diff --git a/src/dData.pas b/src/dData.pas index 9d72d27..d6913c9 100644 --- a/src/dData.pas +++ b/src/dData.pas @@ -165,7 +165,7 @@ type function GetMySQLLib : String; function GetDebugLevel : Integer; - procedure CreateDBConnections; + procedure CreateDBConnections(const SkipLibraryVersionCheck : Boolean = False); procedure CreateViews; procedure PrepareBandDatabase; procedure PrepareDXClusterDatabase; @@ -1069,6 +1069,7 @@ var c : TConnectionName; MySQLVer : String; param : String; + SkipLibraryVersionCheck : Boolean = False; begin InitCriticalSection(csPreviousQSO); cqrini := nil; @@ -1108,10 +1109,17 @@ begin Writeln('**************************') end; - if MySQLVer = '10.' then - MySQLVer := '5.6'; - if MySQLVer = '10.1' then - MySQLVer := '5.7' + case MySQLVer of + '5.1', '5.2', '5.3', '5.4' : MySQLVer := '5.1'; + '5.5' : MySQLVer := '5.5'; + '5.6' : MySQLVer := '5.6'; + '10.' : MySQLVer := '5.6'; + else + // use latest available TMySQL component and disable library version check + // to allow yet unknown versions + MySQLVer := '5.7'; + SkipLibraryVersionCheck := True + end; except on E : Exception do @@ -1132,10 +1140,14 @@ begin begin Writeln('**********************************'); Writeln('MySQL version assigned: ',FloatToStr(fMySQLVersion)); + if SkipLibraryVersionCheck then + begin + Writeln('No suitable TMySQL class for used MySQL client library available, library version check disabled'); + end; Writeln('**********************************') end; - CreateDBConnections; + CreateDBConnections(SkipLibraryVersionCheck); MainCon.KeepConnection := True; MainCon.Transaction := trmQ; @@ -4164,7 +4176,7 @@ begin end end; -procedure TdmData.CreateDBConnections; +procedure TdmData.CreateDBConnections(const SkipLibraryVersionCheck: Boolean = False); begin if fMySQLVersion < 5.5 then begin @@ -4172,15 +4184,33 @@ begin BandMapCon := TMySQL51Connection.Create(self); RbnMonCon := TMySQL51Connection.Create(self); LogUploadCon := TMySQL51Connection.Create(self); - dbDXC := TMySQL51Connection.Create(self) + dbDXC := TMySQL51Connection.Create(self); + + if SkipLibraryVersionCheck then + begin + TMySQL51Connection(MainCon).SkipLibraryVersionCheck := True; + TMySQL51Connection(BandMapCon).SkipLibraryVersionCheck := True; + TMySQL51Connection(RbnMonCon).SkipLibraryVersionCheck := True; + TMySQL51Connection(LogUploadCon).SkipLibraryVersionCheck := True; + TMySQL51Connection(dbDXC).SkipLibraryVersionCheck := True + end end - else if fMySQLVersion < 5.6 then + else if fMySQLVersion < 5.6 then begin MainCon := TMySQL55Connection.Create(self); BandMapCon := TMySQL55Connection.Create(self); RbnMonCon := TMySQL55Connection.Create(self); LogUploadCon := TMySQL55Connection.Create(self); - dbDXC := TMySQL55Connection.Create(self) + dbDXC := TMySQL55Connection.Create(self); + + if SkipLibraryVersionCheck then + begin + TMySQL55Connection(MainCon).SkipLibraryVersionCheck := True; + TMySQL55Connection(BandMapCon).SkipLibraryVersionCheck := True; + TMySQL55Connection(RbnMonCon).SkipLibraryVersionCheck := True; + TMySQL55Connection(LogUploadCon).SkipLibraryVersionCheck := True; + TMySQL55Connection(dbDXC).SkipLibraryVersionCheck := True + end end else begin if fMySQLVersion < 5.7 then @@ -4189,14 +4219,32 @@ begin BandMapCon := TMySQL56Connection.Create(self); RbnMonCon := TMySQL56Connection.Create(self); LogUploadCon := TMySQL56Connection.Create(self); - dbDXC := TMySQL56Connection.Create(self) + dbDXC := TMySQL56Connection.Create(self); + + if SkipLibraryVersionCheck then + begin + TMySQL56Connection(MainCon).SkipLibraryVersionCheck := True; + TMySQL56Connection(BandMapCon).SkipLibraryVersionCheck := True; + TMySQL56Connection(RbnMonCon).SkipLibraryVersionCheck := True; + TMySQL56Connection(LogUploadCon).SkipLibraryVersionCheck := True; + TMySQL56Connection(dbDXC).SkipLibraryVersionCheck := True + end end else begin MainCon := TMySQL57Connection.Create(self); BandMapCon := TMySQL57Connection.Create(self); RbnMonCon := TMySQL57Connection.Create(self); LogUploadCon := TMySQL57Connection.Create(self); - dbDXC := TMySQL57Connection.Create(self) + dbDXC := TMySQL57Connection.Create(self); + + if SkipLibraryVersionCheck then + begin + TMySQL57Connection(MainCon).SkipLibraryVersionCheck := True; + TMySQL57Connection(BandMapCon).SkipLibraryVersionCheck := True; + TMySQL57Connection(RbnMonCon).SkipLibraryVersionCheck := True; + TMySQL57Connection(LogUploadCon).SkipLibraryVersionCheck := True; + TMySQL57Connection(dbDXC).SkipLibraryVersionCheck := True + end end end end;