zeoslib  UNKNOWN
 All Files
ZPlainMySqlConstants.pas
Go to the documentation of this file.
1 {*********************************************************}
2 { }
3 { Zeos Database Objects }
4 { Delphi plain interface to libmysql.dll }
5 { Version 4.1 }
6 { }
7 { Originally written by Sergey Seroukhov }
8 { }
9 { Thanks to : }
10 { Pascal Data Objects Library }
11 { }
12 { Copyright (c) 2006 John Marino, www.synsport.com }
13 { }
14 {*********************************************************}
15 
16 {@********************************************************}
17 { Copyright (c) 1999-2012 Zeos Development Group }
18 { }
19 { License Agreement: }
20 { }
21 { This library is distributed in the hope that it will be }
22 { useful, but WITHOUT ANY WARRANTY; without even the }
23 { implied warranty of MERCHANTABILITY or FITNESS FOR }
24 { A PARTICULAR PURPOSE. See the GNU Lesser General }
25 { Public License for more details. }
26 { }
27 { The source code of the ZEOS Libraries and packages are }
28 { distributed under the Library GNU General Public }
29 { License (see the file COPYING / COPYING.ZEOS) }
30 { with the following modification: }
31 { As a special exception, the copyright holders of this }
32 { library give you permission to link this library with }
33 { independent modules to produce an executable, }
34 { regardless of the license terms of these independent }
35 { modules, and to copy and distribute the resulting }
36 { executable under terms of your choice, provided that }
37 { you also meet, for each linked independent module, }
38 { the terms and conditions of the license of that module. }
39 { An independent module is a module which is not derived }
40 { from or based on this library. If you modify this }
41 { library, you may extend this exception to your version }
42 { of the library, but you are not obligated to do so. }
43 { If you do not wish to do so, delete this exception }
44 { statement from your version. }
45 { }
46 { }
47 { The project web site is located on: }
48 { http://zeos.firmos.at (FORUM) }
49 { http://sourceforge.net/p/zeoslib/tickets/ (BUGTRACKER)}
50 { svn://svn.code.sf.net/p/zeoslib/code-0/trunk (SVN) }
51 { }
52 { http://www.sourceforge.net/projects/zeoslib. }
53 { }
54 { }
55 { Zeos Development Group. }
56 {********************************************************@}
57 
58 unit ZPlainMySqlConstants;
59 
60 interface
61 
62 {$I ZPlain.inc}
63 
64 uses
65  ZCompatibility;
66 
67 const
68 { General Declarations }
69  MYSQL_ERRMSG_SIZE = 512;
70  SQLSTATE_LENGTH = 5;
71 
72  MYSQL_PORT = 3306;
73  LOCAL_HOST = 'localhost';
74 
75 { Enum Field Types }
76 { FIELD_TYPE_DECIMAL = 0;
77  FIELD_TYPE_TINY = 1;
78  FIELD_TYPE_SHORT = 2;
79  FIELD_TYPE_LONG = 3;
80  FIELD_TYPE_FLOAT = 4;
81  FIELD_TYPE_DOUBLE = 5;
82  FIELD_TYPE_NULL = 6;
83  FIELD_TYPE_TIMESTAMP = 7;
84  FIELD_TYPE_LONGLONG = 8;
85  FIELD_TYPE_INT24 = 9;
86  FIELD_TYPE_DATE = 10;
87  FIELD_TYPE_TIME = 11;
88  FIELD_TYPE_DATETIME = 12;
89  FIELD_TYPE_YEAR = 13;
90  FIELD_TYPE_NEWDATE = 14;
91  FIELD_TYPE_VARCHAR = 15; //<--ADDED by fduenas 20-06-2006
92  FIELD_TYPE_BIT = 16; //<--ADDED by fduenas 20-06-2006
93  FIELD_TYPE_NEWDECIMAL = 246; //<--ADDED by fduenas 20-06-2006
94  FIELD_TYPE_ENUM = 247;
95  FIELD_TYPE_SET = 248;
96  FIELD_TYPE_TINY_BLOB = 249;
97  FIELD_TYPE_MEDIUM_BLOB = 250;
98  FIELD_TYPE_LONG_BLOB = 251;
99  FIELD_TYPE_BLOB = 252;
100  FIELD_TYPE_VAR_STRING = 253;
101  FIELD_TYPE_STRING = 254;
102  FIELD_TYPE_GEOMETRY = 255; }
103 { For Compatibility }
104 { FIELD_TYPE_CHAR = FIELD_TYPE_TINY;
105  FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM; }
106 
107  { Field's flags }
108  NOT_NULL_FLAG = 1; { Field can't be NULL }
109  PRI_KEY_FLAG = 2; { Field is part of a primary key }
110  UNIQUE_KEY_FLAG = 4; { Field is part of a unique key }
111  MULTIPLE_KEY_FLAG = 8; { Field is part of a key }
112  BLOB_FLAG = 16; { Field is a blob }
113  UNSIGNED_FLAG = 32; { Field is unsigned }
114  ZEROFILL_FLAG = 64; { Field is zerofill }
115  BINARY_FLAG = 128; { Field is binary }
116  ENUM_FLAG = 256; { Field is an enum }
117  AUTO_INCREMENT_FLAG = 512; { Field is a autoincrement field }
118  TIMESTAMP_FLAG = 1024; { Field is a timestamp }
119  SET_FLAG = 2048; { Field is a set }
120  NUM_FLAG = 32768; { Field is num (for clients) }
121  PART_KEY_FLAG = 16384; { Intern; Part of some key }
122  GROUP_FLAG = 32768; { Intern: Group field }
123  UNIQUE_FLAG = 65536; { Intern: Used by sql_yacc }
124  BINCMP_FLAG = $20000; { Intern: Used by sql_yacc }
125  GET_FIXED_FIELDS_FLAG = $40000; { Used to get fields in item tree }
126  FIELD_IN_PART_FUNC_FLAG= $80000; { Field part of partition func }
127  FIELD_IN_ADD_INDEX = $100000; { Intern: Field used in ADD INDEX }
128  FIELD_IS_RENAMED = $200000; { Intern: Field is being renamed}
129 
130 { Client Connection Options }
131  _CLIENT_LONG_PASSWORD = 1; { new more secure passwords }
132  _CLIENT_FOUND_ROWS = 2; { Found instead of affected rows }
133  _CLIENT_LONG_FLAG = 4; { Get all column flags }
134  _CLIENT_CONNECT_WITH_DB = 8; { One can specify db on connect }
135  _CLIENT_NO_SCHEMA = 16; { Don't allow database.table.column }
136  _CLIENT_COMPRESS = 32; { Can use compression protcol }
137  _CLIENT_ODBC = 64; { Odbc client }
138  _CLIENT_LOCAL_FILES = 128; { Can use LOAD DATA LOCAL }
139  _CLIENT_IGNORE_SPACE = 256; { Ignore spaces before '(' }
140  _CLIENT_CHANGE_USER = 512; { Support the mysql_change_user() }
141  _CLIENT_INTERACTIVE = 1024; { This is an interactive client }
142  _CLIENT_SSL = 2048; { Switch to SSL after handshake }
143  _CLIENT_IGNORE_SIGPIPE = 4096; { IGNORE sigpipes }
144  _CLIENT_TRANSACTIONS = 8196; { Client knows about transactions }
145  _CLIENT_RESERVED = 16384; { Old flag for 4.1 protocol }
146  _CLIENT_SECURE_CONNECTION = 32768; { New 4.1 authentication }
147  _CLIENT_MULTI_STATEMENTS = 65536; { Enable/disable multi-stmt support }
148  _CLIENT_MULTI_RESULTS = 131072; { Enable/disable multi-results }
149  _CLIENT_PS_MULTI_RESULTS = 262144; { Enable Multi-results in PS-protocol }
150  _CLIENT_PLUGIN_AUTH = 524288;
151  _CLIENT_SSL_VERIFY_SERVER_CERT = 1073741824;
152  _CLIENT_REMEMBER_OPTIONS = 2147483648; {Enable/disable multi-results }
153 
154 {THD: Killable}
155  MYSQL_SHUTDOWN_KILLABLE_CONNECT = 1;
156  MYSQL_SHUTDOWN_KILLABLE_TRANS = 2;
157  MYSQL_SHUTDOWN_KILLABLE_LOCK_TABLE = 4;
158  MYSQL_SHUTDOWN_KILLABLE_UPDATE = 8;
159 
160 {prepared fetch results}
161  STMT_FETCH_OK = 0;
162  STMT_FETCH_ERROR = 1;
163  STMT_FETCH_NO_DATA = 100;
164  STMT_FETCH_DATA_TRUNC = 101;
165 
166  {status codes}
167 const
168  MYSQL_NO_DATA = 100;
169  MYSQL_DATA_TRUNCATED = 101;
170 
171 type
172  TMySqlOption = (
173  MYSQL_OPT_CONNECT_TIMEOUT, MYSQL_OPT_COMPRESS, MYSQL_OPT_NAMED_PIPE,
174  MYSQL_INIT_COMMAND, MYSQL_READ_DEFAULT_FILE, MYSQL_READ_DEFAULT_GROUP,
175  MYSQL_SET_CHARSET_DIR, MYSQL_SET_CHARSET_NAME, MYSQL_OPT_LOCAL_INFILE,
176  MYSQL_OPT_PROTOCOL, MYSQL_SHARED_MEMORY_BASE_NAME, MYSQL_OPT_READ_TIMEOUT,
177  MYSQL_OPT_WRITE_TIMEOUT, MYSQL_OPT_USE_RESULT,
178  MYSQL_OPT_USE_REMOTE_CONNECTION, MYSQL_OPT_USE_EMBEDDED_CONNECTION,
179  MYSQL_OPT_GUESS_CONNECTION, MYSQL_SET_CLIENT_IP, MYSQL_SECURE_AUTH,
180  MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT,
181  MYSQL_OPT_SSL_VERIFY_SERVER_CERT, MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH,
182  MYSQL_OPT_BIND,
183  MYSQL_OPT_SSL_KEY, MYSQL_OPT_SSL_CERT,
184  MYSQL_OPT_SSL_CA, MYSQL_OPT_SSL_CAPATH, MYSQL_OPT_SSL_CIPHER,
185  MYSQL_OPT_SSL_CRL, MYSQL_OPT_SSL_CRLPATH,
186  MYSQL_OPT_CONNECT_ATTR_RESET, MYSQL_OPT_CONNECT_ATTR_ADD,
187  MYSQL_OPT_CONNECT_ATTR_DELETE,
188  MYSQL_SERVER_PUBLIC_KEY,
189  MYSQL_ENABLE_CLEARTEXT_PLUGIN,
190  MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS,
191  MYSQL_OPT_SSL_ENFORCE
192  );
193 const
194  TMySqlOptionMinimumVersion: array[TMySqlOption] of Integer =
195  (
196  {MYSQL_OPT_CONNECT_TIMEOUT} 0,
197  {MYSQL_OPT_COMPRESS} 0,
198  {MYSQL_OPT_NAMED_PIPE} 0,
199  {MYSQL_INIT_COMMAND} 0,
200  {MYSQL_READ_DEFAULT_FILE} 0,
201  {MYSQL_READ_DEFAULT_GROUP} 0,
202  {MYSQL_SET_CHARSET_DIR} 0,
203  {MYSQL_SET_CHARSET_NAME} 0,
204  {MYSQL_OPT_LOCAL_INFILE} 0,
205  {MYSQL_OPT_PROTOCOL} 40100,
206  {MYSQL_SHARED_MEMORY_BASE_NAME} 40100,
207  {MYSQL_OPT_READ_TIMEOUT} 40101,
208  {MYSQL_OPT_WRITE_TIMEOUT} 40101,
209  {MYSQL_OPT_USE_RESULT} 40101,
210  {MYSQL_OPT_USE_REMOTE_CONNECTION} 40101,
211  {MYSQL_OPT_USE_EMBEDDED_CONNECTION} 40101,
212  {MYSQL_OPT_GUESS_CONNECTION} 40101,
213  {MYSQL_SET_CLIENT_IP} 40101,
214  {MYSQL_SECURE_AUTH} 40101,
215  {MYSQL_REPORT_DATA_TRUNCATION} 40101,
216  {MYSQL_OPT_RECONNECT} 50013,
217  {MYSQL_OPT_SSL_VERIFY_SERVER_CERT} 50023,
218  {MYSQL_PLUGIN_DIR} 50507,
219  {MYSQL_DEFAULT_AUTH} 50507,
220  {MYSQL_OPT_BIND} 50601,
221  {MYSQL_OPT_SSL_KEY} 50603,
222  {MYSQL_OPT_SSL_CERT} 50603,
223  {MYSQL_OPT_SSL_CA} 50603,
224  {MYSQL_OPT_SSL_CAPATH} 50603,
225  {MYSQL_OPT_SSL_CIPHER} 50603,
226  {MYSQL_OPT_SSL_CRL} 50603,
227  {MYSQL_OPT_SSL_CRLPATH} 50603,
228  {MYSQL_OPT_CONNECT_ATTR_RESET} 50606,
229  {MYSQL_OPT_CONNECT_ATTR_ADD} 50606,
230  {MYSQL_OPT_CONNECT_ATTR_DELETE} 50606,
231  {MYSQL_SERVER_PUBLIC_KEY} 50606,
232  {MYSQL_ENABLE_CLEARTEXT_PLUGIN} 50607,
233  {MYSQL_OPT_CAN_HANDLE_EXPIRED_PASSWORDS} 50610,
234  {MYSQL_OPT_SSL_ENFORCE} 50703
235  );
236 type
237  PUSED_MEM=^USED_MEM;
238  USED_MEM = packed record
239  next: PUSED_MEM;
240  left: Integer;
241  size: Integer;
242  end;
243 
244  PERR_PROC = ^ERR_PROC;
245  ERR_PROC = procedure;
246 
247  PMEM_ROOT = ^MEM_ROOT;
248  MEM_ROOT = packed record
249  free: PUSED_MEM;
250  used: PUSED_MEM;
251  pre_alloc: PUSED_MEM;
252  min_malloc: Integer;
253  block_size: Integer;
254  block_num: Integer;
255  first_block_usage: Integer;
256  error_handler: PERR_PROC;
257  end;
258 
259  MYSQL_ROW = array[00..$ff] of PAnsiChar;
260  PMYSQL_ROW = ^MYSQL_ROW;
261 
262  PMYSQL_ROWS = ^MYSQL_ROWS;
263  MYSQL_ROWS = record
264  next: PMYSQL_ROWS;
265  data: PMYSQL_ROW;
266  end;
267 
268  MYSQL_ROW_OFFSET = PMYSQL_ROWS;
269 
270  MYSQL_DATA = record
271  Rows: Int64;
272  Fields: Cardinal;
273  Data: PMYSQL_ROWS;
274  Alloc: MEM_ROOT;
275  end;
276  PMYSQL_DATA = ^MYSQL_DATA;
277 
278  MYSQL_FIELD_OFFSET = UInt;
279 
280  PMYSQL_OPTIONS = ^_MYSQL_OPTIONS;
281  _MYSQL_OPTIONS = record
282  connect_timeout: UInt;
283  read_timeout: UInt;
284  write_timeout: UInt;
285  port: UInt;
286  protocol: UInt;
287  client_flag: ULong;
288  host: PAnsiChar;
289  user: PAnsiChar;
290  password: PAnsiChar;
291  unix_socket: PAnsiChar;
292  db: PAnsiChar;
293  init_commands: Pointer;
294  my_cnf_file: PAnsiChar;
295  my_cnf_group: PAnsiChar;
296  charset_dir: PAnsiChar;
297  charset_name: PAnsiChar;
298  ssl_key: PAnsiChar;
299  ssl_cert: PAnsiChar;
300  ssl_ca: PAnsiChar;
301  ssl_capath: PAnsiChar;
302  ssl_cipher: PAnsiChar;
303  shared_memory_base_name: PAnsiChar;
304  max_allowed_packet: ULong;
305  use_ssl: Byte;
306  compress: Byte;
307  named_pipe: Byte;
308  unused1: Byte;
309  unused2: Byte;
310  unused3: Byte;
311  unused4: Byte;
312  methods_to_use: TMySqlOption;
313  client_ip: PAnsiChar;
314  secure_auth: Byte;
315  local_infile_init: Pointer;
316  local_infile_read: Pointer;
317  local_infile_end: Pointer;
318  local_infile_error: Pointer;
319  local_infile_userdata: Pointer;
320  end;
321 
322  PZMySQLConnect = Pointer;
323  PZMySQLResult = Pointer;
324  PZMySQLRow = Pointer;
325  PZMySQLField = Pointer;
326  PZMySQLRowOffset = Pointer;
327  PZMySqlPrepStmt = Pointer;
328  PZMysqlBindArray = Pointer;
329 
330 { Enum Field Types }
331  TMysqlFieldTypes = (
332  FIELD_TYPE_DECIMAL = 0,
333  FIELD_TYPE_TINY = 1,
334  FIELD_TYPE_SHORT = 2,
335  FIELD_TYPE_LONG = 3,
336  FIELD_TYPE_FLOAT = 4,
337  FIELD_TYPE_DOUBLE = 5,
338  FIELD_TYPE_NULL = 6,
339  FIELD_TYPE_TIMESTAMP = 7,
340  FIELD_TYPE_LONGLONG = 8,
341  FIELD_TYPE_INT24 = 9,
342  FIELD_TYPE_DATE = 10,
343  FIELD_TYPE_TIME = 11,
344  FIELD_TYPE_DATETIME = 12,
345  FIELD_TYPE_YEAR = 13,
346  FIELD_TYPE_NEWDATE = 14,
347  FIELD_TYPE_VARCHAR = 15, //<--ADDED by fduenas 20-06-2006
348  FIELD_TYPE_BIT = 16, //<--ADDED by fduenas 20-06-2006
349  FIELD_TYPE_NEWDECIMAL = 246, //<--ADDED by fduenas 20-06-2006
350  FIELD_TYPE_ENUM = 247,
351  FIELD_TYPE_SET = 248,
352  FIELD_TYPE_TINY_BLOB = 249,
353  FIELD_TYPE_MEDIUM_BLOB = 250,
354  FIELD_TYPE_LONG_BLOB = 251,
355  FIELD_TYPE_BLOB = 252,
356  FIELD_TYPE_VAR_STRING = 253,
357  FIELD_TYPE_STRING = 254,
358  FIELD_TYPE_GEOMETRY = 255
359  );
360  PTMysqlFieldTypes=^TMysqlFieldTypes;
361  { Options for mysql_set_option }
362  TMySqlSetOption = (
363  MYSQL_OPTION_MULTI_STATEMENTS_ON,
364  MYSQL_OPTION_MULTI_STATEMENTS_OFF
365  );
366 
367  TMysqlStmtAttrType = (
368  STMT_ATTR_UPDATE_MAX_LENGTH,
369  STMT_ATTR_CURSOR_TYPE,
370  STMT_ATTR_PREFETCH_ROWS
371  );
372 
373  TMysqlShutdownLevel = (
374  SHUTDOWN_DEFAULT = 0,
375  SHUTDOWN_WAIT_CONNECTIONS = MYSQL_SHUTDOWN_KILLABLE_CONNECT,
376  SHUTDOWN_WAIT_TRANSACTIONS = MYSQL_SHUTDOWN_KILLABLE_TRANS,
377  SHUTDOWN_WAIT_UPDATES = MYSQL_SHUTDOWN_KILLABLE_UPDATE,
378  SHUTDOWN_WAIT_ALL_BUFFERS = (MYSQL_SHUTDOWN_KILLABLE_UPDATE shl 1),
379  SHUTDOWN_WAIT_CRITICAL_BUFFERS,
380  KILL_QUERY = 254,
381  KILL_CONNECTION = 255
382  );
383 
384 TMYSQL_CLIENT_OPTIONS =
385 ( CLIENT_LONG_PASSWORD, { = 1; new more secure passwords }
386  CLIENT_FOUND_ROWS , { = 2; Found instead of affected rows }
387  CLIENT_LONG_FLAG , { = 4; Get all column flags }
388  CLIENT_CONNECT_WITH_DB , { = 8; One can specify db on connect }
389  CLIENT_NO_SCHEMA , { = 16; Don't allow database.table.column }
390  CLIENT_COMPRESS , { = 32; Can use compression protcol }
391  CLIENT_ODBC , { = 64; Odbc client }
392  CLIENT_LOCAL_FILES , { = 128; Can use LOAD DATA LOCAL }
393  CLIENT_IGNORE_SPACE , { = 256; Ignore spaces before '(' }
394  CLIENT_CHANGE_USER , { = 512; Support the mysql_change_user() }
395  CLIENT_INTERACTIVE , { = 1024; This is an interactive client }
396  CLIENT_SSL , { = 2048; Switch to SSL after handshake }
397  CLIENT_IGNORE_SIGPIPE , { = 4096; IGNORE sigpipes }
398  CLIENT_TRANSACTIONS , { = 8196; Client knows about transactions }
399  CLIENT_RESERVED , { = 16384; Old flag for 4.1 protocol }
400  CLIENT_SECURE_CONNECTION , {= 32768; New 4.1 authentication }
401  CLIENT_MULTI_STATEMENTS , {= 65536; Enable/disable multi-stmt support }
402  CLIENT_MULTI_RESULTS , { = 131072; Enable/disable multi-results }
403  CLIENT_PS_MULTI_RESULTS, {2^18 = 262144; Enable Multi-results in PS-protocol}
404  CLIENT_PLUGIN_AUTH,{2^19 = 524288}
405  CLIENT_OPT_20, {2^20 = 1048576}
406  CLIENT_OPT_21, {2^21 = 2097152 }
407  CLIENT_OPT_22, {2^22 = 4194304}
408  CLIENT_OPT_23, {2^23 = 8388608 }
409  CLIENT_OPT_24, {2^24 = 16777216 }
410  CLIENT_OPT_25, {2^25 = 33554432}
411  CLIENT_OPT_26, {2^26 = 67108864}
412  CLIENT_OPT_27, {2^27 = 134217728}
413  CLIENT_OPT_28, {2^28 = 268435456}
414  CLIENT_OPT_29, {2^29 = 536870912}
415  CLIENT_SSL_VERIFY_SERVER_CERT, {2^30 = 1073741824}
416  CLIENT_REMEMBER_OPTIONS { = 2147483648; Enable/disable multi-results });
417 
418  TMysqlStmtState = (
419  MYSQL_STMT_INIT_DONE = 1,
420  MYSQL_STMT_PREPARE_DONE,
421  MYSQL_STMT_EXECUTE_DONE,
422  MYSQL_STMT_FETCH_DONE
423  );
424 
425  mysql_timestamp_type = (
426  MYSQL_TIMESTAMP_NONE = -2,
427  MYSQL_TIMESTAMP_ERROR = -1,
428  MYSQL_TIMESTAMP_DATE = 0,
429  MYSQL_TIMESTAMP_DATETIME = 1,
430  MYSQL_TIMESTAMP_TIME = 2
431  );
432 
433  MYSQL_TIME = record
434  year: UInt;
435  month: UInt;
436  day: UInt;
437  hour: UInt;
438  minute: UInt;
439  second: UInt;
440  second_part: ULong;
441  neg: Byte;
442  time_type: mysql_timestamp_type;
443  padding: UInt; //ludob alignment is different? Mysql returns 36 bytes.
444  end;
445  PMYSQL_TIME = ^MYSQL_TIME;
446 
447  PLIST = ^LIST;
448  LIST = record
449  prev: PLIST;
450  next: PLIST;
451  data: Pointer;
452  end;
453 
454  PMYSQL_FIELD = ^MYSQL_FIELD;
455  MYSQL_FIELD = record
456  name: PAnsiChar; // Name of column
457  org_name: PAnsiChar; // Original column name, if an alias
458  table: PAnsiChar; // Table of column if column was a field
459  org_table: PAnsiChar; // Org table name if table was an alias
460  db: PAnsiChar; // Database for table
461  catalog: PAnsiChar; // Catalog for table
462  def: PAnsiChar; // Default value (set by mysql_list_fields)
463  length: ULong; // Width of column
464  max_length: ULong; // Max width of selected set
465  name_length: UInt;
466  org_name_length: UInt;
467  table_length: UInt;
468  org_table_length: UInt;
469  db_length: UInt;
470  catalog_length: UInt;
471  def_length: UInt;
472  flags: UInt; // Div flags
473  decimals: UInt; // Number of decimals in field
474  charsetnr: UInt; // Character set
475  _type: TMysqlFieldTypes; // Type of field. Se mysql_com.h for types
476  end;
477 
478  PMYSQL_BIND41 = ^MYSQL_BIND41;
479  MYSQL_BIND41 = record
480  // 4.1.22 definition
481  length: PULong;
482  is_null: PByte;
483  buffer: PAnsiChar;
484  buffer_type: TMysqlFieldTypes;
485  buffer_length: ULong;
486  //internal fields
487  inter_buffer: PByte;
488  offset: ULong;
489  internal_length: ULong;
490  param_number: UInt;
491  pack_length: UInt;
492  is_unsigned: Byte;
493  long_data_used: Byte;
494  internal_is_null: Byte;
495  store_param_func: Pointer;
496  fetch_result: Pointer;
497  skip_result: Pointer;
498  end;
499 
500  PMYSQL_BIND50 = ^MYSQL_BIND50;
501  MYSQL_BIND50 = record
502  // 5.0.67 definition
503  length: PULong;
504  is_null: PByte;
505  buffer: PAnsiChar;
506  error: PByte;
507  buffer_type: TMysqlFieldTypes;
508  buffer_length: ULong;
509  row_ptr: PByte;
510  offset: ULong;
511  length_value: ULong;
512  param_number: UInt;
513  pack_length: UInt;
514  error_value: Byte;
515  is_unsigned: Byte;
516  long_data_used: Byte;
517  is_null_value: Byte;
518  store_param_funct: Pointer;
519  fetch_result: Pointer;
520  skip_result: Pointer;
521  end;
522 
523  PMYSQL_BIND51 = ^MYSQL_BIND51;
524  MYSQL_BIND51 = record
525  // 5.1.30 definition (Still valid for 5.6.25)
526  length: PULong;
527  is_null: PByte;
528  buffer: PAnsiChar;
529  error: PByte;
530  row_ptr: PByte;
531  store_param_funct: Pointer;
532  fetch_result: Pointer;
533  skip_result: Pointer;
534  buffer_length: ULong;
535  offset: ULong;
536  length_value: ULong;
537  param_number: UInt;
538  pack_length: UInt;
539  buffer_type: TMysqlFieldTypes;
540  error_value: Byte;
541  is_unsigned: Byte;
542  long_data_used: Byte;
543  is_null_value: Byte;
544  extension: Pointer;
545  end;
546 
547  PMYSQL_BIND60 = ^MYSQL_BIND60;
548  MYSQL_BIND60 = record
549  // 6.0.8 definition
550  length: PULong;
551  is_null: PByte;
552  buffer: PAnsiChar;
553  error: PByte;
554  row_ptr: PByte;
555  store_param_funct: Pointer;
556  fetch_result: Pointer;
557  skip_result: Pointer;
558  buffer_length: ULong;
559  offset: ULong;
560  length_value: ULong;
561  param_number: UInt;
562  pack_length: UInt;
563  buffer_type: TMysqlFieldTypes;
564  error_value: Byte;
565  is_unsigned: Byte;
566  long_data_used: Byte;
567  is_null_value: Byte;
568  extension: Pointer;
569  end;
570 
571  // offsets to used MYSQL_BINDxx members. Filled by GetBindOffsets
572  MYSQL_BINDOFFSETS=record
573  buffer_type :NativeUint;
574  buffer_length :NativeUint;
575  is_unsigned :NativeUint;
576  buffer :NativeUint;
577  length :NativeUint;
578  is_null :NativeUint;
579  size :integer; //size of MYSQL_BINDxx
580  end;
581 
582 
583  PDOBindRecord2 = record
584  buffer: Array of Byte;
585  length: ULong;
586  is_null: Byte;
587  end;
588 
589  PMYSQL = ^MYSQL;
590 
591  MYSQL = pointer;
592 
593  PMY_CHARSET_INFO = ^MY_CHARSET_INFO;
594  MY_CHARSET_INFO = record
595  number: UInt;
596  state: UInt;
597  csname: PAnsiChar;
598  name: PAnsiChar;
599  comment: PAnsiChar;
600  dir: PAnsiChar;
601  mbminlen: UInt;
602  mbmaxlen: UInt;
603  end;
604  // Structure of the MYSQL_RES record isn't used anymore.
605  // Access to the fields should be done using library functions
606  // Reason : the structure of these records tend to change now and then.
607  PMYSQL_RES = Pointer;
608 
609  PREP_STMT_STATE=(
610  MY_ST_UNKNOWN,
611  MY_ST_PREPARE,
612  MY_ST_EXECUTE);
613 
614  PMYSQL_STMT = Pointer;
615 
616 { ****************** Plain API Types definition ***************** }
617 
618 type
619 
620 { ************** Plain API Function types definition ************* }
621 
622  { Functions to get information from the MYSQL and MYSQL_RES structures
623  Should definitely be used if one uses shared libraries. }
624  Tmysql_affected_rows = function(Handle: PMYSQL): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
625  Tmysql_character_set_name = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
626  Tmysql_close = procedure(Handle: PMYSQL); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
627  Tmysql_connect = function(Handle: PMYSQL; const Host, User, Passwd: PAnsiChar): PMYSQL; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
628  Tmysql_create_db = function(Handle: PMYSQL; const Db: PAnsiChar): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
629  Tmysql_data_seek = procedure(Result: PMYSQL_RES; Offset: ULongLong); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
630  Tmysql_debug = procedure(Debug: PAnsiChar); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
631  Tmysql_drop_db = function(Handle: PMYSQL; const Db: PAnsiChar): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
632  Tmysql_dump_debug_info = function(Handle: PMYSQL): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
633  Tmysql_eof = function(Result: PMYSQL_RES): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
634  Tmysql_errno = function(Handle: PMYSQL): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
635  Tmysql_error = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
636  Tmysql_escape_string = function(PTo, PFrom: PAnsiChar; Len: ULong): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
637  Tmysql_fetch_field = function(Result: PMYSQL_RES): PMYSQL_FIELD; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
638  Tmysql_fetch_field_direct = function(Result: PMYSQL_RES; FieldNo: UInt): PMYSQL_FIELD; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
639  Tmysql_fetch_fields = function(Result: PMYSQL_RES): PMYSQL_FIELD; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
640  Tmysql_fetch_lengths = function(Result: PMYSQL_RES): PULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
641  Tmysql_fetch_row = function(Result: PMYSQL_RES): PMYSQL_ROW; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
642  Tmysql_field_seek = function(Result: PMYSQL_RES; Offset: MYSQL_FIELD_OFFSET): MYSQL_FIELD_OFFSET;
643  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
644  Tmysql_field_tell = function(Result: PMYSQL_RES): MYSQL_FIELD_OFFSET; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
645  Tmysql_free_result = procedure(Result: PMYSQL_RES); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
646  Tmysql_get_client_info = function: PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
647  Tmysql_get_host_info = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
648  Tmysql_get_proto_info = function(Handle: PMYSQL): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
649  Tmysql_get_server_info = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
650  Tmysql_info = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
651  Tmysql_init = function(Handle: PMYSQL): PMYSQL; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
652  Tmysql_insert_id = function(Handle: PMYSQL): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
653  Tmysql_kill = function(Handle: PMYSQL; Pid: ULong): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
654  Tmysql_list_dbs = function(Handle: PMYSQL; Wild: PAnsiChar): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
655  Tmysql_list_fields = function(Handle: PMYSQL; const Table, Wild: PAnsiChar): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
656  Tmysql_list_processes = function(Handle: PMYSQL): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
657  Tmysql_list_tables = function(Handle: PMYSQL; const Wild: PAnsiChar): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
658  Tmysql_num_fields = function(Result: PMYSQL_RES): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
659  Tmysql_num_rows = function(Result: PMYSQL_RES): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
660  Tmysql_options = function(Handle: PMYSQL; Option: TMySqlOption; const Arg: PAnsiChar): Integer;
661  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
662  Tmysql_ping = function(Handle: PMYSQL): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
663  Tmysql_query = function(Handle: PMYSQL; const Query: PAnsiChar): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
664  Tmysql_real_connect = function(Handle: PMYSQL; const Host, User, Passwd, Db: PAnsiChar;
665  Port: UInt; const UnixSocket: PAnsiChar; ClientFlag: ULong): PMYSQL;
666  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
667  Tmysql_real_escape_string = function(Handle: PMYSQL; PTo: PAnsiChar; const PFrom: PAnsiChar; length: ULong): ULong;
668  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
669  Tmysql_real_query = function(Handle: PMYSQL; const Query: PAnsiChar; Length: ULong): Integer;
670  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
671  Tmysql_refresh = function(Handle: PMYSQL; Options: UInt): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
672  Tmysql_row_seek = function(Result: PMYSQL_RES; Offset: PMYSQL_ROWS): PMYSQL_ROWS; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
673  Tmysql_row_tell = function(Result: PMYSQL_RES): PMYSQL_ROWS; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
674  Tmysql_select_db = function(Handle: PMYSQL; const Db: PAnsiChar): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
675  Tmysql_ssl_set = function(Handle: PMYSQL; const key, cert, CA, CApath, cipher:
676  PAnsiChar): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
677  Tmysql_stat = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
678  Tmysql_store_result = function(Handle: PMYSQL): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
679  Tmysql_thread_id = function(Handle: PMYSQL): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
680  Tmysql_use_result = function(Handle: PMYSQL): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
681 
682  { Set up and bring down a thread; these function should be called for each thread in an application which
683  opens at least one MySQL connection. All uses of the connection(s) should be between these function calls. }
684  Tmy_init = procedure; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
685  Tmysql_thread_init = function: Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
686  Tmysql_thread_end = procedure; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
687  Tmysql_thread_safe = function: UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
688 
689  { Set up and bring down the server; to ensure that applications will work when linked against either the
690  standard client library or the embedded server library, these functions should be called. }
691  Tmysql_server_init = function(Argc: Integer; Argv, Groups: Pointer): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
692  Tmysql_server_end = procedure; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
693 
694  Tmysql_change_user = function(mysql: PMYSQL; const user: PAnsiChar; const passwd: PAnsiChar; const db: PAnsiChar): Byte;
695  Tmysql_field_count = function(Handle: PMYSQL): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
696 
697 
698  Tmysql_get_client_version = function: ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
699 
700  Tmysql_send_query = function(mysql: PMYSQL; const query: PAnsiChar;
701  length: ULong): Integer;
702  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
703 
704  Tmysql_read_query_result = function(mysql: PMYSQL): Byte;
705  {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
706 
707 
708  Tmysql_autocommit = function(Handle: PMYSQL; const mode: Byte): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
709  Tmysql_commit = function(Handle: PMYSQL): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
710  Tmysql_get_server_version = function(Handle: PMYSQL): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
711  Tmysql_hex_string = function(PTo, PFrom: PAnsiChar; Len: ULong): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
712  Tmysql_more_results = function(Handle: PMYSQL): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
713  Tmysql_next_result = function(Handle: PMYSQL): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
714  Tmysql_rollback = function(Handle: PMYSQL): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
715  Tmysql_set_character_set = function(Handle: PMYSQL; const csname: PAnsiChar): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
716  Tmysql_set_server_option = function(Handle: PMYSQL; Option: TMysqlSetOption): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
717  Tmysql_shutdown = function(Handle: PMYSQL; shutdown_level: TMysqlShutdownLevel): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
718  Tmysql_sqlstate = function(Handle: PMYSQL): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
719  Tmysql_warning_count = function(Handle: PMYSQL): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
720 {BELOW are new PREPARED STATEMENTS}
721  Tmysql_stmt_affected_rows = function(stmt: PMYSQL_STMT): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
722  Tmysql_stmt_attr_get = function(stmt: PMYSQL_STMT; option: TMysqlStmtAttrType;
723  arg: PAnsiChar): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
724  Tmysql_stmt_attr_set517UP = function(stmt: PMYSQL_STMT; option: TMysqlStmtAttrType;
725  const arg: PAnsiChar): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
726  Tmysql_stmt_attr_set = function(stmt: PMYSQL_STMT; option: TMysqlStmtAttrType;
727  const arg: PAnsiChar): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
728  Tmysql_stmt_bind_param = function(stmt: PMYSQL_STMT; bind: Pointer{BIND record}): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
729  Tmysql_stmt_bind_result = function(stmt: PMYSQL_STMT; bind: Pointer{BIND record}): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
730  Tmysql_stmt_close = function(stmt: PMYSQL_STMT): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
731  Tmysql_stmt_data_seek = procedure(stmt: PMYSQL_STMT; offset: ULongLong); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
732  Tmysql_stmt_errno = function(stmt: PMYSQL_STMT): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
733  Tmysql_stmt_error = function(stmt: PMYSQL_STMT): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
734  Tmysql_stmt_execute = function(stmt: PMYSQL_STMT): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
735  Tmysql_stmt_fetch = function(stmt: PMYSQL_STMT): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
736  Tmysql_stmt_fetch_column = function(stmt: PMYSQL_STMT; bind: Pointer{BIND record}; column: UInt;
737  offset: ULong): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
738  Tmysql_stmt_field_count = function(stmt: PMYSQL_STMT): UInt; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
739  Tmysql_stmt_free_result = function(stmt: PMYSQL_STMT): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
740  Tmysql_stmt_init = function(Handle: PMYSQL): PMYSQL_STMT; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
741  Tmysql_stmt_insert_id = function(stmt: PMYSQL_STMT): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
742  Tmysql_stmt_next_result = function(stmt: PMYSQL_STMT): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
743  Tmysql_stmt_num_rows = function(stmt: PMYSQL_STMT): ULongLong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
744  Tmysql_stmt_param_count = function(stmt: PMYSQL_STMT): ULong; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
745  Tmysql_stmt_param_metadata = function(stmt: PMYSQL_STMT): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
746  Tmysql_stmt_prepare = function(stmt: PMYSQL_STMT; const query: PAnsiChar; length: ULong):
747  Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
748  Tmysql_stmt_reset = function(stmt: PMYSQL_STMT): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
749  Tmysql_stmt_result_metadata = function(stmt: PMYSQL_STMT): PMYSQL_RES; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
750  Tmysql_stmt_row_seek = function(stmt: PMYSQL_STMT; offset: PMYSQL_ROWS): PMYSQL_ROWS; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
751  Tmysql_stmt_row_tell = function(stmt: PMYSQL_STMT): PMYSQL_ROWS; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
752  Tmysql_stmt_send_long_data = function(stmt: PMYSQL_STMT; parameter_number: UInt; const
753  data: PAnsiChar; length: ULong): Byte; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
754  Tmysql_stmt_sqlstate = function(stmt: PMYSQL_STMT): PAnsiChar; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
755  Tmysql_stmt_store_result = function(stmt: PMYSQL_STMT): Integer; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
756 
757  Tmysql_get_character_set_info = procedure(Handle: PMYSQL; cs: PMY_CHARSET_INFO); {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
758  Tmysql_library_end = procedure; {$IFDEF MSWINDOWS} stdcall {$ELSE} cdecl {$ENDIF};
759 
760 { ************** Collection of Plain API Function types definition ************* }
761 TZMYSQL_API = record
762  mysql_affected_rows: Tmysql_affected_rows; {mysql 3.2}
763  mysql_character_set_name: Tmysql_character_set_name; {mysql 3.2}
764  mysql_close: Tmysql_close; {mysql 3.2}
765  mysql_connect: Tmysql_connect; {mysql 3.2} {deprecated for mysql_real_connect}
766  mysql_create_db: Tmysql_create_db; {mysql 3.2} {deprecated for mysql_query}
767  mysql_data_seek: Tmysql_data_seek; {mysql 3.2}
768  mysql_debug: Tmysql_debug; {mysql 3.2}
769  mysql_drop_db: Tmysql_drop_db; {mysql 3.2} {deprecated for mysql_query}
770  mysql_dump_debug_info: Tmysql_dump_debug_info; {mysql 3.2}
771  mysql_eof: Tmysql_eof; {mysql 3.2} {deprecated for mysql_error/mysql_errno}
772  mysql_errno: Tmysql_errno; {mysql 3.2}
773  mysql_error: Tmysql_error; {mysql 3.2}
774  mysql_escape_string: Tmysql_escape_string; {mysql 3.2} {deprecated for mysql_real_escape_string}
775  mysql_fetch_field: Tmysql_fetch_field; {mysql 3.2}
776  mysql_fetch_field_direct: Tmysql_fetch_field_direct; {mysql 3.2}
777  mysql_fetch_fields: Tmysql_fetch_fields; {mysql 3.2}
778  mysql_fetch_lengths: Tmysql_fetch_lengths; {mysql 3.2}
779  mysql_fetch_row: Tmysql_fetch_row; {mysql 3.2}
780  mysql_field_seek: Tmysql_field_seek; {mysql 3.2}
781  mysql_field_tell: Tmysql_field_tell; {mysql 3.2}
782  mysql_free_result: Tmysql_free_result; {mysql 3.2}
783  mysql_get_client_info: Tmysql_get_client_info; {mysql 3.2}
784  mysql_get_host_info: Tmysql_get_host_info; {mysql 3.2}
785  mysql_get_proto_info: Tmysql_get_proto_info; {mysql 3.2}
786  mysql_get_server_info: Tmysql_get_server_info; {mysql 3.2}
787  mysql_info: Tmysql_info; {mysql 3.2}
788  mysql_init: Tmysql_init; {mysql 3.2}
789  mysql_library_end: Tmysql_library_end;
790  mysql_insert_id: Tmysql_insert_id; {mysql 3.2}
791  mysql_kill: Tmysql_kill; {mysql 3.2}
792  mysql_list_dbs: Tmysql_list_dbs; {mysql 3.2}
793  mysql_list_fields: Tmysql_list_fields; {mysql 3.2}
794  mysql_list_processes: Tmysql_list_processes; {mysql 3.2}
795  mysql_list_tables: Tmysql_list_tables; {mysql 3.2}
796  mysql_num_fields: Tmysql_num_fields; {mysql 3.2}
797  mysql_num_rows: Tmysql_num_rows; {mysql 3.2}
798  mysql_options: Tmysql_options; {mysql 3.2}
799  mysql_ping: Tmysql_ping; {mysql 3.2}
800  mysql_query: Tmysql_query; {mysql 3.2} {deprecated for mysql_real_query}
801  mysql_real_connect: Tmysql_real_connect; {mysql 3.2}
802  mysql_real_escape_string: Tmysql_real_escape_string; {mysql 3.2}
803  mysql_real_query: Tmysql_real_query; {mysql 3.2}
804  mysql_refresh: Tmysql_refresh; {mysql 3.2}
805  mysql_row_seek: Tmysql_row_seek; {mysql 3.2}
806  mysql_row_tell: Tmysql_row_tell; {mysql 3.2}
807  mysql_select_db: Tmysql_select_db; {mysql 3.2}
808  mysql_shutdown: Tmysql_shutdown; {mysql 3.2} {new argument 4.1}
809  mysql_ssl_set: Tmysql_ssl_set; {mysql 3.2}
810  mysql_stat: Tmysql_stat; {mysql 3.2}
811  mysql_store_result: Tmysql_store_result; {mysql 3.2}
812  mysql_thread_id: Tmysql_thread_id; {mysql 3.2}
813  mysql_use_result: Tmysql_use_result; {mysql 3.2}
814 
815  {API for THREADED FUNCTIONS }
816  my_init: Tmy_init; {mysql 3.2}
817  mysql_thread_init: Tmysql_thread_init; {mysql 3.2}
818  mysql_thread_end: Tmysql_thread_end; {mysql 3.2}
819  mysql_thread_safe: tmysql_thread_safe; {mysql 3.2}
820 
821  {API for EMBEDDED SERVER }
822  mysql_server_init: Tmysql_server_init; {mysql 3.2}
823  mysql_server_end: Tmysql_server_end; {mysql 3.2}
824 
825  mysql_change_user: Tmysql_change_user; {mysql 3.23}
826  mysql_field_count: Tmysql_field_count; {mysql 3.22}
827 
828  mysql_get_client_version: Tmysql_get_client_version; {mysql 4.0}
829 
830  mysql_send_query: Tmysql_send_query;
831  mysql_read_query_result: Tmysql_read_query_result;
832 
833  mysql_autocommit: Tmysql_autocommit; {mysql 4.1}
834  mysql_commit: Tmysql_commit; {mysql 4.1}
835  mysql_get_server_version: Tmysql_get_server_version; {mysql 4.1}
836  mysql_hex_string: Tmysql_hex_string; {mysql 4.1.8}
837  mysql_more_results: Tmysql_more_results; {mysql 4.1}
838  mysql_next_result: Tmysql_next_result; {mysql 4.1}
839  mysql_rollback: Tmysql_rollback; {mysql 4.1}
840  mysql_set_character_set: Tmysql_set_character_set; {mysql 4.1.13}
841  mysql_set_server_option: Tmysql_set_server_option; {mysql 4.1}
842  mysql_sqlstate: Tmysql_sqlstate; {mysql 4.1}
843  mysql_warning_count: Tmysql_warning_count; {mysql 4.1}
844  {API for PREPARED STATEMENTS}
845  mysql_stmt_affected_rows: Tmysql_stmt_affected_rows; {mysql 4.1.0}
846  mysql_stmt_attr_get: Tmysql_stmt_attr_get; {mysql 4.1.2}
847  mysql_stmt_attr_set517UP: Tmysql_stmt_attr_set517Up; //uses mybool
848  mysql_stmt_attr_set: Tmysql_stmt_attr_set; {mysql 4.1.2} {augmented 5.0.2/6} //uses ulong
849  mysql_stmt_bind_param: Tmysql_stmt_bind_param; {mysql 4.1.2}
850  mysql_stmt_bind_result: Tmysql_stmt_bind_result; {mysql 4.1.2}
851  mysql_stmt_close: Tmysql_stmt_close; {mysql 4.1.0}
852  mysql_stmt_data_seek: Tmysql_stmt_data_seek; {mysql 4.1.1}
853  mysql_stmt_errno: Tmysql_stmt_errno; {mysql 4.1.0}
854  mysql_stmt_error: Tmysql_stmt_error; {mysql 4.1.0}
855  mysql_stmt_execute: Tmysql_stmt_execute; {mysql 4.1.2}
856  mysql_stmt_fetch: Tmysql_stmt_fetch; {mysql 4.1.2}
857  mysql_stmt_fetch_column: Tmysql_stmt_fetch_column; {mysql 4.1.2}
858  mysql_stmt_field_count: Tmysql_stmt_field_count; {mysql 4.1.3}
859  mysql_stmt_free_result: Tmysql_stmt_free_result; {mysql 4.1.1}
860  mysql_stmt_init: Tmysql_stmt_init; {mysql 4.1.2}
861  mysql_stmt_insert_id: Tmysql_stmt_insert_id; {mysql 4.1.2}
862  mysql_stmt_next_result: Tmysql_stmt_next_result; {mysql 5.5.3}
863  mysql_stmt_num_rows: Tmysql_stmt_num_rows; {mysql 4.1.1}
864  mysql_stmt_param_count: Tmysql_stmt_param_count; {mysql 4.1.2}
865  mysql_stmt_param_metadata: Tmysql_stmt_param_metadata; {mysql 4.1.2}
866  mysql_stmt_prepare: Tmysql_stmt_prepare; {mysql 4.1.2}
867  mysql_stmt_reset: Tmysql_stmt_reset; {mysql 4.1.1}
868  mysql_stmt_result_metadata: Tmysql_stmt_result_metadata; {mysql 4.1.2}
869  mysql_stmt_row_seek: Tmysql_stmt_row_seek; {mysql 4.1.1}
870  mysql_stmt_row_tell: Tmysql_stmt_row_tell; {mysql 4.1.1}
871  mysql_stmt_send_long_data: Tmysql_stmt_send_long_data; {mysql 4.1.2}
872  mysql_stmt_sqlstate: Tmysql_stmt_sqlstate; {mysql 4.1.1}
873  mysql_stmt_store_result: Tmysql_stmt_store_result; {mysql 4.1.0}
874 
875  mysql_get_character_set_info: Tmysql_get_character_set_info; {mysql 5.0.10}
876 end;
877 
878 const
879  EMBEDDED_DEFAULT_DATA_DIR = {$IFDEF WIN32}
880  '.\data\'
881  {$ELSE} './data/'
882  {$ENDIF};
883  SERVER_ARGUMENTS_KEY_PREFIX = 'ServerArgument';
884  SERVER_GROUPS : array [0..2] of PAnsiChar = ('embedded'#0, 'server'#0, nil);
885 
886  DEFAULT_PARAMS : array [0..2] of PAnsiChar = ('not_used'#0,
887  '--datadir='+EMBEDDED_DEFAULT_DATA_DIR+#0,
888  '--set-variable=key_buffer_size=32M'#0);
889 
890 const
891  MaxBlobSize = 1000000;
892 
893 implementation
894 
895 
896 end.