php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75177 Type 'bit' is fetched as unexpected string
Submitted: 2017-09-08 22:58 UTC Modified: 2017-09-13 11:06 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: david at grudl dot com Assigned:
Status: Closed Package: PDO MySQL
PHP Version: 7.2.0RC1 OS: Windows
Private report: No CVE-ID: None
 [2017-09-08 22:58 UTC] 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"
  }
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-11 03:42 UTC] laruence@php.net
just for the record, I can not reproduce this on linux.
 [2017-09-13 10:29 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-09-13 10:29 UTC] ab@php.net
Do you use a 32-bit build?

Thanks.
 [2017-09-13 11:06 UTC] ab@php.net
I guess this might be related or same as bug #75018.

Thanks.
 [2017-09-13 12:13 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=3d93856c4a05394196c5610ae11cf019d1e18f76
Log: Fixed bug #75018, fixed bug #75177
 [2017-09-13 12:13 UTC] ab@php.net
-Status: Feedback +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 08:01:29 2024 UTC