Skip to content

Commit

Permalink
sql: regression test for MVCC timestamp in materialized views
Browse files Browse the repository at this point in the history
Before abeaf01 this test would have
failed, so this test will help make sure we don't regress.

Release note: None
  • Loading branch information
rafiss committed Mar 30, 2022
1 parent b9a6752 commit 0c87e17
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/sql/logictest/testdata/logic_test/materialized_view
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ SELECT * FROM v
3 4
5 6

let $orig_crdb_timestamp
SELECT max(crdb_internal_mvcc_timestamp) FROM v

# Now refresh the view.
statement ok
REFRESH MATERIALIZED VIEW v
Expand All @@ -42,6 +45,12 @@ SELECT * FROM v
5 6
7 8

# Verify that crdb_internal_mvcc_timestamp is updated for all rows.
query I
SELECT count(*) FROM v WHERE crdb_internal_mvcc_timestamp > $orig_crdb_timestamp
----
4

# Now add an index to the view, and use it.
statement ok
CREATE INDEX i ON v (y)
Expand Down

0 comments on commit 0c87e17

Please sign in to comment.