-
Notifications
You must be signed in to change notification settings - Fork 411
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
close #8450
- Loading branch information
1 parent
717405f
commit 006f532
Showing
8 changed files
with
220 additions
and
18 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Copyright 2023 PingCAP, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
## case 1, normal flashback without failpoints | ||
|
||
mysql> drop database if exists d1; | ||
mysql> drop database if exists d1_new; | ||
|
||
# non-partition table | ||
mysql> create database d1; | ||
mysql> create table d1.t3 (a int); | ||
mysql> insert into d1.t3 values(1); | ||
# partition table | ||
mysql> create table d1.t4(id INT NOT NULL,name VARCHAR(30)) PARTITION BY RANGE (id) ( PARTITION p0 VALUES LESS THAN (50),PARTITION p1 VALUES LESS THAN (100)); | ||
mysql> insert into d1.t4 values(1, 'abc'),(2, 'cde'),(53, 'efg'); | ||
|
||
mysql> alter table d1.t3 set tiflash replica 1; | ||
mysql> alter table d1.t4 set tiflash replica 1; | ||
func> wait_table d1 t3 t4 | ||
|
||
mysql> alter table d1.t3 add column b int; | ||
mysql> insert into d1.t3 values(2,2); | ||
mysql> alter table d1.t4 add column b int; | ||
|
||
mysql> drop database d1; | ||
|
||
mysql> flashback database d1 to d1_new | ||
mysql> set session tidb_isolation_read_engines='tiflash'; select * from d1_new.t3 order by a; | ||
+------+------+ | ||
| a | b | | ||
+------+------+ | ||
| 1 | NULL | | ||
| 2 | 2 | | ||
+------+------+ | ||
mysql> set session tidb_isolation_read_engines='tiflash'; select * from d1_new.t4 order by id; | ||
+----+------+------+ | ||
| id | name | b | | ||
+----+------+------+ | ||
| 1 | abc | NULL | | ||
| 2 | cde | NULL | | ||
| 53 | efg | NULL | | ||
+----+------+------+ | ||
|
||
# ensure the flashbacked table and database is not mark as tombstone | ||
>> DBGInvoke __enable_schema_sync_service('true') | ||
>> DBGInvoke __gc_schemas(18446744073709551615) | ||
|
||
mysql> set session tidb_isolation_read_engines='tiflash'; select * from d1_new.t3 order by a; | ||
+------+------+ | ||
| a | b | | ||
+------+------+ | ||
| 1 | NULL | | ||
| 2 | 2 | | ||
+------+------+ | ||
mysql> set session tidb_isolation_read_engines='tiflash'; select * from d1_new.t4 order by id; | ||
+----+------+------+ | ||
| id | name | b | | ||
+----+------+------+ | ||
| 1 | abc | NULL | | ||
| 2 | cde | NULL | | ||
| 53 | efg | NULL | | ||
+----+------+------+ | ||
|
||
# cleanup | ||
mysql> drop database if exists d1; | ||
mysql> drop database if exists d1_new; |