uw              Tue Jul  7 11:32:17 2009 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/mysql/tests    mysql_affected_rows.phpt 
                                mysql_field_flags.phpt mysql_info.phpt 
                                mysql_query.phpt 
                                mysql_unbuffered_query.phpt table.inc 
  Log:
  MFH. Fixing tests to run with  SQL_MODE=ANSI_QUOTES as well.
  
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_affected_rows.phpt?r1=1.3.2.5&r2=1.3.2.6&diff_format=u
Index: php-src/ext/mysql/tests/mysql_affected_rows.phpt
diff -u php-src/ext/mysql/tests/mysql_affected_rows.phpt:1.3.2.5 
php-src/ext/mysql/tests/mysql_affected_rows.phpt:1.3.2.6
--- php-src/ext/mysql/tests/mysql_affected_rows.phpt:1.3.2.5    Thu Jul  2 
10:05:37 2009
+++ php-src/ext/mysql/tests/mysql_affected_rows.phpt    Tue Jul  7 11:32:17 2009
@@ -35,18 +35,18 @@
 if (!mysql_query('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) 
ENGINE = ' . $engine, $link))
        printf("[007] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
-if (!mysql_query('INSERT INTO test(id, label) VALUES (1, "a")', $link))
+if (!mysql_query("INSERT INTO test(id, label) VALUES (1, 'a')", $link))
        printf("[008] [%d] %s\n",  mysql_errno($link), mysql_error($link));
 
 if (1 !== ($tmp = mysql_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
-...@mysql_query('INSERT INTO test(id, label) VALUES (1, "a")', $link);
+...@mysql_query("INSERT INTO test(id, label) VALUES (1, 'a')", $link);
 if (-1 !== ($tmp = mysql_affected_rows($link)))
        printf("[011] Expecting int/-1, got %s/%s\n", gettype($tmp), $tmp);
 
-if (!mysql_query('INSERT INTO test(id, label) VALUES (1, "a") ON DUPLICATE KEY 
UPDATE id = 4', $link))
+if (!mysql_query("INSERT INTO test(id, label) VALUES (1, 'a') ON DUPLICATE KEY 
UPDATE id = 4", $link))
        printf("[012] [%d] %s\n",  mysql_errno($link), mysql_error($link));
 
 if (2 !== ($tmp = mysql_affected_rows($link)))
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_field_flags.phpt?r1=1.3.2.5&r2=1.3.2.6&diff_format=u
Index: php-src/ext/mysql/tests/mysql_field_flags.phpt
diff -u php-src/ext/mysql/tests/mysql_field_flags.phpt:1.3.2.5 
php-src/ext/mysql/tests/mysql_field_flags.phpt:1.3.2.6
--- php-src/ext/mysql/tests/mysql_field_flags.phpt:1.3.2.5      Fri Jul  3 
08:42:46 2009
+++ php-src/ext/mysql/tests/mysql_field_flags.phpt      Tue Jul  7 11:32:17 2009
@@ -53,11 +53,11 @@
                                                                'label' => 
array(($version < 500) ? 'multiple_key' : 'unique_key')
                                                                ),
        'labela INT, label2 CHAR(1), KEY keyname (labela, label2)'      =>  
array(
-                                                               array('labela, 
label2', '1, "a"'),
+                                                               array('labela, 
label2', "1, 'a'"),
                                                                'labela' => 
array('multiple_key'),
                                                                ),
        'label1 BLOB'                                           =>  array(
-                                                               array('label1', 
'"blob"'),
+                                                               array('label1', 
"'blob'"),
                                                                'label1' => 
array('blob', 'binary'),
                                                                ),
        'label1 INT UNSIGNED'                                   =>  array(
@@ -70,15 +70,15 @@
                                                                                
'unsigned'),
                                                                ),
        'label1 ENUM("a", "b")'                                 =>  array(
-                                                               array('label1', 
'"a"'),
+                                                               array('label1', 
"'a'"),
                                                                'label1' => 
array('enum'),
                                                                ),
        'label1 SET("a", "b")'                                  =>  array(
-                                                               array('label1', 
'"a"'),
+                                                               array('label1', 
"'a'"),
                                                                'label1' => 
array('set'),
                                                                ),
        'label1 TIMESTAMP'                                      =>  array(
-                                                               array('label1', 
sprintf('"%s"', @date("Y-m-d H:i:s"))),
+                                                               array('label1', 
sprintf("'%s'", @date("Y-m-d H:i:s"))),
                                                                'label1' => 
array(
                                                                                
'timestamp',
                                                                                
'unsigned',
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_info.phpt?r1=1.3.2.4&r2=1.3.2.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_info.phpt
diff -u php-src/ext/mysql/tests/mysql_info.phpt:1.3.2.4 
php-src/ext/mysql/tests/mysql_info.phpt:1.3.2.5
--- php-src/ext/mysql/tests/mysql_info.phpt:1.3.2.4     Fri Jul  3 08:42:46 2009
+++ php-src/ext/mysql/tests/mysql_info.phpt     Tue Jul  7 11:32:17 2009
@@ -16,13 +16,13 @@
        printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
 
 require "table.inc";
-if (!$res = mysql_query('INSERT INTO test(id, label) VALUES (100, "a")', 
$link))
+if (!$res = mysql_query("INSERT INTO test(id, label) VALUES (100, 'a')", 
$link))
        printf("[003] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 if (false !== ($tmp = mysql_info($link)))
        printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), 
$tmp);
 
-if (!$res = mysql_query('INSERT INTO test(id, label) VALUES (101, "a"), (102, 
"b")', $link))
+if (!$res = mysql_query("INSERT INTO test(id, label) VALUES (101, 'a'), (102, 
'b')", $link))
        printf("[005] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 if (!is_string($tmp = mysql_info($link)) || ('' == $tmp))
@@ -40,7 +40,7 @@
 if (!is_string($tmp = mysql_info($link)) || ('' == $tmp))
        printf("[010] Expecting string/any_non_empty, got %s/%s\n", 
gettype($tmp), $tmp);
 
-if (!$res = mysql_query('UPDATE test SET label = "b" WHERE id >= 100', $link))
+if (!$res = mysql_query("UPDATE test SET label = 'b' WHERE id >= 100", $link))
        printf("[011] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 if (!is_string($tmp = mysql_info($link)) || ('' == $tmp))
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_query.phpt?r1=1.4.2.4&r2=1.4.2.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_query.phpt
diff -u php-src/ext/mysql/tests/mysql_query.phpt:1.4.2.4 
php-src/ext/mysql/tests/mysql_query.phpt:1.4.2.5
--- php-src/ext/mysql/tests/mysql_query.phpt:1.4.2.4    Thu Jul  2 10:05:37 2009
+++ php-src/ext/mysql/tests/mysql_query.phpt    Tue Jul  7 11:32:17 2009
@@ -26,26 +26,26 @@
 if (false !== ($tmp = mysql_query('THIS IS NOT SQL', $link)))
        printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), 
$tmp);
 
-if (false !== ($tmp = mysql_query('SELECT "this is sql but with backslash 
g"\g', $link)))
+if (false !== ($tmp = mysql_query("SELECT 'this is sql but with backslash 
g'\g", $link)))
        printf("[005] Expecting boolean/false, got %s/%s\n", gettype($tmp), 
$tmp);
 
 if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
        printf("[006] mysql_errno()/mysql_error should return some error\n");
 
-if (!$res = mysql_query('SELECT "this is sql but with semicolon" AS valid ; ', 
$link))
+if (!$res = mysql_query("SELECT 'this is sql but with semicolon' AS valid ; ", 
$link))
        printf("[007] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 var_dump(mysql_fetch_assoc($res));
 mysql_free_result($res);
 
-if (!$res = mysql_query('SELECT "a" AS ""', $link))
+if (!$res = mysql_query("SELECT 'a' AS ''", $link))
        printf("[007a] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 var_dump($tmp = mysql_fetch_assoc($res));
 var_dump($tmp[""]);
 mysql_free_result($res);
 
-if (false !== ($res = mysql_query('SELECT "this is sql but with semicolon" AS 
valid ; SHOW VARIABLES', $link)))
+if (false !== ($res = mysql_query("SELECT 'this is sql but with semicolon' AS 
valid ; SHOW VARIABLES", $link)))
        printf("[008] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 if (mysql_query('DROP PROCEDURE IF EXISTS p', $link)) {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_unbuffered_query.phpt?r1=1.3.2.4&r2=1.3.2.5&diff_format=u
Index: php-src/ext/mysql/tests/mysql_unbuffered_query.phpt
diff -u php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.3.2.4 
php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.3.2.5
--- php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.3.2.4 Thu Jul  2 
10:05:37 2009
+++ php-src/ext/mysql/tests/mysql_unbuffered_query.phpt Tue Jul  7 11:32:17 2009
@@ -23,19 +23,19 @@
 if (false !== ($tmp = mysql_unbuffered_query('THIS IS NOT SQL', $link)))
        printf("[003] Expecting boolean/false, got %s/%s\n", gettype($tmp), 
$tmp);
 
-if (false !== ($tmp = mysql_unbuffered_query('SELECT "this is sql but with 
backslash g"\g', $link)))
+if (false !== ($tmp = mysql_unbuffered_query("SELECT 'this is sql but with 
backslash g'\g", $link)))
        printf("[004] Expecting boolean/false, got %s/%s\n", gettype($tmp), 
$tmp);
 
 if ((0 === mysql_errno($link)) || ('' == mysql_error($link)))
        printf("[005] mysql_errno()/mysql_error should return some error\n");
 
-if (!$res = mysql_unbuffered_query('SELECT "this is sql but with semicolon" AS 
valid ; ', $link))
+if (!$res = mysql_unbuffered_query("SELECT 'this is sql but with semicolon' AS 
valid ; ", $link))
        printf("[006] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 var_dump(mysql_fetch_assoc($res));
 mysql_free_result($res);
 
-if (false !== ($res = mysql_unbuffered_query('SELECT "this is sql but with 
semicolon" AS valid ; SHOW VARIABLES', $link)))
+if (false !== ($res = mysql_unbuffered_query("SELECT 'this is sql but with 
semicolon' AS valid ; SHOW VARIABLES", $link)))
        printf("[007] [%d] %s\n", mysql_errno($link), mysql_error($link));
 
 if (mysql_unbuffered_query('DROP PROCEDURE IF EXISTS p', $link)) {
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/table.inc?r1=1.3.2.2&r2=1.3.2.3&diff_format=u
Index: php-src/ext/mysql/tests/table.inc
diff -u php-src/ext/mysql/tests/table.inc:1.3.2.2 
php-src/ext/mysql/tests/table.inc:1.3.2.3
--- php-src/ext/mysql/tests/table.inc:1.3.2.2   Wed Oct 10 09:49:37 2007
+++ php-src/ext/mysql/tests/table.inc   Tue Jul  7 11:32:17 2009
@@ -18,7 +18,7 @@
        exit(1);
 }
 
-if (!mysql_query('INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, 
"c"), (4, "d"), (5, "e"), (6, "f")', $link)) {
+if (!mysql_query("INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 
'c'), (4, 'd'), (5, 'e'), (6, 'f')", $link)) {
        printf("[%d] %s\n",  mysql_errno($link), mysql_error($link));
 }
 ?>
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to