This is an automated email from the ASF dual-hosted git repository.
amashenkov pushed a commit to branch ignite-21941
in repository https://gitbox.apache.org/repos/asf/ignite-3.git
The following commit(s) were added to refs/heads/ignite-21941 by this push:
new d5ae5e6f6c Minor
d5ae5e6f6c is described below
commit d5ae5e6f6cd8c93109b9fe464934b0ad18a97598
Author: amashenkov <[email protected]>
AuthorDate: Wed May 8 14:03:51 2024 +0300
Minor
---
.../sql/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 8a3c039af3..39c69ee6a1 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_veryLooooooooooooooooooooooooooooooooooooooooo [...]
+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_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
[...]
----
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;