Bug #67983 [NEW]: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns
| From: | tenzzor at gmail dot com | Date: | Mon, 08 Sep 2014 17:57:45 +0000 |
| Subject: | Bug #67983 [NEW]: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187456@lists.php.net to get a copy of this message | ||
From: tenzzor at gmail dot com
Operating system: Linux Ubuntu
PHP version: 5.6.0
Package: MySQLi related
Bug Type: Bug
Bug description:mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns
Description:
------------
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
https://github.com/php/php-src/blob/master/ext/mysqli/tests/mysqli_options_int_and_float_native.phpt
but it's only checking for value=0.
Test script:
---------------
<?php
$connection = mysqli_init();
mysqli_options($connection, MYSQLI_OPT_INT_AND_FLOAT_NATIVE, TRUE);
mysqli_real_connect($connection, '127.0.0.1', '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);
var_dump($result['id']);
Expected result:
----------------
int(1) or string(1)
Actual result:
--------------
int(0)
--
Edit bug report at https://bugs.php.net/bug.php?id=67983&edit=1
--