Page 1 of 1

Bug in TZInterbase6DatabaseMetadata.UncachedGetColumns ?

Posted: 30.04.2013, 14:24
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.