Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: can't adding new columns as primary key (#2310)
- Loading branch information
1 parent
f529fca
commit b1f5a88
Showing
4 changed files
with
86 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,25 @@ | ||
CREATE TABLE test(i INTEGER, j TIMESTAMP TIME INDEX); | ||
|
||
DESC TABLE test; | ||
|
||
INSERT INTO test VALUES (1, 1), (2, 2); | ||
|
||
ALTER TABLE test ADD COLUMN k INTEGER; | ||
|
||
SELECT * FROM test; | ||
|
||
DESC TABLE test; | ||
|
||
ALTER TABLE test ADD COLUMN host STRING PRIMARY KEY; | ||
|
||
SELECT * FROM test; | ||
|
||
DESC TABLE test; | ||
|
||
ALTER TABLE test ADD COLUMN idc STRING default "idc" PRIMARY KEY; | ||
|
||
SELECT * FROM test; | ||
|
||
DESC TABLE test; | ||
|
||
DROP TABLE test; |