From: Antony Dovgal Date: Tue, 18 Jan 2005 15:11:22 +0000 (+0000) Subject: MFH: fix bug #30430 (odbc_next_result() doesn't bind values and that results in segfault) X-Git-Tag: php-4.3.11RC1~143 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=744713745311fea40c5f9d96d6f6b195894e0185;p=php MFH: fix bug #30430 (odbc_next_result() doesn't bind values and that results in segfault) fix protos --- diff --git a/NEWS b/NEWS index 51b0b15342..f442ecc92b 100644 --- a/NEWS +++ b/NEWS @@ -30,6 +30,8 @@ PHP 4 NEWS path of the request URI). (kameshj at fastmail dot fm) - Fixed bug #30726 (-.1 like numbers are not being handled correctly). (Ilia) - Fixed bug #30446 (apache2handler: virtual() includes files out of sequence) +- Fixed bug #30430 (odbc_next_result() doesn't bind values and that results + in segfault). (pdan-php at esync dot org, Tony) - Fixed bug #30120 (imagettftext() and imagettfbbox() accept too many parameters). (Jani) - Fixed bug #28930 (PHP sources pick wrong header files generated by bison). diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index e435fcf87f..a053e99f45 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2422,10 +2422,7 @@ PHP_FUNCTION(odbc_next_result) result->fetched = 0; rc = SQLMoreResults(result->stmt); - if (rc == SQL_SUCCESS) { - RETURN_TRUE; - } - else if (rc == SQL_SUCCESS_WITH_INFO) { + if (rc == SQL_SUCCESS_WITH_INFO || rc == SQL_SUCCESS) { rc = SQLFreeStmt(result->stmt, SQL_UNBIND); SQLNumParams(result->stmt, &(result->numparams)); SQLNumResultCols(result->stmt, &(result->numcols)); @@ -2766,7 +2763,7 @@ PHP_FUNCTION(odbc_setoption) * metadata functions */ -/* {{{ proto resource odbc_tables(resource connection_id [, string qualifier, string owner, string name, string table_types]) +/* {{{ proto resource odbc_tables(resource connection_id [, string qualifier [, string owner [, string name [, string table_types]]]]) Call the SQLTables function */ PHP_FUNCTION(odbc_tables) { @@ -2845,7 +2842,7 @@ PHP_FUNCTION(odbc_tables) } /* }}} */ -/* {{{ proto resource odbc_columns(resource connection_id, string qualifier, string owner, string table_name, string column_name) +/* {{{ proto resource odbc_columns(resource connection_id [, string qualifier [, string owner [, string table_name [, string column_name]]]]) Returns a result identifier that can be used to fetch a list of column names in specified tables */ PHP_FUNCTION(odbc_columns) {