Bug #67983 [Opn->Asn]: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns

From: Date: Tue, 09 Sep 2014 09:23:47 +0000
Subject: Bug #67983 [Opn->Asn]: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187471@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67983&edit=1 ID: 67983 Updated by: andrey@php.net Reported by: tenzzor at gmail dot com Summary: mysqlnd with MYSQLI_OPT_INT_AND_FLOAT_NATIVE fails to interpret bit columns -Status: Open +Status: Assigned Type: Bug Package: MySQLi related Operating System: Linux Ubuntu PHP Version: 5.6.0 -Assigned To: +Assigned To: andrey Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2014-09-08 17:57:45] tenzzor at gmail dot com 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 this bug report at https://bugs.php.net/bug.php?id=67983&edit=1

« previous php.bugs (#187471) next »