-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support create database/table level snapshot (#20850)
support create database/table level snapshot Approved by: @heni02, @daviszhen
- Loading branch information
Showing
3 changed files
with
357 additions
and
31 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
80 changes: 80 additions & 0 deletions
80
test/distributed/cases/snapshot/snapshot_database_level.result
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,80 @@ | ||
drop snapshot if exists sn1; | ||
create snapshot sn1 for database db1; | ||
internal error: database db1 does not exist | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop database if exists db1; | ||
create database if not exists db1; | ||
create snapshot sn2 for database db1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
sn2 2024-12-20 02:58:51.442498 database sys db1 | ||
drop database if exists db1; | ||
drop snapshot if exists sn2; | ||
drop snapshot if exists sn1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop account if exists acc01; | ||
create account acc01 admin_name = 'test_account' identified by '111'; | ||
drop snapshot if exists sn1; | ||
create snapshot sn1 for database db1; | ||
internal error: database db1 does not exist | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop database if exists db1; | ||
create database if not exists db1; | ||
create snapshot sn2 for database db1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
sn2 2024-12-20 02:58:51.951431 database acc01 db1 | ||
drop database if exists db1; | ||
drop snapshot if exists sn2; | ||
drop snapshot if exists sn1; | ||
drop account if exists acc1; | ||
drop snapshot if exists sn1; | ||
create snapshot sn1 for table db1 tbl1; | ||
internal error: table db1.tbl1 does not exist | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop database if exists db1; | ||
create database if not exists db1; | ||
create table db1.tbl1 (a int); | ||
insert into db1.tbl1 values (1), (2), (3); | ||
create snapshot sn2 for table db1 tbl1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
sn2 2024-12-20 02:58:52.013035 table sys db1 tbl1 | ||
drop database if exists db1; | ||
drop snapshot if exists sn2; | ||
drop snapshot if exists sn1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop account if exists acc01; | ||
create account acc01 admin_name = 'test_account' identified by '111'; | ||
drop snapshot if exists sn1; | ||
create snapshot sn1 for table db1 tbl1; | ||
internal error: table db1.tbl1 does not exist | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
drop database if exists db1; | ||
create database if not exists db1; | ||
create table db1.tbl1 (a int); | ||
insert into db1.tbl1 values (1), (2), (3); | ||
create snapshot sn2 for table db1 tbl1; | ||
show snapshots; | ||
SNAPSHOT_NAME TIMESTAMP SNAPSHOT_LEVEL ACCOUNT_NAME DATABASE_NAME TABLE_NAME | ||
sn2 2024-12-20 02:58:52.689975 table acc01 db1 tbl1 | ||
drop database if exists db1; | ||
drop snapshot if exists sn2; | ||
drop snapshot if exists sn1; | ||
drop account if exists acc1; | ||
create snapshot sn1 for account sys; | ||
create snapshot sn1 for account sys; | ||
internal error: snapshot sn1 already exists | ||
create snapshot if not exists sn1 for account sys; | ||
drop snapshot if exists sn1; | ||
create snapshot sn1 for database mo_catalog; | ||
internal error: can not create snapshot for current database mo_catalog | ||
create snapshot sn1 for table mo_catalog mo_user; | ||
internal error: can not create pitr for current table mo_catalog.mo_user | ||
drop snapshot if exists sn1; |
Oops, something went wrong.