| # name: sql/identifiers/test_long_identifiers.test |
| # description: SQL feature F391 (Long identifiers) |
| # group: [identifiers] |
| |
| statement ok |
| PRAGMA enable_verification |
| |
| statement error: Non-query expression encountered in illegal context. |
| tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters |
| |
| statement error: Non-query expression encountered in illegal context. |
| SELECT 1; tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters |
| |
| # Create schema with long identifiers |
| statement ok |
| CREATE SCHEMA identifier_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| |
| statement error: Length of identifier |
| CREATE SCHEMA identifier_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; |
| |
| # Create schema and table with long identifiers |
| statement ok |
| CREATE TABLE identifier_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, PRIMARY KEY (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters)); |
| |
| statement ok |
| DROP SCHEMA identifier_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters CASCADE; |
| |
| |
| # Create table with short identifiers for test simplicity purpose |
| statement ok |
| CREATE TABLE t (id INTEGER, val INTEGER, PRIMARY KEY (id)) |
| |
| # Create table with long identifiers |
| statement ok |
| CREATE TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters INTEGER, PRIMARY KEY (keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters)); |
| |
| statement error: Length of identifier |
| CREATE TABLE tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters (key INTEGER, val INTEGER, PRIMARY KEY (key)); |
| |
| statement error: Length of identifier |
| SELECT * from t as tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; |
| |
| statement error: Length of identifier |
| SELECT * FROM t where 1 = (SELECT 1 from t as tableName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters LIMIT 1); |
| |
| statement error: Length of identifier |
| CREATE TABLE ttt (key type0Name_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters, val INTEGER, PRIMARY KEY (key)); |
| |
| statement error: Length of identifier |
| CREATE TABLE ttt (key type0Name_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters ARRAY, val INTEGER, PRIMARY KEY (key)); |
| |
| # Rename table with long identifiers |
| skipif ignite3 |
| # Ignored: https://issues.apache.org/jira/browse/IGNITE-19484 |
| statement error: 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: Length of identifier |
| ALTER TABLE t ADD COLUMN (columnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters INTEGER); |
| |
| statement ok |
| ALTER TABLE t DROP COLUMN (columnName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); |
| |
| |
| # Alter table rename column with long identifier |
| skipif ignite3 |
| # Ignored: https://issues.apache.org/jira/browse/IGNITE-19485 |
| statement error: 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 |
| 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 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (VALUES (1), (2)) tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters(columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); |
| ---- |
| 1 |
| 2 |
| |
| statement error: Length of identifier |
| SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (VALUES (1), (2)) t(columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); |
| |
| statement error: Length of identifier |
| SELECT col FROM (VALUES (1), (2)) tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters(col); |
| |
| query I |
| SELECT 1 as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters |
| ---- |
| 1 |
| |
| query I |
| SELECT 1 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters |
| ---- |
| 1 |
| |
| statement error: Length of identifier |
| SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters |
| |
| statement error: Length of identifier |
| SELECT * FROM (VALUES (1)) t(columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); |
| |
| statement error: Length of identifier |
| SELECT * FROM (VALUES (1)) tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters(c); |
| |
| statement error: Length of identifier |
| SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters |
| |
| # Long column aliases with subquery |
| query I |
| SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (SELECT 1 as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); |
| ---- |
| 1 |
| |
| query I |
| SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM (SELECT 1 columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters); |
| ---- |
| 1 |
| |
| statement error: Length of identifier |
| SELECT columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); |
| |
| statement error: Length of identifier |
| SELECT columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM (SELECT 1 columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters); |
| |
| query I rowsort |
| SELECT tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| ---- |
| 1 |
| 2 |
| |
| # Long table alias |
| query I |
| SELECT * FROM (SELECT 1) as tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| ---- |
| 1 |
| |
| statement error: Length of identifier |
| SELECT * FROM (SELECT 1) as tableAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; |
| |
| query I rowsort |
| SELECT tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters.id FROM t as tableAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| ---- |
| 1 |
| 2 |
| |
| # Long identifier in ORDER BY clause |
| query II |
| 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: Length of identifier |
| SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t ORDER BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters DESC; |
| |
| |
| # Long identifier in GROUP BY clause |
| query II |
| SELECT valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters, SUM(keyColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters) FROM tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters GROUP BY valueColumnName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| ---- |
| 1 3 |
| |
| query II |
| SELECT val as columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters, SUM(id) FROM t GROUP BY columnAlias_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| ---- |
| 1 3 |
| |
| statement error: Length of identifier |
| SELECT id as columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters FROM t GROUP BY columnAlias_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; |
| |
| statement error: Length of identifier |
| SELECT functionName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters(1, 2, 3) |
| |
| # Long identifier in WHERE clause |
| query I |
| 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: Length of identifier |
| CREATE INDEX indexName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters on t (val); |
| |
| |
| # Drop test tables |
| statement ok |
| DROP TABLE t; |
| |
| statement ok |
| DROP TABLE tableName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| |
| |
| # Zone with long identifier |
| statement ok |
| CREATE ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; |
| |
| statement error: Length of identifier |
| CREATE ZONE zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters WITH STORAGE_PROFILES='default', PARTITIONS=1, REPLICAS=3; |
| |
| statement ok |
| ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters SET REPLICAS = 4; |
| |
| statement ok |
| ALTER ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters RENAME TO zoneName; |
| |
| statement error: Length of identifier |
| ALTER ZONE zoneName RENAME TO zoneName_veryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf129Characters; |
| |
| statement ok |
| ALTER ZONE zoneName RENAME TO zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |
| |
| statement ok |
| DROP ZONE zoneName_veryLooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooongIdentifierOf128Characters; |