Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add integration test for issue2437 #2481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/cases/standalone/common/alter/add_incorrect_col.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
CREATE TABLE table_should_not_break_after_incorrect_alter(i INTEGER, j TIMESTAMP TIME INDEX);

Affected Rows: 0

ALTER TABLE table_should_not_break_after_incorrect_alter ADD column k string NOT NULL;

Error: 1004(InvalidArguments), Invalid alter table(table_should_not_break_after_incorrect_alter) request: no default value for column k

INSERT INTO table_should_not_break_after_incorrect_alter VALUES (1, 1), (2, 2);

Affected Rows: 2

SELECT * FROM table_should_not_break_after_incorrect_alter;

+---+-------------------------+
| i | j |
+---+-------------------------+
| 1 | 1970-01-01T00:00:00.001 |
| 2 | 1970-01-01T00:00:00.002 |
+---+-------------------------+

DROP TABLE table_should_not_break_after_incorrect_alter;

Affected Rows: 1

9 changes: 9 additions & 0 deletions tests/cases/standalone/common/alter/add_incorrect_col.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
CREATE TABLE table_should_not_break_after_incorrect_alter(i INTEGER, j TIMESTAMP TIME INDEX);

ALTER TABLE table_should_not_break_after_incorrect_alter ADD column k string NOT NULL;

INSERT INTO table_should_not_break_after_incorrect_alter VALUES (1, 1), (2, 2);

SELECT * FROM table_should_not_break_after_incorrect_alter;

DROP TABLE table_should_not_break_after_incorrect_alter;