Can't answer your question directly.  But I wonder if this would trick it
into avoiding the lock:

UPDATE AnotherTable
   SET...
   WHERE id IN (SELECT id FROM SomeTable);

And the real workaround would be

CREATE TEMPORARY TABLE t
   SELECT id ...;
UPDATE AnotherTable
   SET...
   WHERE id IN (SELECT id FROM t); 

> -----Original Message-----
> From: Robert DiFalco [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, October 03, 2006 9:26 AM
> To: mysql@lists.mysql.com; [EMAIL PROTECTED]
> Subject: RE: Innodb Locks
> 
> Any thoughts on this? Should SomeTable be locked when performing the
> UPDATE on AnotherTable? 
> 
> -------
> 
> Is there a detailed source for when innodb creates row or table locks?
> 
> I have a situation where one thread is performing this in one
> transaction:
> 
>       UPDATE SomeTable SET .... WHERE SomeTable.id = N;
> 
> 
> This is invoked after another thread has kicked off this long running
> query in another transaction:
>       
>       UPDATE AnotherTable 
>       SET ...
>       WHERE EXISTS(
>           SELECT null
>           FROM SomeTable
>           WHERE SomeTable.id = AnotherTable.id );
> 
> 
> Would this create a conflicting lock? I am getting "Lock wait timeout
> exceeded" on SomeTable fro the UPDATE to SomeTable.
> 
> TIA,
> 
> R.
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    
> http://lists.mysql.com/[EMAIL PROTECTED]
> 
> 
> 


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to