All pages
Powered by GitBook
1 of 1

Loading...

COM_STMT_BULK_EXECUTE

This command executes a bulk insert for a previously prepared statement, using a compact binary format for efficiency.

Executes a bulk insert of a previously prepared statement.

A command that returns a result set returns an error (Error packet).

Direction

Client to server.

Fields

  • 0xfa : COM_STMT_BULK_EXECUTE header.

  • statement id.

  • .

Flags

Bulk Flags

Flag
Value
Details

Parameter Type Flag

Parameter Indicator

Response

The server can answer with 3 different responses:

  • 0xff: if any errors occur.

  • 0x00: when query execution works without result set.

  • A result set containing affected rows and auto-increment IDs when bulk flag SEND_UNIT_RESULTS is set.

This page is licensed: CC BY-SA / Gnu FDL

If (
bulk_flag
&
SEND_TYPES_TO_SERVER
):
  • For each parameter:

    • byte<1>: field type.

    • byte<1>: parameter type flag.

  • Until end of packet:

    • For each parameter (i.e param_count times):

      • byte<1>: parameter indicator.

      • If indicator == NONE:

        • byte : binary parameter value.

  • SEND_UNIT_RESULTS

    64

    Return generated affected rows and auto-increment IDs as a result set (only when server supports MARIADB_CLIENT_BULK_UNIT_RESULTS capability).

    SEND_TYPES_TO_SERVER

    128

    Send types to server.

    128

    unsigned

    0

    NONE

    Value follow

    1

    NULL

    Value is null

    2

    DEFAULT

    For INSERT/UPDATE, value is default

    3

    IGNORE

    Value is default for insert, Is ignored for update

    int<1>
    int<4>
    int<2>
    bulk flags
    ERR_Packet
    OK_packet