Skip to content

Commit

Permalink
Remove all MDT related tools.
Browse files Browse the repository at this point in the history
MDT (Mirror Dataset Tools) was an atempt to implement specific caching technology.
  • Loading branch information
madorin committed Nov 9, 2019
1 parent 41c8945 commit 4364ada
Show file tree
Hide file tree
Showing 60 changed files with 83 additions and 1,971 deletions.
3 changes: 0 additions & 3 deletions Editors/pFIBComponentEditors.pas
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ procedure TpFIBDatabaseEditor.ExecuteVerb(Index: Integer);
var
db:IFIBConnect;
Script:TStrings;
Stringer:IFIBStringer;
Connected:Boolean;
begin
if ObjSupports(Component,IFIBConnect,db) then
Expand Down Expand Up @@ -1099,7 +1098,6 @@ procedure TFIBGenSQlEd.ExecuteVerb(Index: Integer);

type THackCondition=class
private
FOwner:TObject;
FEnabled:boolean;
end;

Expand Down Expand Up @@ -1376,7 +1374,6 @@ procedure TpFIBDeltaReceiverEditor.ExecuteVerb(Index: Integer);
Qry:TComponent;
Trans :TObject;
iQry:IFIBQuery;
iTrans:IFIBTransaction;
trActive:boolean;
ErrMessage:string;
Script:TStrings;
Expand Down
1 change: 0 additions & 1 deletion Editors/pfibdsgnviewsqls.dfm
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ object frmSaveSQLs: TfrmSaveSQLs
object pFIBTransaction1: TpFIBTransaction
DefaultDatabase = pFIBDatabase1
TimeoutAction = TARollback
MDTTransactionRole = mtrAutoDefine
Left = 160
Top = 88
end
Expand Down
69 changes: 2 additions & 67 deletions FIBDataSet.pas
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ interface
pFIBProps,pFIBFieldsDescr, DB,FIBCacheManage,
DBCommon,DbConsts,DBParsers,
FIBDatabase, FIBQuery, FIBMiscellaneous,SqlTxtRtns,pFIBLists,FIBCloneComponents ,
pFIBInterfaces,pFIBEventLists, FIBMDTInterface,
pFIBInterfaces,pFIBEventLists,
Classes,StdFuncs
{$IFNDEF NO_GUI}
{$IFDEF D_XE2}
Expand Down Expand Up @@ -1382,12 +1382,6 @@ TFIBCustomDataSet = class({$IFDEF TWideDataSet}TWideDataset{$ELSE}TDataset{$EN
{$IFDEF CSMonitor}
property CSMonitorSupport: TCSMonitorSupport read FCSMonitorSupport write SetCSMonitorSupport;
{$ENDIF}
protected
FMDTSQLExecutor: TMDTSQLExecutor;
procedure SetMDTSQLExecutor(AValue: TMDTSQLExecutor);
published
property MDTSQLExecutor: TMDTSQLExecutor
read FMDTSQLExecutor write SetMDTSQLExecutor default se_ServerAfterLocal;
end;

TFIBDataSet = class(TFIBCustomDataSet)
Expand Down Expand Up @@ -3761,7 +3755,6 @@ constructor TFIBCustomDataSet.Create(AOwner: TComponent);
vBeforeCloseEvents := TNotifyEventList.Create(Self);
vAfterOpenEvents := TNotifyEventList.Create(Self);
vBeforeOpenEvents := TNotifyEventList.Create(Self);
FMDTSQLExecutor:=se_ServerAfterLocal;
end;

destructor TFIBCustomDataSet.Destroy;
Expand Down Expand Up @@ -4896,15 +4889,6 @@ procedure TFIBCustomDataSet.FetchRecordToCache(Qry: TFIBQuery; RecordNumber: Int
fi:PFIBFieldDescr;
Buffer:TRecordBuffer;
curVar:TFIBXSQLVAR;

XMDTDataRecord: IMDTDataRecord;
XBlobIndex: integer;
XBlobDataBufer: pointer;
XBlobDataSize: integer;
fs: TFIBBlobStream;
XField: TField;
XStr: string;
XVarIndex:integer;
begin
StopFetching:=False;
if FUniDirectional or (FCacheModelOptions.CacheModelKind=cmkLimitedBufferSize) then
Expand Down Expand Up @@ -5081,36 +5065,6 @@ procedure TFIBCustomDataSet.FetchRecordToCache(Qry: TFIBQuery; RecordNumber: Int
end;
end;

XMDTDataRecord:=Qry.MDTResultDataRecord;
if XMDTDataRecord<>nil then begin
XBlobIndex:=0;
for i := 0 to c do begin
curVar:=qda[i];
if curVar.IsBlob then begin
XField:=Fields[I];
XVarIndex:=XMDTDataRecord.IVariables.VariableByOrderNumToIndex(I);
XMDTDataRecord.GetDataBuffer(XVarIndex,XBlobDataBufer,XBlobDataSize);
XStr:=XMDTDataRecord.StringValue[XVarIndex];
if Assigned(XBlobDataBufer) then begin
if pbd^[XBlobIndex]=nil then begin
fs:=TFIBBlobStream.CreateNew(XField.FieldNo, FBlobStreamList);
pbd^[XBlobIndex]:=fs;
if XField is TFIBBlobField //???MDT
then fs.blobSubType := TFIBBlobField(XField).FSubType
else fs.blobSubType := curVar.sqlsubtype;
fs.Mode := bmReadWrite;
fs.Database := Database;
fs.Transaction := Transaction;
fs.UpdateTransaction := UpdateTransaction;
fs.BlobID:=curVar.AsQuad;
//fs.BlobID := BlobID;
end;
pbd^[XBlobIndex].SetMDTValue(XBlobDataBufer,XBlobDataSize);
Inc(XBlobIndex);
end;
end;
end;
end;
if Assigned(FAfterFetchRecord) then
FAfterFetchRecord(Qry,RecordNumber,StopFetching);
if StopFetching then
Expand All @@ -5120,7 +5074,6 @@ procedure TFIBCustomDataSet.FetchRecordToCache(Qry: TFIBQuery; RecordNumber: Int
end;
end;


procedure TFIBCustomDataSet.InitDataSetSchema;
var
i, j,c: Integer;
Expand Down Expand Up @@ -5225,7 +5178,7 @@ procedure TFIBCustomDataSet.InitDataSetSchema;
fi^.fdRelationTable:=qda[i].RelationName;
fi^.fdRelationField:=qda[i].SqlName;
fi^.fdTableAlias :=QSelect.TableAliasForField(i);
//MDT confict

if fi^.fdIsSeparateString then
fi^.fdStrIndex:=StrIndex
else
Expand Down Expand Up @@ -12050,29 +12003,11 @@ procedure TFIBCustomDataSet.SetArrayElementValue(Field:TField;Value:Variant;
end;
{$ENDIF}

procedure TFIBCustomDataSet.SetMDTSQLExecutor(AValue:TMDTSQLExecutor);
begin
Close;
FMDTSQLExecutor:=AValue;
FQSelect.MDTSQLExecutor:=AValue;
FQRefresh.MDTSQLExecutor:=AValue;
if AValue=se_Local then begin
FQUpdate.MDTSQLExecutor:=se_ServerAfterLocal;
FQInsert.MDTSQLExecutor:=se_ServerAfterLocal;
FQDelete.MDTSQLExecutor:=se_ServerAfterLocal;
end
else begin
FQUpdate.MDTSQLExecutor:=AValue;
FQInsert.MDTSQLExecutor:=AValue;
FQDelete.MDTSQLExecutor:=AValue;
end;
end;
function TFIBDataSet.DoStoreActive:boolean;
begin
Result:=Active and (Database.StoreConnected or not (csDesigning in ComponentState))
end;


(*
* Support routines
*)
Expand Down
Loading

0 comments on commit 4364ada

Please sign in to comment.