|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67983 mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns
Submitted: 2014-09-08 17:57 UTC Modified: 2014-09-09 09:23 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tenzzor at gmail dot com Assigned: andrey
Status: Assigned Package: MySQLi related
PHP Version: 5.6.0 OS: Linux Ubuntu
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2014-09-08 17:57 UTC] tenzzor at gmail dot com
mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns. It always returns int 0 regardless of actual column value.
I found a passing test but it's only checking for value=0.

Test script:
$connection = mysqli_init();
mysqli_options($connection, MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
mysqli_real_connect($connection, '', 'root', '', 'test');

mysqli_set_charset($connection, 'utf8');
mysqli_query($connection, 'DROP TABLE IF EXISTS test');
mysqli_query($connection, 'CREATE TABLE test (id BIT(1))');
mysqli_query($connection, 'INSERT INTO test VALUES (1)');

$res = mysqli_query($connection, 'SELECT * FROM test');

$result = mysqli_fetch_assoc($res);


Expected result:
int(1) or string(1)

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-09-09 09:23 UTC]
-Status: Open +Status: Assigned
 [2014-09-09 09:23 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: andrey
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC