LOAD DATA LOCAL INFILE: The used command is not allowed with this MySQL version
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MySQL Connector/Python |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
CLIENT-A:
python 3.1.1+ and mysql connector 0.1.3
Linux me-laptop 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 x86_64 GNU/Linux
CLIENT-B:
mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using EditLine wrapper ;)
SERVER:
Server version: 5.1.39-
Linux oneohone 2.6.18-6-amd64 #1 SMP Fri Dec 12 05:49:32 UTC 2008 x86_64 GNU/Linux
CLIENT-A:
Gets this Exception + traceback:
( the first line is the output of a print(stmt) in the cursor.py file of python mysql connector! )
=======
b'LOAD DATA LOCAL INFILE "/tmp/tmpBBITg8" INTO TABLE `testtable2` FIELDS
TERMINATED BY "," OPTIONALLY ENCLOSED BY \'\\"\''
Traceback (most recent call last):
File "converters.py", line 240, in <module>
fromValuesT
not null' ], [ 'email', 'varchar(255)' ] ], GSO=GSO)
File "converters.py", line 98, in fromValuesToTable
c.execute('LOAD DATA LOCAL INFILE "%s" INTO TABLE `%s` FIELDS
TERMINATED BY "," OPTIONALLY ENCLOSED BY %s' % (f.name, table, '%s'),
[ quotedBy ] )
File
"/home/
398, in rexecute
res = self.baseClass.
File
"/usr/local/
334, in execute
res = self.db(
File
"/usr/local/
line 268, in cmd_query
buf = self.conn(
File
"/usr/local/
line 84, in recv
self.
File
"/usr/local/
line 142, in is_error
self.
File
"/usr/local/
line 132, in _handle_error
raise errors.
mysql.connector
allowed with this MySQL version
=======
CLIENT-B:
Works fine:
=======
mysql -h 10.10.10.101 -u brd -p
LOAD DATA LOCAL INFILE "/tmp/tmpBBITg8" INTO TABLE `testtable2` FIELDS
TERMINATED BY "," OPTIONALLY ENCLOSED BY '"';
Query OK, 0 rows affected (0.02 sec)
Records: 0 Deleted: 0 Skipped: 0 Warnings: 0
mysql> status
--------------
mysql Ver 14.14 Distrib 5.1.37, for debian-linux-gnu (x86_64) using
EditLine wrapper
...
=======
I guess that should be a bug, right?
The exception says it all: it's simply not (yet) supported.
Very valid workaround: You can easily read from the file, parse it, and make INSERT-statements in Python.