Skip to content

Output diagnostics when SQLFetch with SQL_ERROR #15256

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 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1412,6 +1412,13 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
rc = SQLFetch(result->stmt);

if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
if (rc == SQL_ERROR) {
#ifdef HAVE_SQL_EXTENDED_FETCH
odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch");
#else
odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetch");
#endif
}
RETURN_FALSE;
}

Expand Down Expand Up @@ -1576,6 +1583,13 @@ PHP_FUNCTION(odbc_fetch_into)
rc = SQLFetch(result->stmt);

if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
if (rc == SQL_ERROR) {
#ifdef HAVE_SQL_EXTENDED_FETCH
odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch");
#else
odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetch");
#endif
}
RETURN_FALSE;
}

Expand Down Expand Up @@ -1703,6 +1717,13 @@ PHP_FUNCTION(odbc_fetch_row)
rc = SQLFetch(result->stmt);

if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
if (rc == SQL_ERROR) {
#ifdef HAVE_SQL_EXTENDED_FETCH
odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch");
#else
odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetch");
#endif
}
RETURN_FALSE;
}

Expand Down Expand Up @@ -1792,6 +1813,13 @@ PHP_FUNCTION(odbc_result)
rc = SQLFetch(result->stmt);

if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) {
if (rc == SQL_ERROR) {
#ifdef HAVE_SQL_EXTENDED_FETCH
odbc_sql_error(result->conn_ptr, result->stmt, "SQLExtendedFetch");
#else
odbc_sql_error(result->conn_ptr, result->stmt, "SQLFetch");
#endif
}
RETURN_FALSE;
}

Expand Down
Loading