Skip to content

Commit

Permalink
avoid mysterious bug
Browse files Browse the repository at this point in the history
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
  • Loading branch information
waynexia committed Mar 26, 2024
1 parent f497f29 commit 8d48088
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions tests/cases/standalone/common/alter/alter_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ INSERT INTO test_alt_table VALUES (1, 1, 0), (2, 2, 1);

Affected Rows: 2

ALTER TABLE test_alt_table ADD COLUMN k INTEGER PRIMARY KEY;
-- TODO: It may result in an error if `k` is with type INTEGER.
-- Error: 3001(EngineExecuteQuery), Invalid argument error: column types must match schema types, expected Int32 but found Utf8 at column index 3
ALTER TABLE test_alt_table ADD COLUMN k STRING PRIMARY KEY;

Affected Rows: 0

Expand All @@ -28,7 +30,7 @@ DESC TABLE test_alt_table;
| h | Int32 | PRI | YES | | TAG |
| i | Int32 | PRI | YES | | TAG |
| j | TimestampMillisecond | PRI | NO | | TIMESTAMP |
| k | Int32 | PRI | YES | | TAG |
| k | String | PRI | YES | | TAG |
+--------+----------------------+-----+------+---------+---------------+

SELECT * FROM test_alt_table;
Expand Down Expand Up @@ -61,7 +63,7 @@ DESC TABLE test_alt_table;
| h | Int32 | PRI | YES | | TAG |
| i | Int32 | PRI | YES | | TAG |
| j | TimestampMillisecond | PRI | NO | | TIMESTAMP |
| k | Int32 | PRI | YES | | TAG |
| k | String | PRI | YES | | TAG |
| m | Int32 | | YES | | FIELD |
+--------+----------------------+-----+------+---------+---------------+

Expand Down
4 changes: 3 additions & 1 deletion tests/cases/standalone/common/alter/alter_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ DESC TABLE test_alt_table;

INSERT INTO test_alt_table VALUES (1, 1, 0), (2, 2, 1);

ALTER TABLE test_alt_table ADD COLUMN k INTEGER PRIMARY KEY;
-- TODO: It may result in an error if `k` is with type INTEGER.
-- Error: 3001(EngineExecuteQuery), Invalid argument error: column types must match schema types, expected Int32 but found Utf8 at column index 3
ALTER TABLE test_alt_table ADD COLUMN k STRING PRIMARY KEY;

DESC TABLE test_alt_table;

Expand Down

0 comments on commit 8d48088

Please sign in to comment.