summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-24 10:30:41 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-24 12:15:59 +0200
commit610e7d2c77f7af3cc69399e0fdcca0d99300e2ce (patch)
treee9b4093db7724588653fa06e7d82260e928c2657
parent2576c57a5133df757c51f341e794bf53add7663f (diff)
downloadphp-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.
-rw-r--r--NEWS3
-rw-r--r--ext/odbc/php_odbc.c2
-rw-r--r--ext/odbc/tests/bug78470.phpt15
3 files changed, 19 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6d8ed53499..35a928af07 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,9 @@ PHP NEWS
. Fixed bug #80107 (mysqli_query() fails for ~16 MB long query when
compression is enabled). (Nikita)
+- ODBC:
+ . Fixed bug #78470 (odbc_specialcolumns() no longer accepts $nullable). (cmb)
+
- OPcache:
. Fixed bug #80083 (Optimizer pass 6 removes variables used for ibm_db2 data
binding). (Nikita)
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)