From 8e67f868a79ce034b4920dd5997388a4ee97a06f Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Fri, 1 Sep 2023 06:27:03 -0400 Subject: [PATCH 1/2] Sub=>Until Signed-off-by: Andrew Mason --- go/test/endtoend/throttler/util.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/test/endtoend/throttler/util.go b/go/test/endtoend/throttler/util.go index 8722c283409..40cfdb53118 100644 --- a/go/test/endtoend/throttler/util.go +++ b/go/test/endtoend/throttler/util.go @@ -79,7 +79,7 @@ func UpdateThrottlerTopoConfigRaw(vtctldProcess *cluster.VtctldClientProcess, ke } if appRule != nil { args = append(args, "--throttle-app", appRule.Name) - args = append(args, "--throttle-app-duration", protoutil.TimeFromProto(appRule.ExpiresAt).UTC().Sub(time.Now()).String()) + args = append(args, "--throttle-app-duration", time.Until(protoutil.TimeFromProto(appRule.ExpiresAt).UTC()).String()) args = append(args, "--throttle-app-ratio", fmt.Sprintf("%f", appRule.Ratio)) if appRule.Exempt { args = append(args, "--throttle-app-exempt") From 273500484278b53a2d9c374dc79c8424dab3e1e0 Mon Sep 17 00:00:00 2001 From: Andrew Mason Date: Fri, 1 Sep 2023 06:27:28 -0400 Subject: [PATCH 2/2] Fix bug due to quirk in concrete vs interface nil checks See https://go.dev/play/p/dLYXDE73nQS for a trivial example Signed-off-by: Andrew Mason --- go/vt/vtgate/planbuilder/operators/route_planning.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/route_planning.go b/go/vt/vtgate/planbuilder/operators/route_planning.go index fa8a12d97ac..6bf88e15847 100644 --- a/go/vt/vtgate/planbuilder/operators/route_planning.go +++ b/go/vt/vtgate/planbuilder/operators/route_planning.go @@ -548,8 +548,9 @@ func unwrapDerivedTables(ctx *plancontext.PlanningContext, exp sqlparser.Expr) s } exp = semantics.RewriteDerivedTableExpression(exp, tbl) - exp = getColName(exp) - if exp == nil { + if col := getColName(exp); col != nil { + exp = col + } else { return nil } }