我正在使用 tidb 同步器将数据从 mysql 复制到 tidb。但我不完全理解警告“将拆分更改表语句”的含义。
我刚刚发布了下面的简单更改表查询。为什么拆分语句以及它如何影响我的 TiDB 的架构或数据。
ALTER TABLE `agg_url_base` ADD COLUMN `price` INT NULL AFTER `consumption`
下面有 TiDB 的 syncer 日志。
2019/02/11 07:45:44 meta.go:135: [info] save position to file, binlog-name:mysql-bin.000153 binlog-pos:15852122 binlog-gtid:
2019/02/11 07:45:46 ddl.go:103: [warning] will split alter table statement: ALTER TABLE `agg_url_base` ADD COLUMN `price` INT NULL AFTER `consumption`
2019/02/11 07:45:46 ast.go:508: [info] spec &{node:{text:} Tp:2 Name: Constraint:<nil> Options:[] NewTable:<nil> NewColumns:[0xc0003616c0] OldColumnName:<nil> Position:0xc0005d10a0 LockType:0 Comment: FromKey: ToKey: PartDefinitions:[] Num:0}
2019/02/11 07:45:46 ddl.go:107: [warning] splitted alter table statement: [ALTER TABLE `agg_url_base` ADD COLUMN `price` int(11) NULL AFTER `consumption`]
2019/02/11 07:45:46 syncer.go:745: [info] [query]ALTER TABLE `agg_url_base` ADD COLUMN `price` INT NULL AFTER `consumption` [current pos](mysql-bin.000153, 15852977) [next pos](mysql-bin.000153, 15853214) [current gtid set] [next gtid set]<nil>
2019/02/11 07:45:46 syncer.go:784: [info] [ddl][schema]adn [start]USE `adn`; ALTER TABLE `agg_url_base` ADD COLUMN `price` int(11) NULL AFTER `consumption`;
2019/02/11 07:45:47 meta.go:135: [info] save position to file, binlog-name:mysql-bin.000153 binlog-pos:15853214 binlog-gtid:
2019/02/11 07:45:47 syncer.go:792: [info] [ddl][end]USE `adn`; ALTER TABLE `agg_url_base` ADD COLUMN `price` int(11) NULL AFTER `consumption`;