diff options
Diffstat (limited to 'ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt')
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt index a7a76a462b..50819f9695 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_prepare_native_placeholder_everywhere.phpt @@ -11,6 +11,8 @@ $db = MySQLPDOTest::factory(); <?php require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc'); $db = MySQLPDOTest::factory(); + $db->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true); + try { $db->setAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY, 1); if (1 != $db->getAttribute(PDO::MYSQL_ATTR_DIRECT_QUERY)) @@ -41,16 +43,7 @@ $db = MySQLPDOTest::factory(); var_export($stmt->errorCode(), true), var_export($stmt->errorInfo(), true)); - $tmp = $stmt->fetchAll(PDO::FETCH_ASSOC); - if (!MySQLPDOTest::isPDOMySQLnd()) { - if (isset($tmp[0]['id'])) { - // libmysql should return a string here whereas mysqlnd returns a native int - if (gettype($tmp[0]['id']) == 'string') - // convert to int for the test output... - settype($tmp[0]['id'], 'integer'); - } - } - var_dump($tmp); + var_dump($stmt->fetchAll(PDO::FETCH_ASSOC)); } catch (PDOException $e) { printf("[001] %s [%s] %s\n", @@ -82,7 +75,7 @@ array(1) { ["?"]=> string(2) "id" ["id"]=> - int(1) + string(1) "1" ["label"]=> string(4) "row1" } |