-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmysql.d
1434 lines (943 loc) · 30.4 KB
/
mysql.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
module mysql;
import std.stdio;
import std.string;
import std.conv;
extern (C) {
alias uint size_t;
alias ubyte __u_char;
alias ushort __u_short;
alias uint __u_int;
alias uint __u_long;
alias byte __int8_t;
alias ubyte __uint8_t;
alias short __int16_t;
alias ushort __uint16_t;
alias int __int32_t;
alias uint __uint32_t;
alias long __int64_t;
alias ulong __uint64_t;
alias long __quad_t;
alias ulong __u_quad_t;
alias ulong __dev_t;
alias uint __uid_t;
alias uint __gid_t;
alias uint __ino_t;
alias ulong __ino64_t;
alias uint __mode_t;
alias uint __nlink_t;
alias int __off_t;
alias long __off64_t;
alias int __pid_t;
struct __fsid_t { int __val[2]; };
alias int __clock_t;
alias uint __rlim_t;
alias ulong __rlim64_t;
alias uint __id_t;
alias int __time_t;
alias uint __useconds_t;
alias int __suseconds_t;
alias int __daddr_t;
alias int __swblk_t;
alias int __key_t;
alias int __clockid_t;
alias int __timer_t;
alias int __blksize_t;
alias int __blkcnt_t;
alias long __blkcnt64_t;
alias uint __fsblkcnt_t;
alias ulong __fsblkcnt64_t;
alias uint __fsfilcnt_t;
alias ulong __fsfilcnt64_t;
alias int __ssize_t;
alias __off64_t __loff_t;
alias __quad_t *__qaddr_t;
alias char *__caddr_t;
alias int __intptr_t;
alias uint __socklen_t;
alias __u_char u_char;
alias __u_short u_short;
alias __u_int u_int;
alias __u_long u_long;
alias __quad_t quad_t;
alias __u_quad_t u_quad_t;
alias __fsid_t fsid_t;
alias __loff_t loff_t;
alias __ino_t ino_t;
alias __dev_t dev_t;
alias __gid_t gid_t;
alias __mode_t mode_t;
alias __nlink_t nlink_t;
alias __uid_t uid_t;
alias __off_t off_t;
alias __pid_t pid_t;
alias __id_t id_t;
alias __ssize_t ssize_t;
alias __daddr_t daddr_t;
alias __caddr_t caddr_t;
alias __key_t key_t;
alias __time_t time_t;
alias __clockid_t clockid_t;
alias __timer_t timer_t;
alias int int8_t ;
alias int int16_t ;
alias int int32_t ;
alias int int64_t ;
alias uint u_int8_t ;
alias uint u_int16_t ;
alias uint u_int32_t ;
alias uint u_int64_t ;
alias int register_t ;
alias int __sig_atomic_t;
struct __sigset_t {
uint __val[(1024 / (8 * uint.sizeof))];
};
alias __sigset_t sigset_t;
struct timespec {
__time_t tv_sec;
int tv_nsec;
}
struct timeval {
__time_t tv_sec;
__suseconds_t tv_usec;
}
alias __suseconds_t suseconds_t;
alias int __fd_mask;
struct fd_set {
__fd_mask __fds_bits[1024 / (8 * __fd_mask.sizeof)];
};
alias __fd_mask fd_mask;
extern int select (int __nfds, fd_set * __readfds,
fd_set * __writefds,
fd_set * __exceptfds,
timeval * __timeout);
alias __blkcnt_t blkcnt_t;
alias __fsblkcnt_t fsblkcnt_t;
alias __fsfilcnt_t fsfilcnt_t;
struct __sched_param {
int __sched_priority;
}
alias int __atomic_lock_t;
struct _pthread_fastlock {
int __status;
__atomic_lock_t __spinlock;
}
struct _pthread_descr_struct ;
alias _pthread_descr_struct *_pthread_descr;
struct __pthread_attr_s {
int __detachstate;
int __schedpolicy;
__sched_param __schedparam;
int __inheritsched;
int __scope;
size_t __guardsize;
int __stackaddr_set;
void *__stackaddr;
size_t __stacksize;
};
alias __pthread_attr_s pthread_attr_t;
alias long __pthread_cond_align_t;
struct pthread_cond_t {
_pthread_fastlock __c_lock;
_pthread_descr __c_waiting;
char __padding[48 - _pthread_fastlock.sizeof
- _pthread_descr.sizeof - __pthread_cond_align_t.sizeof];
__pthread_cond_align_t __align;
};
struct pthread_condattr_t {
int __dummy;
};
alias uint pthread_key_t;
struct pthread_mutex_t {
int __m_reserved;
int __m_count;
_pthread_descr __m_owner;
int __m_kind;
_pthread_fastlock __m_lock;
};
struct pthread_mutexattr_t {
int __mutexkind;
};
alias int pthread_once_t;
alias uint pthread_t;
alias char my_bool;
alias char * gptr;
alias int my_socket;
enum enum_server_command
{
COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST,
COM_CREATE_DB, COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS,
COM_PROCESS_INFO, COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING,
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT,
COM_RESET_STMT, COM_SET_OPTION, COM_FETCH,
COM_END
};
struct st_vio ;
alias st_vio Vio;
struct st_net {
Vio* vio;
// ubyte *buff,*buff_end,*write_pos,*read_pos;
ubyte* buff,buff_end,write_pos,read_pos;
my_socket fd;
uint max_packet,max_packet_size;
uint pkt_nr,compress_pkt_nr;
uint write_timeout, read_timeout, retry_count;
int fcntl;
my_bool compress;
uint remain_in_buf,length, buf_length, where_b;
uint *return_status;
ubyte reading_or_writing;
char save_char;
my_bool no_send_ok;
my_bool no_send_eof;
my_bool no_send_error;
char last_error[512];
char sqlstate[5 +1];
uint last_errno;
ubyte error;
gptr query_cache_query;
my_bool report_error;
my_bool return_errno;
};
alias st_net NET;
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_SHORT, MYSQL_TYPE_LONG,
MYSQL_TYPE_FLOAT, MYSQL_TYPE_DOUBLE,
MYSQL_TYPE_NULL, MYSQL_TYPE_TIMESTAMP,
MYSQL_TYPE_LONGLONG,MYSQL_TYPE_INT24,
MYSQL_TYPE_DATE, MYSQL_TYPE_TIME,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
MYSQL_TYPE_TINY_BLOB=249,
MYSQL_TYPE_MEDIUM_BLOB=250,
MYSQL_TYPE_LONG_BLOB=251,
MYSQL_TYPE_BLOB=252,
MYSQL_TYPE_VAR_STRING=253,
MYSQL_TYPE_STRING=254,
MYSQL_TYPE_GEOMETRY=255
};
enum mysql_enum_shutdown_level {
SHUTDOWN_DEFAULT = 0,
SHUTDOWN_WAIT_CONNECTIONS= cast(ubyte)(1 << 0),
SHUTDOWN_WAIT_TRANSACTIONS= cast(ubyte)(1 << 1),
SHUTDOWN_WAIT_UPDATES= cast(ubyte)(1 << 3),
SHUTDOWN_WAIT_ALL_BUFFERS= (cast(ubyte)(1 << 3) << 1),
SHUTDOWN_WAIT_CRITICAL_BUFFERS= (cast(ubyte)(1 << 3) << 1) + 1,
KILL_CONNECTION= 255
};
enum enum_cursor_type
{
CURSOR_TYPE_NO_CURSOR= 0,
CURSOR_TYPE_READ_ONLY= 1,
CURSOR_TYPE_FOR_UPDATE= 2,
CURSOR_TYPE_SCROLLABLE= 4
};
enum enum_mysql_set_option
{
MYSQL_OPTION_MULTI_STATEMENTS_ON,
MYSQL_OPTION_MULTI_STATEMENTS_OFF
};
my_bool my_net_init(NET *net, Vio* vio);
void my_net_local_init(NET *net);
void net_end(NET *net);
void net_clear(NET *net);
my_bool net_realloc(NET *net, uint length);
my_bool net_flush(NET *net);
my_bool my_net_write(NET *net, char *packet,uint len);
my_bool net_write_command(NET *net,ubyte command,
char *header, uint head_len,
char *packet, uint len);
int net_real_write(NET *net, char *packet,uint len);
uint my_net_read(NET *net);
struct sockaddr;
int my_connect(my_socket s, sockaddr *name, uint namelen,
uint timeout);
struct rand_struct {
uint seed1,seed2,max_value;
double max_value_dbl;
}
enum Item_result {STRING_RESULT=0, REAL_RESULT, INT_RESULT, ROW_RESULT,
DECIMAL_RESULT};
struct st_udf_args {
uint arg_count;
Item_result *arg_type;
char **args;
uint *lengths;
char *maybe_null;
char **attributes;
uint *attribute_lengths;
};
alias st_udf_args UDF_ARGS;
struct st_udf_init {
my_bool maybe_null;
uint decimals;
uint max_length;
char *ptr;
my_bool const_item;
};
alias st_udf_init UDF_INIT;
void randominit(rand_struct *, uint seed1,
uint seed2);
double my_rnd(rand_struct *);
void create_random_string(char *to, uint length, rand_struct *rand_st);
void hash_password(uint *to, char *password, uint password_len);
void make_scrambled_password_323(char *to, char *password);
void scramble_323(char *to, char *message, char *password);
my_bool check_scramble_323( char *, char *message,
uint *salt);
void get_salt_from_password_323(uint *res, char *password);
void make_password_from_salt_323(char *to, uint *salt);
void make_scrambled_password(char *to, char *password);
void scramble(char *to, char *message, char *password);
my_bool check_scramble( char *reply, char *message,
ubyte *hash_stage2);
void get_salt_from_password(ubyte *res, char *password);
void make_password_from_salt(char *to, ubyte *hash_stage2);
char *get_tty_password(char *opt_message);
char *mysql_errno_to_sqlstate(uint mysql_errno);
my_bool my_init();
int load_defaults( char *conf_file, char **groups,
int *argc, char ***argv);
my_bool my_thread_init();
void my_thread_end();
enum enum_mysql_timestamp_type
{
MYSQL_TIMESTAMP_NONE= -2, MYSQL_TIMESTAMP_ERROR= -1,
MYSQL_TIMESTAMP_DATE= 0, MYSQL_TIMESTAMP_DATETIME= 1, MYSQL_TIMESTAMP_TIME= 2
};
struct st_mysql_time {
uint year, month, day, hour, minute, second;
uint second_part;
my_bool neg;
enum_mysql_timestamp_type time_type;
};
alias st_mysql_time MYSQL_TIME;
struct st_typelib {
uint count;
const char *name;
const char **type_names;
uint *type_lengths;
};
alias st_typelib TYPELIB;
extern int find_type(char *x,TYPELIB *typelib,uint full_name);
extern void make_type(char *to,uint nr,TYPELIB *typelib);
extern char *get_type(TYPELIB *typelib,uint nr);
extern TYPELIB sql_protocol_typelib;
struct st_list {
//st_list *prev,*next;
alias st_list *prev;
alias st_list *next;
void *data;
};
alias st_list LIST;
alias int (*list_walk_action)(void *,void *);
extern LIST *list_add(LIST *root,LIST *element);
extern LIST *list_delete(LIST *root,LIST *element);
extern LIST *list_cons(void *data,LIST *root);
extern LIST *list_reverse(LIST *root);
extern void list_free(LIST *root,uint free_data);
extern uint list_length(LIST *);
extern int list_walk(LIST *,list_walk_action action,gptr argument);
extern uint mysql_port;
extern char *mysql_unix_port;
struct st_mysql_field {
char *name;
char *org_name;
char *table;
char *org_table;
char *db;
char *catalog;
char *def;
uint length;
uint max_length;
uint name_length;
uint org_name_length;
uint table_length;
uint org_table_length;
uint db_length;
uint catalog_length;
uint def_length;
uint flags;
uint decimals;
uint charsetnr;
enum_field_types type;
};
alias st_mysql_field MYSQL_FIELD;
alias char **MYSQL_ROW;
alias uint MYSQL_FIELD_OFFSET;
alias ulong my_ulonglong;
struct st_mysql_rows {
st_mysql_rows *next;
MYSQL_ROW data;
uint length;
};
alias st_mysql_rows MYSQL_ROWS;
alias MYSQL_ROWS *MYSQL_ROW_OFFSET;
struct st_used_mem {
st_used_mem *next;
uint left;
uint size;
};
alias st_used_mem USED_MEM;
struct st_mem_root {
USED_MEM *free;
USED_MEM *used;
USED_MEM *pre_alloc;
uint min_malloc;
uint block_size;
uint block_num;
uint first_block_usage;
void (*error_handler)();
};
alias st_mem_root MEM_ROOT;
struct st_mysql_data {
my_ulonglong rows;
uint fields;
MYSQL_ROWS *data;
MEM_ROOT alloc;
MYSQL_ROWS **prev_ptr;
};
alias st_mysql_data MYSQL_DATA;
enum mysql_option
{
MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
MYSQL_REPORT_DATA_TRUNCATION
};
struct st_mysql_options {
uint connect_timeout, read_timeout, write_timeout;
uint port, protocol;
uint client_flag;
//char *host,*user,*password,*unix_socket,*db;
char* host,user,password,unix_socket,db;
//struct {st_dynamic_array *init_commands;};
//char *my_cnf_file,*my_cnf_group, *charset_dir, *charset_name;
char* my_cnf_file,my_cnf_group, charset_dir, charset_name;
char *ssl_key;
char *ssl_cert;
char *ssl_ca;
char *ssl_capath;
char *ssl_cipher;
char *shared_memory_base_name;
uint max_allowed_packet;
my_bool use_ssl;
my_bool compress,named_pipe;
my_bool rpl_probe;
my_bool rpl_parse;
my_bool no_master_reads;
my_bool separate_thread;
mysql_option methods_to_use;
char *client_ip;
my_bool secure_auth;
my_bool report_data_truncation;
int (*local_infile_init)(void **, char *, void *);
int (*local_infile_read)(void *, char *, uint);
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, uint);
void *local_infile_userdata;
}
enum mysql_status
{
MYSQL_STATUS_READY,MYSQL_STATUS_GET_RESULT,MYSQL_STATUS_USE_RESULT
};
enum mysql_protocol_type
{
MYSQL_PROTOCOL_DEFAULT, MYSQL_PROTOCOL_TCP, MYSQL_PROTOCOL_SOCKET,
MYSQL_PROTOCOL_PIPE, MYSQL_PROTOCOL_MEMORY
};
enum mysql_rpl_type
{
MYSQL_RPL_MASTER, MYSQL_RPL_SLAVE, MYSQL_RPL_ADMIN
};
// start self inserted
alias char pchar;
struct charset_info_st
{
uint number;
const char *name;
ubyte *ctype;
ubyte *to_lower;
ubyte *to_upper;
ubyte *sort_order;
uint strxfrm_multiply;
int (*strcoll)(byte *, ubyte *);
int (*strxfrm)(ubyte *, ubyte *, int);
int (*strnncoll)(ubyte *, int, ubyte *, int);
int (*strnxfrm)(ubyte *, ubyte *, int, int);
my_bool (*like_range)(char *, uint, pchar, uint,
char *, char *, uint *, uint *);
uint mbmaxlen;
int (*ismbchar)(char *, char *);
my_bool (*ismbhead)(uint);
int (*mbcharlen)(uint);
}
alias charset_info_st CHARSET_INFO;
// end self inserted
//struct st_mysql_methods; // conflict with line 1211
struct st_mysql {
NET net;
gptr connector_fd;
//char *host,*user,*passwd,*unix_socket,*server_version,*host_info,*info;
char* host,user,passwd,unix_socket,server_version,host_info,info;
char *db;
charset_info_st *charset;
MYSQL_FIELD *fields;
MEM_ROOT field_alloc;
my_ulonglong affected_rows;
my_ulonglong insert_id;
my_ulonglong extra_info;
uint thread_id;
uint packet_length;
uint port;
uint client_flag,server_capabilities;
uint protocol_version;
uint field_count;
uint server_status;
uint server_language;
uint warning_count;
st_mysql_options options;
mysql_status status;
my_bool free_me;
my_bool reconnect;
char scramble[20 +1];
my_bool rpl_pivot;
alias st_mysql* master;
alias st_mysql* *next_slave;
alias st_mysql* last_used_slave;
alias st_mysql* last_used_con;
LIST *stmts;
const st_mysql_methods *methods;
void *thd;
my_bool *unbuffered_fetch_owner;
};
alias st_mysql MYSQL;
struct st_mysql_res {
my_ulonglong row_count;
MYSQL_FIELD *fields;
MYSQL_DATA *data;
MYSQL_ROWS *data_cursor;
uint *lengths;
MYSQL *handle;
MEM_ROOT field_alloc;
uint field_count, current_field;
MYSQL_ROW row;
MYSQL_ROW current_row;
my_bool eof;
my_bool unbuffered_fetch_cancelled;
const st_mysql_methods *methods;
};
alias st_mysql_res MYSQL_RES;
struct st_mysql_manager {
NET net;
char* host,user,passwd;
uint port;
my_bool free_me;
my_bool eof;
int cmd_status;
int last_errno;
//char* net_buf,*net_buf_pos,*net_data_end;
char* net_buf,net_buf_pos,net_data_end;
int net_buf_size;
char last_error[256];
};
alias st_mysql_manager MYSQL_MANAGER;
struct st_mysql_parameters {
uint *p_max_allowed_packet;
uint *p_net_buffer_length;
};
alias st_mysql_parameters MYSQL_PARAMETERS;
int mysql_server_init(int argc, char **argv, char **groups);
void mysql_server_end();
MYSQL_PARAMETERS * mysql_get_parameters();
my_bool mysql_thread_init();
void mysql_thread_end();
my_ulonglong mysql_num_rows(MYSQL_RES *res);
uint mysql_num_fields(MYSQL_RES *res);
my_bool mysql_eof(MYSQL_RES *res);
MYSQL_FIELD * mysql_fetch_field_direct(MYSQL_RES *res,
uint fieldnr);
MYSQL_FIELD * mysql_fetch_fields(MYSQL_RES *res);
MYSQL_ROW_OFFSET mysql_row_tell(MYSQL_RES *res);
MYSQL_FIELD_OFFSET mysql_field_tell(MYSQL_RES *res);
uint mysql_field_count(MYSQL *mysql);
my_ulonglong mysql_affected_rows(MYSQL *mysql);
my_ulonglong mysql_insert_id(MYSQL *mysql);
uint mysql_errno(MYSQL *mysql);
char * mysql_error(MYSQL *mysql);
char * mysql_sqlstate(MYSQL *mysql);
uint mysql_warning_count(MYSQL *mysql);
char * mysql_info(MYSQL *mysql);
uint mysql_thread_id(MYSQL *mysql);
char * mysql_character_set_name(MYSQL *mysql);
MYSQL * mysql_init(MYSQL *mysql);
my_bool mysql_ssl_set(MYSQL *mysql, char *key,
char *cert, char *ca,
char *capath, char *cipher);
my_bool mysql_change_user(MYSQL *mysql, char *user,
char *passwd, char *db);
MYSQL * mysql_real_connect(MYSQL *mysql, char *host,
char *user,
char *passwd,
char *db,