Skip to content

Commit

Permalink
tests(ticdc): add exchange partition test to lossy DDL case (#8912)
Browse files Browse the repository at this point in the history
close #8686
  • Loading branch information
Rustin170506 authored May 8, 2023
1 parent c9d276f commit 4dc30e9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions tests/integration_tests/lossy_ddl/data/prepare.sql
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,21 @@ INSERT INTO example15 (id, b)
VALUES (1, -1);
ALTER TABLE example15 MODIFY COLUMN b INT UNSIGNED;

-- exchange partition
CREATE TABLE example16
(
a INT PRIMARY KEY
) PARTITION BY RANGE ( a ) ( PARTITION p0 VALUES LESS THAN (6),PARTITION p1 VALUES LESS THAN (11),PARTITION p2 VALUES LESS THAN (21));
INSERT INTO example16
VALUES (1);
CREATE TABLE example17
(
a int primary key
);
INSERT INTO example17
VALUES (18);
ALTER TABLE example16 EXCHANGE PARTITION p2 WITH TABLE example17;

CREATE TABLE `finish_mark`
(
id INT PRIMARY KEY,
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_tests/lossy_ddl/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function check_lossy_ddl() {
row_logs=$(grep "BlackHoleSink: WriteEvents" "$1/cdc.log")
echo $row_logs
row_logs_count=$(grep "BlackHoleSink: WriteEvents" -c "$1/cdc.log")
if [[ "$row_logs_count" -ne 16 ]]; then
echo "can't found 16 row logs, got $row_logs_count"
if [[ "$row_logs_count" -ne 18 ]]; then
echo "can't found 18 row logs, got $row_logs_count"
exit 1
fi
}
Expand Down

0 comments on commit 4dc30e9

Please sign in to comment.