Hi!

Just had to upgrade to fpc 2.3.1 for some reason.
But using fpc 2.3.1 UIB produces an "Invalid field size" error when trying to open a UIBDataset.

The same program works when using fpc 2.2.3.

For demonstrating the problem I created the following program:

When trying to open an UIBDataset I get an error: "EDatabaseError : Invalid field size : 4828"
Failes with: FPC 2.3.1 svn, UIB latest svn, Firebird 2.0, OS Ubuntu 8.04
Works with: FPC 2.2.3, UIB latest svn, Firebird 2.0, OS Ubuntu 8.04



program Project1;

{$mode Delphi}{$H+}

uses
  Classes, SysUtils, UIB, UIBLib, UIBDataset;

var IDB: TUIBDataBase;
    ITrans: TUIBTransaction;
    IQuery: TUIBDataSet;

begin
  IDB:=TUIBDataBase.Create(nil);
  ITrans:=TUIBTransaction.Create(nil);
  IQuery:=TUIBDataSet.Create(nil);
  IDB.DatabaseName:='DB.fdb';
  IDB.CharacterSet:=csISO8859_1;
  IDB.LibraryName:='libfbclient.so';
  IDB.UserName:='User';
  IDB.PassWord:='Pass';
  ITrans.DataBase:=IDB;
  ITrans.AutoStart:=false;
  ITrans.AutoStop:=false;
  IDB.Connected:=True;
  ITrans.StartTransaction;
  IQuery.DataBase:=IDB;
  IQuery.Transaction:=ITrans;
  IQuery.SQL.Text:='SELECT "DocID" FROM "Docs";';
  try
    IQuery.Open;
  finally
    if IQuery.Active then IQuery.Close;
    if ITrans.InTransaction then ITrans.RollBack;
    IDB.Connected:=False;
  end;
end.

Database-DDL:


CREATE DOMAIN "dm_Key" AS Integer
 DEFAULT 0
 NOT NULL
 CHECK (VALUE>=0)
;
CREATE DOMAIN "dm_TypID" AS Smallint
 DEFAULT 0
 NOT NULL
;

CREATE TABLE "Docs"(
  "DocID" "dm_Key" DEFAULT 0,
  "DocType" "dm_TypID" DEFAULT 0,
  PRIMARY KEY ("DocID")
);


anyone an idea how to proceed? Is this a bug somewhere? In UIB? In fpc? In my code?

Regards
Lukas

--

--------------------------
software security networks
Lukas Gradl <fpc#ssn.at>
Eduard-Bodem-Gasse 9
A - 6020 Innsbruck
Tel: +43-512-214040-0
Fax: +43-512-214040-21
--------------------------
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to