diff --git a/circle.yml b/circle.yml index 5e3e49a0e84a7..621621981ff83 100644 --- a/circle.yml +++ b/circle.yml @@ -3,7 +3,7 @@ version: 2 jobs: build: docker: - - image: golang:1.15 + - image: golang:1.16 working_directory: /go/src/github.com/pingcap/tidb steps: - checkout diff --git a/session/session_test.go b/session/session_test.go index 83c660c9edfe4..4e12b5fafa952 100644 --- a/session/session_test.go +++ b/session/session_test.go @@ -4207,11 +4207,10 @@ func (s *testSessionSerialSuite) TestParseWithParams(c *C) { c.Assert(err, IsNil) var sb strings.Builder - ctx := format.NewRestoreCtx(0, &sb) + ctx := format.NewRestoreCtx(format.RestoreStringDoubleQuotes, &sb) err = stmt.Restore(ctx) c.Assert(err, IsNil) - // FIXME: well... so the restore function is vulnerable... - c.Assert(sb.String(), Equals, "SELECT * FROM test WHERE name=_utf8mb4\xbf' OR 1=1 /* LIMIT 1") + c.Assert(sb.String(), Equals, "SELECT * FROM test WHERE name=_utf8mb4\"\xbf' OR 1=1 /*\" LIMIT 1") // test invalid sql _, err = exec.ParseWithParams(context.TODO(), "SELECT")