List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:December 22 1999 12:39am
Subject:Re: Why is MySQL forcing me to lock?
View as plain text  
At 5:29 PM -0700 1999-12-21, Rick Moore wrote:
>Hi everybody!
>
>I have two tables: site and siteq.  After siteq is locked, I'm trying to
>populate it with an "insert into siteq select..."  I get the following
>error:
>
>ERROR 1100: Table xxx was not locked with "LOCK TABLES"
>
>My logic doesn't require that site be locked.  In fact, this is the only
>operation I'm performing on site so it's atomic anyway.
>
>Why is MySQL trying to make me lock this other table?  Is this an
>architectural issue or is MySQL trying to protect me from myself?


If you're performing explicit locks using LOCK TABLES, the manual
states you must acquire appropriate locks for *all* tables you're
using.

If you're only using site and siteq is a single query you don't need
to use LOCK TABLES because the server will acquire the necessary locks
automatically.  If this is what you're doing and you're getting the
error message, I don't know what's going on.

-- 
Paul DuBois, paul@stripped
Thread
VariablesJames Lyon21 Dec
  • Re: VariablesTonu Samuel21 Dec
  • Re: VariablesSasha Pachev21 Dec
  • Why is MySQL forcing me to lock?Rick Moore22 Dec
    • Re: Why is MySQL forcing me to lock?Paul DuBois22 Dec