-
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.
Browse files
Browse the repository at this point in the history
fix restore table or database with keyword Approved by: @daviszhen, @heni02, @sukki37
- Loading branch information
Showing
4 changed files
with
60 additions
and
6 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
20 changes: 20 additions & 0 deletions
20
test/distributed/cases/snapshot/snapshot_restore_keyword.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,20 @@ | ||
drop account if exists `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; | ||
create account `01929da4-89af-7ed8-8f32-8df9ed5ddd71` admin_name = 'test_account' identified by '111'; | ||
drop account if exists `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
create account `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14` admin_name = 'test_account' identified by '111'; | ||
create database if not exists `mocloud_meta`; | ||
use `mocloud_meta`; | ||
create table if not exists `lock` (id int, name varchar(100)); | ||
insert into `lock` values(1, 'test'); | ||
select * from `mocloud_meta`.`lock`; | ||
id name | ||
1 test | ||
create snapshot metadb202411181350 for account `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; | ||
restore account `01929da4-89af-7ed8-8f32-8df9ed5ddd71` from snapshot metadb202411181350 to account `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
use `mocloud_meta`; | ||
select * from `mocloud_meta`.`lock`; | ||
id name | ||
1 test | ||
drop snapshot if exists metadb202411181350; | ||
drop account if exists `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
drop account if exists `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; |
31 changes: 31 additions & 0 deletions
31
test/distributed/cases/snapshot/snapshot_restore_keyword.sql
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,31 @@ | ||
drop account if exists `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; | ||
create account `01929da4-89af-7ed8-8f32-8df9ed5ddd71` admin_name = 'test_account' identified by '111'; | ||
|
||
drop account if exists `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
create account `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14` admin_name = 'test_account' identified by '111'; | ||
|
||
-- @session:id=1&user=01929da4-89af-7ed8-8f32-8df9ed5ddd71:test_account&password = 111 | ||
create database if not exists `mocloud_meta`; | ||
use `mocloud_meta`; | ||
create table if not exists `lock` (id int, name varchar(100)); | ||
insert into `lock` values(1, 'test'); | ||
select * from `mocloud_meta`.`lock`; | ||
-- @session | ||
|
||
|
||
|
||
create snapshot metadb202411181350 for account `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; | ||
|
||
-- @session:id=1&user=01929da4-89af-7ed8-8f32-8df9ed5ddd71:test_account&password = 111drop database if exists `mocloud_meta`; | ||
-- @session | ||
|
||
restore account `01929da4-89af-7ed8-8f32-8df9ed5ddd71` from snapshot metadb202411181350 to account `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
|
||
-- @session:id=2&user=0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14:test_account&password = 111 | ||
use `mocloud_meta`; | ||
select * from `mocloud_meta`.`lock`; | ||
-- @session | ||
|
||
drop snapshot if exists metadb202411181350; | ||
drop account if exists `0192fbbb-bfb0-7d54-a2fe-b7fd26dbdb14`; | ||
drop account if exists `01929da4-89af-7ed8-8f32-8df9ed5ddd71`; |