From 1ba8e3f137bc1a74f834e0302ea6831db1d64ff0 Mon Sep 17 00:00:00 2001 From: Tanner Date: Tue, 4 Jun 2019 21:26:29 +0800 Subject: [PATCH] parser: add MySQL extension assignment support for VariableAssignment (#10700) --- expression/integration_test.go | 13 +++++++++++++ go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/expression/integration_test.go b/expression/integration_test.go index dc6b89f0a69a2..6c1c49f2494e5 100644 --- a/expression/integration_test.go +++ b/expression/integration_test.go @@ -4353,3 +4353,16 @@ func (s *testIntegrationSuite) TestIssue10181(c *C) { tk.MustExec(`insert into t values(9223372036854775807), (18446744073709551615)`) tk.MustQuery(`select * from t where a > 9223372036854775807-0.5 order by a`).Check(testkit.Rows(`9223372036854775807`, `18446744073709551615`)) } + +func (s *testIntegrationSuite) TestMySQLExtAssignment(c *C) { + tk := testkit.NewTestKit(c, s.store) + defer s.cleanEnv(c) + + tk.MustExec("use test") + tk.MustExec("set @@autocommit := on;") + tk.MustExec("set autocommit := on;") + tk.MustExec("set session autocommit := on;") + tk.MustExec("set global autocommit := on;") + tk.MustExec("set @count := 100;") + tk.MustExec("set @count := @count + 5;") +} diff --git a/go.mod b/go.mod index cda0a8de747ec..3936aa96c70a7 100644 --- a/go.mod +++ b/go.mod @@ -41,7 +41,7 @@ require ( github.com/pingcap/goleveldb v0.0.0-20171020122428-b9ff6c35079e github.com/pingcap/kvproto v0.0.0-20190517030054-ff2e03f6fdfe github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596 - github.com/pingcap/parser v0.0.0-20190603120328-7cb252e677b5 + github.com/pingcap/parser v0.0.0-20190604062806-1e93bd08fe82 github.com/pingcap/pd v0.0.0-20190424024702-bd1e2496a669 github.com/pingcap/tidb-tools v2.1.3-0.20190321065848-1e8b48f5c168+incompatible github.com/pingcap/tipb v0.0.0-20190428032612-535e1abaa330 diff --git a/go.sum b/go.sum index 9f659ea46b5c6..c64690e38dc2c 100644 --- a/go.sum +++ b/go.sum @@ -165,8 +165,8 @@ github.com/pingcap/kvproto v0.0.0-20190517030054-ff2e03f6fdfe/go.mod h1:QMdbTAXC github.com/pingcap/log v0.0.0-20190214045112-b37da76f67a7/go.mod h1:xsfkWVaFVV5B8e1K9seWfyJWFrIhbtUTAD8NV1Pq3+w= github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596 h1:t2OQTpPJnrPDGlvA+3FwJptMTt6MEPdzK1Wt99oaefQ= github.com/pingcap/log v0.0.0-20190307075452-bd41d9273596/go.mod h1:WpHUKhNZ18v116SvGrmjkA9CBhYmuUTKL+p8JC9ANEw= -github.com/pingcap/parser v0.0.0-20190603120328-7cb252e677b5 h1:Sk4qtg+9KIZAJVu/TtgL7r4JnNKQsYmvJmMOilA0RME= -github.com/pingcap/parser v0.0.0-20190603120328-7cb252e677b5/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= +github.com/pingcap/parser v0.0.0-20190604062806-1e93bd08fe82 h1:Xir4G43GOHOFioCI+wtVTv/ssCkGnMzZHzpF7ZfDxEs= +github.com/pingcap/parser v0.0.0-20190604062806-1e93bd08fe82/go.mod h1:1FNvfp9+J0wvc4kl8eGNh7Rqrxveg15jJoWo/a0uHwA= github.com/pingcap/pd v0.0.0-20190424024702-bd1e2496a669 h1:ZoKjndm/Ig7Ru/wojrQkc/YLUttUdQXoH77gtuWCvL4= github.com/pingcap/pd v0.0.0-20190424024702-bd1e2496a669/go.mod h1:MUCxRzOkYiWZtlyi4MhxjCIj9PgQQ/j+BLNGm7aUsnM= github.com/pingcap/tidb-tools v2.1.3-0.20190321065848-1e8b48f5c168+incompatible h1:MkWCxgZpJBgY2f4HtwWMMFzSBb3+JPzeJgF3VrXE/bU=