Skip to content
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

Convert odbc_bindcols() function to void #13900

Merged
merged 1 commit into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
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
78 changes: 16 additions & 62 deletions ext/odbc/php_odbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ void php_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode)
/* }}} */

/* {{{ odbc_bindcols */
int odbc_bindcols(odbc_result *result)
void odbc_bindcols(odbc_result *result)
{
RETCODE rc;
int i;
Expand Down Expand Up @@ -645,7 +645,6 @@ int odbc_bindcols(odbc_result *result)
break;
}
}
return 1;
}
/* }}} */

Expand Down Expand Up @@ -855,10 +854,7 @@ PHP_FUNCTION(odbc_prepare)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -1057,10 +1053,7 @@ PHP_FUNCTION(odbc_execute)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -1253,10 +1246,7 @@ PHP_FUNCTION(odbc_exec)

/* For insert, update etc. cols == 0 */
if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -2383,10 +2373,7 @@ PHP_FUNCTION(odbc_next_result)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETVAL_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -2752,10 +2739,7 @@ PHP_FUNCTION(odbc_tables)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -2822,10 +2806,7 @@ PHP_FUNCTION(odbc_columns)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -2886,10 +2867,7 @@ PHP_FUNCTION(odbc_columnprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -2965,10 +2943,7 @@ PHP_FUNCTION(odbc_foreignkeys)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3026,10 +3001,7 @@ PHP_FUNCTION(odbc_gettypeinfo)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3087,10 +3059,7 @@ PHP_FUNCTION(odbc_primarykeys)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3151,10 +3120,7 @@ PHP_FUNCTION(odbc_procedurecolumns)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3214,10 +3180,7 @@ PHP_FUNCTION(odbc_procedures)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3285,10 +3248,7 @@ PHP_FUNCTION(odbc_specialcolumns)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3354,10 +3314,7 @@ PHP_FUNCTION(odbc_statistics)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down Expand Up @@ -3416,10 +3373,7 @@ PHP_FUNCTION(odbc_tableprivileges)
SQLNumResultCols(result->stmt, &(result->numcols));

if (result->numcols > 0) {
if (!odbc_bindcols(result)) {
efree(result);
RETURN_FALSE;
}
odbc_bindcols(result);
} else {
result->values = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/odbc/php_odbc_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void odbc_del_result(HashTable *list, int count);
int odbc_add_conn(HashTable *list, HDBC conn);
odbc_connection *odbc_get_conn(HashTable *list, int count);
void odbc_del_conn(HashTable *list, int ind);
int odbc_bindcols(odbc_result *result);
void odbc_bindcols(odbc_result *result);

#define ODBC_SQL_ERROR_PARAMS odbc_connection *conn_resource, ODBC_SQL_STMT_T stmt, char *func

Expand Down
Loading