Bug #70384 [Csd]: mysqli_real_query(): Unknown type 245 sent by the server

From: Date: Tue, 29 Sep 2015 21:30:21 +0000
Subject: Bug #70384 [Csd]: mysqli_real_query(): Unknown type 245 sent by the server
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196304@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70384&edit=1 ID: 70384 User updated by: marc at infomarc dot info Reported by: marc at infomarc dot info Summary: mysqli_real_query(): Unknown type 245 sent by the server Status: Closed Type: Bug Package: MySQLi related Operating System: Linux PHP Version: 7.0.0RC1 Assigned To: mysql Block user comment: N Private report: N New Comment: Hi Andrey, I believe you also need to register MYSQLI_TYPE_JSON in ext/mysqli/mysqli.c. Marc Delisle Previous Comments: ------------------------------------------------------------------------ [2015-09-29 14:02:08] andrey@php.net The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Fixed in PHP-5.6, PHP-7.0 and master (PHP-7.1) Thank You for your report ------------------------------------------------------------------------ [2015-08-28 19:22:37] morgan dot tocker at oracle dot com There is a temporary workaround available here. The test case can be modified to cast the JSON type to a CHAR, which is fine from PHP's perspective: select id, CAST(jsoncol as CHAR) from marctable ------------------------------------------------------------------------ [2015-08-28 18:13:54] marc at infomarc dot info Description: ------------ I report this for 7.0.0RC1 but am able to reproduce also on PHP 5.6.7. MySQL Server is 5.7.8-rc. Test table created with CREATE TABLE marctable ( id int(11) NOT NULL AUTO_INCREMENT, jsoncol json DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 Test script: --------------- <?php $link = mysqli_init(); $connect_result = mysqli_real_connect($link, '127.0.0.1', 'userxxx', 'passxxx', 'marcdb'); echo "connect_result: " . $connect_result . "\n"; $query_result = mysqli_real_query($link, "select * from marctable"); echo "query result: " . $query_result . "\n"; echo "mysqli_error: " . mysqli_error($link) . "\n"; Expected result: ---------------- connect_result: 1 query result: 1 mysqli_error: Actual result: -------------- connect_result: 1 PHP Warning: mysqli_real_query(): Unknown type 245 sent by the server. Please send a report to the developers in bugjson.php on line 9 Warning: mysqli_real_query(): Unknown type 245 sent by the server. Please send a report to the developers in bugjson.php on line 9 zend_mm_heap corrupted ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70384&edit=1

« previous php.bugs (#196304) next »