Subject BUG, need confirmation
Author meier3342
Hi!

I think I found a bug in Firebird. I use FirebirdS
S-1.0.3.972-0.tar.gz on a "pretty
vanilla" SuSE 8.2 (athlon).

I have a very simple DB with five tables and less than ten records
per table. I
have a query that crashes ISQL and seems to "crash" Jaybird (1.0) as
well.
Here's the DDL file:

create table tblThread (
id INTEGER not null,
version INTEGER not null,
created TIMESTAMP not null,
initialMessage INTEGER,
forum INTEGER,
primary key (id)
);
create table tblUser (
id INTEGER not null,
version INTEGER not null,
created TIMESTAMP not null,
name VARCHAR(127) not null unique,
pword VARCHAR(255),
primary key (id)
);
create table tblMessage (
id INTEGER not null,
version INTEGER not null,
created TIMESTAMP not null,
thread INTEGER,
replyTo INTEGER,
author INTEGER,
subject VARCHAR(255),
body VARCHAR(32000),
primary key (id)
);
create table tblForum (
id INTEGER not null,
version INTEGER not null,
created TIMESTAMP not null,
subject VARCHAR(255),
primary key (id)
);
create table tblRoles (
userid INTEGER not null,
userrole INTEGER
);
alter table tblThread add constraint FKD99C73688EF24C23 foreign key
(initialMessage) references tblMessage;
alter table tblThread add constraint FKD99C73685D18D21 foreign key
(forum)
references tblForum;
alter table tblMessage add constraint FKE29C4669413D0B05 foreign key
(replyTo) references tblMessage;
alter table tblMessage add constraint FKE29C4669AC2D218B foreign key
(author) references tblUser;
alter table tblMessage add constraint FKE29C4669CBE10E0A foreign key
(thread) references tblThread;
alter table tblRoles add constraint FKF2E059FCE2B3226 foreign key
(userid)
references tblUser;
create generator genForum;
create generator genMessage;
create generator genUser;
create generator genThread;

Here is query A:

select
tblthrea0_.id as id__, message1_.id as id0_, message1_.version as
version0_,
message1_.created as created0_, message1_.thread as thread0_,
message1_.replyTo as replyTo0_, message1_.author as author0_,
message1_.subject as subject0_, message1_.body as body0_,
message2_.id as
id1_, message2_.version as version1_, message2_.created as created1_,
message2_.thread as thread1_, message2_.replyTo as replyTo1_,
message2_.author as author1_, message2_.subject as subject1_,
message2_.body as body1_, user3_.id as id2_, user3_.version as
version2_,
user3_.created as created2_, user3_.name as name2_, user3_.pword as
pword2_, user4_.id as id3_, user4_.version as version3_,
user4_.created as
created3_, user4_.name as name3_, user4_.pword as pword3_,
tblthrea0_.id as
id4_, tblthrea0_.version as version4_, tblthrea0_.created as
created4_,
tblthrea0_.initialMessage as initialM4_4_, tblthrea0_.forum as
forum4_
from
tblThread tblthrea0_ left outer join tblMessage message1_ on
tblthrea0_.initialMessage=message1_.id
left outer join tblMessage message2_ on message1_.
replyTo=message2_.id
left outer join tblUser user3_ on message2_.author=user3_.id
left outer join tblUser user4_ on message1_.author=user4_.id
where tblthrea0_.forum=2
order by tblthrea0_.created desc;

Here is query B (same as A except for the field selection):

select
*
from
tblThread tblthrea0_ left outer join tblMessage message1_ on
tblthrea0_.initialMessage=message1_.id
left outer join tblMessage message2_ on message1_.
replyTo=message2_.id
left outer join tblUser user3_ on message2_.author=user3_.id
left outer join tblUser user4_ on message1_.author=user4_.id
where tblthrea0_.forum=2
order by tblthrea0_.created desc;

I can issue A and B successfully using an empty DB with the above
DDL. When I
insert some sample data query A crashes (ISQL and Jaybird) and B
works!
"crash" for ISQL means no error messages from ISQL but a "memory
access
fault" from linux (I think).

I cannot supply the SQL to insert "my" records into the tables since
I use a little
Java program to populate the DB. I could either provide that or the
.gdb file.

Please confirm this is a bug, so it can find its way into the bug
database.


Thanks,

Timo