-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMySQL.au3
2530 lines (2356 loc) · 109 KB
/
MySQL.au3
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
#cs
;/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
;/*
This file defines the client API to MySQL and also the ABI of the
dynamically linked libmysqlclient.
The ABI should never be changed in a released product of MySQL
thus you need to take great care when changing the file. In case
the file is changed so the ABI is broken, you must also
update the SHAREDLIB_MAJOR_VERSION in configure.in .
*/
#ce
;===================================================================================
;
; Script: MySQL UDFs working with libmysql.dll
; Version: 1.0.0.2
; Author: Prog@ndy
;
; YOU ARE NOT ALLOWED TO REMOVE THIS INFORMATION
;===================================================================================
#include-once
;~ #include "my_alloc.au3"
#include "mysql_version.au3"
#include "mysql_com.au3"
#include "MySQL_errmsg.au3"
Global Const $MYSQL_SUCCESS = 0
Global Const $MYSQL_OK = 0
Global Const $MYSQL_ERROR = True
; Prog@ndy
Func __MySQL_SIZEOF($tagStruct)
Return DllStructGetSize(DllStructCreate($tagStruct, 1))
EndFunc ;==>__MySQL_SIZEOF
Global Const $CLIENT_NET_READ_TIMEOUT = 365 * 24 * 3600 ;/* Timeout on read */
Global Const $CLIENT_NET_WRITE_TIMEOUT = 365 * 24 * 3600 ;/* Timeout on write */
;~ Global Const $IS_PRI_KEY(n) ((n) & PRI_KEY_FLAG)
;~ Global Const $IS_NOT_NULL(n) ((n) & NOT_NULL_FLAG)
;~ Global Const $IS_BLOB(n) ((n) & BLOB_FLAG)
;~ Global Const $IS_NUM(t) ((t) <= FIELD_TYPE_INT24 || (t) == FIELD_TYPE_YEAR || (t) == FIELD_TYPE_NEWDECIMAL)
;~ Global Const $IS_NUM_FIELD(f) ((f)->flags & NUM_FLAG)
;~ Global Const $INTERNAL_NUM_FIELD(f) (((f)->type <= FIELD_TYPE_INT24 && ((f)->type != FIELD_TYPE_TIMESTAMP || (f)->length == 14 || (f)->length == 8)) || (f)->type == FIELD_TYPE_YEAR)
;~ Global Const $IS_LONGDATA(t) ((t) >= MYSQL_TYPE_TINY_BLOB && (t) <= MYSQL_TYPE_STRING)
Func IS_PRI_KEY($n)
Return (BitAND($n, $PRI_KEY_FLAG) = $PRI_KEY_FLAG)
EndFunc ;==>IS_PRI_KEY
Func IS_NOT_NULL($n)
Return (BitAND($n, $NOT_NULL_FLAG) = $NOT_NULL_FLAG)
EndFunc ;==>IS_NOT_NULL
Func IS_BLOB($n)
Return (BitAND($n, $BLOB_FLAG) = $BLOB_FLAG)
EndFunc ;==>IS_BLOB
Func IS_NUM($t)
Return ($t <= $MYSQL_TYPE_INT24 Or $t == $MYSQL_TYPE_YEAR Or $t == $MYSQL_TYPE_NEWDECIMAL)
EndFunc ;==>IS_NUM
Func IS_NUM_FIELD(ByRef $f)
Return (BitAND(DllStructGetData($f, "type"), $NUM_FLAG) = $NUM_FLAG)
EndFunc ;==>IS_NUM_FIELD
Func INTERNAL_NUM_FIELD(ByRef $f)
Local $type = DllStructGetData($f, "type")
Return ($type <= $MYSQL_TYPE_INT24 And ($type <> $MYSQL_TYPE_TIMESTAMP Or DllStructGetData($f, "length") == 14 Or DllStructGetData($f, "length") == 8 Or $type = $MYSQL_TYPE_YEAR))
EndFunc ;==>INTERNAL_NUM_FIELD
Func IS_LONGDATA($t)
Return ($t >= $MYSQL_TYPE_TINY_BLOB And $t <= $MYSQL_TYPE_STRING)
EndFunc ;==>IS_LONGDATA
;~ typedef struct st_mysql_field {
Global Const $st_mysql_field = _
"ptr name;" & _ ;/* Name of column */ [[char *
"ptr orgName;" & _ ;/* Original column name, if an alias */ [[char *
"ptr table;" & _ ;/* Table of column if column was a field */ [[char *
"ptr orgTable;" & _ ;/* Org table name, if table was an alias */ [[char *
"ptr db;" & _ ;/* Database for table */ [[char *
"ptr catalog;" & _ ;/* Catalog for table */ [[char *
"ptr def;" & _ ;/* Default value (set by mysql_list_fields) */ [[char *
"ulong length;" & _ ;/* Width of column (create length) */
"ulong maxLength;" & _ ;/* Max width for selected set */
"uint nameLength;" & _
"uint orgNameLength;" & _
"uint tableLength;" & _
"uint orgTableLength;" & _
"uint dbLength;" & _
"uint catalogLength;" & _
"uint defLength;" & _
"uint flags;" & _ ;/* Div flags */
"uint decimals;" & _ ;/* Number of decimals in field */
"uint charsetnr;" & _ ;/* Character set */
"int type;" & _ ;/* Type of field. See mysql_com.h for types */
"ptr extension;"
;~ } MYSQL_FIELD;
Global Const $MYSQL_FIELD = $st_mysql_field
;~ typedef char **MYSQL_ROW; ;/* return data as array of strings */
Global Const $MYSQL_ROW = "ptr"; ;/* return data as array of strings */
;~ typedef unsigned int MYSQL_FIELD_OFFSET; ;/* offset to current field */
;~ Global Const $MYSQL_COUNT_ERROR (~(my_ulonglong) 0)
;/* backward compatibility define - to be removed eventually */
;~ Global Const $ER_WARN_DATA_TRUNCATED = $WARN_DATA_TRUNCATED
Global Const $st_mysql_rows = _
"ptr next;" & _ ;/* list of rows */
$MYSQL_ROW & " data;" & _
"unsigned long length;"
Global Const $MYSQL_ROWS = $st_mysql_rows;
;~ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; ;/* offset to current row */
;~ typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
;~ typedef struct st_mysql_data {
;~ Global Const $st_mysql_data = _
;~ "uint64 rows;" & _
;~ "uint fields;" & _
;~ "ptr data;" & _
;~ "byte alloc[" & __MySQL_SIZEOF($MEM_ROOT) & "];" & _ ;MEM_ROOT alloc;
;~ "" & _ ;/* extra info for embedded library */
;~ "ptr embedded_info;" ;struct embedded_query_result *embedded_info;
;~ } MYSQL_DATA;
;~ enum mysql_option
Global Enum _
$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, $MYSQL_OPT_RECONNECT, _
$MYSQL_OPT_SSL_VERIFY_SERVER_CERT
#cs
struct st_mysql_options {
unsigned int connect_timeout, read_timeout, write_timeout;
unsigned int port, protocol;
unsigned long client_flag;
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 *ssl_key; ;/* PEM key file */
char *ssl_cert; ;/* PEM cert file */
char *ssl_ca; ;/* PEM CA file */
char *ssl_capath; ;/* PEM directory of CA-s? */
char *ssl_cipher; ;/* cipher to use */
char *shared_memory_base_name;
unsigned long max_allowed_packet;
my_bool use_ssl; ;/* if to use SSL or not */
my_bool compress,named_pipe;
;/*
On connect, find out the replication role of the server, and
establish connections to all the peers
*/
my_bool rpl_probe;
;/*
Each call to mysql_real_query() will parse it to tell if it is a read
or a write, and direct it to the slave or the master
*/
my_bool rpl_parse;
;/*
If set, never read from a master, only from slave, when doing
a read that is replication-aware
*/
my_bool no_master_reads;
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || defined(EMBEDDED_LIBRARY)
my_bool separate_thread;
#endif
enum mysql_option methods_to_use;
char *client_ip;
;/* Refuse client connecting to server if it uses old (pre-4.1.1) protocol */
my_bool secure_auth;
;/* 0 - never report, 1 - always report (default) */
my_bool report_data_truncation;
;/* function pointers for local infile support */
int (*local_infile_init)(void **, const char *, void *);
int (*local_infile_read)(void *, char *, unsigned int);
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata;
} MYSQL_OPTIONS;
#ce
;~ enum mysql_status
Global Enum _
$MYSQL_STATUS_READY, $MYSQL_STATUS_GET_RESULT, $MYSQL_STATUS_USE_RESULT
;~ };
;~ enum mysql_protocol_type
Global Enum _
$MYSQL_PROTOCOL_DEFAULT, $MYSQL_PROTOCOL_TCP, $MYSQL_PROTOCOL_SOCKET, _
$MYSQL_PROTOCOL_PIPE, $MYSQL_PROTOCOL_MEMORY
;~ };
#cs
There are three types of queries - the ones that have to go to
the master, the ones that go to a slave, and the adminstrative
type which must happen on the pivot connectioin
#ce
;~ enum mysql_rpl_type
Global Enum _
$MYSQL_RPL_MASTER, $MYSQL_RPL_SLAVE, $MYSQL_RPL_ADMIN
;~ };
;~ typedef struct character_set
Global Const $MY_CHARSET_INFO = _
"uint number;" & _ ;/* character set number */
"uint state;" & _ ;/* character set state */
"ptr csname;" & _ ;/* collation name */ const char *
"ptr name;" & _ ;/* character set name */ const char *
"ptr comment;" & _ ;/* comment */ const char *
"ptr dir;" & _ ;/* character set directory */ const char *
"uint mbminlen;" & _ ;/* min. length for multibyte strings */
"uint mbmaxlen;" ;/* max. length for multibyte strings */
Global $ghMYSQL_LIBMYSQL = -1, $ghMYSQL_LIBMYSQL_COUNT=0
; Prog@ndy
Func __MySQL_DLLLoaded()
Local $Ret = DllCall("kernel32.dll", "hwnd", "GetModuleHandle", "str", "libmysql.dll")
If @error Then Return SetError(1, 0, False)
Return ($Ret[0] <> HWnd(0))
EndFunc ;==>__MySQL_DLLLoaded
;===============================================================================
;
; Function Name: _MySQL_InitLibrary
; Description:: MYSQL starten, DLL im PATH (enthält auch @ScriptDir), sonst Pfad zur DLL angeben. DLL muss libmysql.dll heißen.
; Parameter(s): $libmysqldll - Path to libMySQL.dll (if not in %PATH%)
; $Use_EmbeddedDLL - [optional] specifies wether libmysql.dll from libmysqldll.au3 should be used (default=FALSE)
; Requirement(s): libmysql.dll
; Return Value(s): Zero if successful. Non-zero if an error occurred.
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_InitLibrary($libmysqldll = "", $Use_EmbeddedDLL = False)
Select
Case $ghMYSQL_LIBMYSQL <> -1 And _MySQL_Get_Client_Version() <> 0
$ghMYSQL_LIBMYSQL_COUNT += 1
Return 0
; Nothing
Case $libmysqldll <> ""
$ghMYSQL_LIBMYSQL = DllOpen($libmysqldll)
If $ghMYSQL_LIBMYSQL < 0 Then ContinueCase
Case True
$ghMYSQL_LIBMYSQL = DllOpen("libmysql.dll")
If $ghMYSQL_LIBMYSQL < 0 And @AutoItX64 Then $ghMYSQL_LIBMYSQL = DllOpen("libmysql_x64.dll")
If $ghMYSQL_LIBMYSQL < 0 Then
Switch $Use_EmbeddedDLL
Case True
ContinueCase
Case Else
Return SetError(2, 0, 1)
EndSwitch
EndIf
Case $Use_EmbeddedDLL = True
Local $sx64 = ''
If @AutoItX64 Then $sx64 = "_x64"
Call("_" & "_MySQL_ExtractEmbeddedDLL" & $sx64, @TempDir & "\libmysql_au3"&$sx64&".dll")
If @error Then Return SetError(3, 0, 1)
$ghMYSQL_LIBMYSQL = DllOpen(@TempDir & "\libmysql_au3"&$sx64&".dll")
If $ghMYSQL_LIBMYSQL < 0 Then Return SetError(4, 0, 1)
EndSelect
Local $mysql = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_server_init", "int", 0, "ptr", 0, "ptr", 0)
If @error Then
DllClose($ghMYSQL_LIBMYSQL)
$ghMYSQL_LIBMYSQL = -1
$ghMYSQL_LIBMYSQL_COUNT = 0
Return SetError(5, 0, 1)
EndIf
$ghMYSQL_LIBMYSQL_COUNT = 1
Return $mysql[0]
EndFunc ;==>_MySQL_InitLibrary
;===============================================================================
;
; Function Name: _MySQL_EndLibrary
; Description:: Closes MySQL DLL
; It has to be called to free memory used by MySQL
; Parameter(s):
; Requirement(s): libmysql.dll
; Return Value(s):
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_EndLibrary()
If $ghMYSQL_LIBMYSQL = -1 Then Return
$ghMYSQL_LIBMYSQL_COUNT -= 1
If $ghMYSQL_LIBMYSQL_COUNT < 1 Then
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_server_end")
DllClose($ghMYSQL_LIBMYSQL)
$ghMYSQL_LIBMYSQL = -1
$ghMYSQL_LIBMYSQL_COUNT = 0
EndIf
EndFunc ;==>_MySQL_EndLibrary
;===============================================================================
;
; Function Name: _MySQL_Affected_Rows
; Description:: After executing a statement with mysql_query() or mysql_real_query(),
; returns the number of rows changed (for UPDATE), deleted (for DELETE),
; or inserted (for INSERT). For SELECT statements, mysql_affected_rows()
; works like mysql_num_rows().
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): number of affected rows
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-affected-rows.html
;
;===============================================================================
;
Func _MySQL_Affected_Rows($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, -1)
Local $row = DllCall($ghMYSQL_LIBMYSQL, "uint64", "mysql_affected_rows", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, -1)
Return $row[0]
;~ Return __MySQL_ReOrderULONGLONG($row[0])
EndFunc ;==>_MySQL_Affected_Rows
;===============================================================================
;
; Function Name: _MySQL_AutoCommit
; Description:: Sets autocommit mode on if mode is 1, off if mode is 0.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; $Mode - Autocommit (True / False)
; Requirement(s): libmysql.dll
; Return Value(s): Zero if successful. Non-zero if an error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-autocommit.html
;
;===============================================================================
;
Func _MySQL_AutoCommit($MySQL_ptr, $Mode)
If Not $MySQL_ptr Then Return SetError(3, 0, $CR_NULL_POINTER)
Local $mysql = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_autocommit", "ptr", $MySQL_ptr, "int", $Mode)
If @error Then Return SetError(1, 0, 1)
Return $mysql[0]
EndFunc ;==>_MySQL_AutoCommit
;===============================================================================
;
; Function Name: _MySQL_Change_User
; Description:: Changes the user and causes the database specified by db to
; become the default (current) database on the connection.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; $User - New username
; $Pass - New password [default= none (empty string "")]
; $Database - New default database [default= none (empty string "")]
; Requirement(s): libmysql.dll
; Return Value(s): Zero for success. Non-zero if an error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-change-user.html
;
;===============================================================================
;
Func _MySQL_Change_User($MySQL_ptr, $User, $Pass, $Database = "")
If Not $MySQL_ptr Then Return SetError(3, 0, $CR_NULL_POINTER)
Local $PWType = "str", $DBType = "str"
If $Pass = "" Then $PWType = "ptr"
If $Database = "" Then $DBType = "ptr"
Local $conn = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_change_user", "ptr", $MySQL_ptr, "str", $User, $PWType, $Pass, $DBType, $Database)
If @error Then Return SetError(1, 0, 1)
Return $conn[0]
EndFunc ;==>_MySQL_Change_User
;===============================================================================
;
; Function Name: _MySQL_Character_Set_Name
; Description:: Returns the default character set name for the current connection.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): The default character set name
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-character-set-name.html
;
;===============================================================================
;
Func _MySQL_Character_Set_Name($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, '')
Local $conn = DllCall($ghMYSQL_LIBMYSQL, "str", "mysql_character_set_name", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, "")
Return $conn[0]
EndFunc ;==>_MySQL_Character_Set_Name
;===============================================================================
;
; Function Name: _MySQL_Close
; Description:: Closes a previously opened connection
; if the MySQL struct was created with _MySQL_Init() without any parameter
; it will be deleted, too.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): none
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-close.html
;
;===============================================================================
;
Func _MySQL_Close($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, 0)
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_close", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, 0)
Return 1
EndFunc ;==>_MySQL_Close
;===============================================================================
;
; Function Name: _MySQL_Commit
; Description:: Commits the current transaction.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): Zero if successful. Non-zero if an error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-commit.html
;
;===============================================================================
;
Func _MySQL_Commit($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, $CR_NULL_POINTER)
Local $mysql = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_commit", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, 1)
Return $mysql[0]
EndFunc ;==>_MySQL_Commit
;###############################################################################
;
; _MySQL_Connect
; This function is deprecated. Use _MySQL_Real_Connect instead.
; --> http://dev.mysql.com/doc/refman/5.1/en/mysql-connect.html
;
;###############################################################################
;###############################################################################
;
; _MySQL_Create_DB
; This function is deprecated. Use mysql_query() to issue an SQL CREATE DATABASE statement instead.
; --> http://dev.mysql.com/doc/refman/5.1/en/mysql-create-db.html
;
;###############################################################################
;===============================================================================
;
; Function Name: _MySQL_Data_Seek
; Description:: Seeks to an arbitrary row in a query result set.
; The offset value is a row number and should be in the range from 0 to mysql_num_rows(result)-1.
; Parameter(s): $result - MySQL Result pointer
; $offset - index of row
; Requirement(s): libmysql.dll
; Return Value(s): None.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-data-seek.html
;
;===============================================================================
;
Func _MySQL_Data_Seek($result, $offset)
If Not $result Then Return SetError(3, 0, 0)
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_data_seek", "ptr", $result, "uint64", $offset)
If @error Then Return SetError(1, 0, 0)
Return 1
EndFunc ;==>_MySQL_Data_Seek
;===============================================================================
;
; Function Name: _MySQL_Debug
; Description:: Does a DBUG_PUSH with the given string. mysql_debug() uses the
; Fred Fish debug library. To use this function, you must compile
; the client library to support debugging.
; Parameter(s): $debug - Degub data (don't know format)
; Requirement(s): libmysql.dll
; Return Value(s): None.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-debug.html
;
;===============================================================================
;
Func _MySQL_Debug($debug)
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_debug", "str", $debug)
EndFunc ;==>_MySQL_Debug
;###############################################################################
;
; _MySQL_Drop_DB
; This function is deprecated. Use mysql_query() to issue an SQL DROP DATABASE statement instead.
; --> http://dev.mysql.com/doc/refman/5.1/en/mysql-drop-db.html
;
;###############################################################################
;===============================================================================
;
; Function Name: _MySQL_Dump_Debug_Info
; Description:: Instructs the server to write some debug information to the log.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): Zero if the command was successful. Non-zero if an error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-dump-debug-info.html
;
;===============================================================================
;
Func _MySQL_Dump_Debug_Info($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, $CR_NULL_POINTER)
Local $errors = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_dump_debug_info", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, 1)
Return $errors[0]
EndFunc ;==>_MySQL_Dump_Debug_Info
;===============================================================================
;
; Function Name: _MySQL_EOF
; Description:: This function is deprecated. mysql_errno() or mysql_error() may be used instead.
; mysql_eof() determines whether the last row of a result set has been read.
; Parameter(s): $result - MySQL Result pointer
; Requirement(s): libmysql.dll
; Return Value(s): Zero if no error occurred. Nonzero if the end of the result set has been reached.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-data-seek.html
;
;===============================================================================
;
Func _MySQL_EOF($result)
If Not $result Then Return SetError(3, 0, 1)
Local $eof = DllCall($ghMYSQL_LIBMYSQL, "int", "mysql_eof", "ptr", $result)
If @error Then Return SetError(1, 0, 1)
Return $eof[0]
EndFunc ;==>_MySQL_EOF
;===============================================================================
;
; Function Name: _MySQL_Errno
; Description:: returns the error code for the most recently invoked API function that can succeed or fail
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): An error code value for the last mysql_xxx() call, if it failed. zero means no error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-errno.html
;
;===============================================================================
;
Func _MySQL_Errno($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, 0)
Local $errors = DllCall($ghMYSQL_LIBMYSQL, "uint", "mysql_errno", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, 0)
Return $errors[0]
EndFunc ;==>_MySQL_Errno
;===============================================================================
;
; Function Name: _MySQL_Error
; Description:: returns a null-terminated string containing the error message
; for the most recently invoked API function that failed.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): A null-terminated character string that describes the error. An empty string if no error occurred.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-error.html
;
;===============================================================================
;
Func _MySQL_Error($MySQL_ptr)
If Not $MySQL_ptr Then Return SetError(3, 0, '')
Local $errors = DllCall($ghMYSQL_LIBMYSQL, "str", "mysql_error", "ptr", $MySQL_ptr)
If @error Then Return SetError(1, 0, "")
Return $errors[0]
EndFunc ;==>_MySQL_Error
;###############################################################################
;
; _MySQL_Escape_String
; You should use _mysql_real_escape_string() instead!
; --> http://dev.mysql.com/doc/refman/5.1/en/mysql-escape-string.html
;
;###############################################################################
;===============================================================================
;
; Function Name: _MySQL_Fetch_Field
; Description:: Returns the definition of one column of a result set as a MYSQL_FIELD structure.
; Parameter(s): $result - MySQL Result pointer
; Requirement(s): libmysql.dll
; Return Value(s): MySQL_FIELD-Structure. On error 0 (ZERO)
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-field.html
;
;===============================================================================
;
Func _MySQL_Fetch_Field($result)
If Not $result Then Return SetError(3, 0, 0)
Local $field = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_field", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
$field = $field[0]
Return DllStructCreate($MYSQL_FIELD, $field)
EndFunc ;==>_MySQL_Fetch_Field
;===============================================================================
;
; Function Name: _MySQL_Fetch_Field_Direct
; Description:: returns that column's field definition as a MYSQL_FIELD structure.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $fieldnr - Index of field from which to fetch information
; Requirement(s): libmysql.dll
; Return Value(s): The MYSQL_FIELD structure for the specified column. On error 0 (ZERO)
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-field-direct.html
;
;===============================================================================
;
Func _MySQL_Fetch_Field_Direct($result, $fieldnr)
If Not $result Then Return SetError(3, 0, 0)
Local $field = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_field_direct", "ptr", $result, "uint", $fieldnr)
If @error Then Return SetError(1, 0, 0)
$field = $field[0]
Return DllStructCreate($MYSQL_FIELD, $field)
EndFunc ;==>_MySQL_Fetch_Field_Direct
;===============================================================================
;
; Function Name: _MySQL_Fetch_Fields
; Description:: Returns an array of all MYSQL_FIELD structures for a result set.
; Each structure provides the field definition for one column of the result set.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $numberOfFields - [optional] The count of fields in the result set. (default: uses _MySQL_Num_Fields)
; Requirement(s): libmysql.dll
; Return Value(s): Success: Array of MYSQL_FIELD structures
; Error: 0 (ZERO) and @error > 0
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-fields.html
;
;===============================================================================
;
Func _MySQL_Fetch_Fields($result, $numberOfFields = Default)
If $numberOfFields = Default Then $numberOfFields = _MySQL_Num_Fields($result)
If $numberOfFields = 0 Then Return SetError(1, 0, 0)
Local $fields = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_fields", "ptr", $result)
If @error Then Return SetError(2, 0, 0)
$fields = $fields[0]
Local $arFields[$numberOfFields]
$arFields[0] = DllStructCreate($MYSQL_FIELD, $fields)
For $i = 1 To $numberOfFields - 1
$arFields[$i] = DllStructCreate($MYSQL_FIELD, $fields + (DllStructGetSize($arFields[0]) * $i))
Next
Return $arFields
EndFunc ;==>_MySQL_Fetch_Fields
;===============================================================================
;
; Function Name: _MySQL_Fetch_Fields_Names
; Description:: Fetches all captions of the colums of a result
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $numberOfFields - [optional] The count of fields in the result set. (default: uses _MySQL_Num_Fields)
; Requirement(s): libmysql.dll
; Return Value(s): Array of fieldnames. On error returns 0 (ZERO)
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_Fetch_Fields_Names($result, $numberOfFields = Default)
If $numberOfFields = Default Then $numberOfFields = _MySQL_Num_Fields($result)
If $numberOfFields = 0 Then Return SetError(1, 0, 0)
Local $fields = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_fields", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
$fields = $fields[0]
Local $struct = DllStructCreate($MYSQL_FIELD, $fields)
Local $arFields[$numberOfFields]
For $i = 1 To $numberOfFields
$arFields[$i - 1] = __MySQL_PtrStringRead(DllStructGetData($struct, 1))
If $i = $numberOfFields Then ExitLoop
$struct = DllStructCreate($MYSQL_FIELD, $fields + (DllStructGetSize($struct) * $i))
Next
Return $arFields
EndFunc ;==>_MySQL_Fetch_Fields_Names
;===============================================================================
;
; Function Name: _MySQL_Fetch_Lengths
; Description:: Returns the lengths of the columns of the current row within a result set.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $numberOfFields - [optional] The count of fields in the result set. (default: uses _MySQL_Num_Fields)
; Requirement(s): libmysql.dll
; Return Value(s): DLLStruct with ulong Array get data [ DLLStructGetData($struct,1, $n ) ]
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-lengths.html
;
;===============================================================================
;
Func _MySQL_Fetch_Lengths($result, $numberOfFields = Default)
If $numberOfFields = Default Then $numberOfFields = _MySQL_Num_Fields($result)
If $numberOfFields <= 0 Then Return SetError(1, 0, 0)
Local $lengths = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_lengths", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
Return DllStructCreate("ulong lengths[" & $numberOfFields & "]", $lengths[0])
EndFunc ;==>_MySQL_Fetch_Lengths
;===============================================================================
;
; Function Name: _MySQL_Fetch_Row
; Description:: Retrieves the next row of a result set.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $numberOfFields - [optional] The count of fields in the result set. (default: uses _MySQL_Num_Fields)
; Requirement(s): libmysql.dll
; Return Value(s): DLLStruct with pointers to data fields. On error 0 (ZERO)
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-fetch-row.html
;
;===============================================================================
;
Func _MySQL_Fetch_Row($result, $numberOfFields = Default)
If $numberOfFields = Default Then $numberOfFields = _MySQL_Num_Fields($result)
If $numberOfFields <= 0 Then Return SetError(1, 0, 0)
Local $row = DllCall($ghMYSQL_LIBMYSQL, "ptr", "mysql_fetch_row", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
Return DllStructCreate("ptr[" & $numberOfFields & "]", $row[0])
EndFunc ;==>_MySQL_Fetch_Row
;===============================================================================
;
; Function Name: _MySQL_Fetch_Row_StringArray
; Description:: Fetches one row to an array as strings
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $numberOfFields - [optional] The count of fields in the result set. (default: uses _MySQL_Num_Fields)
; $NULLasPtr0 - [optional] Specifies if NULL-value should be returned as Ptr(0) (default: False - empty string)
; Requirement(s): libmysql.dll
; Return Value(s): Array with Strings. On error 0 (ZERO)
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_Fetch_Row_StringArray($result, $fields = Default, $NULLasPtr0 = False)
If $fields = Default Then $fields = _MySQL_Num_Fields($result)
If $fields <= 0 Or $result = 0 Then Return SetError(1, 0, 0)
Local $RowArr[$fields]
Local $mysqlrow = _MySQL_Fetch_Row($result, $fields)
If Not IsDllStruct($mysqlrow) Then Return SetError(1, 0, 0)
Local $lenthsStruct = _MySQL_Fetch_Lengths($result)
Local $length, $fieldPtr
For $i = 1 To $fields
$length = DllStructGetData($lenthsStruct, 1, $i)
$fieldPtr = DllStructGetData($mysqlrow, 1, $i)
Select
Case $length ; if there is data
$RowArr[$i - 1] = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1)
Case $NULLasPtr0 And Not $fieldPtr ; is NULL and return NULL as Ptr(0)
$RowArr[$i - 1] = Ptr(0)
;~ Case Else ; Empty String or NULL as empty string
; Nothing needs to be done, since array entries are default empty string
;~ $RowArr[$i - 1] = ""
EndSelect
Next
Return $RowArr
EndFunc ;==>_MySQL_Fetch_Row_StringArray
;===============================================================================
;
; Function Name: _MySQL_Fetch_Result_StringArray
; Description:: Gets the whole result into a 2D String array.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; $NULLasPtr0 - [optional] Specifies if NULL-value should be returned as Ptr(0) (default: False - empty string)
; Requirement(s): libmysql.dll
; Return Value(s): 2D-Array On error 0 (ZERO)
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_Fetch_Result_StringArray($result, $NULLasPtr0 = False)
_MySQL_Data_Seek($result, 0)
Local $fields = _MySQL_Num_Fields($result)
Local $rows = _MySQL_Num_Rows($result)
If $fields < 1 Or $rows < 1 Then Return SetError(1, 0, 0)
Local $ResultArr[$rows + 1][$fields]
Local $Names = _MySQL_Fetch_Fields_Names($result, $fields)
For $i = 0 To $fields - 1
$ResultArr[0][$i] = $Names[$i]
Next
Local $length, $fieldPtr, $rowPtr, $mysqlrow, $lengths, $lenthsStruct
Local Const $NULLPTR = Ptr(0)
For $j = 1 To $rows
$mysqlrow = _MySQL_Fetch_Row($result, $fields)
If Not IsDllStruct($mysqlrow) Then ExitLoop
$lenthsStruct = _MySQL_Fetch_Lengths($result)
For $i = 1 To $fields
$length = DllStructGetData($lenthsStruct, 1, $i)
$fieldPtr = DllStructGetData($mysqlrow, 1, $i)
Select
Case $length ; if there is data
$ResultArr[$j][$i - 1] = DllStructGetData(DllStructCreate("char[" & $length & "]", $fieldPtr), 1)
Case $NULLasPtr0 And Not $fieldPtr ; is NULL and return NULL as Ptr(0)
$ResultArr[$j][$i - 1] = $NULLPTR
;~ Case Else ; Empty String or NULL as empty string
; Nothing needs to be done, since array entries are default empty string
;~ $RowArr[$i - 1] = ""
EndSelect
Next
Next
Return $ResultArr
EndFunc ;==>_MySQL_Fetch_Result_StringArray
;===============================================================================
;
; Function Name: _MySQL_Field_Count
; Description:: Returns the number of columns for the most recent query on the connection.
; Parameter(s): $result - MySQL Resut pointer returned from _MySQL_Real_Query
; Requirement(s): libmysql.dll
; Return Value(s): An unsigned integer representing the number of columns in a result set.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-field-count.html
;
;===============================================================================
;
Func _MySQL_Field_Count($result)
Local $row = DllCall($ghMYSQL_LIBMYSQL, "uint", "mysql_field_count", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
Return $row[0]
EndFunc ;==>_MySQL_Field_Count
;===============================================================================
;
; Function Name: _MySQL_Field_ReadValue
; Description:: Reads the specified value of a MYSQL_FIELD struct
; Parameter(s): $field - MYSQL_FIELD
; $ValueName - the name of the value to read
; Requirement(s): libmysql.dll
; Return Value(s): The value of the field.
; Author(s): Prog@ndy
;
;===============================================================================
;
Func _MySQL_Field_ReadValue(ByRef $field, $ValueName)
Local $Return = DllStructGetData($field, $ValueName)
If @error Then Return SetError(1, 0, "")
If IsPtr($Return) Then Return __MySQL_PtrStringRead($Return)
Return $Return
EndFunc ;==>_MySQL_Field_ReadValue
;===============================================================================
;
; Function Name: _MySQL_Field_Seek
; Description:: Sets the field cursor to the given offset.
; The next call to mysql_fetch_field() retrieves the field
; definition of the column associated with that offset.
; To seek to the beginning of a row, pass an offset value of zero.
; Parameter(s): $result - MySQL Result pointer
; $offset - Offset of the filed pointer
; Requirement(s): libmysql.dll
; Return Value(s): The previous value of the field cursor.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-field-seek.html
;
;===============================================================================
;
Func _MySQL_Field_Seek($result, $offset)
Local $row = DllCall($ghMYSQL_LIBMYSQL, "uint", "mysql_field_seek", "ptr", $result, "uint", $offset)
If @error Then Return SetError(1, 0, 0)
Return $row[0]
EndFunc ;==>_MySQL_Field_Seek
;===============================================================================
;
; Function Name: _MySQL_Field_Tell
; Description:: Returns the position of the field cursor used for the last mysql_fetch_field().
; This value can be used as an argument to mysql_field_seek().
; Parameter(s): $result - MySQL Result pointer
; Requirement(s): libmysql.dll
; Return Value(s): The previous value of the field cursor.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-field-seek.html
;
;===============================================================================
;
Func _MySQL_Field_Tell($result)
Local $row = DllCall($ghMYSQL_LIBMYSQL, "uint", "mysql_field_tell", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
Return $row[0]
EndFunc ;==>_MySQL_Field_Tell
;===============================================================================
;
; Function Name: _MySQL_Free_Result
; Description:: Frees the memory allocated for a result set by mysql_store_result(),
; mysql_use_result(), mysql_list_dbs(), and so forth. When you are
; done with a result set, you must free the memory it uses by
; calling mysql_free_result().
; Do not attempt to access a result set after freeing it.
; Parameter(s): $result - MySQL Result pointer
; Requirement(s): libmysql.dll
; Return Value(s): None.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-free-result.html
;
;===============================================================================
;
Func _MySQL_Free_Result($result)
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_free_result", "ptr", $result)
If @error Then Return SetError(1, 0, 0)
EndFunc ;==>_MySQL_Free_Result
;===============================================================================
;
; Function Name: _MySQL_Get_Character_Set_Info
; Description:: This function provides information about the default client character set.
; The default character set may be changed with the mysql_set_character_set() function.
; Parameter(s): $MySQL_ptr - Pointer to the MySQL struct
; Requirement(s): libmysql.dll
; Return Value(s): a $MY_CHARSET_INFO struct with the fetched values.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-get-character-set-info.html
;
;===============================================================================
;
Func _MySQL_Get_Character_Set_Info($MySQL_ptr)
Local $charset = DllStructCreate($MY_CHARSET_INFO)
DllCall($ghMYSQL_LIBMYSQL, "none", "mysql_get_character_set_info", "ptr", $MySQL_ptr, "ptr", DllStructGetPtr($charset))
If @error Then Return SetError(1, 0, 0)
Return $charset
EndFunc ;==>_MySQL_Get_Character_Set_Info
;===============================================================================
;
; Function Name: _MySQL_Get_Client_Info
; Description:: Returns a string that represents the client library version.
; Parameter(s):
; Requirement(s): libmysql.dll
; Return Value(s): A character string that represents the MySQL client library version.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-get-client-info.html
;
;===============================================================================
;
Func _MySQL_Get_Client_Info()
Local $errors = DllCall($ghMYSQL_LIBMYSQL, "str", "mysql_get_client_info")
If @error Then Return SetError(1, 0, "")
Return $errors[0]
EndFunc ;==>_MySQL_Get_Client_Info
;===============================================================================
;
; Function Name: _MySQL_Get_Client_Version
; Description:: Returns an integer that represents the client library version.
; The value has the format XYYZZ where X is the major version,
; YY is the release level, and ZZ is the version number within
; the release level. For example, a value of 40102 represents
; a client library version of 4.1.2.
; Parameter(s):
; Requirement(s): libmysql.dll
; Return Value(s): An integer that represents the MySQL client library version.
; Author(s): Prog@ndy
;
; Further Information: http://dev.mysql.com/doc/refman/5.1/en/mysql-get-client-version.html
;
;===============================================================================
;
Func _MySQL_Get_Client_Version()