See note on MYSQL_OPT_RECONNECT on:
http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
http://dev.mysql.com/doc/refman/5.1/en/ ... tions.html
Code: Select all
Index: ZDbcMySql.pas
===================================================================
--- ZDbcMySql.pas (revision 879)
+++ ZDbcMySql.pas (working copy)
@@ -356,6 +356,7 @@
sMyOpt: string;
my_client_Opt:TMYSQL_CLIENT_OPTIONS;
sMy_client_Opt:String;
+ ClientVersion: Integer;
begin
if not Closed then
Exit;
@@ -461,6 +462,15 @@
end;
DriverManager.LogMessage(lcConnect, FPlainDriver.GetProtocol, LogMessage);
+ { Fix Bugs in certain Versions where real_conncet resets the Reconnect flag }
+ if StrToBoolEx(Info.Values['MYSQL_OPT_RECONNECT']) then
+ begin
+ ClientVersion := FPlainDriver.GetClientVersion;
+ if ((ClientVersion>=50013) and (ClientVersion<50019)) or
+ ((ClientVersion>=50100) and (ClientVersion<50106)) then
+ FPlainDriver.SetOptions(FHandle, MYSQL_OPT_RECONNECT, 'true');
+ end;
+
{ Sets a client codepage. }
if FClientCodePage <> '' then
begin