|
@@ -2,9 +2,11 @@ unit mysql_com;
|
|
|
|
|
|
interface
|
|
|
|
|
|
-{$linklib mysqlclient}
|
|
|
-{$linklib m}
|
|
|
-{$linklib c}
|
|
|
+{$ifndef win32}
|
|
|
+ {$linklib mysqlclient}
|
|
|
+ {$linklib m}
|
|
|
+ {$linklib c}
|
|
|
+{$endif}
|
|
|
|
|
|
{
|
|
|
Common definition between mysql server & client
|
|
@@ -12,56 +14,56 @@ interface
|
|
|
|
|
|
{$packrecords 4}
|
|
|
{ Extra types introduced for pascal }
|
|
|
-Type
|
|
|
+Type
|
|
|
pbyte = ^byte;
|
|
|
pcardinal = ^cardinal;
|
|
|
Socket = longint;
|
|
|
my_bool = byte;
|
|
|
|
|
|
Const
|
|
|
- NAME_LEN = 64 ; { Field/table name length }
|
|
|
+ NAME_LEN = 64 ; { Field/table name length }
|
|
|
LOCAL_HOST : pchar = 'localhost' ;
|
|
|
|
|
|
- MYSQL_PORT = 3306; { Alloced by ISI for MySQL }
|
|
|
+ MYSQL_PORT = 3306; { Alloced by ISI for MySQL }
|
|
|
MYSQL_UNIX_ADDR : pchar = '/tmp/mysql.sock';
|
|
|
|
|
|
Type
|
|
|
enum_server_command = ( COM_SLEEP,COM_QUIT,COM_INIT_DB,COM_QUERY,
|
|
|
- COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,COM_REFRESH,
|
|
|
- COM_SHUTDOWN,COM_STATISTICS,
|
|
|
- COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
|
|
|
- COM_DEBUG);
|
|
|
+ COM_FIELD_LIST,COM_CREATE_DB,COM_DROP_DB,COM_REFRESH,
|
|
|
+ COM_SHUTDOWN,COM_STATISTICS,
|
|
|
+ COM_PROCESS_INFO,COM_CONNECT,COM_PROCESS_KILL,
|
|
|
+ COM_DEBUG);
|
|
|
|
|
|
Const
|
|
|
- NOT_NULL_FLAG = 1; { Field can't be NULL }
|
|
|
- PRI_KEY_FLAG = 2; { Field is part of a primary key }
|
|
|
- UNIQUE_KEY_FLAG = 4; { Field is part of a unique key }
|
|
|
- MULTIPLE_KEY_FLAG = 8; { Field is part of a key }
|
|
|
- BLOB_FLAG = 16; { Field is a blob }
|
|
|
- UNSIGNED_FLAG = 32; { Field is unsigned }
|
|
|
- ZEROFILL_FLAG = 64; { Field is zerofill }
|
|
|
- BINARY_FLAG = 128;
|
|
|
+ NOT_NULL_FLAG = 1; { Field can't be NULL }
|
|
|
+ PRI_KEY_FLAG = 2; { Field is part of a primary key }
|
|
|
+ UNIQUE_KEY_FLAG = 4; { Field is part of a unique key }
|
|
|
+ MULTIPLE_KEY_FLAG = 8; { Field is part of a key }
|
|
|
+ BLOB_FLAG = 16; { Field is a blob }
|
|
|
+ UNSIGNED_FLAG = 32; { Field is unsigned }
|
|
|
+ ZEROFILL_FLAG = 64; { Field is zerofill }
|
|
|
+ BINARY_FLAG = 128;
|
|
|
{ The following are only sent to new clients }
|
|
|
- ENUM_FLAG = 256; { field is an enum }
|
|
|
- AUTO_INCREMENT_FLAG = 512; { field is a autoincrement field }
|
|
|
- TIMESTAMP_FLAG = 1024; { Field is a timestamp }
|
|
|
- PART_KEY_FLAG = 16384; { Intern; Part of some key }
|
|
|
- GROUP_FLAG = 32768; { Intern group field }
|
|
|
+ ENUM_FLAG = 256; { field is an enum }
|
|
|
+ AUTO_INCREMENT_FLAG = 512; { field is a autoincrement field }
|
|
|
+ TIMESTAMP_FLAG = 1024; { Field is a timestamp }
|
|
|
+ PART_KEY_FLAG = 16384; { Intern; Part of some key }
|
|
|
+ GROUP_FLAG = 32768; { Intern group field }
|
|
|
|
|
|
- REFRESH_GRANT = 1; { Refresh grant tables }
|
|
|
- REFRESH_LOG = 2; { Start on new log file }
|
|
|
- REFRESH_TABLES = 4; { close all tables }
|
|
|
+ REFRESH_GRANT = 1; { Refresh grant tables }
|
|
|
+ REFRESH_LOG = 2; { Start on new log file }
|
|
|
+ REFRESH_TABLES = 4; { close all tables }
|
|
|
|
|
|
- CLIENT_LONG_PASSWORD = 1; { new more secure passwords }
|
|
|
- CLIENT_FOUND_ROWS = 2; { Found instead of affected rows }
|
|
|
- CLIENT_LONG_FLAG = 4; { Get all column flags }
|
|
|
+ CLIENT_LONG_PASSWORD = 1; { new more secure passwords }
|
|
|
+ CLIENT_FOUND_ROWS = 2; { Found instead of affected rows }
|
|
|
+ CLIENT_LONG_FLAG = 4; { Get all column flags }
|
|
|
|
|
|
Type
|
|
|
pst_used_mem = ^st_used_mem;
|
|
|
-st_used_mem = record { struct for once_alloc }
|
|
|
- next : pst_used_mem; { Next block in use }
|
|
|
- left : cardinal; { memory left in block }
|
|
|
- size : cardinal; { size of block }
|
|
|
+st_used_mem = record { struct for once_alloc }
|
|
|
+ next : pst_used_mem; { Next block in use }
|
|
|
+ left : cardinal; { memory left in block }
|
|
|
+ size : cardinal; { size of block }
|
|
|
end;
|
|
|
|
|
|
TUSED_MEM = st_used_mem;
|
|
@@ -106,24 +108,24 @@ Const
|
|
|
|
|
|
Type
|
|
|
enum_field_types = ( FIELD_TYPE_DECIMAL, FIELD_TYPE_TINY,
|
|
|
- FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
|
|
|
- FIELD_TYPE_FLOAT, FIELD_TYPE_DOUBLE,
|
|
|
- FIELD_TYPE_NULL, FIELD_TYPE_TIMESTAMP,
|
|
|
- FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
|
|
|
- FIELD_TYPE_DATE, FIELD_TYPE_TIME,
|
|
|
- FIELD_TYPE_DATETIME,
|
|
|
- FIELD_TYPE_ENUM := 247,
|
|
|
- FIELD_TYPE_SET := 248,
|
|
|
- FIELD_TYPE_TINY_BLOB := 249,
|
|
|
- FIELD_TYPE_MEDIUM_BLOB := 250,
|
|
|
- FIELD_TYPE_LONG_BLOB :=251,
|
|
|
- FIELD_TYPE_BLOB :=252,
|
|
|
- FIELD_TYPE_VAR_STRING :=253,
|
|
|
- FIELD_TYPE_STRING:=254);
|
|
|
+ FIELD_TYPE_SHORT, FIELD_TYPE_LONG,
|
|
|
+ FIELD_TYPE_FLOAT, FIELD_TYPE_DOUBLE,
|
|
|
+ FIELD_TYPE_NULL, FIELD_TYPE_TIMESTAMP,
|
|
|
+ FIELD_TYPE_LONGLONG,FIELD_TYPE_INT24,
|
|
|
+ FIELD_TYPE_DATE, FIELD_TYPE_TIME,
|
|
|
+ FIELD_TYPE_DATETIME,
|
|
|
+ FIELD_TYPE_ENUM := 247,
|
|
|
+ FIELD_TYPE_SET := 248,
|
|
|
+ FIELD_TYPE_TINY_BLOB := 249,
|
|
|
+ FIELD_TYPE_MEDIUM_BLOB := 250,
|
|
|
+ FIELD_TYPE_LONG_BLOB :=251,
|
|
|
+ FIELD_TYPE_BLOB :=252,
|
|
|
+ FIELD_TYPE_VAR_STRING :=253,
|
|
|
+ FIELD_TYPE_STRING:=254);
|
|
|
|
|
|
Const
|
|
|
-FIELD_TYPE_CHAR = FIELD_TYPE_TINY; { For compability }
|
|
|
-FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM; { For compability }
|
|
|
+FIELD_TYPE_CHAR = FIELD_TYPE_TINY; { For compability }
|
|
|
+FIELD_TYPE_INTERVAL = FIELD_TYPE_ENUM; { For compability }
|
|
|
|
|
|
Procedure sql_free (root : PMEM_ROOT);{$ifdef win32} stdcall {$else} cdecl {$endif};
|
|
|
Procedure init_alloc_root (root: PMEM_ROOT;block_size : Cardinal);{$ifdef win32} stdcall {$else} cdecl {$endif};
|
|
@@ -162,10 +164,10 @@ PRand_struct = ^TRand_struct;
|
|
|
Item_result = (STRING_RESULT,REAL_RESULT,INT_RESULT);
|
|
|
|
|
|
st_udf_args = record
|
|
|
- arg_count : cardinal; { Number of arguments }
|
|
|
- arg_type : ^Item_result; { Pointer to item_results }
|
|
|
- args : ppchar; { Pointer to argument }
|
|
|
- lengths : PCardinal; { Length of string arguments }
|
|
|
+ arg_count : cardinal; { Number of arguments }
|
|
|
+ arg_type : ^Item_result; { Pointer to item_results }
|
|
|
+ args : ppchar; { Pointer to argument }
|
|
|
+ lengths : PCardinal; { Length of string arguments }
|
|
|
end;
|
|
|
TUDF_ARGS = st_udf_args;
|
|
|
PUDPF_ARGS = ^TUDF_ARGS;
|
|
@@ -173,10 +175,10 @@ PUDPF_ARGS = ^TUDF_ARGS;
|
|
|
{ This holds information about the result }
|
|
|
|
|
|
st_udf_init = record
|
|
|
- maybe_null : my_bool; { 1 if function can return NULL }
|
|
|
- decimals : cardinal; { for real functions }
|
|
|
- max_length : Cardinal; { For string functions }
|
|
|
- ptr : PChar; { free pointer for function data }
|
|
|
+ maybe_null : my_bool; { 1 if function can return NULL }
|
|
|
+ decimals : cardinal; { for real functions }
|
|
|
+ max_length : Cardinal; { For string functions }
|
|
|
+ ptr : PChar; { free pointer for function data }
|
|
|
end;
|
|
|
TUDF_INIT = st_udf_init;
|
|
|
PUDF_INIT = TUDF_INIT;
|
|
@@ -221,7 +223,10 @@ function get_tty_password(opt_message: pchar) : pchar;{$ifdef win32} stdcall {
|
|
|
|
|
|
end.
|
|
|
$Log$
|
|
|
- Revision 1.4 2001-03-13 08:50:38 michael
|
|
|
+ Revision 1.5 2001-04-13 18:04:56 peter
|
|
|
+ * added missing $ifndef win32
|
|
|
+
|
|
|
+ Revision 1.4 2001/03/13 08:50:38 michael
|
|
|
+ merged Fixed calling convention for win32
|
|
|
|
|
|
Revision 1.3 2000/12/02 15:24:37 michael
|
|
@@ -229,5 +234,5 @@ end.
|
|
|
|
|
|
Revision 1.2 2000/07/13 11:33:26 michael
|
|
|
+ removed logs
|
|
|
-
|
|
|
+
|
|
|
}
|