Bug #75177 [Opn->Fbk]: Type 'bit' is fetched as unexpected string
Edit report at https://bugs.php.net/bug.php?id=75177&edit=1
ID: 75177
Updated by: ab@php.net
Reported by: david at grudl dot com
Summary: Type 'bit' is fetched as unexpected string
-Status: Open
+Status: Feedback
Type: Bug
Package: PDO MySQL
Operating System: Windows
PHP Version: 7.2.0RC1
Block user comment: N
Private report: N
New Comment:
Do you use a 32-bit build?
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2017-09-11 03:42:59] laruence@php.net
just for the record, I can not reproduce this on linux.
------------------------------------------------------------------------
[2017-09-08 22:58:29] david at grudl dot com
Description:
------------
MySQL type 'bit' is fetched as unexpected string. Works correctly in PHP < 7.2
Test script:
---------------
<?php
$db = new PDO('mysql:dbname=test', 'root', '123');
$db->query('CREATE TABLE tbl (bit bit(1)) ENGINE=InnoDB');
$db->query('INSERT INTO tbl (bit) VALUES (1)');
var_dump($db->query('SELECT * FROM tbl')->fetchAll());
Expected result:
----------------
array(1) {
[0]=>
array(2) {
["bit"]=>
string(1) "1"
}
}
Actual result:
--------------
array(1) {
[0]=>
array(2) {
["bit"]=>
string(19) "8220976629027962881"
}
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75177&edit=1
Thread (5 messages)