bug fix: use `column is None` when colValue is None. Thanks lubing.chen for reporting it

This commit is contained in:
danfengcao 2016-12-13 16:00:11 +08:00
parent 69ab881eff
commit 296542a029
3 changed files with 7 additions and 4 deletions

View File

@ -13,7 +13,7 @@ binlog2sql
项目状态
===
正常维护
正常维护。已在大众点评线上环境使用。线上环境的操作请在对MySQL熟悉的同学指导下进行
* 已测试环境
* Python 2.6, 2.7

View File

@ -66,7 +66,10 @@ def command_line_args():
def compare_items((k, v)):
#caution: if v is NULL, may need to process
return '`%s`=%%s'%k
if v is None:
return '`%s` IS %%s'%k
else:
return '`%s`=%%s'%k
def fix_object(value):
"""Fixes python objects so that they can be properly inserted into SQL queries"""

View File

@ -1,4 +1,4 @@
MySQL误操作后如何快速回滚
MySQL误操作后如何快速恢复数据
========================
基本上每个跟数据库打交道的程序员当然也可能是你同事都会碰一个问题MySQL误操作后如何快速回滚比如delete一张表忘加限制条件整张表都没了。假如这还是线上环境核心业务数据那这事就闹大了。误操作后能快速回滚数据是非常重要的。
@ -8,7 +8,7 @@ MySQL误操作后如何快速回滚
===
用全量备份重搭实例再利用增量binlog备份恢复到误操作之前的状态。然后跳过误操作的SQL再继续应用binlog。此法费时费力不值得再推荐。
binlog2sql快速回
利用binlog2sql快速
===
首先确认你的MySQL server开启了binlog设置了以下参数: