Hi Group,

A question about locking. In my code (delphi but that doesn't much matter) I fire ad-hoc queries (select). Before the query i fire a locking query (read) for that particular tables. Something like this:

lock tables tab1 a read, tab2 b read
(execute)
select * from tab1 a, tab2 b where.........
(execute)

In this case I get an error: tab1 is not locked using LOCK TABLES.

If I change the locking query to: lock tables tab1 read, tab2 b read
The first times I didn't get any error. But after some times of running my app the error: a is not locked using LOCK TABLES occur!?!?


Ok finally I use the statement: lock tables tab1 read, tab1 a read, tab2 b read
en everything works fine.


The strangest thing about this is that sometimes it doesn't go wrong (locking using the lock statement with only the table aliases), other times it goes.

When I execute the locking and the select query from my SQL explorer (borland) nothing is going wrong (makes no sense whatever you lock).

It makes no difference I use version 4.0/4.1/5.0 (on suse linux).

Anybody who has seen this before?????

Okay the workaround is simple: don't use table aliases or use the above showed locking statement, but it makes me angry something like this errors are raised on unexpected moments in my production environment,.


Thanks for help


Hans


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



Reply via email to