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