Lianghwa Jou <[EMAIL PROTECTED]> wrote: > > Mysql seems to insists that all tables must be locked if one table is > locked in a select statement. Why ? > > For example- > > lock tables A WRITE, B WRITE; > select * from A, B, C where A.id=B.id and A.id=C.id; > > Mysql will complain that table C is not locked. Is there a way to avoid > locking table C ? I only want to modify table A and B. Table C is also > used in some other select statement with other tables. If I lock table > C, I will have to lock all these other tables too. >
Yes, you should lock all tables that you are going to use. If you want table C will readable for other threads you can set READ lock on this table. -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]