MySQL Forums
Forum List  »  MyISAM

locking error
Posted by: Kenneth Vogt
Date: January 17, 2006 07:59PM

Why does the following get the error: Table 'am_queue' was not locked with LOCK TABLES

LOCK TABLES am_queue READ, am_group READ, am_site READ;
(
SELECT am_group.description AS partner, am_queue.action_date AS action_date
FROM am_queue
LEFT JOIN am_group ON am_queue.site_id = am_group.id
WHERE am_queue.status = 'complete'
AND am_queue.action_type = 'post'
GROUP BY partner
)
UNION (

SELECT am_site.description AS partner, am_queue.action_date AS action_date
FROM am_queue
LEFT JOIN am_site ON am_queue.site_id = am_site.id
WHERE am_queue.status = 'complete'
AND am_queue.action_type = 'submit'
GROUP BY partner
)
ORDER BY action_date DESC
LIMIT 10;
UNLOCK TABLES;

Options: ReplyQuote


Subject
Views
Written By
Posted
locking error
2959
January 17, 2006 07:59PM
1987
January 24, 2006 10:38AM
1809
January 24, 2006 08:13PM
1795
January 24, 2006 08:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.