diff options
author | Andrey Hristov <andrey@php.net> | 2009-05-27 18:13:56 +0000 |
---|---|---|
committer | Andrey Hristov <andrey@php.net> | 2009-05-27 18:13:56 +0000 |
commit | e3456c0460c5a000e29bf91cd1fdc59e50ce97c0 (patch) | |
tree | ea5677ad210a1333e3d9548a7bd37fce670febc3 /ext/mysqli/tests | |
parent | 8124e94d22f2a1b7ed17216d03feb672769e631e (diff) | |
download | php-git-e3456c0460c5a000e29bf91cd1fdc59e50ce97c0.tar.gz |
Fix tests when the server is running with ANSI_QUOTES
Diffstat (limited to 'ext/mysqli/tests')
26 files changed, 78 insertions, 78 deletions
diff --git a/ext/mysqli/tests/mysqli_affected_rows.phpt b/ext/mysqli/tests/mysqli_affected_rows.phpt index d5d2328293..771ecb47a1 100644 --- a/ext/mysqli/tests/mysqli_affected_rows.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows.phpt @@ -36,18 +36,18 @@ mysqli_affected_rows() if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE = ' . $engine)) printf("[007] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); - if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a")')) + if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a')")) printf("[008] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (1 !== ($tmp = mysqli_affected_rows($link))) printf("[010] 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($link, 'INSERT INTO test(id, label) VALUES (1, "a")'); + mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a')"); if (-1 !== ($tmp = mysqli_affected_rows($link))) printf("[011] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp); - if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY UPDATE id = 4')) + if (!mysqli_query($link, "INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY UPDATE id = 4")) printf("[012] [%d] %s\n", mysqli_errno($link), mysqli_error($link)); if (2 !== ($tmp = mysqli_affected_rows($link))) @@ -128,4 +128,4 @@ mysqli_affected_rows() print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt index 4d82981baf..42ab46eb15 100644 --- a/ext/mysqli/tests/mysqli_affected_rows_oo.phpt +++ b/ext/mysqli/tests/mysqli_affected_rows_oo.phpt @@ -28,7 +28,7 @@ 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)) @@ -39,7 +39,7 @@ mysqli->affected_rows 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)) @@ -107,4 +107,4 @@ mysqli->affected_rows print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_change_user_insert_id.phpt b/ext/mysqli/tests/mysqli_change_user_insert_id.phpt index 51ff25f8a0..5d7a060516 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) @@ -62,4 +62,4 @@ if (!$IS_MYSQLND) { print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt index ad3ed045cb..bcd122daf8 100644 --- a/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt +++ b/ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt @@ -13,8 +13,8 @@ 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"')) - printf("[002] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error()); + if (!$stmt = mysqli_prepare($link, "SELECT 'prepared statements should be released'")) + printf("[002] [%d] %s\n", mysqli_errno(), mysqli_error()); mysqli_change_user($link, $user, $passwd, $db); @@ -30,4 +30,4 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_change_user_set_names.phpt b/ext/mysqli/tests/mysqli_change_user_set_names.phpt index 1ac2d3d76b..547d68c981 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)) @@ -162,4 +162,4 @@ if ($version[0] <= 4 && $version[1] < 1) print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_fetch_field_types.phpt b/ext/mysqli/tests/mysqli_fetch_field_types.phpt index 84038c4c8d..984c14cc1f 100644 --- a/ext/mysqli/tests/mysqli_fetch_field_types.phpt +++ b/ext/mysqli/tests/mysqli_fetch_field_types.phpt @@ -75,7 +75,7 @@ require_once('skipifconnectfailure.inc'); MYSQLI_TYPE_DATETIME => array('DATETIME', '2007-08-20 18:42:01'), MYSQLI_TYPE_YEAR => array('YEAR', '2007'), MYSQLI_TYPE_ENUM => array('ENUM("everything", "is", "just", "wonderful")', 'is'), - // MYSQLI_TYPE_SET => array('SET("I", "smash", "the")', 'I,smash,the'), - string + // MYSQLI_TYPE_SET => array("SET('I', 'smash', 'the')", 'I,smash,the'), - string // MYSQLI_TYPE_TINY_BLOB => array("TINYBLOB", "I got a tiny blog"), - blob // MYSQLI_TYPE_MEDIUM_BLOB => array("MEDIUMBLOB", "No blob for masses"), - blob // MYSQLI_TYPE_LONG_BLOB => array("LONGBLOB", "Small is beautiful?"), - blob @@ -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', @@ -116,4 +116,4 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_field_count.phpt b/ext/mysqli/tests/mysqli_field_count.phpt index 8d1e8da5ea..8ce335fcdb 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); @@ -56,4 +56,4 @@ int(3) Warning: mysqli_field_count(): Couldn't fetch mysqli in %s on line %d NULL -done!
\ No newline at end of file +done! 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 d9a6c4df13..fdb4ea68a7 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)) @@ -94,4 +94,4 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_pconn_disabled.phpt b/ext/mysqli/tests/mysqli_pconn_disabled.phpt index 746dd3ba90..dc64b903fe 100644 --- a/ext/mysqli/tests/mysqli_pconn_disabled.phpt +++ b/ext/mysqli/tests/mysqli_pconn_disabled.phpt @@ -23,7 +23,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)); @@ -60,4 +60,4 @@ Warning: mysqli_connect(): Persistent connections are disabled. Downgrading to n Warning: mysqli_connect(): Persistent connections are disabled. Downgrading to normal in %s on line %d Connecction 1 - SELECT @pcondisabled -> 'Connection 1' Connecction 2 - SELECT @pcondisabled -> '' -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_pconn_limits.phpt b/ext/mysqli/tests/mysqli_pconn_limits.phpt index 774154deeb..4ff345d5c5 100644 --- a/ext/mysqli/tests/mysqli_pconn_limits.phpt +++ b/ext/mysqli/tests/mysqli_pconn_limits.phpt @@ -19,7 +19,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 +31,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 +45,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 +58,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 +72,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)); @@ -93,4 +93,4 @@ Regular connection 2 - 'works...' Persistent connection 1 - 'works...' Persistent connection 2 - 'works...' Persistent connection 3 - 'works...' -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_pconn_reuse.phpt b/ext/mysqli/tests/mysqli_pconn_reuse.phpt index 4a7e75b72f..35fd4dc2dd 100644 --- a/ext/mysqli/tests/mysqli_pconn_reuse.phpt +++ b/ext/mysqli/tests/mysqli_pconn_reuse.phpt @@ -22,7 +22,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)); @@ -47,7 +47,7 @@ mysqli.max_links=2 printf("Connection 2 (no reuse) - Thread ID -> '%s'\n", $thread_id); mysqli_free_result($res); - if (!mysqli_query($link2, 'SET @pcondisabled = "Connection 2"')) + if (!mysqli_query($link2, "SET @pcondisabled = 'Connection 2'")) printf("[006] Cannot set user variable to check if we got the same persistent connection, [%d] %s\n", mysqli_errno($link2), mysqli_error($link2)); @@ -89,4 +89,4 @@ Connection 2 (no reuse) - Thread ID -> '%d' Connection 2 - SELECT @pcondisabled -> 'Connection 2' Connection 2 (reuse) - SELECT @pcondisabled -> 'Connection 2' Connection 2 (reuse) - Thread ID -> '%d' -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt b/ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt index ea063ee04c..95e412986e 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..c96404ddf3 100644 --- a/ext/mysqli/tests/mysqli_prepare.phpt +++ b/ext/mysqli/tests/mysqli_prepare.phpt @@ -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 910338127e..ca25adb089 100644 --- a/ext/mysqli/tests/mysqli_query.phpt +++ b/ext/mysqli/tests/mysqli_query.phpt @@ -30,26 +30,26 @@ 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)); var_dump($tmp[""]); mysqli_free_result($res); - if (false !== ($res = mysqli_query($link, 'SELECT "this is sql but with semicolon" AS valid ; SHOW VARIABLES'))) + if (false !== ($res = mysqli_query($link, "SELECT 'this is sql but with semicolon' AS valid ; 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_query_stored_proc.phpt b/ext/mysqli/tests/mysqli_query_stored_proc.phpt index a1d4fa6786..57b1612f1f 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 99113233c6..f053f4ce92 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 66e0823420..f199d169bd 100644 --- a/ext/mysqli/tests/mysqli_real_query.phpt +++ b/ext/mysqli/tests/mysqli_real_query.phpt @@ -26,17 +26,17 @@ 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))) - printf("[008] Expecting reseult object, got %s/%s [%d] %s\n", gettype($res), $res, mysqli_errno($link), mysqli_error($link)); + printf("[008] Expecting result object, got %s/%s [%d] %s\n", gettype($res), $res, mysqli_errno($link), mysqli_error($link)); var_dump(mysqli_fetch_assoc($res)); mysqli_free_result($res); diff --git a/ext/mysqli/tests/mysqli_report.phpt b/ext/mysqli/tests/mysqli_report.phpt index 25e1050b6a..c07ca8756d 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)); @@ -298,4 +298,4 @@ Warning: mysqli_kill(): processid should have positive value in %s on line %d Warning: mysqli_stmt_prepare(): (%d/%d): 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 'FOO' at line 1 in %s on line %d [013] Access denied for user '%s'@'%s' (using password: YES) [016] Access denied for user '%s'@'%s' (using password: YES) -done!
\ No newline at end of file +done! 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..17e74e87b4 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)) @@ -182,4 +182,4 @@ if (mysqli_get_server_version($link) <= 50000) { print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_stmt_field_count.phpt b/ext/mysqli/tests/mysqli_stmt_field_count.phpt index 143c3c268a..57ca199e4e 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)); @@ -93,4 +93,4 @@ Warning: mysqli_stmt_bind_param(): Number of variables doesn't match number of p Warning: mysqli_stmt_prepare(): Couldn't fetch mysqli_stmt in %s on line %d Warning: mysqli_stmt_field_count(): Couldn't fetch mysqli_stmt in %s on line %d -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt b/ext/mysqli/tests/mysqli_stmt_send_long_data.phpt index 1a0ded0f63..e7f747f552 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)) @@ -130,4 +130,4 @@ require_once('skipifconnectfailure.inc'); Warning: mysqli_stmt_send_long_data(): Invalid parameter number in %s on line %d Warning: mysqli_stmt_send_long_data(): Invalid parameter number in %s on line %d -done!
\ No newline at end of file +done! 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..f908b45d10 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)) @@ -97,4 +97,4 @@ Warning: mysqli_stmt_send_long_data(): There was an error while sending long dat print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_stmt_store_result.phpt b/ext/mysqli/tests/mysqli_stmt_store_result.phpt index 57d18424bd..fb5e24def0 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)); @@ -83,4 +83,4 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/table.inc b/ext/mysqli/tests/table.inc index bfbbed7102..5c6ed6fd28 100644 --- a/ext/mysqli/tests/table.inc +++ b/ext/mysqli/tests/table.inc @@ -17,7 +17,7 @@ if (!mysqli_query($link, 'CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(i exit(1); } -if (!mysqli_query($link, 'INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")')) { +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 +?> |