|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-06-07 16:13 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 03:00:01 2025 UTC |
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;