summaryrefslogtreecommitdiff
path: root/ext/mysql
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-08-17 15:37:44 (GMT)
committerAndrey Hristov <andrey@php.net>2010-08-17 15:37:44 (GMT)
commit8600c1b4dad9479730cb5e00e7904a1fdb2e87b2 (patch)
treee3860f38ee5d12fab6112ffdd64a4fcfad89364d /ext/mysql
parent0655d34070f47e99f34e74611d5a6fff250e610a (diff)
downloadphp-8600c1b4dad9479730cb5e00e7904a1fdb2e87b2.tar.gz
Deprecate mysql_list_dbs, as mysql_list_tables is already deprecated.
As well as mysql_list
Diffstat (limited to 'ext/mysql')
-rw-r--r--ext/mysql/php_mysql.c2
-rw-r--r--ext/mysql/tests/mysql_db_name.phpt2
-rw-r--r--ext/mysql/tests/mysql_list_dbs.phpt3
3 files changed, 7 insertions, 0 deletions
diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c
index 85831b7..1f2762b 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 be4f604..e241bc0 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 3e12ce5..e0850d5 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!