Added foreign_key_checks to ignored set

Signed-off-by: Saif Alharthi <saif@saifalharthi.me>
This commit is contained in:
Saif Alharthi 2019-10-18 14:20:32 -07:00
Родитель 63fef107a2
Коммит de27f61d03
3 изменённых файлов: 7 добавлений и 1 удалений

3
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

Просмотреть файл

@ -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":

Просмотреть файл

@ -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}},