Bug #65300 doing mysql insert into a database record after 160 records it hangs
Submitted: 13 May 2012 4:51 Modified: 13 Jun 2012 7:49
Reporter: wayne lowsik Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: General Severity:S2 (Serious)
Version:5.5.20 OS:Windows
Assigned to: CPU Architecture:Any
Tags: INSERT INTO webparts.sv

[13 May 2012 4:51] wayne lowsik
Description:
// SQL: INSERT INTO webparts_copy(CUST_NBR, LINE_CODE, PART_NBR, GROUP_NAME, SUB_GROUP_NAME, DESCRIPTION_LONG, UNIT_OF_MEASURE, MANUFACTURE)
// VALUES (4812,'110','26240','MECHANICAL INVENTORY','CHEMICAL','LOCKTITE RED','36 ML','PERMATEX - LOCTITE')
-------------------------------------------------

If I use this code to insert records into my table webparts__sv
It should add 340 records but after 120 to 170 records it hangs.
No errors.
 run it again stops at 146 records then again 120 records.
Run it under mysql linux works fine..
The php should go to html at the pogram end but nothing.
If I don't do the $db->query($sSQL);
 But just run the foreach it goes to record 330.
ends ok.

========================================

foreach ($parts as $value) {
			$i++;
	
			
        	 $sSQL =  "INSERT INTO webparts_copy (CUST_NBR, LINE_CODE, PART_NBR, GROUP_NAME, SUB_GROUP_NAME, DESCRIPTION_LONG, UNIT_OF_MEASURE, MANUFACTURE)";
	         $sSQL .= "VALUES (".tosql($value['custnbr'], 'Number').",".tosql($value['linecode'], 'text').",".tosql($value['partnbr'], 'text').",".tosql($value['group'], 'text').",".tosql($value['subgrp'], 'text').",".tosql($value['longdesc'], 'text').",".tosql($value['umea'], 'text').",".tosql($value['mfgr'], 'text').")";
             
	         $sSQL= str_replace ("/","-",$sSQL);
	         	            
	        $db->query($sSQL);

}

How to repeat:
 
Insert this for 130 + records then hangs.
mysql_error($link) = 0... no error.

$sSQL =  "INSERT INTO webparts_copy (CUST_NBR, LINE_CODE, PART_NBR, GROUP_NAME, SUB_GROUP_NAME, DESCRIPTION_LONG, UNIT_OF_MEASURE, MANUFACTURE)";
	         $sSQL .= "VALUES (".tosql($value['custnbr'], 'Number').",".tosql($value['linecode'], 'text').",".tosql($value['partnbr'], 'text').",".tosql($value['group'], 'text').",".tosql($value['subgrp'], 'text').",".tosql($value['longdesc'], 'text').",".tosql($value['umea'], 'text').",".tosql($value['mfgr'], 'text').")";
             
	         $sSQL= str_replace ("/","-",$sSQL);
	         	            
	        $db->query($sSQL);

Suggested fix:

Check on the mysql fix 4.20.? a forms says its fixed.. 
works in linux.
[13 May 2012 7:49] MySQL Verification Team
To eliminate the possibility your php code is at fault, please just try running all these queries using the mysql command line client.

So, print out the sql, and save this output, then paste into mysql client.

print $sSQL . " ;\n";
//$db->query($sSQL);

If it hangs, open a new connection and grab output of:
SHOW FULL PROCESSLIST;
SHOW ENGINE INNODB STATUS\G
[14 Jun 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".