MySQL 8.4.3
Source Code Documentation
|
Send a Text Protocol based SQL query
Execution starts immediately.
If the client and server support it, the values for the named parameters of the query are sent (if any) in Binary Protocol Value form. The type of each parameter is made up of two bytes (except for the parameter name):
Type | Name | Description |
---|---|---|
int<1> | command | 0x03: COM_QUERY |
if CLIENT_QUERY_ATTRIBUTES is set { | ||
int<lenenc> | parameter_count | Number of parameters |
int<lenenc> | parameter_set_count | Number of parameter sets. Currently always 1 |
if parameter_count > 0 { | ||
binary<var> | null_bitmap | NULL bitmap, length= (num_params + 7) / 8 |
int<1> | new_params_bind_flag | Always 1. Malformed packet error if not 1 |
if new_params_bind_flag, for each parameter { | ||
int<2> | param_type_and_flag | Parameter type (2 bytes). The MSB is reserved for unsigned flag |
string<lenenc> | parameter name | String |
} | ||
binary<var> | parameter_values | value of each parameter: Binary Protocol Value |
} | ||
} | ||
string<EOF> | query | the text of the SQL query to execute |
null_bitmap
is like the NULL-bitmap for the Binary Protocol Resultset Row just that it has a bit_offset of 0.