> That shouldn't happen, since get_lock() will only succeed for one mysql
> connection at a time.

I figured it out.

Because there was an order by clause, the get_lock function was being
called for each row in the result set, and since each call to get_lock
releases any previous locks you had, mySQL was effectively locking and
then immediately unlocking (during the sort) each row in the result set.

I wound up moving the get_lock call into a second query, like this:

set i = 0;

select * from foo order by blah limit i, 1;

and then:

select get_lock(blah, 0);

and if that returns 0, do the processing, otherwise do:

i = i + 1; continue;

and that seems to be working like a charm now.

Thanks for your help!

Tim Gustafson
831-332-1496
t...@tgustafson.com
http://tgustafson.com/


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to