Repository: vitessio/vitess
Pull request #6961 (2020-10-28 08:19:50)

Vitess Slack Guidelines v1.0
Signed-off-by: Alkin Tezuysal <alkin.tezuysal@gmail.com>


Patch:
diff --git a/doc/VitessSlackGuidelinesv1_0.md b/doc/VitessSlackGuidelinesv1_0.md
new file mode 100644
index 0000000000..5953d5e945
--- /dev/null
+++ b/doc/VitessSlackGuidelinesv1_0.md
@@ -0,0 +1,15 @@
+# Vitess Slack Guidelines v1.0
+
+The [CNCF Code of Conduct](https://github.com/cncf/foundation/blob/master/code-of-conduct.md) applies in all areas in addition to these rules:
+
+## Channel Spamming
+Slack is our best communication medium for the community. Please keep your messages on topic for each channel, and please use the appropriate channel. Spamming channels with unrelated or marketing messages is not allowed.
+
+## Unwanted Solicitation through Private Messages
+Directly messaging users (unless the user has specifically requested the information) offering services, events, employment opportunities or freelance projects, is not allowed.
+
+### Unwanted Voice/Video Calling
+Abuse of the voice/video calling features to call users without their permission is not allowed. Accidents sometimes happen, let the user know it was a mistake.
+
+## Reporting a Problem, Issue, or Bug
+To report a problem the best way to get attention is to create a GitHub [issue](https://github.com/vitessio/vitess/issues ). You may post a follow-up question on the #general channel.
diff --git a/docker/lite/install_dependencies.sh b/docker/lite/install_dependencies.sh
index 1afff6e3f4..381d38ce16 100755
--- a/docker/lite/install_dependencies.sh
+++ b/docker/lite/install_dependencies.sh
@@ -56,8 +56,7 @@ mysql56)
         libmysqlclient18
         mysql-client
         mysql-server
-        libcurl3
-        percona-xtrabackup
+        percona-xtrabackup-24
     )
     ;;
 mysql57)
@@ -98,9 +97,8 @@ mysql80)
     ;;
 percona)
     PACKAGES=(
-        libcurl3
         percona-server-server-5.6
-        percona-xtrabackup
+        percona-xtrabackup-24
     )
     ;;
 percona57)
@@ -148,7 +146,7 @@ add_apt_key 9334A25F8507EFA5
 # Add extra apt repositories for MySQL.
 case "${FLAVOR}" in
 mysql56)
-    echo 'deb http://repo.mysql.com/apt/debian/ stretch mysql-5.6' > /etc/apt/sources.list.d/mysql.list
+    echo 'deb http://repo.mysql.com/apt/debian/ buster mysql-5.6' > /etc/apt/sources.list.d/mysql.list
     ;;
 mysql57)
     echo 'deb http://repo.mysql.com/apt/debian/ buster mysql-5.7' > /etc/apt/sources.list.d/mysql.list
@@ -157,7 +155,7 @@ mysql80)
     echo 'deb http://repo.mysql.com/apt/debian/ buster mysql-8.0' > /etc/apt/sources.list.d/mysql.list
     ;;
 mariadb)
-    echo 'deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian stretch main' > /etc/apt/sources.list.d/mariadb.list
+    echo 'deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.2/debian buster main' > /etc/apt/sources.list.d/mariadb.list
     ;;
 mariadb103)
     echo 'deb http://sfo1.mirrors.digitalocean.com/mariadb/repo/10.3/debian buster main' > /etc/apt/sources.list.d/mariadb.list
@@ -166,12 +164,7 @@ esac
 
 # Add extra apt repositories for Percona Server and/or Percona XtraBackup.
 case "${FLAVOR}" in
-percona|mysql56)
-    # 5.6 is no longer supported on buster
-    echo 'deb http://deb.debian.org/debian stretch main' > /etc/apt/sources.list.d/stretch.list
-    echo 'deb http://repo.percona.com/apt stretch main' > /etc/apt/sources.list.d/percona.list
-    ;;
-mysql57|mysql80|percona57)
+mysql56|mysql57|mysql80|percona|percona57)
     echo 'deb http://repo.percona.com/apt buster main' > /etc/apt/sources.list.d/percona.list
     ;;
 percona80)
