# EXECUTE\_LOAD\_QUERY\_EVENT

This event is written to the binary log file for [LOAD DATA INFILE](/docs/server/reference/sql-statements/data-manipulation/inserting-loading-data/load-data-into-tables-or-index/load-data-infile.md) events. The event format is similar to a [QUERY\_EVENT](/docs/server/reference/clientserver-protocol/replication-protocol/query_event.md), except that it has extra static fields.

## Header

* Event Type = 0x12.

## Fields

### Fixed Data Part

* [uint<4>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The ID of the thread that issued this statement on the master.
* [uint<4>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The time in seconds that the statement took to execute.
* [uint<1>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The length of the name of the database which was the default database when the statement was executed. This name appears later, in the variable data part. It is necessary for statements such as `INSERT INTO t VALUES(1)` that don't specify the database and rely on the default database previously selected by `USE`.
* [uint<2>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The error code resulting from execution of the statement on the master.
* [uint<2>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The length of the status variable block.
* [uint<4>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) The ID of the loaded file.
* [uint<4>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) Offset from the start of the statement to the beginning of the filename.
* [uint<4>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) Offset from the start of the statement to the end of the filename.
* [uint<1>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-integers) How `LOAD DATA INFILE` handles duplicates (0x0: error, 0x1: ignore, 0x2: replace).

### Variable Data Part

* [byte\<n>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-bytes) Zero or more status variables. Each status variable consists of one byte code identifying the variable stored, followed by the value of the variable. The format of the value is variable-specific.\
  The number of bytes 'n' is the length of the status variable block (read in fixed data part)
* [string\<NUL>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-bytes) The default database name (null-terminated).
* [string\<EOF>](/docs/server/reference/clientserver-protocol/protocol-data-types.md#fixed-length-bytes) The SQL statement. By subtraction the size of the statement can be known.

<sub>*This page is licensed: CC BY-SA / Gnu FDL*</sub>

{% @marketo/form formId="4316" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mariadb.com/docs/server/reference/clientserver-protocol/replication-protocol/execute_load_query_event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
