Issue Details (XML | Word | Printable)

Key: CORE-1572
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Ivano Di Mizio
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Multiple Rows in Singleton Select not reported in a View

Created: 07/Nov/07 11:57 AM   Updated: 03/Apr/08 10:02 AM
Component/s: Engine
Affects Version/s: 2.0.3
Fix Version/s: 2.0.4

Time Tracking:
Not Specified

Issue Links:
Relate
 


 Description  « Hide
Consider a database like this:

CREATE TABLE TABLE1 ( ID1 INTEGER NOT NULL, FIELD1 VARCHAR(20));
CREATE TABLE TABLE2 ( ID2 INTEGER NOT NULL, FIELD2 VARCHAR(20));

INSERT INTO TABLE1 (ID1, FIELD1) VALUES (1, 'ONE');
INSERT INTO TABLE2 (ID2, FIELD2) VALUES (2, 'TWO');
INSERT INTO TABLE2 (ID2, FIELD2) VALUES (3, 'THREE');

CREATE VIEW VIEW_TABLE( ID1, FIELD1, FIELD2) AS
SELECT TABLE1.ID1, TABLE1.FIELD1, ( SELECT TABLE2.FIELD2 FROM TABLE2 ) FROM TABLE1;


If you run this query:

SELECT * FROM VIEW_TABLE;

There is no error raised and the data returned is:

ID1 FIELD1 FIELD2
--- ------ ------
1 ONE TWO

If you instead run the same query the VIEW is based on:

SELECT TABLE1.ID1, TABLE1.FIELD1, ( SELECT TABLE2.FIELD2 FROM TABLE2 ) FROM TABLE1;

a "Multiple Rows in Singleton Select" error is correctly reported.

This behaviour only applies to Firebird 2.0.x.
With Firebird 2.1 Beta 2 the error is correctly displayed in both cases.


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Dmitry Yemanov added a comment - 12/Nov/07 05:08 AM
Adriano, could you please research the reason and consider a backport into v2.0.4 when time permits?

Adriano dos Santos Fernandes added a comment - 12/Nov/07 07:32 AM
Problem is (I suppose) same as CORE-881 Singleton is not respected in COMPUTED BY expressions.
I'll test and backport tonight or latter this weak.

Philippe Makowski added a comment - 03/Apr/08 10:02 AM
Q/A test ok and qmtest made