From: Felipe Pena Date: Thu, 14 May 2009 01:27:23 +0000 (+0000) Subject: MFH: X-Git-Tag: php-5.2.10RC1~93 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=913c81d4ad511c0d901bd1b71e4246c444aa94e2;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 64d2ffea4a..6a747cbd90 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2994,6 +2994,10 @@ PHP_FUNCTION(odbc_columns) */ if (table && strlen(table) && schema && !strlen(schema)) schema = NULL; + if (cat && cat_len == 0) { + cat = NULL; + } + rc = SQLColumns(result->stmt, cat, cat_len, schema, schema_len, @@ -3068,6 +3072,10 @@ PHP_FUNCTION(odbc_columnprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLColumnPrivileges(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3162,6 +3170,10 @@ PHP_FUNCTION(odbc_foreignkeys) efree(result); RETURN_FALSE; } + + if (pcat_len == 0) { + pcat = NULL; + } rc = SQLForeignKeys(result->stmt, pcat, SAFE_SQL_NTS(pcat), @@ -3305,6 +3317,10 @@ PHP_FUNCTION(odbc_primarykeys) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLPrimaryKeys(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3543,6 +3559,10 @@ PHP_FUNCTION(odbc_specialcolumns) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLSpecialColumns(result->stmt, type, @@ -3624,6 +3644,10 @@ PHP_FUNCTION(odbc_statistics) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLStatistics(result->stmt, cat, SAFE_SQL_NTS(cat), @@ -3698,6 +3722,10 @@ PHP_FUNCTION(odbc_tableprivileges) efree(result); RETURN_FALSE; } + + if (cat_len == 0) { + cat = NULL; + } rc = SQLTablePrivileges(result->stmt, cat, SAFE_SQL_NTS(cat),