forked from databendlabs/databend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from dantengsky/sky_fan_snapshot2
chore: tweak logic test & code comment
- Loading branch information
Showing
5 changed files
with
91 additions
and
17 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
59 changes: 59 additions & 0 deletions
59
tests/sqllogictests/suites/base/14_transaction/14_0005_snapshots.test
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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
statement ok | ||
create or replace database test_txn_snapshots; | ||
|
||
statement ok | ||
use test_txn_snapshots; | ||
|
||
statement ok | ||
create or replace table t(c int); | ||
|
||
|
||
################################### | ||
# no snapshots left if tx aborted # | ||
################################### | ||
|
||
statement ok | ||
begin; | ||
|
||
statement ok | ||
insert into t values(1); | ||
|
||
statement ok | ||
insert into t values(1); | ||
|
||
statement ok | ||
rollback; | ||
|
||
query I | ||
select count() from fuse_snapshot('test_txn_snapshots', 't'); | ||
---- | ||
0 | ||
|
||
|
||
##################################################### | ||
# one snapshot left if table mutated multiple times # | ||
##################################################### | ||
|
||
|
||
|
||
statement ok | ||
begin; | ||
|
||
statement ok | ||
insert into t values(1); | ||
|
||
statement ok | ||
insert into t values(1); | ||
|
||
statement ok | ||
insert into t values(1); | ||
|
||
statement ok | ||
commit; | ||
|
||
query I | ||
select count() from fuse_snapshot('test_txn_snapshots', 't'); | ||
---- | ||
1 | ||
|
||
|