Fix erros and add test

This commit is contained in:
potya 2020-05-25 21:58:30 +03:00
parent 70fac9c068
commit 2974d81b2e
3 changed files with 38 additions and 5 deletions

View File

@ -71,7 +71,7 @@ namespace ErrorCodes
extern const int BAD_DATABASE_FOR_TEMPORARY_TABLE;
extern const int SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY;
extern const int DICTIONARY_ALREADY_EXISTS;
extern const int ILLEGAL_SYNTAX_FOR_DATA_TYPE
extern const int ILLEGAL_SYNTAX_FOR_DATA_TYPE;
}

View File

@ -0,0 +1,2 @@
Nullable(Int32) Int32 Nullable(Int32) Int32
Nullable(Int32) Int32 Nullable(Int32) Nullable(Int32)

View File

@ -1,11 +1,42 @@
DROP TABLE IF EXISTS data_null;
DROP TABLE IF EXISTS set_null;
CREATE TABLE data_null (
a INT NULL,
b INT NOT NULL,
C Nullable(INT)
);
c Nullable(INT),
d INT
) engine=Memory();
INSERT INTO data_null VALUES (1, 2, 3);
SELECT toTypeName(*) FROM data_null;
INSERT INTO data_null VALUES (1, 2, 3, 4);
SELECT toTypeName(a), toTypeName(b), toTypeName(c), toTypeName(d) FROM data_null;
CREATE TABLE data_null (
a Nullable(INT) NULL,
b INT NOT NULL,
c Nullable(INT)
) engine=Memory(); --{serverError 377}
CREATE TABLE data_null (
a INT NULL,
b Nullable(INT) NOT NULL,
c Nullable(INT)
) engine=Memory(); --{serverError 377}
SET data_type_default_nullable='true';
CREATE TABLE set_null (
a INT NULL,
b INT NOT NULL,
c Nullable(INT),
d INT
) engine=Memory();
INSERT INTO set_null VALUES (1, 2, 3, 4);
SELECT toTypeName(a), toTypeName(b), toTypeName(c), toTypeName(d) FROM set_null;