From 089f028cc8fc9c09e23fd5986533521560c0e4cd Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Thu, 24 Sep 2020 10:30:41 +0200 Subject: [PATCH] Fix #78470: odbc_specialcolumns() no longer accepts $nullable It is mandatory to pass either `SQL_NO_NULLS` or `SQL_NULLABLE` as tenth parameter to `SQLSpecialColumns()`; otherwise the function call fails. Therefore the user must be allowed to pass the desired value as parameter to `odbc_specialcolumns()` again. --- ext/odbc/php_odbc.c | 2 +- ext/odbc/tests/bug78470.phpt | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 ext/odbc/tests/bug78470.phpt diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 4ba9aa2d74b32..c2d1a8f846f92 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -3668,7 +3668,7 @@ PHP_FUNCTION(odbc_specialcolumns) SQLUSMALLINT type, scope, nullable; RETCODE rc; - if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssl", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rls!ssll", &pv_conn, &vtype, &cat, &cat_len, &schema, &schema_len, &name, &name_len, &vscope, &vnullable) == FAILURE) { return; } diff --git a/ext/odbc/tests/bug78470.phpt b/ext/odbc/tests/bug78470.phpt new file mode 100644 index 0000000000000..6910f9bbd10e3 --- /dev/null +++ b/ext/odbc/tests/bug78470.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #78470 (odbc_specialcolumns() no longer accepts $nullable) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +resource(%d) of type (odbc result)