summaryrefslogtreecommitdiff
path: root/ext/odbc
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-09-24 12:23:08 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2020-09-24 12:23:37 +0200
commit555e7eccc4f2391046b76caeb8219904f092f843 (patch)
treec6e1b10e03e8483fe66d073ee4d5eb61bb68d7fc /ext/odbc
parentc25b5c64d17f17d8af195747363586f360c2c6b3 (diff)
parent901d02200152492d6292b418bb35e80084d5d140 (diff)
downloadphp-git-555e7eccc4f2391046b76caeb8219904f092f843.tar.gz
Merge branch 'PHP-7.4' into master
* PHP-7.4: Fix #78470: odbc_specialcolumns() no longer accepts $nullable
Diffstat (limited to 'ext/odbc')
-rw-r--r--ext/odbc/odbc.stub.php2
-rw-r--r--ext/odbc/odbc_arginfo.h5
-rw-r--r--ext/odbc/php_odbc.c2
-rw-r--r--ext/odbc/tests/bug78470.phpt15
4 files changed, 20 insertions, 4 deletions
diff --git a/ext/odbc/odbc.stub.php b/ext/odbc/odbc.stub.php
index 9316f1d7e4..36d8ad6dc7 100644
--- a/ext/odbc/odbc.stub.php
+++ b/ext/odbc/odbc.stub.php
@@ -174,7 +174,7 @@ function odbc_foreignkeys($connection_id, ?string $pk_qualifier, string $pk_owne
* @param resource $connection_id
* @return resource|false
*/
-function odbc_specialcolumns($connection_id, int $type, ?string $qualifier, string $owner, string $table, int $scope) {}
+function odbc_specialcolumns($connection_id, int $type, ?string $qualifier, string $owner, string $table, int $scope, int $nullable) {}
/**
* @param resource $connection_id
diff --git a/ext/odbc/odbc_arginfo.h b/ext/odbc/odbc_arginfo.h
index 7d42c63530..738bd44886 100644
--- a/ext/odbc/odbc_arginfo.h
+++ b/ext/odbc/odbc_arginfo.h
@@ -1,5 +1,5 @@
/* This is a generated file, edit the .stub.php file instead.
- * Stub hash: 57db79b23d127851f985d9b6280b113637384a68 */
+ * Stub hash: b533372de4f1110216b2545121d7851022980650 */
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_odbc_close_all, 0, 0, IS_VOID, 0)
ZEND_END_ARG_INFO()
@@ -211,13 +211,14 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_foreignkeys, 0, 0, 7)
ZEND_END_ARG_INFO()
#endif
-ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_specialcolumns, 0, 0, 6)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_specialcolumns, 0, 0, 7)
ZEND_ARG_INFO(0, connection_id)
ZEND_ARG_TYPE_INFO(0, type, IS_LONG, 0)
ZEND_ARG_TYPE_INFO(0, qualifier, IS_STRING, 1)
ZEND_ARG_TYPE_INFO(0, owner, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, scope, IS_LONG, 0)
+ ZEND_ARG_TYPE_INFO(0, nullable, IS_LONG, 0)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_odbc_statistics, 0, 0, 6)
diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c
index 6636a81043..0cfa52be44 100644
--- a/ext/odbc/php_odbc.c
+++ b/ext/odbc/php_odbc.c
@@ -3298,7 +3298,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_THROWS();
}
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)