Re: [drupal-devel] LOCK vs. SELECT FOR UPDATE
18 Oct
2005
18 Oct
'05
3:32 p.m.
Here is a workaround that someone cooked up to get over the fact that his host does not allow for LOCK TABLE privilege. http://drupal.org/node/34455 Is this something we can go by?
18 Oct
18 Oct
4:20 p.m.
New subject: [drupal-devel] LOCK vs. SELECT FOR UPDATE
On Tue, Oct 18, 2005 at 09:32:55AM -0400, Khalid B wrote:
Here is a workaround that someone cooked up to get over the fact that his host does not allow for LOCK TABLE privilege.
if(!db_affected_rows($result)) { db_query("insert into {sequences} (id, name) values (0, '%s')", $name); db_query("update {sequences} set id = last_insert_id(id+1) where name = '%s'", $name); } How is it atomic? It can insert to (0, $name) rows into the table
Is this something we can go by?
Dunno. ;) -- Piotrek irc: #debian.pl Mors Drosophilis melanogastribus!
7551
Age (days ago)
7551
Last active (days ago)
1 comments
2 participants
participants (2)
-
Khalid B -
piotrwwwï¼ krukowiecki.net