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

test(frontend): add tests for schema change default value not to be refreshed (#17121) #20291

Merged
merged 1 commit into from
Jan 24, 2025
Merged
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
41 changes: 41 additions & 0 deletions e2e_test/ddl/alter_table_column_issue_17121.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# https://github.com/risingwavelabs/risingwave/issues/17121

statement ok
create table t(v int);

statement ok
insert into t values (1);

statement ok
alter table t add column now1 timestamptz default now();

# Epoch (then `now()`) will advance after `FLUSH`.
statement ok
flush;

statement ok
insert into t values (2);

statement ok
flush;

query I
select v from t order by now1;
----
1
2

# Add a new column again, causing the table to be replaced again.
statement ok
alter table t add column v2 varchar;

# We show that the "snapshot value" of `now1` does not get refreshed upon the above `ALTER TABLE`.
# Otherwise, the `now1` column of `v=1` would be greater than that of `v=2`.
query I
select v from t order by now1;
----
1
2

statement ok
drop table t;
Loading