Details

      Description

      BULK Command

      Protocol

      • byte<1> (250) COM_STMT_BULK_EXECUTE
      • int<4> stmt id
      • byte<2> bulk_flags
      • if BIT_IS_SET(bulk_flags,SEND_TYPES_TO_SERVER)
        • for each parameter :
          • byte<1>: field type
          • byte<1>: parameter flag (128 = unsigned)
      • until end of packet :
        • for each parameter :
          • byte<1>: parameter indicator (see after)
          • if indicator == NONE
            • byte<n>: binary parameter value

      BULK response:

      • OK_PACKET (with MORE_RESULT_EXISTS if NEED_GENERATED_IDS)
      • if BIT_IS_SET(bulk_flags,NEED_GENERATED_IDS)
        • insert ids resultset encoded in binary
      • ERROR_PACKET something bad happened, also if stmt would return result set

      Flags

      Bulk flags:

      64 Return generated auto-increment IDs
      128 Send types to server

      Indicator parameter:

      0 NONE Value follow
      1 NULL Value is null
      2 DEFAULT For INSERT/UPDATE, value is default
      3 IGNORE Value is default one for insert, Is ignored for update

      Generated IDs result-set :

      result-set encoded in binary format.

      Columns

      Column name type meaning
      “Id” Unsigned 8 byte numeric Start ID of the sequence
      “Len” Unsigned 8 byte numeric Sequence length (number of sequential Ids)
      “Inc” Signed 8 byte numeric Increment of the sequence (same for all records of this row)

      Example

      The following result set

      Id Len Inc
      1 2 1
      4 3 2
      15 1 1

      Is returned if generated ids are 1,2, 4,6 ,8, 15

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sanja Oleksandr Byelkin
                Reporter:
                sanja Oleksandr Byelkin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: