unit server_capabilities;
interface
type
TServerBranch = (sbOther, sbMariaDB, sbMySQL);
TServerFeature = Integer;
TServerMutableString = Integer;
TServerVersion = Integer;
const
SRVFT_USER_ROLES: TServerFeature = $100001;
SRVMS_PASSWORD_COLUMN: TServerMutableString = $200001;
type
TServerCapabilities =
class
private
FServerBranch: TServerBranch;
FServerVersion: TServerVersion;
public
constructor Create(Branch: TServerBranch; Version: TServerVersion);
virtual;
function HasFeature(
const AFeature: TServerFeature): Boolean;
virtual;
function MutableString(
const AMutableString: TServerMutableString):
string;
virtual;
end;
implementation
{ TServerCapabilities }
constructor TServerCapabilities.Create(Branch: TServerBranch;
Version: TServerVersion);
begin
FServerBranch:= Branch;
FServerVersion:= Version;
end;
function TServerCapabilities.HasFeature(
const AFeature: TServerFeature): Boolean;
begin
Result:= FALSE;
case FServerBranch
of
sbMariaDB:
begin
case AFeature
of
SRVFT_USER_ROLES:
// <-- [dcc32 Fehler] server_capabilities.pas(45): E2026 Konstantenausdruck erwartet
Result:= (FServerVersion >= 100005);
end;
end;
sbMySQL:
begin
case AFeature
of
SRVFT_USER_ROLES:
// <-- [dcc32 Fehler] server_capabilities.pas(45): E2026 Konstantenausdruck erwartet
Result:= (FServerVersion >= 80000);
end;
end;
end;
end;
function TServerCapabilities.MutableString(
const AMutableString: TServerMutableString):
string;
begin
Result:= '
';
case FServerBranch
of
sbMariaDB:
begin
case AMutableString
of
SRVMS_PASSWORD_COLUMN:
// <-- [dcc32 Fehler] server_capabilities.pas(45): E2026 Konstantenausdruck erwartet
Result:= '
Password';
end;
end;
sbMySQL:
begin
case AMutableString
of
SRVMS_PASSWORD_COLUMN:
// <-- [dcc32 Fehler] server_capabilities.pas(45): E2026 Konstantenausdruck erwartet
begin
if FServerVersion >= 50706
then
Result:= '
authentication_string'
else
Result:= '
password';
end;
end;
end;
end;
end;
end.