summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql/tests/bug75177.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_mysql/tests/bug75177.phpt')
-rw-r--r--ext/pdo_mysql/tests/bug75177.phpt23
1 files changed, 19 insertions, 4 deletions
diff --git a/ext/pdo_mysql/tests/bug75177.phpt b/ext/pdo_mysql/tests/bug75177.phpt
index f6414f0b29..104734f3ac 100644
--- a/ext/pdo_mysql/tests/bug75177.phpt
+++ b/ext/pdo_mysql/tests/bug75177.phpt
@@ -5,27 +5,42 @@ PDO MySQL Bug #75177 Type 'bit' is fetched as unexpected string
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'skipif.inc');
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
MySQLPDOTest::skip();
+if (!MySQLPDOTest::isPDOMySQLnd()) die('skip only for mysqlnd');
?>
--FILE--
<?php
require_once(__DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
$pdo = MySQLPDOTest::factory();
-$tbl = "tbl_bug75177";
+$tbl = "test";
$pdo->query("DROP TABLE IF EXISTS $tbl");
$pdo->query("CREATE TABLE $tbl (`bit` bit(8)) ENGINE=InnoDB");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (1)");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b011)");
$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b01100)");
+$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
$ret = $pdo->query("SELECT * FROM $tbl")->fetchAll();
+foreach ($ret as $i) {
+ var_dump($i["bit"]);
+}
+$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
+$ret = $pdo->query("SELECT * FROM $tbl")->fetchAll();
foreach ($ret as $i) {
var_dump($i["bit"]);
}
?>
+--CLEAN--
+<?php
+require dirname(__FILE__) . '/mysql_pdo_test.inc';
+MySQLPDOTest::dropTestTable();
+?>
--EXPECT--
-string(1) "1"
-string(1) "3"
-string(2) "12"
+int(1)
+int(3)
+int(12)
+int(1)
+int(3)
+int(12)