xref: /PHP-7.3/ext/pdo_mysql/tests/bug75177.phpt (revision 3d93856c)
1--TEST--
2PDO MySQL Bug #75177 Type 'bit' is fetched as unexpected string
3--SKIPIF--
4<?php
5require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
6require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
7MySQLPDOTest::skip();
8?>
9--FILE--
10<?php
11require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
12$pdo = MySQLPDOTest::factory();
13
14$tbl = "tbl_bug75177";
15$pdo->query("DROP TABLE IF EXISTS $tbl");
16$pdo->query("CREATE TABLE $tbl (`bit` bit(8)) ENGINE=InnoDB");
17$pdo->query("INSERT INTO $tbl (`bit`) VALUES (1)");
18$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b011)");
19$pdo->query("INSERT INTO $tbl (`bit`) VALUES (0b01100)");
20
21$ret = $pdo->query("SELECT * FROM $tbl")->fetchAll();
22
23foreach ($ret as $i) {
24	var_dump($i["bit"]);
25}
26
27?>
28==DONE==
29--EXPECT--
30string(1) "1"
31string(1) "3"
32string(2) "12"
33==DONE==
34