-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Conversation
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))) { |
91168d7
to
66232da
Compare
ext/odbc/php_odbc.c
Outdated
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zend_argument_value_error(2, "must be greater than or equal to 1"); | |
zend_argument_value_error(2, "must be greater than 0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same below
66232da
to
2e5bc1e
Compare
@@ -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"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"); |
ODBC really ought to have more tests