From: Felipe Pena Date: Thu, 14 May 2009 01:26:39 +0000 (+0000) Subject: MFH: X-Git-Tag: php-5.3.0RC3~269 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=652b77243cd72617d04af9c3e8f1a20cb0ac0ae8;p=php MFH: - Fixed bug #42414 (some odbc_*() functions incompatible with Oracle ODBC driver) patch by: jhml at gmx dot net --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index dc349bf413..331acdcf62 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -3127,6 +3127,10 @@ PHP_FUNCTION(odbc_columns) schema = NULL; } + if (cat && cat_len == 0) { + cat = NULL; + } + rc = SQLColumns(result->stmt, cat, (SQLSMALLINT) cat_len, schema, (SQLSMALLINT) schema_len, @@ -3189,6 +3193,10 @@ PHP_FUNCTION(odbc_columnprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLColumnPrivileges(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3265,6 +3273,10 @@ PHP_FUNCTION(odbc_foreignkeys) efree(result); RETURN_FALSE; } + + if (pcat_len == 0) { + pcat = NULL; + } rc = SQLForeignKeys(result->stmt, pcat, SAFE_SQL_NTS(pcat), @@ -3388,6 +3400,10 @@ PHP_FUNCTION(odbc_primarykeys) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLPrimaryKeys(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3589,6 +3605,10 @@ PHP_FUNCTION(odbc_specialcolumns) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLSpecialColumns(result->stmt, type, @@ -3658,6 +3678,10 @@ PHP_FUNCTION(odbc_statistics) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLStatistics(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3721,6 +3745,10 @@ PHP_FUNCTION(odbc_tableprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLTablePrivileges(result->stmt, cat, SAFE_SQL_NTS(cat),