LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-74] Character Constants Should be CHAR not VARCHAR #796

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[reporter="edan", created="Fri, 17 Mar 2006 14:46:14 -0500 (GMT-05:00)"] Issue #1 Character constants are coming out VARCHAR.

CREATE VIEW v AS VALUES ('foo');

The column should have type CHAR(3) NOT NULL.

Issue #2 Compound literals should have the same type, e.g.

CREATE VIEW v2 AS VALUES ('foo'
'bar');

The column should have type CHAR(6) NOT NULL.

Issue #3. The standard prohibits columns from having zero length. So, the views

CREATE VIEW v0 AS VALUES ('');

CREATE VIEW v00 AS VALUES (''
'');

should both have columns of type CHAR(1) NOT NULL.
------- Comment #1 From Julian Hyde 2005-10-08 18:02 [reply] -------
When fixing this bug, please fix SqlOperatorTests.testLiteralChain.

dynamobi-build commented 12 years ago

[author="angel", created="Sun, 17 Dec 2006 16:49:24 -0500 (GMT-05:00)"] Issues #1, #2 has been verified. SqlOperatorTests.testLiteralChain also looks
good. There is a test case in farrago/unitsql/expressions/datatypes.sql.
Eigenbase dt change 8364 adds the testcase for the multiline case (Issue #2).

Issue #3 is still outstanding. CREATE VIEW v0 AS VALUES ('') still has a
column of type CHAR(0) NOT NULL.

dynamobi-build commented 12 years ago

[author="angel", created="Sat, 3 Feb 2007 19:07:15 -0500 (GMT-05:00)"] Fixed in Eigenbase dt change 8636 by casting CHAR(0) to CHAR(1) in view (similarly for VARCHAR, BINARY, VARBINARY). Note that this means '' becomes ' ' in view for CHAR.