Thank you for the feedback. I used your Lua script with few more print functions for debugging and fresh 0.8.3 MySQL Proxy. See below. In one terminal: [sveta@delly bug67178]$ pwd /home/sveta/MySQL/bugs/bug67178 [sveta@delly bug67178]$ cat example_load_data_infile.lua --[[ * Example how can be change destination table of * a LOAD DATA LOCAL INLINE statement. ]] function split(str, pat) local t = {} -- NOTE: use {n = 0} in Lua-5.0 local fpat = "(.-)" .. pat local last_end = 1 local s, e, cap = str:find(fpat, 1) while s do if s ~= 1 or cap ~= "" then table.insert(t,cap) end last_end = e+1 s, e, cap = str:find(fpat, last_end) end if last_end <= #str then cap = str:sub(last_end) table.insert(t, cap) end return t end ------------------------------------------------------------------------------------------ -- Read client query and inject function for LOAD DATA INFILE LOCAL query ------------------------------------------------------------------------------------------ function read_query(packet) if packet:byte() ~= proxy.COM_QUERY then return end local q = packet:sub(2) if DEBUG then log( "Received query: " .. q, MSG_IMPORTANT ) end print("Received query: " .. q) if string.find( string.lower( q ), 'load data local' ) then local table_name = split( q, "%s" ) local tbl_name = string.gsub( table_name[8], "`", "" ) local file_name = string.gsub( table_name[5], "'", "" ) local tmp_table = "NEW_TABLE" proxy.queries:append( 1, string.char(proxy.COM_QUERY) .. "LOAD DATA INFILE '" .. file_name .. "' INTO TABLE `" .. tmp_table .. "`", { resultset_is_needed = true } ) proxy.queries:append( 2, string.char(proxy.COM_QUERY) .. "SHOW WARNINGS", { resultset_is_needed = true } ) else proxy.queries:append( 1, packet, { resultset_is_needed = true } ) end return proxy.PROXY_SEND_QUERY end ------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------ -- Catch result and send result to client ------------------------------------------------------------------------------------------ function read_query_result(inj) local res = assert(inj.resultset) if inj.id == 2 then return proxy.PROXY_IGNORE_RESULT end proxy.response = { type = proxy.MYSQLD_PACKET_OK, affected_rows = inj.resultset.affected_rows } end ------------------------------------------------------------------------------------------ In second terminal: [sveta@delly mysqlpackages]$ mv ~/Downloads/mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit.tar.gz . [sveta@delly mysqlpackages]$ tar -xzf mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit.tar.gz [sveta@delly mysqlpackages]$ cd mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit [sveta@delly mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit]$ ls bin include lib libexec licenses share [sveta@delly mysql-proxy-0.8.3-linux-glibc2.3-x86-64bit]$ ./bin/mysql-proxy --proxy-backend-addresses=127.0.0.1:13000 --proxy-lua-script=/home/sveta/MySQL/bugs/bug67178/example_load_data_infile.lua 2013-01-10 20:10:36: (critical) plugin proxy 0.8.3 started Received query: show databases Received query: show tables Received query: select @@version_comment limit 1 Received query: load data infile into table t1 'bug67178.csv' Received query: load data infile into table t1 file 'bug67178.csv' Received query: load data infile 'bug67178.csv' into table t1 Received query: select * from t1 Received query: load data local infile 'bug67178.csv' into table t1 Received query: create table NEW_TABLE like t1 Received query: select * from NEW_TABLE Received query: load data local infile 'bug67178.csv' into table not_existent Received query: select * from NEW_TABLE In third terminal: [sveta@delly mysql-test]$ Logging: ./mtr --start innodb 2013-01-10 20:05:55 32579 [Note] Plugin 'FEDERATED' is disabled. 2013-01-10 20:05:55 32579 [Note] Binlog end 2013-01-10 20:05:55 32579 [Note] Shutting down plugin 'CSV' 2013-01-10 20:05:55 32579 [Note] Shutting down plugin 'MyISAM' MySQL Version 5.7.1 Checking supported features... - SSL connections supported - binaries are debug compiled Collecting tests... Checking leftover processes... - found old pid 7344 in 'mysqld.1.pid', killing it... process did not exist! Removing old var directory... Creating var directory '/home/sveta/src/mysql-trunk/mysql-test/var'... Installing system database... Using server port 49088 ============================================================================== TEST RESULT TIME (ms) or COMMENT -------------------------------------------------------------------------- worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 worker[1] Started [mysqld.1 - pid: 32610, winpid: 32610] worker[1] Using config for test innodb.innodb worker[1] Port and socket path for server(s): worker[1] mysqld.1 13000 /home/sveta/src/mysql-trunk/mysql-test/var/tmp/mysqld.1.sock worker[1] Waiting for server(s) to exit... [sveta@delly mysql-test]$ ../client/mysql -uroot -h 127.0.0.1 -P13000 test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.7.1-m11-debug-log Source distribution Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> create table t1(f1 int); Query OK, 0 rows affected (0.14 sec) mysql> \q Bye [sveta@delly mysql-test]$ cat >var/mysqld.1/data/test/bug67178.csv 1 2 3 ^C [sveta@delly mysql-test]$ ../client/mysql -uroot -h 127.0.0.1 -P13000 test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.7.1-m11-debug-log Source distribution Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> \q Bye [sveta@delly mysql-test]$ ../client/mysql -uroot -h 127.0.0.1 -P4040 test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.1-m11-debug-log Source distribution Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> load data infile 'bug67178.csv' into table t1; Query OK, 4 rows affected, 1 warning (0.00 sec) Records: 4 Deleted: 0 Skipped: 0 Warnings: 1 mysql> select * from t1; +------+ | f1 | +------+ | 1 | | 2 | | 3 | | 0 | +------+ 4 rows in set (0.01 sec) mysql> load data local infile 'bug67178.csv' into table t1; ERROR 1146 (42S02): Table 'test.NEW_TABLE' doesn't exist mysql> create table NEW_TABLE like t1; Query OK, 0 rows affected (0.14 sec) mysql> select * from NEW_TABLE; Empty set (0.00 sec) mysql> load data local infile 'bug67178.csv' into table not_existent; Query OK, 4 rows affected, 1 warning (0.00 sec) Records: 4 Deleted: 0 Skipped: 0 Warnings: 1 mysql> select * from NEW_TABLE; +------+ | f1 | +------+ | 1 | | 2 | | 3 | | 0 | +------+ 4 rows in set (0.00 sec) mysql> So everything works fine and I close this report as "Can't repeat"