Bug #46333 | Can't update table 'tstamp' in stored function/trigger because it is already use | ||
---|---|---|---|
Submitted: | 22 Jul 2009 5:30 | Modified: | 27 Jul 2009 5:43 |
Reporter: | Vishnu Purushothaman | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Stored Routines | Severity: | S3 (Non-critical) |
Version: | 5.0.83, 5.0 bzr | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[22 Jul 2009 5:30]
Vishnu Purushothaman
[22 Jul 2009 6:12]
Valeriy Kravchuk
I think we need SHOW CREATE TABLE results for all the tables used and code of the trigger and all SPs mentioned to check if this is really a bug or not.
[22 Jul 2009 8:41]
Vishnu Purushothaman
Hi Valeriy Kravchuk, Do you want the db dump?.If so i can upload it Regards, Vishnu
[22 Jul 2009 21:25]
Sveta Smirnova
Thank you for the feedback. Please provide output of SHOW CREATE TABLE global_config also.
[23 Jul 2009 6:34]
Sveta Smirnova
test case for the testsuite
Attachment: bug46333.test.zip (application/zip, text), 124.60 KiB.
[23 Jul 2009 8:53]
Susanne Ebrecht
Unfortunately, I am not able to repeat this. Neither on Linux nor on Windows.
[23 Jul 2009 9:18]
Vishnu Purushothaman
Hi Susanne Ebrecht, Thanks for the feed back. My customer's machine is "Intel Core2Duo " + 3GB RAM and mysql is configured to use 512 MB RAM. He doesn't get this error as often as I do. Probably, because i run the tests on a VMWare(virtual machine software) with P4 128 MB RAM configuration. One of the possible reason why this error happens may be due to low memory. If you could use the data(that i uploaded, Sveta Smirnova has removed those in the test case), you will surely hit it(i hope so :)). I Initially thought it might due to the mysql version(i was using 5.0.45) so switched to 5.0.83 this week, but was of no use. Regards, Vishnu.
[23 Jul 2009 10:21]
Sveta Smirnova
Thank you for the feedback. Strange. I got this error once, but can not repeat anymore.
[23 Jul 2009 10:30]
Vishnu Purushothaman
Good News finally!!!! Sveta Smirnova, are you executing the two test case together?, Case 1 : Error Will Occur ---------------------------------------------------------------------- SET AUTOCOMMIT=0; LOCK TABLES booking WRITE, consignment WRITE,receive_booking WRITE, receive_consignment WRITE, outward_booking WRITE,outward_consignment WRITE, inward_booking WRITE, inward_consignment WRITE, chargeequation WRITE, branch WRITE, state WRITE, district WRITE, company WRITE, branch_reference WRITE, Customer WRITE, global_config WRITE, contenttype WRITE, packingtype WRITE, rebook WRITE, tstamp WRITE, tripdetails write, receive write; call edit_booking(179,'T1AA11100167','2009-06-26','10:05:22',1590000006,2540006137,0,19,19,160, 'TO PAY','2/3','DOOR DELIVERY',120,10,2.575,'','2009-06-27',6909,6640,5,30,12,332,1,'',0,0,0,1,6640,0,0,0); call new_consignment(0,1110000022,1110000002,'2','3','2009-06-26',3,332,'',3,2,6640,19,1,20); COMMIT; UNLOCK Tables; ------------------------------------------------------------------------ Case 2 : Error won't occur ------------------------------------------------------------------------ FLUSH TABLE tstamp; SET AUTOCOMMIT=0; LOCK TABLES booking WRITE, consignment WRITE,receive_booking WRITE, receive_consignment WRITE, outward_booking WRITE,outward_consignment WRITE, inward_booking WRITE, inward_consignment WRITE, chargeequation WRITE, branch WRITE, state WRITE, district WRITE, company WRITE, branch_reference WRITE, Customer WRITE, global_config WRITE, contenttype WRITE, packingtype WRITE, rebook WRITE, tstamp WRITE, tripdetails write, receive write; call edit_booking(179,'T1AA11100167','2009-06-26','10:05:22',1590000006,2540006137,0,19,19,160, 'TO PAY','2/3','DOOR DELIVERY',120,10,2.575,'','2009-06-27',6909,6640,5,30,12,332,1,'',0,0,0,1,6640,0,0,0); call new_consignment(0,1110000022,1110000002,'2','3','2009-06-26',3,332,'',3,2,6640,19,1,20); COMMIT; UNLOCK Tables; -------------------------------------------------------------------------- In the second case i have added "FLUSH TABLE tstamp;" command, so it won't give any error. Keep executing the first case, 9 out 10 it will be error(for the first time after a restart or when the memory is "cleared" there won't be any error). Regards, Vishnu
[24 Jul 2009 5:27]
Sveta Smirnova
Thank you for the feedback. Verified as described using attached test case. Problem is not repeatable every run. To repeat one should run test several times.