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

Comparing ibx/trunk/runtime/nongui/IBCustomDataSet.pas (file contents):
Revision 311 by tony, Mon Aug 24 09:32:58 2020 UTC vs.
Revision 312 by tony, Tue Aug 25 15:40:58 2020 UTC

# Line 1961 | Line 1961 | var
1961    Buff: PRecordData;
1962   begin
1963    Buff := PRecordData(GetActiveBuf);
1964 <  result := (FQModify.SQL.Text <> '') or
1965 <    (Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukModify).Text <> '')) or
1964 >  result := (Trim(FQModify.SQL.Text) <> '') or
1965 >    (Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukModify).Text) <> '')) or
1966      ((Buff <> nil) and (Buff^.rdCachedUpdateStatus = cusInserted) and
1967        (FCachedUpdates));
1968   end;
1969  
1970   function TIBCustomDataSet.CanInsert: Boolean;
1971   begin
1972 <  result := (FQInsert.SQL.Text <> '') or
1973 <    (Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukInsert).Text <> ''));
1972 >  result := (Trim(FQInsert.SQL.Text) <> '') or
1973 >    (Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukInsert).Text) <> ''));
1974   end;
1975  
1976   function TIBCustomDataSet.CanDelete: Boolean;
1977   begin
1978 <  if (FQDelete.SQL.Text <> '') or
1979 <    (Assigned(FUpdateObject) and (FUpdateObject.GetSQL(ukDelete).Text <> '')) then
1978 >  if (Trim(FQDelete.SQL.Text) <> '') or
1979 >    (Assigned(FUpdateObject) and (Trim(FUpdateObject.GetSQL(ukDelete).Text) <> '')) then
1980      result := True
1981    else
1982      result := False;
# Line 1984 | Line 1984 | end;
1984  
1985   function TIBCustomDataSet.CanRefresh: Boolean;
1986   begin
1987 <  result := (FQRefresh.SQL.Text <> '') or
1988 <    (Assigned(FUpdateObject) and (FUpdateObject.RefreshSQL.Text <> ''));
1987 >  result := (Trim(FQRefresh.SQL.Text) <> '') or
1988 >    (Assigned(FUpdateObject) and (Trim(FUpdateObject.RefreshSQL.Text) <> ''));
1989   end;
1990  
1991   procedure TIBCustomDataSet.CheckEditState;
# Line 2637 | Line 2637 | begin
2637      begin
2638        if Buff <> nil then
2639        begin
2640 <        if (Assigned(FUpdateObject) and (FUpdateObject.RefreshSQL.Text <> '')) then
2640 >        if (Assigned(FUpdateObject) and (Trim(FUpdateObject.RefreshSQL.Text) <> '')) then
2641          begin
2642            Qry := TIBSQL.Create(self);
2643            Qry.Database := Database;
# Line 3948 | Line 3948 | begin
3948   procedure TIBCustomDataSet.FieldDefsFromQuery(SourceQuery: TIBSQL);
3949   const
3950    DefaultSQL = 'Select F.RDB$COMPUTED_BLR, ' + {do not localize}
3951 <               'F.RDB$DEFAULT_VALUE, Trim(R.RDB$FIELD_NAME) as RDB$FIELD_NAME ' + {do not localize}
3951 >               'F.RDB$DEFAULT_VALUE,  R.RDB$FIELD_NAME ' + {do not localize}
3952                 'from RDB$RELATION_FIELDS R, RDB$FIELDS F ' + {do not localize}
3953                 'where R.RDB$RELATION_NAME = :RELATION ' +  {do not localize}
3954                 'and R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME '+ {do not localize}
# Line 3956 | Line 3956 | const
3956                 '     (not F.RDB$DEFAULT_VALUE is NULL)) '; {do not localize}
3957  
3958    DefaultSQLODS12 = 'Select F.RDB$COMPUTED_BLR, ' + {do not localize}
3959 <               'F.RDB$DEFAULT_VALUE, Trim(R.RDB$FIELD_NAME) as RDB$FIELD_NAME, R.RDB$IDENTITY_TYPE ' + {do not localize}
3959 >               'F.RDB$DEFAULT_VALUE, R.RDB$FIELD_NAME, R.RDB$IDENTITY_TYPE ' + {do not localize}
3960                 'from RDB$RELATION_FIELDS R, RDB$FIELDS F ' + {do not localize}
3961                 'where R.RDB$RELATION_NAME = :RELATION ' +  {do not localize}
3962                 'and R.RDB$FIELD_SOURCE = F.RDB$FIELD_NAME '+ {do not localize}
# Line 4000 | Line 4000 | var
4000      while not Query.Eof do
4001      begin
4002        FField := TFieldNode.Create;
4003 <      FField.FieldName := Query.Fields[2].AsString;
4003 >      FField.FieldName := TrimRight(Query.Fields[2].AsString);
4004        FField.DEFAULT_VALUE := not Query.Fields[1].IsNull;
4005        FField.COMPUTED_BLR := not Query.Fields[0].IsNull;
4006        FField.IDENTITY_COLUMN := (Query.FieldCount > 3) and not Query.Fields[3].IsNull;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines