提交 72a9ffc0 编写于 作者: martianzhang's avatar martianzhang
上级 a75d1c65
......@@ -36,6 +36,8 @@ where col = 1
tb;
18
-- comment
19 INSERT /*+ SET_VAR(foreign_key_checks=OFF) */ INTO t2 VALUES(2);
20 select /*!50000 1,*/ 1;
0 select * from test\Ghello
1 select 'hello\Gworld', col from test\Ghello
2 -- select * from test\Ghello
......
......@@ -898,8 +898,11 @@ func SplitStatement(buf []byte, delimiter []byte) (string, string, []byte) {
}
// multi line comment
// https://dev.mysql.com/doc/refman/8.0/en/comments.html
// https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html
if b == '/' && i+1 < len(buf) && buf[i+1] == '*' {
if !multiLineComment && !singleLineComment && !quoted && buf[i+2] != '!' {
if !multiLineComment && !singleLineComment && !quoted &&
(buf[i+2] != '!' && buf[i+2] != '+') {
i = i + 2
multiLineComment = true
continue
......
......@@ -166,6 +166,8 @@ select col from tb where col = 1;`),
select col from tb;
select col from tb;
`),
[]byte(`INSERT /*+ SET_VAR(foreign_key_checks=OFF) */ INTO t2 VALUES(2);`),
[]byte(`select /*!50000 1,*/ 1;`),
}
buf2s := [][]byte{
[]byte("select * from test\\Ghello"),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册