]> granicus.if.org Git - php/commitdiff
MFH: Fix tests when the server is running with ANSI_QUOTES
authorAndrey Hristov <andrey@php.net>
Wed, 27 May 2009 18:18:58 +0000 (18:18 +0000)
committerAndrey Hristov <andrey@php.net>
Wed, 27 May 2009 18:18:58 +0000 (18:18 +0000)
26 files changed:
ext/mysqli/tests/mysqli_affected_rows.phpt
ext/mysqli/tests/mysqli_affected_rows_oo.phpt
ext/mysqli/tests/mysqli_change_user_insert_id.phpt
ext/mysqli/tests/mysqli_change_user_prepared_statements.phpt
ext/mysqli/tests/mysqli_change_user_set_names.phpt
ext/mysqli/tests/mysqli_fetch_field_types.phpt
ext/mysqli/tests/mysqli_field_count.phpt
ext/mysqli/tests/mysqli_get_charset.phpt
ext/mysqli/tests/mysqli_info.phpt
ext/mysqli/tests/mysqli_pconn_disabled.phpt
ext/mysqli/tests/mysqli_pconn_limits.phpt
ext/mysqli/tests/mysqli_pconn_reuse.phpt
ext/mysqli/tests/mysqli_poll_mixing_insert_select.phpt
ext/mysqli/tests/mysqli_prepare.phpt
ext/mysqli/tests/mysqli_query.phpt
ext/mysqli/tests/mysqli_query_stored_proc.phpt
ext/mysqli/tests/mysqli_query_unicode.phpt
ext/mysqli/tests/mysqli_real_query.phpt
ext/mysqli/tests/mysqli_report.phpt
ext/mysqli/tests/mysqli_stmt_affected_rows.phpt
ext/mysqli/tests/mysqli_stmt_execute_stored_proc.phpt
ext/mysqli/tests/mysqli_stmt_field_count.phpt
ext/mysqli/tests/mysqli_stmt_send_long_data.phpt
ext/mysqli/tests/mysqli_stmt_send_long_data_packet_size_mysqlnd.phpt
ext/mysqli/tests/mysqli_stmt_store_result.phpt
ext/mysqli/tests/table.inc

index d5d232829396b7f8e72e777cc30e1aaa6d071b65..771ecb47a14fbc0be3af39310e22cd125793ac01 100644 (file)
@@ -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!
index 4d82981baf621b600193d98bba2ea117f549123c..42ab46eb156523e721ada66447a0f57ba7e5327c 100644 (file)
@@ -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!
index 51ff25f8a0f14c9216c7206f15e3ec60a3b549da..5d7a0605164db422d30ae83e1af949f16a18e4b5 100644 (file)
@@ -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!
index ad3ed045cb8426f24b6ff103f46e79d0938ba986..bcd122daf81371f6cefd120ac9de44eefa379ba4 100644 (file)
@@ -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!
index 1ac2d3d76b178d0c006ff997da792d6218e4a7f2..547d68c981034508189c6d7243eae98e64c79363 100644 (file)
@@ -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!
index 84038c4c8d5b48d4685966aa194f07754d9d1463..984c14cc1f0fe75eb532f706d417b1f84b56473b 100644 (file)
@@ -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!
index 8d1e8da5ea1eab3ab94e37007393ef9f051dea6f..8ce335fcdbe09c859f5087d9785d140d2ff35759 100644 (file)
@@ -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!
index 3652e7b193a6f35e899927e92c17ece7d3d8f1e3..128e07f8208ddffacf6580c43c5db884a306cbb9 100644 (file)
@@ -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);
index d9a6c4df134fd6bd391e01f612c0883734fd7a9d..fdb4ea68a76abb1f7af2da3118a30289ac819aed 100644 (file)
@@ -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!
index 746dd3ba90799e323a79d79856bf5904318c577d..dc64b903fe6f561816d995dd5b0bbbe1d4fc4160 100644 (file)
@@ -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!
index 774154deeb27aa0767779a4692f8f858530daa9b..4ff345d5c5ce41d6f0e1a5acf31e2d9d8bbbbdf1 100644 (file)
@@ -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!
index c2808579ac08d77234feca3e122e8475db52e04e..0269f696fbc6399ba75b566709681d3de3448aaa 100644 (file)
@@ -24,7 +24,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));
 
@@ -49,7 +49,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));
 
@@ -91,4 +91,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!
index ea063ee04c5192ae214f6ea90044d0fb6f3237e3..95e412986ee69f9dfe45161adcefacba161a4636 100644 (file)
@@ -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);
 
index 4aa671d71a158771ef2500b45e53fd8d990d9766..c96404ddf311ede25058433faa6c437aee387004 100644 (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);
 
index 18f65e23713a90ed06ed0d936be9791593b2aeab..1203f7d363a12d39a81dca85f056934084be1d44 100644 (file)
@@ -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) {
@@ -137,4 +137,4 @@ array(1) {
 unicode(1) "a"
 
 Warning: mysqli_query(): Couldn't fetch mysqli in %s on line %d
-done!
\ No newline at end of file
+done!
index 051b541fdb20b39c8a47468b3381ec0d577c6d96..b79c3b7ae5ae23b4aa34f457b7401d71b63e8277 100644 (file)
@@ -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'))
@@ -209,4 +209,4 @@ array(1) {
   [u"id"]=>
   unicode(1) "1"
 }
-done!
\ No newline at end of file
+done!
index 3b2a3dd710cbef16b45380b283b9717eea4c4c3d..b24c6dede3b74c9a2ff0a183db917590519c37cb 100644 (file)
@@ -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) {
index e151a9b48d31839fe1cd55311a83c19ef5c93e4b..86104adf95ed64a0644eef8d21d63b16d481baf6 100644 (file)
@@ -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);
@@ -104,4 +104,4 @@ array(1) {
 }
 
 Warning: mysqli_real_query(): Couldn't fetch mysqli in %s on line %d
-done!
\ No newline at end of file
+done!
index 25e1050b6a05c09deb335be7c86fee3ea5ab6436..c07ca8756ddc45063fd44b94844cec104c303d5c 100644 (file)
@@ -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!
index 65e41a25e81e4535a6a6db5a8f41fd2a0e54789f..4e69428e3e88c6178a0d921ac8fd9ef39ae0e902 100644 (file)
@@ -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));
 
index f6b7444cba56a373367d949d3d9f948c062cb659..17e74e87b44a814c6da30eb26534b5fe7ebc09d2 100644 (file)
@@ -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!
index 143c3c268a957d6fd46e2ee7abad461ae2a9e05f..57ca199e4ecfe28bb968d32b170e3fe4d99d0fc9 100644 (file)
@@ -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!
index a29df4ffa44f1ec62a843ca7cc4fb40cf558a38a..9263d277aa79271063807014a0e56a28b954e8d4 100644 (file)
@@ -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))
@@ -128,4 +128,4 @@ require_once('skipifconnectfailure.inc');
 ?>
 --EXPECTF--
 Warning: mysqli_stmt_send_long_data(): Invalid parameter number in %s on line %d
-done!
\ No newline at end of file
+done!
index 1600729250d2a83ffedc885c93a00daf9b3ca691..f908b45d108e8046212966625980b7e1f704cea3 100644 (file)
@@ -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!
index 57d18424bd6e8637868adc7588ddea0815db7d0d..fb5e24def0d0a234ccb6680eefc2fe81712b9169 100644 (file)
@@ -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!
index bfbbed7102ef0d5996363682795e47d001ca1bd4..5c6ed6fd280ba2bc841e080ef1313a7cbe5e6fd7 100644 (file)
@@ -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
+?>