27 |
|
{ IBX For Lazarus (Firebird Express) } |
28 |
|
{ Contributor: Tony Whyman, MWA Software http://www.mwasoftware.co.uk } |
29 |
|
{ Portions created by MWA Software are copyright McCallum Whyman } |
30 |
< |
{ Associates Ltd 2011 - 2015 } |
30 |
> |
{ Associates Ltd 2011 - 2015 } |
31 |
|
{ } |
32 |
|
{************************************************************************} |
33 |
|
|
441 |
|
FInTransactionEnd: boolean; |
442 |
|
FIBLinks: TList; |
443 |
|
FFieldColumns: PFieldColumns; |
444 |
+ |
FBufferUpdatedOnQryReturn: boolean; |
445 |
|
procedure ColumnDataToBuffer(QryResults: IResults; ColumnIndex, |
446 |
|
FieldIndex: integer; Buffer: PChar); |
447 |
|
procedure InitModelBuffer(Qry: TIBSQL; Buffer: PChar); |
686 |
|
procedure Post; override; |
687 |
|
function ParamByName(ParamName: String): ISQLParam; |
688 |
|
property ArrayFieldCount: integer read FArrayFieldCount; |
689 |
+ |
property DatabaseInfo: TIBDatabaseInfo read FDatabaseInfo; |
690 |
|
property UpdateObject: TIBDataSetUpdateObject read FUpdateObject write SetUpdateObject; |
691 |
|
property UpdatesPending: Boolean read FUpdatesPending; |
692 |
|
property UpdateRecordTypes: TIBUpdateRecordTypes read FUpdateRecordTypes |
2065 |
|
begin |
2066 |
|
j := GetFieldPosition(QryResults[i].GetAliasName); |
2067 |
|
if j > 0 then |
2068 |
+ |
begin |
2069 |
|
ColumnDataToBuffer(QryResults,i,j,Buffer); |
2070 |
+ |
FBufferUpdatedOnQryReturn := true; |
2071 |
+ |
end; |
2072 |
|
end; |
2073 |
|
end; |
2074 |
|
|
2458 |
|
end; |
2459 |
|
Inc(arr); |
2460 |
|
end; |
2461 |
+ |
FBufferUpdatedOnQryReturn := false; |
2462 |
|
if Assigned(FUpdateObject) then |
2463 |
|
begin |
2464 |
|
if (Qry = FQDelete) then |
2471 |
|
else begin |
2472 |
|
SetInternalSQLParams(Qry.Params, Buff); |
2473 |
|
Qry.ExecQuery; |
2474 |
+ |
if Qry.FieldCount > 0 then {Has RETURNING Clause} |
2475 |
+ |
UpdateRecordFromQuery(Qry.Current,Buff); |
2476 |
|
end; |
2469 |
– |
if Qry.FieldCount > 0 then {Has RETURNING Clause} |
2470 |
– |
UpdateRecordFromQuery(Qry.Current,Buff); |
2477 |
|
PRecordData(Buff)^.rdUpdateStatus := usUnmodified; |
2478 |
|
PRecordData(Buff)^.rdCachedUpdateStatus := cusUnmodified; |
2479 |
|
SetModified(False); |
2480 |
|
WriteRecordCache(PRecordData(Buff)^.rdRecordNumber, Buff); |
2481 |
< |
if (FForcedRefresh or FNeedsRefresh) and CanRefresh then |
2481 |
> |
if (FForcedRefresh or (FNeedsRefresh and not FBufferUpdatedOnQryReturn)) and CanRefresh then |
2482 |
|
InternalRefreshRow; |
2483 |
|
end; |
2484 |
|
|
2714 |
|
|
2715 |
|
procedure TIBCustomDataSet.SetDatabase(Value: TIBDatabase); |
2716 |
|
begin |
2717 |
< |
if (FBase.Database <> Value) then |
2717 |
> |
if (csLoading in ComponentState) or (FBase.Database <> Value) then |
2718 |
|
begin |
2719 |
|
CheckDatasetClosed; |
2720 |
|
InternalUnPrepare; |