51
51
#include "my_list.h" /* for LISTs used in 'MYSQL' */
53
extern unsigned int mysql_port;
54
extern char *mysql_unix_port;
56
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
57
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
59
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
60
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
61
#define IS_BLOB(n) ((n) & BLOB_FLAG)
62
#define IS_NUM(t) ((t) <= MYSQL_TYPE_LONGLONG || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
63
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
53
extern unsigned int drizzle_port;
54
extern char *drizzle_unix_port;
56
#define CLIENT_NET_READ_TIMEOUT 365*24*3600 /* Timeout on read */
57
#define CLIENT_NET_WRITE_TIMEOUT 365*24*3600 /* Timeout on write */
59
#define IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
60
#define IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
61
#define IS_BLOB(n) ((n) & BLOB_FLAG)
62
#define IS_NUM(t) ((t) <= MYSQL_TYPE_LONGLONG || (t) == MYSQL_TYPE_YEAR || (t) == MYSQL_TYPE_NEWDECIMAL)
63
#define IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
64
64
#define INTERNAL_NUM_FIELD(f) (((f)->type <= MYSQL_TYPE_LONGLONG && ((f)->type != MYSQL_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == MYSQL_TYPE_YEAR)
65
65
#define IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)
68
typedef struct st_mysql_field {
68
typedef struct st_drizzle_field {
69
69
char *name; /* Name of column */
70
70
char *org_name; /* Original column name, if an alias */
71
71
char *table; /* Table of column if column was a field */
72
72
char *org_table; /* Org table name, if table was an alias */
73
73
char *db; /* Database for table */
74
char *catalog; /* Catalog for table */
75
char *def; /* Default value (set by mysql_list_fields) */
74
char *catalog; /* Catalog for table */
75
char *def; /* Default value (set by drizzle_list_fields) */
76
76
unsigned long length; /* Width of column (create length) */
77
77
unsigned long max_length; /* Max width for selected set */
78
78
unsigned int name_length;
85
85
unsigned int flags; /* Div flags */
86
86
unsigned int decimals; /* Number of decimals in field */
87
87
unsigned int charsetnr; /* Character set */
88
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
88
enum enum_field_types type; /* Type of field. See drizzle_com.h for types */
92
typedef char **MYSQL_ROW; /* return data as array of strings */
93
typedef unsigned int MYSQL_FIELD_OFFSET; /* offset to current field */
92
typedef char **DRIZZLE_ROW; /* return data as array of strings */
93
typedef unsigned int DRIZZLE_FIELD_OFFSET; /* offset to current field */
95
95
#include "typelib.h"
97
#define MYSQL_COUNT_ERROR (~(uint64_t) 0)
97
#define DRIZZLE_COUNT_ERROR (~(uint64_t) 0)
99
99
/* backward compatibility define - to be removed eventually */
100
100
#define ER_WARN_DATA_TRUNCATED WARN_DATA_TRUNCATED
102
typedef struct st_mysql_rows {
103
struct st_mysql_rows *next; /* list of rows */
102
typedef struct st_drizzle_rows {
103
struct st_drizzle_rows *next; /* list of rows */
105
105
unsigned long length;
108
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
108
typedef DRIZZLE_ROWS *DRIZZLE_ROW_OFFSET; /* offset to current row */
110
110
#include "my_alloc.h"
112
112
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
113
typedef struct st_mysql_data {
113
typedef struct st_drizzle_data {
115
115
struct embedded_query_result *embedded_info;
118
118
unsigned int fields;
119
119
/* extra info for embedded library */
125
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
126
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
127
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
128
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
129
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
130
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
131
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
132
MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
133
MYSQL_OPT_SSL_VERIFY_SERVER_CERT
125
DRIZZLE_OPT_CONNECT_TIMEOUT, DRIZZLE_OPT_COMPRESS, DRIZZLE_OPT_NAMED_PIPE,
126
DRIZZLE_INIT_COMMAND, DRIZZLE_READ_DEFAULT_FILE, DRIZZLE_READ_DEFAULT_GROUP,
127
DRIZZLE_SET_CHARSET_DIR, DRIZZLE_SET_CHARSET_NAME, DRIZZLE_OPT_LOCAL_INFILE,
128
DRIZZLE_OPT_PROTOCOL, DRIZZLE_SHARED_MEMORY_BASE_NAME, DRIZZLE_OPT_READ_TIMEOUT,
129
DRIZZLE_OPT_WRITE_TIMEOUT, DRIZZLE_OPT_USE_RESULT,
130
DRIZZLE_OPT_USE_REMOTE_CONNECTION, DRIZZLE_OPT_USE_EMBEDDED_CONNECTION,
131
DRIZZLE_OPT_GUESS_CONNECTION, DRIZZLE_SET_CLIENT_IP, DRIZZLE_SECURE_AUTH,
132
DRIZZLE_REPORT_DATA_TRUNCATION, DRIZZLE_OPT_RECONNECT,
133
DRIZZLE_OPT_SSL_VERIFY_SERVER_CERT
136
struct st_mysql_options {
136
struct st_drizzle_options {
137
137
unsigned int connect_timeout, read_timeout, write_timeout;
138
138
unsigned int port, protocol;
139
139
unsigned long client_flag;
140
140
char *host,*user,*password,*unix_socket,*db;
141
141
struct st_dynamic_array *init_commands;
142
142
char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
143
char *ssl_key; /* PEM key file */
144
char *ssl_cert; /* PEM cert file */
145
char *ssl_ca; /* PEM CA file */
146
char *ssl_capath; /* PEM directory of CA-s? */
147
char *ssl_cipher; /* cipher to use */
143
char *ssl_key; /* PEM key file */
144
char *ssl_cert; /* PEM cert file */
145
char *ssl_ca; /* PEM CA file */
146
char *ssl_capath; /* PEM directory of CA-s? */
147
char *ssl_cipher; /* cipher to use */
148
148
char *shared_memory_base_name;
149
149
unsigned long max_allowed_packet;
150
my_bool use_ssl; /* if to use SSL or not */
150
my_bool use_ssl; /* if to use SSL or not */
151
151
my_bool compress,named_pipe;
156
enum mysql_option methods_to_use;
156
enum drizzle_option methods_to_use;
158
158
/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
159
159
my_bool secure_auth;
192
192
unsigned int mbmaxlen; /* max. length for multibyte strings */
193
193
} MY_CHARSET_INFO;
195
struct st_mysql_methods;
196
struct st_mysql_stmt;
195
struct st_drizzle_methods;
196
struct st_drizzle_stmt;
198
typedef struct st_mysql
198
typedef struct st_drizzle
200
NET net; /* Communication parameters */
201
unsigned char *connector_fd; /* ConnectorFd for SSL */
202
char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
200
NET net; /* Communication parameters */
201
unsigned char *connector_fd; /* ConnectorFd for SSL */
202
char *host,*user,*passwd,*unix_socket,*server_version,*host_info;
204
204
struct charset_info_st *charset;
206
MEM_ROOT field_alloc;
205
DRIZZLE_FIELD *fields;
206
MEM_ROOT field_alloc;
207
207
uint64_t affected_rows;
208
uint64_t insert_id; /* id if insert on table with NEXTNR */
209
uint64_t extra_info; /* Not used */
210
uint32_t thread_id; /* Id for connection in server */
208
uint64_t insert_id; /* id if insert on table with NEXTNR */
209
uint64_t extra_info; /* Not used */
210
uint32_t thread_id; /* Id for connection in server */
211
211
uint32_t packet_length;
213
213
uint32_t client_flag,server_capabilities;
214
uint32_t protocol_version;
215
uint32_t field_count;
216
uint32_t server_status;
214
uint32_t protocol_version;
215
uint32_t field_count;
216
uint32_t server_status;
217
217
uint32_t server_language;
218
uint32_t warning_count;
219
struct st_mysql_options options;
220
enum mysql_status status;
221
bool free_me; /* If free in mysql_close */
222
bool reconnect; /* set to 1 if automatic reconnect */
218
uint32_t warning_count;
219
struct st_drizzle_options options;
220
enum drizzle_status status;
221
bool free_me; /* If free in drizzle_close */
222
bool reconnect; /* set to 1 if automatic reconnect */
224
224
/* session-wide random string */
225
char scramble[SCRAMBLE_LENGTH+1];
225
char scramble[SCRAMBLE_LENGTH+1];
227
227
void *unused2, *unused3, *unused4, *unused5;
229
229
LIST *stmts; /* list of all statements */
230
const struct st_mysql_methods *methods;
230
const struct st_drizzle_methods *methods;
233
Points to boolean flag in MYSQL_RES or MYSQL_STMT. We set this flag
234
from mysql_stmt_close if close had to cancel result set of this object.
233
Points to boolean flag in DRIZZLE_RES or MYSQL_STMT. We set this flag
234
from drizzle_stmt_close if close had to cancel result set of this object.
236
236
bool *unbuffered_fetch_owner;
237
237
/* needed for embedded server - no net buffer to store the 'info' */
238
238
char *info_buffer;
243
typedef struct st_mysql_res {
243
typedef struct st_drizzle_res {
244
244
uint64_t row_count;
247
MYSQL_ROWS *data_cursor;
248
uint32_t *lengths; /* column lengths of current row */
249
MYSQL *handle; /* for unbuffered reads */
250
const struct st_mysql_methods *methods;
251
MYSQL_ROW row; /* If unbuffered read */
252
MYSQL_ROW current_row; /* buffer to current row */
253
MEM_ROOT field_alloc;
254
uint32_t field_count, current_field;
255
bool eof; /* Used by mysql_fetch_row */
256
/* mysql_stmt_close() had to cancel this result */
257
bool unbuffered_fetch_cancelled;
245
DRIZZLE_FIELD *fields;
247
DRIZZLE_ROWS *data_cursor;
248
uint32_t *lengths; /* column lengths of current row */
249
DRIZZLE *handle; /* for unbuffered reads */
250
const struct st_drizzle_methods *methods;
251
DRIZZLE_ROW row; /* If unbuffered read */
252
DRIZZLE_ROW current_row; /* buffer to current row */
253
MEM_ROOT field_alloc;
254
uint32_t field_count, current_field;
255
bool eof; /* Used by drizzle_fetch_row */
256
/* drizzle_stmt_close() had to cancel this result */
257
bool unbuffered_fetch_cancelled;
262
262
#if !defined(MYSQL_SERVER) && !defined(MYSQL_CLIENT)
304
304
connection. All uses of the connection(s) should be between these
307
my_bool STDCALL mysql_thread_init(void);
308
void STDCALL mysql_thread_end(void);
307
my_bool STDCALL drizzle_thread_init(void);
308
void STDCALL drizzle_thread_end(void);
311
Functions to get information from the MYSQL and MYSQL_RES structures
311
Functions to get information from the DRIZZLE and DRIZZLE_RES structures
312
312
Should definitely be used if one uses shared libraries.
315
uint64_t STDCALL mysql_num_rows(MYSQL_RES *res);
316
unsigned int STDCALL mysql_num_fields(MYSQL_RES *res);
317
my_bool STDCALL mysql_eof(MYSQL_RES *res);
318
MYSQL_FIELD *STDCALL mysql_fetch_field_direct(MYSQL_RES *res,
319
unsigned int fieldnr);
320
MYSQL_FIELD * STDCALL mysql_fetch_fields(MYSQL_RES *res);
321
MYSQL_ROW_OFFSET STDCALL mysql_row_tell(MYSQL_RES *res);
322
MYSQL_FIELD_OFFSET STDCALL mysql_field_tell(MYSQL_RES *res);
324
uint32_t STDCALL mysql_field_count(MYSQL *mysql);
325
uint64_t STDCALL mysql_affected_rows(MYSQL *mysql);
326
uint64_t STDCALL mysql_insert_id(MYSQL *mysql);
327
uint32_t STDCALL mysql_errno(MYSQL *mysql);
328
const char * STDCALL mysql_error(MYSQL *mysql);
329
const char *STDCALL mysql_sqlstate(MYSQL *mysql);
330
uint32_t STDCALL mysql_warning_count(MYSQL *mysql);
331
const char * STDCALL mysql_info(MYSQL *mysql);
332
uint32_t STDCALL mysql_thread_id(MYSQL *mysql);
333
const char * STDCALL mysql_character_set_name(MYSQL *mysql);
334
int32_t STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname);
336
MYSQL * STDCALL mysql_init(MYSQL *mysql);
337
my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user,
338
const char *passwd, const char *db);
339
MYSQL * STDCALL mysql_real_connect(MYSQL *mysql, const char *host,
344
const char *unix_socket,
345
uint32_t clientflag);
346
int32_t STDCALL mysql_select_db(MYSQL *mysql, const char *db);
347
int32_t STDCALL mysql_query(MYSQL *mysql, const char *q);
348
int32_t STDCALL mysql_send_query(MYSQL *mysql, const char *q, uint32_t length);
349
int32_t STDCALL mysql_real_query(MYSQL *mysql, const char *q, uint32_t length);
350
MYSQL_RES * STDCALL mysql_store_result(MYSQL *mysql);
351
MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql);
353
void STDCALL mysql_get_character_set_info(MYSQL *mysql,
315
uint64_t STDCALL drizzle_num_rows(DRIZZLE_RES *res);
316
unsigned int STDCALL drizzle_num_fields(DRIZZLE_RES *res);
317
my_bool STDCALL drizzle_eof(DRIZZLE_RES *res);
318
DRIZZLE_FIELD *STDCALL drizzle_fetch_field_direct(DRIZZLE_RES *res,
319
unsigned int fieldnr);
320
DRIZZLE_FIELD * STDCALL drizzle_fetch_fields(DRIZZLE_RES *res);
321
DRIZZLE_ROW_OFFSET STDCALL DRIZZLE_ROW_tell(DRIZZLE_RES *res);
322
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_tell(DRIZZLE_RES *res);
324
uint32_t STDCALL drizzle_field_count(DRIZZLE *drizzle);
325
uint64_t STDCALL drizzle_affected_rows(DRIZZLE *drizzle);
326
uint64_t STDCALL drizzle_insert_id(DRIZZLE *drizzle);
327
uint32_t STDCALL drizzle_errno(DRIZZLE *drizzle);
328
const char * STDCALL drizzle_error(DRIZZLE *drizzle);
329
const char *STDCALL drizzle_sqlstate(DRIZZLE *drizzle);
330
uint32_t STDCALL drizzle_warning_count(DRIZZLE *drizzle);
331
const char * STDCALL drizzle_info(DRIZZLE *drizzle);
332
uint32_t STDCALL drizzle_thread_id(DRIZZLE *drizzle);
333
const char * STDCALL drizzle_character_set_name(DRIZZLE *drizzle);
334
int32_t STDCALL drizzle_set_character_set(DRIZZLE *drizzle, const char *csname);
336
DRIZZLE * STDCALL drizzle_init(DRIZZLE *drizzle);
337
my_bool STDCALL drizzle_change_user(DRIZZLE *drizzle, const char *user,
338
const char *passwd, const char *db);
339
DRIZZLE * STDCALL drizzle_connect(DRIZZLE *drizzle, const char *host,
344
const char *unix_socket,
345
uint32_t clientflag);
346
int32_t STDCALL drizzle_select_db(DRIZZLE *drizzle, const char *db);
347
int32_t STDCALL drizzle_query(DRIZZLE *drizzle, const char *q);
348
int32_t STDCALL drizzle_send_query(DRIZZLE *drizzle, const char *q, uint32_t length);
349
int32_t STDCALL drizzle_real_query(DRIZZLE *drizzle, const char *q, uint32_t length);
350
DRIZZLE_RES * STDCALL drizzle_store_result(DRIZZLE *drizzle);
351
DRIZZLE_RES * STDCALL drizzle_use_result(DRIZZLE *drizzle);
353
void STDCALL drizzle_get_character_set_info(DRIZZLE *drizzle,
354
354
MY_CHARSET_INFO *charset);
356
356
/* local infile support */
358
358
#define LOCAL_INFILE_ERROR_LEN 512
361
mysql_set_local_infile_handler(MYSQL *mysql,
362
int (*local_infile_init)(void **, const char *,
364
int (*local_infile_read)(void *, char *,
366
void (*local_infile_end)(void *),
367
int (*local_infile_error)(void *, char*,
361
drizzle_set_local_infile_handler(DRIZZLE *drizzle,
362
int (*local_infile_init)(void **, const char *, void *),
363
int (*local_infile_read)(void *, char *, unsigned int),
364
void (*local_infile_end)(void *),int (*local_infile_error)
365
(void *, char*, unsigned int), void *);
372
mysql_set_local_infile_default(MYSQL *mysql);
374
int32_t STDCALL mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level);
375
int32_t STDCALL mysql_dump_debug_info(MYSQL *mysql);
376
int32_t STDCALL mysql_refresh(MYSQL *mysql, uint32_t refresh_options);
377
int32_t STDCALL mysql_kill(MYSQL *mysql, uint32_t pid);
378
int32_t STDCALL mysql_set_server_option(MYSQL *mysql, enum enum_mysql_set_option option);
379
int32_t STDCALL mysql_ping(MYSQL *mysql);
380
const char * STDCALL mysql_stat(MYSQL *mysql);
381
const char * STDCALL mysql_get_server_info(MYSQL *mysql);
382
const char * STDCALL mysql_get_client_info(void);
383
uint32_t STDCALL mysql_get_client_version(void);
384
const char * STDCALL mysql_get_host_info(MYSQL *mysql);
385
uint32_t STDCALL mysql_get_server_version(MYSQL *mysql);
386
uint32_t STDCALL mysql_get_proto_info(MYSQL *mysql);
387
MYSQL_RES * STDCALL mysql_list_dbs(MYSQL *mysql,const char *wild);
388
MYSQL_RES * STDCALL mysql_list_tables(MYSQL *mysql,const char *wild);
389
MYSQL_RES * STDCALL mysql_list_processes(MYSQL *mysql);
390
int32_t STDCALL mysql_options(MYSQL *mysql,enum mysql_option option, const void *arg);
391
void STDCALL mysql_free_result(MYSQL_RES *result);
392
void STDCALL mysql_data_seek(MYSQL_RES *result, uint64_t offset);
393
MYSQL_ROW_OFFSET STDCALL mysql_row_seek(MYSQL_RES *result, MYSQL_ROW_OFFSET offset);
394
MYSQL_FIELD_OFFSET STDCALL mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET offset);
395
MYSQL_ROW STDCALL mysql_fetch_row(MYSQL_RES *result);
396
uint32_t * STDCALL mysql_fetch_lengths(MYSQL_RES *result);
397
MYSQL_FIELD * STDCALL mysql_fetch_field(MYSQL_RES *result);
398
MYSQL_RES * STDCALL mysql_list_fields(MYSQL *mysql, const char *table, const char *wild);
399
uint32_t STDCALL mysql_escape_string(char *to,const char *from, uint32_t from_length);
400
uint32_t STDCALL mysql_hex_string(char *to,const char *from, uint32_t from_length);
401
uint32_t STDCALL mysql_real_escape_string(MYSQL *mysql, char *to, const char *from, uint32_t length);
402
void STDCALL myodbc_remove_escape(MYSQL *mysql,char *name);
403
uint32_t STDCALL mysql_thread_safe(void);
404
my_bool STDCALL mysql_embedded(void);
405
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
409
typedef struct st_mysql_methods
368
drizzle_set_local_infile_default(DRIZZLE *drizzle);
370
int32_t STDCALL drizzle_shutdown(DRIZZLE *drizzle, enum drizzle_enum_shutdown_level shutdown_level);
371
int32_t STDCALL drizzle_dump_debug_info(DRIZZLE *drizzle);
372
int32_t STDCALL drizzle_refresh(DRIZZLE *drizzle, uint32_t refresh_options);
373
int32_t STDCALL drizzle_kill(DRIZZLE *drizzle, uint32_t pid);
374
int32_t STDCALL drizzle_set_server_option(DRIZZLE *drizzle, enum enum_drizzle_set_option option);
375
int32_t STDCALL drizzle_ping(DRIZZLE *drizzle);
376
const char * STDCALL drizzle_stat(DRIZZLE *drizzle);
377
const char * STDCALL drizzle_get_server_info(DRIZZLE *drizzle);
378
const char * STDCALL drizzle_get_client_info(void);
379
uint32_t STDCALL drizzle_get_client_version(void);
380
const char * STDCALL drizzle_get_host_info(DRIZZLE *drizzle);
381
uint32_t STDCALL drizzle_get_server_version(DRIZZLE *drizzle);
382
uint32_t STDCALL drizzle_get_proto_info(DRIZZLE *drizzle);
383
DRIZZLE_RES * STDCALL drizzle_list_dbs(DRIZZLE *drizzle,const char *wild);
384
DRIZZLE_RES * STDCALL drizzle_list_tables(DRIZZLE *drizzle,const char *wild);
385
DRIZZLE_RES * STDCALL drizzle_list_processes(DRIZZLE *drizzle);
386
int32_t STDCALL drizzle_options(DRIZZLE *drizzle,enum drizzle_option option, const void *arg);
387
void STDCALL drizzle_free_result(DRIZZLE_RES *result);
388
void STDCALL drizzle_data_seek(DRIZZLE_RES *result, uint64_t offset);
389
DRIZZLE_ROW_OFFSET STDCALL drizzle_row_seek(DRIZZLE_RES *result, DRIZZLE_ROW_OFFSET offset);
390
DRIZZLE_FIELD_OFFSET STDCALL drizzle_field_seek(DRIZZLE_RES *result, DRIZZLE_FIELD_OFFSET offset);
391
DRIZZLE_ROW STDCALL drizzle_fetch_row(DRIZZLE_RES *result);
392
uint32_t * STDCALL drizzle_fetch_lengths(DRIZZLE_RES *result);
393
DRIZZLE_FIELD * STDCALL drizzle_fetch_field(DRIZZLE_RES *result);
394
DRIZZLE_RES * STDCALL drizzle_list_fields(DRIZZLE *drizzle, const char *table, const char *wild);
395
uint32_t STDCALL drizzle_escape_string(char *to,const char *from, uint32_t from_length);
396
uint32_t STDCALL drizzle_hex_string(char *to,const char *from, uint32_t from_length);
397
uint32_t STDCALL drizzle_real_escape_string(DRIZZLE *drizzle, char *to, const char *from, uint32_t length);
398
void STDCALL myodbc_remove_escape(DRIZZLE *drizzle,char *name);
399
uint32_t STDCALL drizzle_thread_safe(void);
400
my_bool STDCALL drizzle_embedded(void);
401
my_bool STDCALL drizzle_read_query_result(DRIZZLE *drizzle);
405
typedef struct st_drizzle_methods
411
bool (*read_query_result)(MYSQL *mysql);
412
bool (*advanced_command)(MYSQL *mysql,
407
bool (*read_query_result)(DRIZZLE *drizzle);
408
bool (*advanced_command)(DRIZZLE *drizzle,
413
409
enum enum_server_command command,
414
410
const unsigned char *header,
415
411
uint32_t header_length,
416
412
const unsigned char *arg,
417
413
uint32_t arg_length,
418
414
bool skip_check);
419
MYSQL_DATA *(*read_rows)(MYSQL *mysql,MYSQL_FIELD *mysql_fields, uint32_t fields);
420
MYSQL_RES * (*use_result)(MYSQL *mysql);
421
void (*fetch_lengths)(uint32_t *to, MYSQL_ROW column, uint32_t field_count);
422
void (*flush_use_result)(MYSQL *mysql);
423
MYSQL_FIELD * (*list_fields)(MYSQL *mysql);
424
int32_t (*unbuffered_fetch)(MYSQL *mysql, char **row);
425
const char *(*read_statistics)(MYSQL *mysql);
426
bool (*next_result)(MYSQL *mysql);
427
int32_t (*read_change_user_result)(MYSQL *mysql, char *buff, const char *passwd);
431
my_bool STDCALL mysql_commit(MYSQL * mysql);
432
my_bool STDCALL mysql_rollback(MYSQL * mysql);
433
my_bool STDCALL mysql_autocommit(MYSQL * mysql, my_bool auto_mode);
434
my_bool STDCALL mysql_more_results(MYSQL *mysql);
435
int STDCALL mysql_next_result(MYSQL *mysql);
436
void STDCALL mysql_close(MYSQL *sock);
415
DRIZZLE_DATA *(*read_rows)(DRIZZLE *drizzle,DRIZZLE_FIELD *drizzle_fields, uint32_t fields);
416
DRIZZLE_RES * (*use_result)(DRIZZLE *drizzle);
417
void (*fetch_lengths)(uint32_t *to, DRIZZLE_ROW column, uint32_t field_count);
418
void (*flush_use_result)(DRIZZLE *drizzle);
419
DRIZZLE_FIELD * (*list_fields)(DRIZZLE *drizzle);
420
int32_t (*unbuffered_fetch)(DRIZZLE *drizzle, char **row);
421
const char *(*read_statistics)(DRIZZLE *drizzle);
422
bool (*next_result)(DRIZZLE *drizzle);
423
int32_t (*read_change_user_result)(DRIZZLE *drizzle, char *buff, const char *passwd);
427
my_bool STDCALL drizzle_commit(DRIZZLE *drizzle);
428
my_bool STDCALL drizzle_rollback(DRIZZLE *drizzle);
429
my_bool STDCALL drizzle_autocommit(DRIZZLE *drizzle, my_bool auto_mode);
430
my_bool STDCALL drizzle_more_results(DRIZZLE *drizzle);
431
int STDCALL drizzle_next_result(DRIZZLE *drizzle);
432
void STDCALL drizzle_close(DRIZZLE *sock);
439
435
/* status return codes */
440
#define MYSQL_NO_DATA 100
441
#define MYSQL_DATA_TRUNCATED 101
436
#define DRIZZLE_NO_DATA 100
437
#define DRIZZLE_DATA_TRUNCATED 101
443
#define mysql_reload(mysql) mysql_refresh((mysql),REFRESH_GRANT)
439
#define drizzle_reload(drizzle) drizzle_refresh((drizzle),REFRESH_GRANT)
446
The following functions are mainly exported because of mysqlbinlog;
442
The following functions are mainly exported because of binlog;
447
443
They are not for general usage
450
#define simple_command(mysql, command, arg, length, skip_check) \
451
(*(mysql)->methods->advanced_command)(mysql, command, 0, \
446
#define simple_command(drizzle, command, arg, length, skip_check) \
447
(*(drizzle)->methods->advanced_command)(drizzle, command, 0, \
452
448
0, arg, length, skip_check)
458
#endif /* _mysql_h */
454
#endif /* _drizzle_h */