Yan> Thanks so much for pointing that out, Martin!
Yan> I wasn't aware of this "semantics"! Now I got another challenge:
Yan> how do I lock up all the databases at the same time??
Yan> (I need this so that I can snapshot all the databases for a file-level backup;
Yan> I also rotate update log after such a snapshot, so that this backup plus
Yan> the next update log equals the up-to-date state of the databases)
Yan> I tried the following statement as an attempt to lock 2 tables in 2 different
Yan> LOCK TABLES <db1>.<tab11> READ, <db2>.<tab21> READ;
Yan> but it didn't work (syntax error).
Yan> Is any way around? (I wish MySQL had something that locks several
Yan> DATABASES in one statement)
Which MySQL version are you using?
In MySQL 3.22, this works:
mysql> lock tables test.t1 READ, test2.blocked READ;
Query OK, 0 rows affected (0.03 sec)