From 3ff033b2f16ce68095eb400f84e7ceb5513ae83c Mon Sep 17 00:00:00 2001 From: agapple Date: Tue, 31 Jul 2018 17:31:31 +0800 Subject: [PATCH] Updated FAQ (markdown) --- FAQ.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/FAQ.md b/FAQ.md index 466bd9b..4bf7b58 100644 --- a/FAQ.md +++ b/FAQ.md @@ -1,13 +1,16 @@ 问1:INSERT/UPDATE/DELETE被解析为Query或DDL语句? + 答1: 出现这类情况主要原因为收到的binlog就为Query事件,比如: 1. binlog格式为非row模式,通过show variables like 'binlog\_format'可以查看. 针对statement/mixed模式,DML语句都会是以SQL语句存在 2. mysql5.6+之后,在binlog为row模式下,针对DML语句通过一个开关(binlog-rows-query-log-events=true),记录DML的原始SQL,对应binlog事件为RowsQueryLogEvent,同时也有对应的row记录. ps. canal可以通过properties设置来过滤:canal.instance.filter.query.dml = true + +--- -*** 问2:设置了数据表的过滤条件,但貌似没有生效? + 答2: 1. 首先看文档[AdminGuide](AdminGuide),了解canal.instance.filter.regex的书写格式 ```plain @@ -24,4 +27,5 @@ 3. 检查下CanalConnector是否调用subscribe(filter)方法;有的话,filter需要和instance.properties的canal.instance.filter.regex一致,否则subscribe的filter会覆盖instance的配置,如果subscribe的filter是.\*\\..\*,那么相当于你消费了所有的更新数据 【特别注意】 4. 检查一下[历史的issue列表](https://github.com/alibaba/canal/issues?utf8=%E2%9C%93&q=subscribe),很有可能你的提问别人已经遇到过并解决了,比如表达式不对,特别是双斜杠的问题 -*** \ No newline at end of file + +