Bug #489 LOCK TABLES and LOAD TABLE for MyISAM not working
Submitted: 24 May 2003 5:07 Modified: 31 May 2003 16:41
Reporter: Robert Graf Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S1 (Critical)
Version:4.0.12 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[24 May 2003 5:07] Robert Graf
Description:
For development I'm using 4.0.12 for Windows with MyISAM tables and for production 3.23.53 for Unix with MyISAM. - all is default

I want to LOAD all tables from their .txt file and before I start the LOAD statement I LOCK all the tables (for WRITE).

It works brilliant with 3.23.53, but on 4.0.12 I receive the error 'Can't execute the given command because you have active locked tables or an active transaction'.

If it is not a bug - how can I LOAD all tables and to be sure no user can change another table during this LOAD?

Robert

How to repeat:
LOCK TABLES a WRITE, b WRITE

LOAD DATA INFILE a INTO TABLE a
LOAD DATA INFILE b INTO TABLE b
[31 May 2003 16:41] MySQL Verification Team
I wasn't able for to repeat the behavior reported:

c:\mysql\bin>mysql test -uroot -p
Enter password: ******
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.0.12-max-nt

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> LOCK TABLES a WRITE, b WRITE;
Query OK, 0 rows affected (0.02 sec)

mysql> load data infile "c:/mysql/a.txt" into table a;
Query OK, 2 rows affected (0.02 sec)
Records: 2  Deleted: 0  Skipped: 0  Warnings: 0

mysql> load data infile "c:/mysql/b.txt" into table b;
Query OK, 2 rows affected (0.00 sec)
Records: 2  Deleted: 0  Skipped: 0  Warnings: 0
[5 Jun 2003 10:17] Robert Graf
Hi,

I'll try and test it again during my holiday in 2 weeks why the program doesn't work under 4.x but on 3.x!

There is nothing special ...

thx,
Robert