Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

表中含有text字段并且开启备份的情况下出错 #107

Closed
phaibin opened this issue Nov 13, 2019 · 6 comments
Closed

表中含有text字段并且开启备份的情况下出错 #107

phaibin opened this issue Nov 13, 2019 · 6 comments

Comments

@phaibin
Copy link

phaibin commented Nov 13, 2019

描述
表中含有text字段并且开启备份的情况下出错

重现

CREATE TABLE `activity_register` (
  `id` int(20) NOT NULL AUTO_INCREMENT,
  `flag_id` text NOT NULL,
  `gift_grant_num` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`) USING BTREE,
) ENGINE=InnoDB 

UPDATE `activity_register` SET `gift_grant_num` = 1 WHERE `id` = 1

环境

  • 数据库: mysql
  • 版本: 5.6.39

参数

# IP地址
host = "0.0.0.0"
# 端口
port = 4000
# TiDB数据库目录
path = "/tmp/tidb"

[log]
# 日志级别: debug, info, warn, error, fatal.
level = "info"

# 日志格式, one of json, text, console.
format = "text"

# 禁用时间戳输出
disable-timestamp = false

# 日志文件
[log.file]
# 日志文件名
filename = ""
# 日志文件的最大上限(MB)
max-size = 300
# Max日志文件的保存天数,默认值 `0`,即不清理
max-days = 0
# 要保留的最大旧日志文件数,默认值 `0`,即不清理
max-backups = 0
# 日志轮询,默认值 `true`,即开启
log-rotate = true

[inc]

backup_host = "192.168.18.110"
backup_port = 3307
backup_user = "root"
backup_password = "123456"
max_update_rows = 10000000
check_primary_key = true
enable_blob_type = true
enable_identifer_keyword = true
enable_column_charset = true
enable_minimal_rollback = true

[osc]

osc_min_table_size = 0

[ghost]

ghost_on = true
ghost_aliyun_rds = true
ghost_allow_on_master = true
ghost_assume_rbr = true
ghost_approve_renamed_columns = true

[inc_level]

错误堆栈

2019/11/13 17:28:30.619 conn.go:424: [error] lastCmd
        /*--user=root;--password=password;--host=192.168.7.101;--port=3306;--execute=1;real_row_count=true;--backup=1;*/         inception_magic_start;        use `zuo`;        UPDATE `activity_register` SET `gift_grant_num` = 1 WHERE `id` = 1;         inception_magic_commit;
        , runtime error: comparing uncomparable type []uint8, goroutine 713 [running]:
github.com/hanchuanchuan/goInception/server.(*clientConn).Run.func1(0xc00a34c5b0, 0xc0004b1de7)
	/root/hcc/github.com/hanchuanchuan/goInception/server/conn.go:422 +0x106
panic(0x2281120, 0xc00a0f0880)
	/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/hanchuanchuan/goInception/session.(*session).generateUpdateSql(0xc000115700, 0xc00a18a000, 0xc00a135200, 0xc00a2f4a80, 0x1, 0x0, 0x0, 0x4)
	/root/hcc/github.com/hanchuanchuan/goInception/session/parser.go:658 +0x710
github.com/hanchuanchuan/goInception/session.(*session).Parser(0xc000115700, 0x27662a0, 0xc0001df980)
	/root/hcc/github.com/hanchuanchuan/goInception/session/parser.go:305 +0x102c
github.com/hanchuanchuan/goInception/session.(*session).executeCommit(0xc000115700, 0x27662a0, 0xc0001df980)
	/root/hcc/github.com/hanchuanchuan/goInception/session/session_inception.go:1066 +0x46b
github.com/hanchuanchuan/goInception/session.(*session).executeInc(0xc000115700, 0x27662a0, 0xc0001df980, 0xc00a366001, 0x10a, 0x0, 0x0, 0x0, 0x0, 0x0)
	/root/hcc/github.com/hanchuanchuan/goInception/session/session_inception.go:554 +0xd68
github.com/hanchuanchuan/goInception/session.(*session).ExecuteInc(0xc000115700, 0x27662a0, 0xc0001df980, 0xc00a366001, 0x10a, 0x0, 0x0, 0x0, 0x0, 0x0)
	/root/hcc/github.com/hanchuanchuan/goInception/session/session_inception.go:344 +0x320
github.com/hanchuanchuan/goInception/server.(*TiDBContext).Execute(0xc00a4369c0, 0x27662a0, 0xc0001df980, 0xc00a366001, 0x10a, 0xc0001e8a18, 0xc01bad0d70, 0x1bad0d70004b1c40, 0xc0004b1c40, 0x102c1cf)
	/root/hcc/github.com/hanchuanchuan/goInception/server/driver_tidb.go:259 +0x7c
github.com/hanchuanchuan/goInception/server.(*clientConn).handleQuery(0xc00a34c5b0, 0x27662a0, 0xc0001df980, 0xc00a366001, 0x10a, 0x0, 0x0)
	/root/hcc/github.com/hanchuanchuan/goInception/server/conn.go:886 +0x80
github.com/hanchuanchuan/goInception/server.(*clientConn).dispatch(0xc00a34c5b0, 0xc00a366001, 0x10b, 0x10b, 0x0, 0x0)
	/root/hcc/github.com/hanchuanchuan/goInception/server/conn.go:638 +0x535
github.com/hanchuanchuan/goInception/server.(*clientConn).Run(0xc00a34c5b0)
	/root/hcc/github.com/hanchuanchuan/goInception/server/conn.go:467 +0x158
github.com/hanchuanchuan/goInception/server.(*Server).onConn(0xc00032a620, 0x277b640, 0xc0001e0120)
	/root/hcc/github.com/hanchuanchuan/goInception/server/server.go:320 +0x201
created by github.com/hanchuanchuan/goInception/server.(*Server).Run
	/root/hcc/github.com/hanchuanchuan/goInception/server/server.go:265 +0x3ec
@hanchuanchuan
Copy link
Owner

该问题已修复, 会于下个版本中更新, 也可使用docker版本(最新).
另外, 可以临时关闭最小化日志功能, 以避免该问题 enable_minimal_rollback = false

@phaibin
Copy link
Author

phaibin commented Nov 13, 2019

👍

@hanchuanchuan
Copy link
Owner

新版本已发布,详细见 Release v1.1.3

@phaibin
Copy link
Author

phaibin commented Nov 14, 2019

下载了新版,但是对于含有text字段的表更新,并且开启了enable_minimal_rollback,更新的也不是text字段,并没有生成回滚语句,是不是还有问题?

@hanchuanchuan
Copy link
Owner

提示备份成功了吗?
另外, 在开启 enable_minimal_rollback 选项时,如果值没有变更, 会跳过该字段(不在回滚的update set中记录).

@phaibin
Copy link
Author

phaibin commented Nov 14, 2019

抱歉我的错,我的更新语句使用的是相同的值,换一个值就出现回滚语句了👍

@phaibin phaibin closed this as completed Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants