-
-
Notifications
You must be signed in to change notification settings - Fork 584
Expand file tree
/
Copy pathdbstructures.mysql.pas
More file actions
3615 lines (3568 loc) · 103 KB
/
Copy pathdbstructures.mysql.pas
File metadata and controls
3615 lines (3568 loc) · 103 KB
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
unit dbstructures.mysql;
interface
uses
System.Classes, System.SysUtils, dbstructures, StrUtils;
const
// General declarations
MYSQL_ERRMSG_SIZE = 512;
SQLSTATE_LENGTH = 5;
SCRAMBLE_LENGTH = 20;
MYSQL_PORT = 3306;
LOCAL_HOST = 'localhost';
NAME_LEN = 64;
PROTOCOL_VERSION = 10;
FRM_VER = 6;
// Field's flags
NOT_NULL_FLAG = 1;
PRI_KEY_FLAG = 2;
UNIQUE_KEY_FLAG = 4;
MULTIPLE_KEY_FLAG = 8;
BLOB_FLAG = 16;
UNSIGNED_FLAG = 32;
ZEROFILL_FLAG = 64;
BINARY_FLAG = 128;
ENUM_FLAG = 256;
AUTO_INCREMENT_FLAG = 512;
TIMESTAMP_FLAG = 1024;
SET_FLAG = 2048;
NO_DEFAULT_VALUE_FLAG = 4096; // Field has no default value
ON_UPDATE_NOW_FLAG = 8192; // If a field is updated it will get the current time value (NOW())
NUM_FLAG = 32768; // Field is numeric
PART_KEY_FLAG = 16384; // wrong from here on, where do these come from?
GROUP_FLAG = 32768;
UNIQUE_FLAG = 65536;
BINCMP_FLAG = 131072;
// Client connection options
CLIENT_LONG_PASSWORD: Int64 = 0; // obsolete flag
CLIENT_MYSQL: Int64 = 1; // mysql/old mariadb server/client
CLIENT_FOUND_ROWS: Int64 = 2; // Found instead of affected rows
CLIENT_LONG_FLAG: Int64 = 4; // Get all column flags
CLIENT_CONNECT_WITH_DB: Int64 = 8; // One can specify db on connect
CLIENT_NO_SCHEMA: Int64 = 16; // Don't allow database.table.column
CLIENT_COMPRESS: Int64 = 32; // Can use compression protocol
CLIENT_ODBC: Int64 = 64; // Odbc client
CLIENT_LOCAL_FILES: Int64 = 128; // Can use LOAD DATA LOCAL
CLIENT_IGNORE_SPACE: Int64 = 256; // Ignore spaces before '('
CLIENT_PROTOCOL_41: Int64 = 512; // New 4.1 protocol
CLIENT_INTERACTIVE: Int64 = 1024; // This is an interactive client
CLIENT_SSL: Int64 = 2048; // Switch to SSL after handshake
CLIENT_IGNORE_SIGPIPE: Int64 = 4096; // IGNORE sigpipes
CLIENT_TRANSACTIONS: Int64 = 8192; // Client knows about transactions
CLIENT_RESERVED: Int64 = 16384; // Old flag for 4.1 protocol
CLIENT_SECURE_CONNECTION: Int64 = 32768; // New 4.1 authentication
CLIENT_MULTI_STATEMENTS: Int64 = 1 Shl 16; // Enable/disable multi-stmt support
CLIENT_MULTI_RESULTS: Int64 = 1 Shl 17; // Enable/disable multi-results
CLIENT_PS_MULTI_RESULTS: Int64 = 1 Shl 18; // Multi-results in PS-protocol
CLIENT_PLUGIN_AUTH: Int64 = 1 Shl 19; // Client supports plugin authentication
CLIENT_CONNECT_ATTRS: Int64 = 1 Shl 20; // Client supports connection attributes
// Enable authentication response packet to be larger than 255 bytes.
CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA: Int64 = 1 Shl 21;
// Don't close the connection for a connection with expired password.
CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS: Int64 = 1 Shl 22;
{
Capable of handling server state change information. Its a hint to the
server to include the state change information in Ok packet.
}
CLIENT_SESSION_TRACK: Int64 = 1 Shl 23;
// Client no longer needs EOF packet
CLIENT_DEPRECATE_EOF: Int64 = 1 Shl 24;
CLIENT_PROGRESS_OBSOLETE: Int64 = 1 Shl 29;
CLIENT_SSL_VERIFY_SERVER_CERT: Int64 = 1 Shl 30;
{
It used to be that if mysql_real_connect() failed, it would delete any
options set by the client, unless the CLIENT_REMEMBER_OPTIONS flag was
given.
That behaviour does not appear very useful, and it seems unlikely that
any applications would actually depend on this. So from MariaDB 5.5 we
always preserve any options set in case of failed connect, and this
option is effectively always set.
}
CLIENT_REMEMBER_OPTIONS: Int64 = 1 Shl 31;
COLLATION_BINARY = 63;
// Equivalent to COLLATION_BINARY, this is what a new driver returns when connected to a pre-4.1 server.
COLLATION_NONE = 0;
// Relevant MySQL error codes, taken from include/mysql/server/mysqld_error.h
ER_MUST_CHANGE_PASSWORD = 1820;
ER_NO_SUCH_THREAD = 1094;
ER_NONEXISTING_GRANT = 1141;
ER_WRONG_AUTO_KEY = 1075;
type
PUSED_MEM=^USED_MEM;
USED_MEM = packed record
next: PUSED_MEM;
left: Integer;
size: Integer;
end;
PERR_PROC = ^ERR_PROC;
ERR_PROC = procedure;
PMEM_ROOT = ^MEM_ROOT;
MEM_ROOT = packed record
free: PUSED_MEM;
used: PUSED_MEM;
pre_alloc: PUSED_MEM;
min_malloc: Integer;
block_size: Integer;
block_num: Integer;
first_block_usage: Integer;
error_handler: PERR_PROC;
end;
NET = record
vio: Pointer;
buff: PAnsiChar;
buff_end: PAnsiChar;
write_pos: PAnsiChar;
read_pos: PAnsiChar;
fd: Integer;
max_packet: Cardinal;
max_packet_size: Cardinal;
pkt_nr: Cardinal;
compress_pkt_nr: Cardinal;
write_timeout: Cardinal;
read_timeout: Cardinal;
retry_count: Cardinal;
fcntl: Integer;
compress: Byte;
remain_in_buf: LongInt;
length: LongInt;
buf_length: LongInt;
where_b: LongInt;
return_status: Pointer;
reading_or_writing: Char;
save_char: Char;
no_send_ok: Byte;
last_error: array[1..MYSQL_ERRMSG_SIZE] of Char;
sqlstate: array[1..SQLSTATE_LENGTH + 1] of Char;
last_errno: Cardinal;
error: Char;
query_cache_query: Pointer;
report_error: Byte;
return_errno: Byte;
end;
PMYSQL_FIELD = ^MYSQL_FIELD;
MYSQL_FIELD = record
name: PAnsiChar; // Name of column
org_name: PAnsiChar; // Name of original column (added after 3.23.58)
table: PAnsiChar; // Table of column if column was a field
org_table: PAnsiChar; // Name of original table (added after 3.23.58
db: PAnsiChar; // table schema (added after 3.23.58)
catalog: PAnsiChar; // table catalog (added after 3.23.58)
def: PAnsiChar; // Default value (set by mysql_list_fields)
length: LongInt; // Width of column
max_length: LongInt; // Max width of selected set
// added after 3.23.58
name_length: Cardinal;
org_name_length: Cardinal;
table_length: Cardinal;
org_table_length: Cardinal;
db_length: Cardinal;
catalog_length: Cardinal;
def_length: Cardinal;
//***********************
flags: Cardinal; // Div flags
decimals: Cardinal; // Number of decimals in field
charsetnr: Cardinal; // char set number (added in 4.1)
_type: Cardinal; // Type of field. Se mysql_com.h for types
end;
// Added in Oct 2023, to fix usage of mysql_fetch_lengths(). See issue #1863
PMYSQL_LENGTHS = ^TMYSQL_LENGTHS;
TMYSQL_LENGTHS = array[0..MaxInt div SizeOf(LongWord) - 1] of LongWord;
MYSQL_ROW = array[0..$ffff] of PAnsiChar;
PMYSQL_ROW = ^MYSQL_ROW;
PMYSQL_ROWS = ^MYSQL_ROWS;
MYSQL_ROWS = record
next: PMYSQL_ROWS;
data: PMYSQL_ROW;
end;
MYSQL_DATA = record
Rows: Int64;
Fields: Cardinal;
Data: PMYSQL_ROWS;
Alloc: MEM_ROOT;
end;
PMYSQL_DATA = ^MYSQL_DATA;
PMYSQL = ^MYSQL;
MYSQL = record
_net: NET;
connector_fd: Pointer;
host: PAnsiChar;
user: PAnsiChar;
passwd: PAnsiChar;
unix_socket: PAnsiChar;
server_version: PAnsiChar;
host_info: PAnsiChar;
info: PAnsiChar;
db: PAnsiChar;
charset: PAnsiChar;
fields: PMYSQL_FIELD;
field_alloc: MEM_ROOT;
affected_rows: Int64;
insert_id: Int64;
extra_info: Int64;
thread_id: LongInt;
packet_length: LongInt;
port: Cardinal;
client_flag: LongInt;
server_capabilities: LongInt;
protocol_version: Cardinal;
field_count: Cardinal;
server_status: Cardinal;
server_language: Cardinal;
warning_count: Cardinal;
options: Cardinal;
status: Byte;
free_me: Byte;
reconnect: Byte;
scramble: array[1..SCRAMBLE_LENGTH+1] of Char;
rpl_pivot: Byte;
master: PMYSQL;
next_slave: PMYSQL;
last_used_slave: PMYSQL;
last_used_con: PMYSQL;
stmts: Pointer;
methods: Pointer;
thd: Pointer;
unbuffered_fetch_owner: PByte;
end;
MYSQL_RES = record
row_count: Int64;
field_count, current_field: Integer;
fields: PMYSQL_FIELD;
data: PMYSQL_DATA;
data_cursor: PMYSQL_ROWS;
field_alloc: MEM_ROOT;
row: PMYSQL_ROW; // If unbuffered read
current_row: PMYSQL_ROW; // buffer to current row
lengths: PLongInt; // column lengths of current row
handle: PMYSQL; // for unbuffered reads
eof: Byte; // Used my mysql_fetch_row
is_ps: Byte;
end;
PMYSQL_RES = ^MYSQL_RES;
TMySQLLib = class(TDbLib)
mysql_affected_rows: function(Handle: PMYSQL): Int64; stdcall;
mysql_character_set_name: function(Handle: PMYSQL): PAnsiChar; stdcall;
mysql_close: procedure(Handle: PMYSQL); stdcall;
mysql_data_seek: procedure(Result: PMYSQL_RES; Offset: Int64); stdcall;
mysql_errno: function(Handle: PMYSQL): Cardinal; stdcall;
mysql_error: function(Handle: PMYSQL): PAnsiChar; stdcall;
mysql_fetch_field_direct: function(Result: PMYSQL_RES; FieldNo: Cardinal): PMYSQL_FIELD; stdcall;
mysql_fetch_field: function(Result: PMYSQL_RES): PMYSQL_FIELD; stdcall;
mysql_fetch_lengths: function(Result: PMYSQL_RES): PMYSQL_LENGTHS; stdcall;
mysql_fetch_row: function(Result: PMYSQL_RES): PMYSQL_ROW; stdcall;
mysql_free_result: procedure(Result: PMYSQL_RES); stdcall;
mysql_get_client_info: function: PAnsiChar; stdcall;
mysql_get_server_info: function(Handle: PMYSQL): PAnsiChar; stdcall;
mysql_init: function(Handle: PMYSQL): PMYSQL; stdcall;
mysql_info: function(Handle: PMYSQL): PAnsiChar; stdcall;
mysql_num_fields: function(Result: PMYSQL_RES): Integer; stdcall;
mysql_num_rows: function(Result: PMYSQL_RES): Int64; stdcall;
mysql_options: function(Handle: PMYSQL; Option: Integer; arg: Pointer): Integer; stdcall;
mysql_optionsv: function(Handle: PMYSQL; Option: Integer; arg, val: PAnsiChar): Integer; stdcall;
mysql_ping: function(Handle: PMYSQL): Integer; stdcall;
mysql_real_connect: function(Handle: PMYSQL; const Host, User, Passwd, Db: PAnsiChar; Port: Cardinal; const UnixSocket: PAnsiChar; ClientFlag: Cardinal): PMYSQL; stdcall;
mysql_real_query: function(Handle: PMYSQL; const Query: PAnsiChar; Length: Cardinal): Integer; stdcall;
mysql_stat: function(Handle: PMYSQL): PAnsiChar; stdcall;
mysql_store_result: function(Handle: PMYSQL): PMYSQL_RES; stdcall;
mysql_thread_id: function(Handle: PMYSQL): Cardinal; stdcall;
mysql_next_result: function(Handle: PMYSQL): Integer; stdcall;
mysql_set_character_set: function(Handle: PMYSQL; csname: PAnsiChar): Integer; stdcall;
mysql_thread_init: function: Byte; stdcall;
mysql_thread_end: procedure; stdcall;
mysql_warning_count: function(Handle: PMYSQL): Cardinal; stdcall;
const
INVALID_OPT = -1;
MYBOOL_FALSE: Integer = 0;
MYBOOL_TRUE: Integer = 1;
protected
procedure AssignProcedures; override;
public
MYSQL_OPT_LOCAL_INFILE,
MYSQL_OPT_CONNECT_TIMEOUT,
MARIADB_OPT_TLS_VERSION,
MYSQL_OPT_TLS_VERSION,
MYSQL_PLUGIN_DIR,
MYSQL_OPT_SSL_KEY,
MYSQL_OPT_SSL_CERT,
MYSQL_OPT_SSL_CA,
MYSQL_OPT_SSL_CIPHER,
MYSQL_OPT_CONNECT_ATTR_ADD,
MYSQL_ENABLE_CLEARTEXT_PLUGIN,
MYSQL_OPT_SSL_MODE,
MYSQL_OPT_SSL_VERIFY_SERVER_CERT: Integer;
SSL_MODE_DISABLED,
SSL_MODE_PREFERRED,
SSL_MODE_REQUIRED,
SSL_MODE_VERIFY_CA,
SSL_MODE_VERIFY_IDENTITY: Integer;
constructor Create(DllFile, DefaultDll: String); override;
function IsLibMariadb: Boolean;
end;
TMySqlProvider = class(TSqlProvider)
public
function GetSql(AId: TQueryId): string; override;
end;
var
MySQLKeywords: TStringList;
MySQLErrorCodes: TStringList;
// MySQL Data Type List and Properties
MySQLDatatypes: array [0..42] of TDBDatatype =
(
(
Index: dbdtUnknown;
NativeTypes: '99999';
Name: 'UNKNOWN';
Description: 'Unknown data type';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcOther;
),
(
Index: dbdtTinyint;
NativeType: 1;
Name: 'TINYINT';
Description: 'TINYINT[(M)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A very small integer. The signed range is -128 to 127. ' +
'The unsigned range is 0 to 255.';
HasLength: True;
RequiresLength: False;
MaxSize: 127;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtBool;
NativeType: 1;
Name: 'BOOLEAN';
Description: 'Synonym of TINYINT(1)';
HasLength: False;
RequiresLength: False;
MaxSize: 127;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtSmallint;
NativeType: 2;
Name: 'SMALLINT';
Description: 'SMALLINT[(M)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A small integer. The signed range is -32768 to 32767. ' +
'The unsigned range is 0 to 65535.';
HasLength: True;
RequiresLength: False;
MaxSize: 32767;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtMediumint;
NativeType: 9;
Name: 'MEDIUMINT';
Description: 'MEDIUMINT[(M)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A medium-sized integer. The signed range is -8388608 to 8388607. ' +
'The unsigned range is 0 to 16777215.';
HasLength: True;
RequiresLength: False;
MaxSize: 8388607;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtInt;
NativeType: 3;
Name: 'INT';
Description: 'INT[(M)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A normal-size integer. The signed range is -2147483648 to 2147483647. ' +
'The unsigned range is 0 to 4294967295.';
HasLength: True;
RequiresLength: False;
MaxSize: 2147483647;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtBigint;
NativeType: 8;
Name: 'BIGINT';
Description: 'BIGINT[(M)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A large integer. The signed range is -9223372036854775808 to ' +
'9223372036854775807. The unsigned range is 0 to 18446744073709551615.';
HasLength: True;
RequiresLength: False;
MaxSize: 9223372036854775807;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtFloat;
NativeType: 4;
Name: 'FLOAT';
Description: 'FLOAT[(M,D)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A small (single-precision) floating-point number. Allowable values are '+
'-3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to '+
'3.402823466E+38. These are the theoretical limits, based on the IEEE '+
'standard. The actual range might be slightly smaller depending on your '+
'hardware or operating system.';
HasLength: True;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcReal;
),
(
Index: dbdtDouble;
NativeType: 5;
Name: 'DOUBLE';
Description: 'DOUBLE[(M,D)] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A normal-size (double-precision) floating-point number. Allowable ' +
'values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and ' +
'2.2250738585072014E-308 to 1.7976931348623157E+308. These are the ' +
'theoretical limits, based on the IEEE standard. The actual range might ' +
'be slightly smaller depending on your hardware or operating system.';
HasLength: True;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcReal;
),
(
Index: dbdtDecimal;
NativeType: 246;
Name: 'DECIMAL';
Description: 'DECIMAL[(M[,D])] [UNSIGNED] [ZEROFILL]' + sLineBreak +
'A packed "exact" fixed-point number. M is the total number of digits ' +
'(the precision) and D is the number of digits after the decimal point ' +
'(the scale). The decimal point and (for negative numbers) the "-" sign ' +
'are not counted in M. If D is 0, values have no decimal point or ' +
'fractional part. The maximum number of digits (M) for DECIMAL is 65. ' +
'The maximum number of supported decimals (D) is 30. If D is omitted, ' +
'the default is 0. If M is omitted, the default is 10.';
HasLength: True;
RequiresLength: True;
MaxSize: 9223372036854775807;
HasBinary: False;
HasDefault: True;
LoadPart: False;
DefLengthSet: '20,6';
Category: dtcReal;
),
(
Index: dbdtDate;
NativeType: 10;
Name: 'DATE';
Description: 'DATE' + sLineBreak +
'A date. The supported range is ''1000-01-01'' to ''9999-12-31''. MySQL ' +
'displays DATE values in ''YYYY-MM-DD'' format, but allows assignment of ' +
'values to DATE columns using either strings or numbers.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Format: 'yyyy-mm-dd';
Category: dtcTemporal;
),
(
Index: dbdtTime;
NativeType: 11;
Name: 'TIME';
Description: 'TIME' + sLineBreak +
'A time. The range is ''-838:59:59'' to ''838:59:59''. MySQL displays TIME ' +
'values in ''HH:MM:SS'' format, but allows assignment of values to TIME ' +
'columns using either strings or numbers.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Format: 'hh:nn:ss';
Category: dtcTemporal;
),
(
Index: dbdtYear;
NativeType: 13;
Name: 'YEAR';
Description: 'YEAR[(2|4)]' + sLineBreak +
'A year in two-digit or four-digit format. The default is four-digit ' +
'format. In four-digit format, the allowable values are 1901 to 2155, ' +
'and 0000. In two-digit format, the allowable values are 70 to 69, ' +
'representing years from 1970 to 2069. MySQL displays YEAR values in ' +
'YYYY format, but allows you to assign values to YEAR columns using ' +
'either strings or numbers.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Format: 'yyyy';
Category: dtcTemporal;
),
(
Index: dbdtDatetime;
NativeType: 12;
Name: 'DATETIME';
Description: 'DATETIME' + sLineBreak +
'A date and time combination. The supported range is ''1000-01-01 ' +
'00:00:00'' to ''9999-12-31 23:59:59''. MySQL displays DATETIME values in ' +
'''YYYY-MM-DD HH:MM:SS'' format, but allows assignment of values to ' +
'DATETIME columns using either strings or numbers.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Format: 'yyyy-mm-dd hh:nn:ss';
Category: dtcTemporal;
),
(
Index: dbdtTimestamp;
NativeType: 7;
Name: 'TIMESTAMP';
Description: 'TIMESTAMP' + sLineBreak +
'A timestamp. The range is ''1970-01-01 00:00:01'' UTC to ''2038-01-09 ' +
'03:14:07'' UTC. TIMESTAMP values are stored as the number of seconds ' +
'since the epoch (''1970-01-01 00:00:00'' UTC). A TIMESTAMP cannot ' +
'represent the value ''1970-01-01 00:00:00'' because that is equivalent to ' +
'0 seconds from the epoch and the value 0 is reserved for representing ' +
'''0000-00-00 00:00:00'', the "zero" TIMESTAMP value.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Format: 'yyyy-mm-dd hh:nn:ss';
Category: dtcTemporal;
),
(
Index: dbdtVarchar;
NativeType: 253;
Name: 'VARCHAR';
Description: 'VARCHAR(M)' + sLineBreak +
'A variable-length string. M represents the maximum column length in ' +
'characters. The range of M is 0 to 65,535. The effective maximum length ' +
'of a VARCHAR is subject to the maximum row size (65,535 bytes, which is ' +
'shared among all columns) and the character set used. For example, utf8 ' +
'characters can require up to three bytes per character, so a VARCHAR ' +
'column that uses the utf8 character set can be declared to be a maximum ' +
'of 21,844 characters. ' + sLineBreak + sLineBreak +
'*Note*: MySQL 5.1 follows the standard SQL specification, and does not ' +
'remove trailing spaces from VARCHAR values.';
HasLength: True;
RequiresLength: True;
MaxSize: 255;
HasBinary: True; // MySQL-Help says the opposite but it's valid for older versions at least.
HasDefault: True;
LoadPart: True;
DefLengthSet: '50';
Category: dtcText;
),
(
Index: dbdtChar;
NativeType: 254;
Name: 'CHAR';
Description: 'CHAR[(M)]' + sLineBreak +
'A fixed-length string that is always right-padded with spaces to the ' +
'specified length when stored. M represents the column length in ' +
'characters. The range of M is 0 to 255. If M is omitted, the length is 1.' + sLineBreak + sLineBreak +
'*Note*: Trailing spaces are removed when CHAR values are retrieved ' +
'unless the PAD_CHAR_TO_FULL_LENGTH SQL mode is enabled.';
HasLength: True;
RequiresLength: True;
MaxSize: 255;
HasBinary: True;
HasDefault: True;
LoadPart: False;
DefLengthSet: '50';
Category: dtcText;
),
(
Index: dbdtTinytext;
NativeType: 249;
Name: 'TINYTEXT';
Description: 'TINYTEXT' + sLineBreak +
'A TEXT column with a maximum length of 255 (2^8 - 1) characters. The ' +
'effective maximum length is less if the value contains multi-byte ' +
'characters. Each TINYTEXT value is stored using a one-byte length ' +
'prefix that indicates the number of bytes in the value.';
HasLength: False;
RequiresLength: False;
MaxSize: 255;
HasBinary: True;
HasDefault: False;
LoadPart: False;
Category: dtcText;
),
(
Index: dbdtText;
NativeType: 252;
Name: 'TEXT';
Description: 'TEXT[(M)]' + sLineBreak +
'A TEXT column with a maximum length of 65,535 (2^16 - 1) characters. The ' +
'effective maximum length is less if the value contains multi-byte ' +
'characters. Each TEXT value is stored using a two-byte length prefix ' +
'that indicates the number of bytes in the value. ' + sLineBreak +
'An optional length M can be given for this type. If this is done, MySQL ' +
'creates the column as the smallest TEXT type large enough to hold ' +
'values M characters long.';
HasLength: True;
RequiresLength: False;
MaxSize: 65535;
DefaultSize: 65535;
HasBinary: True;
HasDefault: False;
LoadPart: True;
Category: dtcText;
),
(
Index: dbdtMediumtext;
NativeType: 250;
Name: 'MEDIUMTEXT';
Description: 'MEDIUMTEXT' + sLineBreak +
'A TEXT column with a maximum length of 16,777,215 (2^24 - 1) characters. ' +
'The effective maximum length is less if the value contains multi-byte ' +
'characters. Each MEDIUMTEXT value is stored using a three-byte length ' +
'prefix that indicates the number of bytes in the value.';
HasLength: False;
RequiresLength: False;
HasBinary: True;
HasDefault: False;
LoadPart: True;
Category: dtcText;
),
(
Index: dbdtLongtext;
NativeType: 251;
Name: 'LONGTEXT';
Description: 'LONGTEXT' + sLineBreak +
'A TEXT column with a maximum length of 4,294,967,295 or 4GB (2^32 - 1) ' +
'characters. The effective maximum length is less if the value contains ' +
'multi-byte characters. The effective maximum length of LONGTEXT columns ' +
'also depends on the configured maximum packet size in the client/server ' +
'protocol and available memory. Each LONGTEXT value is stored using a ' +
'four-byte length prefix that indicates the number of bytes in the ' +
'value.';
HasLength: False;
RequiresLength: False;
HasBinary: True;
HasDefault: False;
LoadPart: True;
Category: dtcText;
),
(
Index: dbdtJson;
NativeType: 245;
Name: 'JSON';
Description: 'JSON' + sLineBreak +
'Documents stored in JSON columns are converted to an internal format that '+
'permits quick read access to document elements. When the server later must '+
'read a JSON value stored in this binary format, the value need not be parsed '+
'from a text representation. The binary format is structured to enable the '+
'server to look up subobjects or nested values directly by key or array index '+
'without reading all values before or after them in the document.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: True;
Category: dtcText;
),
(
Index: dbdtUniqueidentifier;
NativeType: 254;
Name: 'UUID';
Description: 'UUID' + sLineBreak +
'The UUID data type is intended for the storage of 128-bit UUID (Universally ' +
'Unique Identifier) data. See the UUID function page for more details on UUIDs ' +
'themselves.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcText;
),
(
Index: dbdtInet4;
NativeType: 255;
Name: 'INET4';
Description: 'INET4' + sLineBreak +
'INET4 is a data type to store IPv4 addresses, as 4-byte binary strings. '+
'It was added in MariaDB 10.10.0';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcText;
MinVersion: 10100;
),
(
Index: dbdtInet6;
NativeType: 255;
Name: 'INET6';
Description: 'INET6' + sLineBreak +
'The INET6 data type is intended for storage of IPv6 addresses, as well as ' +
'IPv4 addresses assuming conventional mapping of IPv4 addresses into IPv6 ' +
'addresses. ' + slineBreak +
'Both short and long IPv6 notation are permitted, according to RFC-5952. '+
'It was added in MariaDB 10.5.0';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcText;
MinVersion: 10050;
),
(
Index: dbdtBinary;
NativeType: 254;
Name: 'BINARY';
Description: 'BINARY(M)' + sLineBreak +
'The BINARY type is similar to the CHAR type, but stores binary byte ' +
'strings rather than non-binary character strings. M represents the ' +
'column length in bytes.';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: False;
DefLengthSet: '50';
Category: dtcBinary;
),
(
Index: dbdtVarbinary;
NativeType: 253;
Name: 'VARBINARY';
Description: 'VARBINARY(M)' + sLineBreak +
'The VARBINARY type is similar to the VARCHAR type, but stores binary ' +
'byte strings rather than non-binary character strings. M represents the ' +
'maximum column length in bytes.';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: True;
DefLengthSet: '50';
Category: dtcBinary;
),
(
Index: dbdtTinyblob;
NativeType: 249;
Name: 'TINYBLOB';
Description: 'TINYBLOB' + sLineBreak +
'A BLOB column with a maximum length of 255 (2^8 - 1) bytes. Each ' +
'TINYBLOB value is stored using a one-byte length prefix that indicates ' +
'the number of bytes in the value.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcBinary;
),
(
Index: dbdtBlob;
NativeType: 252;
Name: 'BLOB';
Description: 'BLOB[(M)]' + sLineBreak +
'A BLOB column with a maximum length of 65,535 (2^16 - 1) bytes. Each ' +
'BLOB value is stored using a two-byte length prefix that indicates the ' +
'number of bytes in the value. ' + sLineBreak +
'An optional length M can be given for this type. If this is done, MySQL ' +
'creates the column as the smallest BLOB type large enough to hold ' +
'values M bytes long.';
HasLength: True;
RequiresLength: False;
MaxSize: 65535;
DefaultSize: 65535;
HasBinary: False;
HasDefault: False;
LoadPart: True;
Category: dtcBinary;
),
(
Index: dbdtMediumblob;
NativeType: 250;
Name: 'MEDIUMBLOB';
Description: 'MEDIUMBLOB' + sLineBreak +
'A BLOB column with a maximum length of 16,777,215 (2^24 - 1) bytes. Each ' +
'MEDIUMBLOB value is stored using a three-byte length prefix that ' +
'indicates the number of bytes in the value.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: True;
Category: dtcBinary;
),
(
Index: dbdtLongblob;
NativeType: 251;
Name: 'LONGBLOB';
Description: 'LONGBLOB' + sLineBreak +
'A BLOB column with a maximum length of 4,294,967,295 or 4GB (2^32 - 1) ' +
'bytes. The effective maximum length of LONGBLOB columns depends on the ' +
'configured maximum packet size in the client/server protocol and ' +
'available memory. Each LONGBLOB value is stored using a four-byte ' +
'length prefix that indicates the number of bytes in the value.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: True;
Category: dtcBinary;
),
(
Index: dbdtVector;
NativeType: 253;
Name: 'VECTOR';
Description: 'VECTOR(N)' + sLineBreak +
'VECTOR data type with a built-in data validation. N is the number of dimensions ' +
'that all vector values in the column will have.';
HasLength: True;
RequiresLength: True;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcBinary;
),
(
Index: dbdtEnum;
NativeType: 247;
Name: 'ENUM';
Description: 'ENUM(''value1'',''value2'',...)' + sLineBreak +
'An enumeration. A string object that can have only one value, chosen ' +
'from the list of values ''value1'', ''value2'', ..., NULL or the special '''' ' +
'error value. An ENUM column can have a maximum of 65,535 distinct ' +
'values. ENUM values are represented internally as integers.';
HasLength: True; // Obviously this is not meant as "length", but as "set of values"
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: False;
DefLengthSet: '''Y'',''N''';
Category: dtcOther;
),
(
Index: dbdtSet;
NativeType: 248;
Name: 'SET';
Description: 'SET(''value1'',''value2'',...)' + sLineBreak +
'A set. A string object that can have zero or more values, each of which ' +
'must be chosen from the list of values ''value1'', ''value2'', ... A SET ' +
'column can have a maximum of 64 members. SET values are represented ' +
'internally as integers.';
HasLength: True; // Same as for ENUM
RequiresLength: True;
HasBinary: False;
HasDefault: True;
LoadPart: False;
DefLengthSet: '''Value A'',''Value B''';
Category: dtcOther;
),
(
Index: dbdtBit;
NativeType: 16;
Name: 'BIT';
Description: 'BIT[(M)]' + sLineBreak +
'A bit-field type. M indicates the number of bits per value, from 1 to ' +
'64. The default is 1 if M is omitted.';
HasLength: True;
RequiresLength: False;
HasBinary: False;
HasDefault: True;
LoadPart: False;
Category: dtcInteger;
),
(
Index: dbdtPoint;
NativeType: 255;
Name: 'POINT';
Description: 'POINT(x,y)' + sLineBreak +
'Constructs a WKB Point using its coordinates.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcSpatial;
),
(
Index: dbdtLinestring;
NativeType: 255;
Name: 'LINESTRING';
Description: 'LINESTRING(pt1,pt2,...)' + sLineBreak +
'Constructs a WKB LineString value from a number of WKB Point arguments. ' +
'If any argument is not a WKB Point, the return value is NULL. If the ' +
'number of Point arguments is less than two, the return value is NULL.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcSpatial;
),
(
Index: dbdtPolygon;
NativeType: 255;
Name: 'POLYGON';
Description: 'POLYGON(ls1,ls2,...)' + sLineBreak +
'Constructs a WKB Polygon value from a number of WKB LineString ' +
'arguments. If any argument does not represent the WKB of a LinearRing ' +
'(that is, not a closed and simple LineString) the return value is NULL.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcSpatial;
),
(
Index: dbdtGeometry;
NativeType: 255;
Name: 'GEOMETRY';
Description: '';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcSpatial;
),
(
Index: dbdtMultipoint;
NativeType: 255;
Name: 'MULTIPOINT';
Description: 'MULTIPOINT(pt1,pt2,...)' + sLineBreak +
'Constructs a WKB MultiPoint value using WKB Point arguments. If any ' +
'argument is not a WKB Point, the return value is NULL.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;
Category: dtcSpatial;
),
(
Index: dbdtMultilinestring;
NativeType: 255;
Name: 'MULTILINESTRING';
Description: 'MULTILINESTRING(ls1,ls2,...)' + sLineBreak +
'Constructs a WKB MultiLineString value using WKB LineString arguments. ' +
'If any argument is not a WKB LineString, the return value is NULL.';
HasLength: False;
RequiresLength: False;
HasBinary: False;
HasDefault: False;
LoadPart: False;