1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

php_pgsql_meta_data raises a ValueError when table name is invalid.

This commit is contained in:
David Carlier
2023-03-13 20:16:33 +00:00
parent 0ce755be26
commit 394470c052
2 changed files with 3 additions and 7 deletions

View File

@@ -4137,9 +4137,8 @@ PHP_PGSQL_API zend_result php_pgsql_meta_data(PGconn *pg_link, const zend_string
src = estrdup(ZSTR_VAL(table_name));
tmp_name = php_strtok_r(src, ".", &tmp_name2);
if (!tmp_name) {
// TODO ValueError (empty table name)?
efree(src);
php_error_docref(NULL, E_WARNING, "The table name must be specified");
zend_argument_value_error(2, "The table name must be specified (%s)", ZSTR_VAL(table_name));
return FAILURE;
}
if (!tmp_name2 || !*tmp_name2) {

View File

@@ -23,9 +23,6 @@ Done
--EXPECTF--
pg_insert(): Argument #2 ($table_name) cannot be empty
Warning: pg_insert(): The table name must be specified in %s on line %d
bool(false)
Warning: pg_insert(): The table name must be specified in %s on line %d
bool(false)
pg_insert(): The table name must be specified (.)
pg_insert(): The table name must be specified (..)
Done