diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-24 10:30:41 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-09-24 12:15:59 +0200 |
commit | 610e7d2c77f7af3cc69399e0fdcca0d99300e2ce (patch) | |
tree | e9b4093db7724588653fa06e7d82260e928c2657 /ext/odbc | |
parent | 2576c57a5133df757c51f341e794bf53add7663f (diff) | |
download | php-git-610e7d2c77f7af3cc69399e0fdcca0d99300e2ce.tar.gz |
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.
Closes GH-6200.
Diffstat (limited to 'ext/odbc')
-rw-r--r-- | ext/odbc/php_odbc.c | 2 | ||||
-rw-r--r-- | ext/odbc/tests/bug78470.phpt | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 4ba9aa2d74..c2d1a8f846 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 0000000000..6910f9bbd1 --- /dev/null +++ b/ext/odbc/tests/bug78470.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #78470 (odbc_specialcolumns() no longer accepts $nullable) +--SKIPIF-- +<?php +if (!extension_loaded('odbc')) die('skip odbc extension not available'); +?> +--FILE-- +<?php +include 'config.inc'; + +$conn = odbc_connect($dsn, $user, $pass); +var_dump(odbc_specialcolumns($conn, SQL_BEST_ROWID, '', '', '', SQL_SCOPE_CURROW, SQL_NO_NULLS)); +?> +--EXPECTF-- +resource(%d) of type (odbc result) |