Browse Source

* Patch from Werner Pamler to fix issue #39544

Michaël Van Canneyt 3 years ago
parent
commit
7b3ef85d2f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      packages/fcl-db/src/sqldb/sqldb.pp

+ 7 - 1
packages/fcl-db/src/sqldb/sqldb.pp

@@ -516,6 +516,7 @@ type
     function GetSQLConnection: TSQLConnection;
     function GetSQLTransaction: TSQLTransaction;
     function GetStatementType : TStatementType;
+    function IsMacrosStored: Boolean;
     Function NeedLastInsertID: TField;
     procedure SetMacroChar(AValue: Char);
     procedure SetOptions(AValue: TSQLQueryOptions);
@@ -639,7 +640,7 @@ type
     Property Options : TSQLQueryOptions Read FOptions Write SetOptions default [];
     property Params : TParams read GetParams Write SetParams;
     Property ParamCheck : Boolean Read GetParamCheck Write SetParamCheck default true;
-    property Macros : TParams read GetMacros Write SetMacros;
+    property Macros : TParams read GetMacros Write SetMacros stored IsMacrosStored;
     Property MacroCheck : Boolean Read GetMacroCheck Write SetMacroCheck default false;
     Property MacroChar : Char Read GetMacroChar Write SetMacroChar default DefaultMacroChar;
     property ParseSQL : Boolean read GetParseSQL write SetParseSQL default true;
@@ -3432,6 +3433,11 @@ begin
     Result:=stUnknown;
 end;
 
+function TCustomSQLQuery.IsMacrosStored: Boolean;
+begin
+  Result := Macros.Count > 0;
+end;
+
 procedure TCustomSQLQuery.SetParamCheck(AValue: Boolean);
 begin
   FStatement.ParamCheck:=AValue;