[fpc-pascal] Re: SQLDB/Firebird unable to open table with more than 128 fields

Funky Beast funkybeast at pacific.net.sg
Sun Mar 22 03:40:20 CET 2009


Hi Joost,

Joost van der Sluis wrote:
> Op vrijdag 20-03-2009 om 22:38 uur [tijdzone +0800], schreef Funky
> Beast:
> 
>> I've found a bug in sqldb/firebird.
>> Its reported here, with sample project to reproduce:
>> http://bugs.freepascal.org/view.php?id=13340
> 
> You are using one TSQLQuery object for all sorts of actions. Try to
> create a new TSQLQeury for every sql-statement you execute. See if that
> helps.
> 
> And firebird doesn't allow sql-statements which changes the database
> (like alter table) within the same transaction as a select-statment. Are
> you sure you're not doing this?
> 
Thanks, I didn't know I need to create seperate TSQLQuerys for each sql statement.

> And the comparision with flamerobin and such is useless. In flamerobin
> you're not running this program which does a lot of strange things.
> 
> Try a simple program which only does a 'select * from table' - You'll
> see that it will work.
> 
I did, and posted the program in the bugtracker.

try the program with the following commands:
./sqldb_test 128 (this will create a database table with 129 fields, adds 1 record and exit)
./sqldb_test     (this will simply open the table with does a 'select * from datatable')

And he output is:
An unhandled exception occurred at $080B309C :
EIBDatabaseError :  : Fetch :
 -Dynamic SQL Error
 -SQL error code = -804
 -Incorrect values within SQLDA structure
  $080B309C  TIBCONNECTION__CHECKERROR,  line 155 of ibconnection.pp
  $080B50DB  TIBCONNECTION__FETCH,  line 693 of ibconnection.pp
  $080ADB7E  TCUSTOMSQLQUERY__FETCH,  line 965 of sqldb.pp
  $080E7AEB  TBUFDATASET__LOADBUFFER,  line 1524 of bufdataset.pas
  $080E7512  TBUFDATASET__GETNEXTPACKET,  line 1438 of bufdataset.pas
  $080E6B21  TBUFDATASET__GETRECORD,  line 1273 of bufdataset.pas
  $080911DC  TDATASET__GETNEXTRECORD,  line 743 of dataset.inc
  $08091388  TDATASET__GETNEXTRECORDS,  line 772 of dataset.inc
  $0809255D  TDATASET__RECALCBUFLISTSIZE,  line 1084 of dataset.inc
  $0809005B  TDATASET__DOINTERNALOPEN,  line 409 of dataset.inc
  $08091C0A  TDATASET__OPENCURSOR,  line 918 of dataset.inc
  $0809216F  TDATASET__SETACTIVE,  line 1017 of dataset.inc
  $080AD4D7  TCUSTOMSQLQUERY__SETACTIVE,  line 876 of sqldb.pp
  $0809557C  TDATASET__OPEN,  line 1950 of dataset.inc
  $08048E53  TSQLDB_TEST_FUNCTION__OPEN_QUERY,  line 147 of sqldb_test.pas
  $08048ED8  main,  line 159 of sqldb_test.pas

Regards,
Funky Beast





More information about the fpc-pascal mailing list