From: Felipe Pena Date: Thu, 14 May 2009 01:25:17 +0000 (+0000) Subject: - Fixed bug #42414 (some odbc_*() functions incompatible with Oracle ODBC driver) X-Git-Tag: php-5.4.0alpha1~191^2~3671 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c71b5e616fd6cbff78b5a2826eb14f35b1322792;p=php - Fixed bug #42414 (some odbc_*() functions incompatible with Oracle ODBC driver) --- diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index eafa548386..d54a46fb61 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -3122,6 +3122,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, @@ -3184,6 +3188,10 @@ PHP_FUNCTION(odbc_columnprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLColumnPrivileges(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3260,6 +3268,10 @@ PHP_FUNCTION(odbc_foreignkeys) efree(result); RETURN_FALSE; } + + if (pcat_len == 0) { + pcat = NULL; + } rc = SQLForeignKeys(result->stmt, pcat, SAFE_SQL_NTS(pcat), @@ -3385,6 +3397,10 @@ PHP_FUNCTION(odbc_primarykeys) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLPrimaryKeys(result->stmt, cat, SAFE_SQL_NTS(cat), schema, SAFE_SQL_NTS(schema), table, SAFE_SQL_NTS(table) ); @@ -3583,6 +3599,10 @@ PHP_FUNCTION(odbc_specialcolumns) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLSpecialColumns(result->stmt, type, @@ -3652,6 +3672,10 @@ PHP_FUNCTION(odbc_statistics) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLStatistics(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3715,6 +3739,10 @@ PHP_FUNCTION(odbc_tableprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLTablePrivileges(result->stmt, cat, SAFE_SQL_NTS(cat),