Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-7143

mysql load --local-infile sends unknown 4-byte packet

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Not a Bug
    • 5.5.33a
    • 5.5.41
    • OTHER
    • None
    • 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

      Attachments

        Activity

          Yes, check the link in my previous comment.

          nirbhay_c Nirbhay Choubey (Inactive) added a comment - Yes, check the link in my previous comment.

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

          vilho Vilho Raatikka added a comment - Is the LOAD INFILE protocol and the empty packet documented somewhere?

          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

          nirbhay_c Nirbhay Choubey (Inactive) added a comment - 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

          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

          vilho Vilho Raatikka added a comment - 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

          People

            nirbhay_c Nirbhay Choubey (Inactive)
            vilho Vilho Raatikka
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.