uw Tue Jul 7 11:31:45 2009 UTC Modified files: /php-src/ext/mysql/tests connect.inc mysql_affected_rows.phpt mysql_field_flags.phpt mysql_info.phpt mysql_query.phpt mysql_unbuffered_query.phpt skipif.inc table.inc Log: Fixing tests to run with SQL_MODE=ANSI_QUOTES as well.
http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/connect.inc?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/mysql/tests/connect.inc diff -u php-src/ext/mysql/tests/connect.inc:1.5 php-src/ext/mysql/tests/connect.inc:1.6 --- php-src/ext/mysql/tests/connect.inc:1.5 Thu Apr 24 14:04:57 2008 +++ php-src/ext/mysql/tests/connect.inc Tue Jul 7 11:31:45 2009 @@ -62,4 +62,4 @@ false; $IS_MYSQLND = stristr(mysql_get_client_info(), "mysqlnd"); -?> +?> \ No newline at end of file http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/mysql_affected_rows.phpt?r1=1.6&r2=1.7&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.6 php-src/ext/mysql/tests/mysql_affected_rows.phpt:1.7 --- php-src/ext/mysql/tests/mysql_affected_rows.phpt:1.6 Thu Jul 2 10:04:25 2009 +++ php-src/ext/mysql/tests/mysql_affected_rows.phpt Tue Jul 7 11:31:45 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.6&r2=1.7&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.6 php-src/ext/mysql/tests/mysql_field_flags.phpt:1.7 --- php-src/ext/mysql/tests/mysql_field_flags.phpt:1.6 Fri Jul 3 08:42:25 2009 +++ php-src/ext/mysql/tests/mysql_field_flags.phpt Tue Jul 7 11:31:45 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.5&r2=1.6&diff_format=u Index: php-src/ext/mysql/tests/mysql_info.phpt diff -u php-src/ext/mysql/tests/mysql_info.phpt:1.5 php-src/ext/mysql/tests/mysql_info.phpt:1.6 --- php-src/ext/mysql/tests/mysql_info.phpt:1.5 Fri Jul 3 08:42:25 2009 +++ php-src/ext/mysql/tests/mysql_info.phpt Tue Jul 7 11:31:45 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.7&r2=1.8&diff_format=u Index: php-src/ext/mysql/tests/mysql_query.phpt diff -u php-src/ext/mysql/tests/mysql_query.phpt:1.7 php-src/ext/mysql/tests/mysql_query.phpt:1.8 --- php-src/ext/mysql/tests/mysql_query.phpt:1.7 Thu Jul 2 10:04:25 2009 +++ php-src/ext/mysql/tests/mysql_query.phpt Tue Jul 7 11:31:45 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.6&r2=1.7&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.6 php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.7 --- php-src/ext/mysql/tests/mysql_unbuffered_query.phpt:1.6 Thu Jul 2 10:04:25 2009 +++ php-src/ext/mysql/tests/mysql_unbuffered_query.phpt Tue Jul 7 11:31:45 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/skipif.inc?r1=1.5&r2=1.6&diff_format=u Index: php-src/ext/mysql/tests/skipif.inc diff -u php-src/ext/mysql/tests/skipif.inc:1.5 php-src/ext/mysql/tests/skipif.inc:1.6 --- php-src/ext/mysql/tests/skipif.inc:1.5 Mon Jul 23 07:51:37 2007 +++ php-src/ext/mysql/tests/skipif.inc Tue Jul 7 11:31:45 2009 @@ -1,6 +1,6 @@ <?php -require_once('connect.inc'); if (!extension_loaded("mysql")) { die('skip mysql extension not available'); } +require_once('connect.inc'); ?> http://cvs.php.net/viewvc.cgi/php-src/ext/mysql/tests/table.inc?r1=1.3&r2=1.4&diff_format=u Index: php-src/ext/mysql/tests/table.inc diff -u php-src/ext/mysql/tests/table.inc:1.3 php-src/ext/mysql/tests/table.inc:1.4 --- php-src/ext/mysql/tests/table.inc:1.3 Mon Jul 23 07:51:37 2007 +++ php-src/ext/mysql/tests/table.inc Tue Jul 7 11:31:45 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