2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS ` test_foo_ #`;
CREATE TABLE ` test_foo_ #` (
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ; -- { serverError BAD_ARGUMENTS }
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS ` test_foo_ #`;
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE test_foo (
` insecure_ #` Int8,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ; -- { serverError BAD_ARGUMENTS }
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE test_foo (
` insecure_ ' ` Int8,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ; -- { serverError BAD_ARGUMENTS }
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE test_foo (
` insecure_ " ` Int8,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ; -- { serverError BAD_ARGUMENTS }
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE test_foo (
` secure_123 ` Int8 ,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ;
2024-09-12 08:36:55 +00:00
2024-10-03 16:45:39 +00:00
SHOW CREATE TABLE test_foo
2024-09-12 08:36:55 +00:00
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ;
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE test_foo (
` 123 _secure ` Int8 ,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date )
COMMENT ' test ' -- to end ENGINE definition, so SETTINGS will be in the query level
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ;
2024-09-12 08:36:55 +00:00
2024-10-03 16:45:39 +00:00
SHOW CREATE TABLE test_foo
2024-09-12 08:36:55 +00:00
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ;
2024-09-12 08:36:55 +00:00
2024-10-03 16:45:39 +00:00
-- CREATE TABLE without `enforce_strict_identifier_format`
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
CREATE TABLE ` test_foo ` (
` insecure_ $ ` Int8 ,
` date ` Date ,
` town ` LowCardinality ( String ) ,
)
ENGINE = MergeTree
PRIMARY KEY ( town , date )
PARTITION BY toYear ( date ) ;
2024-10-03 16:45:39 +00:00
-- Then SHOW CREATE .. with `enforce_strict_identifier_format`
2024-09-12 08:36:55 +00:00
-- While the result contains insecure identifiers (`insecure_$`), the `SHOW CREATE TABLE ...` query does not have any. So the query is expected to succeed.
2024-10-03 16:45:39 +00:00
SHOW CREATE TABLE test_foo
2024-09-12 08:36:55 +00:00
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ;
2024-09-12 08:36:55 +00:00
DROP TABLE IF EXISTS test_foo ;
2024-10-03 16:45:39 +00:00
-- SHOW CREATE .. query contains an insecure identifier (`test_foo$`) with `enforce_strict_identifier_format`
2024-09-12 08:36:55 +00:00
SHOW CREATE TABLE ` test_foo $ `
SETTINGS
2024-10-03 16:45:39 +00:00
enforce_strict_identifier_format = true ; -- { serverError BAD_ARGUMENTS }
2024-09-12 08:36:55 +00:00
2024-10-03 16:45:39 +00:00
DROP TABLE IF EXISTS test_foo ;