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

通过gh-ost执行包含``的语句,提示语法错误 #33

Closed
hhyo opened this issue May 26, 2019 · 1 comment
Closed

通过gh-ost执行包含``的语句,提示语法错误 #33

hhyo opened this issue May 26, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@hhyo
Copy link
Contributor

hhyo commented May 26, 2019

描述
v0.8.3 通过gh-ost执行包含``的语句,提示语法错误,去除`后正常
旧版本执行是正常的,不确定是哪个版本,docker镜像id:04ec51bc001f,构建于4 weeks ago

重现
配置开启ghost

osc_min_table_size = 0
ghost_on = true

执行语句

ALTER TABLE `archer_test`.`osc_test` DROP COLUMN `xx`;

结果

Execute: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\`xx\`' at line 1.

日志


time="2019/05/26 10:04:51.635" level=info msg="con:73 new connection 172.18.0.5:55140" file=server.go line=319
[2019/05/26 10:04:51] [info] binlogsyncer.go:133 create BinlogSyncer with config {99999 mysql mysql 3306 inception    false false <nil> false UTC true 0 0s 0s 0 false}
[2019/05/26 10:04:51] [info] binlogsyncer.go:354 begin to sync binlog from position (mysql-bin.000002, 101139950)
[2019/05/26 10:04:51] [info] binlogsyncer.go:203 register slave for master server mysql:3306
[2019/05/26 10:04:51] [info] binlogsyncer.go:723 rotate to (mysql-bin.000002, 101139950)
2019-05-26 10:04:51 ERROR Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\`xx\`' at line 1
2019-05-26 10:04:51 ERROR Unable to ALTER ghost table, see further error details. Bailing out
time="2019/05/26 10:04:51.886" level=error msg="Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\\`xx\\`' at line 1" file=osc.go line=532
time="2019/05/26 10:04:51.898" level=info msg="con:73 close connection" file=server.go line=321

去除`再次执行

ALTER TABLE `archer_test`.`osc_test` DROP COLUMN xx;

正常执行

环境

  • goInception: [v0.8.3] docker环境
[root@VM_0_15_centos ~]# docker images|grep goinception
hanchuanchuan/goinception   latest              12571ec1bcef        2 days ago          46.6MB
hanchuanchuan/goinception   <none>              04ec51bc001f        4 weeks ago         46.4MB
  • 数据库: [mysql]
  • 版本: [5.7.25-log]

参数

osc_min_table_size = 0
ghost_on = true
@hanchuanchuan hanchuanchuan added the bug Something isn't working label May 26, 2019
@hanchuanchuan
Copy link
Owner

感谢指出,问题已修复,docker镜像已经更新。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants