Skip to content

Promote warning to Error in ODBC extension #6123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Sep 13, 2020

ODBC really ought to have more tests

@cmb69
Copy link
Member

cmb69 commented Sep 13, 2020

To fix the compile error on Windows:

 ext/odbc/php_odbc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index f3f7b19109..2d30ae4816 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -1248,7 +1248,7 @@ PHP_FUNCTION(odbc_data_source)
 
 	if (!(fetch_type == SQL_FETCH_FIRST || fetch_type == SQL_FETCH_NEXT)) {
 		zend_argument_value_error(2, "must be SQL_FETCH_FIRST or SQL_FETCH_NEXT");
-		RETURN_THROWS()
+		RETURN_THROWS();
 	}
 
 	if (!(conn = (odbc_connection *)zend_fetch_resource2(Z_RES_P(zv_conn), "ODBC-Link", le_conn, le_pconn))) {

@Girgias Girgias force-pushed the odbc-warning-to-error branch from 91168d7 to 66232da Compare September 13, 2020 13:31
@@ -787,6 +787,11 @@ void odbc_column_lengths(INTERNAL_FUNCTION_PARAMETERS, int type)
RETURN_THROWS();
}

if (pv_num < 1) {
zend_argument_value_error(2, "must be greater than or equal to 1");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zend_argument_value_error(2, "must be greater than or equal to 1");
zend_argument_value_error(2, "must be greater than 0");

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same below

@Girgias Girgias force-pushed the odbc-warning-to-error branch from 66232da to 2e5bc1e Compare September 14, 2020 16:48
@@ -1246,8 +1247,8 @@ PHP_FUNCTION(odbc_data_source)
fetch_type = (SQLSMALLINT) zv_fetch_type;

if (!(fetch_type == SQL_FETCH_FIRST || fetch_type == SQL_FETCH_NEXT)) {
php_error_docref(NULL, E_WARNING, "Invalid fetch type (%d)", fetch_type);
RETURN_FALSE;
zend_argument_value_error(2, "must either be SQL_FETCH_FIRST or SQL_FETCH_NEXT");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zend_argument_value_error(2, "must either be SQL_FETCH_FIRST or SQL_FETCH_NEXT");
zend_argument_value_error(2, "must be either SQL_FETCH_FIRST or SQL_FETCH_NEXT");

@php-pulls php-pulls closed this in c1823c6 Sep 15, 2020
@Girgias Girgias deleted the odbc-warning-to-error branch September 15, 2020 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants