[MDEV-7143] mysql load --local-infile sends unknown 4-byte packet Created: 2014-11-19  Updated: 2014-12-17  Resolved: 2014-12-17

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5.33a
Fix Version/s: 5.5.41

Type: Bug Priority: Critical
Reporter: Vilho Raatikka Assignee: Nirbhay Choubey (Inactive)
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

64-bit linux



 Description   

I see extra bytes in what mysql client sends to server when load data local infile .. is called. The extra bytes appears to be an additional packet which I don't recognize to any known packet. It consists of 4 bytes and includes 0x0 0x0 0x0 0x3 .

ngrep dump caught by exexcuting :

sudo ngrep -x -q -d lo '' > outfile.out

dump:

interface: lo (127.0.0.0/255.0.0.0)
 
T 127.0.0.1:58151 -> 127.0.0.1:3000 [AP]
  38 00 00 00 03 6c 6f 61    64 20 64 61 74 61 20 6c    8....load data l
  6f 63 61 6c 20 69 6e 66    69 6c 65 20 27 2e 2f 6c    ocal infile './l
  6f 61 64 33 2e 74 78 74    27 20 69 6e 74 6f 20 74    oad3.txt' into t
  61 62 6c 65 20 74 65 73    74 2e 74 31                able test.t1
 
T 127.0.0.1:3000 -> 127.0.0.1:58151 [AP]
  0c 00 00 01 fb 2e 2f 6c    6f 61 64 33 2e 74 78 74    ....../load3.txt
 
T 127.0.0.1:58151 -> 127.0.0.1:3000 [AP]
  14 00 00 02 31 20 20 20    20 20 20 32 20 0a 31 20    ....1      2 .1
  20 20 20 20 20 39 31 0a    00 00 00 03                     91.....
 
............. The packet above should contain 4 (header) + 20 bytes but it has 28 bytes. 
 
T 127.0.0.1:3000 -> 127.0.0.1:58151 [AP]
  19 00 00 04 ff ff ff 01    02 02 00 00 00 0f 45 6e    ..............En
  64 20 62 75 6c 6b 20 69    6e 73 65 72 74             d bulk insert



 Comments   
Comment by Vilho Raatikka [ 2014-11-20 ]

MySQL client : mysql Ver 15.1 Distrib 5.5.37-MariaDB, for Linux (x86_64) using readline 5.1
Reproduce by executing this in bash shell : mysql --local-infile -h 127.0.0.1 -P 3306 -u user -ppwd -c --disable-reconnect (not sure if last arguments are really needed for this case)
and in mysql-client prompt : load data local infile './load3.txt' into table test.t1;

Content of load3.txt :
1 2
1 91

Comment by Nirbhay Choubey (Inactive) [ 2014-12-17 ]

vilho That's an empty packet which client sends after it has sent the INFILE contents.

An empty packet only has header and no payload,
[00 00 00 03] - length = 0; packet sequence number = 3.

http://dev.mysql.com/doc/internals/en/com-query-response.html#packet-Protocol::LOCAL_INFILE_Request

Comment by Vilho Raatikka [ 2014-12-17 ]

Is the LOAD INFILE protocol and the empty packet documented somewhere?

Comment by Nirbhay Choubey (Inactive) [ 2014-12-17 ]

Yes, check the link in my previous comment.

Generated at Thu Feb 08 07:17:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.