com php-src: dirty hack adding myslqnd.use_fetch_buffer option: ext/mysql/tests/001.phpt ext/mysql/tes ts/002.phpt ext/mysql/tests/003.phpt ext/my
sql/tests/bug47438.phpt ext/mysql/tests/bug48 754.phpt ext/mysql/tests/bug51242.phpt ext/mysql/tests/bug53649.phpt ext/mysql/tests/bug 55473.phpt
ext/mysql/tests/connect.inc ext/my sql/tests/mysql_affected_rows.phpt ext/mysql/tests/mysq l_client_encoding.phpt ext/mysql/tests/mysql_close. phpt
ext/mysql/tests/
| From: | Antony Dovgal | Date: | Thu, 06 Feb 2014 19:24:25 +0000 |
| Subject: | com php-src: dirty hack adding myslqnd.use_fetch_buffer option: ext/mysql/tests/001.phpt ext/mysql/tes ts/002.phpt ext/mysql/tests/003.phpt ext/my sql/tests/bug47438.phpt ext/mysql/tests/bug48 754.phpt ext/mysql/tests/bug51242.phpt ext/mysql/tests/bug53649.phpt ext/mysql/tests/bug 55473.phpt ext/mysql/tests/connect.inc ext/my sql/tests/mysql_affected_rows.phpt ext/mysql/tests/mysq l_client_encoding.phpt ext/mysql/tests/mysql_close. phpt ext/mysql/tests/ |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-76620@lists.php.net to get a copy of this message | ||
Commit: 4d3a370ab0423c934eafa835d83c02ebf7423459
Author: Antony Dovgal <tony2001@php.net> Thu, 6 Feb 2014 23:24:25 +0400
Parents: 7dcf8765f1c18862e25422930a69c09aa8ff6c48
Branches: badoo-5.5_mysqlnd
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4d3a370ab0423c934eafa835d83c02ebf7423459
Log:
dirty hack adding myslqnd.use_fetch_buffer option
and also fixing tests, cause we'ver removed the deprecation warning long
ago
Changed paths:
M ext/mysql/tests/001.phpt
M ext/mysql/tests/002.phpt
M ext/mysql/tests/003.phpt
M ext/mysql/tests/bug47438.phpt
M ext/mysql/tests/bug48754.phpt
M ext/mysql/tests/bug51242.phpt
M ext/mysql/tests/bug53649.phpt
M ext/mysql/tests/bug55473.phpt
M ext/mysql/tests/connect.inc
M ext/mysql/tests/mysql_affected_rows.phpt
M ext/mysql/tests/mysql_client_encoding.phpt
M ext/mysql/tests/mysql_close.phpt
M ext/mysql/tests/mysql_connect.phpt
M ext/mysql/tests/mysql_constants.phpt
M ext/mysql/tests/mysql_create_db.phpt
M ext/mysql/tests/mysql_data_seek.phpt
M ext/mysql/tests/mysql_db_name.phpt
M ext/mysql/tests/mysql_db_query.phpt
M ext/mysql/tests/mysql_deprecated_api.phpt
M ext/mysql/tests/mysql_drop_db.phpt
M ext/mysql/tests/mysql_errno.phpt
M ext/mysql/tests/mysql_error.phpt
M ext/mysql/tests/mysql_fetch_array.phpt
M ext/mysql/tests/mysql_fetch_assoc.phpt
M ext/mysql/tests/mysql_fetch_field.phpt
M ext/mysql/tests/mysql_fetch_lengths.phpt
M ext/mysql/tests/mysql_fetch_object.phpt
M ext/mysql/tests/mysql_fetch_row.phpt
M ext/mysql/tests/mysql_field_flags.phpt
M ext/mysql/tests/mysql_field_len.phpt
M ext/mysql/tests/mysql_field_name.phpt
M ext/mysql/tests/mysql_field_seek.phpt
M ext/mysql/tests/mysql_field_table.phpt
M ext/mysql/tests/mysql_field_type.phpt
M ext/mysql/tests/mysql_free_result.phpt
M ext/mysql/tests/mysql_get_client_info.phpt
M ext/mysql/tests/mysql_get_host_info.phpt
M ext/mysql/tests/mysql_get_proto_info.phpt
M ext/mysql/tests/mysql_get_server_info.phpt
M ext/mysql/tests/mysql_info.phpt
M ext/mysql/tests/mysql_insert_id.phpt
M ext/mysql/tests/mysql_list_dbs.phpt
M ext/mysql/tests/mysql_list_fields.phpt
M ext/mysql/tests/mysql_list_processes.phpt
M ext/mysql/tests/mysql_list_tables.phpt
M ext/mysql/tests/mysql_max_links.phpt
M ext/mysql/tests/mysql_max_persistent.phpt
M ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt
M ext/mysql/tests/mysql_num_fields.phpt
M ext/mysql/tests/mysql_num_rows.phpt
M ext/mysql/tests/mysql_pconn_disable.phpt
M ext/mysql/tests/mysql_pconn_kill.phpt
M ext/mysql/tests/mysql_pconn_max_links.phpt
M ext/mysql/tests/mysql_pconn_reuse.phpt
M ext/mysql/tests/mysql_pconnect.phpt
M ext/mysql/tests/mysql_ping.phpt
M ext/mysql/tests/mysql_query.phpt
M ext/mysql/tests/mysql_query_load_data_openbasedir.phpt
M ext/mysql/tests/mysql_real_escape_string.phpt
M ext/mysql/tests/mysql_reflection_extension.phpt
M ext/mysql/tests/mysql_reflection_functions.phpt
M ext/mysql/tests/mysql_result.phpt
M ext/mysql/tests/mysql_select_db..phpt
M ext/mysql/tests/mysql_set_charset.phpt
M ext/mysql/tests/mysql_sql_safe_mode.phpt
M ext/mysql/tests/mysql_stat.phpt
M ext/mysql/tests/mysql_tablename.phpt
M ext/mysql/tests/mysql_thread_id.phpt
M ext/mysql/tests/mysql_trace_mode.phpt
M ext/mysql/tests/mysql_unbuffered_query.phpt
M ext/mysqlnd/mysqlnd.h
M ext/mysqlnd/mysqlnd_result.c
M ext/mysqlnd/mysqlnd_structs.h
M ext/mysqlnd/mysqlnd_wireprotocol.c
M ext/mysqlnd/mysqlnd_wireprotocol.h
M ext/mysqlnd/php_mysqlnd.c
diff --git a/ext/mysql/tests/001.phpt b/ext/mysql/tests/001.phpt index 8782fd1..e9ac45c 100644 --- a/ext/mysql/tests/001.phpt +++ b/ext/mysql/tests/001.phpt @@ -29,8 +29,6 @@ var_dump($test); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(2) "11" done! diff --git a/ext/mysql/tests/002.phpt b/ext/mysql/tests/002.phpt index 8f53f4d..8355c5f 100644 --- a/ext/mysql/tests/002.phpt +++ b/ext/mysql/tests/002.phpt @@ -37,7 +37,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link) bool(true) bool(true) diff --git a/ext/mysql/tests/003.phpt b/ext/mysql/tests/003.phpt index 365abc2..2d0b68b 100644 --- a/ext/mysql/tests/003.phpt +++ b/ext/mysql/tests/003.phpt @@ -57,7 +57,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d ==stdClass== object(stdClass)#%d (1) { [%u|b%"a"]=> diff --git a/ext/mysql/tests/bug47438.phpt b/ext/mysql/tests/bug47438.phpt index fa7b3e6..2ddb757 100644 --- a/ext/mysql/tests/bug47438.phpt +++ b/ext/mysql/tests/bug47438.phpt @@ -47,7 +47,6 @@ if (!mysql_select_db($db, $link) || mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d 0.a 1.b 2.c diff --git a/ext/mysql/tests/bug48754.phpt b/ext/mysql/tests/bug48754.phpt index b461db3..fb322f4 100644 --- a/ext/mysql/tests/bug48754.phpt +++ b/ext/mysql/tests/bug48754.phpt @@ -68,8 +68,6 @@ var_dump($link); ?> --EXPECTF-- Explicit connection on close - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Expect same thread id for $link and default conn: bool(true) resource(%d) of type (mysql link) resource(%d) of type (Unknown) @@ -77,24 +75,18 @@ resource(%d) of type (Unknown) Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d Closing default link - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Expect same thread id for $link and default conn but not the previous: bool(true) resource(%d) of type (mysql link) resource(%d) of type (mysql link) resource(%d) of type (Unknown) Explicit resource and pconnect - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link persistent) resource(%d) of type (Unknown) Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d Default link and pconnect - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link persistent) resource(%d) of type (mysql link persistent) resource(%d) of type (Unknown) diff --git a/ext/mysql/tests/bug51242.phpt b/ext/mysql/tests/bug51242.phpt index 6801d30..9b62cdb 100644 --- a/ext/mysql/tests/bug51242.phpt +++ b/ext/mysql/tests/bug51242.phpt @@ -35,5 +35,4 @@ if ($link = my_mysql_connect($host, $user, $passwd, $db, null, $socket)) { } ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link) diff --git a/ext/mysql/tests/bug53649.phpt b/ext/mysql/tests/bug53649.phpt index 7ccdf08..e6068d5 100644 --- a/ext/mysql/tests/bug53649.phpt +++ b/ext/mysql/tests/bug53649.phpt @@ -68,5 +68,4 @@ mysql_close($link); unlink('bug53649.data'); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done diff --git a/ext/mysql/tests/bug55473.phpt b/ext/mysql/tests/bug55473.phpt index 98fd009..5e20024 100644 --- a/ext/mysql/tests/bug55473.phpt +++ b/ext/mysql/tests/bug55473.phpt @@ -2,6 +2,7 @@ Bug #5547 (mysql_pconnect leaks file descriptors on reconnect) --SKIPIF-- <?php +die("skip"); require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (defined('PHP_WINDOWS_VERSION_MAJOR')) { @@ -68,29 +69,24 @@ mysql.allow_persistent=1 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 0 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] Setting openened files... Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 1 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 2 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 3 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected done! diff --git a/ext/mysql/tests/connect.inc b/ext/mysql/tests/connect.inc index 0df5bc3..82f4024 100644 --- a/ext/mysql/tests/connect.inc +++ b/ext/mysql/tests/connect.inc @@ -60,7 +60,7 @@ Default values are "localhost", "root", database "test" and empty password. Change the MYSQL_TEST_* environment values if you want to use another configuration. */ -$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost"; +$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "127.0.0.1"; $port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306; $user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root"; $passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : ""; diff --git a/ext/mysql/tests/mysql_affected_rows.phpt b/ext/mysql/tests/mysql_affected_rows.phpt index 2449ac4..145e1f5 100644 --- a/ext/mysql/tests/mysql_affected_rows.phpt +++ b/ext/mysql/tests/mysql_affected_rows.phpt @@ -122,5 +122,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_client_encoding.phpt b/ext/mysql/tests/mysql_client_encoding.phpt index 5b21765..8aa67a0 100644 --- a/ext/mysql/tests/mysql_client_encoding.phpt +++ b/ext/mysql/tests/mysql_client_encoding.phpt @@ -67,5 +67,4 @@ if (false !== ($tmp = @mysql_client_encoding($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_close.phpt b/ext/mysql/tests/mysql_close.phpt index e676511..8f305ba 100644 --- a/ext/mysql/tests/mysql_close.phpt +++ b/ext/mysql/tests/mysql_close.phpt @@ -36,5 +36,4 @@ if (false !== ($tmp = @mysql_query("SELECT 1", $link))) print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_connect.phpt b/ext/mysql/tests/mysql_connect.phpt index 2b73092..90b67c3 100644 --- a/ext/mysql/tests/mysql_connect.phpt +++ b/ext/mysql/tests/mysql_connect.phpt @@ -104,25 +104,7 @@ if (!ini_get('sql.safe_mode')) { print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[001] Expecting NULL, got boolean/ -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +Warning: mysql_connect(): Access denied for user 'rootunknown_really'@'localhost' (using password: YES) (errno: 1045) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_constants.phpt b/ext/mysql/tests/mysql_constants.phpt index e687745..45a7fc3 100644 --- a/ext/mysql/tests/mysql_constants.phpt +++ b/ext/mysql/tests/mysql_constants.phpt @@ -62,5 +62,4 @@ if (!empty($expected_constants)) { print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_create_db.phpt b/ext/mysql/tests/mysql_create_db.phpt index 0b6d58a..838d5e1 100644 --- a/ext/mysql/tests/mysql_create_db.phpt +++ b/ext/mysql/tests/mysql_create_db.phpt @@ -53,7 +53,5 @@ if (!mysql_query("DROP DATABASE IF EXISTS mysqlcreatedb", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_data_seek.phpt b/ext/mysql/tests/mysql_data_seek.phpt index 72d3e63..3518cf3 100644 --- a/ext/mysql/tests/mysql_data_seek.phpt +++ b/ext/mysql/tests/mysql_data_seek.phpt @@ -67,7 +67,6 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_data_seek(): Offset 4 is invalid for MySQL result index %d (or the query data is unbuffered) in %s on line %d diff --git a/ext/mysql/tests/mysql_db_name.phpt b/ext/mysql/tests/mysql_db_name.phpt index 92878e9..6edd8aa 100644 --- a/ext/mysql/tests/mysql_db_name.phpt +++ b/ext/mysql/tests/mysql_db_name.phpt @@ -58,7 +58,6 @@ mysql_close($link); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO 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 diff --git a/ext/mysql/tests/mysql_db_query.phpt b/ext/mysql/tests/mysql_db_query.phpt index 291fbfa..bb837dd 100644 --- a/ext/mysql/tests/mysql_db_query.phpt +++ b/ext/mysql/tests/mysql_db_query.phpt @@ -62,5 +62,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_deprecated_api.phpt b/ext/mysql/tests/mysql_deprecated_api.phpt index ebf7237..5b6c011 100644 --- a/ext/mysql/tests/mysql_deprecated_api.phpt +++ b/ext/mysql/tests/mysql_deprecated_api.phpt @@ -33,7 +33,6 @@ if (version_compare(PHP_VERSION, '5.3.0') >= 0) { } /* - Deprecated since 2002 or the like but documented to be deprecated since 5.3. In 5.3 and before the deprecation message was bound to mysql.trace_mode=1. In 5.3.99 the warning will always be thrown, independent of the mysql.trace_mode setting. @@ -75,5 +74,5 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[006] mysql_escape_string has been deprecated in 5.3.0 done! diff --git a/ext/mysql/tests/mysql_drop_db.phpt b/ext/mysql/tests/mysql_drop_db.phpt index 3281b8a..ef4f5b2 100644 --- a/ext/mysql/tests/mysql_drop_db.phpt +++ b/ext/mysql/tests/mysql_drop_db.phpt @@ -52,5 +52,4 @@ if (!mysql_query("DROP DATABASE IF EXISTS mysqldropdb", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_errno.phpt b/ext/mysql/tests/mysql_errno.phpt index c9c2956..8cfa7bd 100644 --- a/ext/mysql/tests/mysql_errno.phpt +++ b/ext/mysql/tests/mysql_errno.phpt @@ -55,7 +55,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d int(0) int(%d) diff --git a/ext/mysql/tests/mysql_error.phpt b/ext/mysql/tests/mysql_error.phpt index a2cf7e0..85f1751 100644 --- a/ext/mysql/tests/mysql_error.phpt +++ b/ext/mysql/tests/mysql_error.phpt @@ -62,7 +62,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_error(): %d is not a valid MySQL-Link resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_fetch_array.phpt b/ext/mysql/tests/mysql_fetch_array.phpt index 8ccefd0..362cf99 100644 --- a/ext/mysql/tests/mysql_fetch_array.phpt +++ b/ext/mysql/tests/mysql_fetch_array.phpt @@ -281,7 +281,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] array(4) { [0]=> diff --git a/ext/mysql/tests/mysql_fetch_assoc.phpt b/ext/mysql/tests/mysql_fetch_assoc.phpt index 048613a..3c5ca79 100644 --- a/ext/mysql/tests/mysql_fetch_assoc.phpt +++ b/ext/mysql/tests/mysql_fetch_assoc.phpt @@ -63,7 +63,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] array(2) { [%u|b%"id"]=> @@ -88,8 +87,6 @@ array(5) { } Warning: mysql_fetch_assoc(): %d is not a valid MySQL result resource in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [010] array(5) { [%u|b%"id"]=> diff --git a/ext/mysql/tests/mysql_fetch_field.phpt b/ext/mysql/tests/mysql_fetch_field.phpt index 85c1fd6..ef03279 100644 --- a/ext/mysql/tests/mysql_fetch_field.phpt +++ b/ext/mysql/tests/mysql_fetch_field.phpt @@ -156,7 +156,6 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d object(stdClass)#%d (13) { [%u|b%"name"]=> %unicode|string%(2) "ID" diff --git a/ext/mysql/tests/mysql_fetch_lengths.phpt b/ext/mysql/tests/mysql_fetch_lengths.phpt index f0fbbb7..4793e26 100644 --- a/ext/mysql/tests/mysql_fetch_lengths.phpt +++ b/ext/mysql/tests/mysql_fetch_lengths.phpt @@ -39,7 +39,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [0]=> int(1) diff --git a/ext/mysql/tests/mysql_fetch_object.phpt b/ext/mysql/tests/mysql_fetch_object.phpt index 666d0ee..c11631e 100644 --- a/ext/mysql/tests/mysql_fetch_object.phpt +++ b/ext/mysql/tests/mysql_fetch_object.phpt @@ -82,7 +82,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d object(stdClass)#%d (2) { [%u|b%"ID"]=> %unicode|string%(1) "1" diff --git a/ext/mysql/tests/mysql_fetch_row.phpt b/ext/mysql/tests/mysql_fetch_row.phpt index 0ed932e..e5eba39 100644 --- a/ext/mysql/tests/mysql_fetch_row.phpt +++ b/ext/mysql/tests/mysql_fetch_row.phpt @@ -41,7 +41,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [004] array(2) { [0]=> diff --git a/ext/mysql/tests/mysql_field_flags.phpt b/ext/mysql/tests/mysql_field_flags.phpt index 5f8eb09..697955f 100644 --- a/ext/mysql/tests/mysql_field_flags.phpt +++ b/ext/mysql/tests/mysql_field_flags.phpt @@ -144,13 +144,12 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - Warning: mysql_field_flags() expects exactly 2 parameters, 1 given in %s on line %d Warning: mysql_field_flags(): Field -1 is invalid for MySQL result index %d in %s on line %d Warning: mysql_field_flags(): Field 2 is invalid for MySQL result index %d in %s on line %d +[014/label1 TIMESTAMP] Field 'label1', unexpected flags ' unsigned zerofill' found, [0] Warning: mysql_field_flags(): %d is not a valid MySQL result resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_field_len.phpt b/ext/mysql/tests/mysql_field_len.phpt index 119d352..231ab9f 100644 --- a/ext/mysql/tests/mysql_field_len.phpt +++ b/ext/mysql/tests/mysql_field_len.phpt @@ -47,7 +47,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_len() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_name.phpt b/ext/mysql/tests/mysql_field_name.phpt index 85f6c42..4ef020e 100644 --- a/ext/mysql/tests/mysql_field_name.phpt +++ b/ext/mysql/tests/mysql_field_name.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_name() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_seek.phpt b/ext/mysql/tests/mysql_field_seek.phpt index 8487493..54868b2 100644 --- a/ext/mysql/tests/mysql_field_seek.phpt +++ b/ext/mysql/tests/mysql_field_seek.phpt @@ -44,7 +44,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_seek(): Field -1 is invalid for MySQL result index %d in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_field_table.phpt b/ext/mysql/tests/mysql_field_table.phpt index 826651a..c1bd1f0 100644 --- a/ext/mysql/tests/mysql_field_table.phpt +++ b/ext/mysql/tests/mysql_field_table.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_table() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_type.phpt b/ext/mysql/tests/mysql_field_type.phpt index c767cab..db77c90 100644 --- a/ext/mysql/tests/mysql_field_type.phpt +++ b/ext/mysql/tests/mysql_field_type.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_type() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_free_result.phpt b/ext/mysql/tests/mysql_free_result.phpt index 90498bd..fe132d8 100644 --- a/ext/mysql/tests/mysql_free_result.phpt +++ b/ext/mysql/tests/mysql_free_result.phpt @@ -44,7 +44,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) Warning: mysql_free_result(): %d is not a valid MySQL result resource in %s on line %d diff --git a/ext/mysql/tests/mysql_get_client_info.phpt b/ext/mysql/tests/mysql_get_client_info.phpt index 95de0ad..32a7e38 100644 --- a/ext/mysql/tests/mysql_get_client_info.phpt +++ b/ext/mysql/tests/mysql_get_client_info.phpt @@ -20,4 +20,4 @@ if (!is_null($tmp = @mysql_get_client_info("too many arguments"))) { print "done!"; ?> --EXPECTF-- -done! \ No newline at end of file +done! diff --git a/ext/mysql/tests/mysql_get_host_info.phpt b/ext/mysql/tests/mysql_get_host_info.phpt index 4b21ddb..443910c 100644 --- a/ext/mysql/tests/mysql_get_host_info.phpt +++ b/ext/mysql/tests/mysql_get_host_info.phpt @@ -41,5 +41,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_get_proto_info.phpt b/ext/mysql/tests/mysql_get_proto_info.phpt index 3e14811..043fb62 100644 --- a/ext/mysql/tests/mysql_get_proto_info.phpt +++ b/ext/mysql/tests/mysql_get_proto_info.phpt @@ -31,5 +31,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_get_server_info.phpt b/ext/mysql/tests/mysql_get_server_info.phpt index ad192e4..e806335 100644 --- a/ext/mysql/tests/mysql_get_server_info.phpt +++ b/ext/mysql/tests/mysql_get_server_info.phpt @@ -36,5 +36,4 @@ if (NULL !== ($tmp = @mysql_get_server_info('too many', 'just too many'))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_info.phpt b/ext/mysql/tests/mysql_info.phpt index c478679..e53c29f 100644 --- a/ext/mysql/tests/mysql_info.phpt +++ b/ext/mysql/tests/mysql_info.phpt @@ -70,5 +70,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_insert_id.phpt b/ext/mysql/tests/mysql_insert_id.phpt index b69a96a..aaa9b13 100644 --- a/ext/mysql/tests/mysql_insert_id.phpt +++ b/ext/mysql/tests/mysql_insert_id.phpt @@ -66,7 +66,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_insert_id(): %d is not a valid MySQL-Link resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_list_dbs.phpt b/ext/mysql/tests/mysql_list_dbs.phpt index 402161a..ecc9faa 100644 --- a/ext/mysql/tests/mysql_list_dbs.phpt +++ b/ext/mysql/tests/mysql_list_dbs.phpt @@ -51,5 +51,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_list_fields.phpt b/ext/mysql/tests/mysql_list_fields.phpt index 6b6ae9b..335b2d9 100644 --- a/ext/mysql/tests/mysql_list_fields.phpt +++ b/ext/mysql/tests/mysql_list_fields.phpt @@ -64,7 +64,6 @@ if (!mysql_query("DROP TABLE IF EXISTS test2", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [006] [%d] %s bool(false) Field Offset 0 diff --git a/ext/mysql/tests/mysql_list_processes.phpt b/ext/mysql/tests/mysql_list_processes.phpt index 7838a6f..7f5294f 100644 --- a/ext/mysql/tests/mysql_list_processes.phpt +++ b/ext/mysql/tests/mysql_list_processes.phpt @@ -49,5 +49,4 @@ mysql_close($link); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_list_tables.phpt b/ext/mysql/tests/mysql_list_tables.phpt index 3b753ae..cf0b1a6 100644 --- a/ext/mysql/tests/mysql_list_tables.phpt +++ b/ext/mysql/tests/mysql_list_tables.phpt @@ -82,5 +82,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_max_links.phpt b/ext/mysql/tests/mysql_max_links.phpt index 32096c4..c9d0095 100644 --- a/ext/mysql/tests/mysql_max_links.phpt +++ b/ext/mysql/tests/mysql_max_links.phpt @@ -54,20 +54,10 @@ mysql_close($links[1]); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Too many open links (2) in %s on line %s +Warning: mysql_connect(): Too many open links (2) in %s on line %d [030] Cannot connect using host '%s', user '%s', password '****', [0] 0 -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Too many open links (2) in %s on line %s +Warning: mysql_connect(): Too many open links (2) in %s on line %d [060] Cannot connect using host '%s', user '%s', password '****', [0] 0 array(3) { [0]=> diff --git a/ext/mysql/tests/mysql_max_persistent.phpt b/ext/mysql/tests/mysql_max_persistent.phpt index 36f2266..ec5343c 100644 --- a/ext/mysql/tests/mysql_max_persistent.phpt +++ b/ext/mysql/tests/mysql_max_persistent.phpt @@ -90,14 +90,9 @@ if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_pconnect(): Too many open persistent links (1) in %s on line %d [020] Cannot connect using host '%s', user '%s', password '****', [0] 0 - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [0]=> resource(%d) of type (mysql link persistent) diff --git a/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt b/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt index 2c67e64..8a262de 100644 --- a/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt +++ b/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt @@ -30,7 +30,6 @@ max_execution_time=12 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"SLEEP(6)"]=> %unicode|string%(1) "0" diff --git a/ext/mysql/tests/mysql_num_fields.phpt b/ext/mysql/tests/mysql_num_fields.phpt index 4621dc9..7f9d815 100644 --- a/ext/mysql/tests/mysql_num_fields.phpt +++ b/ext/mysql/tests/mysql_num_fields.phpt @@ -52,7 +52,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_num_fields(): %d is not a valid MySQL result resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_num_rows.phpt b/ext/mysql/tests/mysql_num_rows.phpt index 5a803d4..e3cee56 100644 --- a/ext/mysql/tests/mysql_num_rows.phpt +++ b/ext/mysql/tests/mysql_num_rows.phpt @@ -79,7 +79,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in %s on line %d diff --git a/ext/mysql/tests/mysql_pconn_disable.phpt b/ext/mysql/tests/mysql_pconn_disable.phpt index 6997e59..5b21184 100644 --- a/ext/mysql/tests/mysql_pconn_disable.phpt +++ b/ext/mysql/tests/mysql_pconn_disable.phpt @@ -49,13 +49,7 @@ mysql.max_links=2 require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [001] Can connect to the server. [002] Can fetch data using persistent connection! Data = '1' - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconn_kill.phpt b/ext/mysql/tests/mysql_pconn_kill.phpt index eb1feb7..c023ff7 100644 --- a/ext/mysql/tests/mysql_pconn_kill.phpt +++ b/ext/mysql/tests/mysql_pconn_kill.phpt @@ -106,12 +106,6 @@ mysql.max_persistent=2 require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconn_max_links.phpt b/ext/mysql/tests/mysql_pconn_max_links.phpt index ced94b3..470848a 100644 --- a/ext/mysql/tests/mysql_pconn_max_links.phpt +++ b/ext/mysql/tests/mysql_pconn_max_links.phpt @@ -191,9 +191,7 @@ $host = substr($row['_user'], strrpos($row['_user'], "@") + 1, strlen($row['_use mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [%u|b%"id"]=> %unicode|string%(1) "1" @@ -201,7 +199,6 @@ array(2) { %unicode|string%(1) "a" } -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [%u|b%"id"]=> %unicode|string%(1) "1" diff --git a/ext/mysql/tests/mysql_pconn_reuse.phpt b/ext/mysql/tests/mysql_pconn_reuse.phpt index 26b4ca5..6891d17 100644 --- a/ext/mysql/tests/mysql_pconn_reuse.phpt +++ b/ext/mysql/tests/mysql_pconn_reuse.phpt @@ -59,17 +59,9 @@ mysql.max_links=2 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [001] Can connect to the server. [002] Can fetch data using persistent connection! Data = '1' -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - Warning: mysql_connect(): Too many open links (2) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconnect.phpt b/ext/mysql/tests/mysql_pconnect.phpt index ec28d2e..eb3079c 100644 --- a/ext/mysql/tests/mysql_pconnect.phpt +++ b/ext/mysql/tests/mysql_pconnect.phpt @@ -81,17 +81,7 @@ mysql.allow_persistent=1 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[001] Expecting NULL, got boolean/ -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_pconnect(): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +Warning: mysql_pconnect(): Access denied for user 'rootunknown_really'@'%s' (using password: YES) (errno: 1045) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_ping.phpt b/ext/mysql/tests/mysql_ping.phpt index 0308df3..edf18c4 100644 --- a/ext/mysql/tests/mysql_ping.phpt +++ b/ext/mysql/tests/mysql_ping.phpt @@ -42,7 +42,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) bool(true) bool(true) diff --git a/ext/mysql/tests/mysql_query.phpt b/ext/mysql/tests/mysql_query.phpt index 01b14ee..a5978a6 100644 --- a/ext/mysql/tests/mysql_query.phpt +++ b/ext/mysql/tests/mysql_query.phpt @@ -113,7 +113,6 @@ if (!mysql_query('DROP TABLE IF EXISTS test', $link)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"valid"]=> %unicode|string%(30) "this is sql but with semicolon" diff --git a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt index c2cb41e..99f3438 100644 --- a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt +++ b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt @@ -111,9 +111,7 @@ unlink("./simple.csv"); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [006] [1148] %s [007] [0] '' [008] LOAD DATA not run? diff --git a/ext/mysql/tests/mysql_real_escape_string.phpt b/ext/mysql/tests/mysql_real_escape_string.phpt index 4fdedf7..2789ad2 100644 --- a/ext/mysql/tests/mysql_real_escape_string.phpt +++ b/ext/mysql/tests/mysql_real_escape_string.phpt @@ -33,7 +33,6 @@ assert($tmp === mysql_real_escape_string("foo" . chr(0) . "bar")); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(31) "Am I a unicode string in PHP 6?" %unicode|string%(2) "\\" %unicode|string%(2) "\"" diff --git a/ext/mysql/tests/mysql_reflection_extension.phpt b/ext/mysql/tests/mysql_reflection_extension.phpt index 169036c..2b58478 100644 --- a/ext/mysql/tests/mysql_reflection_extension.phpt +++ b/ext/mysql/tests/mysql_reflection_extension.phpt @@ -102,4 +102,5 @@ Functions: mysql_tablename mysql_thread_id mysql_unbuffered_query -done! \ No newline at end of file + mysql_warning_count +done! diff --git a/ext/mysql/tests/mysql_reflection_functions.phpt b/ext/mysql/tests/mysql_reflection_functions.phpt index 4f2710d..85e2b8b 100644 --- a/ext/mysql/tests/mysql_reflection_functions.phpt +++ b/ext/mysql/tests/mysql_reflection_functions.phpt @@ -19,7 +19,6 @@ require_once('skipif.inc'); printf(" %s\n", $func->name); $rf = new ReflectionFunction($func->name); - printf(" Deprecated: %s\n", $rf->isDeprecated() ? "yes" : "no"); printf(" Accepted parameters: %d\n", $rf->getNumberOfParameters()); printf(" Required parameters: %d\n", $rf->getNumberOfRequiredParameters()); foreach( $rf->getParameters() as $param ) { @@ -32,29 +31,24 @@ require_once('skipif.inc'); --EXPECTF-- Functions: mysql - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $query ] Parameter #2 [ <optional> $link_identifier ] mysql_affected_rows - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_client_encoding - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_close - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_connect - Deprecated: no Accepted parameters: 5 Required parameters: 0 Parameter #0 [ <optional> $hostname ] @@ -63,249 +57,205 @@ Functions: Parameter #3 [ <optional> $new ] Parameter #4 [ <optional> $flags ] mysql_data_seek - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row_number ] mysql_db_name - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_db_query - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $query ] Parameter #2 [ <optional> $link_identifier ] mysql_dbname - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_errno - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_error - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_escape_string - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $string ] mysql_fetch_array - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $result_type ] mysql_fetch_assoc - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_fetch_field - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $field_offset ] mysql_fetch_lengths - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_fetch_object - Deprecated: no Accepted parameters: 3 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $class_name ] Parameter #2 [ <optional> $ctor_params ] mysql_fetch_row - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_field_flags - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_len - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_name - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_index ] mysql_field_seek - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_table - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_type - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldflags - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldlen - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldname - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_index ] mysql_fieldtable - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldtype - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_free_result - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_freeresult - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_get_client_info - Deprecated: no Accepted parameters: 0 Required parameters: 0 mysql_get_host_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_get_proto_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_get_server_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_insert_id - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_dbs - Deprecated: yes Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_fields - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $table_name ] Parameter #2 [ <optional> $link_identifier ] mysql_list_processes - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_tables - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_listdbs - Deprecated: yes Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_listfields - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $table_name ] Parameter #2 [ <optional> $link_identifier ] mysql_listtables - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_num_fields - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_num_rows - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_numfields - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_numrows - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_pconnect - Deprecated: no Accepted parameters: 4 Required parameters: 0 Parameter #0 [ <optional> $hostname ] @@ -313,75 +263,66 @@ Functions: Parameter #2 [ <optional> $password ] Parameter #3 [ <optional> $flags ] mysql_ping - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_query - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $query ] Parameter #1 [ <optional> $link_identifier ] mysql_real_escape_string - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $string ] Parameter #1 [ <optional> $link_identifier ] mysql_result - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_select_db - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_selectdb - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_set_charset - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $charset_name ] Parameter #1 [ <optional> $link_identifier ] mysql_stat - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_table_name - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_tablename - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_thread_id - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_unbuffered_query - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $query ] Parameter #1 [ <optional> $link_identifier ] -done! \ No newline at end of file + mysql_warning_count + Accepted parameters: 0 + Required parameters: 0 +done! diff --git a/ext/mysql/tests/mysql_result.phpt b/ext/mysql/tests/mysql_result.phpt index 0a58b9b..cf78910 100644 --- a/ext/mysql/tests/mysql_result.phpt +++ b/ext/mysql/tests/mysql_result.phpt @@ -65,7 +65,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_result(): Unable to jump to row -1 on MySQL result index %d in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_select_db.phpt b/ext/mysql/tests/mysql_select_db.phpt index e9bc99a..211e342 100644 --- a/ext/mysql/tests/mysql_select_db.phpt +++ b/ext/mysql/tests/mysql_select_db.phpt @@ -66,7 +66,6 @@ if (false !== ($tmp = mysql_select_db($db, $link))) print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(%d) "%s" bool(false) diff --git a/ext/mysql/tests/mysql_set_charset.phpt b/ext/mysql/tests/mysql_set_charset.phpt index a0bccd8..953323b 100644 --- a/ext/mysql/tests/mysql_set_charset.phpt +++ b/ext/mysql/tests/mysql_set_charset.phpt @@ -58,5 +58,4 @@ mysql_close($link); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_sql_safe_mode.phpt b/ext/mysql/tests/mysql_sql_safe_mode.phpt index 4d8ca92..60e8b54 100644 --- a/ext/mysql/tests/mysql_sql_safe_mode.phpt +++ b/ext/mysql/tests/mysql_sql_safe_mode.phpt @@ -37,4 +37,4 @@ Warning: mysql_connect(): Access denied for user '%s'@'%s' (using password: NO) Notice: mysql_pconnect(): SQL safe mode in effect - ignoring host/user/password information in %s on line %d Warning: mysql_pconnect(): Access denied for user '%s'@'%s' (using password: NO) in %s on line %d -done! \ No newline at end of file +done! diff --git a/ext/mysql/tests/mysql_stat.phpt b/ext/mysql/tests/mysql_stat.phpt index d6a34df..6113bb7 100644 --- a/ext/mysql/tests/mysql_stat.phpt +++ b/ext/mysql/tests/mysql_stat.phpt @@ -44,7 +44,6 @@ if (false !== ($tmp = mysql_stat($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_stat(): %d is not a valid MySQL-Link resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_tablename.phpt b/ext/mysql/tests/mysql_tablename.phpt index 4bbe54d..f785cfa 100644 --- a/ext/mysql/tests/mysql_tablename.phpt +++ b/ext/mysql/tests/mysql_tablename.phpt @@ -42,7 +42,6 @@ mysql_close($link); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_tablename() expects at least 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_thread_id.phpt b/ext/mysql/tests/mysql_thread_id.phpt index aa95d31..d541016 100644 --- a/ext/mysql/tests/mysql_thread_id.phpt +++ b/ext/mysql/tests/mysql_thread_id.phpt @@ -35,7 +35,6 @@ if (false !== ($tmp = mysql_thread_id($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_thread_id(): %d is not a valid MySQL-Link resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_trace_mode.phpt b/ext/mysql/tests/mysql_trace_mode.phpt index 7655975..2b6c61d 100644 --- a/ext/mysql/tests/mysql_trace_mode.phpt +++ b/ext/mysql/tests/mysql_trace_mode.phpt @@ -29,7 +29,6 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d I don\'t mind character sets, do I?\n Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d done! diff --git a/ext/mysql/tests/mysql_unbuffered_query.phpt b/ext/mysql/tests/mysql_unbuffered_query.phpt index 8754b58..ad9b4fb 100644 --- a/ext/mysql/tests/mysql_unbuffered_query.phpt +++ b/ext/mysql/tests/mysql_unbuffered_query.phpt @@ -107,7 +107,6 @@ if (!mysql_query('DROP TABLE IF EXISTS test', $link)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"valid"]=> %unicode|string%(30) "this is sql but with semicolon" diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 1514feb..46a4e8e 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -282,6 +282,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) long debug_calloc_fail_threshold; long debug_realloc_fail_threshold; char * sha256_server_public_key; + zend_bool use_fetch_buffer; ZEND_END_MODULE_GLOBALS(mysqlnd) PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd) diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 4d9c655..d230eec 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -48,6 +48,11 @@ MYSQLND_METHOD(mysqlnd_res, initialize_result_set_rest)(MYSQLND_RES * const resu if (!data_cursor || row_count == result->stored_data->initialized_rows) { DBG_RETURN(ret); } + + if (!result->use_fetch_buffer) { + row_count = 1; + } + while ((data_cursor - data_begin) < (int)(row_count * field_count)) { if (NULL == data_cursor[0]) { enum_func_status rc = result->m.row_decoder( @@ -56,22 +61,23 @@ MYSQLND_METHOD(mysqlnd_res, initialize_result_set_rest)(MYSQLND_RES * const resu result->meta->field_count, result->meta->fields, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, !result->use_fetch_buffer TSRMLS_CC); if (rc != PASS) { ret = FAIL; break; } result->stored_data->initialized_rows++; - for (i = 0; i < result->field_count; i++) { - /* - NULL fields are 0 length, 0 is not more than 0 - String of zero size, definitely can't be the next max_length. - Thus for NULL and zero-length we are quite efficient. - */ - if (Z_TYPE_P(data_cursor[i]) >= IS_STRING) { - unsigned long len = Z_STRLEN_P(data_cursor[i]); - if (result->meta->fields[i].max_length < len) { - result->meta->fields[i].max_length = len; + if (!result->use_fetch_buffer) { + for (i = 0; i < result->field_count; i++) { + zval_ptr_dtor(&data_cursor[i]); + } + } else { + for (i = 0; i < result->field_count; i++) { + if (Z_TYPE_P(data_cursor[i]) >= IS_STRING) { + unsigned long len = Z_STRLEN_P(data_cursor[i]); + if (result->meta->fields[i].max_length < len) { + result->meta->fields[i].max_length = len; + } } } } @@ -172,7 +178,6 @@ MYSQLND_METHOD(mysqlnd_res, unbuffered_free_last_data)(MYSQLND_RES * result TSRM } /* }}} */ - /* {{{ mysqlnd_res::free_buffered_data */ static void MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) @@ -184,35 +189,43 @@ MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) DBG_ENTER("mysqlnd_res::free_buffered_data"); DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count); - if (set->data) { - unsigned int copy_on_write_performed = 0; - unsigned int copy_on_write_saved = 0; - - for (row = set->row_count - 1; row >= 0; row--) { - zval **current_row = set->data + row * field_count; - MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; - int64_t col; - - if (current_row != NULL) { - for (col = field_count - 1; col >= 0; --col) { - if (current_row[col]) { - zend_bool copy_ctor_called; - mysqlnd_rset_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC); - if (copy_ctor_called) { - ++copy_on_write_performed; - } else { - ++copy_on_write_saved; + if (result->use_fetch_buffer) { + if (set->data) { + unsigned int copy_on_write_performed = 0; + unsigned int copy_on_write_saved = 0; + + for (row = set->row_count - 1; row >= 0; row--) { + zval **current_row = set->data + row * field_count; + MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; + int64_t col; + + if (current_row != NULL) { + for (col = field_count - 1; col >= 0; --col) { + if (current_row[col]) { + zend_bool copy_ctor_called; + mysqlnd_rset_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC); + if (copy_ctor_called) { + ++copy_on_write_performed; + } else { + ++copy_on_write_saved; + } } } } + current_buffer->free_chunk(current_buffer TSRMLS_CC); } + + MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_COPY_ON_WRITE_PERFORMED, copy_on_write_performed, + STAT_COPY_ON_WRITE_SAVED, copy_on_write_saved); + mnd_efree(set->data); + set->data = NULL; + } + } else { + for (row = set->row_count - 1; row >= 0; row--) { + MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; current_buffer->free_chunk(current_buffer TSRMLS_CC); } - - MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_COPY_ON_WRITE_PERFORMED, copy_on_write_performed, - STAT_COPY_ON_WRITE_SAVED, copy_on_write_saved); mnd_efree(set->data); - set->data = NULL; } if (set->row_buffers) { @@ -565,24 +578,55 @@ mysqlnd_fetch_lengths_buffered(MYSQLND_RES * const result TSRMLS_DC) zval **previous_row; MYSQLND_RES_BUFFERED *set = result->stored_data; - /* - If: - - unbuffered result - - first row has not been read - - last_row has been read - */ - if (set->data_cursor == NULL || - set->data_cursor == set->data || - ((set->data_cursor - set->data) > (set->row_count * result->meta->field_count) )) - { - return NULL;/* No rows or no more rows */ - } + if (result->use_fetch_buffer) { + /* + If: + - unbuffered result + - first row has not been read + - last_row has been read + */ + if (set->data_cursor == NULL || + set->data_cursor == set->data || + ((set->data_cursor - set->data) > (set->row_count * result->meta->field_count) )) + { + return NULL;/* No rows or no more rows */ + } - previous_row = set->data_cursor - result->meta->field_count; - for (i = 0; i < result->meta->field_count; i++) { - result->lengths[i] = (Z_TYPE_P(previous_row[i]) == IS_NULL)? 0:Z_STRLEN_P(previous_row[i]); - } + previous_row = set->data_cursor - result->meta->field_count; + for (i = 0; i < result->meta->field_count; i++) { + result->lengths[i] = (Z_TYPE_P(previous_row[i]) == IS_NULL)? 0:Z_STRLEN_P(previous_row[i]); + } + } else { + if (set->data_cursor_current_position > 0 && set->data_cursor_current_position <= set->row_count) { + zval **current_row = set->data; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + uint64_t row_num = set->data_cursor_current_position - 1; /* because we need the LAST row */ + unsigned long *lengths = result->lengths; + + enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 1 TSRMLS_CC); + if (rc != PASS) { + return NULL; + } + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; + unsigned int len = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRLEN_P(data); + + if (lengths) { + lengths[i] = len; + } + zval_ptr_dtor(&data); + } + } else { + return NULL; + } + } return result->lengths; } /* }}} */ @@ -660,7 +704,7 @@ mysqlnd_fetch_row_unbuffered_c(MYSQLND_RES * result TSRMLS_DC) row_packet->field_count, row_packet->fields_metadata, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (PASS != rc) { DBG_RETURN(retrow); } @@ -775,7 +819,7 @@ mysqlnd_fetch_row_unbuffered(MYSQLND_RES * result, void *param, unsigned int fla field_count, row_packet->fields_metadata, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (PASS != rc) { DBG_RETURN(FAIL); } @@ -933,7 +977,7 @@ mysqlnd_fetch_row_buffered_c(MYSQLND_RES * result TSRMLS_DC) result->meta->field_count, result->meta->fields, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (rc != PASS) { DBG_RETURN(ret); } @@ -990,32 +1034,103 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES * result, void *param, unsigned int flags DBG_ENTER("mysqlnd_fetch_row_buffered"); - /* If we haven't read everything */ - if (set->data_cursor && - (set->data_cursor - set->data) < (set->row_count * result->meta->field_count)) - { - zval **current_row = set->data_cursor; - MYSQLND_FIELD *field = result->meta->fields; - struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + if (result->use_fetch_buffer) { + /* If we haven't read everything */ + if (set->data_cursor && + (set->data_cursor - set->data) < (set->row_count * result->meta->field_count)) + { + zval **current_row = set->data_cursor; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + + if (NULL == current_row[0]) { + uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count; + enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 0 TSRMLS_CC); + if (rc != PASS) { + DBG_RETURN(FAIL); + } + set->initialized_rows++; + for (i = 0; i < result->field_count; i++) { + /* + NULL fields are 0 length, 0 is not more than 0 + String of zero size, definitely can't be the next max_length. + Thus for NULL and zero-length we are quite efficient. + */ + if (Z_TYPE_P(current_row[i]) >= IS_STRING) { + unsigned long len = Z_STRLEN_P(current_row[i]); + if (field->max_length < len) { + field->max_length = len; + } + } + } + } + + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; + + if (flags & MYSQLND_FETCH_NUM) { + Z_ADDREF_P(data); + zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); + } + if (flags & MYSQLND_FETCH_ASSOC) { + /* zend_hash_quick_update needs length + trailing zero */ + /* QQ: Error handling ? */ + /* + zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether + the index is a numeric and convert it to it. This however means constant + hashing of the column name, which is not needed as it can be precomputed. + */ + Z_ADDREF_P(data); + if (hash_key->is_numeric == FALSE) { + zend_hash_quick_update(Z_ARRVAL_P(row), + field->name, + field->name_length + 1, + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } else { + zend_hash_index_update(Z_ARRVAL_P(row), + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } + } + } + set->data_cursor += result->meta->field_count; + *fetched_anything = TRUE; + MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); + ret = PASS; + } else { + set->data_cursor = NULL; + *fetched_anything = FALSE; + ret = PASS; + DBG_INF("EOF reached"); + } + } else { + if (set->data_cursor_current_position < set->row_count) { + zval **current_row = set->data; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + uint64_t row_num = set->data_cursor_current_position; - if (NULL == current_row[0]) { - uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count; enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], - current_row, - result->meta->field_count, - result->meta->fields, - result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 1 TSRMLS_CC); if (rc != PASS) { DBG_RETURN(FAIL); } - set->initialized_rows++; for (i = 0; i < result->field_count; i++) { /* - NULL fields are 0 length, 0 is not more than 0 - String of zero size, definitely can't be the next max_length. - Thus for NULL and zero-length we are quite efficient. - */ + NULL fields are 0 length, 0 is not more than 0 + String of zero size, definitely can't be the next max_length. + Thus for NULL and zero-length we are quite efficient. + */ if (Z_TYPE_P(current_row[i]) >= IS_STRING) { unsigned long len = Z_STRLEN_P(current_row[i]); if (field->max_length < len) { @@ -1023,46 +1138,46 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES * result, void *param, unsigned int flags } } } - } - for (i = 0; i < result->field_count; i++, field++, hash_key++) { - zval *data = current_row[i]; + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; - if (flags & MYSQLND_FETCH_NUM) { - Z_ADDREF_P(data); - zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); - } - if (flags & MYSQLND_FETCH_ASSOC) { - /* zend_hash_quick_update needs length + trailing zero */ - /* QQ: Error handling ? */ - /* - zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether - the index is a numeric and convert it to it. This however means constant - hashing of the column name, which is not needed as it can be precomputed. - */ - Z_ADDREF_P(data); - if (hash_key->is_numeric == FALSE) { - zend_hash_quick_update(Z_ARRVAL_P(row), - field->name, - field->name_length + 1, - hash_key->key, - (void *) &data, sizeof(zval *), NULL); - } else { - zend_hash_index_update(Z_ARRVAL_P(row), - hash_key->key, - (void *) &data, sizeof(zval *), NULL); + if (flags == MYSQLND_FETCH_BOTH) { + Z_ADDREF_P(data); + } + if (flags & MYSQLND_FETCH_NUM) { + zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); + } + if (flags & MYSQLND_FETCH_ASSOC) { + /* zend_hash_quick_update needs length + trailing zero */ + /* QQ: Error handling ? */ + /* + zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether + the index is a numeric and convert it to it. This however means constant + hashing of the column name, which is not needed as it can be precomputed. + */ + if (hash_key->is_numeric == FALSE) { + zend_hash_quick_update(Z_ARRVAL_P(row), + field->name, + field->name_length + 1, + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } else { + zend_hash_index_update(Z_ARRVAL_P(row), + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } } } + set->data_cursor_current_position++; + *fetched_anything = TRUE; + MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); + ret = PASS; + } else { + *fetched_anything = FALSE; + ret = PASS; + DBG_INF("EOF reached"); } - set->data_cursor += result->meta->field_count; - *fetched_anything = TRUE; - MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); - ret = PASS; - } else { - set->data_cursor = NULL; - *fetched_anything = FALSE; - ret = PASS; - DBG_INF("EOF reached"); } DBG_INF_FMT("ret=PASS fetched=%u", *fetched_anything); DBG_RETURN(ret); @@ -1161,14 +1276,23 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c ret = FAIL; goto end; } - /* if pecalloc is used valgrind barks gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) */ - set->data = mnd_emalloc((size_t)(set->row_count * meta->field_count * sizeof(zval *))); - if (!set->data) { - SET_OOM_ERROR(*conn->error_info); - ret = FAIL; - goto end; + if (result->use_fetch_buffer) { + /* if pecalloc is used valgrind barks gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) */ + set->data = mnd_emalloc((size_t)(set->row_count * meta->field_count * sizeof(zval *))); + if (!set->data) { + SET_OOM_ERROR(*conn->error_info); + ret = FAIL; + goto end; + } + memset(set->data, 0, (size_t)(set->row_count * meta->field_count * sizeof(zval *))); + } else { + set->data = mnd_ecalloc(meta->field_count, sizeof(zval *)); + if (!set->data) { + SET_OOM_ERROR(*conn->error_info); + ret = FAIL; + goto end; + } } - memset(set->data, 0, (size_t)(set->row_count * meta->field_count * sizeof(zval *))); } MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, @@ -1260,8 +1384,6 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result, DBG_RETURN(result); } -/* }}} */ - /* {{{ mysqlnd_res::skip_result */ static enum_func_status @@ -1322,10 +1444,14 @@ MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * result, uint64_t row TSRMLS } /* libmysql just moves to the end, it does traversing of a linked list */ - if (row >= result->stored_data->row_count) { - result->stored_data->data_cursor = NULL; + if (result->use_fetch_buffer) { + if (row >= result->stored_data->row_count) { + result->stored_data->data_cursor = NULL; + } else { + result->stored_data->data_cursor = result->stored_data->data + row * result->meta->field_count; + } } else { - result->stored_data->data_cursor = result->stored_data->data + row * result->meta->field_count; + result->stored_data->data_cursor_current_position = row; } DBG_RETURN(PASS); @@ -1369,11 +1495,19 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC) then we can have max_length as dynamic property, which will be calculated during runtime and not during mysqli_fetch_field() time. */ - if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) { - DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request"); - /* we have to initialize the rest to get the updated max length */ - if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { - break; + if (result->use_fetch_buffer) { + if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) { + DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request"); + /* we have to initialize the rest to get the updated max length */ + if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { + break; + } + } + } else { + if (result->stored_data && !result->stored_data->initialized_rows) { + if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { + break; + } } } DBG_RETURN(result->meta->m->fetch_field(result->meta TSRMLS_CC)); @@ -1657,6 +1791,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC) DBG_RETURN(NULL); } + ret->use_fetch_buffer = MYSQLND_G(use_fetch_buffer); ret->persistent = persistent; ret->field_count = field_count; ret->m = *mysqlnd_result_get_methods(); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 99981f7..7c35430 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -642,7 +642,7 @@ typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *resu /* for decoding - binary or text protocol */ typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC); @@ -970,6 +970,7 @@ struct st_mysqlnd_buffered_result { zval **data; zval **data_cursor; + uint64_t data_cursor_current_position; MYSQLND_MEMORY_POOL_CHUNK **row_buffers; uint64_t row_count; uint64_t initialized_rows; @@ -1014,6 +1015,7 @@ struct st_mysqlnd_res MYSQLND_MEMORY_POOL * result_set_memory_pool; zend_bool persistent; + zend_bool use_fetch_buffer; struct st_mysqlnd_res_methods m; }; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 0d29973..359c32b 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1478,7 +1478,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC) + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC) { unsigned int i; zend_uchar * p = row_buffer->ptr; @@ -1576,7 +1576,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv enum_func_status php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC) + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC) { unsigned int i; zend_bool last_field_was_string = FALSE; @@ -1620,7 +1620,9 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval a \0 there. */ - *this_field_len_pos = '\0'; + if (!copy_data) { + *this_field_len_pos = '\0'; + } } /* NULL or NOT NULL, this is the question! */ @@ -1699,7 +1701,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval #error Need fix for this architecture #endif /* SIZEOF */ { - ZVAL_STRINGL(*current_field, (char *)p, len, 0); + ZVAL_STRINGL(*current_field, (char *)p, len, copy_data); } else { ZVAL_LONG(*current_field, (long) v); /* the cast is safe */ } @@ -1732,16 +1734,17 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval p -= len; if (Z_TYPE_PP(current_field) == IS_LONG) { bit_area += 1 + sprintf((char *)start, "%ld", Z_LVAL_PP(current_field)); - ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0); + ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, copy_data); } else if (Z_TYPE_PP(current_field) == IS_STRING){ memcpy(bit_area, Z_STRVAL_PP(current_field), Z_STRLEN_PP(current_field)); bit_area += Z_STRLEN_PP(current_field); *bit_area++ = '\0'; zval_dtor(*current_field); - ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0); + ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, copy_data); } - } else - ZVAL_STRINGL(*current_field, (char *)p, len, 0); + } else { + ZVAL_STRINGL(*current_field, (char *)p, len, copy_data); + } p += len; last_field_was_string = TRUE; } diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 26dd4c6..04cf7fc 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -308,12 +308,12 @@ PHPAPI const extern char * const mysqlnd_empty_string; enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); enum_func_status php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC); diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index 016840c..1c9854a 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -209,6 +209,7 @@ static PHP_GINIT_FUNCTION(mysqlnd) mysqlnd_globals->debug_calloc_fail_threshold = -1; mysqlnd_globals->debug_realloc_fail_threshold = -1; mysqlnd_globals->sha256_server_public_key = NULL; + mysqlnd_globals->use_fetch_buffer = 0; } /* }}} */ @@ -237,6 +238,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("mysqlnd.log_mask", "0", PHP_INI_ALL, OnUpdateLong, log_mask, zend_mysqlnd_globals, mysqlnd_globals) STD_PHP_INI_ENTRY("mysqlnd.mempool_default_size","16000", PHP_INI_ALL, OnUpdateLong, mempool_default_size, zend_mysqlnd_globals, mysqlnd_globals) STD_PHP_INI_ENTRY("mysqlnd.sha256_server_public_key",NULL, PHP_INI_PERDIR, OnUpdateString, sha256_server_public_key, zend_mysqlnd_globals, mysqlnd_globals) + STD_PHP_INI_ENTRY("mysqlnd.use_fetch_buffer", "0", PHP_INI_ALL, OnUpdateBool, use_fetch_buffer, zend_mysqlnd_globals, mysqlnd_globals) #if PHP_DEBUG STD_PHP_INI_ENTRY("mysqlnd.debug_emalloc_fail_threshold","-1", PHP_INI_SYSTEM, OnUpdateLong, debug_emalloc_fail_threshold, zend_mysqlnd_globals, mysqlnd_globals)
diff --git a/ext/mysql/tests/001.phpt b/ext/mysql/tests/001.phpt index 8782fd1..e9ac45c 100644 --- a/ext/mysql/tests/001.phpt +++ b/ext/mysql/tests/001.phpt @@ -29,8 +29,6 @@ var_dump($test); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(2) "11" done! diff --git a/ext/mysql/tests/002.phpt b/ext/mysql/tests/002.phpt index 8f53f4d..8355c5f 100644 --- a/ext/mysql/tests/002.phpt +++ b/ext/mysql/tests/002.phpt @@ -37,7 +37,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link) bool(true) bool(true) diff --git a/ext/mysql/tests/003.phpt b/ext/mysql/tests/003.phpt index 365abc2..2d0b68b 100644 --- a/ext/mysql/tests/003.phpt +++ b/ext/mysql/tests/003.phpt @@ -57,7 +57,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d ==stdClass== object(stdClass)#%d (1) { [%u|b%"a"]=> diff --git a/ext/mysql/tests/bug47438.phpt b/ext/mysql/tests/bug47438.phpt index fa7b3e6..2ddb757 100644 --- a/ext/mysql/tests/bug47438.phpt +++ b/ext/mysql/tests/bug47438.phpt @@ -47,7 +47,6 @@ if (!mysql_select_db($db, $link) || mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d 0.a 1.b 2.c diff --git a/ext/mysql/tests/bug48754.phpt b/ext/mysql/tests/bug48754.phpt index b461db3..fb322f4 100644 --- a/ext/mysql/tests/bug48754.phpt +++ b/ext/mysql/tests/bug48754.phpt @@ -68,8 +68,6 @@ var_dump($link); ?> --EXPECTF-- Explicit connection on close - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Expect same thread id for $link and default conn: bool(true) resource(%d) of type (mysql link) resource(%d) of type (Unknown) @@ -77,24 +75,18 @@ resource(%d) of type (Unknown) Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d Closing default link - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Expect same thread id for $link and default conn but not the previous: bool(true) resource(%d) of type (mysql link) resource(%d) of type (mysql link) resource(%d) of type (Unknown) Explicit resource and pconnect - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link persistent) resource(%d) of type (Unknown) Warning: mysql_close(): no MySQL-Link resource supplied in %s on line %d Default link and pconnect - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link persistent) resource(%d) of type (mysql link persistent) resource(%d) of type (Unknown) diff --git a/ext/mysql/tests/bug51242.phpt b/ext/mysql/tests/bug51242.phpt index 6801d30..9b62cdb 100644 --- a/ext/mysql/tests/bug51242.phpt +++ b/ext/mysql/tests/bug51242.phpt @@ -35,5 +35,4 @@ if ($link = my_mysql_connect($host, $user, $passwd, $db, null, $socket)) { } ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d resource(%d) of type (mysql link) diff --git a/ext/mysql/tests/bug53649.phpt b/ext/mysql/tests/bug53649.phpt index 7ccdf08..e6068d5 100644 --- a/ext/mysql/tests/bug53649.phpt +++ b/ext/mysql/tests/bug53649.phpt @@ -68,5 +68,4 @@ mysql_close($link); unlink('bug53649.data'); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done diff --git a/ext/mysql/tests/bug55473.phpt b/ext/mysql/tests/bug55473.phpt index 98fd009..5e20024 100644 --- a/ext/mysql/tests/bug55473.phpt +++ b/ext/mysql/tests/bug55473.phpt @@ -2,6 +2,7 @@ Bug #5547 (mysql_pconnect leaks file descriptors on reconnect) --SKIPIF-- <?php +die("skip"); require_once('skipif.inc'); require_once('skipifconnectfailure.inc'); if (defined('PHP_WINDOWS_VERSION_MAJOR')) { @@ -68,29 +69,24 @@ mysql.allow_persistent=1 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 0 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] Setting openened files... Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 1 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 2 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected Warning: mysql_ping(): MySQL server has gone away in %s on line %d [003] reconnect 3 -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [007] Opened files as expected done! diff --git a/ext/mysql/tests/connect.inc b/ext/mysql/tests/connect.inc index 0df5bc3..82f4024 100644 --- a/ext/mysql/tests/connect.inc +++ b/ext/mysql/tests/connect.inc @@ -60,7 +60,7 @@ Default values are "localhost", "root", database "test" and empty password. Change the MYSQL_TEST_* environment values if you want to use another configuration. */ -$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "localhost"; +$host = getenv("MYSQL_TEST_HOST") ? getenv("MYSQL_TEST_HOST") : "127.0.0.1"; $port = getenv("MYSQL_TEST_PORT") ? getenv("MYSQL_TEST_PORT") : 3306; $user = getenv("MYSQL_TEST_USER") ? getenv("MYSQL_TEST_USER") : "root"; $passwd = getenv("MYSQL_TEST_PASSWD") ? getenv("MYSQL_TEST_PASSWD") : ""; diff --git a/ext/mysql/tests/mysql_affected_rows.phpt b/ext/mysql/tests/mysql_affected_rows.phpt index 2449ac4..145e1f5 100644 --- a/ext/mysql/tests/mysql_affected_rows.phpt +++ b/ext/mysql/tests/mysql_affected_rows.phpt @@ -122,5 +122,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_client_encoding.phpt b/ext/mysql/tests/mysql_client_encoding.phpt index 5b21765..8aa67a0 100644 --- a/ext/mysql/tests/mysql_client_encoding.phpt +++ b/ext/mysql/tests/mysql_client_encoding.phpt @@ -67,5 +67,4 @@ if (false !== ($tmp = @mysql_client_encoding($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_close.phpt b/ext/mysql/tests/mysql_close.phpt index e676511..8f305ba 100644 --- a/ext/mysql/tests/mysql_close.phpt +++ b/ext/mysql/tests/mysql_close.phpt @@ -36,5 +36,4 @@ if (false !== ($tmp = @mysql_query("SELECT 1", $link))) print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_connect.phpt b/ext/mysql/tests/mysql_connect.phpt index 2b73092..90b67c3 100644 --- a/ext/mysql/tests/mysql_connect.phpt +++ b/ext/mysql/tests/mysql_connect.phpt @@ -104,25 +104,7 @@ if (!ini_get('sql.safe_mode')) { print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[001] Expecting NULL, got boolean/ -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +Warning: mysql_connect(): Access denied for user 'rootunknown_really'@'localhost' (using password: YES) (errno: 1045) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_constants.phpt b/ext/mysql/tests/mysql_constants.phpt index e687745..45a7fc3 100644 --- a/ext/mysql/tests/mysql_constants.phpt +++ b/ext/mysql/tests/mysql_constants.phpt @@ -62,5 +62,4 @@ if (!empty($expected_constants)) { print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_create_db.phpt b/ext/mysql/tests/mysql_create_db.phpt index 0b6d58a..838d5e1 100644 --- a/ext/mysql/tests/mysql_create_db.phpt +++ b/ext/mysql/tests/mysql_create_db.phpt @@ -53,7 +53,5 @@ if (!mysql_query("DROP DATABASE IF EXISTS mysqlcreatedb", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_data_seek.phpt b/ext/mysql/tests/mysql_data_seek.phpt index 72d3e63..3518cf3 100644 --- a/ext/mysql/tests/mysql_data_seek.phpt +++ b/ext/mysql/tests/mysql_data_seek.phpt @@ -67,7 +67,6 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_data_seek(): Offset 4 is invalid for MySQL result index %d (or the query data is unbuffered) in %s on line %d diff --git a/ext/mysql/tests/mysql_db_name.phpt b/ext/mysql/tests/mysql_db_name.phpt index 92878e9..6edd8aa 100644 --- a/ext/mysql/tests/mysql_db_name.phpt +++ b/ext/mysql/tests/mysql_db_name.phpt @@ -58,7 +58,6 @@ mysql_close($link); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO 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 diff --git a/ext/mysql/tests/mysql_db_query.phpt b/ext/mysql/tests/mysql_db_query.phpt index 291fbfa..bb837dd 100644 --- a/ext/mysql/tests/mysql_db_query.phpt +++ b/ext/mysql/tests/mysql_db_query.phpt @@ -62,5 +62,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_deprecated_api.phpt b/ext/mysql/tests/mysql_deprecated_api.phpt index ebf7237..5b6c011 100644 --- a/ext/mysql/tests/mysql_deprecated_api.phpt +++ b/ext/mysql/tests/mysql_deprecated_api.phpt @@ -33,7 +33,6 @@ if (version_compare(PHP_VERSION, '5.3.0') >= 0) { } /* - Deprecated since 2002 or the like but documented to be deprecated since 5.3. In 5.3 and before the deprecation message was bound to mysql.trace_mode=1. In 5.3.99 the warning will always be thrown, independent of the mysql.trace_mode setting. @@ -75,5 +74,5 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[006] mysql_escape_string has been deprecated in 5.3.0 done! diff --git a/ext/mysql/tests/mysql_drop_db.phpt b/ext/mysql/tests/mysql_drop_db.phpt index 3281b8a..ef4f5b2 100644 --- a/ext/mysql/tests/mysql_drop_db.phpt +++ b/ext/mysql/tests/mysql_drop_db.phpt @@ -52,5 +52,4 @@ if (!mysql_query("DROP DATABASE IF EXISTS mysqldropdb", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_errno.phpt b/ext/mysql/tests/mysql_errno.phpt index c9c2956..8cfa7bd 100644 --- a/ext/mysql/tests/mysql_errno.phpt +++ b/ext/mysql/tests/mysql_errno.phpt @@ -55,7 +55,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d int(0) int(%d) diff --git a/ext/mysql/tests/mysql_error.phpt b/ext/mysql/tests/mysql_error.phpt index a2cf7e0..85f1751 100644 --- a/ext/mysql/tests/mysql_error.phpt +++ b/ext/mysql/tests/mysql_error.phpt @@ -62,7 +62,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_error(): %d is not a valid MySQL-Link resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_fetch_array.phpt b/ext/mysql/tests/mysql_fetch_array.phpt index 8ccefd0..362cf99 100644 --- a/ext/mysql/tests/mysql_fetch_array.phpt +++ b/ext/mysql/tests/mysql_fetch_array.phpt @@ -281,7 +281,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] array(4) { [0]=> diff --git a/ext/mysql/tests/mysql_fetch_assoc.phpt b/ext/mysql/tests/mysql_fetch_assoc.phpt index 048613a..3c5ca79 100644 --- a/ext/mysql/tests/mysql_fetch_assoc.phpt +++ b/ext/mysql/tests/mysql_fetch_assoc.phpt @@ -63,7 +63,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [005] array(2) { [%u|b%"id"]=> @@ -88,8 +87,6 @@ array(5) { } Warning: mysql_fetch_assoc(): %d is not a valid MySQL result resource in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [010] array(5) { [%u|b%"id"]=> diff --git a/ext/mysql/tests/mysql_fetch_field.phpt b/ext/mysql/tests/mysql_fetch_field.phpt index 85c1fd6..ef03279 100644 --- a/ext/mysql/tests/mysql_fetch_field.phpt +++ b/ext/mysql/tests/mysql_fetch_field.phpt @@ -156,7 +156,6 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d object(stdClass)#%d (13) { [%u|b%"name"]=> %unicode|string%(2) "ID" diff --git a/ext/mysql/tests/mysql_fetch_lengths.phpt b/ext/mysql/tests/mysql_fetch_lengths.phpt index f0fbbb7..4793e26 100644 --- a/ext/mysql/tests/mysql_fetch_lengths.phpt +++ b/ext/mysql/tests/mysql_fetch_lengths.phpt @@ -39,7 +39,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [0]=> int(1) diff --git a/ext/mysql/tests/mysql_fetch_object.phpt b/ext/mysql/tests/mysql_fetch_object.phpt index 666d0ee..c11631e 100644 --- a/ext/mysql/tests/mysql_fetch_object.phpt +++ b/ext/mysql/tests/mysql_fetch_object.phpt @@ -82,7 +82,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d object(stdClass)#%d (2) { [%u|b%"ID"]=> %unicode|string%(1) "1" diff --git a/ext/mysql/tests/mysql_fetch_row.phpt b/ext/mysql/tests/mysql_fetch_row.phpt index 0ed932e..e5eba39 100644 --- a/ext/mysql/tests/mysql_fetch_row.phpt +++ b/ext/mysql/tests/mysql_fetch_row.phpt @@ -41,7 +41,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [004] array(2) { [0]=> diff --git a/ext/mysql/tests/mysql_field_flags.phpt b/ext/mysql/tests/mysql_field_flags.phpt index 5f8eb09..697955f 100644 --- a/ext/mysql/tests/mysql_field_flags.phpt +++ b/ext/mysql/tests/mysql_field_flags.phpt @@ -144,13 +144,12 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - Warning: mysql_field_flags() expects exactly 2 parameters, 1 given in %s on line %d Warning: mysql_field_flags(): Field -1 is invalid for MySQL result index %d in %s on line %d Warning: mysql_field_flags(): Field 2 is invalid for MySQL result index %d in %s on line %d +[014/label1 TIMESTAMP] Field 'label1', unexpected flags ' unsigned zerofill' found, [0] Warning: mysql_field_flags(): %d is not a valid MySQL result resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_field_len.phpt b/ext/mysql/tests/mysql_field_len.phpt index 119d352..231ab9f 100644 --- a/ext/mysql/tests/mysql_field_len.phpt +++ b/ext/mysql/tests/mysql_field_len.phpt @@ -47,7 +47,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_len() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_name.phpt b/ext/mysql/tests/mysql_field_name.phpt index 85f6c42..4ef020e 100644 --- a/ext/mysql/tests/mysql_field_name.phpt +++ b/ext/mysql/tests/mysql_field_name.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_name() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_seek.phpt b/ext/mysql/tests/mysql_field_seek.phpt index 8487493..54868b2 100644 --- a/ext/mysql/tests/mysql_field_seek.phpt +++ b/ext/mysql/tests/mysql_field_seek.phpt @@ -44,7 +44,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_seek(): Field -1 is invalid for MySQL result index %d in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_field_table.phpt b/ext/mysql/tests/mysql_field_table.phpt index 826651a..c1bd1f0 100644 --- a/ext/mysql/tests/mysql_field_table.phpt +++ b/ext/mysql/tests/mysql_field_table.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_table() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_field_type.phpt b/ext/mysql/tests/mysql_field_type.phpt index c767cab..db77c90 100644 --- a/ext/mysql/tests/mysql_field_type.phpt +++ b/ext/mysql/tests/mysql_field_type.phpt @@ -46,7 +46,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_field_type() expects exactly 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_free_result.phpt b/ext/mysql/tests/mysql_free_result.phpt index 90498bd..fe132d8 100644 --- a/ext/mysql/tests/mysql_free_result.phpt +++ b/ext/mysql/tests/mysql_free_result.phpt @@ -44,7 +44,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) Warning: mysql_free_result(): %d is not a valid MySQL result resource in %s on line %d diff --git a/ext/mysql/tests/mysql_get_client_info.phpt b/ext/mysql/tests/mysql_get_client_info.phpt index 95de0ad..32a7e38 100644 --- a/ext/mysql/tests/mysql_get_client_info.phpt +++ b/ext/mysql/tests/mysql_get_client_info.phpt @@ -20,4 +20,4 @@ if (!is_null($tmp = @mysql_get_client_info("too many arguments"))) { print "done!"; ?> --EXPECTF-- -done! \ No newline at end of file +done! diff --git a/ext/mysql/tests/mysql_get_host_info.phpt b/ext/mysql/tests/mysql_get_host_info.phpt index 4b21ddb..443910c 100644 --- a/ext/mysql/tests/mysql_get_host_info.phpt +++ b/ext/mysql/tests/mysql_get_host_info.phpt @@ -41,5 +41,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_get_proto_info.phpt b/ext/mysql/tests/mysql_get_proto_info.phpt index 3e14811..043fb62 100644 --- a/ext/mysql/tests/mysql_get_proto_info.phpt +++ b/ext/mysql/tests/mysql_get_proto_info.phpt @@ -31,5 +31,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_get_server_info.phpt b/ext/mysql/tests/mysql_get_server_info.phpt index ad192e4..e806335 100644 --- a/ext/mysql/tests/mysql_get_server_info.phpt +++ b/ext/mysql/tests/mysql_get_server_info.phpt @@ -36,5 +36,4 @@ if (NULL !== ($tmp = @mysql_get_server_info('too many', 'just too many'))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_info.phpt b/ext/mysql/tests/mysql_info.phpt index c478679..e53c29f 100644 --- a/ext/mysql/tests/mysql_info.phpt +++ b/ext/mysql/tests/mysql_info.phpt @@ -70,5 +70,4 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_insert_id.phpt b/ext/mysql/tests/mysql_insert_id.phpt index b69a96a..aaa9b13 100644 --- a/ext/mysql/tests/mysql_insert_id.phpt +++ b/ext/mysql/tests/mysql_insert_id.phpt @@ -66,7 +66,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_insert_id(): %d is not a valid MySQL-Link resource in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_list_dbs.phpt b/ext/mysql/tests/mysql_list_dbs.phpt index 402161a..ecc9faa 100644 --- a/ext/mysql/tests/mysql_list_dbs.phpt +++ b/ext/mysql/tests/mysql_list_dbs.phpt @@ -51,5 +51,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_list_fields.phpt b/ext/mysql/tests/mysql_list_fields.phpt index 6b6ae9b..335b2d9 100644 --- a/ext/mysql/tests/mysql_list_fields.phpt +++ b/ext/mysql/tests/mysql_list_fields.phpt @@ -64,7 +64,6 @@ if (!mysql_query("DROP TABLE IF EXISTS test2", $link)) mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [006] [%d] %s bool(false) Field Offset 0 diff --git a/ext/mysql/tests/mysql_list_processes.phpt b/ext/mysql/tests/mysql_list_processes.phpt index 7838a6f..7f5294f 100644 --- a/ext/mysql/tests/mysql_list_processes.phpt +++ b/ext/mysql/tests/mysql_list_processes.phpt @@ -49,5 +49,4 @@ mysql_close($link); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_list_tables.phpt b/ext/mysql/tests/mysql_list_tables.phpt index 3b753ae..cf0b1a6 100644 --- a/ext/mysql/tests/mysql_list_tables.phpt +++ b/ext/mysql/tests/mysql_list_tables.phpt @@ -82,5 +82,4 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_max_links.phpt b/ext/mysql/tests/mysql_max_links.phpt index 32096c4..c9d0095 100644 --- a/ext/mysql/tests/mysql_max_links.phpt +++ b/ext/mysql/tests/mysql_max_links.phpt @@ -54,20 +54,10 @@ mysql_close($links[1]); print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Too many open links (2) in %s on line %s +Warning: mysql_connect(): Too many open links (2) in %s on line %d [030] Cannot connect using host '%s', user '%s', password '****', [0] 0 -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_connect(): Too many open links (2) in %s on line %s +Warning: mysql_connect(): Too many open links (2) in %s on line %d [060] Cannot connect using host '%s', user '%s', password '****', [0] 0 array(3) { [0]=> diff --git a/ext/mysql/tests/mysql_max_persistent.phpt b/ext/mysql/tests/mysql_max_persistent.phpt index 36f2266..ec5343c 100644 --- a/ext/mysql/tests/mysql_max_persistent.phpt +++ b/ext/mysql/tests/mysql_max_persistent.phpt @@ -90,14 +90,9 @@ if (!$link = my_mysql_connect($host, $user, $passwd, $db, $port, $socket)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_pconnect(): Too many open persistent links (1) in %s on line %d [020] Cannot connect using host '%s', user '%s', password '****', [0] 0 - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [0]=> resource(%d) of type (mysql link persistent) diff --git a/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt b/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt index 2c67e64..8a262de 100644 --- a/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt +++ b/ext/mysql/tests/mysql_mysqlnd_read_timeout_long.phpt @@ -30,7 +30,6 @@ max_execution_time=12 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"SLEEP(6)"]=> %unicode|string%(1) "0" diff --git a/ext/mysql/tests/mysql_num_fields.phpt b/ext/mysql/tests/mysql_num_fields.phpt index 4621dc9..7f9d815 100644 --- a/ext/mysql/tests/mysql_num_fields.phpt +++ b/ext/mysql/tests/mysql_num_fields.phpt @@ -52,7 +52,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_num_fields(): %d is not a valid MySQL result resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_num_rows.phpt b/ext/mysql/tests/mysql_num_rows.phpt index 5a803d4..e3cee56 100644 --- a/ext/mysql/tests/mysql_num_rows.phpt +++ b/ext/mysql/tests/mysql_num_rows.phpt @@ -79,7 +79,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in %s on line %d diff --git a/ext/mysql/tests/mysql_pconn_disable.phpt b/ext/mysql/tests/mysql_pconn_disable.phpt index 6997e59..5b21184 100644 --- a/ext/mysql/tests/mysql_pconn_disable.phpt +++ b/ext/mysql/tests/mysql_pconn_disable.phpt @@ -49,13 +49,7 @@ mysql.max_links=2 require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [001] Can connect to the server. [002] Can fetch data using persistent connection! Data = '1' - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconn_kill.phpt b/ext/mysql/tests/mysql_pconn_kill.phpt index eb1feb7..c023ff7 100644 --- a/ext/mysql/tests/mysql_pconn_kill.phpt +++ b/ext/mysql/tests/mysql_pconn_kill.phpt @@ -106,12 +106,6 @@ mysql.max_persistent=2 require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconn_max_links.phpt b/ext/mysql/tests/mysql_pconn_max_links.phpt index ced94b3..470848a 100644 --- a/ext/mysql/tests/mysql_pconn_max_links.phpt +++ b/ext/mysql/tests/mysql_pconn_max_links.phpt @@ -191,9 +191,7 @@ $host = substr($row['_user'], strrpos($row['_user'], "@") + 1, strlen($row['_use mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [%u|b%"id"]=> %unicode|string%(1) "1" @@ -201,7 +199,6 @@ array(2) { %unicode|string%(1) "a" } -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(2) { [%u|b%"id"]=> %unicode|string%(1) "1" diff --git a/ext/mysql/tests/mysql_pconn_reuse.phpt b/ext/mysql/tests/mysql_pconn_reuse.phpt index 26b4ca5..6891d17 100644 --- a/ext/mysql/tests/mysql_pconn_reuse.phpt +++ b/ext/mysql/tests/mysql_pconn_reuse.phpt @@ -59,17 +59,9 @@ mysql.max_links=2 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [001] Can connect to the server. [002] Can fetch data using persistent connection! Data = '1' -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - Warning: mysql_connect(): Too many open links (2) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_pconnect.phpt b/ext/mysql/tests/mysql_pconnect.phpt index ec28d2e..eb3079c 100644 --- a/ext/mysql/tests/mysql_pconnect.phpt +++ b/ext/mysql/tests/mysql_pconnect.phpt @@ -81,17 +81,7 @@ mysql.allow_persistent=1 print "done!"; ?> --EXPECTF-- -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +[001] Expecting NULL, got boolean/ -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Warning: mysql_pconnect(): Access denied for user '%s'@'%s' (using password: YES) in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d - -Deprecated: mysql_pconnect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d +Warning: mysql_pconnect(): Access denied for user 'rootunknown_really'@'%s' (using password: YES) (errno: 1045) in %s on line %d done! diff --git a/ext/mysql/tests/mysql_ping.phpt b/ext/mysql/tests/mysql_ping.phpt index 0308df3..edf18c4 100644 --- a/ext/mysql/tests/mysql_ping.phpt +++ b/ext/mysql/tests/mysql_ping.phpt @@ -42,7 +42,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d bool(true) bool(true) bool(true) diff --git a/ext/mysql/tests/mysql_query.phpt b/ext/mysql/tests/mysql_query.phpt index 01b14ee..a5978a6 100644 --- a/ext/mysql/tests/mysql_query.phpt +++ b/ext/mysql/tests/mysql_query.phpt @@ -113,7 +113,6 @@ if (!mysql_query('DROP TABLE IF EXISTS test', $link)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"valid"]=> %unicode|string%(30) "this is sql but with semicolon" diff --git a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt index c2cb41e..99f3438 100644 --- a/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt +++ b/ext/mysql/tests/mysql_query_load_data_openbasedir.phpt @@ -111,9 +111,7 @@ unlink("./simple.csv"); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d [006] [1148] %s [007] [0] '' [008] LOAD DATA not run? diff --git a/ext/mysql/tests/mysql_real_escape_string.phpt b/ext/mysql/tests/mysql_real_escape_string.phpt index 4fdedf7..2789ad2 100644 --- a/ext/mysql/tests/mysql_real_escape_string.phpt +++ b/ext/mysql/tests/mysql_real_escape_string.phpt @@ -33,7 +33,6 @@ assert($tmp === mysql_real_escape_string("foo" . chr(0) . "bar")); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(31) "Am I a unicode string in PHP 6?" %unicode|string%(2) "\\" %unicode|string%(2) "\"" diff --git a/ext/mysql/tests/mysql_reflection_extension.phpt b/ext/mysql/tests/mysql_reflection_extension.phpt index 169036c..2b58478 100644 --- a/ext/mysql/tests/mysql_reflection_extension.phpt +++ b/ext/mysql/tests/mysql_reflection_extension.phpt @@ -102,4 +102,5 @@ Functions: mysql_tablename mysql_thread_id mysql_unbuffered_query -done! \ No newline at end of file + mysql_warning_count +done! diff --git a/ext/mysql/tests/mysql_reflection_functions.phpt b/ext/mysql/tests/mysql_reflection_functions.phpt index 4f2710d..85e2b8b 100644 --- a/ext/mysql/tests/mysql_reflection_functions.phpt +++ b/ext/mysql/tests/mysql_reflection_functions.phpt @@ -19,7 +19,6 @@ require_once('skipif.inc'); printf(" %s\n", $func->name); $rf = new ReflectionFunction($func->name); - printf(" Deprecated: %s\n", $rf->isDeprecated() ? "yes" : "no"); printf(" Accepted parameters: %d\n", $rf->getNumberOfParameters()); printf(" Required parameters: %d\n", $rf->getNumberOfRequiredParameters()); foreach( $rf->getParameters() as $param ) { @@ -32,29 +31,24 @@ require_once('skipif.inc'); --EXPECTF-- Functions: mysql - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $query ] Parameter #2 [ <optional> $link_identifier ] mysql_affected_rows - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_client_encoding - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_close - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_connect - Deprecated: no Accepted parameters: 5 Required parameters: 0 Parameter #0 [ <optional> $hostname ] @@ -63,249 +57,205 @@ Functions: Parameter #3 [ <optional> $new ] Parameter #4 [ <optional> $flags ] mysql_data_seek - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row_number ] mysql_db_name - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_db_query - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $query ] Parameter #2 [ <optional> $link_identifier ] mysql_dbname - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_errno - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_error - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_escape_string - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $string ] mysql_fetch_array - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $result_type ] mysql_fetch_assoc - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_fetch_field - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $field_offset ] mysql_fetch_lengths - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_fetch_object - Deprecated: no Accepted parameters: 3 Required parameters: 1 Parameter #0 [ <required> $result ] Parameter #1 [ <optional> $class_name ] Parameter #2 [ <optional> $ctor_params ] mysql_fetch_row - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_field_flags - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_len - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_name - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_index ] mysql_field_seek - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_table - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_field_type - Deprecated: no Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldflags - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldlen - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldname - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_index ] mysql_fieldtable - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_fieldtype - Deprecated: yes Accepted parameters: 2 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $field_offset ] mysql_free_result - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_freeresult - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_get_client_info - Deprecated: no Accepted parameters: 0 Required parameters: 0 mysql_get_host_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_get_proto_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_get_server_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_info - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_insert_id - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_dbs - Deprecated: yes Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_fields - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $table_name ] Parameter #2 [ <optional> $link_identifier ] mysql_list_processes - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_list_tables - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_listdbs - Deprecated: yes Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_listfields - Deprecated: yes Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $database_name ] Parameter #1 [ <required> $table_name ] Parameter #2 [ <optional> $link_identifier ] mysql_listtables - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_num_fields - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_num_rows - Deprecated: no Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_numfields - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_numrows - Deprecated: yes Accepted parameters: 1 Required parameters: 1 Parameter #0 [ <required> $result ] mysql_pconnect - Deprecated: no Accepted parameters: 4 Required parameters: 0 Parameter #0 [ <optional> $hostname ] @@ -313,75 +263,66 @@ Functions: Parameter #2 [ <optional> $password ] Parameter #3 [ <optional> $flags ] mysql_ping - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_query - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $query ] Parameter #1 [ <optional> $link_identifier ] mysql_real_escape_string - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $string ] Parameter #1 [ <optional> $link_identifier ] mysql_result - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_select_db - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_selectdb - Deprecated: yes Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $database_name ] Parameter #1 [ <optional> $link_identifier ] mysql_set_charset - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $charset_name ] Parameter #1 [ <optional> $link_identifier ] mysql_stat - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_table_name - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_tablename - Deprecated: no Accepted parameters: 3 Required parameters: 2 Parameter #0 [ <required> $result ] Parameter #1 [ <required> $row ] Parameter #2 [ <optional> $field ] mysql_thread_id - Deprecated: no Accepted parameters: 1 Required parameters: 0 Parameter #0 [ <optional> $link_identifier ] mysql_unbuffered_query - Deprecated: no Accepted parameters: 2 Required parameters: 1 Parameter #0 [ <required> $query ] Parameter #1 [ <optional> $link_identifier ] -done! \ No newline at end of file + mysql_warning_count + Accepted parameters: 0 + Required parameters: 0 +done! diff --git a/ext/mysql/tests/mysql_result.phpt b/ext/mysql/tests/mysql_result.phpt index 0a58b9b..cf78910 100644 --- a/ext/mysql/tests/mysql_result.phpt +++ b/ext/mysql/tests/mysql_result.phpt @@ -65,7 +65,6 @@ print "done!"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_result(): Unable to jump to row -1 on MySQL result index %d in %s on line %d bool(false) diff --git a/ext/mysql/tests/mysql_select_db.phpt b/ext/mysql/tests/mysql_select_db.phpt index e9bc99a..211e342 100644 --- a/ext/mysql/tests/mysql_select_db.phpt +++ b/ext/mysql/tests/mysql_select_db.phpt @@ -66,7 +66,6 @@ if (false !== ($tmp = mysql_select_db($db, $link))) print "done!\n"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d %unicode|string%(%d) "%s" bool(false) diff --git a/ext/mysql/tests/mysql_set_charset.phpt b/ext/mysql/tests/mysql_set_charset.phpt index a0bccd8..953323b 100644 --- a/ext/mysql/tests/mysql_set_charset.phpt +++ b/ext/mysql/tests/mysql_set_charset.phpt @@ -58,5 +58,4 @@ mysql_close($link); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d done! diff --git a/ext/mysql/tests/mysql_sql_safe_mode.phpt b/ext/mysql/tests/mysql_sql_safe_mode.phpt index 4d8ca92..60e8b54 100644 --- a/ext/mysql/tests/mysql_sql_safe_mode.phpt +++ b/ext/mysql/tests/mysql_sql_safe_mode.phpt @@ -37,4 +37,4 @@ Warning: mysql_connect(): Access denied for user '%s'@'%s' (using password: NO) Notice: mysql_pconnect(): SQL safe mode in effect - ignoring host/user/password information in %s on line %d Warning: mysql_pconnect(): Access denied for user '%s'@'%s' (using password: NO) in %s on line %d -done! \ No newline at end of file +done! diff --git a/ext/mysql/tests/mysql_stat.phpt b/ext/mysql/tests/mysql_stat.phpt index d6a34df..6113bb7 100644 --- a/ext/mysql/tests/mysql_stat.phpt +++ b/ext/mysql/tests/mysql_stat.phpt @@ -44,7 +44,6 @@ if (false !== ($tmp = mysql_stat($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_stat(): %d is not a valid MySQL-Link resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_tablename.phpt b/ext/mysql/tests/mysql_tablename.phpt index 4bbe54d..f785cfa 100644 --- a/ext/mysql/tests/mysql_tablename.phpt +++ b/ext/mysql/tests/mysql_tablename.phpt @@ -42,7 +42,6 @@ mysql_close($link); print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_tablename() expects at least 2 parameters, 1 given in %s on line %d diff --git a/ext/mysql/tests/mysql_thread_id.phpt b/ext/mysql/tests/mysql_thread_id.phpt index aa95d31..d541016 100644 --- a/ext/mysql/tests/mysql_thread_id.phpt +++ b/ext/mysql/tests/mysql_thread_id.phpt @@ -35,7 +35,6 @@ if (false !== ($tmp = mysql_thread_id($link))) print "done!"; ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d Warning: mysql_thread_id(): %d is not a valid MySQL-Link resource in %s on line %d done! diff --git a/ext/mysql/tests/mysql_trace_mode.phpt b/ext/mysql/tests/mysql_trace_mode.phpt index 7655975..2b6c61d 100644 --- a/ext/mysql/tests/mysql_trace_mode.phpt +++ b/ext/mysql/tests/mysql_trace_mode.phpt @@ -29,7 +29,6 @@ print "done!\n"; require_once("clean_table.inc"); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d I don\'t mind character sets, do I?\n Warning: mysql_query(): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BOGUS_SQL' at line 1 in %s on line %d done! diff --git a/ext/mysql/tests/mysql_unbuffered_query.phpt b/ext/mysql/tests/mysql_unbuffered_query.phpt index 8754b58..ad9b4fb 100644 --- a/ext/mysql/tests/mysql_unbuffered_query.phpt +++ b/ext/mysql/tests/mysql_unbuffered_query.phpt @@ -107,7 +107,6 @@ if (!mysql_query('DROP TABLE IF EXISTS test', $link)) { mysql_close($link); ?> --EXPECTF-- -Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in %s on line %d array(1) { [%u|b%"valid"]=> %unicode|string%(30) "this is sql but with semicolon" diff --git a/ext/mysqlnd/mysqlnd.h b/ext/mysqlnd/mysqlnd.h index 1514feb..46a4e8e 100644 --- a/ext/mysqlnd/mysqlnd.h +++ b/ext/mysqlnd/mysqlnd.h @@ -282,6 +282,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mysqlnd) long debug_calloc_fail_threshold; long debug_realloc_fail_threshold; char * sha256_server_public_key; + zend_bool use_fetch_buffer; ZEND_END_MODULE_GLOBALS(mysqlnd) PHPAPI ZEND_EXTERN_MODULE_GLOBALS(mysqlnd) diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 4d9c655..d230eec 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -48,6 +48,11 @@ MYSQLND_METHOD(mysqlnd_res, initialize_result_set_rest)(MYSQLND_RES * const resu if (!data_cursor || row_count == result->stored_data->initialized_rows) { DBG_RETURN(ret); } + + if (!result->use_fetch_buffer) { + row_count = 1; + } + while ((data_cursor - data_begin) < (int)(row_count * field_count)) { if (NULL == data_cursor[0]) { enum_func_status rc = result->m.row_decoder( @@ -56,22 +61,23 @@ MYSQLND_METHOD(mysqlnd_res, initialize_result_set_rest)(MYSQLND_RES * const resu result->meta->field_count, result->meta->fields, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, !result->use_fetch_buffer TSRMLS_CC); if (rc != PASS) { ret = FAIL; break; } result->stored_data->initialized_rows++; - for (i = 0; i < result->field_count; i++) { - /* - NULL fields are 0 length, 0 is not more than 0 - String of zero size, definitely can't be the next max_length. - Thus for NULL and zero-length we are quite efficient. - */ - if (Z_TYPE_P(data_cursor[i]) >= IS_STRING) { - unsigned long len = Z_STRLEN_P(data_cursor[i]); - if (result->meta->fields[i].max_length < len) { - result->meta->fields[i].max_length = len; + if (!result->use_fetch_buffer) { + for (i = 0; i < result->field_count; i++) { + zval_ptr_dtor(&data_cursor[i]); + } + } else { + for (i = 0; i < result->field_count; i++) { + if (Z_TYPE_P(data_cursor[i]) >= IS_STRING) { + unsigned long len = Z_STRLEN_P(data_cursor[i]); + if (result->meta->fields[i].max_length < len) { + result->meta->fields[i].max_length = len; + } } } } @@ -172,7 +178,6 @@ MYSQLND_METHOD(mysqlnd_res, unbuffered_free_last_data)(MYSQLND_RES * result TSRM } /* }}} */ - /* {{{ mysqlnd_res::free_buffered_data */ static void MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) @@ -184,35 +189,43 @@ MYSQLND_METHOD(mysqlnd_res, free_buffered_data)(MYSQLND_RES * result TSRMLS_DC) DBG_ENTER("mysqlnd_res::free_buffered_data"); DBG_INF_FMT("Freeing "MYSQLND_LLU_SPEC" row(s)", set->row_count); - if (set->data) { - unsigned int copy_on_write_performed = 0; - unsigned int copy_on_write_saved = 0; - - for (row = set->row_count - 1; row >= 0; row--) { - zval **current_row = set->data + row * field_count; - MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; - int64_t col; - - if (current_row != NULL) { - for (col = field_count - 1; col >= 0; --col) { - if (current_row[col]) { - zend_bool copy_ctor_called; - mysqlnd_rset_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC); - if (copy_ctor_called) { - ++copy_on_write_performed; - } else { - ++copy_on_write_saved; + if (result->use_fetch_buffer) { + if (set->data) { + unsigned int copy_on_write_performed = 0; + unsigned int copy_on_write_saved = 0; + + for (row = set->row_count - 1; row >= 0; row--) { + zval **current_row = set->data + row * field_count; + MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; + int64_t col; + + if (current_row != NULL) { + for (col = field_count - 1; col >= 0; --col) { + if (current_row[col]) { + zend_bool copy_ctor_called; + mysqlnd_rset_zval_ptr_dtor(&(current_row[col]), result->type, ©_ctor_called TSRMLS_CC); + if (copy_ctor_called) { + ++copy_on_write_performed; + } else { + ++copy_on_write_saved; + } } } } + current_buffer->free_chunk(current_buffer TSRMLS_CC); } + + MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_COPY_ON_WRITE_PERFORMED, copy_on_write_performed, + STAT_COPY_ON_WRITE_SAVED, copy_on_write_saved); + mnd_efree(set->data); + set->data = NULL; + } + } else { + for (row = set->row_count - 1; row >= 0; row--) { + MYSQLND_MEMORY_POOL_CHUNK *current_buffer = set->row_buffers[row]; current_buffer->free_chunk(current_buffer TSRMLS_CC); } - - MYSQLND_INC_GLOBAL_STATISTIC_W_VALUE2(STAT_COPY_ON_WRITE_PERFORMED, copy_on_write_performed, - STAT_COPY_ON_WRITE_SAVED, copy_on_write_saved); mnd_efree(set->data); - set->data = NULL; } if (set->row_buffers) { @@ -565,24 +578,55 @@ mysqlnd_fetch_lengths_buffered(MYSQLND_RES * const result TSRMLS_DC) zval **previous_row; MYSQLND_RES_BUFFERED *set = result->stored_data; - /* - If: - - unbuffered result - - first row has not been read - - last_row has been read - */ - if (set->data_cursor == NULL || - set->data_cursor == set->data || - ((set->data_cursor - set->data) > (set->row_count * result->meta->field_count) )) - { - return NULL;/* No rows or no more rows */ - } + if (result->use_fetch_buffer) { + /* + If: + - unbuffered result + - first row has not been read + - last_row has been read + */ + if (set->data_cursor == NULL || + set->data_cursor == set->data || + ((set->data_cursor - set->data) > (set->row_count * result->meta->field_count) )) + { + return NULL;/* No rows or no more rows */ + } - previous_row = set->data_cursor - result->meta->field_count; - for (i = 0; i < result->meta->field_count; i++) { - result->lengths[i] = (Z_TYPE_P(previous_row[i]) == IS_NULL)? 0:Z_STRLEN_P(previous_row[i]); - } + previous_row = set->data_cursor - result->meta->field_count; + for (i = 0; i < result->meta->field_count; i++) { + result->lengths[i] = (Z_TYPE_P(previous_row[i]) == IS_NULL)? 0:Z_STRLEN_P(previous_row[i]); + } + } else { + if (set->data_cursor_current_position > 0 && set->data_cursor_current_position <= set->row_count) { + zval **current_row = set->data; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + uint64_t row_num = set->data_cursor_current_position - 1; /* because we need the LAST row */ + unsigned long *lengths = result->lengths; + + enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 1 TSRMLS_CC); + if (rc != PASS) { + return NULL; + } + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; + unsigned int len = (Z_TYPE_P(data) == IS_NULL)? 0:Z_STRLEN_P(data); + + if (lengths) { + lengths[i] = len; + } + zval_ptr_dtor(&data); + } + } else { + return NULL; + } + } return result->lengths; } /* }}} */ @@ -660,7 +704,7 @@ mysqlnd_fetch_row_unbuffered_c(MYSQLND_RES * result TSRMLS_DC) row_packet->field_count, row_packet->fields_metadata, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (PASS != rc) { DBG_RETURN(retrow); } @@ -775,7 +819,7 @@ mysqlnd_fetch_row_unbuffered(MYSQLND_RES * result, void *param, unsigned int fla field_count, row_packet->fields_metadata, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (PASS != rc) { DBG_RETURN(FAIL); } @@ -933,7 +977,7 @@ mysqlnd_fetch_row_buffered_c(MYSQLND_RES * result TSRMLS_DC) result->meta->field_count, result->meta->fields, result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + result->conn->stats, 0 TSRMLS_CC); if (rc != PASS) { DBG_RETURN(ret); } @@ -990,32 +1034,103 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES * result, void *param, unsigned int flags DBG_ENTER("mysqlnd_fetch_row_buffered"); - /* If we haven't read everything */ - if (set->data_cursor && - (set->data_cursor - set->data) < (set->row_count * result->meta->field_count)) - { - zval **current_row = set->data_cursor; - MYSQLND_FIELD *field = result->meta->fields; - struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + if (result->use_fetch_buffer) { + /* If we haven't read everything */ + if (set->data_cursor && + (set->data_cursor - set->data) < (set->row_count * result->meta->field_count)) + { + zval **current_row = set->data_cursor; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + + if (NULL == current_row[0]) { + uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count; + enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 0 TSRMLS_CC); + if (rc != PASS) { + DBG_RETURN(FAIL); + } + set->initialized_rows++; + for (i = 0; i < result->field_count; i++) { + /* + NULL fields are 0 length, 0 is not more than 0 + String of zero size, definitely can't be the next max_length. + Thus for NULL and zero-length we are quite efficient. + */ + if (Z_TYPE_P(current_row[i]) >= IS_STRING) { + unsigned long len = Z_STRLEN_P(current_row[i]); + if (field->max_length < len) { + field->max_length = len; + } + } + } + } + + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; + + if (flags & MYSQLND_FETCH_NUM) { + Z_ADDREF_P(data); + zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); + } + if (flags & MYSQLND_FETCH_ASSOC) { + /* zend_hash_quick_update needs length + trailing zero */ + /* QQ: Error handling ? */ + /* + zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether + the index is a numeric and convert it to it. This however means constant + hashing of the column name, which is not needed as it can be precomputed. + */ + Z_ADDREF_P(data); + if (hash_key->is_numeric == FALSE) { + zend_hash_quick_update(Z_ARRVAL_P(row), + field->name, + field->name_length + 1, + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } else { + zend_hash_index_update(Z_ARRVAL_P(row), + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } + } + } + set->data_cursor += result->meta->field_count; + *fetched_anything = TRUE; + MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); + ret = PASS; + } else { + set->data_cursor = NULL; + *fetched_anything = FALSE; + ret = PASS; + DBG_INF("EOF reached"); + } + } else { + if (set->data_cursor_current_position < set->row_count) { + zval **current_row = set->data; + MYSQLND_FIELD *field = result->meta->fields; + struct mysqlnd_field_hash_key * hash_key = result->meta->zend_hash_keys; + uint64_t row_num = set->data_cursor_current_position; - if (NULL == current_row[0]) { - uint64_t row_num = (set->data_cursor - set->data) / result->meta->field_count; enum_func_status rc = result->m.row_decoder(set->row_buffers[row_num], - current_row, - result->meta->field_count, - result->meta->fields, - result->conn->options->int_and_float_native, - result->conn->stats TSRMLS_CC); + current_row, + result->meta->field_count, + result->meta->fields, + result->conn->options->int_and_float_native, + result->conn->stats, 1 TSRMLS_CC); if (rc != PASS) { DBG_RETURN(FAIL); } - set->initialized_rows++; for (i = 0; i < result->field_count; i++) { /* - NULL fields are 0 length, 0 is not more than 0 - String of zero size, definitely can't be the next max_length. - Thus for NULL and zero-length we are quite efficient. - */ + NULL fields are 0 length, 0 is not more than 0 + String of zero size, definitely can't be the next max_length. + Thus for NULL and zero-length we are quite efficient. + */ if (Z_TYPE_P(current_row[i]) >= IS_STRING) { unsigned long len = Z_STRLEN_P(current_row[i]); if (field->max_length < len) { @@ -1023,46 +1138,46 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES * result, void *param, unsigned int flags } } } - } - for (i = 0; i < result->field_count; i++, field++, hash_key++) { - zval *data = current_row[i]; + for (i = 0; i < result->field_count; i++, field++, hash_key++) { + zval *data = current_row[i]; - if (flags & MYSQLND_FETCH_NUM) { - Z_ADDREF_P(data); - zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); - } - if (flags & MYSQLND_FETCH_ASSOC) { - /* zend_hash_quick_update needs length + trailing zero */ - /* QQ: Error handling ? */ - /* - zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether - the index is a numeric and convert it to it. This however means constant - hashing of the column name, which is not needed as it can be precomputed. - */ - Z_ADDREF_P(data); - if (hash_key->is_numeric == FALSE) { - zend_hash_quick_update(Z_ARRVAL_P(row), - field->name, - field->name_length + 1, - hash_key->key, - (void *) &data, sizeof(zval *), NULL); - } else { - zend_hash_index_update(Z_ARRVAL_P(row), - hash_key->key, - (void *) &data, sizeof(zval *), NULL); + if (flags == MYSQLND_FETCH_BOTH) { + Z_ADDREF_P(data); + } + if (flags & MYSQLND_FETCH_NUM) { + zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); + } + if (flags & MYSQLND_FETCH_ASSOC) { + /* zend_hash_quick_update needs length + trailing zero */ + /* QQ: Error handling ? */ + /* + zend_hash_quick_update does not check, as add_assoc_zval_ex do, whether + the index is a numeric and convert it to it. This however means constant + hashing of the column name, which is not needed as it can be precomputed. + */ + if (hash_key->is_numeric == FALSE) { + zend_hash_quick_update(Z_ARRVAL_P(row), + field->name, + field->name_length + 1, + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } else { + zend_hash_index_update(Z_ARRVAL_P(row), + hash_key->key, + (void *) &data, sizeof(zval *), NULL); + } } } + set->data_cursor_current_position++; + *fetched_anything = TRUE; + MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); + ret = PASS; + } else { + *fetched_anything = FALSE; + ret = PASS; + DBG_INF("EOF reached"); } - set->data_cursor += result->meta->field_count; - *fetched_anything = TRUE; - MYSQLND_INC_GLOBAL_STATISTIC(STAT_ROWS_FETCHED_FROM_CLIENT_NORMAL_BUF); - ret = PASS; - } else { - set->data_cursor = NULL; - *fetched_anything = FALSE; - ret = PASS; - DBG_INF("EOF reached"); } DBG_INF_FMT("ret=PASS fetched=%u", *fetched_anything); DBG_RETURN(ret); @@ -1161,14 +1276,23 @@ MYSQLND_METHOD(mysqlnd_res, store_result_fetch_data)(MYSQLND_CONN_DATA * const c ret = FAIL; goto end; } - /* if pecalloc is used valgrind barks gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) */ - set->data = mnd_emalloc((size_t)(set->row_count * meta->field_count * sizeof(zval *))); - if (!set->data) { - SET_OOM_ERROR(*conn->error_info); - ret = FAIL; - goto end; + if (result->use_fetch_buffer) { + /* if pecalloc is used valgrind barks gcc version 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] (SUSE Linux) */ + set->data = mnd_emalloc((size_t)(set->row_count * meta->field_count * sizeof(zval *))); + if (!set->data) { + SET_OOM_ERROR(*conn->error_info); + ret = FAIL; + goto end; + } + memset(set->data, 0, (size_t)(set->row_count * meta->field_count * sizeof(zval *))); + } else { + set->data = mnd_ecalloc(meta->field_count, sizeof(zval *)); + if (!set->data) { + SET_OOM_ERROR(*conn->error_info); + ret = FAIL; + goto end; + } } - memset(set->data, 0, (size_t)(set->row_count * meta->field_count * sizeof(zval *))); } MYSQLND_INC_CONN_STATISTIC_W_VALUE(conn->stats, @@ -1260,8 +1384,6 @@ MYSQLND_METHOD(mysqlnd_res, store_result)(MYSQLND_RES * result, DBG_RETURN(result); } -/* }}} */ - /* {{{ mysqlnd_res::skip_result */ static enum_func_status @@ -1322,10 +1444,14 @@ MYSQLND_METHOD(mysqlnd_res, data_seek)(MYSQLND_RES * result, uint64_t row TSRMLS } /* libmysql just moves to the end, it does traversing of a linked list */ - if (row >= result->stored_data->row_count) { - result->stored_data->data_cursor = NULL; + if (result->use_fetch_buffer) { + if (row >= result->stored_data->row_count) { + result->stored_data->data_cursor = NULL; + } else { + result->stored_data->data_cursor = result->stored_data->data + row * result->meta->field_count; + } } else { - result->stored_data->data_cursor = result->stored_data->data + row * result->meta->field_count; + result->stored_data->data_cursor_current_position = row; } DBG_RETURN(PASS); @@ -1369,11 +1495,19 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field)(MYSQLND_RES * const result TSRMLS_DC) then we can have max_length as dynamic property, which will be calculated during runtime and not during mysqli_fetch_field() time. */ - if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) { - DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request"); - /* we have to initialize the rest to get the updated max length */ - if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { - break; + if (result->use_fetch_buffer) { + if (result->stored_data && (result->stored_data->initialized_rows < result->stored_data->row_count)) { + DBG_INF_FMT("We have decode the whole result set to be able to satisfy this meta request"); + /* we have to initialize the rest to get the updated max length */ + if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { + break; + } + } + } else { + if (result->stored_data && !result->stored_data->initialized_rows) { + if (PASS != result->m.initialize_result_set_rest(result TSRMLS_CC)) { + break; + } } } DBG_RETURN(result->meta->m->fetch_field(result->meta TSRMLS_CC)); @@ -1657,6 +1791,7 @@ mysqlnd_result_init(unsigned int field_count, zend_bool persistent TSRMLS_DC) DBG_RETURN(NULL); } + ret->use_fetch_buffer = MYSQLND_G(use_fetch_buffer); ret->persistent = persistent; ret->field_count = field_count; ret->m = *mysqlnd_result_get_methods(); diff --git a/ext/mysqlnd/mysqlnd_structs.h b/ext/mysqlnd/mysqlnd_structs.h index 99981f7..7c35430 100644 --- a/ext/mysqlnd/mysqlnd_structs.h +++ b/ext/mysqlnd/mysqlnd_structs.h @@ -642,7 +642,7 @@ typedef void (*func_mysqlnd_res__unbuffered_free_last_data)(MYSQLND_RES *resu /* for decoding - binary or text protocol */ typedef enum_func_status (*func_mysqlnd_res__row_decoder)(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); typedef MYSQLND_RES_METADATA * (*func_mysqlnd_res__result_meta_init)(unsigned int field_count, zend_bool persistent TSRMLS_DC); @@ -970,6 +970,7 @@ struct st_mysqlnd_buffered_result { zval **data; zval **data_cursor; + uint64_t data_cursor_current_position; MYSQLND_MEMORY_POOL_CHUNK **row_buffers; uint64_t row_count; uint64_t initialized_rows; @@ -1014,6 +1015,7 @@ struct st_mysqlnd_res MYSQLND_MEMORY_POOL * result_set_memory_pool; zend_bool persistent; + zend_bool use_fetch_buffer; struct st_mysqlnd_res_methods m; }; diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.c b/ext/mysqlnd/mysqlnd_wireprotocol.c index 0d29973..359c32b 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.c +++ b/ext/mysqlnd/mysqlnd_wireprotocol.c @@ -1478,7 +1478,7 @@ php_mysqlnd_read_row_ex(MYSQLND_CONN_DATA * conn, MYSQLND_MEMORY_POOL * result_s enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC) + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC) { unsigned int i; zend_uchar * p = row_buffer->ptr; @@ -1576,7 +1576,7 @@ php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zv enum_func_status php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC) + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC) { unsigned int i; zend_bool last_field_was_string = FALSE; @@ -1620,7 +1620,9 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval a \0 there. */ - *this_field_len_pos = '\0'; + if (!copy_data) { + *this_field_len_pos = '\0'; + } } /* NULL or NOT NULL, this is the question! */ @@ -1699,7 +1701,7 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval #error Need fix for this architecture #endif /* SIZEOF */ { - ZVAL_STRINGL(*current_field, (char *)p, len, 0); + ZVAL_STRINGL(*current_field, (char *)p, len, copy_data); } else { ZVAL_LONG(*current_field, (long) v); /* the cast is safe */ } @@ -1732,16 +1734,17 @@ php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval p -= len; if (Z_TYPE_PP(current_field) == IS_LONG) { bit_area += 1 + sprintf((char *)start, "%ld", Z_LVAL_PP(current_field)); - ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0); + ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, copy_data); } else if (Z_TYPE_PP(current_field) == IS_STRING){ memcpy(bit_area, Z_STRVAL_PP(current_field), Z_STRLEN_PP(current_field)); bit_area += Z_STRLEN_PP(current_field); *bit_area++ = '\0'; zval_dtor(*current_field); - ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, 0); + ZVAL_STRINGL(*current_field, (char *) start, bit_area - start - 1, copy_data); } - } else - ZVAL_STRINGL(*current_field, (char *)p, len, 0); + } else { + ZVAL_STRINGL(*current_field, (char *)p, len, copy_data); + } p += len; last_field_was_string = TRUE; } diff --git a/ext/mysqlnd/mysqlnd_wireprotocol.h b/ext/mysqlnd/mysqlnd_wireprotocol.h index 26dd4c6..04cf7fc 100644 --- a/ext/mysqlnd/mysqlnd_wireprotocol.h +++ b/ext/mysqlnd/mysqlnd_wireprotocol.h @@ -308,12 +308,12 @@ PHPAPI const extern char * const mysqlnd_empty_string; enum_func_status php_mysqlnd_rowp_read_binary_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); enum_func_status php_mysqlnd_rowp_read_text_protocol(MYSQLND_MEMORY_POOL_CHUNK * row_buffer, zval ** fields, unsigned int field_count, const MYSQLND_FIELD * fields_metadata, - zend_bool as_int_or_float, MYSQLND_STATS * stats TSRMLS_DC); + zend_bool as_int_or_float, MYSQLND_STATS * stats, zend_bool copy_data TSRMLS_DC); PHPAPI MYSQLND_PROTOCOL * mysqlnd_protocol_init(zend_bool persistent TSRMLS_DC); diff --git a/ext/mysqlnd/php_mysqlnd.c b/ext/mysqlnd/php_mysqlnd.c index 016840c..1c9854a 100644 --- a/ext/mysqlnd/php_mysqlnd.c +++ b/ext/mysqlnd/php_mysqlnd.c @@ -209,6 +209,7 @@ static PHP_GINIT_FUNCTION(mysqlnd) mysqlnd_globals->debug_calloc_fail_threshold = -1; mysqlnd_globals->debug_realloc_fail_threshold = -1; mysqlnd_globals->sha256_server_public_key = NULL; + mysqlnd_globals->use_fetch_buffer = 0; } /* }}} */ @@ -237,6 +238,7 @@ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("mysqlnd.log_mask", "0", PHP_INI_ALL, OnUpdateLong, log_mask, zend_mysqlnd_globals, mysqlnd_globals) STD_PHP_INI_ENTRY("mysqlnd.mempool_default_size","16000", PHP_INI_ALL, OnUpdateLong, mempool_default_size, zend_mysqlnd_globals, mysqlnd_globals) STD_PHP_INI_ENTRY("mysqlnd.sha256_server_public_key",NULL, PHP_INI_PERDIR, OnUpdateString, sha256_server_public_key, zend_mysqlnd_globals, mysqlnd_globals) + STD_PHP_INI_ENTRY("mysqlnd.use_fetch_buffer", "0", PHP_INI_ALL, OnUpdateBool, use_fetch_buffer, zend_mysqlnd_globals, mysqlnd_globals) #if PHP_DEBUG STD_PHP_INI_ENTRY("mysqlnd.debug_emalloc_fail_threshold","-1", PHP_INI_SYSTEM, OnUpdateLong, debug_emalloc_fail_threshold, zend_mysqlnd_globals, mysqlnd_globals)