]> granicus.if.org Git - php/commitdiff
Test update for sql_mode = ANSI
authorUlf Wendel <uw@php.net>
Wed, 22 Sep 2010 15:16:07 +0000 (15:16 +0000)
committerUlf Wendel <uw@php.net>
Wed, 22 Sep 2010 15:16:07 +0000 (15:16 +0000)
30 files changed:
ext/pdo_mysql/tests/bug_42499.phpt
ext/pdo_mysql/tests/bug_pecl_12925.phpt
ext/pdo_mysql/tests/mysql_pdo_test.inc
ext/pdo_mysql/tests/pdo_mysql_attr_autocommit.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_case.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt
ext/pdo_mysql/tests/pdo_mysql_attr_server_info.phpt
ext/pdo_mysql/tests/pdo_mysql_begintransaction.phpt
ext/pdo_mysql/tests/pdo_mysql_commit.phpt
ext/pdo_mysql/tests/pdo_mysql_exec.phpt
ext/pdo_mysql/tests/pdo_mysql_exec_load_data.phpt
ext/pdo_mysql/tests/pdo_mysql_exec_select.phpt
ext/pdo_mysql/tests/pdo_mysql_last_insert_id.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_anonymous.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_emulated_placeholder_everywhere.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_load_data.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_clear_error.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_dup_named_placeholder.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_named_placeholder.phpt
ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt
ext/pdo_mysql/tests/pdo_mysql_rollback.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_columncount.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_non_select.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetch_serialize_simple.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_fetchobject.phpt
ext/pdo_mysql/tests/pdo_mysql_stmt_getcolumnmeta.phpt
ext/pdo_mysql/tests/pdo_mysql_types.phpt
ext/pdo_mysql/tests/pdo_mysql_types_zerofill.phpt

