summaryrefslogtreecommitdiff
path: root/ext/pdo_mysql
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2017-09-13 14:12:31 +0200
committerAnatol Belski <ab@php.net>2017-09-13 14:12:31 +0200
commitb134793b328a8bbf38800518469b0f25aa8de49f (patch)
treeaa51665503206b503d26632be9cb45912d527466 /ext/pdo_mysql
parentd99cd289257a97be3f5b344fe8de4bc3de85e609 (diff)
parent3d93856c4a05394196c5610ae11cf019d1e18f76 (diff)
downloadphp-git-b134793b328a8bbf38800518469b0f25aa8de49f.tar.gz
Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1: Fixed bug #75018, fixed bug #75177
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r--ext/pdo_mysql/tests/bug75177.phpt33
1 files changed, 33 insertions, 0 deletions
diff --git a/ext/pdo_mysql/tests/bug75177.phpt b/ext/pdo_mysql/tests/bug75177.phpt
new file mode 100644
index 0000000000..abdfd3954b
--- /dev/null
+++ b/ext/pdo_mysql/tests/bug75177.phpt
@@ -0,0 +1,33 @@
+--TEST--
+PDO MySQL Bug #75177 Type 'bit' is fetched as unexpected string
+--SKIPIF--
+<?php
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+MySQLPDOTest::skip();
+?>
+--FILE--
+<?php
+require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
+$pdo = MySQLPDOTest::factory();
+
+$tbl = "tbl_bug75177";
+$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)");
+
+$ret = $pdo->query("SELECT * FROM $tbl")->fetchAll();
+
+foreach ($ret as $i) {
+ var_dump($i["bit"]);
+}
+
+?>
+==DONE==
+--EXPECT--
+string(1) "1"
+string(1) "3"
+string(2) "12"
+==DONE==