Edit report at http://bugs.php.net/bug.php?id=47928&edit=1
ID: 47928 Comment by: Reported by: jjuergens at web dot de Summary: Crash in mysqli_stmt_fetch() with longtext column Status: Bogus Type: Bug Package: MySQLi related Operating System: * PHP Version: 5.*, 6CVS (2009-04-19) Assigned To: mysql New Comment: I experienced this problem regardless of BLOB, LONGBLOB, TEXT, LONGTEXT etc... However to fix, I found that if I called mysqli_stmt_store_result after executing the statement then the problem went away. The documentation says it increases performance but at a cost of memory, but I would argue that for BLOB's you should only be selecting them for a single row anyway. Previous Comments: ------------------------------------------------------------------------ [2009-04-20 08:57:40] johan...@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. This is indeed an issue with the MySQL cLient library. It works properly when using mysqlnd with 5.3 (--with-mysqli=mysqlnd) or when using MySQL's Connector/C, which is a standalone version of libmysql distributed witohut the server. I didn't try using a current vcersion of libmysql bundled with the server. ------------------------------------------------------------------------ [2009-04-19 16:19:58] j...@php.net In PHP_5_3 / HEAD the crash happens with any BLOB/TEXT types. (due to mysqli_api.c:398) This might be also a MySQL bug since it seems to set MYSQL_TYPE_BLOB always for any blob column. ------------------------------------------------------------------------ [2009-04-19 15:14:49] j...@php.net Here's better reproduce data (the longtext column has to have enough data to cause crash): drop database crashtest; create database crashtest; use crashtest; create table crash ( test longtext ); insert into crash set test=' 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 12345678901234567890123456789012345678901234567890 '; grant select on crashtest.* to 'test'@'localhost'; ------------------------------------------------------------------------ [2009-04-19 14:44:29] jjuergens at web dot de Yeah, you're right: Soon as I change the column-type from longtext to text, PHP doesn't crash anymore. The example you provided also crashes on my debug-enabled PHP-Version, while the Opensuse-Version (with Suoshin-Patch) throws efree()-errors until there are more than 396 characters in the textfield. I actually tried to debug the PHP-code some (with very limited knowledge) and I think that the problem is somewhere within the binding of the resultset since thats where the script stops. ------------------------------------------------------------------------ [2009-04-19 14:11:14] j...@php.net See also bug #46808 ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=47928 -- Edit this bug report at http://bugs.php.net/bug.php?id=47928&edit=1