Re: Error code -1?
Tobias Downer <[email protected]> Wed, 27 Jul 2005 18:11:27 -0700
| Newsgroups | gmane.comp.db.mckoi |
|---|---|
| Message-ID | <[email protected]> |
Hi, Thanks for the test script. I could reproduce this error on both 1.0.2 and 1.0.3. This error happens because Mckoi incorrectly labels sections of the query tree on nested outer joins which causes this error. To work around the problem, you will need to remove the outer join from the sub-query. I do have a patch for this problem for 1.0.3. If you need 1.0.2 patched, please email me and I will see what I can do for you. Toby. M. A. Sridhar wrote: > I'm running into a strange error with some queries: Mckoi 1.0.2 throws an > "Error -1, error code 1" with no explanation. (I'm running it on IBM Java 1.4 > on a Linux box, if that helps.) I can reproduce this problem on a simple > 4-table database of suppliers, parts and part types. The query is > automatically generated, and in this case it is attempting to list suppliers, > parts and part types, including suppliers who do not supply any parts. I > would greatly appreciate any help. > > Here is the query: > > select Supplier.name as atr_0, sq1.col0 as atr_1, sq1.col1 as atr_2 > from Supplier > left join ( > select Supplier.supplier_id as pk, Part.name as col0, part_type.name > as col1 > from Supplier, Link, Part left join part_type on part.part_type = > part_type.part_type_id > where Part.part_id = Link.part and Link.supplier = > Supplier.supplier_id) as sq1 > on Supplier.supplier_id = sq1.pk > > And here are the four tables in question: > > > create table Supplier ( > supplier_id integer not null, > name varchar(30) not null, > constraint supplier__pk primary key (supplier_id) > ); > > > create table Part ( > part_id integer not null, > name varchar(30) not null, > sku varchar(30) not null, > part_type integer not null, > ship_date timestamp, > constraint part__pk primary key (part_id) > ); > > > create table Link ( > link_id integer not null, > supplier integer not null, > part integer not null, > constraint link_pk primary key (link_id) > ); > > > alter table Link add constraint sup_fk foreign key (supplier) references > Supplier (supplier_id); > alter table Link add constraint part_fk foreign key (part) references Part > (part_id); > > create table Part_type ( > part_type_id integer not null, > name varchar(64) not null, > constraint part_typepk primary key (part_type_id) > ); > > alter table Part add constraint part_type_fk > foreign key (part_type) references Part_type (part_type_id); > > > Thanks. > > M. A. Sridhar --------------------------------------------------------------- Mckoi SQL Database mailing list http://www.mckoi.com/database/ To unsubscribe, send a message to [email protected]