ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/runtime/IBCustomDataSet.pas
(Generate patch)

Comparing ibx/trunk/runtime/IBCustomDataSet.pas (file contents):
Revision 106 by tony, Thu Jan 18 14:37:35 2018 UTC vs.
Revision 107 by tony, Thu Jan 18 14:37:40 2018 UTC

# Line 27 | Line 27
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  
# Line 441 | Line 441 | type
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);
# Line 685 | Line 686 | type
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
# Line 2063 | Line 2065 | begin
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  
# Line 2453 | Line 2458 | begin
2458        end;
2459        Inc(arr);
2460      end;
2461 +  FBufferUpdatedOnQryReturn := false;
2462    if Assigned(FUpdateObject) then
2463    begin
2464      if (Qry = FQDelete) then
# Line 2465 | Line 2471 | begin
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines