From bd2cb1b62f5b73fd39125e057f1b8080022d3ef5 Mon Sep 17 00:00:00 2001 From: amashenkov Date: Tue, 7 May 2024 15:21:21 +0300 Subject: [PATCH 1/5] wip --- .../identifiers/test_long_identifiers.test | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test diff --git a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test new file mode 100644 index 00000000000..7851690c999 --- /dev/null +++ b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test @@ -0,0 +1,68 @@ +# name: sql/identifiers/test_long_identifiers.test +# description: SQL feature F391 (Long identifiers) +# group: [identifiers] + +statement ok +PRAGMA enable_verification + +statement ok +CREATE TABLE tableNameLongIdentifier (keyColumnLongIdentifier INTEGER, valueColumnLongIdentifier INTEGER, PRIMARY KEY (keyColumnLongIdentifier)) + +statement ok +ALTER TABLE tableNameLongIdentifier ADD COLUMN (newValueColumnLongIdentifier INTEGER) + +statement ok +ALTER TABLE tableNameLongIdentifier DROP COLUMN newValueColumnLongIdentifier + +query I +SELECT col_ FROM (VALUES (1), (2)) t(col_) +---- +1 +2 + +query I +SELECT 1 as col_ +---- +1 + +query I +SELECT 1 col_ +---- +1 + +query I +SELECT col_ FROM (SELECT 1 as col_) +---- +1 + +query I +SELECT col_ FROM (SELECT 1 col_) +---- +1 + +query I +SELECT col__ FROM (VALUES (1), (2)) t(col__) +---- +1 +2 + +statement ok +CREATE INDEX t_some_idx_ on t_ (val) + +statement ok +DROP INDEX t_some_idx_ + +statement ok +DROP TABLE t_ + +statement ok +CREATE ZONE zone_ WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3 + +statement ok +ALTER ZONE zone_ SET REPLICAS = 4 + +statement ok +ALTER ZONE zone_ RENAME TO another_zone_ + +statement ok +DROP ZONE another_zone_ From 4d054e9edd934bbd6b1181d10c9e96c7bd538959 Mon Sep 17 00:00:00 2001 From: amashenkov Date: Tue, 7 May 2024 18:17:24 +0300 Subject: [PATCH 2/5] Add feature tests --- .../identifiers/test_long_identifiers.test | 57 +++++++++++++------ 1 file changed, 41 insertions(+), 16 deletions(-) diff --git a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test index 7851690c999..8a3c039af3f 100644 --- a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test +++ b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test @@ -6,63 +6,88 @@ statement ok PRAGMA enable_verification statement ok -CREATE TABLE tableNameLongIdentifier (keyColumnLongIdentifier INTEGER, valueColumnLongIdentifier INTEGER, PRIMARY KEY (keyColumnLongIdentifier)) +CREATE TABLE someTableNameLongIdentifier (keyColumnLongIdentifier INTEGER, valueColumnLongIdentifier INTEGER, PRIMARY KEY (keyColumnLongIdentifier)); statement ok -ALTER TABLE tableNameLongIdentifier ADD COLUMN (newValueColumnLongIdentifier INTEGER) +ALTER TABLE someTableNameLongIdentifier ADD COLUMN (newValueColumnLongIdentifier INTEGER); statement ok -ALTER TABLE tableNameLongIdentifier DROP COLUMN newValueColumnLongIdentifier +ALTER TABLE someTableNameLongIdentifier DROP COLUMN newValueColumnLongIdentifier; + +statement ok +INSERT INTO someTableNameLongIdentifier (keyColumnLongIdentifier, valueColumnLongIdentifier) VALUES (1, 1), (2, 1); query I -SELECT col_ FROM (VALUES (1), (2)) t(col_) +SELECT columnAliasLongIdentifier FROM (VALUES (1), (2)) tableAliasLongIdentifier(columnAliasLongIdentifier); ---- 1 2 query I -SELECT 1 as col_ +SELECT 1 as columnAliasLongIdentifier ---- 1 query I -SELECT 1 col_ +SELECT 1 columnAliasLongIdentifier ---- 1 query I -SELECT col_ FROM (SELECT 1 as col_) +SELECT columnAliasLongIdentifier FROM (SELECT 1 as columnAliasLongIdentifier); ---- 1 query I -SELECT col_ FROM (SELECT 1 col_) +SELECT columnAliasLongIdentifier FROM (SELECT 1 columnAliasLongIdentifier); ---- 1 + query I -SELECT col__ FROM (VALUES (1), (2)) t(col__) +SELECT someTableNameLongIdentifier.keyColumnLongIdentifier FROM someTableNameLongIdentifier; ---- 1 2 +query II +SELECT keyColumnLongIdentifier, valueColumnLongIdentifier FROM someTableNameLongIdentifier ORDER BY keyColumnLongIdentifier DESC; +---- +2 1 +1 1 + +query II +SELECT valueColumnLongIdentifier, SUM(keyColumnLongIdentifier) FROM someTableNameLongIdentifier GROUP BY valueColumnLongIdentifier; +---- +1 3 + +query II +SELECT * FROM someTableNameLongIdentifier WHERE keyColumnLongIdentifier = 2; +---- +2 1 + +query I +SELECT columnAliasLongIdentifier FROM (SELECT 1 columnAliasLongIdentifier) WHERE columnAliasLongIdentifier = 1; +---- +1 + statement ok -CREATE INDEX t_some_idx_ on t_ (val) +CREATE INDEX someIndexNameLongIdentifier on someTableNameLongIdentifier (valueColumnLongIdentifier); statement ok -DROP INDEX t_some_idx_ +DROP INDEX someIndexNameLongIdentifier; statement ok -DROP TABLE t_ +DROP TABLE someTableNameLongIdentifier; statement ok -CREATE ZONE zone_ WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3 +CREATE ZONE someZoneNameLongIdentifier WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; statement ok -ALTER ZONE zone_ SET REPLICAS = 4 +ALTER ZONE someZoneNameLongIdentifier SET REPLICAS = 4; statement ok -ALTER ZONE zone_ RENAME TO another_zone_ +ALTER ZONE someZoneNameLongIdentifier RENAME TO anotherZoneNameLongIdentifier; statement ok -DROP ZONE another_zone_ +DROP ZONE anotherZoneNameLongIdentifier; From d5ae5e6f6cd8c93109b9fe464934b0ad18a97598 Mon Sep 17 00:00:00 2001 From: amashenkov Date: Wed, 8 May 2024 14:03:51 +0300 Subject: [PATCH 3/5] Minor --- .../identifiers/test_long_identifiers.test | 158 +++++++++++++++--- 1 file changed, 136 insertions(+), 22 deletions(-) diff --git a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test index 8a3c039af3f..39c69ee6a17 100644 --- a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test +++ b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test @@ -5,89 +5,203 @@ statement ok PRAGMA enable_verification +# Create table with short identifiers for test simplicity purpose statement ok -CREATE TABLE someTableNameLongIdentifier (keyColumnLongIdentifier INTEGER, valueColumnLongIdentifier INTEGER, PRIMARY KEY (keyColumnLongIdentifier)); +CREATE TABLE t (id INTEGER, val INTEGER, PRIMARY KEY (id)) +# Create table with long identifiers statement ok -ALTER TABLE someTableNameLongIdentifier ADD COLUMN (newValueColumnLongIdentifier INTEGER); +CREATE TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, PRIMARY KEY (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters)); +statement error +CREATE TABLE tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters (key INTEGER, val INTEGER, PRIMARY KEY (key)); + + +# Rename table with long identifiers +# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. +# statement error +# ALTER TABLE t RENAME TO tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; +# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. +# statement ok +# ALTER TABLE t RENAME TO tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; +# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. +# statement ok +# ALTER TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO tableName; + + +# Alter table add/drop column with long identifier statement ok -ALTER TABLE someTableNameLongIdentifier DROP COLUMN newValueColumnLongIdentifier; +ALTER TABLE t ADD COLUMN (columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER); + +statement error +ALTER TABLE t ADD COLUMN (columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters INTEGER); statement ok -INSERT INTO someTableNameLongIdentifier (keyColumnLongIdentifier, valueColumnLongIdentifier) VALUES (1, 1), (2, 1); +ALTER TABLE t DROP COLUMN (columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); + + +# Alter table rename column with long identifier +# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. +# statement error +# ALTER TABLE t RENAME COLUMN val TO columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; +# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. +# statement ok +# ALTER TABLE t RENAME COLUMN val TO columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; +# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. +# statement ok +# ALTER TABLE t RENAME COLUMN columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters TO val; + + +# Alter table with long identifier +statement ok +ALTER TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters ADD COLUMN columnName INTEGER; + +statement ok +ALTER TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters DROP COLUMN columnName; + +statement ok +INSERT INTO tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters, valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters) VALUES (1, 1), (2, 1); + +statement ok +INSERT INTO t (id, val) VALUES (1, 1), (2, 1); + + +# Aliases with long identifiers query I -SELECT columnAliasLongIdentifier FROM (VALUES (1), (2)) tableAliasLongIdentifier(columnAliasLongIdentifier); +SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (VALUES (1), (2)) tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters(columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); ---- 1 2 +statement error +SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (VALUES (1), (2)) t(columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); + +statement error +SELECT col FROM (VALUES (1), (2)) tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters(col); + query I -SELECT 1 as columnAliasLongIdentifier +SELECT 1 as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters ---- 1 query I -SELECT 1 columnAliasLongIdentifier +SELECT 1 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters ---- 1 +statement error +SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters + +statement error +SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters + +# Long column aliases with subquery query I -SELECT columnAliasLongIdentifier FROM (SELECT 1 as columnAliasLongIdentifier); +SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (SELECT 1 as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); ---- 1 query I -SELECT columnAliasLongIdentifier FROM (SELECT 1 columnAliasLongIdentifier); +SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (SELECT 1 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); ---- 1 +statement error +SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); + +statement error +SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); query I -SELECT someTableNameLongIdentifier.keyColumnLongIdentifier FROM someTableNameLongIdentifier; +SELECT tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; ---- 1 2 +# Long table alias +query I +SELECT tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.id FROM t as tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; +---- +1 +2 + +# Long identifier in ORDER BY clause query II -SELECT keyColumnLongIdentifier, valueColumnLongIdentifier FROM someTableNameLongIdentifier ORDER BY keyColumnLongIdentifier DESC; +SELECT * FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters ORDER BY keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters DESC; ---- 2 1 1 1 +query I +SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM t ORDER BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters DESC; +---- +2 +1 + +statement error +SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t ORDER BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters DESC; + + +# Long identifier in GROUP BY clause query II -SELECT valueColumnLongIdentifier, SUM(keyColumnLongIdentifier) FROM someTableNameLongIdentifier GROUP BY valueColumnLongIdentifier; +SELECT valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters, SUM(keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters) FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters GROUP BY valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; ---- 1 3 query II -SELECT * FROM someTableNameLongIdentifier WHERE keyColumnLongIdentifier = 2; +SELECT val as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters, SUM(id) FROM t GROUP BY columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; ---- -2 1 +1 3 +statement error +SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t GROUP BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; + + +# Long identifier in WHERE clause query I -SELECT columnAliasLongIdentifier FROM (SELECT 1 columnAliasLongIdentifier) WHERE columnAliasLongIdentifier = 1; +SELECT valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters WHERE valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters = 1; ---- 1 +1 + +# Index with long identifiers +statement ok +CREATE INDEX indexName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters on tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); + +statement ok +DROP INDEX indexName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; + +statement error +CREATE INDEX indexName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters on t (val); + +# Drop test tables statement ok -CREATE INDEX someIndexNameLongIdentifier on someTableNameLongIdentifier (valueColumnLongIdentifier); +DROP TABLE t; statement ok -DROP INDEX someIndexNameLongIdentifier; +DROP TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; + +# Zone with long identifier statement ok -DROP TABLE someTableNameLongIdentifier; +CREATE ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; + +statement error +CREATE ZONE zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; statement ok -CREATE ZONE someZoneNameLongIdentifier WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; +ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters SET REPLICAS = 4; statement ok -ALTER ZONE someZoneNameLongIdentifier SET REPLICAS = 4; +ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO zoneName; + +statement error +ALTER ZONE zoneName RENAME TO zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; statement ok -ALTER ZONE someZoneNameLongIdentifier RENAME TO anotherZoneNameLongIdentifier; +ALTER ZONE zoneName RENAME TO zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; statement ok -DROP ZONE anotherZoneNameLongIdentifier; +DROP ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; From 405c7c1fe99bc1ef085fb404e5f56c4e0b48e9aa Mon Sep 17 00:00:00 2001 From: amashenkov Date: Wed, 8 May 2024 14:05:24 +0300 Subject: [PATCH 4/5] Add todo --- .../integrationTest/sql/identifiers/test_long_identifiers.test | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test index 39c69ee6a17..f1039f7d0c8 100644 --- a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test +++ b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test @@ -2,6 +2,8 @@ # description: SQL feature F391 (Long identifiers) # group: [identifiers] +# TODO: IGNITE-19703 Add cases for long identifiers for schema names. + statement ok PRAGMA enable_verification From c05635763a9bb00c4d73d39c96ef399bc0a8fd42 Mon Sep 17 00:00:00 2001 From: amashenkov Date: Mon, 13 May 2024 18:07:25 +0300 Subject: [PATCH 5/5] Minor after review --- .../identifiers/test_long_identifiers.test | 80 ++++++++++++------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test index f1039f7d0c8..84ea70023cd 100644 --- a/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test +++ b/modules/sql-engine/src/integrationTest/sql/identifiers/test_long_identifiers.test @@ -15,27 +15,32 @@ CREATE TABLE t (id INTEGER, val INTEGER, PRIMARY KEY (id)) statement ok CREATE TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, PRIMARY KEY (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters)); -statement error +statement error: Failed to parse query: Length of identifier CREATE TABLE tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters (key INTEGER, val INTEGER, PRIMARY KEY (key)); # Rename table with long identifiers -# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. -# statement error -# ALTER TABLE t RENAME TO tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; -# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. -# statement ok -# ALTER TABLE t RENAME TO tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; -# TODO: Enable after https://issues.apache.org/jira/browse/IGNITE-19484 is fixed. -# statement ok -# ALTER TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO tableName; +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19484 +statement error: Failed to parse query: Length of identifier +ALTER TABLE t RENAME TO tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; + +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19484 +statement ok +ALTER TABLE t RENAME TO tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; + +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19484 +statement ok +ALTER TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO tableName; # Alter table add/drop column with long identifier statement ok ALTER TABLE t ADD COLUMN (columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER); -statement error +statement error: Failed to parse query: Length of identifier ALTER TABLE t ADD COLUMN (columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters INTEGER); statement ok @@ -43,15 +48,20 @@ ALTER TABLE t DROP COLUMN (columnName_veryLooooooooooooooooooooooooooooooooooooo # Alter table rename column with long identifier -# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. -# statement error -# ALTER TABLE t RENAME COLUMN val TO columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; -# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. -# statement ok -# ALTER TABLE t RENAME COLUMN val TO columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; -# TODO: IGNITE-19485, IGNITE-20315 - Uncomment this after column rename support gets aded. -# statement ok -# ALTER TABLE t RENAME COLUMN columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters TO val; +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19485 +statement error: Failed to parse query: Length of identifier +ALTER TABLE t RENAME COLUMN val TO columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; + +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19485 +statement ok +ALTER TABLE t RENAME COLUMN val TO columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; + +skipif ignite3 +# Ignored: https://issues.apache.org/jira/browse/IGNITE-19485 +statement ok +ALTER TABLE t RENAME COLUMN columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters TO val; # Alter table with long identifier @@ -76,10 +86,10 @@ SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooo 1 2 -statement error +statement error: Failed to parse query: Length of identifier SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (VALUES (1), (2)) t(columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); -statement error +statement error: Failed to parse query: Length of identifier SELECT col FROM (VALUES (1), (2)) tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters(col); query I @@ -92,10 +102,10 @@ SELECT 1 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooo ---- 1 -statement error +statement error: Failed to parse query: Length of identifier SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters -statement error +statement error: Failed to parse query: Length of identifier SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters # Long column aliases with subquery @@ -109,10 +119,10 @@ SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooo ---- 1 -statement error +statement error: Failed to parse query: Length of identifier SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); -statement error +statement error: Failed to parse query: Length of identifier SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); query I @@ -122,6 +132,14 @@ SELECT tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooo 2 # Long table alias +query I +SELECT * FROM (SELECT 1) as tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; +---- +1 + +statement error: Failed to parse query: Length of identifier +SELECT * FROM (SELECT 1) as tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; + query I SELECT tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.id FROM t as tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; ---- @@ -141,7 +159,7 @@ SELECT id as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooo 2 1 -statement error +statement error: Failed to parse query: Length of identifier SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t ORDER BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters DESC; @@ -156,7 +174,7 @@ SELECT val as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooo ---- 1 3 -statement error +statement error: Failed to parse query: Length of identifier SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t GROUP BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; @@ -174,7 +192,7 @@ CREATE INDEX indexName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooo statement ok DROP INDEX indexName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; -statement error +statement error: Failed to parse query: Length of identifier CREATE INDEX indexName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters on t (val); @@ -190,7 +208,7 @@ DROP TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooo statement ok CREATE ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; -statement error +statement error: Failed to parse query: Length of identifier CREATE ZONE zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; statement ok @@ -199,7 +217,7 @@ ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooo statement ok ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO zoneName; -statement error +statement error: Failed to parse query: Length of identifier ALTER ZONE zoneName RENAME TO zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; statement ok