-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle create/drop sequence job type (#950)
1. handle create/drop sequence job type 2. ref pingcap/tidb#14954 TiDB will write a fake ddl binlog like: select setval(`seq`.`sequence_name`, 1000) when the value of sequence is changed for replicate the value of the sequence. we CAN NOT query the job from the tikv according the job id. just skip this kind of binlog now.
- Loading branch information
Showing
4 changed files
with
66 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
data-dir = '/tmp/tidb_binlog_test/data.drainer' | ||
|
||
[syncer] | ||
txn-batch = 1 | ||
worker-count = 1 | ||
safe-mode = false | ||
db-type = 'mysql' | ||
replicate-do-db = ['seq'] | ||
|
||
[syncer.to] | ||
host = '127.0.0.1' | ||
user = 'root' | ||
password = '' | ||
port = 3306 | ||
|
||
[syncer.to.checkpoint] | ||
schema = "seq_checkpoint" |
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,29 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
cd "$(dirname "$0")" | ||
|
||
run_drainer & | ||
|
||
sleep 3 | ||
|
||
run_sql 'CREATE DATABASE seq;' | ||
run_sql 'CREATE SEQUENCE seq.sequence_name;' | ||
run_sql 'CREATE TABLE seq.table_name (id INT DEFAULT NEXT VALUE FOR seq.sequence_name, val int);' | ||
|
||
run_sql 'INSERT INTO seq.table_name(val) values(10);' | ||
|
||
sleep 3 | ||
|
||
down_run_sql 'SELECT count(*), sum(id), sum(val) FROM seq.table_name;' | ||
check_contains 'count(*): 1' | ||
check_contains 'sum(id): 1' | ||
check_contains 'sum(val): 10' | ||
|
||
|
||
run_sql 'DROP TABLE seq.table_name;' | ||
run_sql 'DROP SEQUENCE seq.sequence_name;' | ||
|
||
|
||
killall drainer |