From 4645f513604d02c1a2772e3618dff1d3f1c85bdd Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Thu, 28 May 2009 15:49:14 +0000 Subject: [PATCH] MFH - I had accidently removed Andrey's path to work with ANSI QUOTES... fixing what I broke (part 1) --- ext/mysqli/tests/local_infile_tools.inc | 2 +- ext/mysqli/tests/mysqli_affected_rows.phpt | 10 +++++----- ext/mysqli/tests/mysqli_affected_rows_oo.phpt | 6 +++--- ext/mysqli/tests/mysqli_change_user_insert_id.phpt | 2 +- .../mysqli_change_user_prepared_statements.phpt | 2 +- ext/mysqli/tests/mysqli_change_user_set_names.phpt | 14 +++++++------- ext/mysqli/tests/mysqli_fetch_field_types.phpt | 2 +- ext/mysqli/tests/mysqli_field_count.phpt | 2 +- ext/mysqli/tests/mysqli_get_charset.phpt | 6 +++--- ext/mysqli/tests/mysqli_info.phpt | 6 +++--- ext/mysqli/tests/mysqli_pconn_disabled.phpt | 4 +++- ext/mysqli/tests/mysqli_pconn_limits.phpt | 11 ++++++----- .../tests/mysqli_poll_mixing_insert_select.phpt | 4 ++-- ext/mysqli/tests/mysqli_prepare.phpt | 6 +++--- ext/mysqli/tests/mysqli_query.phpt | 6 +++--- ext/mysqli/tests/mysqli_query_stored_proc.phpt | 8 ++++---- ext/mysqli/tests/mysqli_query_unicode.phpt | 6 +++--- ext/mysqli/tests/mysqli_real_query.phpt | 6 +++--- ext/mysqli/tests/mysqli_report.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_affected_rows.phpt | 8 ++++---- .../tests/mysqli_stmt_execute_stored_proc.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_field_count.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_send_long_data.phpt | 2 +- ...i_stmt_send_long_data_packet_size_libmysql.phpt | 2 +- ...li_stmt_send_long_data_packet_size_mysqlnd.phpt | 2 +- ext/mysqli/tests/mysqli_stmt_store_result.phpt | 2 +- ext/mysqli/tests/skipifunicode.inc | 4 ++-- ext/mysqli/tests/table.inc | 2 +- 28 files changed, 67 insertions(+), 64 deletions(-) diff --git a/ext/mysqli/tests/local_infile_tools.inc b/ext/mysqli/tests/local_infile_tools.inc index d740b8253c..fcbf45a2e7 100644 --- a/ext/mysqli/tests/local_infile_tools.inc +++ b/ext/mysqli/tests/local_infile_tools.inc @@ -17,7 +17,7 @@ register_shutdown_function("shutdown_clean", $file); } - if (ini_get('unicode.semantics')) { + if ((version_compare(PHP_VERSION, '5.9.9', '>') == 1)) { if (!fwrite($fp, (binary)"'97';'x';\n") || !fwrite($fp, (binary)"'98';'y';\n") || !fwrite($fp, (binary)"99;'z';\n")) { diff --git a/ext/mysqli/tests/mysqli_affected_rows.phpt b/ext/mysqli/tests/mysqli_affected_rows.phpt index d5d2328293..24762cc99a 100644 --- a/ext/mysqli/tests/mysqli_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows.phpt @@ -1,7 +1,7 @@ --TEST-- mysqli_affected_rows() --SKIPIF-- - $charset) { - if (!($res = mysqli_query($link, sprintf('SHOW CHARACTER SET LIKE "%s"', $charset)))) + if (!($res = mysqli_query($link, sprintf("SHOW CHARACTER SET LIKE '%s'", $charset)))) continue; mysqli_free_result($res); if (true !== ($tmp = mysqli_set_charset($link, $charset))) diff --git a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt index 4d82981baf..bdbb790b13 100644 --- a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt @@ -28,18 +28,18 @@ mysqli->affected_rows if (!$mysqli->query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE = ' . $engine)) printf("[004] [%d] %s\n", $mysqli->errno, $mysqli->error); - if (!$mysqli->query('INSERT INTO test(id, label) VALUES (1, "a")')) + if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a')")) printf("[005] [%d] %s\n", $mysqli->errno, $mysqli->error); if (1 !== ($tmp = $mysqli->affected_rows)) printf("[006] Expecting int/1, got %s/%s\n", gettype($tmp), $tmp); // ignore INSERT error, NOTE: command line returns 0, affected_rows returns -1 as documented - $mysqli->query('INSERT INTO test(id, label) VALUES (1, "a")'); + $mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a')"); if (-1 !== ($tmp = $mysqli->affected_rows)) printf("[007] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp); - if (!$mysqli->query('INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4')) + if (!$mysqli->query("INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4")) printf("[008] [%d] %s\n", $mysqli->errno, $mysqli->error); if (2 !== ($tmp = $mysqli->affected_rows)) diff --git a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt index 51ff25f8a0..0dfb88a458 100644 --- a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt +++ b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt @@ -28,7 +28,7 @@ if (!$IS_MYSQLND) { if (!mysqli_query($link, 'CREATE TABLE test(id INT AUTO_INCREMENT PRIMARY KEY, label CHAR(10))')) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "z")')) + if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'z')")) printf("[004] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (($insert_id = mysqli_insert_id($link)) !== 100) diff --git a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt index ad3ed045cb..aa8eb41765 100644 --- a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt +++ b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt @@ -13,7 +13,7 @@ require_once('skipifconnectfailure.inc'); if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - if (!$stmt = mysqli_prepare($link, 'SELECT "prepared statements should be released"')) + if (!$stmt = mysqli_prepare($link, "SELECT 'prepared statements should be released'")) printf("[002] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); mysqli_change_user($link, $user, $passwd, $db); diff --git a/ext/mysqli/tests/mysqli_change_user_set_names.phpt b/ext/mysqli/tests/mysqli_change_user_set_names.phpt index 53156d66bb..d734ee886b 100644 --- a/ext/mysqli/tests/mysqli_change_user_set_names.phpt +++ b/ext/mysqli/tests/mysqli_change_user_set_names.phpt @@ -28,7 +28,7 @@ if ($version[0] <= 4 && $version[1] < 1) if (!$link = mysqli_connect($host, $user, $passwd, $db, $port, $socket)) printf("[001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - if (!$res = mysqli_query($link, 'SHOW CHARACTER SET LIKE "latin%"')) + if (!$res = mysqli_query($link, "SHOW CHARACTER SET LIKE 'latin%'")) printf("[002] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $charsets = array(); @@ -57,32 +57,32 @@ if ($version[0] <= 4 && $version[1] < 1) if (isset($not_changed['charset_client']) && $charset != $not_changed['charset_client'] && - mysqli_query($link, sprintf('SET @@character_set_client = "%s"', $charset))) + mysqli_query($link, sprintf("SET @@character_set_client = '%s'", $charset))) unset($not_changed['charset_client']); if (isset($not_changed['charset_connection']) && $charset != $not_changed['charset_connection'] && - mysqli_query($link, sprintf('SET @@character_connection = "%s"', $charset))) + mysqli_query($link, sprintf("SET @@character_connection = '%s'", $charset))) unset($not_changed['charset_connection']); if (isset($not_changed['charset_results']) && $charset != $not_changed['charset_results'] && - mysqli_query($link, sprintf('SET @@character_set_results = "%s"', $charset))) + mysqli_query($link, sprintf("SET @@character_set_results = '%s'", $charset))) unset($not_changed['charset_results']); if (isset($not_changed['collation_connection']) && $collation != $not_changed['collation_connection'] && - mysqli_query($link, sprintf('SET @@collation_connection = "%s"', $collation))) + mysqli_query($link, sprintf("SET @@collation_connection = '%s'", $collation))) unset($not_changed['collation_connection']); if (isset($not_changed['collation_database']) && $collation != $not_changed['collation_database'] && - mysqli_query($link, sprintf('SET @@collation_database = "%s"', $collation))) + mysqli_query($link, sprintf("SET @@collation_database = '%s'", $collation))) unset($not_changed['collation_database']); if (isset($not_changed['collation_server']) && $collation != $not_changed['collation_server'] && - mysqli_query($link, sprintf('SET @@collation_server = "%s"', $collation))) + mysqli_query($link, sprintf("SET @@collation_server = '%s'", $collation))) unset($not_changed['collation_server']); if (empty($not_changed)) diff --git a/ext/mysqli/tests/mysqli_fetch_field_types.phpt b/ext/mysqli/tests/mysqli_fetch_field_types.phpt index 84038c4c8d..fa9825354c 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_types.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_types.phpt @@ -86,7 +86,7 @@ require_once('skipifconnectfailure.inc'); MYSQLI_TYPE_VAR_STRING => array("VARCHAR(32768)", 'varchar'), MYSQLI_TYPE_STRING => 'MYSQLI_TYPE_STRING - TODO add testing', MYSQLI_TYPE_STRING => array('CHAR(1)', 'a'), - MYSQLI_TYPE_STRING => array('SET("I", "smash", "the")', 'Will be converted to string although it is a SET...'), + MYSQLI_TYPE_STRING => array("SET('I', 'smash', 'the')", 'Will be converted to string although it is a SET...'), MYSQLI_TYPE_NULL => 'MYSQLI_TYPE_NULL - TODO add testing', MYSQLI_TYPE_NEWDATE => 'MYSQLI_TYPE_NEWDATE - TODO add testing', MYSQLI_TYPE_INTERVAL => 'MYSQLI_TYPE_INTERVAL - TODO add testing', diff --git a/ext/mysqli/tests/mysqli_field_count.phpt b/ext/mysqli/tests/mysqli_field_count.phpt index 8d1e8da5ea..be8c3075d6 100644 --- a/ext/mysqli/tests/mysqli_field_count.phpt +++ b/ext/mysqli/tests/mysqli_field_count.phpt @@ -36,7 +36,7 @@ require_once('skipifconnectfailure.inc'); var_dump($link->field_count); var_dump(mysqli_field_count($link)); - if (!$res = mysqli_query($link, 'SELECT NULL as _null, "" AS "", "three" AS "drei"')) + if (!$res = mysqli_query($link, "SELECT NULL as _null, '' AS '', 'three' AS 'drei'")) printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); var_dump(mysqli_field_count($link)); mysqli_free_result($res); diff --git a/ext/mysqli/tests/mysqli_get_charset.phpt b/ext/mysqli/tests/mysqli_get_charset.phpt index 3652e7b193..128e07f820 100644 --- a/ext/mysqli/tests/mysqli_get_charset.phpt +++ b/ext/mysqli/tests/mysqli_get_charset.phpt @@ -44,7 +44,7 @@ if (!function_exists('mysqli_get_charset')) if (!($character_set_connection = $tmp['charset']) || !($collation_connection = $tmp['collation'])) printf("[008] Cannot determine current character set and collation\n"); - if (!$res = mysqli_query($link, $sql = sprintf('SHOW CHARACTER SET LIKE "%s"', $character_set_connection))) + if (!$res = mysqli_query($link, $sql = sprintf("SHOW CHARACTER SET LIKE '%s'", $character_set_connection))) printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $tmp = mysqli_fetch_assoc($res); if (empty($tmp)) @@ -53,14 +53,14 @@ if (!function_exists('mysqli_get_charset')) $maxlen = (isset($tmp['Maxlen'])) ? $tmp['Maxlen'] : ''; $comment = (isset($tmp['Description'])) ? $tmp['Description'] : ''; - if (!$res = mysqli_query($link, sprintf('SHOW COLLATION LIKE "%s"', $collation_connection))) + if (!$res = mysqli_query($link, sprintf("SHOW COLLATION LIKE '%s'", $collation_connection))) printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $tmp = mysqli_fetch_assoc($res); mysqli_free_result($res); if (!($id = $tmp['Id'])) printf("[012] Cannot fetch Id/Number, test will fail\n"); - if (!$res = mysqli_query($link, sprintf('SHOW VARIABLES LIKE "character_sets_dir"'))) + if (!$res = mysqli_query($link, sprintf("SHOW VARIABLES LIKE 'character_sets_dir'"))) printf("[013] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); $tmp = mysqli_fetch_assoc($res); mysqli_free_result($res); diff --git a/ext/mysqli/tests/mysqli_info.phpt b/ext/mysqli/tests/mysqli_info.phpt index 3f77de3cd1..8760f21777 100644 --- a/ext/mysqli/tests/mysqli_info.phpt +++ b/ext/mysqli/tests/mysqli_info.phpt @@ -17,14 +17,14 @@ require_once('skipifconnectfailure.inc'); printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); require "table.inc"; - if (!$res = mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "a")')) + if (!$res = mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'a')")) printf("[003] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); // NOTE: empty string, no multiple insert syntax if (!is_string($tmp = mysqli_info($link)) || ('' != $tmp)) printf("[004] Expecting string/empty, got %s/%s\n", gettype($tmp), $tmp); - if (!$res = mysqli_query($link, 'INSERT INTO test(id, label) VALUES (101, "a"), (102, "b")')) + if (!$res = mysqli_query($link, "INSERT INTO test(id, label) VALUES (101, 'a'), (102, 'b')")) printf("[005] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp)) @@ -45,7 +45,7 @@ require_once('skipifconnectfailure.inc'); if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp)) printf("[010] Expecting string/any_non_empty, got %s/%s\n", gettype($tmp), $tmp); - if (!$res = mysqli_query($link, 'UPDATE test SET label = "b" WHERE id >= 100')) + if (!$res = mysqli_query($link, "UPDATE test SET label = 'b' WHERE id >= 100")) printf("[011] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!is_string($tmp = mysqli_info($link)) || ('' == $tmp)) diff --git a/ext/mysqli/tests/mysqli_pconn_disabled.phpt b/ext/mysqli/tests/mysqli_pconn_disabled.phpt index 746dd3ba90..609361c5c1 100644 --- a/ext/mysqli/tests/mysqli_pconn_disabled.phpt +++ b/ext/mysqli/tests/mysqli_pconn_disabled.phpt @@ -8,6 +8,8 @@ require_once('skipifconnectfailure.inc'); if (!stristr(mysqli_get_client_info(), 'mysqlnd')) die("skip: only available in mysqlnd"); + +die("skip TODO - we need to add a user level way to check if CHANGE_USER gets called by pconnect"); ?> --INI-- mysqli.allow_persistent=0 @@ -23,7 +25,7 @@ mysqli.max_links=2 printf("[001] Cannot connect to the server using host=%s, user=%s, passwd=***, dbname=%s, port=%s, socket=%s, [%d] %s\n", $host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error()); } - if (!mysqli_query($link1, 'SET @pcondisabled = "Connection 1"')) + if (!mysqli_query($link1, "SET @pcondisabled = 'Connection 1'")) printf("[002] Cannot set user variable to check if we got the same persistent connection, [%d] %s\n", mysqli_errno($link1), mysqli_error($link1)); diff --git a/ext/mysqli/tests/mysqli_pconn_limits.phpt b/ext/mysqli/tests/mysqli_pconn_limits.phpt index 774154deeb..9f8bfe7d78 100644 --- a/ext/mysqli/tests/mysqli_pconn_limits.phpt +++ b/ext/mysqli/tests/mysqli_pconn_limits.phpt @@ -8,6 +8,7 @@ require_once('skipifconnectfailure.inc'); require_once("connect.inc"); if (!$IS_MYSQLND) die("skip mysqlnd test only"); + ?> --INI-- mysqli.allow_persistent=1 @@ -19,7 +20,7 @@ mysqli.max_links=-1 // opens a regular connection require_once("table.inc"); - if (!$res = mysqli_query($link, 'SELECT "works.." as _desc')) + if (!$res = mysqli_query($link, "SELECT 'works..' as _desc")) printf("[001] Cannot run query, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); @@ -31,7 +32,7 @@ mysqli.max_links=-1 printf("[002] Cannot open second regular connection, [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); - if (!$res = mysqli_query($link2, 'SELECT "works..." as _desc')) + if (!$res = mysqli_query($link2, "SELECT 'works...' as _desc")) printf("[003] Cannot run query, [%d] %s\n", mysqli_errno($link2), mysqli_error($link2)); @@ -45,7 +46,7 @@ mysqli.max_links=-1 $host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error()); - if (!$res = mysqli_query($plink, 'SELECT "works..." as _desc')) + if (!$res = mysqli_query($plink, "SELECT 'works...' as _desc")) printf("[005] Cannot run query, [%d] %s\n", mysqli_errno($plink), mysqli_error($plink)); @@ -58,7 +59,7 @@ mysqli.max_links=-1 $host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error()); - if (!$res = mysqli_query($plink2, 'SELECT "works..." as _desc')) + if (!$res = mysqli_query($plink2, "SELECT 'works...' as _desc")) printf("[007] Cannot run query, [%d] %s\n", mysqli_errno($plink2), mysqli_error($plink2)); @@ -72,7 +73,7 @@ mysqli.max_links=-1 $host, $user, $db, $port, $socket, mysqli_connect_errno(), mysqli_connect_error()); - if (!$res = mysqli_query($plink3, 'SELECT "works..." as _desc')) + if (!$res = mysqli_query($plink3, "SELECT 'works...' as _desc")) printf("[009] Cannot run query, [%d] %s\n", mysqli_errno($plink2), mysqli_error($plink2)); diff --git a/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt b/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt index cddc2e6e3f..443259887b 100644 --- a/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt +++ b/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt @@ -28,7 +28,7 @@ if (!$IS_MYSQLND) 'CREATE TABLE IF NOT EXISTS bogus(id INT)', 'SET @a = 1', 'SELECT * FROM test ORDER BY id ASC LIMIT 2', - 'INSERT INTO test(id, label) VALUES (100, "z")', + "INSERT INTO test(id, label) VALUES (100, 'z')", 'SELECT * FROM test ORDER BY id ASC LIMIT 2', 'SELECT', 'UPDATE test SET id = 101 WHERE id > 3', @@ -43,7 +43,7 @@ if (!$IS_MYSQLND) mysqli_real_query($link, "DROP PROCEDURE IF EXISTS p"); if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) { $have_proc = true; - $queries[] = 'CALL p("myversion", @version)'; + $queries[] = "CALL p('myversion', @version)"; } mysqli_close($link); diff --git a/ext/mysqli/tests/mysqli_prepare.phpt b/ext/mysqli/tests/mysqli_prepare.phpt index 4aa671d71a..8c1d8bbd02 100644 --- a/ext/mysqli/tests/mysqli_prepare.phpt +++ b/ext/mysqli/tests/mysqli_prepare.phpt @@ -1,9 +1,9 @@ --TEST-- mysqli_prepare() --SKIPIF-- - --FILE-- @@ -86,7 +86,7 @@ require_once('skipifconnectfailure.inc'); printf("[018] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_stmt_close($stmt); - if (!is_object(($stmt = mysqli_prepare($link, 'DO GET_LOCK("testlock", 1)')))) + if (!is_object(($stmt = mysqli_prepare($link, "DO GET_LOCK('testlock', 1)")))) printf("[019] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); mysqli_stmt_close($stmt); diff --git a/ext/mysqli/tests/mysqli_query.phpt b/ext/mysqli/tests/mysqli_query.phpt index d16ed4352a..12cba90dfa 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -30,19 +30,19 @@ require_once('skipifconnectfailure.inc'); if (false !== ($tmp = mysqli_query($link, 'THIS IS NOT SQL'))) printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = mysqli_query($link, 'SELECT "this is sql but with backslash g"\g'))) + if (false !== ($tmp = mysqli_query($link, "SELECT 'this is sql but with backslash g'\g"))) printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link))) printf("[006] mysqli_errno()/mysqli_error should return some error\n"); - if (!$res = mysqli_query($link, 'SELECT "this is sql but with semicolon" AS valid ; ')) + if (!$res = mysqli_query($link, "SELECT 'this is sql but with semicolon' AS valid ; ")) printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); var_dump(mysqli_fetch_assoc($res)); mysqli_free_result($res); - if (!$res = mysqli_query($link, 'SELECT "a" AS ""')) + if (!$res = mysqli_query($link, "SELECT 'a' AS ''")) printf("[007a] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); var_dump($tmp = mysqli_fetch_assoc($res)); diff --git a/ext/mysqli/tests/mysqli_query_stored_proc.phpt b/ext/mysqli/tests/mysqli_query_stored_proc.phpt index e4f65b0e13..f419205eaa 100644 --- a/ext/mysqli/tests/mysqli_query_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_query_stored_proc.phpt @@ -99,7 +99,7 @@ END;')) { if (!mysqli_query($link, 'CALL p(@version)')) printf("[011] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!mysqli_query($link, 'SET @version = "unknown"')) + if (!mysqli_query($link, "SET @version = 'unknown'")) printf("[012] Cannot reset user variable, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!mysqli_query($link, 'CALL p(@version)')) @@ -124,13 +124,13 @@ END;')) { if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) { /* no result set, one input, one output parameter */ - if (!mysqli_query($link, 'CALL p("myversion", @version)')) + if (!mysqli_query($link, "CALL p('myversion', @version)")) printf("[018] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!mysqli_query($link, 'SET @version = "unknown"')) + if (!mysqli_query($link, "SET @version = 'unknown'")) printf("[019] Cannot reset user variable, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!mysqli_query($link, 'CALL p("myversion", @version)')) + if (!mysqli_query($link, "CALL p('myversion', @version)")) printf("[020] Cannot call SP, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$res = mysqli_query($link, 'SELECT @version as _vers')) diff --git a/ext/mysqli/tests/mysqli_query_unicode.phpt b/ext/mysqli/tests/mysqli_query_unicode.phpt index 5c1037f680..c05f22a2f1 100644 --- a/ext/mysqli/tests/mysqli_query_unicode.phpt +++ b/ext/mysqli/tests/mysqli_query_unicode.phpt @@ -36,19 +36,19 @@ mysqli_close($link); if (false !== ($tmp = mysqli_query($link, 'това не е ескюел'))) printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = mysqli_query($link, 'SELECT "това е ескюел, но със обратна наклонена и g"\g'))) + if (false !== ($tmp = mysqli_query($link, "SELECT 'това е ескюел, но със обратна наклонена и g'\g"))) printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link))) printf("[006] mysqli_errno()/mysqli_error should return some error\n"); - if (!$res = mysqli_query($link, 'SELECT "това ескюел, но с точка и запетая" AS правилен ; ')) + if (!$res = mysqli_query($link, "SELECT 'това ескюел, но с точка и запетая' AS правилен ; ")) printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); var_dump(mysqli_fetch_assoc($res)); mysqli_free_result($res); - if (false !== ($res = mysqli_query($link, 'SELECT "това ескюел, но с точка и запетая" AS правилен ; SHOW VARIABLES'))) + if (false !== ($res = mysqli_query($link, "SELECT 'това ескюел, но с точка и запетая' AS правилен ; SHOW VARIABLES"))) printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (mysqli_get_server_version($link) > 50000) { diff --git a/ext/mysqli/tests/mysqli_real_query.phpt b/ext/mysqli/tests/mysqli_real_query.phpt index 3979f1b009..92961977f3 100644 --- a/ext/mysqli/tests/mysqli_real_query.phpt +++ b/ext/mysqli/tests/mysqli_real_query.phpt @@ -26,13 +26,13 @@ require_once('skipifconnectfailure.inc'); if (false !== ($tmp = mysqli_real_query($link, 'THIS IS NOT SQL'))) printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); - if (false !== ($tmp = mysqli_real_query($link, 'SELECT "this is sql but with backslash g"\g'))) + if (false !== ($tmp = mysqli_real_query($link, "SELECT 'this is sql but with backslash g'\g"))) printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp); if ((0 === mysqli_errno($link)) || ('' == mysqli_error($link))) printf("[006] mysqli_errno()/mysqli_error should return some error\n"); - if (!mysqli_real_query($link, 'SELECT "this is sql but with semicolon" AS valid ; ')) + if (!mysqli_real_query($link, "SELECT 'this is sql but with semicolon' AS valid ; ")) printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!is_object($res = mysqli_use_result($link))) @@ -41,7 +41,7 @@ require_once('skipifconnectfailure.inc'); var_dump(mysqli_fetch_assoc($res)); mysqli_free_result($res); - if (false !== ($res = mysqli_real_query($link, 'SELECT "this is sql but with semicolon" AS valid ; SHOW VARIABLES'))) + if (false !== ($res = mysqli_real_query($link, "SELECT 'this is sql but with semicolon' AS valid ; SHOW VARIABLES"))) printf("[008] Expecting boolean/false, got %s/%s, [%d] %s\n", gettype($res), $res, mysqli_errno($link), mysqli_error($link)); diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt index 25e1050b6a..7b421014df 100644 --- a/ext/mysqli/tests/mysqli_report.phpt +++ b/ext/mysqli/tests/mysqli_report.phpt @@ -270,7 +270,7 @@ require_once('skipifconnectfailure.inc'); else mysqli_stmt_close($stmt); - if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (100, "z")', MYSQLI_USE_RESULT) || + if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (100, 'z')", MYSQLI_USE_RESULT) || !mysqli_query($link, 'DELETE FROM test WHERE id > 50', MYSQLI_USE_RESULT)) printf("[033] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); diff --git a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt index 65e41a25e8..4e69428e3e 100644 --- a/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_stmt_affected_rows.phpt @@ -41,14 +41,14 @@ require_once('skipifconnectfailure.inc'); mysqli_stmt_close($stmt); $stmt = mysqli_stmt_init($link); - if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (1, "a")') || + if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a')") || !mysqli_stmt_execute($stmt)) printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); mysqli_stmt_close($stmt); $stmt = mysqli_stmt_init($link); - if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') || + if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") || !mysqli_stmt_execute($stmt)) printf("[007] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); @@ -58,7 +58,7 @@ require_once('skipifconnectfailure.inc'); mysqli_stmt_close($stmt); $stmt = mysqli_stmt_init($link); - if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') || + if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") || !mysqli_stmt_execute($stmt)) // NOTE: the error message varies with the MySQL Server version, dump only the error code! printf("[009] [%d] (error message varies with the MySQL Server version, check the error code)\n", mysqli_stmt_errno($stmt)); @@ -70,7 +70,7 @@ require_once('skipifconnectfailure.inc'); mysqli_stmt_close($stmt); $stmt = mysqli_stmt_init($link); - if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4') || + if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4") || !mysqli_stmt_execute($stmt)) printf("[011] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); diff --git a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt index f6b7444cba..e4e57138f3 100644 --- a/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt +++ b/ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt @@ -104,7 +104,7 @@ if (mysqli_get_server_version($link) <= 50000) { if (mysqli_real_query($link, 'CREATE PROCEDURE p(IN ver_in VARCHAR(25), OUT ver_out VARCHAR(25)) BEGIN SELECT ver_in INTO ver_out; END;')) { // no result set, one input parameter, output parameter // yes, I really do not want to bind input values... - if (!$stmt = mysqli_prepare($link, 'CALL p("myversion", @version)')) + if (!$stmt = mysqli_prepare($link, "CALL p('myversion', @version)")) printf("[029] Cannot prepare CALL, [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!mysqli_stmt_execute($stmt)) diff --git a/ext/mysqli/tests/mysqli_stmt_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_field_count.phpt index 143c3c268a..11c0e12e2a 100644 --- a/ext/mysqli/tests/mysqli_stmt_field_count.phpt +++ b/ext/mysqli/tests/mysqli_stmt_field_count.phpt @@ -63,7 +63,7 @@ require_once('skipifconnectfailure.inc'); if (0 !== ($tmp = mysqli_stmt_field_count($stmt))) printf("[017] Expecting int/0, got %s/%s\n", gettype($tmp), $tmp); - if (!mysqli_stmt_prepare($stmt, 'UPDATE test SET label = "z" WHERE id = 1') || + if (!mysqli_stmt_prepare($stmt, "UPDATE test SET label = 'z' WHERE id = 1") || !mysqli_stmt_execute($stmt)) printf("[018] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index a29df4ffa4..563209a2ef 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt @@ -41,7 +41,7 @@ require_once('skipifconnectfailure.inc'); if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label)) printf("[008] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); - if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"')) + if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'max_allowed_packet'")) printf("[009] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt index 9d2aa397fd..6c6936cb65 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_libmysql.phpt @@ -31,7 +31,7 @@ if (stristr(mysqli_get_client_info(), 'mysqlnd')) if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label)) printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); - if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"')) + if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'max_allowed_packet'")) printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt index 1600729250..f641819c9c 100644 --- a/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt +++ b/ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt @@ -31,7 +31,7 @@ if (!stristr(mysqli_get_client_info(), 'mysqlnd')) if (!mysqli_stmt_bind_param($stmt, "ib", $id, $label)) printf("[005] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); - if (!$res = mysqli_query($link, 'SHOW VARIABLES LIKE "max_allowed_packet"')) + if (!$res = mysqli_query($link, "SHOW VARIABLES LIKE 'max_allowed_packet'")) printf("[006] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (!$row = mysqli_fetch_assoc($res)) diff --git a/ext/mysqli/tests/mysqli_stmt_store_result.phpt b/ext/mysqli/tests/mysqli_stmt_store_result.phpt index 57d18424bd..b74808bac8 100644 --- a/ext/mysqli/tests/mysqli_stmt_store_result.phpt +++ b/ext/mysqli/tests/mysqli_stmt_store_result.phpt @@ -31,7 +31,7 @@ require_once('skipifconnectfailure.inc'); if (NULL !== ($tmp = @mysqli_stmt_store_result($stmt))) printf("[005] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp); - if (!mysqli_stmt_prepare($stmt, 'INSERT INTO test(id, label) VALUES (100, "z")') || + if (!mysqli_stmt_prepare($stmt, "INSERT INTO test(id, label) VALUES (100, 'z')") || !mysqli_stmt_execute($stmt)) printf("[006] [%d] %s\n", mysqli_stmt_errno($stmt), mysqli_stmt_error($stmt)); diff --git a/ext/mysqli/tests/skipifunicode.inc b/ext/mysqli/tests/skipifunicode.inc index 23cd79d460..da4dd8e6fd 100644 --- a/ext/mysqli/tests/skipifunicode.inc +++ b/ext/mysqli/tests/skipifunicode.inc @@ -1,5 +1,5 @@ ') == 1) { + die('skip Not functional with PHP 6 (fomerly PHP 6 && unicode.semantics=On)'); } ?> diff --git a/ext/mysqli/tests/table.inc b/ext/mysqli/tests/table.inc index 5c6ed6fd28..b36ba7b306 100644 --- a/ext/mysqli/tests/table.inc +++ b/ext/mysqli/tests/table.inc @@ -20,4 +20,4 @@ if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(i if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')")) { printf("[%d] %s\n", mysqli_errno($link), mysqli_error($link)); } -?> +?> \ No newline at end of file -- 2.40.0