mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
* Merged Andrew Brunners and Lacak2's patches from Mantis #19736 that
implement mysql 5.5 header + sqldb connection support. git-svn-id: trunk@20534 -
This commit is contained in:
parent
e27f910070
commit
2d8dbeca54
3
.gitattributes
vendored
3
.gitattributes
vendored
@ -1977,6 +1977,7 @@ packages/fcl-db/src/sqldb/mysql/mysql41conn.pas svneol=native#text/plain
|
|||||||
packages/fcl-db/src/sqldb/mysql/mysql4conn.pas svneol=native#text/plain
|
packages/fcl-db/src/sqldb/mysql/mysql4conn.pas svneol=native#text/plain
|
||||||
packages/fcl-db/src/sqldb/mysql/mysql50conn.pas svneol=native#text/plain
|
packages/fcl-db/src/sqldb/mysql/mysql50conn.pas svneol=native#text/plain
|
||||||
packages/fcl-db/src/sqldb/mysql/mysql51conn.pas svneol=native#text/plain
|
packages/fcl-db/src/sqldb/mysql/mysql51conn.pas svneol=native#text/plain
|
||||||
|
packages/fcl-db/src/sqldb/mysql/mysql55conn.pas svneol=native#text/plain
|
||||||
packages/fcl-db/src/sqldb/mysql/mysqlconn.inc svneol=native#text/plain
|
packages/fcl-db/src/sqldb/mysql/mysqlconn.inc svneol=native#text/plain
|
||||||
packages/fcl-db/src/sqldb/odbc/Makefile svneol=native#text/plain
|
packages/fcl-db/src/sqldb/odbc/Makefile svneol=native#text/plain
|
||||||
packages/fcl-db/src/sqldb/odbc/Makefile.fpc svneol=native#text/plain
|
packages/fcl-db/src/sqldb/odbc/Makefile.fpc svneol=native#text/plain
|
||||||
@ -5129,6 +5130,8 @@ packages/mysql/src/mysql50dyn.pp svneol=native#text/plain
|
|||||||
packages/mysql/src/mysql51.pp svneol=native#text/plain
|
packages/mysql/src/mysql51.pp svneol=native#text/plain
|
||||||
packages/mysql/src/mysql51dyn.pp svneol=native#text/plain
|
packages/mysql/src/mysql51dyn.pp svneol=native#text/plain
|
||||||
packages/mysql/src/mysql51emb.pp svneol=native#text/plain
|
packages/mysql/src/mysql51emb.pp svneol=native#text/plain
|
||||||
|
packages/mysql/src/mysql55.pp svneol=native#text/plain
|
||||||
|
packages/mysql/src/mysql55dyn.pp svneol=native#text/plain
|
||||||
packages/ncurses/Makefile svneol=native#text/plain
|
packages/ncurses/Makefile svneol=native#text/plain
|
||||||
packages/ncurses/Makefile.fpc svneol=native#text/plain
|
packages/ncurses/Makefile.fpc svneol=native#text/plain
|
||||||
packages/ncurses/Makefile.fpc.fpcmake svneol=native#text/plain
|
packages/ncurses/Makefile.fpc.fpcmake svneol=native#text/plain
|
||||||
|
@ -596,6 +596,17 @@ begin
|
|||||||
AddUnit('dbconst');
|
AddUnit('dbconst');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
T:=P.Targets.AddUnit('mysql55conn.pas', SqldbConnectionOSes);
|
||||||
|
T.ResourceStrings:=true;
|
||||||
|
with T.Dependencies do
|
||||||
|
begin
|
||||||
|
AddInclude('mysqlconn.inc');
|
||||||
|
AddUnit('bufdataset');
|
||||||
|
AddUnit('sqldb');
|
||||||
|
AddUnit('db');
|
||||||
|
AddUnit('dbconst');
|
||||||
|
end;
|
||||||
|
|
||||||
T:=P.Targets.AddUnit('odbcconn.pas', SqldbConnectionOSes);
|
T:=P.Targets.AddUnit('odbcconn.pas', SqldbConnectionOSes);
|
||||||
with T.Dependencies do
|
with T.Dependencies do
|
||||||
begin
|
begin
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -6,8 +6,8 @@
|
|||||||
main=fcl-db
|
main=fcl-db
|
||||||
|
|
||||||
[target]
|
[target]
|
||||||
units=mysql40conn mysql41conn mysql50conn mysql4conn mysql51conn
|
units=mysql40conn mysql41conn mysql50conn mysql4conn mysql51conn mysql55conn
|
||||||
rsts=mysql40conn mysql41conn mysql50conn mysql4conn mysql51conn
|
rsts=mysql40conn mysql41conn mysql50conn mysql4conn mysql51conn mysql55conn
|
||||||
[require]
|
[require]
|
||||||
packages=fcl-xml mysql
|
packages=fcl-xml mysql
|
||||||
|
|
||||||
|
13
packages/fcl-db/src/sqldb/mysql/mysql55conn.pas
Normal file
13
packages/fcl-db/src/sqldb/mysql/mysql55conn.pas
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
Contains the TMysqlConnection for MySQL 5.5
|
||||||
|
}
|
||||||
|
|
||||||
|
unit mysql55conn;
|
||||||
|
|
||||||
|
{$DEFINE MYSQL50_UP}
|
||||||
|
{$DEFINE MYSQL51_UP}
|
||||||
|
{$DEFINE MYSQL55}
|
||||||
|
|
||||||
|
{$i mysqlconn.inc}
|
||||||
|
|
||||||
|
end.
|
@ -5,7 +5,10 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils,bufdataset,sqldb,db,dynlibs,ctypes,
|
Classes, SysUtils,bufdataset,sqldb,db,dynlibs,ctypes,
|
||||||
{$IFDEF Mysql51}
|
{$IFDEF mysql55}
|
||||||
|
mysql55dyn;
|
||||||
|
{$ELSE}
|
||||||
|
{$IFDEF mysql51}
|
||||||
mysql51dyn;
|
mysql51dyn;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
{$IfDef mysql50}
|
{$IfDef mysql50}
|
||||||
@ -22,9 +25,13 @@ uses
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
Const
|
Const
|
||||||
{$IFDEF Mysql51}
|
{$IFDEF mysql55}
|
||||||
|
MySQLVersion = '5.5';
|
||||||
|
{$else}
|
||||||
|
{$IFDEF mysql51}
|
||||||
MySQLVersion = '5.1';
|
MySQLVersion = '5.1';
|
||||||
{$else}
|
{$else}
|
||||||
{$IfDef mysql50}
|
{$IfDef mysql50}
|
||||||
@ -41,7 +48,7 @@ Const
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$endif}
|
||||||
Type
|
Type
|
||||||
TTransactionName = Class(TSQLHandle)
|
TTransactionName = Class(TSQLHandle)
|
||||||
protected
|
protected
|
||||||
@ -140,7 +147,12 @@ Type
|
|||||||
|
|
||||||
|
|
||||||
EMySQLError = Class(Exception);
|
EMySQLError = Class(Exception);
|
||||||
|
{$ifdef mysql55}
|
||||||
|
TMySQL55Connection = Class(TConnectionName);
|
||||||
|
TMySQL55ConnectionDef = Class(TMySQLConnectionDef);
|
||||||
|
TMySQL55Transaction = Class(TTransactionName);
|
||||||
|
TMySQL55Cursor = Class(TCursorName);
|
||||||
|
{$else}
|
||||||
{$IfDef mysql51}
|
{$IfDef mysql51}
|
||||||
TMySQL51Connection = Class(TConnectionName);
|
TMySQL51Connection = Class(TConnectionName);
|
||||||
TMySQL51ConnectionDef = Class(TMySQLConnectionDef);
|
TMySQL51ConnectionDef = Class(TMySQLConnectionDef);
|
||||||
@ -171,6 +183,7 @@ Type
|
|||||||
TMySQL40Cursor = Class(TCursorName);
|
TMySQL40Cursor = Class(TCursorName);
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
|
{$endif}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -195,6 +208,12 @@ const
|
|||||||
'MYSQL_SECURE_AUTH'
|
'MYSQL_SECURE_AUTH'
|
||||||
{$IFDEF MYSQL50_UP}
|
{$IFDEF MYSQL50_UP}
|
||||||
,'MYSQL_REPORT_DATA_TRUNCATION', 'MYSQL_OPT_RECONNECT'
|
,'MYSQL_REPORT_DATA_TRUNCATION', 'MYSQL_OPT_RECONNECT'
|
||||||
|
{$IFDEF mysql51_UP}
|
||||||
|
,'MYSQL_OPT_SSL_VERIFY_SERVER_CERT'
|
||||||
|
{$IFDEF mysql55}
|
||||||
|
,'MYSQL_PLUGIN_DIR', 'MYSQL_DEFAULT_AUTH'
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -436,6 +455,9 @@ end;
|
|||||||
|
|
||||||
function TConnectionName.AllocateCursorHandle: TSQLCursor;
|
function TConnectionName.AllocateCursorHandle: TSQLCursor;
|
||||||
begin
|
begin
|
||||||
|
{$IfDef mysql55}
|
||||||
|
Result:=TMySQL55Cursor.Create;
|
||||||
|
{$ELSE}
|
||||||
{$IfDef mysql51}
|
{$IfDef mysql51}
|
||||||
Result:=TMySQL51Cursor.Create;
|
Result:=TMySQL51Cursor.Create;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -453,6 +475,7 @@ begin
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TConnectionName.DeAllocateCursorHandle(var cursor : TSQLCursor);
|
Procedure TConnectionName.DeAllocateCursorHandle(var cursor : TSQLCursor);
|
||||||
@ -1115,6 +1138,9 @@ end;
|
|||||||
|
|
||||||
class function TMySQLConnectionDef.ConnectionClass: TSQLConnectionClass;
|
class function TMySQLConnectionDef.ConnectionClass: TSQLConnectionClass;
|
||||||
begin
|
begin
|
||||||
|
{$IfDef mysql55}
|
||||||
|
Result:=TMySQL55Connection;
|
||||||
|
{$ELSE}
|
||||||
{$IfDef mysql51}
|
{$IfDef mysql51}
|
||||||
Result:=TMySQL51Connection;
|
Result:=TMySQL51Connection;
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -1132,6 +1158,7 @@ begin
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TMySQLConnectionDef.Description: String;
|
class function TMySQLConnectionDef.Description: String;
|
||||||
@ -1139,6 +1166,12 @@ begin
|
|||||||
Result:='Connect to a MySQL '+MySQLVersion+'database directly via the client library';
|
Result:='Connect to a MySQL '+MySQLVersion+'database directly via the client library';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IfDef mysql55}
|
||||||
|
initialization
|
||||||
|
RegisterConnection(TMySQL55ConnectionDef);
|
||||||
|
finalization
|
||||||
|
UnRegisterConnection(TMySQL55ConnectionDef);
|
||||||
|
{$else}
|
||||||
{$IfDef mysql51}
|
{$IfDef mysql51}
|
||||||
initialization
|
initialization
|
||||||
RegisterConnection(TMySQL51ConnectionDef);
|
RegisterConnection(TMySQL51ConnectionDef);
|
||||||
@ -1171,5 +1204,6 @@ end;
|
|||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$EndIf}
|
{$EndIf}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
@ -121,6 +121,16 @@ begin
|
|||||||
begin
|
begin
|
||||||
AddInclude('mysql.inc');
|
AddInclude('mysql.inc');
|
||||||
end;
|
end;
|
||||||
|
T:=P.Targets.AddUnit('mysql55.pp');
|
||||||
|
with T.Dependencies do
|
||||||
|
begin
|
||||||
|
AddInclude('mysql.inc');
|
||||||
|
end;
|
||||||
|
T:=P.Targets.AddUnit('mysql55dyn.pp');
|
||||||
|
with T.Dependencies do
|
||||||
|
begin
|
||||||
|
AddInclude('mysql.inc');
|
||||||
|
end;
|
||||||
T.ResourceStrings := True;
|
T.ResourceStrings := True;
|
||||||
|
|
||||||
P.ExamplePath.Add('examples');
|
P.ExamplePath.Add('examples');
|
||||||
|
@ -31,7 +31,9 @@ uses
|
|||||||
{$DEFINE extdecl:=cdecl}
|
{$DEFINE extdecl:=cdecl}
|
||||||
const
|
const
|
||||||
mysqllib = 'libmysqlclient.'+sharedsuffix;
|
mysqllib = 'libmysqlclient.'+sharedsuffix;
|
||||||
{$IF DEFINED(mysql51)}
|
{$IF DEFINED(mysql55)}
|
||||||
|
mysqlvlib = mysqllib+'.18';
|
||||||
|
{$ELSEIF DEFINED(mysql51)}
|
||||||
mysqlvlib = mysqllib+'.16';
|
mysqlvlib = mysqllib+'.16';
|
||||||
{$ELSEIF DEFINED(mysql50)}
|
{$ELSEIF DEFINED(mysql50)}
|
||||||
mysqlvlib = mysqllib+'.15';
|
mysqlvlib = mysqllib+'.15';
|
||||||
@ -48,6 +50,10 @@ uses
|
|||||||
mysqlvlib = 'libmysql.dll';
|
mysqlvlib = 'libmysql.dll';
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
|
{$IFDEF mysql55}
|
||||||
|
{$DEFINE mysql51}
|
||||||
|
{$ENDIF mysql55}
|
||||||
|
|
||||||
{$IFDEF mysql51}
|
{$IFDEF mysql51}
|
||||||
{$DEFINE mysql50}
|
{$DEFINE mysql50}
|
||||||
{$ENDIF mysql51}
|
{$ENDIF mysql51}
|
||||||
@ -100,6 +106,7 @@ uses
|
|||||||
NAME_LEN = 64;
|
NAME_LEN = 64;
|
||||||
HOSTNAME_LENGTH = 60;
|
HOSTNAME_LENGTH = 60;
|
||||||
USERNAME_LENGTH = 16;
|
USERNAME_LENGTH = 16;
|
||||||
|
MYSQL_AUTODETECT_CHARSET_NAME = 'auto';
|
||||||
SERVER_VERSION_LENGTH = 60;
|
SERVER_VERSION_LENGTH = 60;
|
||||||
SQLSTATE_LENGTH = 5;
|
SQLSTATE_LENGTH = 5;
|
||||||
LOCAL_HOST = 'localhost';
|
LOCAL_HOST = 'localhost';
|
||||||
@ -180,6 +187,12 @@ uses
|
|||||||
REFRESH_THREADS = 32; // Flush thread cache
|
REFRESH_THREADS = 32; // Flush thread cache
|
||||||
REFRESH_SLAVE = 64; // Reset master info and restart slave thread
|
REFRESH_SLAVE = 64; // Reset master info and restart slave thread
|
||||||
REFRESH_MASTER = 128; // Remove all bin logs in the index and truncate the index
|
REFRESH_MASTER = 128; // Remove all bin logs in the index and truncate the index
|
||||||
|
REFRESH_ERROR_LOG = 256; // Rotate only the erorr log
|
||||||
|
REFRESH_ENGINE_LOG = 512; // Flush all storage engine logs
|
||||||
|
REFRESH_BINARY_LOG = 1024; // Flush the binary log
|
||||||
|
REFRESH_RELAY_LOG = 2048; // Flush the relay log
|
||||||
|
REFRESH_GENERAL_LOG = 4096; // Flush the general log
|
||||||
|
REFRESH_SLOW_LOG = 8192; // Flush the slow query log
|
||||||
|
|
||||||
{ The following can't be set with mysql_refresh() }
|
{ The following can't be set with mysql_refresh() }
|
||||||
REFRESH_READ_LOCK = 16384; // Lock tables for read
|
REFRESH_READ_LOCK = 16384; // Lock tables for read
|
||||||
@ -208,10 +221,16 @@ uses
|
|||||||
CLIENT_SECURE_CONNECTION = 32768; // New 4.1 authentication
|
CLIENT_SECURE_CONNECTION = 32768; // New 4.1 authentication
|
||||||
CLIENT_MULTI_STATEMENTS = 65536; // Enable/disable multi-stmt support
|
CLIENT_MULTI_STATEMENTS = 65536; // Enable/disable multi-stmt support
|
||||||
CLIENT_MULTI_RESULTS = 131072; // Enable/disable multi-results
|
CLIENT_MULTI_RESULTS = 131072; // Enable/disable multi-results
|
||||||
|
CLIENT_PS_MULTI_RESULTS : cardinal = 1 shl 18; // Multi-results in PS-protocol
|
||||||
|
CLIENT_PLUGIN_AUTH : cardinal = 1 shl 19; // Client supports plugin authentication
|
||||||
|
CLIENT_SSL_VERIFY_SERVER_CERT : cardinal = 1 shl 30;
|
||||||
CLIENT_REMEMBER_OPTIONS : cardinal = 1 shl 31;
|
CLIENT_REMEMBER_OPTIONS : cardinal = 1 shl 31;
|
||||||
|
|
||||||
|
|
||||||
SERVER_STATUS_IN_TRANS = 1; // Transaction has started
|
SERVER_STATUS_IN_TRANS = 1; // Is raised when a multi-statement transaction
|
||||||
|
// has been started, either explicitly, by means
|
||||||
|
// of BEGIN or COMMIT AND CHAIN, or implicitly, by the first transactional
|
||||||
|
// statement, when autocommit=off
|
||||||
SERVER_STATUS_AUTOCOMMIT = 2; // Server in auto_commit mode
|
SERVER_STATUS_AUTOCOMMIT = 2; // Server in auto_commit mode
|
||||||
SERVER_STATUS_MORE_RESULTS = 4; // More results on server
|
SERVER_STATUS_MORE_RESULTS = 4; // More results on server
|
||||||
SERVER_MORE_RESULTS_EXISTS = 8; // Multi query - next query exists
|
SERVER_MORE_RESULTS_EXISTS = 8; // Multi query - next query exists
|
||||||
@ -238,6 +257,10 @@ uses
|
|||||||
}
|
}
|
||||||
SERVER_STATUS_METADATA_CHANGED = 1024;
|
SERVER_STATUS_METADATA_CHANGED = 1024;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
{$IFDEF mysql55}
|
||||||
|
SERVER_QUERY_WAS_SLOW = 2048;
|
||||||
|
SERVER_PS_OUT_PARAMS = 4096; // To mark ResultSet containing output parameter values.
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
{$IFDEF mysql41}
|
{$IFDEF mysql41}
|
||||||
MYSQL_ERRMSG_SIZE = 512;
|
MYSQL_ERRMSG_SIZE = 512;
|
||||||
@ -551,6 +574,7 @@ uses
|
|||||||
const
|
const
|
||||||
MYSQL_STMT_HEADER = 4;
|
MYSQL_STMT_HEADER = 4;
|
||||||
MYSQL_LONG_DATA_HEADER = 6;
|
MYSQL_LONG_DATA_HEADER = 6;
|
||||||
|
NOT_FIXED_DEC = 31;
|
||||||
|
|
||||||
{ ------------ Stop of declaration in "mysql_com.h" ----------------------- }
|
{ ------------ Stop of declaration in "mysql_com.h" ----------------------- }
|
||||||
|
|
||||||
@ -742,6 +766,12 @@ uses
|
|||||||
MYSQL_SECURE_AUTH
|
MYSQL_SECURE_AUTH
|
||||||
{$IFDEF MYSQL50}
|
{$IFDEF MYSQL50}
|
||||||
,MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT
|
,MYSQL_REPORT_DATA_TRUNCATION, MYSQL_OPT_RECONNECT
|
||||||
|
{$IFDEF mysql51}
|
||||||
|
,MYSQL_OPT_SSL_VERIFY_SERVER_CERT
|
||||||
|
{$IFDEF mysql55}
|
||||||
|
,MYSQL_PLUGIN_DIR, MYSQL_DEFAULT_AUTH
|
||||||
|
{$ENDIF}
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -765,6 +795,8 @@ uses
|
|||||||
DYNAMIC_ARRAY = st_dynamic_array;
|
DYNAMIC_ARRAY = st_dynamic_array;
|
||||||
Pst_dynamic_array = ^st_dynamic_array;
|
Pst_dynamic_array = ^st_dynamic_array;
|
||||||
|
|
||||||
|
st_mysql_options_extention = record end;
|
||||||
|
|
||||||
Pst_mysql_options = ^st_mysql_options;
|
Pst_mysql_options = ^st_mysql_options;
|
||||||
st_mysql_options = record
|
st_mysql_options = record
|
||||||
connect_timeout : cuint;
|
connect_timeout : cuint;
|
||||||
@ -832,6 +864,9 @@ uses
|
|||||||
local_infile_end : procedure (_para1:pointer);
|
local_infile_end : procedure (_para1:pointer);
|
||||||
local_infile_error : function (_para1:pointer; _para2:Pchar; _para3:cuint):cint;
|
local_infile_error : function (_para1:pointer; _para2:Pchar; _para3:cuint):cint;
|
||||||
local_infile_userdata : pointer;
|
local_infile_userdata : pointer;
|
||||||
|
{$IFDEF mysql51}
|
||||||
|
extension : ^st_mysql_options_extention;
|
||||||
|
{$ENDIF}
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1173,6 +1208,8 @@ uses
|
|||||||
PMYSQL_BIND = ^MYSQL_BIND;
|
PMYSQL_BIND = ^MYSQL_BIND;
|
||||||
|
|
||||||
{ statement handler }
|
{ statement handler }
|
||||||
|
st_mysql_stmt_extension = record end;
|
||||||
|
|
||||||
st_mysql_stmt = record
|
st_mysql_stmt = record
|
||||||
mem_root : MEM_ROOT; // root allocations
|
mem_root : MEM_ROOT; // root allocations
|
||||||
// list : LIST; // list to keep track of all stmts
|
// list : LIST; // list to keep track of all stmts
|
||||||
@ -1212,6 +1249,9 @@ uses
|
|||||||
{ Is set to true if we need to calculate field->max_length for
|
{ Is set to true if we need to calculate field->max_length for
|
||||||
metadata fields when doing mysql_stmt_store_result. }
|
metadata fields when doing mysql_stmt_store_result. }
|
||||||
update_max_length : my_bool;
|
update_max_length : my_bool;
|
||||||
|
{$IFDEF mysql51}
|
||||||
|
extension: ^st_mysql_stmt_extension;
|
||||||
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
MYSQL_STMT = st_mysql_stmt;
|
MYSQL_STMT = st_mysql_stmt;
|
||||||
{ When doing mysql_stmt_store_result calculate max_length attribute
|
{ When doing mysql_stmt_store_result calculate max_length attribute
|
||||||
@ -1450,6 +1490,7 @@ uses
|
|||||||
function mysql_autocommit(mysql:PMYSQL; auto_mode:my_bool):my_bool;extdecl;external mysqllib name 'mysql_autocommit';
|
function mysql_autocommit(mysql:PMYSQL; auto_mode:my_bool):my_bool;extdecl;external mysqllib name 'mysql_autocommit';
|
||||||
function mysql_more_results(mysql:PMYSQL):my_bool;extdecl;external mysqllib name 'mysql_more_results';
|
function mysql_more_results(mysql:PMYSQL):my_bool;extdecl;external mysqllib name 'mysql_more_results';
|
||||||
function mysql_next_result(mysql:PMYSQL):cint;extdecl;external mysqllib name 'mysql_next_result';
|
function mysql_next_result(mysql:PMYSQL):cint;extdecl;external mysqllib name 'mysql_next_result';
|
||||||
|
function mysql_stmt_next_result(stmt:PMYSQL_STMT):cint;extdecl;external mysqllib name 'mysql_stmt_next_result';
|
||||||
procedure mysql_close(sock:PMYSQL);extdecl;external mysqllib name 'mysql_close';
|
procedure mysql_close(sock:PMYSQL);extdecl;external mysqllib name 'mysql_close';
|
||||||
|
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
@ -1519,6 +1560,7 @@ uses
|
|||||||
mysql_stmt_affected_rows: function (stmt:PMYSQL_STMT):my_ulonglong;extdecl;
|
mysql_stmt_affected_rows: function (stmt:PMYSQL_STMT):my_ulonglong;extdecl;
|
||||||
mysql_stmt_insert_id: function (stmt:PMYSQL_STMT):my_ulonglong;extdecl;
|
mysql_stmt_insert_id: function (stmt:PMYSQL_STMT):my_ulonglong;extdecl;
|
||||||
mysql_stmt_field_count: function (stmt:PMYSQL_STMT):cuint;extdecl;
|
mysql_stmt_field_count: function (stmt:PMYSQL_STMT):cuint;extdecl;
|
||||||
|
mysql_stmt_next_result: function (stmt:PMYSQL_STMT):cint;extdecl;
|
||||||
|
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
|
|
||||||
@ -1686,6 +1728,7 @@ begin
|
|||||||
pointer(mysql_stmt_affected_rows) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_affected_rows');
|
pointer(mysql_stmt_affected_rows) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_affected_rows');
|
||||||
pointer(mysql_stmt_insert_id) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_insert_id');
|
pointer(mysql_stmt_insert_id) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_insert_id');
|
||||||
pointer(mysql_stmt_field_count) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_field_count');
|
pointer(mysql_stmt_field_count) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_field_count');
|
||||||
|
pointer(mysql_stmt_next_result) := GetProcedureAddress(MysqlLibraryHandle,'mysql_stmt_next_result');
|
||||||
|
|
||||||
if mysql_library_init(argc, argv, groups) <> 0 then
|
if mysql_library_init(argc, argv, groups) <> 0 then
|
||||||
Exit;
|
Exit;
|
||||||
@ -1768,7 +1811,9 @@ end;
|
|||||||
|
|
||||||
function IS_NUM(t : enum_field_types) : boolean;
|
function IS_NUM(t : enum_field_types) : boolean;
|
||||||
begin
|
begin
|
||||||
{$IF DEFINED(mysql50) or DEFINED(mysql51)}
|
{$IF DEFINED(mysql55)}
|
||||||
|
IS_NUM := ((t <= FIELD_TYPE_INT24) and (t<>FIELD_TYPE_TIMESTAMP)) or (t=FIELD_TYPE_YEAR) or (t=FIELD_TYPE_NEWDECIMAL);
|
||||||
|
{$ELSEIF DEFINED(mysql50) or DEFINED(mysql51)}
|
||||||
IS_NUM := (t <= FIELD_TYPE_INT24) or (t=FIELD_TYPE_YEAR) or (t=FIELD_TYPE_NEWDECIMAL);
|
IS_NUM := (t <= FIELD_TYPE_INT24) or (t=FIELD_TYPE_YEAR) or (t=FIELD_TYPE_NEWDECIMAL);
|
||||||
{$ELSE}
|
{$ELSE}
|
||||||
IS_NUM := (t <= FIELD_TYPE_INT24) or (t=FIELD_TYPE_YEAR);
|
IS_NUM := (t <= FIELD_TYPE_INT24) or (t=FIELD_TYPE_YEAR);
|
||||||
|
12
packages/mysql/src/mysql55.pp
Normal file
12
packages/mysql/src/mysql55.pp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
Contains the mysql calls for MySQL 5.5
|
||||||
|
}
|
||||||
|
|
||||||
|
unit mysql55;
|
||||||
|
|
||||||
|
{$UNDEF LinkDynamically}
|
||||||
|
{$DEFINE MYSQL55}
|
||||||
|
|
||||||
|
{$i mysql.inc}
|
||||||
|
|
||||||
|
end.
|
12
packages/mysql/src/mysql55dyn.pp
Normal file
12
packages/mysql/src/mysql55dyn.pp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
Contains the mysql calls for MySQL 5.5
|
||||||
|
}
|
||||||
|
|
||||||
|
unit mysql55dyn;
|
||||||
|
|
||||||
|
{$DEFINE LinkDynamically}
|
||||||
|
{$DEFINE MYSQL55}
|
||||||
|
|
||||||
|
{$i mysql.inc}
|
||||||
|
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user