Issue Details (XML | Word | Printable)

Key: CORE-3777
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Dmitry Yemanov
Reporter: Maxim Kuzmin
Votes: 0
Watchers: 2
Operations

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

Conversion error from string when using GROUP BY

Created: 26/Feb/12 10:59 PM   Updated: 10/Apr/14 12:10 PM
Component/s: None
Affects Version/s: 2.5.0, 2.5.1
Fix Version/s: 2.5.2

Time Tracking:
Not Specified

Issue Links:
Relate
 

Planning Status: Unspecified


 Description  « Hide
Metadata:
CREATE TABLE TABLE2 (
    ID INTEGER NOT NULL,
    NAME VARCHAR(50)
);
ALTER TABLE TABLE2 ADD CONSTRAINT PK_TABLE2 PRIMARY KEY (ID);

CREATE TABLE TABLE1 (
    ID INTEGER NOT NULL,
    ID_NAME INTEGER,
    NAME COMPUTED BY (COALESCE((SELECT NAME FROM TABLE2 WHERE ID = ID_NAME) || '.', '')),
    OTHER_FIELD INTEGER
);
ALTER TABLE TABLE1 ADD CONSTRAINT PK_TABLE1 PRIMARY KEY (ID);

Data:
INSERT INTO TABLE2 (ID, NAME) VALUES (1, 'qqq');
INSERT INTO TABLE2 (ID, NAME) VALUES (2, 'www');
INSERT INTO TABLE2 (ID, NAME) VALUES (3, 'eee');

INSERT INTO TABLE1 (ID, ID_NAME, OTHER_FIELD) VALUES (1, 1, 100);
INSERT INTO TABLE1 (ID, ID_NAME, OTHER_FIELD) VALUES (2, 2, 101);
INSERT INTO TABLE1 (ID, ID_NAME, OTHER_FIELD) VALUES (3, 3, 102);

Query:
SELECT
    T.NAME
FROM
    TABLE1 T
GROUP BY
    T.NAME,
    T.OTHER_FIELD

Firebird returns:
Overflow occurred during data type conversion.
conversion error from string "qqq.".

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.