From 8600c1b4dad9479730cb5e00e7904a1fdb2e87b2 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Tue, 17 Aug 2010 15:37:44 +0000 Subject: [PATCH] Deprecate mysql_list_dbs, as mysql_list_tables is already deprecated. As well as mysql_list --- ext/mysql/php_mysql.c | 2 ++ ext/mysql/tests/mysql_db_name.phpt | 2 ++ ext/mysql/tests/mysql_list_dbs.phpt | 3 +++ 3 files changed, 7 insertions(+) diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index 85831b7371..1f2762b191 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -1575,11 +1575,13 @@ PHP_FUNCTION(mysql_list_dbs) id = php_mysql_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); CHECK_LINK(id); } + php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "This function is deprecated; use mysql_query() with SHOW DATABASES instead"); ZEND_FETCH_RESOURCE2(mysql, php_mysql_conn *, &mysql_link, id, "MySQL-Link", le_link, le_plink); PHPMY_UNBUFFERED_QUERY_CHECK(); + if ((mysql_result=mysql_list_dbs(mysql->conn, NULL))==NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to save MySQL query result"); RETURN_FALSE; diff --git a/ext/mysql/tests/mysql_db_name.phpt b/ext/mysql/tests/mysql_db_name.phpt index be4f604d9c..e241bc0d9a 100644 --- a/ext/mysql/tests/mysql_db_name.phpt +++ b/ext/mysql/tests/mysql_db_name.phpt @@ -58,6 +58,8 @@ mysql_close($link); print "done!\n"; ?> --EXPECTF-- +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d + Warning: mysql_db_name(): Unable to jump to row -1 on MySQL result index %d in %s on line %d Warning: mysql_db_name(): Unable to jump to row %d on MySQL result index %d in %s on line %d diff --git a/ext/mysql/tests/mysql_list_dbs.phpt b/ext/mysql/tests/mysql_list_dbs.phpt index 3e12ce5501..e0850d5a54 100644 --- a/ext/mysql/tests/mysql_list_dbs.phpt +++ b/ext/mysql/tests/mysql_list_dbs.phpt @@ -51,4 +51,7 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d + +Deprecated: mysql_list_dbs(): This function is deprecated; use mysql_query() with SHOW DATABASES instead in %s on line %d done! -- 2.49.0