At 14:45 +0100 1/5/03, ck@stripped wrote:
> A SELECT statement fails if you have table aliases and use
> table locking with the LOCK command
This is not a bug. It's documented in the manual that you must lock
all the tables at once that you intend to use, *including* locking
any aliases for those tables that you'll use.
> DROP TABLE IF EXISTS CK1;
> CREATE TABLE CK1 (
> ID INT UNSIGNED NOT NULL,
> PRIMARY KEY(ID)
> LOCK TABLES CK1 READ; # you must have locking privileges
> SELECT * FROM CK1; # works
> SELECT * FROM CK1 AS SOME_ALIAS; # fails, error 1100: Table
>'SOME_ALIAS' was not locked with LOCK TABLES
> UNLOCK TABLES;
> Do not check for aliases, but for table names.