From e6df22c5d75ee27fb040d6f56eb8d4cb22cad330 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Wed, 15 Mar 2023 20:42:42 +0000 Subject: [PATCH] pgsql_insert fix unit tests --- UPGRADING | 1 + ext/pgsql/pgsql.c | 2 +- ext/pgsql/tests/pg_insert_002.phpt | 5 ++--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UPGRADING b/UPGRADING index c20a815a0bb2a..210215c3fab7e 100644 --- a/UPGRADING +++ b/UPGRADING @@ -100,6 +100,7 @@ PHP 8.3 UPGRADE NOTES - PGSQL: . pg_fetch_object now raises a ValueError instead of an Exception when the constructor_args argument is non empty with the class not having constructor. + . pg_insert now raises a ValueError instead of a WARNING when the table specified is invalid. - Standard: . E_NOTICEs emitted by unserialized() have been promoted to E_WARNING. diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 944f0d14fae3d..5112a37d58be8 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -4138,7 +4138,7 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string tmp_name = php_strtok_r(src, ".", &tmp_name2); if (!tmp_name) { efree(src); - zend_argument_value_error(2, "The table name must be specified (%s)", ZSTR_VAL(table_name)); + zend_argument_value_error(2, "must be specified (%s)", ZSTR_VAL(table_name)); return FAILURE; } if (!tmp_name2 || !*tmp_name2) { diff --git a/ext/pgsql/tests/pg_insert_002.phpt b/ext/pgsql/tests/pg_insert_002.phpt index 11e9b32d2ed9a..19537e8a5d5d1 100644 --- a/ext/pgsql/tests/pg_insert_002.phpt +++ b/ext/pgsql/tests/pg_insert_002.phpt @@ -22,7 +22,6 @@ foreach (array('', '.', '..') as $table) { Done --EXPECTF-- pg_insert(): Argument #2 ($table_name) cannot be empty - -pg_insert(): The table name must be specified (.) -pg_insert(): The table name must be specified (..) +pg_insert(): Argument #2 ($table_name) must be specified (.) +pg_insert(): Argument #2 ($table_name) must be specified (..) Done