Add support for SET autocommit=ON/OFF#4220
Add support for SET autocommit=ON/OFF#4220sougou merged 3 commits intovitessio:masterfrom kuba--:set-autocommit
Conversation
Signed-off-by: kuba-- <kuba@sourced.tech>
Signed-off-by: kuba-- <kuba@sourced.tech>
sougou
left a comment
There was a problem hiding this comment.
Nice work 👍
- Looks like we missed the test for
ON(consequentlyOFF) in parse_test.go. Can you add the two cases? - The goyacc version you used doesn't agree with the one used by Travis. So, that test is failing. Can you update (probably the latest version) and regenerate sql.go?
Signed-off-by: kuba-- <kuba@sourced.tech>
|
@sougou - I've added tests for parser. So it's hard to say why it generates different ) Just for info. I've just ran |
|
In that case, we may have to update goyacc on the vitess side. I'll push this through if that's the only test failing. |
|
ok, cool. btw. I've modified sql.go manually so the latest build passed ;) |
|
@sougou We're just catching up on upstream changes and I noticed this PR adds This seems like a different behavior from mysql upstream (unlike |
|
@demmer - I think, if we move OFF from keywords to non-keywords in |
|
Yeah -- I understand why this was added.. I guess my question is whether |
|
I believe non-reserved keyword and Could be convinced otherwise. No strong feeling in particular. |
|
Actually I meant the complete opposite.... I don't think we should have keywords which aren't in mysql (and aren't for some vitess-specific use case) even if they are non-reserved. But I could be convinced otherwise as well. |
|
#3896 |
Signed-off-by: kuba-- kuba@sourced.tech
Some drivers (notably Python's mysql-connector) set some variables by using ON and OFF rather than using 1 and 0, e.g:
SET @@session.autocommit=OFFSET @@session.autocommit=ONSo far, we have support for
ONbutOFFwas missed. That's whyOFFstatements expression (sqlparser.Expr) has incorrect type (*sqlparser.ColName, instead of `*sqlparser.SQLVal).This PR adds support also for
OFFvalue for SET expressions.