Subject | Possible bug in Firebird 1.5 SS final? |
---|---|
Author | Salvatore Besso |
Post date | 2004-05-28T16:24:09Z |
hello all,
Firebird 1.5.0.4306 SS final. I don't know if this may be a bug, anyway:
Suppose two tables more or less like these:
TABLE_A:
-----------------
ID_A INTEGER, { pk, autogenerated with a generator/trigger }
NAME VARCHAR(50)
Contents of TABLE_A:
ID_A NAME
-----------------
1 ABC68
2 ABC683
TABLE_B:
ID_B INTEGER, { pk, autogenerated with a generator/trigger }
INT_VALUE INTEGER,
ID_FROM_TABLE_A INTEGER
Well, until Firebird 1.03 I don't remember I have had troubles with an
insert statement like this:
INSERT INTO TABLE_B(INT_VALUE, ID_FROM_TABLE_A)
VALUES(2, (SELECT ID_A FROM TABLE_A TA WHERE TA.NAME = 'ABC683'))
Now with Firebird 1.5 SS final this statement fails with a "Multiple rows
in singleton select" error. I then tried a simple query on TABLE_A using
IBExpert:
SELECT ID_A FROM TABLE_A WHERE NAME = 'ABC683'
and with big surprise this is the result:
ID_A NAME
-----------------
1 ABC68
2 ABC683
How is it possible that it finds two rows?
As far as I know it would find two rows only with a statement like this (I
don't remember exactly the LIKE syntax):
SELECT ID_A FROM TABLE_A WHERE NAME LIKE('ABC68%')
But in the original query I have used = and not LIKE.
Any hints?
Regards
Salvatore
Firebird 1.5.0.4306 SS final. I don't know if this may be a bug, anyway:
Suppose two tables more or less like these:
TABLE_A:
-----------------
ID_A INTEGER, { pk, autogenerated with a generator/trigger }
NAME VARCHAR(50)
Contents of TABLE_A:
ID_A NAME
-----------------
1 ABC68
2 ABC683
TABLE_B:
ID_B INTEGER, { pk, autogenerated with a generator/trigger }
INT_VALUE INTEGER,
ID_FROM_TABLE_A INTEGER
Well, until Firebird 1.03 I don't remember I have had troubles with an
insert statement like this:
INSERT INTO TABLE_B(INT_VALUE, ID_FROM_TABLE_A)
VALUES(2, (SELECT ID_A FROM TABLE_A TA WHERE TA.NAME = 'ABC683'))
Now with Firebird 1.5 SS final this statement fails with a "Multiple rows
in singleton select" error. I then tried a simple query on TABLE_A using
IBExpert:
SELECT ID_A FROM TABLE_A WHERE NAME = 'ABC683'
and with big surprise this is the result:
ID_A NAME
-----------------
1 ABC68
2 ABC683
How is it possible that it finds two rows?
As far as I know it would find two rows only with a statement like this (I
don't remember exactly the LIKE syntax):
SELECT ID_A FROM TABLE_A WHERE NAME LIKE('ABC68%')
But in the original query I have used = and not LIKE.
Any hints?
Regards
Salvatore