Files
greptimedb/tests/cases/standalone/common/alter/rename_table.result
dennis zhuang be3ea0fae7 feat: improve datafusion external error and mysql error (#4362)
* feat: improve datafusion external error and mysql error

* chore: address CR comments and fix tests

---------

Co-authored-by: evenyag <realevenyag@gmail.com>
2024-07-16 07:01:09 +00:00

127 lines
3.5 KiB
Plaintext

CREATE TABLE t(i INTEGER, j TIMESTAMP TIME INDEX);
Affected Rows: 0
DESC TABLE t;
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| i | Int32 | | YES | | FIELD |
| j | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
INSERT INTO TABLE t VALUES (1, 1), (3, 3), (NULL, 4);
Affected Rows: 3
SELECT * from t;
+---+-------------------------+
| i | j |
+---+-------------------------+
| 1 | 1970-01-01T00:00:00.001 |
| 3 | 1970-01-01T00:00:00.003 |
| | 1970-01-01T00:00:00.004 |
+---+-------------------------+
ALTER TABLE t RENAME 'Hi👋';
Error: 1002(Unexpected), Unexpected, violated: Invalid table name: Hi👋
ALTER TABLE t RENAME new_table;
Affected Rows: 0
DESC TABLE t;
Error: 4001(TableNotFound), Table not found: t
SELECT * FROM t;
Error: 4001(TableNotFound), Failed to plan SQL: Table not found: greptime.public.t
CREATE TABLE t(i INTEGER, j TIMESTAMP TIME INDEX);
Affected Rows: 0
DESC TABLE new_table;
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| i | Int32 | | YES | | FIELD |
| j | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
-- SQLNESS ARG restart=true
SELECT * FROM new_table;
+---+-------------------------+
| i | j |
+---+-------------------------+
| 1 | 1970-01-01T00:00:00.001 |
| 3 | 1970-01-01T00:00:00.003 |
| | 1970-01-01T00:00:00.004 |
+---+-------------------------+
ALTER TABLE new_table RENAME new_table;
Error: 4000(TableAlreadyExists), Table already exists, table: greptime.public.new_table
ALTER TABLE new_table RENAME t;
Error: 4000(TableAlreadyExists), Table already exists, table: greptime.public.t
DROP TABLE t;
Affected Rows: 0
DROP TABLE new_table;
Affected Rows: 0
CREATE TABLE "AbCdE"("CoLa" INTEGER, "cOlB" TIMESTAMP TIME INDEX);
Affected Rows: 0
ALTER TABLE "AbCdE" RENAME "fGhI";
Affected Rows: 0
DESC TABLE "fGhI";
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| CoLa | Int32 | | YES | | FIELD |
| cOlB | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
SELECT * FROM "fGhI";
++
++
ALTER TABLE "fGhI" RENAME JkLmN;
Affected Rows: 0
DESC TABLE "JkLmN";
Error: 4001(TableNotFound), Table not found: JkLmN
DESC TABLE JkLmN;
+--------+----------------------+-----+------+---------+---------------+
| Column | Type | Key | Null | Default | Semantic Type |
+--------+----------------------+-----+------+---------+---------------+
| CoLa | Int32 | | YES | | FIELD |
| cOlB | TimestampMillisecond | PRI | NO | | TIMESTAMP |
+--------+----------------------+-----+------+---------+---------------+
DROP TABLE jklmn;
Affected Rows: 0