Bug #62002 GET_LOCK() timeout behaves differently on browser and terminal
Submitted: 27 Jul 2011 9:37 Modified: 6 Oct 2011 23:15
Reporter: Lavesh Rawat Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Locking Severity:S1 (Critical)
Version:5.0.27, 5.1.47 OS:Any
Assigned to: CPU Architecture:Any
Tags: locking, server

[27 Jul 2011 9:37] Lavesh Rawat
Description:
After some experimenting on my linux development machine running MySQL 5.1.31, I
found that GET_LOCK() is behaving differently on terminal and on browser.

on browser it is locking the complete connection while on terminal its working fine.

How to repeat:
<?php
$db=mysql_connct();
$sql="SELECT GET_LOCK('lock1',1);";
$res=mysql_query($sql,$dbb) or die(mysql_error());
$row=mysql_fetch_array($res);
print_r($row);
sleep(10);
?>

case A:
Run this file on terminal
output : Array(    [0] => 1    [GET_LOCK('lock1',1)] => 1)   

after 1 sec run same file on terminal
output : Array(    [0] => 0    [GET_LOCK('lock1',1)] => 0)   

case B:
Run this file on browser
output : Array(    [0] => 1    [GET_LOCK('lock1',1)] => 1)  
after 1 sec Run this file on browser
output : Array(    [0] => 1    [GET_LOCK('lock1',1)] => 1)  

The behavior is not matching...
Why its not working on terminal
[27 Jul 2011 13:10] Valeriy Kravchuk
Please, check if the same problem still happens with a newer version, 5.1.58.
[27 Jul 2011 13:16] Lavesh Rawat
Sorry 
Actually behavior is fine with terminal but problem is with browser.
[27 Jul 2011 13:19] Lavesh Rawat
I checked on version 5.1.47
[6 Aug 2011 11:17] Sveta Smirnova
Thank you for the feedback.

Please check if you don't use persistent connections when connect from browser: add SELECT @@pseudo_thread_id  call in your application and compare results of both run.
[6 Sep 2011 23: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".
[7 Oct 2011 23: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".