Bug in TZInterbase6DatabaseMetadata.UncachedGetColumns ?

The stable tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.
Post Reply
teimue
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 27.11.2008, 10:20

Bug in TZInterbase6DatabaseMetadata.UncachedGetColumns ?

Post by teimue »

Hi everyone,
I'm writing a console app on Delphi2007 and Firebird2.5 and I got an error if I try to open a Query. At a specific row I got an exception that the resultset is not updateable.
But the example ZSimple works on the same table !?
I searched for the reason and found this:
the TZInterbase6DatabaseMetadata.UncachedGetColumns looks like:

Code: Select all

        // COLUMN_SIZE.
        case TypeName of
          7, 8 : Result.UpdateInt(7, 0);
          16   : Result.UpdateInt(7, GetInt(ColumnIndexes[9]));
          37, 38: UpdateNull(7);  //the defaults of the resultsets will be used if null
            {if ( ConSettings.ClientCodePage.ID = 0 ) then //CharcterSet 'NONE'
              Result.UpdateInt(7, GetFieldSize(SQLType, ConSettings,
                GetInt(ColumnIndexes[10]), GetConnection.GetIZPlainDriver.ValidateCharEncoding(SubTypeName).CharWidth, nil, True)) //FireBird return Char*Bytes for Varchar
            else
              Result.UpdateInt(7, GetFieldSize(SQLType, ConSettings,
                GetInt(ColumnIndexes[10]), ConSettings.ClientCodePage.CharWidth, nil, True)); //FireBird return Char*Bytes for Varchar}
        else
          Result.UpdateInt(7, GetInt(ColumnIndexes[10]));
        end;
And I get always an error for 'TypeName = 37'. Then the resultset was readonly and the Update fails.
I think the right line must be:

Code: Select all

37, 38: Result.UpdateNull(7); 
With this change it works.
Post Reply