@@ -4261,6 +4261,7 @@ PHP_FUNCTION(pg_flush)
4261
4261
/* }}} */
4262
4262
4263
4263
/* {{{ php_pgsql_meta_data
4264
+ * table_name must not be empty
4264
4265
* TODO: Add meta_data cache for better performance
4265
4266
*/
4266
4267
PHP_PGSQL_API int php_pgsql_meta_data (PGconn * pg_link , const char * table_name , zval * meta , zend_bool extended )
@@ -4273,11 +4274,7 @@ PHP_PGSQL_API int php_pgsql_meta_data(PGconn *pg_link, const char *table_name, z
4273
4274
int i , num_rows ;
4274
4275
zval elem ;
4275
4276
4276
- if (!* table_name ) {
4277
- // CHeck if can be TODO
4278
- php_error_docref (NULL , E_WARNING , "The table name must be specified" );
4279
- return FAILURE ;
4280
- }
4277
+ ZEND_ASSERT (* table_name );
4281
4278
4282
4279
src = estrdup (table_name );
4283
4280
tmp_name = php_strtok_r (src , "." , & tmp_name2 );
@@ -4393,7 +4390,7 @@ PHP_FUNCTION(pg_meta_data)
4393
4390
RETURN_THROWS ();
4394
4391
}
4395
4392
4396
- /* php_pgsql_meta_data() warns on empty table_name */
4393
+ /* php_pgsql_meta_data() asserts that table_name is not empty */
4397
4394
if (table_name_len == 0 ) {
4398
4395
zend_argument_value_error (2 , "cannot be empty" );
4399
4396
RETURN_THROWS ();
@@ -4604,6 +4601,8 @@ PHP_PGSQL_API int php_pgsql_convert(PGconn *pg_link, const char *table_name, con
4604
4601
ZEND_ASSERT (Z_TYPE_P (result ) == IS_ARRAY );
4605
4602
ZEND_ASSERT (!(opt & ~PGSQL_CONV_OPTS ));
4606
4603
ZEND_ASSERT (table_name );
4604
+ /* Table name cannot be empty for php_pgsql_meta_data() */
4605
+ ZEND_ASSERT (* table_name );
4607
4606
4608
4607
array_init (& meta );
4609
4608
/* table_name is escaped by php_pgsql_meta_data */
0 commit comments