View Issue Details

IDProjectCategoryView StatusLast Update
0001051Interbase/FirebirdGeneralpublic2019-04-18 19:46
Reportershirokov Assigned Tobarry  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0001051: Error in the Database Comparer when comparing the fields description of a view (Firebird 2.5)
DescriptionThe error occurs if the master objects are read out of a scriptfile. In this case the fields (TFldData) of the View (TViwData) don't have the properties "OwnName" and "OwnObject" set. But it seems to be required in the procedure GenScriptViewAlter.

The attached archive contains both master and target DBs and the resulting script.

The problem can be fixed by adding the following code to the TIbParser.ParseView method:

procedure TIbParser.ParseView(caSy: TSymbol);
//<--AVX
var
  vData: TViwData;
  i: Integer;
  fldData: TFldData;
begin
  TestAndGetSy(ViewSy);
  vData := TViwData.Create(Objs);
  vData.ObjName := Ident;
  TestAndGetSy(IdentSy);
  if Sy = lParentSy then IdxFieldsList(vData.Flds);
//<--fix
  for i := 0 to vData.Flds.Count - 1 do
  begin
    fldData := vData.Flds.Objects[i] as TFldData;
    if Assigned(fldData) then
    begin
      fldData.OwnName := vData.ObjName;
      fldData.OwnObj := vData;
    end;
  end;
//<-- end fix
  DoLogNextLine('View: '+vData.ObjName);
  ParseBody(vData);
  DoAddStatement(stStatement, vData.ObjName, dboView, odbCreate, '', fStatement);
  TestAndGetSy(TermSy);
  AddObj(vData);
end;
TagsNo tags attached.

Activities

shirokov

2017-04-27 10:49

administrator  

Example.zip (2,664 bytes)

Issue History

Date Modified Username Field Change
2017-04-27 10:49 shirokov New Issue
2017-04-27 10:49 shirokov File Added: Example.zip
2017-05-15 16:17 barry Assigned To => barry
2017-05-15 16:17 barry Status new => assigned
2018-06-01 05:24 barry Status assigned => resolved
2018-06-01 05:24 barry Resolution open => fixed
2019-04-18 19:46 barry Status resolved => closed