1 #ifndef SQL_COMMON_INCLUDED
2 #define SQL_COMMON_INCLUDED
19 #define SQL_COMMON_INCLUDED
28 extern const char *unknown_sqlstate;
29 extern const char *cant_connect_sqlstate;
30 extern const char *not_error_sqlstate;
37 HASH connection_attributes;
38 char *server_public_key_path;
39 size_t connection_attributes_length;
40 my_bool enable_cleartext_plugin;
45 my_bool (*read_query_result)(
MYSQL *mysql);
46 my_bool (*advanced_command)(
MYSQL *mysql,
47 enum enum_server_command command,
48 const unsigned char *header,
49 unsigned long header_length,
50 const unsigned char *arg,
51 unsigned long arg_length,
57 void (*fetch_lengths)(
unsigned long *
to,
58 MYSQL_ROW column,
unsigned int field_count);
59 void (*flush_use_result)(
MYSQL *mysql, my_bool flush_all_results);
60 int (*read_change_user_result)(
MYSQL *mysql);
61 #if !defined(MYSQL_SERVER) || defined(EMBEDDED_LIBRARY)
66 int (*unbuffered_fetch)(
MYSQL *mysql,
char **row);
67 void (*free_embedded_thd)(
MYSQL *mysql);
68 const char *(*read_statistics)(
MYSQL *mysql);
69 my_bool (*next_result)(
MYSQL *mysql);
70 int (*read_rows_from_cursor)(
MYSQL_STMT *stmt);
74 #define simple_command(mysql, command, arg, length, skip_check) \
75 (*(mysql)->methods->advanced_command)(mysql, command, 0, \
76 0, arg, length, skip_check, NULL)
77 #define stmt_command(mysql, command, arg, length, stmt) \
78 (*(mysql)->methods->advanced_command)(mysql, command, 0, \
79 0, arg, length, 1, stmt)
83 uint fields, my_bool default_value,
84 uint server_capabilities);
86 void free_old_query(
MYSQL *mysql);
87 void end_server(
MYSQL *mysql);
88 my_bool mysql_reconnect(
MYSQL *mysql);
90 const char *filename,
const char *
group);
92 cli_advanced_command(
MYSQL *mysql,
enum enum_server_command command,
93 const unsigned char *header, ulong header_length,
94 const unsigned char *arg, ulong arg_length,
96 unsigned long cli_safe_read(
MYSQL *mysql);
97 void net_clear_error(
NET *net);
99 void set_stmt_error(
MYSQL_STMT *stmt,
int errcode,
const char *sqlstate,
101 void set_mysql_error(
MYSQL *mysql,
int errcode,
const char *sqlstate);
102 void set_mysql_extended_error(
MYSQL *mysql,
int errcode,
const char *sqlstate,
103 const char *format, ...);
108 int run_plugin_auth(
MYSQL *mysql,
char *data, uint data_len,
109 const char *data_plugin,
const char *db);
114 uchar * send_client_connect_attrs(
MYSQL *mysql, uchar *
buf);
115 extern my_bool libmysql_cleartext_plugin_enabled;
121 #define protocol_41(A) ((A)->server_capabilities & CLIENT_PROTOCOL_41)