Files
greptimedb/tests/cases/standalone/common/create/upper_case_table_name.result
Ruihang Xia 92a9802343 feat: canonicalize all unquoted identifier to lowercase (#2828)
* feat: canonicalize all unquoted identifier to lowercase

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* add more tests

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* test altering table

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* primary key declare

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix primary key declare

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* partition by and time index

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* remove redundent call to canonicalize

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2023-11-29 06:40:10 +00:00

107 lines
2.9 KiB
Plaintext

create database upper_case_table_name;
Affected Rows: 1
use upper_case_table_name;
Affected Rows: 0
create table "system_Metric"(ts timestamp time index);
Affected Rows: 0
insert into "system_Metric" values (0), (1);
Affected Rows: 2
select * from system_Metric;
Error: 3000(PlanQuery), Failed to plan SQL: Error during planning: Table not found: greptime.upper_case_table_name.system_metric
select * from "system_Metric";
+-------------------------+
| ts |
+-------------------------+
| 1970-01-01T00:00:00 |
| 1970-01-01T00:00:00.001 |
+-------------------------+
drop table "system_Metric";
Affected Rows: 0
create table "AbCdEfG"("CoLA" string, "cOlB" string, "tS" timestamp time index, primary key ("CoLA"));
Affected Rows: 0
desc table "AbCdEfG";
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| CoLA | String | PRI | YES | | TAG |
| cOlB | String | | YES | | FIELD |
| tS | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
-- unquoted table name and column name.
create table AbCdEfGe(CoLA string, cOlB string, tS timestamp time index, primary key (cOlA));
Affected Rows: 0
desc table aBcDeFgE;
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| cola | String | PRI | YES | | TAG |
| colb | String | | YES | | FIELD |
| ts | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
drop table "AbCdEfG";
Affected Rows: 0
drop table aBcDeFgE;
Affected Rows: 0
-- unquoted column name in partition
create table AbCdEfGe(
CoLA string PRIMARY KEY,
tS timestamp time index
) PARTITION BY RANGE COLUMNS (cOlA) (
PARTITION p0 VALUES LESS THAN (MAXVALUE)
);
Affected Rows: 0
drop table abcdefge;
Affected Rows: 0
-- unquoted column name in TIME INDEX
create table AbCdEfGe(CoLA string, tS timestamp, TIME INDEX (Ts));
Affected Rows: 0
desc table abcdefge;
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| cola | String | | YES | | FIELD |
| ts | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
drop table abcdefge;
Affected Rows: 0
use public;
Affected Rows: 0