ID: 47874 Updated by: paj...@php.net Reported By: jan dot schmidt at vitronic dot de -Status: Open +Status: Feedback Bug Type: PDO related Operating System: Win XP SP3 PHP Version: 5.2.9 New Comment:
5.3 does not use the libmysql library. Check your PATH, the PHP directory has to be 1st in the list, before MySQL. Does it happen in CLI too? Previous Comments: ------------------------------------------------------------------------ [2009-04-06 07:09:47] jan dot schmidt at vitronic dot de I'm sure the 5.0 is loaded: phpinfo: ---- pdo_mysql PDO Driver for MySQL, client library version 5.0.51a ---- I've tested already the 5.3 because of the native mysql driver. phpinfo of PHP Version 5.3.0beta2-dev: ---- pdo_mysql PDO Driver for MySQL enabled Client API version mysqlnd 5.0.5-dev - 081106 - $Revision: 1.3.2.22 $ ---- but this configuration crashed too. ------------------------------------------------------------------------ [2009-04-03 19:39:09] johan...@php.net Please check that a 5.0 libmysql.dll is being loaded, not the 5.1 version from the server, see phpinfo() output. ------------------------------------------------------------------------ [2009-04-02 08:32:15] jan dot schmidt at vitronic dot de Description: ------------ I'm running an Apache 2.2.9 Webserver and a MySQL 5.1.31 Database and want to insert a lot of rows over PDO MySQL Extension. But if the testscript is very often requested, php crashes while preparing a statement. I find out that the easiest way to reproduce the crash is to open the testscript in firefox and keep the F5 Key pressed. For the backtrace i used the php 5.2 snap from 2009-04-01. Only the pdo and pdo_mysql extensions are loaded. Reproduce code: --------------- <?php $dbhandle = new PDO('mysql:host=localhost', 'root', 'mypass',array(PDO::ATTR_PERSISTENT => true)); $dbhandle->exec('SET CHARACTER SET utf8'); $dbhandle->exec('CREATE DATABASE testdb'); $dbhandle->exec('CREATE TABLE testdb.testtable(id bigint(20) NOT NULL AUTO_INCREMENT, testcol text collate utf8_unicode_ci NOT NULL, PRIMARY KEY(id))'); for($i = 0;$i < 100;$i++) { $stmt = $dbhandle->prepare('INSERT INTO testdb.testtable (testcol) VALUES (:testcol)'); $stmt->bindValue(':testcol','testentrie nr '.$i,PDO::PARAM_STR); $stmt->execute(); } ?> Expected result: ---------------- Script insert 100 rows to Table testtable. Actual result: -------------- Script Crashes Backtrace: _zend_mm_free_int(_zend_mm_heap * 0x0110faf8, void * 0x002e0000) line 1974 + 132 bytes _efree(void * 0x00fb5200) line 2306 + 11 bytes _zval_ptr_dtor(_zval_struct * * 0x0558fa8c) line 415 + 37 bytes zend_std_write_property(_zval_struct * 0x015e2b9a, _zval_struct * 0x05d6d530, _zval_struct * 0x00fb5200, void * * * 0x05d6d230) line 417 + 12 bytes pdo_stmt_construct(_pdo_stmt_t * 0x015e2a0d, _zval_struct * 0x05d6d348, _zend_class_entry * 0x05d6d530, _zval_struct * 0x00fb5090, void * * * 0x00000000) line 447 zim_PDO_prepare(int 7916969, _zval_struct * 0x00fb5090, _zval_struct * * 0x05d6d530, _zval_struct * 0x00000000, int 93948008, void * * * 0x00000001) line 581 + 22 bytes zend_do_fcall_common_helper_SPEC(_zend_execute_data * 0x0078c5c5, void * * * 0x0558fbb0) line 200 + 61 bytes ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER(_zend_execute_data * 0x0558fbb0, void * * * 0x0110ece0) line 322 + 17 bytes execute(_zend_op_array * 0x0082e6fd, void * * * 0x00000008) line 92 + 12 bytes php_execute_script(_zend_file_handle * 0x05d6d4dc, void * * * 0x00000000) line 2023 + 18 bytes 05d6d19c() 05d6d190() PHP_PDO! pdo_row_object_handlers + 200 bytes ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47874&edit=1