MySQL 9.1.0
Source Code Documentation
|
#include <errmsg.h>
#include <my_byteorder.h>
#include <my_dbug.h>
#include <my_sys.h>
#include <my_time.h>
#include <cstdint>
#include "m_string.h"
#include "my_config.h"
#include "mysql.h"
#include "mysql/service_mysql_alloc.h"
#include "mysqld_error.h"
#include "nulls.h"
#include "sql_common.h"
Classes | |
class | bind_params_iterator |
Macros | |
#define | MAX_DATE_REP_LENGTH 5 |
#define | MAX_TIME_REP_LENGTH 13 |
Functions | |
static bool | my_realloc_str (NET *net, ulong length) |
static void | store_param_type (unsigned char **pos, MYSQL_BIND *param) |
static void | store_param_tinyint (NET *net, MYSQL_BIND *param) |
static void | store_param_short (NET *net, MYSQL_BIND *param) |
static void | store_param_int32 (NET *net, MYSQL_BIND *param) |
static void | store_param_int64 (NET *net, MYSQL_BIND *param) |
static void | store_param_float (NET *net, MYSQL_BIND *param) |
static void | store_param_double (NET *net, MYSQL_BIND *param) |
static void | store_param_time (NET *net, MYSQL_BIND *param) |
static void | net_store_datetime (NET *net, MYSQL_TIME *tm) |
static void | store_param_date (NET *net, MYSQL_BIND *param) |
static void | store_param_datetime (NET *net, MYSQL_BIND *param) |
static void | store_param_str (NET *net, MYSQL_BIND *param) |
static void | store_param_null (NET *net, MYSQL_BIND *param, my_off_t null_pos_ofs) |
Mark the parameter as NULL. More... | |
static bool | store_param (NET *net, MYSQL_BIND *param, my_off_t null_pos_ofs) |
Store one parameter in network packet: data is read from client buffer and saved in network packet by means of one of store_param_xxxx functions. More... | |
bool | mysql_int_serialize_param_data (NET *net, unsigned int param_count, MYSQL_BIND *params, const char **names, unsigned long n_param_sets, uchar **ret_data, ulong *ret_length, uchar send_types_to_server, bool send_named_params, bool send_parameter_set_count, bool send_parameter_count_when_zero) |
Serialize the query parameters. More... | |
bool | fix_param_bind (MYSQL_BIND *param, uint idx) |
Variables | |
constexpr int | MAX_DATETIME_REP_LENGTH |
static bool | int_is_null_true = true |
static bool | int_is_null_false = false |
#define MAX_DATE_REP_LENGTH 5 |
#define MAX_TIME_REP_LENGTH 13 |
bool fix_param_bind | ( | MYSQL_BIND * | param, |
uint | idx | ||
) |
|
static |
bool mysql_int_serialize_param_data | ( | NET * | net, |
unsigned int | param_count, | ||
MYSQL_BIND * | params, | ||
const char ** | names, | ||
unsigned long | n_param_sets, | ||
uchar ** | ret_data, | ||
ulong * | ret_length, | ||
uchar | send_types_to_server, | ||
bool | send_named_params, | ||
bool | send_parameter_set_count, | ||
bool | send_parameter_count_when_zero | ||
) |
Serialize the query parameters.
Used by mysql_real_query, mysql_real_query_nonblocking and mysql_stmt_execute()
Must be called on connected sessions only.
net | the NET to use as a string buffer serializing the params. It's cleared at start. | |
param_count | the number of parameters to send | |
params | the filled in MYSQL_BIND structure to retrieve the values from | |
names | the names of the parameters in the params argument | |
n_param_sets | the number of sets of values to set | |
[out] | ret_data | the buffer to the serialized parameter representation |
[out] | ret_length | the number of bytes stored into the buffer |
send_types_to_server | : whether to send the parameter types to the server or not | |
send_named_params | : whether the names of the parameters should be sent | |
send_parameter_set_count | : whether to send 1 as parameter count or not | |
send_parameter_count_when_zero | ON to send the param count even when it's zero |
true | execution failed. Error in NET |
false | execution succeeded |
|
static |
|
static |
Store one parameter in network packet: data is read from client buffer and saved in network packet by means of one of store_param_xxxx functions.
net | MySQL NET connection |
param | MySQL bind param |
null_pos_ofs | the offset from the start of the buffer to the first byte of the null mask |
true | failure |
false | success |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Mark the parameter as NULL.
net | MySQL NET connection |
param | MySQL bind param |
null_pos_ofs | the offset from the start of the buffer to the first byte of the null mask |
A data package starts with a string of bits where we set a bit if a parameter is NULL. Unlike bit string in result set row, here we don't have reserved bits for OK/error packet.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
constexpr |