From de27f61d03493b7668387a2de6a82f4a1c2e7379 Mon Sep 17 00:00:00 2001 From: Saif Alharthi Date: Fri, 18 Oct 2019 14:20:32 -0700 Subject: [PATCH] Added foreign_key_checks to ignored set Signed-off-by: Saif Alharthi --- go.mod | 3 +++ go/vt/vtgate/executor.go | 2 +- go/vt/vtgate/executor_test.go | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index ae3b4d9aee..e3081b3479 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/golang/mock v1.3.1 github.com/golang/protobuf v1.3.2 github.com/golang/snappy v0.0.0-20170215233205-553a64147049 + github.com/google/btree v1.0.0 // indirect github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf // indirect github.com/gorilla/websocket v0.0.0-20160912153041-2d1e4548da23 github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 @@ -48,6 +49,8 @@ require ( github.com/minio/minio-go v0.0.0-20190131015406-c8a261de75c1 github.com/mitchellh/go-testing-interface v1.0.0 // indirect github.com/mitchellh/mapstructure v1.1.2 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.1 // indirect github.com/olekukonko/tablewriter v0.0.0-20160115111002-cca8bbc07984 github.com/opentracing-contrib/go-grpc v0.0.0-20180928155321-4b5a12d3ff02 github.com/opentracing/opentracing-go v1.1.0 diff --git a/go/vt/vtgate/executor.go b/go/vt/vtgate/executor.go index fccda5be8c..a6363848fc 100644 --- a/go/vt/vtgate/executor.go +++ b/go/vt/vtgate/executor.go @@ -628,7 +628,7 @@ func (e *Executor) handleSet(ctx context.Context, safeSession *SafeSession, sql if !ok { return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "unexpected value type for wait_timeout: %T", v) } - case "sql_mode", "net_write_timeout", "net_read_timeout", "lc_messages", "collation_connection": + case "sql_mode", "net_write_timeout", "net_read_timeout", "lc_messages", "collation_connection", "foreign_key_checks": log.Warningf("Ignored inapplicable SET %v = %v", k, v) warnings.Add("IgnoredSet", 1) case "charset", "names": diff --git a/go/vt/vtgate/executor_test.go b/go/vt/vtgate/executor_test.go index 953225cbae..8b0eda5e3c 100644 --- a/go/vt/vtgate/executor_test.go +++ b/go/vt/vtgate/executor_test.go @@ -437,6 +437,9 @@ func TestExecutorSet(t *testing.T) { }, { in: "set net_read_timeout = 600", out: &vtgatepb.Session{Autocommit: true}, + }, { + in: "set foreign_key_checks = 0", + out: &vtgatepb.Session{Autocommit: true}, }, { in: "set skip_query_plan_cache = 1", out: &vtgatepb.Session{Autocommit: true, Options: &querypb.ExecuteOptions{SkipQueryPlanCache: true}},