index dece019a9f2a4a61857baa5bbb5594480a1c558d..4ce497ebf93457a659a680378b88bc5029174995 100644 (file)
@@ -27,7 +27,7 @@ $db = MySQLPDOTest::factory();
 function bug_42499($db) {
 
        $db->exec('DROP TABLE IF EXISTS test');
-       $db->exec('CREATE TABLE test(id CHAR(1)); INSERT INTO test(id) VALUES ("a")');
+       $db->exec("CREATE TABLE test(id CHAR(1)); INSERT INTO test(id) VALUES ('a')");
 
        $stmt = $db->query('SELECT id AS _id FROM test');
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
@@ -35,7 +35,7 @@ function bug_42499($db) {
        // You must not use exec() to run statements that create a result set!
        $db->exec('SELECT id FROM test');
        // This will bail at you because you have not fetched the SELECT results: this is not a bug!
-       $db->exec('INSERT INTO test(id) VALUES ("b")');
+       $db->exec("INSERT INTO test(id) VALUES ('b')");
 
 }
 
index 1867868ecb852cc0ee21b6ab2cc87097cf2931c6..dc6933d4b97df32ef8258403b1cb4a831eec7e7f 100644 (file)
@@ -17,10 +17,10 @@ function bug_pecl_1295($db) {
 
        $db->exec('DROP TABLE IF EXISTS test');
        $db->exec('CREATE TABLE test(id CHAR(1))');
-       $db->exec('INSERT INTO test(id) VALUES ("a")');
-       $stmt = $db->prepare('UPDATE test SET id = "b"');
+       $db->exec("INSERT INTO test(id) VALUES ('a')");
+       $stmt = $db->prepare("UPDATE test SET id = 'b'");
        $stmt->execute();
-       $stmt = $db->prepare('UPDATE test SET id = "c"');
+       $stmt = $db->prepare("UPDATE test SET id = 'c'");
        $stmt->execute();
        $stmt = $db->prepare('SELECT id FROM test');
        $stmt->execute();
index 7367919338970f23f1f8dcebf6e921c17496ea0f..01c4cb9aafb02cc7796a9e969e8725871388a529 100644 (file)
@@ -38,7 +38,7 @@ class MySQLPDOTest extends PDOTest {
 
                $db->exec('DROP TABLE IF EXISTS test');
                $db->exec('CREATE TABLE test(id INT, label CHAR(1), PRIMARY KEY(id)) ENGINE=' . $engine);
-               $db->exec('INSERT INTO test(id, label) VALUES (1, "a"), (2, "b"), (3, "c"), (4, "d"), (5, "e"), (6, "f")');
+               $db->exec("INSERT INTO test(id, label) VALUES (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd'), (5, 'e'), (6, 'f')");
        }
 
        static function getTableEngine() {
@@ -159,7 +159,7 @@ class MySQLPDOTest extends PDOTest {
        }
 
        static function dropTestTable($db = NULL) {
-               if (is_null($db)) 
+               if (is_null($db))
                        $db = self::factory();
 
                $db->exec('DROP TABLE IF EXISTS test');
index b1e5507f6765de6149855ac5d994b46e7b3e95a4..9a73f1b296925bd5e3afc200fd832fc592b2799f 100644 (file)
@@ -57,7 +57,7 @@ $db = MySQLPDOTest::factory();
                $row = $db->query('SELECT COUNT(*) AS _num FROM test')->fetch(PDO::FETCH_ASSOC);
                $num = $row['_num'];
 
-               $db->query('INSERT INTO test(id, label) VALUES (100, "z")');
+               $db->query("INSERT INTO test(id, label) VALUES (100, 'z')");
                $num++;
                $row = $db->query('SELECT COUNT(*) AS _num FROM test')->fetch(PDO::FETCH_ASSOC);
                if ($row['_num'] != $num)
index 618d9e65e4be4da9df25e4fcaaa0d6ae535f03bb..8ce8af4a85e05a9e10f9a08d8b56ed952d4ef8fd 100644 (file)
@@ -26,7 +26,7 @@ $db = MySQLPDOTest::factory();
                var_dump($known[$default]);
 
        // lets see what the default is...
-       if (!is_object($stmt = $db->query('SELECT id, id AS "ID_UPPER", label FROM test ORDER BY id ASC LIMIT 2')))
+       if (!is_object($stmt = $db->query("SELECT id, id AS 'ID_UPPER', label FROM test ORDER BY id ASC LIMIT 2")))
                printf("[002] %s - %s\n",
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
@@ -48,7 +48,7 @@ $db = MySQLPDOTest::factory();
                printf("[006] Cannot add column %s - %s\n",
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
-       if (!is_object($stmt = $db->query('SELECT id, id AS "ID_UPPER", label, MiXeD, MYUPPER FROM test ORDER BY id ASC LIMIT 2')))
+       if (!is_object($stmt = $db->query("SELECT id, id AS 'ID_UPPER', label, MiXeD, MYUPPER FROM test ORDER BY id ASC LIMIT 2")))
                printf("[007] %s - %s\n",
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
@@ -62,7 +62,7 @@ $db = MySQLPDOTest::factory();
                printf("[009] getAttribute(PDO::ATTR_CASE) returns wrong value '%s'\n",
                        var_export($tmp, true));
 
-       if (!is_object($stmt = $db->query('SELECT id, label, MiXeD, MYUPPER, MYUPPER AS "lower" FROM test ORDER BY id ASC LIMIT 1')))
+       if (!is_object($stmt = $db->query("SELECT id, label, MiXeD, MYUPPER, MYUPPER AS 'lower' FROM test ORDER BY id ASC LIMIT 1")))
                printf("[010] %s - %s\n",
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
@@ -76,12 +76,12 @@ $db = MySQLPDOTest::factory();
                printf("[012] getAttribute(PDO::ATTR_CASE) returns wrong value '%s'\n",
                        var_export($tmp, true));
 
-       if (!is_object($stmt = $db->query('SELECT id, label, MiXeD, MYUPPER, id AS "ID" FROM test ORDER BY id ASC LIMIT 1')))
+       if (!is_object($stmt = $db->query("SELECT id, label, MiXeD, MYUPPER, id AS 'ID' FROM test ORDER BY id ASC LIMIT 1")))
                printf("[013] %s - %s\n",
                        var_export($db->errorInfo(), true), var_export($db->errorCode(), true));
 
        var_dump($stmt->fetchAll(PDO::FETCH_BOTH));
-       
+
        print "done!";
 ?>
 --CLEAN--
index cdc0b264313d774e0f067e39d0bcba8182a8dd9a..182080440b77ff327afdfeb767169e7a1a72b828 100644 (file)
@@ -24,11 +24,11 @@ MySQLPDOTest::skip();
                printf("[003] Maybe PDO could indicate that this is not a proper way of setting ATTR_ORACLE_NULLS...\n");
 
        $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 1);
-       $stmt = $db->query('SELECT NULL AS z, "" AS a, " " AS b, TRIM(" ") as c, " d" AS d, "' . chr(0) . ' e" AS e');
+       $stmt = $db->query("SELECT NULL AS z, '' AS a, ' ' AS b, TRIM(' ') as c, ' d' AS d, '" . chr(0) . " e' AS e");
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
        $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 0);
-       $stmt = $db->query('SELECT NULL AS z, "" AS a, " " AS b, TRIM(" ") as c, " d" AS d, "' . chr(0) . ' e" AS e');
+       $stmt = $db->query("SELECT NULL AS z, '' AS a, ' ' AS b, TRIM(' ') as c, ' d' AS d, '" . chr(0) . " e' AS e");
        var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
        $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 1);
@@ -43,7 +43,7 @@ MySQLPDOTest::skip();
        $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
 
        if ($have_procedures && (false !== $db->exec('DROP PROCEDURE IF EXISTS p')) &&
-               (false !== $db->exec('CREATE PROCEDURE p() BEGIN SELECT NULL as z, "" AS a, " " AS b, TRIM(" ") as c, " d" AS d, " e" AS e; END;'))) {
+               (false !== $db->exec("CREATE PROCEDURE p() BEGIN SELECT NULL as z, '' AS a, ' ' AS b, TRIM(' ') as c, ' d' AS d, ' e' AS e; END;"))) {
                // requires MySQL 5+
                $stmt = $db->prepare('CALL p()');
                $stmt->execute();
index 558ab232eb5fa36b9263bb30503a07c07abd6ac7..3c21d0f32165df9a1c3546cef9bf6fca95578d09 100644 (file)
@@ -27,7 +27,7 @@ $db = MySQLPDOTest::factory();
                printf("[003] Did we change it from '%s' to '%s'?\n", $info, $info);
 
        // lets hope we always run this in the same second as we did run the server info request...
-       if (!$stmt = $db->query('SHOW STATUS LIKE "%uptime%"'))
+       if (!$stmt = $db->query("SHOW STATUS LIKE '%uptime%'"))
                printf("[004] Cannot run SHOW STATUS, [%s]\n", $db->errorCode());
        else {
                if (!$row = $stmt->fetch(PDO::FETCH_NUM))
index 8871a3170af0099f4f6e13790261cbd79d19f75d..ac9f8a311425f6107f77176c54f58d78f4ddae5f 100644 (file)
@@ -59,7 +59,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
        if (!$db->beginTransaction())
                printf("[011] [%s] %s\n", $db->errorCode(), implode(' ', $db->errorInfo()));
 
-       $db->exec(sprintf('INSERT INTO test(id, label) VALUES (%d, "z")', $row['id']));
+       $db->exec(sprintf("INSERT INTO test(id, label) VALUES (%d, 'z')", $row['id']));
 
        if (!($stmt = $db->query(sprintf('SELECT id, label FROM test WHERE id = %d', $row['id']))))
                printf("[012] [%s] %s\n", $db->errorCode(), implode(' ', $db->errorInfo()));
@@ -166,7 +166,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
                printf("[035] Cannot start a transaction, [%s] [%s]\n",
                        $db->errorCode(), implode(' ', $db->errorInfo()));
 
-       if (0 == $db->exec('INSERT INTO test(id, label) VALUES (1, "a")'))
+       if (0 == $db->exec("INSERT INTO test(id, label) VALUES (1, 'a')"))
                printf("[036] Cannot insert data, [%s] [%s]\n",
                        $db->errorCode(), implode(' ', $db->errorInfo()));
 
index e213f66ea92b4b15f76e6b43e03be293b99f705c..f3cd530f2f43481495e0db71cc764baf6f9c87df 100644 (file)
@@ -37,7 +37,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
                if (true !== ($tmp = $db->beginTransaction()))
                        printf("[004] Expecting true, got %s/%s\n", gettype($tmp), $tmp);
 
-               $db->exec('INSERT INTO test(id, label) VALUES (100, "z")');
+               $db->exec("INSERT INTO test(id, label) VALUES (100, 'z')");
 
                if (true !== ($tmp = $db->commit()))
                        printf("[005] No commit allowed? [%s] %s\n",
@@ -59,7 +59,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
                if (true !== ($tmp = $db->beginTransaction()))
                        printf("[007] Expecting true, got %s/%s\n", gettype($tmp), $tmp);
 
-               $db->exec('INSERT INTO test(id, label) VALUES (100, "z")');
+               $db->exec("INSERT INTO test(id, label) VALUES (100, 'z')");
                if (true !== ($tmp = $db->commit()))
                        printf("[008] No commit allowed? [%s] %s\n",
                                $db->errorCode(), implode(' ', $db->errorInfo()));
index 381a2b51df5a7563b607f7d8654c657e54e0caa8..2a0f5271809a0765a3c47e958739e6d79ce76ef7 100644 (file)
@@ -38,14 +38,14 @@ MySQLPDOTest::skip();
 
                exec_and_count(2, $db, 'DROP TABLE IF EXISTS test', 0);
                exec_and_count(3, $db, sprintf('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, col1 CHAR(10)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE), 0);
-               exec_and_count(4, $db, 'INSERT INTO test(id, col1) VALUES (1, "a")', 1);
-               exec_and_count(5, $db, 'INSERT INTO test(id, col1) VALUES (2, "b"), (3, "c")', 2);
-               exec_and_count(6, $db, 'UPDATE test SET id = 4 WHERE id = 3', 1);
-               exec_and_count(7, $db, 'INSERT INTO test(id, col1) VALUES (1, "d") ON DUPLICATE KEY UPDATE id = 3', 2);
-               exec_and_count(8, $db, 'UPDATE test SET id = 5 WHERE id = 5', 0);
-               exec_and_count(9, $db, 'INSERT INTO test(id, col1) VALUES (5, "e") ON DUPLICATE KEY UPDATE id = 6', 1);
-               exec_and_count(10, $db, 'REPLACE INTO test(id, col1) VALUES (5, "f")', 2);
-               exec_and_count(11, $db, 'REPLACE INTO test(id, col1) VALUES (6, "g")', 1);
+               exec_and_count(4, $db, "INSERT INTO test(id, col1) VALUES (1, 'a')", 1);
+               exec_and_count(5, $db, "INSERT INTO test(id, col1) VALUES (2, 'b'), (3, 'c')", 2);
+               exec_and_count(6, $db, "UPDATE test SET id = 4 WHERE id = 3", 1);
+               exec_and_count(7, $db, "INSERT INTO test(id, col1) VALUES (1, 'd') ON DUPLICATE KEY UPDATE id = 3", 2);
+               exec_and_count(8, $db, "UPDATE test SET id = 5 WHERE id = 5", 0);
+               exec_and_count(9, $db, "INSERT INTO test(id, col1) VALUES (5, 'e') ON DUPLICATE KEY UPDATE id = 6", 1);
+               exec_and_count(10, $db, "REPLACE INTO test(id, col1) VALUES (5, 'f')", 2);
+               exec_and_count(11, $db, "REPLACE INTO test(id, col1) VALUES (6, 'g')", 1);
                exec_and_count(12, $db, 'DELETE FROM test WHERE id > 2', 4);
                exec_and_count(13, $db, 'DROP TABLE test', 0);
                exec_and_count(14, $db, 'SET @myvar = 1', 0);
@@ -54,7 +54,7 @@ MySQLPDOTest::skip();
                printf("[016] [%s] %s\n", $db->errorCode(), implode(' ', $db->errorInfo()));
 
                exec_and_count(36, $db, sprintf('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, col1 CHAR(10)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE), 0);
-               exec_and_count(37, $db, 'INSERT INTO test(id, col1) VALUES (1, "a")', 1);
+               exec_and_count(37, $db, "INSERT INTO test(id, col1) VALUES (1, 'a')", 1);
                // Results may vary. Typically you will get 1. But the MySQL 5.1 manual states: Truncation operations do not return the number of deleted rows.
                // Don't rely on any return value!
                exec_and_count(38, $db, 'TRUNCATE TABLE test', NULL);
index 1310c0e643d5e6b63c2982f343909485cac26e3b..37de557527767bb97d63d2b2f869e54228e1cdf6 100644 (file)
@@ -57,7 +57,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                exec_and_count(2, $db, 'DROP TABLE IF EXISTS test', 0);
                exec_and_count(3, $db, sprintf('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, col1 CHAR(10)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE), 0);
 
-               $stmt = $db->query('SHOW VARIABLES LIKE "secure_file_priv"');
+               $stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'");
                if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
                        $filename = $row['value'] . DIRECTORY_SEPARATOR  . "pdo_mysql_exec_load_data.csv";
                } else {
index ef85fabe6f3bfdcc26db203ab054f272f60c1e1e..d0e0ffcba716a7d4bff586eb2a3343b63ceaad29 100644 (file)
@@ -38,19 +38,19 @@ MySQLPDOTest::skip();
 
                exec_and_count(2, $db, 'DROP TABLE IF EXISTS test', 0);
                exec_and_count(3, $db, sprintf('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, col1 CHAR(10)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE), 0);
-               exec_and_count(4, $db, 'INSERT INTO test(id, col1) VALUES (1, "a")', 1);
+               exec_and_count(4, $db, "INSERT INTO test(id, col1) VALUES (1, 'a')", 1);
                // question is: will the result set be cleaned up, will it be possible to run more queries on the line?
                // buffered or unbuffered does not matter!
                $db->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);
                exec_and_count(5, $db, 'SELECT id FROM test', 0);
-               exec_and_count(6, $db, 'INSERT INTO test(id, col1) VALUES (2, "b")', 1);
+               exec_and_count(6, $db, "INSERT INTO test(id, col1) VALUES (2, 'b')", 1);
 
        } catch (PDOException $e) {
                printf("[001] %s, [%s] %s\n",
                        $e->getMessage(),
                        $db->errorCode(), implode(' ', $db->errorInfo()));
        }
-       
+
        print "done!";
 ?>
 --CLEAN--
@@ -61,5 +61,5 @@ $db = MySQLPDOTest::factory();
 ?>
 --EXPECTF--
 Warning: PDO::exec(): SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute. in %s on line %d
-[006] Expecting '1'/integer got ''/boolean when running 'INSERT INTO test(id, col1) VALUES (2, "b")', [HY000] HY000 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
+[006] Expecting '1'/integer got ''/boolean when running 'INSERT INTO test(id, col1) VALUES (2, 'b')', [HY000] HY000 2014 Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
 done!
\ No newline at end of file
index 2bb5573f3b557ea75933b16e345a06156d1f403e..313b20d18941a26aca3b6fc88c1c7395d6d62165 100644 (file)
@@ -34,7 +34,7 @@ $db = MySQLPDOTest::factory();
                        printf("[005] Expecting '0'/string got '%s'/%s", var_export($tmp, true), gettype($tmp));
 
                // no auto increment column
-               $db->exec('INSERT INTO test(id, col1) VALUES (100, "a")');
+               $db->exec("INSERT INTO test(id, col1) VALUES (100, 'a')");
                if ('0' !== ($tmp = $db->lastInsertId()))
                        printf("[006] Expecting '0'/string got '%s'/%s", var_export($tmp, true), gettype($tmp));
 
@@ -43,17 +43,17 @@ $db = MySQLPDOTest::factory();
                        printf("[006] Expecting '0'/string got '%s'/%s", var_export($tmp, true), gettype($tmp));
 
                // duplicate key
-               @$db->exec('INSERT INTO test(id, col1) VALUES (100, "a")');
+               @$db->exec("INSERT INTO test(id, col1) VALUES (100, 'a')");
                if ('0' !== ($tmp = $db->lastInsertId()))
                        printf("[007] Expecting '0'/string got '%s'/%s", var_export($tmp, true), gettype($tmp));
 
-               $db->exec('INSERT INTO test(id, col1) VALUES (101, "b")');
+               $db->exec("INSERT INTO test(id, col1) VALUES (101, 'b')");
                if ('101' !== ($tmp = $db->lastInsertId()))
                        printf("[008] Expecting '0'/string got '%s'/%s", var_export($tmp, true), gettype($tmp));
 
                $db->exec('ALTER TABLE test MODIFY col1 CHAR(10) UNIQUE');
                // replace = delete + insert -> new auto increment value
-               $db->exec('REPLACE INTO test(col1) VALUES ("b")');
+               $db->exec("REPLACE INTO test(col1) VALUES ('b')");
                $next_id = (int)$db->lastInsertId();
 
                if ($next_id <= 101)
@@ -67,7 +67,7 @@ $db = MySQLPDOTest::factory();
                                $last_id, $next_id);
                }
 
-               $db->exec('INSERT INTO test(col1) VALUES ("c"), ("d"), ("e")');
+               $db->exec("INSERT INTO test(col1) VALUES ('c'), ('d'), ('e')");
                $next_id = (int)$db->lastInsertId();
                if ($next_id <= $last_id)
                        printf("[011] Expecting at least %d, got %d\n", $last_id + 1, $next_id);
@@ -91,7 +91,7 @@ $db = MySQLPDOTest::factory();
                        $row = $stmt->fetch(PDO::FETCH_ASSOC);
                        $last_id = $row['_last_id'];
 
-                       $db->exec('INSERT INTO test(col1) VALUES ("z")');
+                       $db->exec("INSERT INTO test(col1) VALUES ('z')");
                        $next_id = (int)$db->lastInsertId();
                        if ($next_id < ($last_id + $inc))
                                printf("[012] Expecting at least %d, got %d\n", $last_id + $inc, $next_id);
index 4447146eef1b1148a9dcbedf89d5e19c86374008..b2db0d9eed4309d6d95e21e887cb60de00936295 100644 (file)
@@ -98,12 +98,12 @@ $db = MySQLPDOTest::factory();
 
                prepex(5, $db, 'DROP TABLE IF EXISTS test');
                prepex(6, $db, sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               prepex(7, $db, 'INSERT INTO test(id, label) VALUES(1, ":placeholder")');
+               prepex(7, $db, "INSERT INTO test(id, label) VALUES(1, ':placeholder')");
                $stmt = prepex(8, $db, 'SELECT label FROM test');
                var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
                prepex(9, $db, 'DELETE FROM test');
-               prepex(10, $db, 'INSERT INTO test(id, label) VALUES(1, ":placeholder")',
+               prepex(10, $db, "INSERT INTO test(id, label) VALUES(1, ':placeholder')",
                        array(':placeholder' => 'first row'));
                $stmt = prepex(11, $db, 'SELECT label FROM test');
 
@@ -200,12 +200,12 @@ $db = MySQLPDOTest::factory();
                // and now, the same with anonymous placeholders...
                prepex(45, $db, 'DROP TABLE IF EXISTS test');
                prepex(46, $db, sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               prepex(47, $db, 'INSERT INTO test(id, label) VALUES(1, "?")');
+               prepex(47, $db, "INSERT INTO test(id, label) VALUES(1, '?')");
                $stmt = prepex(48, $db, 'SELECT label FROM test');
                var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
                prepex(49, $db, 'DELETE FROM test');
-               prepex(50, $db, 'INSERT INTO test(id, label) VALUES(1, "?")',
+               prepex(50, $db, "INSERT INTO test(id, label) VALUES(1, '?')",
                        array('first row'));
                $stmt = prepex(51, $db, 'SELECT label FROM test');
 
index c382025ba70b265b264b2fc70db51f19486e5350..c6b299e0761a99d22cb1fd17bcdb6b7a6d6c3cc1 100644 (file)
@@ -20,7 +20,7 @@ $db = MySQLPDOTest::factory();
                $db->exec('DROP TABLE IF EXISTS test');
                $db->exec(sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
 
-               $stmt = $db->prepare('INSERT INTO test(id, label) VALUES(1, "?")');
+               $stmt = $db->prepare("INSERT INTO test(id, label) VALUES(1, '?')");
                // you can bind as many values as you want no matter if they can be replaced or not
                $stmt->execute(array('first row'));
                if ('00000' !== $stmt->errorCode())
@@ -39,7 +39,7 @@ $db = MySQLPDOTest::factory();
                        printf("[004] Unable to switch off emulated prepared statements, test will fail\n");
 
                $db->exec('DELETE FROM test');
-               $stmt = $db->prepare('INSERT INTO test(id, label) VALUES(1, "?")');
+               $stmt = $db->prepare("INSERT INTO test(id, label) VALUES(1, '?')");
                // you can bind as many values as you want no matter if they can be replaced or not
                $stmt->execute(array('first row'));
                if ('00000' !== $stmt->errorCode())
index e8f7d39840aeaa6e6a9660f1f96ecb047d91078a..3a77d5eee1b3ce410cb3d098295af21dbc1a4ee0 100644 (file)
@@ -20,7 +20,7 @@ MySQLPDOTest::skip();
 
                $db->exec('DROP TABLE IF EXISTS test');
                $db->exec(sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               $db->exec('INSERT INTO test(id, label) VALUES (1, "row1")');
+               $db->exec("INSERT INTO test(id, label) VALUES (1, 'row1')");
 
                // So, what will happen? More placeholder but values and
                // placeholders in interesting places...
index b8b77ff5dbafda5be40daadc1f26aa8b7ce4f955..37d9cbdb7768de5dab24c7228ff1465e72f8fa55 100644 (file)
@@ -60,7 +60,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                exec_and_count(2, $db, 'DROP TABLE IF EXISTS test', 0);
                exec_and_count(3, $db, sprintf('CREATE TABLE test(id INT NOT NULL PRIMARY KEY, col1 CHAR(10)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE), 0);
 
-               $stmt = $db->query('SHOW VARIABLES LIKE "secure_file_priv"');
+               $stmt = $db->query("SHOW VARIABLES LIKE 'secure_file_priv'");
                if (($row = $stmt->fetch(PDO::FETCH_ASSOC)) && ($row['value'] != '')) {
                        $filename = $row['value'] . DIRECTORY_SEPARATOR  . "pdo_mysql_exec_load_data.csv";
                } else {
@@ -82,7 +82,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                }
 
                // Check the line
-               $stmt = $db->query('SELECT 1 as "one"');
+               $stmt = $db->query("SELECT 1 as 'one'");
                if ($stmt->errorCode() != '0000') {
                        printf("[005] [%d] %s\n", $stmt->errorCode(), var_export($stmt->errorInfo(), true));
                } else {
@@ -100,7 +100,7 @@ if (($tmp[1] !== 'localhost') && ($tmp[1] !== '127.0.0.1'))
                        implode(' ', $db->errorInfo()),
                        (isset($stmt)) ? implode(' ', $stmt->errorInfo()) : 'N/A');
        }
-       
+
        print "done!";
 ?>
 --CLEAN--
index b9027c8980c1be170df367656d0acecc94dd0a41..43006c6d58be7defc813baf07d9f9acceb1d7c53 100644 (file)
@@ -119,7 +119,7 @@ $db = MySQLPDOTest::factory();
 
                prepex(5, $db, 'DROP TABLE IF EXISTS test');
                prepex(6, $db, sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               prepex(7, $db, 'INSERT INTO test(id, label) VALUES(1, ":placeholder")');
+               prepex(7, $db, "INSERT INTO test(id, label) VALUES(1, ':placeholder')");
                $stmt = prepex(8, $db, 'SELECT label FROM test ORDER BY id ASC');
                var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
@@ -183,8 +183,8 @@ $db = MySQLPDOTest::factory();
                }
 
                $db->exec('DELETE FROM test');
-               $db->exec('INSERT INTO test(id, label) VALUES (1, "row1")');
-               $db->exec('INSERT INTO test(id, label) VALUES (2, "row2")');
+               $db->exec("INSERT INTO test(id, label) VALUES (1, 'row1')");
+               $db->exec("INSERT INTO test(id, label) VALUES (2, 'row2')");
 
                $sql = sprintf("SELECT id, label FROM test WHERE (label LIKE %s) AND (id = :placeholder)",
                        $db->quote('%ro%'));
@@ -201,7 +201,7 @@ $db = MySQLPDOTest::factory();
                // and now, the same with anonymous placeholders...
                prepex(33, $db, 'DROP TABLE IF EXISTS test');
                prepex(34, $db, sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               prepex(35, $db, 'INSERT INTO test(id, label) VALUES(1, "?")');
+               prepex(35, $db, "INSERT INTO test(id, label) VALUES(1, '?')");
                $stmt = prepex(36, $db, 'SELECT label FROM test');
                var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
 
index 8c367af249468cff831588d1033b68a2c1a0fc73..42c3d074ad3db63f5dfbec44c29e029de0c47441 100644 (file)
@@ -23,7 +23,7 @@ $db = MySQLPDOTest::factory();
                        printf("[002] Unable to turn on emulated prepared statements\n");
 
                // INSERT a single row
-               $db->exec('INSERT INTO test(id, label) VALUES (1, "row1")');
+               $db->exec("INSERT INTO test(id, label) VALUES (1, 'row1')");
 
                $stmt = $db->prepare('SELECT unknown_column FROM test WHERE id > :placeholder ORDER BY id ASC');
                $stmt->execute(array(':placeholder' => 0));
index c9d122a813105f274be4509d6d4f6b83399e6d26..e382dff375cf0912d3f4cb4eef017d5361d0eacd 100644 (file)
@@ -60,7 +60,7 @@ $db = MySQLPDOTest::factory();
                //
 
                $db->exec('DELETE FROM test');
-               $db->exec('INSERT INTO test (id, label1, label2) VALUES (1, "row1", "row2")');
+               $db->exec("INSERT INTO test (id, label1, label2) VALUES (1, 'row1', 'row2')");
                $sql = "SELECT id, label1 FROM test WHERE id = :placeholder AND label1 = (SELECT label1 AS 'SELECT' FROM test WHERE id = :placeholder)";
 
                // emulated...
index c4a74eadfa25b3503db72294be7cb4557b5357c4..530170d5766d36d21354cef2d5f709ff581c7999 100644 (file)
@@ -22,7 +22,7 @@ $db = MySQLPDOTest::factory();
                        printf("[002] Unable to turn off emulated prepared statements\n");
 
                // INSERT a single row
-               $stmt = $db->prepare('INSERT INTO test(id, label) VALUES (100, ":placeholder")');
+               $stmt = $db->prepare("INSERT INTO test(id, label) VALUES (100, ':placeholder')");
 
                // Yes, there is no placeholder to bind to and named placeholder
                // do not work with MySQL native PS, but lets see what happens!
@@ -45,7 +45,7 @@ $db = MySQLPDOTest::factory();
                        printf("[004] Unable to turn on emulated prepared statements\n");
 
                // Note that the "named placeholder" is enclosed by double quotes.
-               $stmt = $db->prepare('INSERT INTO test(id, label) VALUES(101, ":placeholder")');
+               $stmt = $db->prepare("INSERT INTO test(id, label) VALUES(101, ':placeholder')");
                // No replacement shall be made
                $stmt->execute(array(':placeholder' => 'row1'));
                // Again, I'd like to see an error message
index 0f8c8880e3a51d12bc2e755766a889cc0aefb1b6..dbff9c4b9537ba34e87611f0cbf239cfe0f2cd25 100644 (file)
@@ -18,7 +18,7 @@ $db = MySQLPDOTest::factory();
 
                $db->exec('DROP TABLE IF EXISTS test');
                $db->exec(sprintf('CREATE TABLE test(id INT, label CHAR(255)) ENGINE=%s', PDO_MYSQL_TEST_ENGINE));
-               $db->exec('INSERT INTO test(id, label) VALUES (1, "row1")');
+               $db->exec("INSERT INTO test(id, label) VALUES (1, 'row1')");
 
                $stmt = $db->prepare('SELECT ?, id, label FROM test WHERE ? = ? ORDER BY id ASC');
                $stmt->execute(array('id', 'label', 'label'));
index 193b1a159c431da3d79de43468b6e7d476a9ea77..c0737b2ecc3eaee4e11d70e9d3358212152194ba 100644 (file)
@@ -20,7 +20,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
        $row = $db->query('SELECT COUNT(*) AS _num FROM test')->fetch(PDO::FETCH_ASSOC);
        $num = $row['_num'];
 
-       $db->query('INSERT INTO test(id, label) VALUES (100, "z")');
+       $db->query("INSERT INTO test(id, label) VALUES (100, 'z')");
        $num++;
        $row = $db->query('SELECT COUNT(*) AS _num FROM test')->fetch(PDO::FETCH_ASSOC);
        if ($row['_num'] != $num)
@@ -33,7 +33,7 @@ if (false == MySQLPDOTest::detect_transactional_mysql_engine($db))
                printf("[002] ROLLBACK has failed\n");
 
        $db->beginTransaction();
-       $db->query('INSERT INTO test(id, label) VALUES (100, "z")');
+       $db->query("INSERT INTO test(id, label) VALUES (100, 'z')");
        $db->query('DROP TABLE IF EXISTS test2');
        $db->query('CREATE TABLE test2(id INT)');
        $num++;
index 85985dde891202b38d945a164688948505c69605..54b433f3ccc35973fc87ee21e12eac45893d81af 100644 (file)
@@ -22,7 +22,7 @@ $db = MySQLPDOTest::factory();
                if (1 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY))
                        printf("[002] Unable to turn on emulated prepared statements\n");
 
-               $stmt = $db->prepare('SELECT id, label, "?" as foo FROM test');
+               $stmt = $db->prepare("SELECT id, label, '?' as foo FROM test");
                $stmt->execute();
                var_dump($stmt->columnCount());
 
@@ -40,7 +40,7 @@ $db = MySQLPDOTest::factory();
                if (0 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY))
                        printf("[004] Unable to turn off emulated prepared statements\n");
 
-               $stmt = $db->prepare('SELECT id, label, "?" as foo, "TODO - Stored Procedure" as bar FROM test');
+               $stmt = $db->prepare("SELECT id, label, '?' as foo, 'TODO - Stored Procedure' as bar FROM test");
                $stmt->execute();
                var_dump($stmt->columnCount());
 
index 928e90de621ce723cd1d5499633717f6de529913..fa4b122ef28ff48f956aa693d0c2d2bdae6ac241 100644 (file)
@@ -70,7 +70,7 @@ MySQLPDOTest::skip();
                        printf("[011] Unable to turn off emulated prepared statements\n");
 
                $native_support = 'no';
-               if ($db->exec('PREPARE mystmt FROM "DESCRIBE test id"')) {
+               if ($db->exec("PREPARE mystmt FROM 'DESCRIBE test id'")) {
                        $native_support = 'yes';
                        $db->exec('DEALLOCATE PREPARE mystmt');
                }
@@ -104,7 +104,7 @@ MySQLPDOTest::skip();
 
 
                $native_support = 'no';
-               if ($db->exec('PREPARE mystmt FROM "SHOW ENGINES"')) {
+               if ($db->exec("PREPARE mystmt FROM 'SHOW ENGINES'")) {
                        $native_support = 'yes';
                        $db->exec('DEALLOCATE PREPARE mystmt');
                }
@@ -137,7 +137,7 @@ MySQLPDOTest::skip();
                                var_export($show_native, true));
 
                $native_support = 'no';
-               if ($db->exec('PREPARE mystmt FROM "EXPLAIN SELECT id FROM test"')) {
+               if ($db->exec("PREPARE mystmt FROM 'EXPLAIN SELECT id FROM test'")) {
                        $native_support = 'yes';
                        $db->exec('DEALLOCATE PREPARE mystmt');
                }
index e9b231cfdd9025aef45f37870acdd708896c0915..a935e1aca0e1aa9ad347fd0696570265278fe2b9 100644 (file)
@@ -45,7 +45,7 @@ if (version_compare(PHP_VERSION, '5.1.0', '<'))
                printf("\nAnd now magic PDO using fetchAll(PDO::FETCH_CLASS|PDO::FETCH_SERIALIZE)...\n");
                $db->exec('DROP TABLE IF EXISTS test');
                $db->exec(sprintf('CREATE TABLE test(myobj BLOB) ENGINE=%s', MySQLPDOTest::getTableEngine()));
-               $db->exec('INSERT INTO test(myobj) VALUES ("Data fetched from DB to be given to unserialize()")');
+               $db->exec("INSERT INTO test(myobj) VALUES ('Data fetched from DB to be given to unserialize()')");
 
                $stmt = $db->prepare('SELECT myobj FROM test');
                $stmt->execute();
index 99bade2a689a7e68a95e01bfb4bcda609f058893..2e278b1afb26f37d6ca9c4aae58ff73a26455d3a 100644 (file)
@@ -6,6 +6,16 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
 require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
 MySQLPDOTest::skip();
 $db = MySQLPDOTest::factory();
+
+try {
+       $query = "SELECT '', NULL, \"\" FROM DUAL";
+       $stmt = $db->prepare($query);
+       $ok = @$stmt->execute();
+} catch (PDOException $e) {
+       die("skip: Test cannot be run with SQL mode ANSI");
+}
+if (!$ok)
+       die("skip: Test cannot be run with SQL mode ANSI");
 ?>
 --FILE--
 <?php
@@ -15,7 +25,6 @@ MySQLPDOTest::createTestTable($db);
 
 try {
 
-       // default settings
        $query = "SELECT id, '', NULL, \"\" FROM test ORDER BY id ASC LIMIT 3";
        $stmt = $db->prepare($query);
 
@@ -39,7 +48,7 @@ try {
                        $this->not_a_magic_one();
                        printf("myclass::__set(%s, -%s-) %d\n",
                                $prop, var_export($value, true), $this->set_calls, self::$static_set_calls);
-                       if ("" != $prop) 
+                       if ("" != $prop)
                                $this->{$prop} = $value;
                }
 
index 19ae1951dc31315947b4ac71df12c77374fce2c9..0fef33487846cea75595bf0dfa4908874e7d4701 100644 (file)
@@ -76,7 +76,7 @@ try {
                        return true;
                }
 
-               if (!$db->exec(sprintf('INSERT INTO test(id, label) VALUES (1, "%s")', $value))) {
+               if (!$db->exec(sprintf("INSERT INTO test(id, label) VALUES (1, '%s')", $value))) {
                        printf("[%03d] + 1] Insert failed, %d - %s\n", $offset,
                                $db->errorCode(), var_export($db->errorInfo(), true));
                        return false;
@@ -141,6 +141,11 @@ try {
                return true;
        }
 
+       $stmt = $db->prepare('SELECT @@sql_mode AS _mode');
+       $stmt->execute();
+       $row = $stmt->fetch(PDO::FETCH_ASSOC);
+       $real_as_float = (false === stristr($row['_mode'], "REAL_AS_FLOAT")) ? false : true;
+
        $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
        $is_mysqlnd = MySQLPDOTest::isPDOMySQLnd();
        test_meta($db, 20, 'BIT(8)', 1, NULL, ($is_mysqlnd) ? PDO::PARAM_INT : PDO::PARAM_STR);
@@ -160,10 +165,10 @@ try {
        test_meta($db, 120, 'BIGINT', -9223372036854775808, 'LONGLONG', ($is_mysqlnd) ? ((PHP_INT_SIZE == 4) ? PDO::PARAM_STR : PDO::PARAM_INT) : PDO::PARAM_STR);
        test_meta($db, 130, 'BIGINT UNSIGNED', 18446744073709551615, 'LONGLONG', ($is_mysqlnd) ? ((PHP_INT_SIZE == 4) ? PDO::PARAM_STR : PDO::PARAM_INT) : PDO::PARAM_STR);
 
-       test_meta($db, 130, 'REAL', -1.01, 'DOUBLE', PDO::PARAM_STR);
-       test_meta($db, 140, 'REAL UNSIGNED', 1.01, 'DOUBLE', PDO::PARAM_STR);
-       test_meta($db, 150, 'REAL ZEROFILL', -1.01, 'DOUBLE', PDO::PARAM_STR);
-       test_meta($db, 160, 'REAL UNSIGNED ZEROFILL', 1.01, 'DOUBLE', PDO::PARAM_STR);
+       test_meta($db, 130, 'REAL', -1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR);
+       test_meta($db, 140, 'REAL UNSIGNED', 1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR);
+       test_meta($db, 150, 'REAL ZEROFILL', -1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR);
+       test_meta($db, 160, 'REAL UNSIGNED ZEROFILL', 1.01, ($real_as_float) ? 'FLOAT' : 'DOUBLE', PDO::PARAM_STR);
 
        test_meta($db, 170, 'DOUBLE', -1.01, 'DOUBLE', PDO::PARAM_STR);
        test_meta($db, 180, 'DOUBLE UNSIGNED', 1.01, 'DOUBLE', PDO::PARAM_STR);
index 3629ab9a34e53f1b6c34f5a256f0f46a96e9e012..22c6b66c9856786b054fcb9ab0c4574c8ea84e7a 100644 (file)
@@ -103,8 +103,8 @@ MySQLPDOTest::skip();
        test_type($db, 80, 'MEDIUMINT', -8388608, ($is_mysqlnd) ? -8388608 : '-8388608');
        test_type($db, 90, 'MEDIUMINT UNSIGNED', 16777215, ($is_mysqlnd) ? 16777215 : '16777215');
 
-       test_type($db, 100, 'INT', -2147483648, 
-               ($is_mysqlnd) ? ((PHP_INT_SIZE > 4) ? (int)-2147483648 : (double)-2147483648) : '-2147483648', 
+       test_type($db, 100, 'INT', -2147483648,
+               ($is_mysqlnd) ? ((PHP_INT_SIZE > 4) ? (int)-2147483648 : (double)-2147483648) : '-2147483648',
                NULL, ($is_mysqlnd) ? 'integer' : NULL);
 
        test_type($db, 110, 'INT UNSIGNED', 4294967295, ($is_mysqlnd) ? ((PHP_INT_SIZE > 4) ? 4294967295 : '4294967295') : '4294967295');
index 7c0ec3701a2993ea114c76181e1687790952afd9..f97bd1bbe2ed9f9ebcea1846b732367e8e43cd8d 100644 (file)
@@ -91,9 +91,14 @@ MySQLPDOTest::skip();
        $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
        $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, false);
 
+       $stmt = $db->prepare('SELECT @@sql_mode AS _mode');
+       $stmt->execute();
+       $row = $stmt->fetch(PDO::FETCH_ASSOC);
+       $real_as_float = (false === stristr($row['_mode'], "REAL_AS_FLOAT")) ? false : true;
+
        test_type($db, 100, 'REAL ZEROFILL', -1.01, NULL, '/^[0]*0$/');
-       test_type($db, 110, 'REAL ZEROFILL', 1.01, NULL, '/^[0]*1\.01$/');
-       test_type($db, 120, 'REAL UNSIGNED ZEROFILL', 1.01, NULL, '/^[0]*1\.01$/');
+       test_type($db, 110, 'REAL ZEROFILL', 1.01, NULL, ($real_as_float) ? '/^[0]*1\.0.*$/' : '/^[0]*1\.01$/');
+       test_type($db, 120, 'REAL UNSIGNED ZEROFILL', 1.01, NULL, ($real_as_float) ? '/^[0]*1\..*$/' : '/^[0]*1\.01$/');
 
        test_type($db, 130, 'DOUBLE ZEROFILL', -1.01, NULL, '/^[0]*0$/');
        test_type($db, 140, 'DOUBLE ZEROFILL', 1.01, NULL, '/^[0]*1\.01$/');