diff --git a/go/vt/vtgate/planbuilder/set.go b/go/vt/vtgate/planbuilder/set.go
index 7a7558fe61..613298c86c 100644
--- a/go/vt/vtgate/planbuilder/set.go
+++ b/go/vt/vtgate/planbuilder/set.go
@@ -50,38 +50,36 @@ var sysVarPlanningFunc = map[string]planFunc{}
 
 func buildSetPlan(stmt *sqlparser.Set, vschema ContextVSchema) (engine.Primitive, error) {
 	var setOps []engine.SetOp
+	var setOp engine.SetOp
 	var err error
 
 	ec := new(expressionConverter)
 
 	for _, expr := range stmt.Exprs {
-		// AST struct has been prepared before getting here, so no scope here means that
-		// we have a UDV. If the original query didn't explicitly specify the scope, it
-		// would have been explictly set to sqlparser.SessionStr before reaching this
-		// phase of planning
 		switch expr.Scope {
 		case sqlparser.GlobalScope:
-			setOp, err := planSysVarCheckIgnore(expr, vschema, true)
-			if err != nil {
-				return nil, err
-			}
-			setOps = append(setOps, setOp)
+			return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "unsupported global scope in set: %s", sqlparser.String(expr))
+			// AST struct has been prepared before getting here, so no scope here means that
+			// we have a UDV. If the original query didn't explicitly specify the scope, it
+			// would have been explictly set to sqlparser.SessionStr before reaching this
+			// phase of planning
 		case sqlparser.ImplicitScope:
 			evalExpr, err := ec.convert(expr.Expr /*boolean*/, false /*identifierAsString*/, false)
 			if err != nil {
 				return nil, err
 			}
-			setOp := &engine.UserDefinedVariable{
+			setOp = &engine.UserDefinedVariable{
 				Name: expr.Name.Lowered(),
 				Expr: evalExpr,
 			}
+
 			setOps = append(setOps, setOp)
 		case sqlparser.SessionScope:
 			planFunc, ok := sysVarPlanningFunc[expr.Name.Lowered()]
 			if !ok {
 				return nil, vterrors.Errorf(vtrpcpb.Code_INVALID_ARGUMENT, "unsupported construct in set: %s", sqlparser.String(expr))
 			}
-			setOp, err := planFunc(expr, vschema, ec)
+			setOp, err = planFunc(expr, vschema, ec)
 			if err != nil {
 				return nil, err
 			}


Test patch:
diff --git a/go/vt/vtgate/executor_set_test.go b/go/vt/vtgate/executor_set_test.go
index 19e8d98060..c9fb9f1859 100644
--- a/go/vt/vtgate/executor_set_test.go
+++ b/go/vt/vtgate/executor_set_test.go
@@ -105,6 +105,12 @@ func TestExecutorSet(t *testing.T) {
 	}, {
 		in:  "set client_found_rows = false",
 		out: &vtgatepb.Session{Autocommit: true, Options: &querypb.ExecuteOptions{}},
+	}, {
+		in:  "set @@global.client_found_rows = 1",
+		err: "unsupported global scope in set: global client_found_rows = 1",
+	}, {
+		in:  "set global client_found_rows = 1",
+		err: "unsupported global scope in set: global client_found_rows = 1",
 	}, {
 		in:  "set global @@session.client_found_rows = 1",
 		err: "cannot use scope and @@",
@@ -263,8 +269,6 @@ func TestExecutorSetOp(t *testing.T) {
 		sqltypes.MakeTestResult(sqltypes.MakeTestFields("character_set_results", "varchar")),
 		sqltypes.MakeTestResult(sqltypes.MakeTestFields("character_set_results", "varchar")),
 		sqltypes.MakeTestResult(sqltypes.MakeTestFields("character_set_results", "varchar")),
-		sqltypes.MakeTestResult(sqltypes.MakeTestFields("client_found_rows", "int64")),
-		sqltypes.MakeTestResult(sqltypes.MakeTestFields("client_found_rows", "int64")),
 	})
 
 	testcases := []struct {
@@ -308,10 +312,6 @@ func TestExecutorSetOp(t *testing.T) {
 		in: "set character_set_results='latin1'",
 	}, {
 		in: "set character_set_results='abcd'",
-	}, {
-		in: "set @@global.client_found_rows = 1",
-	}, {
-		in: "set global client_found_rows = 1",
 	}}
 	for _, tcase := range testcases {
 		t.Run(tcase.in, func(t *testing.T) {
diff --git a/go/vt/vtgate/planbuilder/testdata/set_cases.txt b/go/vt/vtgate/planbuilder/testdata/set_cases.txt
index 02ea986cc1..c07ea13103 100644
--- a/go/vt/vtgate/planbuilder/testdata/set_cases.txt
+++ b/go/vt/vtgate/planbuilder/testdata/set_cases.txt
@@ -479,30 +479,3 @@
     ]
   }
 }
-
-# set global autocommit to default
-"set global autocommit = off"
-{
-  "QueryType": "SET",
-  "Original": "set global autocommit = off",
-  "Instructions": {
-    "OperatorType": "Set",
-    "Ops": [
-      {
-        "Type": "SysVarCheckAndIgnore",
-        "Name": "autocommit",
-        "Keyspace": {
-          "Name": "main",
-          "Sharded": false
-        },
-        "TargetDestination": {},
-        "Expr": "0"
-      }
-    ],
-    "Inputs": [
-      {
-        "OperatorType": "SingleRow"
-      }
-    ]
-  }
-}