#37732 [Opn]: calling mysqli_multi_query with multiple queries stops subsequent queries

From: Date: Wed, 07 Jun 2006 16:18:55 +0000
Subject: #37732 [Opn]: calling mysqli_multi_query with multiple queries stops subsequent queries
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98144@lists.php.net to get a copy of this message
ID: 37732 User updated by: jerry dot walsh at gmail dot com Reported By: jerry dot walsh at gmail dot com Status: Open Bug Type: MySQLi related Operating System: FreeBSD 6.1-STABLE PHP Version: 5.1.4 New Comment: This will create the table structure: DROP TABLE IF EXISTS billingrecurringinvoice; CREATE TABLE billingrecurringinvoice ( billingrecurringinvoice_id int(10) unsigned NOT NULL auto_increment, billingrecurringinvoice_currencyid int(10) unsigned NOT NULL, billingrecurringinvoice_status enum('ACTIVE','PENDING_APPROVAL') NOT NULL, billingrecurringinvoice_timestamp timestamp NOT NULL default CURRENT_TIMESTAMP, PRIMARY KEY (billingrecurringinvoice_id) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; DROP TABLE IF EXISTS billingrecurringinvoicedetail; CREATE TABLE billingrecurringinvoicedetail ( billingrecurringinvoicedetail_id int(10) unsigned NOT NULL auto_increment, billingrecurringinvoicedetail_billingrecurringinvoiceid int(10) unsigned default NULL, billingrecurringinvoicedetail_productid int(10) unsigned default NULL, billingrecurringinvoicedetail_quantity int(10) unsigned NOT NULL, billingrecurringinvoicedetail_dontrecur tinyint(3) unsigned NOT NULL default '0', billingrecurringinvoicedetail_description char(255) default NULL, billingrecurringinvoicedetail_price float default NULL, PRIMARY KEY (billingrecurringinvoicedetail_id), KEY IX_productfilesearch (billingrecurringinvoicedetail_billingrecurringinvoiceid,billingrecurringinvoicedetail_productid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; Previous Comments: ------------------------------------------------------------------------ [2006-06-07 16:13:38] jerry dot walsh at gmail dot com Description: ------------ Calling mysqli_multi_query with multiple insert queries causes subsequent calls to mysqli_query or mysqli_multi_query to fail with a MySQL lost connection to server (err#2031). OS - FreeBSD 6.1 MySQL - 5.0.22 (also tested on 5.0.18) PHP - 5.1.4 MySQLi version - 5.1.4 Reproduce code: --------------- $strTestDatabaseName = "Testdb"; $db_hostname = "localhost"; $db_username = "username"; $db_password = "password"; $m_mysqlTestConn = mysqli_connect($db_hostname, $db_username, $db_password, $strTestDatabaseName); // succeeds... $strSQL="INSERT INTO billingrecurringinvoicedetail (billingrecurringinvoicedetail_quantity, billingrecurringinvoicedetail_dontrecur) VALUES (1,false);INSERT INTO billingrecurringinvoicedetail (billingrecurringinvoicedetail_quantity, billingrecurringinvoicedetail_dontrecur) VALUES (1,false);"; mysqli_multi_query($m_mysqlTestConn, $strSQL) || print ("Database insert Failed:<br>".mysqli_error($m_mysqlTestConn)." Code:".mysqli_errno ($m_mysqlTestConn)); $strSQL="SELECT * FROM billingrecurringinvoice WHERE billingrecurringinvoice_id = 429;"; // fails (mysqli_multi_query($m_mysqlTestConn, $strSQL)) || print ("Database select Failed:<br>".mysqli_error($m_mysqlTestConn)." Code:".mysqli_errno ($m_mysqlTestConn)); $mysql_result = mysqli_store_result($m_mysqlTestConn); mysqli_close($m_mysqlTestConn); Expected result: ---------------- I expected the select to work after the double insert Actual result: -------------- This line fails: $strSQL="SELECT * FROM billingrecurringinvoice WHERE billingrecurringinvoice_id = 429;"; // fails (mysqli_multi_query($m_mysqlTestConn, $strSQL)) || print ("Database select Failed:<br>".mysqli_error($m_mysqlTestConn)." With: Database select Failed: Lost connection to MySQL server during query Code:2013 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37732&edit=1

« previous php.bugs (#98144) next »