From aba21b03ae56cea7ed6cbe29a0821aca9c53d842 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 20 Apr 2023 12:22:44 +0530 Subject: [PATCH 01/21] use AliasTableExpr instead of TableName for insert table ast Signed-off-by: Harshit Gangal --- go/vt/sqlparser/ast.go | 2 +- go/vt/sqlparser/ast_clone.go | 2 +- go/vt/sqlparser/ast_copy_on_rewrite.go | 4 ++-- go/vt/sqlparser/ast_equals.go | 2 +- go/vt/sqlparser/ast_format.go | 6 +++--- go/vt/sqlparser/ast_format_fast.go | 6 +++--- go/vt/sqlparser/ast_funcs.go | 6 ++++++ go/vt/sqlparser/ast_rewrite.go | 4 ++-- go/vt/sqlparser/ast_visit.go | 2 +- go/vt/sqlparser/cached_size.go | 6 +++--- go/vt/sqlparser/sql.go | 4 ++-- go/vt/sqlparser/sql.y | 4 ++-- go/vt/vtgate/planbuilder/insert.go | 6 ++++-- .../tabletmanager/vreplication/controller_plan.go | 12 ++++++++---- go/vt/vttablet/tabletserver/planbuilder/builder.go | 7 +++++-- .../vttablet/tabletserver/planbuilder/permission.go | 2 +- 16 files changed, 45 insertions(+), 30 deletions(-) diff --git a/go/vt/sqlparser/ast.go b/go/vt/sqlparser/ast.go index 8fb980ca7e3..84157bf050a 100644 --- a/go/vt/sqlparser/ast.go +++ b/go/vt/sqlparser/ast.go @@ -325,7 +325,7 @@ type ( Action InsertAction Comments *ParsedComments Ignore Ignore - Table TableName + Table *AliasedTableExpr Partitions Partitions Columns Columns Rows InsertRows diff --git a/go/vt/sqlparser/ast_clone.go b/go/vt/sqlparser/ast_clone.go index 5df13c5addf..449c34d7f6a 100644 --- a/go/vt/sqlparser/ast_clone.go +++ b/go/vt/sqlparser/ast_clone.go @@ -1637,7 +1637,7 @@ func CloneRefOfInsert(n *Insert) *Insert { } out := *n out.Comments = CloneRefOfParsedComments(n.Comments) - out.Table = CloneTableName(n.Table) + out.Table = CloneRefOfAliasedTableExpr(n.Table) out.Partitions = ClonePartitions(n.Partitions) out.Columns = CloneColumns(n.Columns) out.Rows = CloneInsertRows(n.Rows) diff --git a/go/vt/sqlparser/ast_copy_on_rewrite.go b/go/vt/sqlparser/ast_copy_on_rewrite.go index f4680c26abd..967e4f262a5 100644 --- a/go/vt/sqlparser/ast_copy_on_rewrite.go +++ b/go/vt/sqlparser/ast_copy_on_rewrite.go @@ -2838,7 +2838,7 @@ func (c *cow) copyOnRewriteRefOfInsert(n *Insert, parent SQLNode) (out SQLNode, out = n if c.pre == nil || c.pre(n, parent) { _Comments, changedComments := c.copyOnRewriteRefOfParsedComments(n.Comments, n) - _Table, changedTable := c.copyOnRewriteTableName(n.Table, n) + _Table, changedTable := c.copyOnRewriteRefOfAliasedTableExpr(n.Table, n) _Partitions, changedPartitions := c.copyOnRewritePartitions(n.Partitions, n) _Columns, changedColumns := c.copyOnRewriteColumns(n.Columns, n) _Rows, changedRows := c.copyOnRewriteInsertRows(n.Rows, n) @@ -2846,7 +2846,7 @@ func (c *cow) copyOnRewriteRefOfInsert(n *Insert, parent SQLNode) (out SQLNode, if changedComments || changedTable || changedPartitions || changedColumns || changedRows || changedOnDup { res := *n res.Comments, _ = _Comments.(*ParsedComments) - res.Table, _ = _Table.(TableName) + res.Table, _ = _Table.(*AliasedTableExpr) res.Partitions, _ = _Partitions.(Partitions) res.Columns, _ = _Columns.(Columns) res.Rows, _ = _Rows.(InsertRows) diff --git a/go/vt/sqlparser/ast_equals.go b/go/vt/sqlparser/ast_equals.go index 1b455a9a907..39548161659 100644 --- a/go/vt/sqlparser/ast_equals.go +++ b/go/vt/sqlparser/ast_equals.go @@ -2907,7 +2907,7 @@ func (cmp *Comparator) RefOfInsert(a, b *Insert) bool { return a.Action == b.Action && cmp.RefOfParsedComments(a.Comments, b.Comments) && a.Ignore == b.Ignore && - cmp.TableName(a.Table, b.Table) && + cmp.RefOfAliasedTableExpr(a.Table, b.Table) && cmp.Partitions(a.Partitions, b.Partitions) && cmp.Columns(a.Columns, b.Columns) && cmp.InsertRows(a.Rows, b.Rows) && diff --git a/go/vt/sqlparser/ast_format.go b/go/vt/sqlparser/ast_format.go index aa86cc6293c..8883f752351 100644 --- a/go/vt/sqlparser/ast_format.go +++ b/go/vt/sqlparser/ast_format.go @@ -116,17 +116,17 @@ func (node *Insert) Format(buf *TrackedBuffer) { buf.astPrintf(node, "%s %v%sinto %v%v%v %v%v", InsertStr, node.Comments, node.Ignore.ToString(), - node.Table, node.Partitions, node.Columns, node.Rows, node.OnDup) + node.Table.Expr, node.Partitions, node.Columns, node.Rows, node.OnDup) case ReplaceAct: buf.astPrintf(node, "%s %v%sinto %v%v%v %v%v", ReplaceStr, node.Comments, node.Ignore.ToString(), - node.Table, node.Partitions, node.Columns, node.Rows, node.OnDup) + node.Table.Expr, node.Partitions, node.Columns, node.Rows, node.OnDup) default: buf.astPrintf(node, "%s %v%sinto %v%v%v %v%v", "Unkown Insert Action", node.Comments, node.Ignore.ToString(), - node.Table, node.Partitions, node.Columns, node.Rows, node.OnDup) + node.Table.Expr, node.Partitions, node.Columns, node.Rows, node.OnDup) } } diff --git a/go/vt/sqlparser/ast_format_fast.go b/go/vt/sqlparser/ast_format_fast.go index f13b504dacf..3286745e749 100644 --- a/go/vt/sqlparser/ast_format_fast.go +++ b/go/vt/sqlparser/ast_format_fast.go @@ -146,7 +146,7 @@ func (node *Insert) formatFast(buf *TrackedBuffer) { buf.WriteString(node.Ignore.ToString()) buf.WriteString("into ") - node.Table.formatFast(buf) + node.Table.Expr.formatFast(buf) node.Partitions.formatFast(buf) @@ -165,7 +165,7 @@ func (node *Insert) formatFast(buf *TrackedBuffer) { buf.WriteString(node.Ignore.ToString()) buf.WriteString("into ") - node.Table.formatFast(buf) + node.Table.Expr.formatFast(buf) node.Partitions.formatFast(buf) @@ -184,7 +184,7 @@ func (node *Insert) formatFast(buf *TrackedBuffer) { buf.WriteString(node.Ignore.ToString()) buf.WriteString("into ") - node.Table.formatFast(buf) + node.Table.Expr.formatFast(buf) node.Partitions.formatFast(buf) diff --git a/go/vt/sqlparser/ast_funcs.go b/go/vt/sqlparser/ast_funcs.go index 4138a5588c6..860d0f02a57 100644 --- a/go/vt/sqlparser/ast_funcs.go +++ b/go/vt/sqlparser/ast_funcs.go @@ -2401,3 +2401,9 @@ func (ty GeomFromWkbType) ToString() string { return "Unknown GeomFromWktType" } } + +func getAliasedTableExprFromTableName(tblName TableName) *AliasedTableExpr { + return &AliasedTableExpr{ + Expr: tblName, + } +} diff --git a/go/vt/sqlparser/ast_rewrite.go b/go/vt/sqlparser/ast_rewrite.go index c913411e224..1adaa601a71 100644 --- a/go/vt/sqlparser/ast_rewrite.go +++ b/go/vt/sqlparser/ast_rewrite.go @@ -3719,8 +3719,8 @@ func (a *application) rewriteRefOfInsert(parent SQLNode, node *Insert, replacer }) { return false } - if !a.rewriteTableName(node, node.Table, func(newNode, parent SQLNode) { - parent.(*Insert).Table = newNode.(TableName) + if !a.rewriteRefOfAliasedTableExpr(node, node.Table, func(newNode, parent SQLNode) { + parent.(*Insert).Table = newNode.(*AliasedTableExpr) }) { return false } diff --git a/go/vt/sqlparser/ast_visit.go b/go/vt/sqlparser/ast_visit.go index ac92cd6381d..281d8cfd4e1 100644 --- a/go/vt/sqlparser/ast_visit.go +++ b/go/vt/sqlparser/ast_visit.go @@ -2008,7 +2008,7 @@ func VisitRefOfInsert(in *Insert, f Visit) error { if err := VisitRefOfParsedComments(in.Comments, f); err != nil { return err } - if err := VisitTableName(in.Table, f); err != nil { + if err := VisitRefOfAliasedTableExpr(in.Table, f); err != nil { return err } if err := VisitPartitions(in.Partitions, f); err != nil { diff --git a/go/vt/sqlparser/cached_size.go b/go/vt/sqlparser/cached_size.go index 94786b16426..7e13ccde9ab 100644 --- a/go/vt/sqlparser/cached_size.go +++ b/go/vt/sqlparser/cached_size.go @@ -1858,12 +1858,12 @@ func (cached *Insert) CachedSize(alloc bool) int64 { } size := int64(0) if alloc { - size += int64(144) + size += int64(128) } // field Comments *vitess.io/vitess/go/vt/sqlparser.ParsedComments size += cached.Comments.CachedSize(true) - // field Table vitess.io/vitess/go/vt/sqlparser.TableName - size += cached.Table.CachedSize(false) + // field Table *vitess.io/vitess/go/vt/sqlparser.AliasedTableExpr + size += cached.Table.CachedSize(true) // field Partitions vitess.io/vitess/go/vt/sqlparser.Partitions { size += hack.RuntimeAllocSize(int64(cap(cached.Partitions)) * int64(32)) diff --git a/go/vt/sqlparser/sql.go b/go/vt/sqlparser/sql.go index 71db29d8ff8..14363fe10ee 100644 --- a/go/vt/sqlparser/sql.go +++ b/go/vt/sqlparser/sql.go @@ -10513,7 +10513,7 @@ yydefault: ins.Action = yyDollar[1].insertActionUnion() ins.Comments = Comments(yyDollar[2].strs).Parsed() ins.Ignore = yyDollar[3].ignoreUnion() - ins.Table = yyDollar[4].tableName + ins.Table = getAliasedTableExprFromTableName(yyDollar[4].tableName) ins.Partitions = yyDollar[5].partitionsUnion() ins.OnDup = OnDup(yyDollar[7].updateExprsUnion()) yyLOCAL = ins @@ -10530,7 +10530,7 @@ yydefault: cols = append(cols, updateList.Name.Name) vals = append(vals, updateList.Expr) } - yyLOCAL = &Insert{Action: yyDollar[1].insertActionUnion(), Comments: Comments(yyDollar[2].strs).Parsed(), Ignore: yyDollar[3].ignoreUnion(), Table: yyDollar[4].tableName, Partitions: yyDollar[5].partitionsUnion(), Columns: cols, Rows: Values{vals}, OnDup: OnDup(yyDollar[8].updateExprsUnion())} + yyLOCAL = &Insert{Action: yyDollar[1].insertActionUnion(), Comments: Comments(yyDollar[2].strs).Parsed(), Ignore: yyDollar[3].ignoreUnion(), Table: getAliasedTableExprFromTableName(yyDollar[4].tableName), Partitions: yyDollar[5].partitionsUnion(), Columns: cols, Rows: Values{vals}, OnDup: OnDup(yyDollar[8].updateExprsUnion())} } yyVAL.union = yyLOCAL case 86: diff --git a/go/vt/sqlparser/sql.y b/go/vt/sqlparser/sql.y index 179b90563ee..07e87670f3c 100644 --- a/go/vt/sqlparser/sql.y +++ b/go/vt/sqlparser/sql.y @@ -911,7 +911,7 @@ insert_statement: ins.Action = $1 ins.Comments = Comments($2).Parsed() ins.Ignore = $3 - ins.Table = $4 + ins.Table = getAliasedTableExprFromTableName($4) ins.Partitions = $5 ins.OnDup = OnDup($7) $$ = ins @@ -924,7 +924,7 @@ insert_statement: cols = append(cols, updateList.Name.Name) vals = append(vals, updateList.Expr) } - $$ = &Insert{Action: $1, Comments: Comments($2).Parsed(), Ignore: $3, Table: $4, Partitions: $5, Columns: cols, Rows: Values{vals}, OnDup: OnDup($8)} + $$ = &Insert{Action: $1, Comments: Comments($2).Parsed(), Ignore: $3, Table: getAliasedTableExprFromTableName($4), Partitions: $5, Columns: cols, Rows: Values{vals}, OnDup: OnDup($8)} } insert_or_replace: diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index cee42fb6d30..5693479ca47 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -38,13 +38,15 @@ func buildInsertPlan(stmt sqlparser.Statement, reservedVars *sqlparser.ReservedV if err != nil { return nil, err } - exprs := sqlparser.TableExprs{&sqlparser.AliasedTableExpr{Expr: ins.Table}} + exprs := sqlparser.TableExprs{ins.Table} rb, err := pb.processDMLTable(exprs, reservedVars, nil) if err != nil { return nil, err } // The table might have been routed to a different one. - ins.Table = exprs[0].(*sqlparser.AliasedTableExpr).Expr.(sqlparser.TableName) + ins.Table = exprs[0].(*sqlparser.AliasedTableExpr) + // remove any alias added from routing table. insert query does not support table alias. + ins.Table.As = sqlparser.NewIdentifierCS("") if rb.eroute.TargetDestination != nil { return nil, vterrors.VT12001("INSERT with a target destination") } diff --git a/go/vt/vttablet/tabletmanager/vreplication/controller_plan.go b/go/vt/vttablet/tabletmanager/vreplication/controller_plan.go index 26c08a4b447..5d2091d335d 100644 --- a/go/vt/vttablet/tabletmanager/vreplication/controller_plan.go +++ b/go/vt/vttablet/tabletmanager/vreplication/controller_plan.go @@ -81,10 +81,14 @@ func buildInsertPlan(ins *sqlparser.Insert) (*controllerPlan, error) { if ins == nil { return nil, fmt.Errorf("BUG: invalid nil INSERT statement found when building VReplication plan") } - if ins.Table.Qualifier.String() != sidecardb.GetName() && ins.Table.Qualifier.String() != sidecardb.DefaultName { - return nil, fmt.Errorf("invalid database name: %s", ins.Table.Qualifier.String()) + tableName, err := ins.Table.TableName() + if err != nil { + return nil, err } - switch ins.Table.Name.String() { + if tableName.Qualifier.String() != sidecardb.GetName() && tableName.Qualifier.String() != sidecardb.DefaultName { + return nil, fmt.Errorf("invalid database name: %s", tableName.Qualifier.String()) + } + switch tableName.Name.String() { case reshardingJournalTableName: return &controllerPlan{ opcode: reshardingJournalQuery, @@ -92,7 +96,7 @@ func buildInsertPlan(ins *sqlparser.Insert) (*controllerPlan, error) { case vreplicationTableName: // no-op default: - return nil, fmt.Errorf("invalid table name: %s", ins.Table.Name.String()) + return nil, fmt.Errorf("invalid table name: %s", tableName.Name.String()) } if ins.Action != sqlparser.InsertAct { return nil, fmt.Errorf("unsupported construct: %v", sqlparser.String(ins)) diff --git a/go/vt/vttablet/tabletserver/planbuilder/builder.go b/go/vt/vttablet/tabletserver/planbuilder/builder.go index a08b747e724..3cae292b593 100644 --- a/go/vt/vttablet/tabletserver/planbuilder/builder.go +++ b/go/vt/vttablet/tabletserver/planbuilder/builder.go @@ -123,8 +123,11 @@ func analyzeInsert(ins *sqlparser.Insert, tables map[string]*schema.Table) (plan FullQuery: GenerateFullQuery(ins), } - tableName := sqlparser.GetTableName(ins.Table) - plan.Table = tables[tableName.String()] + tableName, err := ins.Table.TableName() + if err != nil { + return nil, err + } + plan.Table = tables[sqlparser.GetTableName(tableName).String()] return plan, nil } diff --git a/go/vt/vttablet/tabletserver/planbuilder/permission.go b/go/vt/vttablet/tabletserver/planbuilder/permission.go index d68ff43a152..80b1410f438 100644 --- a/go/vt/vttablet/tabletserver/planbuilder/permission.go +++ b/go/vt/vttablet/tabletserver/planbuilder/permission.go @@ -39,7 +39,7 @@ func BuildPermissions(stmt sqlparser.Statement) []Permission { case *sqlparser.Union, *sqlparser.Select: permissions = buildSubqueryPermissions(node, tableacl.READER, permissions) case *sqlparser.Insert: - permissions = buildTableNamePermissions(node.Table, tableacl.WRITER, permissions) + permissions = buildTableExprPermissions(node.Table, tableacl.WRITER, permissions) permissions = buildSubqueryPermissions(node, tableacl.READER, permissions) case *sqlparser.Update: permissions = buildTableExprsPermissions(node.TableExprs, tableacl.WRITER, permissions) From e2fa858247f966b5379ca84da26e5ceb532e49d6 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 20 Apr 2023 19:52:14 +0530 Subject: [PATCH 02/21] gen4: insert unsharded query planner with shortcut support Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/builder.go | 6 +- go/vt/vtgate/planbuilder/gen4_planner.go | 63 ++++++++++++++++++ go/vt/vtgate/planbuilder/insert.go | 65 ++++++++++--------- .../planbuilder/testdata/dml_cases.json | 12 ++-- ...er_update_test.go => analyzer_dml_test.go} | 0 go/vt/vtgate/semantics/analyzer_test.go | 7 ++ go/vt/vtgate/semantics/scoper.go | 4 +- go/vt/vtgate/semantics/semantic_state.go | 1 + 8 files changed, 117 insertions(+), 41 deletions(-) rename go/vt/vtgate/semantics/{analyzer_update_test.go => analyzer_dml_test.go} (100%) diff --git a/go/vt/vtgate/planbuilder/builder.go b/go/vt/vtgate/planbuilder/builder.go index ae603532e03..7a38d18267c 100644 --- a/go/vt/vtgate/planbuilder/builder.go +++ b/go/vt/vtgate/planbuilder/builder.go @@ -214,7 +214,11 @@ func createInstructionFor(ctx context.Context, query string, stmt sqlparser.Stat } return buildRoutePlan(stmt, reservedVars, vschema, configuredPlanner) case *sqlparser.Insert: - return buildRoutePlan(stmt, reservedVars, vschema, buildInsertPlan) + configuredPlanner, err := getConfiguredPlanner(vschema, buildInsertPlan, stmt, query) + if err != nil { + return nil, err + } + return buildRoutePlan(stmt, reservedVars, vschema, configuredPlanner) case *sqlparser.Update: configuredPlanner, err := getConfiguredPlanner(vschema, buildUpdatePlan, stmt, query) if err != nil { diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index 6349edab2bc..b6aa5f37dc1 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -38,6 +38,8 @@ func gen4Planner(query string, plannerVersion querypb.ExecuteOptions_PlannerVers return gen4UpdateStmtPlanner(plannerVersion, stmt, reservedVars, vschema) case *sqlparser.Delete: return gen4DeleteStmtPlanner(plannerVersion, stmt, reservedVars, vschema) + case *sqlparser.Insert: + return gen4InsertStmtPlanner(plannerVersion, stmt, reservedVars, vschema) default: return nil, vterrors.VT12001(fmt.Sprintf("%T", stmt)) } @@ -408,6 +410,67 @@ func gen4DeleteStmtPlanner( return newPlanResult(plan.Primitive(), operators.TablesUsed(op)...), nil } +func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStmt *sqlparser.Insert, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { + ksName := "" + if ks, _ := vschema.DefaultKeyspace(); ks != nil { + ksName = ks.Name + } + semTable, err := semantics.Analyze(insStmt, ksName, vschema) + if err != nil { + return nil, err + } + // record any warning as planner warning. + vschema.PlannerWarning(semTable.Warning) + + err = rewriteRoutedTables(insStmt, vschema) + if err != nil { + return nil, err + } + + if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil { + eIns := &engine.Insert{} + eIns.Keyspace = ks + eIns.Table = tables[0] + eIns.Opcode = engine.InsertUnsharded + eIns.Query = generateQuery(insStmt) + return newPlanResult(eIns, operators.QualifiedTables(ks, tables)...), nil + } + + if semTable.NotUnshardedErr != nil { + return nil, semTable.NotUnshardedErr + } + + err = queryRewrite(semTable, reservedVars, insStmt) + if err != nil { + return nil, err + } + + ctx := plancontext.NewPlanningContext(reservedVars, semTable, vschema, version) + + op, err := operators.PlanQuery(ctx, insStmt) + if err != nil { + return nil, err + } + + plan, err := transformToLogicalPlan(ctx, op, true) + if err != nil { + return nil, err + } + + plan, err = pushCommentDirectivesOnPlan(plan, insStmt) + if err != nil { + return nil, err + } + + setLockOnAllSelect(plan) + + if err := plan.WireupGen4(ctx); err != nil { + return nil, err + } + + return newPlanResult(plan.Primitive(), operators.TablesUsed(op)...), nil +} + func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema) error { // Rewrite routed tables return sqlparser.Walk(func(node sqlparser.SQLNode) (kontinue bool, err error) { diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index 5693479ca47..00f343173b9 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -31,42 +31,43 @@ import ( ) // buildInsertPlan builds the route for an INSERT statement. -func buildInsertPlan(stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { - pb := newStmtAwarePrimitiveBuilder(vschema, newJointab(reservedVars), stmt) - ins := stmt.(*sqlparser.Insert) - err := checkUnsupportedExpressions(ins) +func buildInsertPlan(string) stmtPlanner { + return func(stmt sqlparser.Statement, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { + pb := newStmtAwarePrimitiveBuilder(vschema, newJointab(reservedVars), stmt) + ins := stmt.(*sqlparser.Insert) + err := checkUnsupportedExpressions(ins) if err != nil { return nil, err - } - exprs := sqlparser.TableExprs{ins.Table} - rb, err := pb.processDMLTable(exprs, reservedVars, nil) - if err != nil { - return nil, err - } - // The table might have been routed to a different one. - ins.Table = exprs[0].(*sqlparser.AliasedTableExpr) - // remove any alias added from routing table. insert query does not support table alias. - ins.Table.As = sqlparser.NewIdentifierCS("") - if rb.eroute.TargetDestination != nil { - return nil, vterrors.VT12001("INSERT with a target destination") - } + }exprs := sqlparser.TableExprs{ins.Table} + rb, err := pb.processDMLTable(exprs, reservedVars, nil) + if err != nil { + return nil, err + } + // The table might have been routed to a different one. + ins.Table = exprs[0].(*sqlparser.AliasedTableExpr) + // remove any alias added from routing table. insert query does not support table alias. + ins.Table.As = sqlparser.NewIdentifierCS("") + if rb.eroute.TargetDestination != nil { + return nil, vterrors.VT12001("INSERT with a target destination") + } - if len(pb.st.tables) != 1 { - // Unreachable. - return nil, vterrors.VT12001("multi-table INSERT statement in a sharded keyspace") - } - var vschemaTable *vindexes.Table - for _, tval := range pb.st.tables { - // There is only one table. - vschemaTable = tval.vschemaTable - } - if !rb.eroute.Keyspace.Sharded { - return buildInsertUnshardedPlan(ins, vschemaTable, reservedVars, vschema) - } - if ins.Action == sqlparser.ReplaceAct { - return nil, vterrors.VT12001("REPLACE INTO with sharded keyspace") + if len(pb.st.tables) != 1 { + // Unreachable. + return nil, vterrors.VT12001("multi-table INSERT statement in a sharded keyspace") + } + var vschemaTable *vindexes.Table + for _, tval := range pb.st.tables { + // There is only one table. + vschemaTable = tval.vschemaTable + } + if !rb.eroute.Keyspace.Sharded { + return buildInsertUnshardedPlan(ins, vschemaTable, reservedVars, vschema) + } + if ins.Action == sqlparser.ReplaceAct { + return nil, vterrors.VT12001("REPLACE INTO with sharded keyspace") + } + return buildInsertShardedPlan(ins, vschemaTable, reservedVars, vschema) } - return buildInsertShardedPlan(ins, vschemaTable, reservedVars, vschema) } func buildInsertUnshardedPlan(ins *sqlparser.Insert, table *vindexes.Table, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index f855ef7e957..c7d2bc7443f 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -1476,7 +1476,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "insert into unsharded select id from unsharded_auto for update", + "Query": "insert into unsharded select id from unsharded_auto", "TableName": "unsharded" }, "TablesUsed": [ @@ -1519,7 +1519,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "insert into unsharded select id from unsharded join unsharded_auto for update", + "Query": "insert into unsharded select id from unsharded join unsharded_auto", "TableName": "unsharded" }, "TablesUsed": [ @@ -2093,7 +2093,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "insert into unsharded select 1 from dual union select 1 from dual for update", + "Query": "insert into unsharded select 1 from dual union select 1 from dual", "TableName": "unsharded" }, "TablesUsed": [ @@ -2312,7 +2312,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "replace into unsharded select id from unsharded_auto for update", + "Query": "replace into unsharded select id from unsharded_auto", "TableName": "unsharded" }, "TablesUsed": [ @@ -3840,7 +3840,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "insert into user_privacy_consents(user_id, accepted_at) select user_id, accepted_at from (select 1 as user_id, 1629194864 as accepted_at from dual) as tmp where not exists (select 1 from user_privacy_consents where user_id = 1 limit 1) for update", + "Query": "insert into user_privacy_consents(user_id, accepted_at) select user_id, accepted_at from (select 1 as user_id, 1629194864 as accepted_at from dual) as tmp where not exists (select 1 from user_privacy_consents where user_id = 1 limit 1)", "TableName": "user_privacy_consents" }, "TablesUsed": [ @@ -5448,7 +5448,7 @@ }, "TargetTabletType": "PRIMARY", "MultiShardAutocommit": false, - "Query": "insert into unsharded(col) select col from unsharded_auto for update", + "Query": "insert into unsharded(col) select col from unsharded_auto", "TableName": "unsharded" }, "TablesUsed": [ diff --git a/go/vt/vtgate/semantics/analyzer_update_test.go b/go/vt/vtgate/semantics/analyzer_dml_test.go similarity index 100% rename from go/vt/vtgate/semantics/analyzer_update_test.go rename to go/vt/vtgate/semantics/analyzer_dml_test.go diff --git a/go/vt/vtgate/semantics/analyzer_test.go b/go/vt/vtgate/semantics/analyzer_test.go index b119e4dc8bc..6e20496246d 100644 --- a/go/vt/vtgate/semantics/analyzer_test.go +++ b/go/vt/vtgate/semantics/analyzer_test.go @@ -1427,6 +1427,13 @@ func TestSingleUnshardedKeyspace(t *testing.T) { {Keyspace: ks1, Name: sqlparser.NewIdentifierCS("t")}, {Keyspace: ks1, Name: sqlparser.NewIdentifierCS("t")}, }, + }, { + query: "insert into t select * from t", + unsharded: ks1, + tables: []*vindexes.Table{ + {Keyspace: ks1, Name: sqlparser.NewIdentifierCS("t")}, + {Keyspace: ks1, Name: sqlparser.NewIdentifierCS("t")}, + }, }, } diff --git a/go/vt/vtgate/semantics/scoper.go b/go/vt/vtgate/semantics/scoper.go index 5f76b9fb81f..4df6fb06685 100644 --- a/go/vt/vtgate/semantics/scoper.go +++ b/go/vt/vtgate/semantics/scoper.go @@ -60,7 +60,7 @@ func newScoper() *scoper { func (s *scoper) down(cursor *sqlparser.Cursor) error { node := cursor.Node() switch node := node.(type) { - case *sqlparser.Update, *sqlparser.Delete: + case *sqlparser.Update, *sqlparser.Delete, *sqlparser.Insert: s.pushDMLScope(node) case *sqlparser.Select: s.pushSelectScope(node) @@ -180,7 +180,7 @@ func (s *scoper) up(cursor *sqlparser.Cursor) error { if isParentSelectStatement(cursor) { s.popScope() } - case *sqlparser.Select, sqlparser.GroupBy, *sqlparser.Update: + case *sqlparser.Select, sqlparser.GroupBy, *sqlparser.Update, *sqlparser.Delete, *sqlparser.Insert: s.popScope() case *sqlparser.Where: if node.Type != sqlparser.HavingClause { diff --git a/go/vt/vtgate/semantics/semantic_state.go b/go/vt/vtgate/semantics/semantic_state.go index 887c5fef067..8d84c03fd55 100644 --- a/go/vt/vtgate/semantics/semantic_state.go +++ b/go/vt/vtgate/semantics/semantic_state.go @@ -407,6 +407,7 @@ func (st *SemTable) SingleUnshardedKeyspace() (*vindexes.Keyspace, []*vindexes.T if vindexTable.Type != "" { // A reference table is not an issue when seeing if a query is going to an unsharded keyspace if vindexTable.Type == vindexes.TypeReference { + tables = append(tables, vindexTable) continue } return nil, nil From 1be89a3414d7bfe8f29952fac4ee3f45d182a66b Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 11 May 2023 12:11:43 +0530 Subject: [PATCH 03/21] gen4: insert sharded initial planning Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/dml_planner.go | 10 -- go/vt/vtgate/planbuilder/insert.go | 27 +---- .../planbuilder/operator_transformers.go | 46 ++++++++ go/vt/vtgate/planbuilder/operators/insert.go | 78 +++++++++++++ go/vt/vtgate/planbuilder/operators/logical.go | 110 ++++++++++++++++++ .../planbuilder/operators/route_planning.go | 2 +- 6 files changed, 240 insertions(+), 33 deletions(-) create mode 100644 go/vt/vtgate/planbuilder/operators/insert.go diff --git a/go/vt/vtgate/planbuilder/dml_planner.go b/go/vt/vtgate/planbuilder/dml_planner.go index 68f2a2b359a..123349f6d1e 100644 --- a/go/vt/vtgate/planbuilder/dml_planner.go +++ b/go/vt/vtgate/planbuilder/dml_planner.go @@ -396,13 +396,3 @@ func generateQuery(statement sqlparser.Statement) string { statement.Format(buf) return buf.String() } - -// dmlFormatter strips out keyspace name from dmls. -func dmlFormatter(buf *sqlparser.TrackedBuffer, node sqlparser.SQLNode) { - switch node := node.(type) { - case sqlparser.TableName: - node.Name.Format(buf) - return - } - node.Format(buf) -} diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index 00f343173b9..49dc9efca5d 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -36,9 +36,10 @@ func buildInsertPlan(string) stmtPlanner { pb := newStmtAwarePrimitiveBuilder(vschema, newJointab(reservedVars), stmt) ins := stmt.(*sqlparser.Insert) err := checkUnsupportedExpressions(ins) - if err != nil { - return nil, err - }exprs := sqlparser.TableExprs{ins.Table} + if err != nil { + return nil, err + } + exprs := sqlparser.TableExprs{ins.Table} rb, err := pb.processDMLTable(exprs, reservedVars, nil) if err != nil { return nil, err @@ -197,7 +198,7 @@ func buildInsertShardedPlan(ins *sqlparser.Insert, table *vindexes.Table, reserv } eins.VindexValues = routeValues eins.Query = generateQuery(ins) - generateInsertShardedQuery(ins, eins, rows) + eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins) return newPlanResult(eins, tc.getTables()...), nil } @@ -358,24 +359,6 @@ func populateInsertColumnlist(ins *sqlparser.Insert, table *vindexes.Table) { ins.Columns = cols } -func generateInsertShardedQuery(node *sqlparser.Insert, eins *engine.Insert, valueTuples sqlparser.Values) { - prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - midBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - eins.Mid = make([]string, len(valueTuples)) - prefixBuf.Myprintf("insert %v%sinto %v%v values ", - node.Comments, node.Ignore.ToString(), - node.Table, node.Columns) - eins.Prefix = prefixBuf.String() - for rowNum, val := range valueTuples { - midBuf.Myprintf("%v", val) - eins.Mid[rowNum] = midBuf.String() - midBuf.Reset() - } - suffixBuf.Myprintf("%v", node.OnDup) - eins.Suffix = suffixBuf.String() -} - func generateInsertSelectQuery(node *sqlparser.Insert, eins *engine.Insert) { prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 9580fd85075..01c1711fd0d 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -366,6 +366,8 @@ func newRoutingParams(ctx *plancontext.PlanningContext, opCode engine.Opcode) *e func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) (logicalPlan, error) { switch src := op.Source.(type) { + case *operators.Insert: + return transformInsertPlan(ctx, op, src) case *operators.Update: return transformUpdatePlan(ctx, op, src) case *operators.Delete: @@ -399,6 +401,50 @@ func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) ( } +func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, ins *operators.Insert) (logicalPlan, error) { + eins := &engine.Insert{ + Opcode: engine.InsertSharded, + Keyspace: op.Routing.Keyspace(), + Query: generateQuery(ins.AST), + Table: ins.VTable, + VindexValues: ins.VindexValues, + ColVindexes: ins.ColVindexes, + } + eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) + + return &primitiveWrapper{prim: eins}, nil +} + +func generateInsertShardedQuery(ins *sqlparser.Insert) (prefix string, mid []string, suffix string) { + valueTuples := ins.Rows.(sqlparser.Values) + prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) + midBuf := sqlparser.NewTrackedBuffer(dmlFormatter) + suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) + mid = make([]string, len(valueTuples)) + prefixBuf.Myprintf("insert %v%sinto %v%v values ", + ins.Comments, ins.Ignore.ToString(), + ins.Table, ins.Columns) + prefix = prefixBuf.String() + for rowNum, val := range valueTuples { + midBuf.Myprintf("%v", val) + mid[rowNum] = midBuf.String() + midBuf.Reset() + } + suffixBuf.Myprintf("%v", ins.OnDup) + suffix = suffixBuf.String() + return +} + +// dmlFormatter strips out keyspace name from dmls. +func dmlFormatter(buf *sqlparser.TrackedBuffer, node sqlparser.SQLNode) { + switch node := node.(type) { + case sqlparser.TableName: + node.Name.Format(buf) + return + } + node.Format(buf) +} + func transformUpdatePlan(ctx *plancontext.PlanningContext, op *operators.Route, upd *operators.Update) (logicalPlan, error) { ast := upd.AST replaceSubQuery(ctx, ast) diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go new file mode 100644 index 00000000000..3f309b770b6 --- /dev/null +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -0,0 +1,78 @@ +/* +Copyright 2023 The Vitess Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package operators + +import ( + "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/vindexes" +) + +type Insert struct { + QTable *QueryTable + VTable *vindexes.Table + AST *sqlparser.Insert + + // VindexValues specifies values for all the vindex columns. + // This is a three-dimensional data structure: + // Insert.Values[i] represents the values to be inserted for the i'th colvindex (i < len(Insert.Table.ColumnVindexes)) + // Insert.Values[i].Values[j] represents values for the j'th column of the given colVindex (j < len(colVindex[i].Columns) + // Insert.Values[i].Values[j].Values[k] represents the value pulled from row k for that column: (k < len(ins.rows)) + VindexValues [][][]evalengine.Expr + + // ColVindexes are the vindexes that will use the VindexValues + ColVindexes []*vindexes.ColumnVindex + + noInputs + noColumns + noPredicates +} + +func (i *Insert) Description() ops.OpDescription { + //TODO implement me + panic("implement me") +} + +func (i *Insert) ShortDescription() string { + //TODO implement me + panic("implement me") +} + +func (i *Insert) GetOrdering() ([]ops.OrderBy, error) { + //TODO implement me + panic("implement me") +} + +var _ ops.Operator = (*Insert)(nil) + +func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { + return &Insert{ + QTable: i.QTable, + VTable: i.VTable, + AST: i.AST, + VindexValues: i.VindexValues, + ColVindexes: i.ColVindexes, + } +} + +func (i *Insert) TablesUsed() []string { + if i.VTable != nil { + return SingleQualifiedIdentifier(i.VTable.Keyspace, i.VTable.Name) + } + return nil +} diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index d6ddcac02c7..729bed58e75 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -19,6 +19,9 @@ package operators import ( "fmt" + "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/vindexes" + "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" @@ -38,6 +41,8 @@ func createLogicalOperatorFromAST(ctx *plancontext.PlanningContext, selStmt sqlp op, err = createOperatorFromUpdate(ctx, node) case *sqlparser.Delete: op, err = createOperatorFromDelete(ctx, node) + case *sqlparser.Insert: + op, err = createOperatorFromInsert(ctx, node) default: err = vterrors.VT12001(fmt.Sprintf("operator: %T", selStmt)) } @@ -233,6 +238,111 @@ func createOperatorFromDelete(ctx *plancontext.PlanningContext, deleteStmt *sqlp return subq, nil } +func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.Insert) (ops.Operator, error) { + tableInfo, qt, err := createQueryTableForDML(ctx, ins.Table, nil) + if err != nil { + return nil, err + } + + vindexTable, routing, err := buildVindexTableForDML(ctx, tableInfo, qt, "insert") + if err != nil { + return nil, err + } + + insOp := &Insert{ + QTable: qt, + VTable: vindexTable, + AST: ins, + } + route := &Route{ + Source: insOp, + Routing: routing, + } + + switch routing.(type) { + case *AnyShardRouting: + // unsharded + return route, nil + case *TargetedRouting: + return nil, vterrors.VT12001("INSERT with a target destination") + case *ShardedRouting: + // to continue after switch + default: + return nil, vterrors.VT13001(fmt.Sprintf("INSERT with a unknown routing type: %T", routing)) + } + + colVindexes := getColVindexes(insOp.VTable.ColumnVindexes) + rows, isRowValues := ins.Rows.(sqlparser.Values) + if !isRowValues { + return nil, vterrors.VT13001("needs implementation") + } + routeValues := make([][][]evalengine.Expr, len(colVindexes)) + for vIdx, colVindex := range colVindexes { + routeValues[vIdx] = make([][]evalengine.Expr, len(colVindex.Columns)) + for colIdx, col := range colVindex.Columns { + routeValues[vIdx][colIdx] = make([]evalengine.Expr, len(rows)) + colNum := findOrAddColumn(ins, col) + for rowNum, row := range rows { + innerpv, err := evalengine.Translate(row[colNum], nil) + if err != nil { + return nil, err + } + routeValues[vIdx][colIdx][rowNum] = innerpv + } + } + } + for _, colVindex := range colVindexes { + for _, col := range colVindex.Columns { + colNum := findOrAddColumn(ins, col) + for rowNum, row := range rows { + name := engine.InsertVarName(col, rowNum) + row[colNum] = sqlparser.NewArgument(name) + } + } + } + insOp.ColVindexes = colVindexes + insOp.VindexValues = routeValues + return route, nil +} + +func getColVindexes(allColVindexes []*vindexes.ColumnVindex) (colVindexes []*vindexes.ColumnVindex) { + for _, colVindex := range allColVindexes { + if colVindex.IsPartialVindex() { + continue + } + colVindexes = append(colVindexes, colVindex) + } + return +} + +// findOrAddColumn finds the position of a column in the insert. If it's +// absent it appends it to the with NULL values and returns that position. +func findOrAddColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { + colNum := findColumn(ins, col) + if colNum >= 0 { + return colNum + } + colOffset := len(ins.Columns) + ins.Columns = append(ins.Columns, col) + if rows, ok := ins.Rows.(sqlparser.Values); ok { + for i := range rows { + rows[i] = append(rows[i], &sqlparser.NullVal{}) + } + } + return colOffset +} + +// findColumn returns the column index where it is placed on the insert column list. +// Otherwise, return -1 when not found. +func findColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { + for i, column := range ins.Columns { + if col.Equal(column) { + return i + } + } + return -1 +} + func getOperatorFromTableExpr(ctx *plancontext.PlanningContext, tableExpr sqlparser.TableExpr) (ops.Operator, error) { switch tableExpr := tableExpr.(type) { case *sqlparser.AliasedTableExpr: diff --git a/go/vt/vtgate/planbuilder/operators/route_planning.go b/go/vt/vtgate/planbuilder/operators/route_planning.go index b99b0d55d71..d8b5de8e223 100644 --- a/go/vt/vtgate/planbuilder/operators/route_planning.go +++ b/go/vt/vtgate/planbuilder/operators/route_planning.go @@ -162,7 +162,7 @@ func buildVindexTableForDML( return nil, nil, vterrors.VT09002(dmlType) } - // we are dealing with an explicitly targeted UPDATE + // we are dealing with an explicitly targeted DML routing := &TargetedRouting{ keyspace: vindexTable.Keyspace, TargetDestination: dest, From 3ea9bcba8d8286c4e61fe851b2d453f06d4239c3 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 26 May 2023 13:43:16 +0530 Subject: [PATCH 04/21] added more in insert engine description Signed-off-by: Harshit Gangal --- go/vt/vtgate/engine/insert.go | 31 +++++++---- .../planbuilder/testdata/dml_cases.json | 54 ++++++++++++++----- 2 files changed, 60 insertions(+), 25 deletions(-) diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index 8fd7332ca7a..37bb3646c74 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -25,20 +25,16 @@ import ( "sync" "time" - "vitess.io/vitess/go/vt/sqlparser" - - "vitess.io/vitess/go/vt/vtgate/evalengine" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" - "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/vt/key" + querypb "vitess.io/vitess/go/vt/proto/query" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" + "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/srvtopo" "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/evalengine" "vitess.io/vitess/go/vt/vtgate/vindexes" - - querypb "vitess.io/vitess/go/vt/proto/query" - vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" ) var _ Primitive = (*Insert)(nil) @@ -976,8 +972,12 @@ func (ins *Insert) description() PrimitiveDescription { other["VindexValues"] = valuesOffsets } - if ins.Generate != nil && ins.Generate.Values == nil { - other["AutoIncrement"] = fmt.Sprintf("%s:%d", ins.Generate.Keyspace.Name, ins.Generate.Offset) + if ins.Generate != nil { + if ins.Generate.Values == nil { + other["AutoIncrement"] = fmt.Sprintf("%s:Offset(%d)", ins.Generate.Query, ins.Generate.Offset) + } else { + other["AutoIncrement"] = fmt.Sprintf("%s:Values::%s", ins.Generate.Query, evalengine.FormatExpr(ins.Generate.Values)) + } } if len(ins.VindexValueOffset) > 0 { @@ -995,6 +995,15 @@ func (ins *Insert) description() PrimitiveDescription { if ins.Ignore { other["InsertIgnore"] = true } + if ins.ForceNonStreaming { + other["InputAsNonStreaming"] = true + } + if len(ins.Mid) > 0 { + shardQuery := fmt.Sprintf("%s%s%s", ins.Prefix, strings.Join(ins.Mid, ", "), ins.Suffix) + if shardQuery != ins.Query { + panic("oh no!!") + } + } return PrimitiveDescription{ OperatorType: "Insert", Keyspace: ins.Keyspace, diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index c7d2bc7443f..3afb1bee324 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -1377,6 +1377,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into unsharded_authoritative(col1, col2) values (:__seq0, 1)", "TableName": "unsharded_authoritative" @@ -1542,6 +1543,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -1565,6 +1567,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -1588,6 +1591,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" @@ -1611,6 +1615,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values (false, :__seq0)", "TableName": "unsharded_auto" @@ -1634,6 +1639,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1), NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" @@ -1680,6 +1686,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, val, `Name`, Costly) values (:_Id_0, 1, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1708,6 +1715,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1767,6 +1775,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1795,6 +1804,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1823,6 +1833,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "InsertIgnore": true, "MultiShardAutocommit": false, "Query": "insert ignore into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", @@ -1852,6 +1863,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "InsertIgnore": true, "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0) on duplicate key update col = 2", @@ -1881,6 +1893,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(:aa)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1909,6 +1922,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (2, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1937,6 +1951,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, nonid, `Name`, Costly) values (:_Id_0, 2, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1965,6 +1980,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (true, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1993,6 +2009,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, `name`, id, Costly) values (2, :_Name_0, :_Id_0, :_Costly_0)", "TableName": "user", @@ -2021,6 +2038,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", @@ -2116,6 +2134,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", @@ -2179,6 +2198,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "TableName": "user", @@ -2207,6 +2227,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": false, "Query": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "QueryTimeout": 1, @@ -2236,6 +2257,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": true, "Query": "insert /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "TableName": "user", @@ -2335,6 +2357,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -2358,6 +2381,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -2381,6 +2405,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" @@ -2404,6 +2429,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n values from seq:Values::(INT64(1), NULL)", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" @@ -5040,7 +5066,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:1", + "AutoIncrement": "select next :n values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5075,7 +5101,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:1", + "AutoIncrement": "select next :n values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5115,7 +5141,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5150,7 +5176,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5190,7 +5216,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:0", + "AutoIncrement": "select next :n values from seq:Offset(0)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5227,7 +5253,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:0", + "AutoIncrement": "select next :n values from seq:Offset(0)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5269,7 +5295,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:1", + "AutoIncrement": "select next :n values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5306,7 +5332,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:1", + "AutoIncrement": "select next :n values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5353,7 +5379,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5388,7 +5414,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5471,7 +5497,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5506,7 +5532,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5546,7 +5572,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5581,7 +5607,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "main:2", + "AutoIncrement": "select next :n values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { From b7fd8a28bcc898211a5727afd6fe3c341e0575e9 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 26 May 2023 16:48:59 +0530 Subject: [PATCH 05/21] generate next sequence query using ast struct Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/insert.go | 8 +- .../planbuilder/testdata/dml_cases.json | 80 +++++++++---------- 2 files changed, 47 insertions(+), 41 deletions(-) diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index 49dc9efca5d..a6a305296cc 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -21,6 +21,8 @@ import ( "strconv" "strings" + "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/sqlparser" @@ -377,9 +379,13 @@ func modifyForAutoinc(ins *sqlparser.Insert, eins *engine.Insert) error { return nil } colNum := findOrAddColumn(ins, eins.Table.AutoIncrement.Column) + selNext := &sqlparser.Select{ + From: []sqlparser.TableExpr{&sqlparser.AliasedTableExpr{Expr: &sqlparser.TableName{Name: eins.Table.AutoIncrement.Sequence.Name}}}, + SelectExprs: sqlparser.SelectExprs{&sqlparser.Nextval{Expr: &sqlparser.Argument{Name: "n", Type: sqltypes.Int64}}}, + } eins.Generate = &engine.Generate{ Keyspace: eins.Table.AutoIncrement.Sequence.Keyspace, - Query: fmt.Sprintf("select next :n values from %s", sqlparser.String(eins.Table.AutoIncrement.Sequence.Name)), + Query: sqlparser.String(selNext), } switch rows := ins.Rows.(type) { case sqlparser.SelectStatement: diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 3afb1bee324..2b9f99bef2f 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -1377,7 +1377,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into unsharded_authoritative(col1, col2) values (:__seq0, 1)", "TableName": "unsharded_authoritative" @@ -1543,7 +1543,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -1567,7 +1567,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -1591,7 +1591,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" @@ -1615,7 +1615,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values (false, :__seq0)", "TableName": "unsharded_auto" @@ -1639,7 +1639,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1), NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), NULL)", "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" @@ -1686,7 +1686,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, val, `Name`, Costly) values (:_Id_0, 1, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1715,7 +1715,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1775,7 +1775,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1804,7 +1804,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1833,7 +1833,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "InsertIgnore": true, "MultiShardAutocommit": false, "Query": "insert ignore into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", @@ -1863,7 +1863,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "InsertIgnore": true, "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0) on duplicate key update col = 2", @@ -1893,7 +1893,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(:aa)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(:aa)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1922,7 +1922,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (2, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1951,7 +1951,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(id, nonid, `Name`, Costly) values (:_Id_0, 2, :_Name_0, :_Costly_0)", "TableName": "user", @@ -1980,7 +1980,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (true, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", @@ -2009,7 +2009,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, `name`, id, Costly) values (2, :_Name_0, :_Id_0, :_Costly_0)", "TableName": "user", @@ -2038,7 +2038,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", @@ -2134,7 +2134,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", @@ -2198,7 +2198,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "TableName": "user", @@ -2227,7 +2227,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": false, "Query": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "QueryTimeout": 1, @@ -2257,7 +2257,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1), INT64(2))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), INT64(2))", "MultiShardAutocommit": true, "Query": "insert /*vt+ MULTI_SHARD_AUTOCOMMIT=1 */ into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "TableName": "user", @@ -2357,7 +2357,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(DECIMAL(18446744073709551616))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -2381,7 +2381,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1))", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" @@ -2405,7 +2405,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" @@ -2429,7 +2429,7 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Values::(INT64(1), NULL)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), NULL)", "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" @@ -5066,7 +5066,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(1)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5101,7 +5101,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(1)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5141,7 +5141,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5176,7 +5176,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5216,7 +5216,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(0)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(0)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5253,7 +5253,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(0)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(0)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5295,7 +5295,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(1)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5332,7 +5332,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(1)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { @@ -5379,7 +5379,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5414,7 +5414,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5497,7 +5497,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5532,7 +5532,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5572,7 +5572,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { @@ -5607,7 +5607,7 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "AutoIncrement": "select next :n values from seq:Offset(2)", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { From c207bdf7b5ff3f24e36438ee4b906eca5a13affb Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 26 May 2023 16:52:22 +0530 Subject: [PATCH 06/21] gen4: added autogenerate column support Signed-off-by: Harshit Gangal --- go/vt/vterrors/code.go | 2 + go/vt/vtgate/planbuilder/gen4_planner.go | 12 +-- .../planbuilder/operator_transformers.go | 35 +++++++- go/vt/vtgate/planbuilder/operators/insert.go | 27 ++++-- go/vt/vtgate/planbuilder/operators/logical.go | 82 ++++++++++++++++-- go/vt/vtgate/planbuilder/plan_test.go | 85 ++++++++++++++----- .../planbuilder/testdata/dml_cases.json | 3 +- 7 files changed, 204 insertions(+), 42 deletions(-) diff --git a/go/vt/vterrors/code.go b/go/vt/vterrors/code.go index 5918abb2bfb..26abd85e49e 100644 --- a/go/vt/vterrors/code.go +++ b/go/vt/vterrors/code.go @@ -72,6 +72,7 @@ var ( VT09011 = errorWithState("VT09011", vtrpcpb.Code_FAILED_PRECONDITION, UnknownStmtHandler, "Unknown prepared statement handler (%s) given to %s", "The prepared statement is not available") VT09012 = errorWithoutState("VT09012", vtrpcpb.Code_FAILED_PRECONDITION, "%s statement with %s tablet not allowed", "This type of statement is not allowed on the given tablet.") VT09013 = errorWithoutState("VT09013", vtrpcpb.Code_FAILED_PRECONDITION, "semi-sync plugins are not loaded", "Durability policy wants Vitess to use semi-sync, but the MySQL instances don't have the semi-sync plugin loaded.") + VT09014 = errorWithoutState("VT09014", vtrpcpb.Code_FAILED_PRECONDITION, "vindex cannot be modified", "The vindex cannot be used as table in DML statement") VT10001 = errorWithoutState("VT10001", vtrpcpb.Code_ABORTED, "foreign key constraints are not allowed", "Foreign key constraints are not allowed, see https://vitess.io/blog/2021-06-15-online-ddl-why-no-fk/.") @@ -134,6 +135,7 @@ var ( VT09011, VT09012, VT09013, + VT09014, VT10001, VT12001, VT13001, diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index b6aa5f37dc1..f40b5408cd7 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -26,7 +26,6 @@ import ( "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" - "vitess.io/vitess/go/vt/vtgate/vindexes" ) func gen4Planner(query string, plannerVersion querypb.ExecuteOptions_PlannerVersion) stmtPlanner { @@ -427,7 +426,7 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm return nil, err } - if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil { + if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil && tables[0].AutoIncrement == nil { eIns := &engine.Insert{} eIns.Keyspace = ks eIns.Table = tables[0] @@ -473,7 +472,7 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema) error { // Rewrite routed tables - return sqlparser.Walk(func(node sqlparser.SQLNode) (kontinue bool, err error) { + return sqlparser.Walk(func(node sqlparser.SQLNode) (bool, error) { aliasTbl, isAlias := node.(*sqlparser.AliasedTableExpr) if !isAlias { return true, nil @@ -482,11 +481,14 @@ func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema) if !ok { return true, nil } - var vschemaTable *vindexes.Table - vschemaTable, _, _, _, _, err = vschema.FindTableOrVindex(tableName) + vschemaTable, vindexTbl, _, _, _, err := vschema.FindTableOrVindex(tableName) if err != nil { return false, err } + if vindexTbl != nil { + // vindex cannot be present in a dml statement. + return false, vterrors.VT09014() + } if vschemaTable.Name.String() != tableName.Name.String() { name := tableName.Name diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 01c1711fd0d..0dc4dcf3769 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -367,7 +367,7 @@ func newRoutingParams(ctx *plancontext.PlanningContext, opCode engine.Opcode) *e func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) (logicalPlan, error) { switch src := op.Source.(type) { case *operators.Insert: - return transformInsertPlan(ctx, op, src) + return transformInsertPlan(op, src) case *operators.Update: return transformUpdatePlan(ctx, op, src) case *operators.Delete: @@ -401,20 +401,47 @@ func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) ( } -func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, ins *operators.Insert) (logicalPlan, error) { +func transformInsertPlan(op *operators.Route, ins *operators.Insert) (logicalPlan, error) { eins := &engine.Insert{ - Opcode: engine.InsertSharded, + Opcode: mapToInsertOpCode(op.Routing.OpCode()), Keyspace: op.Routing.Keyspace(), Query: generateQuery(ins.AST), Table: ins.VTable, VindexValues: ins.VindexValues, ColVindexes: ins.ColVindexes, + Generate: autoIncGenerate(ins.AutoIncrement), + } + if eins.Opcode == engine.InsertSharded { + eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) } - eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) return &primitiveWrapper{prim: eins}, nil } +func mapToInsertOpCode(code engine.Opcode) engine.InsertOpcode { + switch code { + case engine.Unsharded: + return engine.InsertUnsharded + } + return engine.InsertSharded +} + +func autoIncGenerate(gen operators.Generate) *engine.Generate { + if gen.Keyspace == nil { + return nil + } + selNext := &sqlparser.Select{ + From: []sqlparser.TableExpr{&sqlparser.AliasedTableExpr{Expr: gen.TableName}}, + SelectExprs: sqlparser.SelectExprs{&sqlparser.Nextval{Expr: &sqlparser.Argument{Name: "n", Type: sqltypes.Int64}}}, + } + return &engine.Generate{ + Keyspace: gen.Keyspace, + Query: sqlparser.String(selNext), + Values: gen.Values, + Offset: gen.Offset, + } +} + func generateInsertShardedQuery(ins *sqlparser.Insert) (prefix string, mid []string, suffix string) { valueTuples := ins.Rows.(sqlparser.Values) prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 3f309b770b6..1953bf6087f 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -38,11 +38,27 @@ type Insert struct { // ColVindexes are the vindexes that will use the VindexValues ColVindexes []*vindexes.ColumnVindex + AutoIncrement Generate + noInputs noColumns noPredicates } +type Generate struct { + Keyspace *vindexes.Keyspace + TableName sqlparser.TableName + + // Values are the supplied values for the column, which + // will be stored as a list within the expression. New + // values will be generated based on how many were not + // supplied (NULL). + Values evalengine.Expr + + // Insert using Select, offset for auto increment column + Offset int +} + func (i *Insert) Description() ops.OpDescription { //TODO implement me panic("implement me") @@ -62,11 +78,12 @@ var _ ops.Operator = (*Insert)(nil) func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { return &Insert{ - QTable: i.QTable, - VTable: i.VTable, - AST: i.AST, - VindexValues: i.VindexValues, - ColVindexes: i.ColVindexes, + QTable: i.QTable, + VTable: i.VTable, + AST: i.AST, + VindexValues: i.VindexValues, + ColVindexes: i.ColVindexes, + AutoIncrement: i.AutoIncrement, } } diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 729bed58e75..b968eba26c4 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -18,16 +18,16 @@ package operators import ( "fmt" - - "vitess.io/vitess/go/vt/vtgate/evalengine" - "vitess.io/vitess/go/vt/vtgate/vindexes" + "strconv" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + "vitess.io/vitess/go/vt/vtgate/evalengine" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" + "vitess.io/vitess/go/vt/vtgate/vindexes" ) // createLogicalOperatorFromAST creates an operator tree that represents the input SELECT or UNION query @@ -261,8 +261,9 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I switch routing.(type) { case *AnyShardRouting: - // unsharded - return route, nil + if vindexTable.AutoIncrement == nil { + return route, nil + } case *TargetedRouting: return nil, vterrors.VT12001("INSERT with a target destination") case *ShardedRouting: @@ -271,11 +272,38 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I return nil, vterrors.VT13001(fmt.Sprintf("INSERT with a unknown routing type: %T", routing)) } - colVindexes := getColVindexes(insOp.VTable.ColumnVindexes) + // Table column list is nil then add all the columns + // If the column list is empty then add only the auto-inc column and this happens on calling modifyForAutoinc + if ins.Columns == nil { + if vindexTable.ColumnListAuthoritative { + ins = populateInsertColumnlist(ins, vindexTable) + } else { + return nil, vterrors.VT13001(fmt.Sprintf("column list required for inserting data into '%s' table", vindexTable.Name)) + } + } + rows, isRowValues := ins.Rows.(sqlparser.Values) if !isRowValues { return nil, vterrors.VT13001("needs implementation") } + + for _, row := range rows { + if len(ins.Columns) != len(row) { + return nil, vterrors.VT13001("column list does not match values") + } + } + + autoIncGen, err := modifyForAutoinc(ins, vindexTable) + if err != nil { + return nil, err + } + insOp.AutoIncrement = autoIncGen + + colVindexes := getColVindexes(insOp.VTable.ColumnVindexes) + if len(colVindexes) == 0 { + return route, nil + } + routeValues := make([][][]evalengine.Expr, len(colVindexes)) for vIdx, colVindex := range colVindexes { routeValues[vIdx] = make([][]evalengine.Expr, len(colVindex.Columns)) @@ -343,6 +371,48 @@ func findColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { return -1 } +func populateInsertColumnlist(ins *sqlparser.Insert, table *vindexes.Table) *sqlparser.Insert { + cols := make(sqlparser.Columns, 0, len(table.Columns)) + for _, c := range table.Columns { + cols = append(cols, c.Name) + } + ins.Columns = cols + return ins +} + +// modifyForAutoinc modifies the AST and the plan to generate necessary autoinc values. +// For row values cases, bind variable names are generated using baseName. +func modifyForAutoinc(ins *sqlparser.Insert, vTable *vindexes.Table) (gen Generate, err error) { + if vTable.AutoIncrement == nil { + return + } + gen.Keyspace = vTable.AutoIncrement.Sequence.Keyspace + gen.TableName = sqlparser.TableName{Name: vTable.AutoIncrement.Sequence.Name} + colNum := findOrAddColumn(ins, vTable.AutoIncrement.Column) + switch rows := ins.Rows.(type) { + case sqlparser.SelectStatement: + gen.Offset = colNum + case sqlparser.Values: + autoIncValues := make([]evalengine.Expr, 0, len(rows)) + for rowNum, row := range rows { + // Support the DEFAULT keyword by treating it as null + if _, ok := row[colNum].(*sqlparser.Default); ok { + row[colNum] = &sqlparser.NullVal{} + } + + var expr evalengine.Expr + expr, err = evalengine.Translate(row[colNum], nil) + if err != nil { + return gen, err + } + autoIncValues = append(autoIncValues, expr) + row[colNum] = sqlparser.NewArgument(engine.SeqVarName + strconv.Itoa(rowNum)) + } + gen.Values = evalengine.NewTupleExpr(autoIncValues...) + } + return +} + func getOperatorFromTableExpr(ctx *plancontext.PlanningContext, tableExpr sqlparser.TableExpr) (ops.Operator, error) { switch tableExpr := tableExpr.(type) { case *sqlparser.AliasedTableExpr: diff --git a/go/vt/vtgate/planbuilder/plan_test.go b/go/vt/vtgate/planbuilder/plan_test.go index cf6c5b944a8..bf3eca127e5 100644 --- a/go/vt/vtgate/planbuilder/plan_test.go +++ b/go/vt/vtgate/planbuilder/plan_test.go @@ -43,31 +43,40 @@ import ( "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/mysql/collations" - "vitess.io/vitess/go/vt/vtgate/semantics" - - "vitess.io/vitess/go/vt/vterrors" - "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/test/utils" "vitess.io/vitess/go/vt/key" + querypb "vitess.io/vitess/go/vt/proto/query" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" + vschemapb "vitess.io/vitess/go/vt/proto/vschema" + vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" + "vitess.io/vitess/go/vt/servenv" + "vitess.io/vitess/go/vt/sidecardb" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/topo/memorytopo" "vitess.io/vitess/go/vt/topo/topoproto" + "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/semantics" "vitess.io/vitess/go/vt/vtgate/vindexes" - - topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) // hashIndex is a functional, unique Vindex. type hashIndex struct{ name string } -func (v *hashIndex) String() string { return v.name } -func (*hashIndex) Cost() int { return 1 } -func (*hashIndex) IsUnique() bool { return true } +func (v *hashIndex) String() string { return v.name } + +func (*hashIndex) Cost() int { return 1 } + +func (*hashIndex) IsUnique() bool { return true } + func (*hashIndex) NeedsVCursor() bool { return false } + func (*hashIndex) Verify(context.Context, vindexes.VCursor, []sqltypes.Value, [][]byte) ([]bool, error) { return []bool{}, nil } + func (*hashIndex) Map(ctx context.Context, vcursor vindexes.VCursor, ids []sqltypes.Value) ([]key.Destination, error) { return nil, nil } @@ -79,22 +88,30 @@ func newHashIndex(name string, _ map[string]string) (vindexes.Vindex, error) { // lookupIndex is a unique Vindex, and satisfies Lookup. type lookupIndex struct{ name string } -func (v *lookupIndex) String() string { return v.name } -func (*lookupIndex) Cost() int { return 2 } -func (*lookupIndex) IsUnique() bool { return true } +func (v *lookupIndex) String() string { return v.name } + +func (*lookupIndex) Cost() int { return 2 } + +func (*lookupIndex) IsUnique() bool { return true } + func (*lookupIndex) NeedsVCursor() bool { return false } + func (*lookupIndex) Verify(context.Context, vindexes.VCursor, []sqltypes.Value, [][]byte) ([]bool, error) { return []bool{}, nil } + func (*lookupIndex) Map(ctx context.Context, vcursor vindexes.VCursor, ids []sqltypes.Value) ([]key.Destination, error) { return nil, nil } + func (*lookupIndex) Create(context.Context, vindexes.VCursor, [][]sqltypes.Value, [][]byte, bool) error { return nil } + func (*lookupIndex) Delete(context.Context, vindexes.VCursor, [][]sqltypes.Value, []byte) error { return nil } + func (*lookupIndex) Update(context.Context, vindexes.VCursor, []sqltypes.Value, []byte, []sqltypes.Value) error { return nil } @@ -108,31 +125,44 @@ var _ vindexes.Lookup = (*lookupIndex)(nil) // nameLkpIndex satisfies Lookup, NonUnique. type nameLkpIndex struct{ name string } -func (v *nameLkpIndex) String() string { return v.name } -func (*nameLkpIndex) Cost() int { return 3 } -func (*nameLkpIndex) IsUnique() bool { return false } -func (*nameLkpIndex) NeedsVCursor() bool { return false } -func (*nameLkpIndex) AllowBatch() bool { return true } -func (*nameLkpIndex) AutoCommitEnabled() bool { return false } +func (v *nameLkpIndex) String() string { return v.name } + +func (*nameLkpIndex) Cost() int { return 3 } + +func (*nameLkpIndex) IsUnique() bool { return false } + +func (*nameLkpIndex) NeedsVCursor() bool { return false } + +func (*nameLkpIndex) AllowBatch() bool { return true } + +func (*nameLkpIndex) AutoCommitEnabled() bool { return false } + func (*nameLkpIndex) GetCommitOrder() vtgatepb.CommitOrder { return vtgatepb.CommitOrder_NORMAL } + func (*nameLkpIndex) Verify(context.Context, vindexes.VCursor, []sqltypes.Value, [][]byte) ([]bool, error) { return []bool{}, nil } + func (*nameLkpIndex) Map(ctx context.Context, vcursor vindexes.VCursor, ids []sqltypes.Value) ([]key.Destination, error) { return nil, nil } + func (*nameLkpIndex) Create(context.Context, vindexes.VCursor, [][]sqltypes.Value, [][]byte, bool) error { return nil } + func (*nameLkpIndex) Delete(context.Context, vindexes.VCursor, [][]sqltypes.Value, []byte) error { return nil } + func (*nameLkpIndex) Update(context.Context, vindexes.VCursor, []sqltypes.Value, []byte, []sqltypes.Value) error { return nil } + func (v *nameLkpIndex) Query() (string, []string) { return "select name, keyspace_id from name_user_vdx where name in ::name", []string{"name"} } + func (*nameLkpIndex) MapResult([]sqltypes.Value, []*sqltypes.Result) ([]key.Destination, error) { return nil, nil } @@ -142,28 +172,38 @@ func newNameLkpIndex(name string, _ map[string]string) (vindexes.Vindex, error) } var _ vindexes.Vindex = (*nameLkpIndex)(nil) + var _ vindexes.Lookup = (*nameLkpIndex)(nil) + var _ vindexes.LookupPlanable = (*nameLkpIndex)(nil) // costlyIndex satisfies Lookup, NonUnique. type costlyIndex struct{ name string } -func (v *costlyIndex) String() string { return v.name } -func (*costlyIndex) Cost() int { return 10 } -func (*costlyIndex) IsUnique() bool { return false } +func (v *costlyIndex) String() string { return v.name } + +func (*costlyIndex) Cost() int { return 10 } + +func (*costlyIndex) IsUnique() bool { return false } + func (*costlyIndex) NeedsVCursor() bool { return false } + func (*costlyIndex) Verify(context.Context, vindexes.VCursor, []sqltypes.Value, [][]byte) ([]bool, error) { return []bool{}, nil } + func (*costlyIndex) Map(ctx context.Context, vcursor vindexes.VCursor, ids []sqltypes.Value) ([]key.Destination, error) { return nil, nil } + func (*costlyIndex) Create(context.Context, vindexes.VCursor, [][]sqltypes.Value, [][]byte, bool) error { return nil } + func (*costlyIndex) Delete(context.Context, vindexes.VCursor, [][]sqltypes.Value, []byte) error { return nil } + func (*costlyIndex) Update(context.Context, vindexes.VCursor, []sqltypes.Value, []byte, []sqltypes.Value) error { return nil } @@ -173,6 +213,7 @@ func newCostlyIndex(name string, _ map[string]string) (vindexes.Vindex, error) { } var _ vindexes.Vindex = (*costlyIndex)(nil) + var _ vindexes.Lookup = (*costlyIndex)(nil) // multiColIndex satisfies multi column vindex. @@ -435,6 +476,7 @@ func TestBypassPlanningShardTargetFromFile(t *testing.T) { testFile(t, "bypass_shard_cases.json", makeTestOutput(t), vschema, false) } + func TestBypassPlanningKeyrangeTargetFromFile(t *testing.T) { keyRange, _ := key.ParseShardingSpec("-") @@ -800,6 +842,7 @@ func (vw *vschemaWrapper) getfirstKeyspace() (ks *vindexes.Keyspace) { } return } + func (vw *vschemaWrapper) getActualKeyspace() string { if vw.keyspace == nil { return "" diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 2b9f99bef2f..635c9debcbe 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -2275,7 +2275,8 @@ { "comment": "insert into a vindex not allowed", "query": "insert into user_index(id) values(1)", - "plan": "VT12001: unsupported: multi-shard or vindex write statement" + "v3-plan": "VT12001: unsupported: multi-shard or vindex write statement", + "gen4-plan": "VT09012: vindex cannot be modified" }, { "comment": "simple replace unsharded", From fd55d1f942818a964faf28606107054a09028202 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Sat, 27 May 2023 00:51:13 +0530 Subject: [PATCH 07/21] remove value false from plan description Signed-off-by: Harshit Gangal --- go/vt/vtgate/engine/plan_description.go | 2 +- .../planbuilder/testdata/dml_cases.json | 222 ------------------ .../planbuilder/testdata/oltp_cases.json | 9 +- .../planbuilder/testdata/reference_cases.json | 7 - .../planbuilder/testdata/tpcc_cases.json | 32 +-- 5 files changed, 3 insertions(+), 269 deletions(-) diff --git a/go/vt/vtgate/engine/plan_description.go b/go/vt/vtgate/engine/plan_description.go index 0e7929bbe0c..ef8b4360dfb 100644 --- a/go/vt/vtgate/engine/plan_description.go +++ b/go/vt/vtgate/engine/plan_description.go @@ -144,7 +144,7 @@ func GraphViz(p Primitive) (*graphviz.Graph, error) { func addMap(input map[string]any, buf *bytes.Buffer) error { var mk []string for k, v := range input { - if v == "" || v == nil || v == 0 { + if v == "" || v == nil || v == 0 || v == false { continue } mk = append(mk, k) diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 635c9debcbe..2b76f417a4d 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -23,7 +23,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update m1 set val = 1", "Table": "m1" }, @@ -46,7 +45,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set val = 1", "Table": "unsharded" }, @@ -69,7 +67,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = (select col from unsharded limit 1)", "Table": "unsharded" }, @@ -92,7 +89,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = (select id from unsharded union select id from unsharded)", "Table": "unsharded" }, @@ -115,7 +111,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = (select id from unsharded as a join unsharded as b on a.id = b.id)", "Table": "unsharded" }, @@ -138,7 +133,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded as foo left join (select id from unsharded where col is not null order by col desc limit 10) as keepers on foo.id = keepers.id set col1 = 'asdf' where keepers.id is null and foo.col is not null and foo.col < 1000", "Table": "unsharded" }, @@ -161,7 +155,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` as route1 set a = 1 where id = 1", "Table": "user", "Values": [ @@ -184,7 +177,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` as route1 set a = 1 where id = 1", "Table": "user", "Values": [ @@ -211,7 +203,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded_a set a = (select a from unsharded as route2)", "Table": "unsharded, unsharded_a" }, @@ -230,7 +221,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded_a set a = (select a from unsharded as route2)", "Table": "unsharded, unsharded_a" }, @@ -254,7 +244,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded", "Table": "unsharded" }, @@ -277,7 +266,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from seq", "Table": "seq" }, @@ -300,7 +288,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded_ref", "Table": "unsharded_ref" }, @@ -323,7 +310,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 1", "Table": "user", "Values": [ @@ -346,7 +332,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 1", "Table": "user", "Values": [ @@ -373,7 +358,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` as user_alias set val = 1 where user_alias.id = 1", "Table": "user", "Values": [ @@ -396,7 +380,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` as user_alias set val = 1 where user_alias.id = 1", "Table": "user", "Values": [ @@ -423,7 +406,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 1", "Table": "user", "Values": [ @@ -446,7 +428,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 1", "Table": "user", "Values": [ @@ -473,7 +454,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where `name` = 'foo' and id = 1", "Table": "user", "Values": [ @@ -496,7 +476,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where `name` = 'foo' and id = 1", "Table": "user", "Values": [ @@ -528,7 +507,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io' from user_metadata where user_id = 1 for update", "Query": "update user_metadata set email = 'juan@vitess.io' where user_id = 1", "Table": "user_metadata", @@ -557,7 +535,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io' from user_metadata where user_id = 1 for update", "Query": "update user_metadata set email = 'juan@vitess.io' where user_id = 1", "Table": "user_metadata", @@ -596,7 +573,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io', address = '155 5th street' from user_metadata where user_id = 1 for update", "Query": "update user_metadata set email = 'juan@vitess.io', address = '155 5th street' where user_id = 1", "Table": "user_metadata", @@ -626,7 +602,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io', address = '155 5th street' from user_metadata where user_id = 1 for update", "Query": "update user_metadata set email = 'juan@vitess.io', address = '155 5th street' where user_id = 1", "Table": "user_metadata", @@ -659,7 +634,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io' from user_metadata where user_id = 1 order by user_id asc limit 10 for update", "Query": "update user_metadata set email = 'juan@vitess.io' where user_id = 1 order by user_id asc limit 10", "Table": "user_metadata", @@ -688,7 +662,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, email, address, non_planable, email = 'juan@vitess.io' from user_metadata where user_id = 1 order by user_id asc limit 10 for update", "Query": "update user_metadata set email = 'juan@vitess.io' where user_id = 1 order by user_id asc limit 10", "Table": "user_metadata", @@ -721,7 +694,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, music_id = 1 from music_extra where user_id = 1 for update", "Query": "update music_extra set music_id = 1 where user_id = 1", "Table": "music_extra", @@ -750,7 +722,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, music_id = 1 from music_extra where user_id = 1 for update", "Query": "update music_extra set music_id = 1 where user_id = 1", "Table": "music_extra", @@ -778,7 +749,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = id2 and id = 1", "Table": "user", "Values": [ @@ -801,7 +771,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = id2 and id = 1", "Table": "user", "Values": [ @@ -828,7 +797,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 18446744073709551616 and id = 1", "Table": "user", "Values": [ @@ -851,7 +819,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1 where id = 18446744073709551616 and id = 1", "Table": "user", "Values": [ @@ -880,7 +847,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where id = 1 for update", "Query": "delete from `user` where id = 1", "Table": "user", @@ -906,7 +872,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where id = 1 for update", "Query": "delete from `user` where id = 1", "Table": "user", @@ -934,7 +899,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete a from unsharded_a as a, unsharded_b as b where a.id = b.id and b.val = 1", "Table": "unsharded_a, unsharded_b" }, @@ -958,7 +922,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete a from unsharded_a as a join unsharded_b as b on a.id = b.id where b.val = 1", "Table": "unsharded_a, unsharded_b" }, @@ -982,7 +945,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete foo from unsharded as foo left join (select id from unsharded where col is not null order by col desc limit 10) as keepers on foo.id = keepers.id where keepers.id is null and foo.col is not null and foo.col < 1000", "Table": "unsharded" }, @@ -1007,7 +969,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` as route1 where id = 1 for update", "Query": "delete from `user` as route1 where id = 1", "Table": "user", @@ -1033,7 +994,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` as route1 where id = 1 for update", "Query": "delete from `user` as route1 where id = 1", "Table": "user", @@ -1061,7 +1021,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded_a where a = (select a from unsharded as route2)", "Table": "unsharded, unsharded_a" }, @@ -1080,7 +1039,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded_a where a = (select a from unsharded as route2)", "Table": "unsharded, unsharded_a" }, @@ -1104,7 +1062,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update music set val = 1 where id = 1", "Table": "music", "Values": [ @@ -1127,7 +1084,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update music set val = 1 where id = 1", "Table": "music", "Values": [ @@ -1154,7 +1110,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded_a as a join unsharded_b as b on a.id = b.id set a.val = 'foo' where b.val = 1", "Table": "unsharded_a, unsharded_b" }, @@ -1178,7 +1133,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded_a as a, unsharded_b as b set a.val = 'foo' where a.id = b.id and b.val = 1", "Table": "unsharded_a, unsharded_b" }, @@ -1204,7 +1158,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, id from music where id = 1 for update", "Query": "delete from music where id = 1", "Table": "music", @@ -1230,7 +1183,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, id from music where id = 1 for update", "Query": "delete from music where id = 1", "Table": "music", @@ -1258,7 +1210,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from music_extra where user_id = 1", "Table": "music_extra", "Values": [ @@ -1281,7 +1232,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from music_extra where user_id = 1", "Table": "music_extra", "Values": [ @@ -1308,7 +1258,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded values ()", "TableName": "unsharded" }, @@ -1331,7 +1280,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded values (1, 2)", "TableName": "unsharded" }, @@ -1354,7 +1302,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded values (1, 2) on duplicate key update x = 3", "TableName": "unsharded" }, @@ -1378,7 +1325,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into unsharded_authoritative(col1, col2) values (:__seq0, 1)", "TableName": "unsharded_authoritative" }, @@ -1402,7 +1348,6 @@ }, "TargetTabletType": "PRIMARY", "InsertIgnore": true, - "MultiShardAutocommit": false, "Query": "insert into music(user_id, id) values (:_user_id_0, :_id_0) on duplicate key update user_id = values(user_id)", "TableName": "music", "VindexValues": { @@ -1430,7 +1375,6 @@ }, "TargetTabletType": "PRIMARY", "InsertIgnore": true, - "MultiShardAutocommit": false, "Query": "insert into music(user_id, id) values (:_user_id_0, :_id_0), (:_user_id_1, :_id_1) on duplicate key update user_id = values(user_id)", "TableName": "music", "VindexValues": { @@ -1457,7 +1401,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select id from unsharded_auto for update", "TableName": "unsharded" }, @@ -1476,7 +1419,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select id from unsharded_auto", "TableName": "unsharded" }, @@ -1500,7 +1442,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select id from unsharded join unsharded_auto for update", "TableName": "unsharded" }, @@ -1519,7 +1460,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select id from unsharded join unsharded_auto", "TableName": "unsharded" }, @@ -1544,7 +1484,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", - "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" }, @@ -1568,7 +1507,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" }, @@ -1592,7 +1530,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" }, @@ -1616,7 +1553,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(val, id) values (false, :__seq0)", "TableName": "unsharded_auto" }, @@ -1640,7 +1576,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), NULL)", - "MultiShardAutocommit": false, "Query": "insert into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" }, @@ -1663,7 +1598,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded values (1, 1)", "TableName": "unsharded" }, @@ -1687,7 +1621,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, val, `Name`, Costly) values (:_Id_0, 1, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1716,7 +1649,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1749,7 +1681,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into authoritative(user_id, col1, col2) values (:_user_id_0, 2, 3)", "TableName": "authoritative", "VindexValues": { @@ -1776,7 +1707,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1805,7 +1735,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1835,7 +1764,6 @@ "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "InsertIgnore": true, - "MultiShardAutocommit": false, "Query": "insert ignore into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1865,7 +1793,6 @@ "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", "InsertIgnore": true, - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0) on duplicate key update col = 2", "TableName": "user", "VindexValues": { @@ -1894,7 +1821,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(:aa)", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1923,7 +1849,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (2, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1952,7 +1877,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, nonid, `Name`, Costly) values (:_Id_0, 2, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -1981,7 +1905,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, id, `Name`, Costly) values (true, :_Id_0, :_Name_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -2010,7 +1933,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "insert into `user`(nonid, `name`, id, Costly) values (2, :_Name_0, :_Id_0, :_Costly_0)", "TableName": "user", "VindexValues": { @@ -2039,7 +1961,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", "VindexValues": { @@ -2065,7 +1986,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into `weird``name`(`a``b*c`, `b*c`) values (:_a_b_c_0, 2)", "TableName": "weird`name", "VindexValues": { @@ -2091,7 +2011,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select 1 from dual union select 1 from dual for update", "TableName": "unsharded" }, @@ -2110,7 +2029,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded select 1 from dual union select 1 from dual", "TableName": "unsharded" }, @@ -2135,7 +2053,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", - "MultiShardAutocommit": false, "Query": "insert into user_extra(nonid, extra_id, user_id) values (2, :__seq0, :_user_id_0)", "TableName": "user_extra", "VindexValues": { @@ -2161,7 +2078,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into music_extra(music_id, user_id) values (:_music_id_0, :_user_id_0)", "TableName": "music_extra", "VindexValues": { @@ -2199,7 +2115,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), INT64(2))", - "MultiShardAutocommit": false, "Query": "insert into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "TableName": "user", "VindexValues": { @@ -2228,7 +2143,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), INT64(2))", - "MultiShardAutocommit": false, "Query": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into `user`(id, `Name`, Costly) values (:_Id_0, :_Name_0, :_Costly_0), (:_Id_1, :_Name_1, :_Costly_1)", "QueryTimeout": 1, "TableName": "user", @@ -2292,7 +2206,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "replace into unsharded values (1, 2)", "TableName": "unsharded" }, @@ -2315,7 +2228,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "replace into unsharded select id from unsharded_auto for update", "TableName": "unsharded" }, @@ -2334,7 +2246,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "replace into unsharded select id from unsharded_auto", "TableName": "unsharded" }, @@ -2359,7 +2270,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(DECIMAL(18446744073709551616))", - "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" }, @@ -2383,7 +2293,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1))", - "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa')", "TableName": "unsharded_auto" }, @@ -2407,7 +2316,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL)", - "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(val, id) values ('aa', :__seq0)", "TableName": "unsharded_auto" }, @@ -2431,7 +2339,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), NULL)", - "MultiShardAutocommit": false, "Query": "replace into unsharded_auto(id, val) values (:__seq0, 'aa'), (:__seq1, 'bb')", "TableName": "unsharded_auto" }, @@ -2459,7 +2366,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into multicolvin(column_a, column_b, column_c, kid) values (:_column_a_0, :_column_b_0, :_column_c_0, :_kid_0)", "TableName": "multicolvin", "VindexValues": { @@ -2487,7 +2393,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into overlap_vindex(kid, column_a, column_b) values (:_kid_0, :_column_a_0, 3)", "TableName": "overlap_vindex", "VindexValues": { @@ -2514,7 +2419,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into multicolvin(column_a, column_b, column_c, kid) values (:_column_a_0, :_column_b_0, :_column_c_0, :_kid_0), (:_column_a_1, :_column_b_1, :_column_c_1, :_kid_1)", "TableName": "multicolvin", "VindexValues": { @@ -2544,7 +2448,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c from multicolvin where kid = 1 for update", "Query": "delete from multicolvin where kid = 1", "Table": "multicolvin", @@ -2570,7 +2473,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c from multicolvin where kid = 1 for update", "Query": "delete from multicolvin where kid = 1", "Table": "multicolvin", @@ -2603,7 +2505,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_b = 1 and column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_b = 1, column_c = 2 where kid = 1", "Table": "multicolvin", @@ -2632,7 +2533,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_b = 1 and column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_b = 1, column_c = 2 where kid = 1", "Table": "multicolvin", @@ -2666,7 +2566,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_a = 0, column_b = 1 and column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_a = 0, column_b = 1, column_c = 2 where kid = 1", "Table": "multicolvin", @@ -2696,7 +2595,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_a = 0, column_b = 1 and column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_a = 0, column_b = 1, column_c = 2 where kid = 1", "Table": "multicolvin", @@ -2724,7 +2622,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1", "Table": "user_extra" }, @@ -2747,7 +2644,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1", "Table": "user_extra" }, @@ -2793,7 +2689,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update /*vt+ QUERY_TIMEOUT_MS=1 */ user_extra set val = 1", "QueryTimeout": 1, "Table": "user_extra" @@ -2817,7 +2712,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1 where id between 1 and 2", "Table": "user_extra" }, @@ -2840,7 +2734,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1 where user_id in (1, 2)", "Table": "user_extra", "Values": [ @@ -2867,7 +2760,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1 where `name` = 'foo'", "Table": "user_extra" }, @@ -2890,7 +2782,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1 where id in (1, 2)", "Table": "user_extra" }, @@ -2913,7 +2804,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1 where `name` = 'foo' or id = 1", "Table": "user_extra" }, @@ -2936,7 +2826,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from user_extra", "Table": "user_extra" }, @@ -2959,7 +2848,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from user_extra", "Table": "user_extra" }, @@ -2982,7 +2870,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from user_extra where user_id between 1 and 2", "Table": "user_extra" }, @@ -3005,7 +2892,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from user_extra where `name` = 'jose'", "Table": "user_extra" }, @@ -3051,7 +2937,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete /*vt+ QUERY_TIMEOUT_MS=1 */ from user_extra where `name` = 'jose'", "QueryTimeout": 1, "Table": "user_extra" @@ -3075,7 +2960,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from user_extra where user_id in (1, 2)", "Table": "user_extra", "Values": [ @@ -3102,7 +2986,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = (select id from unsharded_a where id = unsharded.col) where col = (select id from unsharded_b)", "Table": "unsharded, unsharded_a, unsharded_b" }, @@ -3121,7 +3004,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = (select id from unsharded_a where id = unsharded.col) where col = (select id from unsharded_b)", "Table": "unsharded, unsharded_a, unsharded_b" }, @@ -3146,7 +3028,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded where col = (select id from unsharded_a where id = unsharded.col)", "Table": "unsharded, unsharded_a" }, @@ -3165,7 +3046,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from unsharded where col = (select id from unsharded_a where id = unsharded.col)", "Table": "unsharded, unsharded_a" }, @@ -3194,7 +3074,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = null from `user` where id = 1 for update", "Query": "update `user` set `name` = null where id = 1", "Table": "user", @@ -3223,7 +3102,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = null from `user` where id = 1 for update", "Query": "update `user` set `name` = null where id = 1", "Table": "user", @@ -3251,7 +3129,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded values (:__lastInsertId, 2)", "TableName": "unsharded" }, @@ -3279,7 +3156,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = null from `user` where id in (1, 2, 3) for update", "Query": "update `user` set `name` = null where id in (1, 2, 3)", "Table": "user", @@ -3312,7 +3188,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = null from `user` for update", "Query": "update `user` set `name` = null", "Table": "user" @@ -3341,7 +3216,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = null from `user` where id + 1 = 2 for update", "Query": "update `user` set `name` = null where id + 1 = 2", "Table": "user" @@ -3367,7 +3241,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where id in (1, 2, 3) for update", "Query": "delete from `user` where id in (1, 2, 3)", "Table": "user", @@ -3397,7 +3270,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where id + 1 = 2 for update", "Query": "delete from `user` where id + 1 = 2", "Table": "user" @@ -3423,7 +3295,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` for update", "Query": "delete from `user`", "Table": "user" @@ -3449,7 +3320,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, id from music where id = 1 for update", "Query": "delete from music where id = 1", "Table": "music", @@ -3475,7 +3345,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select user_id, id from music where id = 1 for update", "Query": "delete from music where id = 1", "Table": "music", @@ -3503,7 +3372,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set val = 1", "Table": "user" }, @@ -3528,7 +3396,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` for update", "Query": "delete from `user`", "Table": "user" @@ -3557,7 +3424,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_c = 2 where kid = 1", "Table": "multicolvin", @@ -3586,7 +3452,6 @@ ], "KsidLength": 1, "KsidVindex": "kid_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select kid, column_a, column_b, column_c, column_c = 2 from multicolvin where kid = 1 for update", "Query": "update multicolvin set column_c = 2 where kid = 1", "Table": "multicolvin", @@ -3619,7 +3484,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = _binary 'abc' from `user` where id = 1 for update", "Query": "update `user` set `name` = _binary 'abc' where id = 1", "Table": "user", @@ -3648,7 +3512,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = _binary 'abc' from `user` where id = 1 for update", "Query": "update `user` set `name` = _binary 'abc' where id = 1", "Table": "user", @@ -3678,7 +3541,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where `name` = _binary 'abc' for update", "Query": "delete from `user` where `name` = _binary 'abc'", "Table": "user" @@ -3700,7 +3562,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where `name` = _binary 'abc' for update", "Query": "delete from `user` where `name` = _binary 'abc'", "Table": "user", @@ -3730,7 +3591,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` for update", "Query": "delete from `user`", "Table": "user" @@ -3759,7 +3619,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, `name` = 'myname' from `user` for update", "Query": "update `user` set `name` = 'myname'", "Table": "user" @@ -3783,7 +3642,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update user_extra set val = 1", "Table": "user_extra" }, @@ -3808,7 +3666,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where `user`.id * `user`.col = `user`.foo for update", "Query": "delete from `user` where `user`.id * `user`.col = `user`.foo", "Table": "user" @@ -3847,7 +3704,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into user_privacy_consents(user_id, accepted_at) select user_id, accepted_at from (select 1 as user_id, 1629194864 as accepted_at from dual) as tmp where not exists (select 1 from user_privacy_consents where user_id = 1 limit 1) for update", "TableName": "user_privacy_consents" }, @@ -3866,7 +3722,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into user_privacy_consents(user_id, accepted_at) select user_id, accepted_at from (select 1 as user_id, 1629194864 as accepted_at from dual) as tmp where not exists (select 1 from user_privacy_consents where user_id = 1 limit 1)", "TableName": "user_privacy_consents" }, @@ -3892,7 +3747,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3 from t1 where c2 = 20 for update", "Query": "delete from t1 where c2 = 20", "Table": "t1" @@ -3921,7 +3775,6 @@ ], "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3, c2 = 1 from t1 where c2 = 20 for update", "Query": "update t1 set c2 = 1 where c2 = 20", "Table": "t1" @@ -3947,7 +3800,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3 from t1 where c2 = 10 and c3 = 20 for update", "Query": "delete from t1 where c2 = 10 and c3 = 20", "Table": "t1", @@ -3973,7 +3825,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3 from t1 where c2 = 10 and c3 = 20 for update", "Query": "delete from t1 where c2 = 10 and c3 = 20", "Table": "t1", @@ -4006,7 +3857,6 @@ ], "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3, c2 = 1 from t1 where c2 = 10 and c3 = 20 for update", "Query": "update t1 set c2 = 1 where c2 = 10 and c3 = 20", "Table": "t1", @@ -4035,7 +3885,6 @@ ], "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3, c2 = 1 from t1 where c2 = 10 and c3 = 20 for update", "Query": "update t1 set c2 = 1 where c2 = 10 and c3 = 20", "Table": "t1", @@ -4065,7 +3914,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3 from t1 where c2 = 10 and c3 in (20, 21) for update", "Query": "delete from t1 where c2 = 10 and c3 in (20, 21)", "Table": "t1", @@ -4098,7 +3946,6 @@ ], "KsidLength": 1, "KsidVindex": "xxhash", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select c1, c2, c3, c2 = 1 from t1 where c2 = 10 and c3 in (20, 21) for update", "Query": "update t1 set c2 = 1 where c2 = 10 and c3 in (20, 21)", "Table": "t1", @@ -4131,7 +3978,6 @@ ], "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly, u.`name` = 'john' from `user` as u where u.col > 20 for update", "Query": "update `user` as u set u.`name` = 'john' where u.col > 20", "Table": "user" @@ -4157,7 +4003,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` as u where u.col > 20 for update", "Query": "delete from `user` as u where u.col > 20", "Table": "user" @@ -4181,7 +4026,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where cola = 1 and colb = 2", "Table": "multicol_tbl", "Values": [ @@ -4205,7 +4049,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where cola = 1 and colb = 2", "Table": "multicol_tbl", "Values": [ @@ -4233,7 +4076,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where colb = 2 and cola = 1", "Table": "multicol_tbl", "Values": [ @@ -4257,7 +4099,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where colb = 2 and cola = 1", "Table": "multicol_tbl", "Values": [ @@ -4285,7 +4126,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where colb in (1, 2) and cola = 1", "Table": "multicol_tbl", "Values": [ @@ -4313,7 +4153,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where colb in (1, 2) and cola in (3, 4)", "Table": "multicol_tbl", "Values": [ @@ -4343,7 +4182,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where cola = 1 and colb = 2 for update", "Query": "delete from multicol_tbl where cola = 1 and colb = 2", "Table": "multicol_tbl", @@ -4370,7 +4208,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where cola = 1 and colb = 2 for update", "Query": "delete from multicol_tbl where cola = 1 and colb = 2", "Table": "multicol_tbl", @@ -4401,7 +4238,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where colb = 2 and cola = 1 for update", "Query": "delete from multicol_tbl where colb = 2 and cola = 1", "Table": "multicol_tbl", @@ -4428,7 +4264,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where colb = 2 and cola = 1 for update", "Query": "delete from multicol_tbl where colb = 2 and cola = 1", "Table": "multicol_tbl", @@ -4459,7 +4294,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where colb in (1, 2) and cola = 1 for update", "Query": "delete from multicol_tbl where colb in (1, 2) and cola = 1", "Table": "multicol_tbl", @@ -4490,7 +4324,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where colb in (1, 2) and cola in (3, 4) for update", "Query": "delete from multicol_tbl where colb in (1, 2) and cola in (3, 4)", "Table": "multicol_tbl", @@ -4524,7 +4357,6 @@ ], "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name`, colc = 1 from multicol_tbl where cola = 1 and colb = 2 for update", "Query": "update multicol_tbl set colc = 1 where cola = 1 and colb = 2", "Table": "multicol_tbl", @@ -4554,7 +4386,6 @@ ], "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name`, colc = 1 from multicol_tbl where cola = 1 and colb = 2 for update", "Query": "update multicol_tbl set colc = 1 where cola = 1 and colb = 2", "Table": "multicol_tbl", @@ -4583,7 +4414,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 42 where `name` = 'foo'", "Table": "multicol_tbl", "Values": [ @@ -4610,7 +4440,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 42 where cola = 1", "Table": "multicol_tbl", "Values": [ @@ -4633,7 +4462,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 42 where cola = 1", "Table": "multicol_tbl", "Values": [ @@ -4665,7 +4493,6 @@ ], "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name`, `name` = 'bar' from multicol_tbl where cola = 1 for update", "Query": "update multicol_tbl set `name` = 'bar' where cola = 1", "Table": "multicol_tbl", @@ -4694,7 +4521,6 @@ ], "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name`, `name` = 'bar' from multicol_tbl where cola = 1 for update", "Query": "update multicol_tbl set `name` = 'bar' where cola = 1", "Table": "multicol_tbl", @@ -4727,7 +4553,6 @@ ], "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name`, `name` = 'bar' from multicol_tbl where cola in (1, 2) for update", "Query": "update multicol_tbl set `name` = 'bar' where cola in (1, 2)", "Table": "multicol_tbl", @@ -4755,7 +4580,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where `name` = 'foo' and cola = 2", "Table": "multicol_tbl", "Values": [ @@ -4778,7 +4602,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update multicol_tbl set x = 1 where `name` = 'foo' and cola = 2", "Table": "multicol_tbl", "Values": [ @@ -4807,7 +4630,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where `name` = 'foo' for update", "Query": "delete from multicol_tbl where `name` = 'foo'", "Table": "multicol_tbl", @@ -4837,7 +4659,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where cola = 1 for update", "Query": "delete from multicol_tbl where cola = 1", "Table": "multicol_tbl", @@ -4863,7 +4684,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where cola = 1 for update", "Query": "delete from multicol_tbl where cola = 1", "Table": "multicol_tbl", @@ -4893,7 +4713,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where cola in (1, 2) for update", "Query": "delete from multicol_tbl where cola in (1, 2)", "Table": "multicol_tbl", @@ -4923,7 +4742,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where `name` = 'foo' and cola = 2 for update", "Query": "delete from multicol_tbl where `name` = 'foo' and cola = 2", "Table": "multicol_tbl", @@ -4949,7 +4767,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 2, "KsidVindex": "multicolIdx", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select cola, colb, colc, `name` from multicol_tbl where `name` = 'foo' and cola = 2 for update", "Query": "delete from multicol_tbl where `name` = 'foo' and cola = 2", "Table": "multicol_tbl", @@ -4977,7 +4794,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "music", "VindexOffsetFromSelect": { "music_user_map": "[0]", @@ -5012,7 +4828,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "music", "VindexOffsetFromSelect": { "music_user_map": "[0]", @@ -5068,7 +4883,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5103,7 +4917,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5143,7 +4956,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[1]" @@ -5178,7 +4990,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[1]" @@ -5218,7 +5029,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(0)", - "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { "costly_map": "[-1]", @@ -5255,7 +5065,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(0)", - "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { "costly_map": "[-1]", @@ -5297,7 +5106,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", - "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { "costly_map": "[-1]", @@ -5334,7 +5142,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", - "MultiShardAutocommit": false, "TableName": "user", "VindexOffsetFromSelect": { "costly_map": "[-1]", @@ -5381,7 +5188,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5416,7 +5222,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5455,7 +5260,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded(col) select col from unsharded_auto for update", "TableName": "unsharded" }, @@ -5474,7 +5278,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into unsharded(col) select col from unsharded_auto", "TableName": "unsharded" }, @@ -5499,7 +5302,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5534,7 +5336,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5574,7 +5375,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5609,7 +5409,6 @@ }, "TargetTabletType": "PRIMARY", "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(2)", - "MultiShardAutocommit": false, "TableName": "user_extra", "VindexOffsetFromSelect": { "user_index": "[0]" @@ -5648,7 +5447,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "unsharded", "Inputs": [ { @@ -5679,7 +5477,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "unsharded", "Inputs": [ { @@ -5715,7 +5512,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "unsharded", "Inputs": [ { @@ -5746,7 +5542,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "TableName": "unsharded", "Inputs": [ { @@ -5801,7 +5596,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = :__sq1", "Table": "user" } @@ -5846,7 +5640,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = :__sq1", "Table": "unsharded" } @@ -5917,7 +5710,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update unsharded set col = :__sq1", "Table": "unsharded" } @@ -5944,7 +5736,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = (select count(*) from user_extra where user_extra.user_id = 5) where id = 5", "Table": "user", "Values": [ @@ -5973,7 +5764,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = (select count(*) from user_extra where user_extra.user_id = `user`.id) where id = 5", "Table": "user", "Values": [ @@ -6002,7 +5792,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = (select count(*) from user_extra where user_extra.user_id = `user`.id) where id > 5", "Table": "user" }, @@ -6026,7 +5815,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into authoritative(user_id) values (:_user_id_0)", "TableName": "authoritative", "VindexValues": { @@ -6063,7 +5851,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` for update", "Query": "delete from `user`", "Table": "user" @@ -6095,7 +5882,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` for update", "Query": "delete from `user`", "Table": "user" @@ -6121,7 +5907,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete foo from unsharded as foo join (select id from unsharded as a join unsharded_b as b on a.user_id = b.user_id) as keepers on foo.id = keepers.id where keepers.id is null and foo.col is not null and foo.col < 1000", "Table": "unsharded, unsharded, unsharded_b" }, @@ -6141,7 +5926,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete foo from unsharded as foo join (select id from unsharded as a join unsharded_b as b on a.user_id = b.user_id) as keepers on foo.id = keepers.id where keepers.id is null and foo.col is not null and foo.col < 1000", "Table": "unsharded, unsharded_b" }, @@ -6165,7 +5949,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = 1 where (`name`, col) in (('aa', 'bb'), ('cc', 'dd'))", "Table": "user" }, @@ -6184,7 +5967,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update `user` set col = 1 where (`name`, col) in (('aa', 'bb'), ('cc', 'dd'))", "Table": "user", "Values": [ @@ -6213,7 +5995,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where (`name`, col) in (('aa', 'bb'), ('cc', 'dd')) for update", "Query": "delete from `user` where (`name`, col) in (('aa', 'bb'), ('cc', 'dd'))", "Table": "user" @@ -6235,7 +6016,6 @@ "TargetTabletType": "PRIMARY", "KsidLength": 1, "KsidVindex": "user_index", - "MultiShardAutocommit": false, "OwnedVindexQuery": "select Id, `Name`, Costly from `user` where (`name`, col) in (('aa', 'bb'), ('cc', 'dd')) for update", "Query": "delete from `user` where (`name`, col) in (('aa', 'bb'), ('cc', 'dd'))", "Table": "user", @@ -6263,7 +6043,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into ref(col) values (1)", "TableName": "ref" }, @@ -6286,7 +6065,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update m1 set foo = last_insert_id(foo + 1) where id = 12345", "Table": "m1" }, diff --git a/go/vt/vtgate/planbuilder/testdata/oltp_cases.json b/go/vt/vtgate/planbuilder/testdata/oltp_cases.json index 88717292379..0a283a77b84 100644 --- a/go/vt/vtgate/planbuilder/testdata/oltp_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/oltp_cases.json @@ -242,7 +242,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update sbtest6 set k = k + 1 where id = 5", "Table": "sbtest6", "Values": [ @@ -265,7 +264,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update sbtest6 set k = k + 1 where id = 5", "Table": "sbtest6", "Values": [ @@ -292,7 +290,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update sbtest9 set c = 7 where id = 8", "Table": "sbtest9", "Values": [ @@ -315,7 +312,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update sbtest9 set c = 7 where id = 8", "Table": "sbtest9", "Values": [ @@ -342,7 +338,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from sbtest15 where id = 7525", "Table": "sbtest15", "Values": [ @@ -365,7 +360,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from sbtest15 where id = 7525", "Table": "sbtest15", "Values": [ @@ -392,7 +386,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into sbtest16(id, k, c, pad) values (:_id_0, 1, 2, 50)", "TableName": "sbtest16", "VindexValues": { @@ -404,4 +397,4 @@ ] } } -] \ No newline at end of file +] diff --git a/go/vt/vtgate/planbuilder/testdata/reference_cases.json b/go/vt/vtgate/planbuilder/testdata/reference_cases.json index b717bc80482..f7f892f2453 100644 --- a/go/vt/vtgate/planbuilder/testdata/reference_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/reference_cases.json @@ -323,7 +323,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into ambiguous_ref_with_source(col) values (1)", "TableName": "ambiguous_ref_with_source" }, @@ -346,7 +345,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into ambiguous_ref_with_source(col) values (1)", "TableName": "ambiguous_ref_with_source" }, @@ -365,7 +363,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into ambiguous_ref_with_source(col) values (1)", "TableName": "ambiguous_ref_with_source" }, @@ -388,7 +385,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update ambiguous_ref_with_source set col = 1", "Table": "ambiguous_ref_with_source" }, @@ -412,7 +408,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update ambiguous_ref_with_source set col = 1", "Table": "ambiguous_ref_with_source" }, @@ -435,7 +430,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from ambiguous_ref_with_source where col = 1", "Table": "ambiguous_ref_with_source" }, @@ -459,7 +453,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from ambiguous_ref_with_source where col = 1", "Table": "ambiguous_ref_with_source" }, diff --git a/go/vt/vtgate/planbuilder/testdata/tpcc_cases.json b/go/vt/vtgate/planbuilder/testdata/tpcc_cases.json index ed28ddf599b..a36319cb322 100644 --- a/go/vt/vtgate/planbuilder/testdata/tpcc_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/tpcc_cases.json @@ -104,7 +104,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update district1 set d_next_o_id = 56 where d_id = 9842 and d_w_id = 8546", "Table": "district1", "Values": [ @@ -127,7 +126,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update district1 set d_next_o_id = 56 where d_id = 9842 and d_w_id = 8546", "Table": "district1", "Values": [ @@ -154,7 +152,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into orders1(o_id, o_d_id, o_w_id, o_c_id, o_entry_d, o_ol_cnt, o_all_local) values (334983, 59896, :_o_w_id_0, 156, now(), 781038, 'hello')", "TableName": "orders1", "VindexValues": { @@ -180,7 +177,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into new_orders1(no_o_id, no_d_id, no_w_id) values (8, 9, :_no_w_id_0)", "TableName": "new_orders1", "VindexValues": { @@ -296,7 +292,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update stock1 set s_quantity = 894 where s_i_id = 156 and s_w_id = 6", "Table": "stock1", "Values": [ @@ -319,7 +314,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update stock1 set s_quantity = 894 where s_i_id = 156 and s_w_id = 6", "Table": "stock1", "Values": [ @@ -346,7 +340,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into order_line1(ol_o_id, ol_d_id, ol_w_id, ol_number, ol_i_id, ol_supply_w_id, ol_quantity, ol_amount, ol_dist_info) values (648, 36812, :_ol_w_id_0, 4946378, 3, 7, 89, 1, 'info')", "TableName": "order_line1", "VindexValues": { @@ -372,7 +365,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update warehouse1 set w_ytd = w_ytd + 946879 where w_id = 3", "Table": "warehouse1", "Values": [ @@ -395,7 +387,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update warehouse1 set w_ytd = w_ytd + 946879 where w_id = 3", "Table": "warehouse1", "Values": [ @@ -467,7 +458,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update district1 set d_ytd = d_ytd + 2 where d_w_id = 89 and d_id = 9", "Table": "district1", "Values": [ @@ -490,7 +480,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update district1 set d_ytd = d_ytd + 2 where d_w_id = 89 and d_id = 9", "Table": "district1", "Values": [ @@ -742,7 +731,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = 508.98, c_ytd_payment = 48941.980301, c_data = 'i am data' where c_w_id = 20 and c_d_id = 387 and c_id = 98", "Table": "customer1", "Values": [ @@ -765,7 +753,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = 508.98, c_ytd_payment = 48941.980301, c_data = 'i am data' where c_w_id = 20 and c_d_id = 387 and c_id = 98", "Table": "customer1", "Values": [ @@ -792,7 +779,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = 508.98, c_ytd_payment = 48941.980301 where c_w_id = 20 and c_d_id = 387 and c_id = 98", "Table": "customer1", "Values": [ @@ -815,7 +801,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = 508.98, c_ytd_payment = 48941.980301 where c_w_id = 20 and c_d_id = 387 and c_id = 98", "Table": "customer1", "Values": [ @@ -842,7 +827,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into history1(h_c_d_id, h_c_w_id, h_c_id, h_d_id, h_w_id, h_date, h_amount, h_data) values (6809887, 38748, 8746, 210, :_h_w_id_0, now(), 8907, 'data')", "TableName": "history1", "VindexValues": { @@ -1138,7 +1122,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from new_orders1 where no_o_id = 2218 and no_d_id = 358 and no_w_id = 98465", "Table": "new_orders1", "Values": [ @@ -1161,7 +1144,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from new_orders1 where no_o_id = 2218 and no_d_id = 358 and no_w_id = 98465", "Table": "new_orders1", "Values": [ @@ -1233,7 +1215,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update orders1 set o_carrier_id = 9 where o_id = 56 and o_d_id = 98 and o_w_id = 897", "Table": "orders1", "Values": [ @@ -1256,7 +1237,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update orders1 set o_carrier_id = 9 where o_id = 56 and o_d_id = 98 and o_w_id = 897", "Table": "orders1", "Values": [ @@ -1283,7 +1263,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update order_line1 set ol_delivery_d = now() where ol_o_id = 235 and ol_d_id = 315 and ol_w_id = 8", "Table": "order_line1", "Values": [ @@ -1306,7 +1285,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update order_line1 set ol_delivery_d = now() where ol_o_id = 235 and ol_d_id = 315 and ol_w_id = 8", "Table": "order_line1", "Values": [ @@ -1378,7 +1356,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = c_balance + 988.01, c_delivery_cnt = c_delivery_cnt + 1 where c_id = 6 and c_d_id = 5 and c_w_id = 160", "Table": "customer1", "Values": [ @@ -1401,7 +1378,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "update customer1 set c_balance = c_balance + 988.01, c_delivery_cnt = c_delivery_cnt + 1 where c_id = 6 and c_d_id = 5 and c_w_id = 160", "Table": "customer1", "Values": [ @@ -1684,7 +1660,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from order_line1 where ol_w_id = 178 and ol_d_id = 1 and ol_o_id = 84", "Table": "order_line1", "Values": [ @@ -1707,7 +1682,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from order_line1 where ol_w_id = 178 and ol_d_id = 1 and ol_o_id = 84", "Table": "order_line1", "Values": [ @@ -1734,7 +1708,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from orders1 where o_w_id = 1 and o_d_id = 3 and o_id = 384", "Table": "orders1", "Values": [ @@ -1757,7 +1730,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from orders1 where o_w_id = 1 and o_d_id = 3 and o_id = 384", "Table": "orders1", "Values": [ @@ -1784,7 +1756,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from history1 where h_w_id = 75 and h_d_id = 102 limit 10", "Table": "history1", "Values": [ @@ -1807,7 +1778,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "delete from history1 where h_w_id = 75 and h_d_id = 102 limit 10", "Table": "history1", "Values": [ @@ -1820,4 +1790,4 @@ ] } } -] \ No newline at end of file +] From 0955025338049e6ea80da0c4d241be3fc2f6a994 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Sat, 27 May 2023 01:07:16 +0530 Subject: [PATCH 08/21] added support for insert ignore and insert on duplicate planning Signed-off-by: Harshit Gangal --- go/vt/vtgate/engine/insert.go | 2 +- go/vt/vtgate/planbuilder/gen4_planner.go | 3 +++ .../planbuilder/operator_transformers.go | 1 + go/vt/vtgate/planbuilder/operators/insert.go | 2 ++ go/vt/vtgate/planbuilder/operators/logical.go | 26 ++++++++++++++----- 5 files changed, 26 insertions(+), 8 deletions(-) diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index 37bb3646c74..68fc1755c03 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -1001,7 +1001,7 @@ func (ins *Insert) description() PrimitiveDescription { if len(ins.Mid) > 0 { shardQuery := fmt.Sprintf("%s%s%s", ins.Prefix, strings.Join(ins.Mid, ", "), ins.Suffix) if shardQuery != ins.Query { - panic("oh no!!") + other["ShardedQuery"] = shardQuery } } return PrimitiveDescription{ diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index f40b5408cd7..13a03a14382 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -425,6 +425,9 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm if err != nil { return nil, err } + // remove any alias added from routing table. + // insert query does not support table alias. + insStmt.Table.As = sqlparser.NewIdentifierCS("") if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil && tables[0].AutoIncrement == nil { eIns := &engine.Insert{} diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 0dc4dcf3769..11221a7c96d 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -410,6 +410,7 @@ func transformInsertPlan(op *operators.Route, ins *operators.Insert) (logicalPla VindexValues: ins.VindexValues, ColVindexes: ins.ColVindexes, Generate: autoIncGenerate(ins.AutoIncrement), + Ignore: ins.Ignore, } if eins.Opcode == engine.InsertSharded { eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 1953bf6087f..9057976efc4 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -39,6 +39,7 @@ type Insert struct { ColVindexes []*vindexes.ColumnVindex AutoIncrement Generate + Ignore bool noInputs noColumns @@ -84,6 +85,7 @@ func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { VindexValues: i.VindexValues, ColVindexes: i.ColVindexes, AutoIncrement: i.AutoIncrement, + Ignore: i.Ignore, } } diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index b968eba26c4..482efcb01d9 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -308,6 +308,10 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I for vIdx, colVindex := range colVindexes { routeValues[vIdx] = make([][]evalengine.Expr, len(colVindex.Columns)) for colIdx, col := range colVindex.Columns { + err = checkAndErrIfVindexChanging(sqlparser.UpdateExprs(ins.OnDup), col) + if err != nil { + return nil, err + } routeValues[vIdx][colIdx] = make([]evalengine.Expr, len(rows)) colNum := findOrAddColumn(ins, col) for rowNum, row := range rows { @@ -316,13 +320,6 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I return nil, err } routeValues[vIdx][colIdx][rowNum] = innerpv - } - } - } - for _, colVindex := range colVindexes { - for _, col := range colVindex.Columns { - colNum := findOrAddColumn(ins, col) - for rowNum, row := range rows { name := engine.InsertVarName(col, rowNum) row[colNum] = sqlparser.NewArgument(name) } @@ -330,6 +327,7 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I } insOp.ColVindexes = colVindexes insOp.VindexValues = routeValues + insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil return route, nil } @@ -343,6 +341,20 @@ func getColVindexes(allColVindexes []*vindexes.ColumnVindex) (colVindexes []*vin return } +func checkAndErrIfVindexChanging(setClauses sqlparser.UpdateExprs, col sqlparser.IdentifierCI) error { + for _, assignment := range setClauses { + if col.Equal(assignment.Name.Name) { + valueExpr, isValuesFuncExpr := assignment.Expr.(*sqlparser.ValuesFuncExpr) + // update on duplicate key is changing the vindex column, not supported. + if !isValuesFuncExpr || !valueExpr.Name.Name.Equal(assignment.Name.Name) { + return vterrors.VT12001("DML cannot update vindex column") + } + return nil + } + } + return nil +} + // findOrAddColumn finds the position of a column in the insert. If it's // absent it appends it to the with NULL values and returns that position. func findOrAddColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { From 459a495563db2294fac88f737381de7d01726582 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Sat, 27 May 2023 01:48:33 +0530 Subject: [PATCH 09/21] gen4: added support for comment directive Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/gen4_planner.go | 107 +++++++++++------- .../planbuilder/operator_transformers.go | 12 +- .../planbuilder/single_sharded_shortcut.go | 2 +- .../planbuilder/testdata/dml_cases.json | 64 +++++++++++ 4 files changed, 131 insertions(+), 54 deletions(-) diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index 13a03a14382..475e1d31528 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -26,6 +26,7 @@ import ( "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" + "vitess.io/vitess/go/vt/vtgate/vindexes" ) func gen4Planner(query string, plannerVersion querypb.ExecuteOptions_PlannerVersion) stmtPlanner { @@ -186,14 +187,11 @@ func newBuildSelectPlan( ctx := plancontext.NewPlanningContext(reservedVars, semTable, vschema, version) if ks, _ := semTable.SingleUnshardedKeyspace(); ks != nil { - plan, tablesUsed, err = unshardedShortcut(ctx, selStmt, ks) - if err != nil { - return nil, nil, nil, err - } - plan, err = pushCommentDirectivesOnPlan(plan, selStmt) + plan, tablesUsed, err = selectUnshardedShortcut(ctx, selStmt, ks) if err != nil { return nil, nil, nil, err } + plan = pushCommentDirectivesOnPlan(plan, selStmt) return plan, semTable, tablesUsed, err } @@ -230,10 +228,7 @@ func newBuildSelectPlan( return nil, nil, nil, err } - plan, err = pushCommentDirectivesOnPlan(plan, selStmt) - if err != nil { - return nil, nil, nil, err - } + plan = pushCommentDirectivesOnPlan(plan, selStmt) return plan, semTable, operators.TablesUsed(op), nil } @@ -287,13 +282,9 @@ func gen4UpdateStmtPlanner( } if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil { - edml := engine.NewDML() - edml.Keyspace = ks - edml.Table = tables - edml.Opcode = engine.Unsharded - edml.Query = generateQuery(updStmt) - upd := &engine.Update{DML: edml} - return newPlanResult(upd, operators.QualifiedTables(ks, tables)...), nil + plan := updateUnshardedShortcut(updStmt, ks, tables) + plan = pushCommentDirectivesOnPlan(plan, updStmt) + return newPlanResult(plan.Primitive(), operators.QualifiedTables(ks, tables)...), nil } if semTable.NotUnshardedErr != nil { @@ -317,10 +308,7 @@ func gen4UpdateStmtPlanner( return nil, err } - plan, err = pushCommentDirectivesOnPlan(plan, updStmt) - if err != nil { - return nil, err - } + plan = pushCommentDirectivesOnPlan(plan, updStmt) setLockOnAllSelect(plan) @@ -331,6 +319,15 @@ func gen4UpdateStmtPlanner( return newPlanResult(plan.Primitive(), operators.TablesUsed(op)...), nil } +func updateUnshardedShortcut(stmt *sqlparser.Update, ks *vindexes.Keyspace, tables []*vindexes.Table) logicalPlan { + edml := engine.NewDML() + edml.Keyspace = ks + edml.Table = tables + edml.Opcode = engine.Unsharded + edml.Query = generateQuery(stmt) + return &primitiveWrapper{prim: &engine.Update{DML: edml}} +} + func gen4DeleteStmtPlanner( version querypb.ExecuteOptions_PlannerVersion, deleteStmt *sqlparser.Delete, @@ -366,13 +363,9 @@ func gen4DeleteStmtPlanner( } if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil { - edml := engine.NewDML() - edml.Keyspace = ks - edml.Table = tables - edml.Opcode = engine.Unsharded - edml.Query = generateQuery(deleteStmt) - del := &engine.Delete{DML: edml} - return newPlanResult(del, operators.QualifiedTables(ks, tables)...), nil + plan := deleteUnshardedShortcut(deleteStmt, ks, tables) + plan = pushCommentDirectivesOnPlan(plan, deleteStmt) + return newPlanResult(plan.Primitive(), operators.QualifiedTables(ks, tables)...), nil } if err := checkIfDeleteSupported(deleteStmt, semTable); err != nil { @@ -395,10 +388,7 @@ func gen4DeleteStmtPlanner( return nil, err } - plan, err = pushCommentDirectivesOnPlan(plan, deleteStmt) - if err != nil { - return nil, err - } + plan = pushCommentDirectivesOnPlan(plan, deleteStmt) setLockOnAllSelect(plan) @@ -409,6 +399,15 @@ func gen4DeleteStmtPlanner( return newPlanResult(plan.Primitive(), operators.TablesUsed(op)...), nil } +func deleteUnshardedShortcut(stmt *sqlparser.Delete, ks *vindexes.Keyspace, tables []*vindexes.Table) logicalPlan { + edml := engine.NewDML() + edml.Keyspace = ks + edml.Table = tables + edml.Opcode = engine.Unsharded + edml.Query = generateQuery(stmt) + return &primitiveWrapper{prim: &engine.Delete{DML: edml}} +} + func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStmt *sqlparser.Insert, reservedVars *sqlparser.ReservedVars, vschema plancontext.VSchema) (*planResult, error) { ksName := "" if ks, _ := vschema.DefaultKeyspace(); ks != nil { @@ -430,12 +429,9 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm insStmt.Table.As = sqlparser.NewIdentifierCS("") if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil && tables[0].AutoIncrement == nil { - eIns := &engine.Insert{} - eIns.Keyspace = ks - eIns.Table = tables[0] - eIns.Opcode = engine.InsertUnsharded - eIns.Query = generateQuery(insStmt) - return newPlanResult(eIns, operators.QualifiedTables(ks, tables)...), nil + plan := insertUnshardedShortcut(insStmt, ks, tables) + plan = pushCommentDirectivesOnPlan(plan, insStmt) + return newPlanResult(plan.Primitive(), operators.QualifiedTables(ks, tables)...), nil } if semTable.NotUnshardedErr != nil { @@ -459,10 +455,7 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm return nil, err } - plan, err = pushCommentDirectivesOnPlan(plan, insStmt) - if err != nil { - return nil, err - } + plan = pushCommentDirectivesOnPlan(plan, insStmt) setLockOnAllSelect(plan) @@ -473,6 +466,15 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm return newPlanResult(plan.Primitive(), operators.TablesUsed(op)...), nil } +func insertUnshardedShortcut(stmt *sqlparser.Insert, ks *vindexes.Keyspace, tables []*vindexes.Table) logicalPlan { + eIns := &engine.Insert{} + eIns.Keyspace = ks + eIns.Table = tables[0] + eIns.Opcode = engine.InsertUnsharded + eIns.Query = generateQuery(stmt) + return &primitiveWrapper{prim: eIns} +} + func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema) error { // Rewrite routed tables return sqlparser.Walk(func(node sqlparser.SQLNode) (bool, error) { @@ -599,27 +601,44 @@ func planOrderByOnUnion(ctx *plancontext.PlanningContext, plan logicalPlan, unio return plan, nil } -func pushCommentDirectivesOnPlan(plan logicalPlan, stmt sqlparser.Statement) (logicalPlan, error) { +func pushCommentDirectivesOnPlan(plan logicalPlan, stmt sqlparser.Statement) logicalPlan { var directives *sqlparser.CommentDirectives cmt, ok := stmt.(sqlparser.Commented) if ok { directives = cmt.GetParsedComments().Directives() scatterAsWarns := directives.IsSet(sqlparser.DirectiveScatterErrorsAsWarnings) timeout := queryTimeout(directives) + multiShardAutoCommit := directives.IsSet(sqlparser.DirectiveMultiShardAutocommit) - if scatterAsWarns || timeout > 0 { + if scatterAsWarns || timeout > 0 || multiShardAutoCommit { _, _ = visit(plan, func(logicalPlan logicalPlan) (bool, logicalPlan, error) { switch plan := logicalPlan.(type) { case *routeGen4: plan.eroute.ScatterErrorsAsWarnings = scatterAsWarns plan.eroute.QueryTimeout = timeout + case *primitiveWrapper: + setDirective(plan.prim, multiShardAutoCommit, timeout) } return true, logicalPlan, nil }) } } - return plan, nil + return plan +} + +func setDirective(prim engine.Primitive, msac bool, timeout int) { + switch edml := prim.(type) { + case *engine.Insert: + edml.MultiShardAutocommit = msac + edml.QueryTimeout = timeout + case *engine.Update: + edml.MultiShardAutocommit = msac + edml.QueryTimeout = timeout + case *engine.Delete: + edml.MultiShardAutocommit = msac + edml.QueryTimeout = timeout + } } // checkIfDeleteSupported checks if the delete query is supported or we must return an error. diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 11221a7c96d..b25c4f14a48 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -490,7 +490,7 @@ func transformUpdatePlan(ctx *plancontext.PlanningContext, op *operators.Route, RoutingParameters: rp, } - transformDMLPlan(upd.AST, upd.VTable, edml, op.Routing, len(upd.ChangedVindexValues) > 0) + transformDMLPlan(upd.VTable, edml, op.Routing, len(upd.ChangedVindexValues) > 0) e := &engine.Update{ ChangedVindexValues: upd.ChangedVindexValues, @@ -517,7 +517,7 @@ func transformDeletePlan(ctx *plancontext.PlanningContext, op *operators.Route, RoutingParameters: rp, } - transformDMLPlan(del.AST, del.VTable, edml, op.Routing, del.OwnedVindexQuery != "") + transformDMLPlan(del.VTable, edml, op.Routing, del.OwnedVindexQuery != "") e := &engine.Delete{ DML: edml, @@ -526,13 +526,7 @@ func transformDeletePlan(ctx *plancontext.PlanningContext, op *operators.Route, return &primitiveWrapper{prim: e}, nil } -func transformDMLPlan(stmt sqlparser.Commented, vtable *vindexes.Table, edml *engine.DML, routing operators.Routing, setVindex bool) { - directives := stmt.GetParsedComments().Directives() - if directives.IsSet(sqlparser.DirectiveMultiShardAutocommit) { - edml.MultiShardAutocommit = true - } - edml.QueryTimeout = queryTimeout(directives) - +func transformDMLPlan(vtable *vindexes.Table, edml *engine.DML, routing operators.Routing, setVindex bool) { if routing.OpCode() != engine.Unsharded && setVindex { primary := vtable.ColumnVindexes[0] edml.KsidVindex = primary.Vindex diff --git a/go/vt/vtgate/planbuilder/single_sharded_shortcut.go b/go/vt/vtgate/planbuilder/single_sharded_shortcut.go index 80d3b0fba11..56326c8b96f 100644 --- a/go/vt/vtgate/planbuilder/single_sharded_shortcut.go +++ b/go/vt/vtgate/planbuilder/single_sharded_shortcut.go @@ -29,7 +29,7 @@ import ( "vitess.io/vitess/go/vt/vtgate/vindexes" ) -func unshardedShortcut(ctx *plancontext.PlanningContext, stmt sqlparser.SelectStatement, ks *vindexes.Keyspace) (logicalPlan, []string, error) { +func selectUnshardedShortcut(ctx *plancontext.PlanningContext, stmt sqlparser.SelectStatement, ks *vindexes.Keyspace) (logicalPlan, []string, error) { // this method is used when the query we are handling has all tables in the same unsharded keyspace sqlparser.SafeRewrite(stmt, nil, func(cursor *sqlparser.Cursor) bool { switch node := cursor.Node().(type) { diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 2b76f417a4d..51a535d9aba 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -6072,5 +6072,69 @@ "main.m1" ] } + }, + { + "comment": "unsharded update query with comment directive", + "query": "update /*vt+ QUERY_TIMEOUT_MS=1 */ unsharded set val = 1", + "v3-plan": { + "QueryType": "UPDATE", + "Original": "update /*vt+ QUERY_TIMEOUT_MS=1 */ unsharded set val = 1", + "Instructions": { + "OperatorType": "Update", + "Variant": "Unsharded", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "TargetTabletType": "PRIMARY", + "Query": "update /*vt+ QUERY_TIMEOUT_MS=1 */ unsharded set val = 1", + "Table": "unsharded" + }, + "TablesUsed": [ + "main.unsharded" + ] + }, + "gen4-plan": { + "QueryType": "UPDATE", + "Original": "update /*vt+ QUERY_TIMEOUT_MS=1 */ unsharded set val = 1", + "Instructions": { + "OperatorType": "Update", + "Variant": "Unsharded", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "TargetTabletType": "PRIMARY", + "Query": "update /*vt+ QUERY_TIMEOUT_MS=1 */ unsharded set val = 1", + "QueryTimeout": 1, + "Table": "unsharded" + }, + "TablesUsed": [ + "main.unsharded" + ] + } + }, + { + "comment": "unsharded insert query with comment directive", + "query": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into unsharded values ()", + "plan": { + "QueryType": "INSERT", + "Original": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into unsharded values ()", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Unsharded", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "TargetTabletType": "PRIMARY", + "Query": "insert /*vt+ QUERY_TIMEOUT_MS=1 */ into unsharded values ()", + "QueryTimeout": 1, + "TableName": "unsharded" + }, + "TablesUsed": [ + "main.unsharded" + ] + } } ] From dc75dd6c83fc5657f64782dfeb2ac06c2d322d5d Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Sat, 27 May 2023 19:03:16 +0530 Subject: [PATCH 10/21] error only when column list is empty and values are provided and table's column list is not known Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/operators/logical.go | 21 ++++++++++++++++++- go/vt/vtgate/planbuilder/plan_test.go | 12 +---------- .../planbuilder/testdata/dml_cases.json | 2 +- .../planbuilder/testdata/reference_cases.json | 2 -- 4 files changed, 22 insertions(+), 15 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 482efcb01d9..1ba1364f5dd 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -274,7 +274,7 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I // Table column list is nil then add all the columns // If the column list is empty then add only the auto-inc column and this happens on calling modifyForAutoinc - if ins.Columns == nil { + if ins.Columns == nil && valuesProvided(ins.Rows) { if vindexTable.ColumnListAuthoritative { ins = populateInsertColumnlist(ins, vindexTable) } else { @@ -320,17 +320,36 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I return nil, err } routeValues[vIdx][colIdx][rowNum] = innerpv + } + } + } + // here we are replacing the row value with the argument. + for _, colVindex := range colVindexes { + for _, col := range colVindex.Columns { + colNum := findOrAddColumn(ins, col) + for rowNum, row := range rows { name := engine.InsertVarName(col, rowNum) row[colNum] = sqlparser.NewArgument(name) } } } + insOp.ColVindexes = colVindexes insOp.VindexValues = routeValues insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil return route, nil } +func valuesProvided(rows sqlparser.InsertRows) bool { + switch values := rows.(type) { + case sqlparser.Values: + return len(values) >= 0 && len(values[0]) > 0 + case sqlparser.SelectStatement: + return true + } + return false +} + func getColVindexes(allColVindexes []*vindexes.ColumnVindex) (colVindexes []*vindexes.ColumnVindex) { for _, colVindex := range allColVindexes { if colVindex.IsPartialVindex() { diff --git a/go/vt/vtgate/planbuilder/plan_test.go b/go/vt/vtgate/planbuilder/plan_test.go index bf3eca127e5..386f8b08603 100644 --- a/go/vt/vtgate/planbuilder/plan_test.go +++ b/go/vt/vtgate/planbuilder/plan_test.go @@ -31,17 +31,6 @@ import ( "github.com/nsf/jsondiff" "github.com/stretchr/testify/require" - querypb "vitess.io/vitess/go/vt/proto/query" - "vitess.io/vitess/go/vt/servenv" - "vitess.io/vitess/go/vt/sidecardb" - - vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" - - "vitess.io/vitess/go/test/utils" - vschemapb "vitess.io/vitess/go/vt/proto/vschema" - oprewriters "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" - "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" - "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/sqltypes" "vitess.io/vitess/go/test/utils" @@ -57,6 +46,7 @@ import ( "vitess.io/vitess/go/vt/topo/topoproto" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + oprewriters "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" "vitess.io/vitess/go/vt/vtgate/vindexes" diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 51a535d9aba..9d2e690d703 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -2190,7 +2190,7 @@ "comment": "insert into a vindex not allowed", "query": "insert into user_index(id) values(1)", "v3-plan": "VT12001: unsupported: multi-shard or vindex write statement", - "gen4-plan": "VT09012: vindex cannot be modified" + "gen4-plan": "VT09014: vindex cannot be modified" }, { "comment": "simple replace unsharded", diff --git a/go/vt/vtgate/planbuilder/testdata/reference_cases.json b/go/vt/vtgate/planbuilder/testdata/reference_cases.json index f7f892f2453..ac5338ecd3a 100644 --- a/go/vt/vtgate/planbuilder/testdata/reference_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/reference_cases.json @@ -684,7 +684,6 @@ "Sharded": true }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into global_ref(col) values (1)", "TableName": "global_ref" }, @@ -703,7 +702,6 @@ "Sharded": false }, "TargetTabletType": "PRIMARY", - "MultiShardAutocommit": false, "Query": "insert into global_ref(col) values (1)", "TableName": "global_ref" }, From 2cbed7b734c6aad53cfd4fe5adc3b84f7d64708b Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Tue, 30 May 2023 21:59:16 +0530 Subject: [PATCH 11/21] gen4: added support for insert using select Signed-off-by: Harshit Gangal --- go/vt/vtgate/engine/insert.go | 8 +- go/vt/vtgate/planbuilder/gen4_planner.go | 2 + go/vt/vtgate/planbuilder/insert.go | 63 ++++++-- .../planbuilder/operator_transformers.go | 87 ++++++----- go/vt/vtgate/planbuilder/operators/insert.go | 52 +++++-- go/vt/vtgate/planbuilder/operators/logical.go | 138 +++++++++++++----- .../vtgate/planbuilder/operators/operator.go | 4 +- .../planbuilder/testdata/dml_cases.json | 12 +- .../testdata/unsupported_cases.json | 6 +- 9 files changed, 256 insertions(+), 116 deletions(-) diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index 68fc1755c03..7da6edc3454 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -949,6 +949,8 @@ func (ins *Insert) description() PrimitiveDescription { "TableName": ins.GetTableName(), "MultiShardAutocommit": ins.MultiShardAutocommit, "QueryTimeout": ins.QueryTimeout, + "InsertIgnore": ins.Ignore, + "InputAsNonStreaming": ins.ForceNonStreaming, } if len(ins.VindexValues) > 0 { @@ -992,12 +994,6 @@ func (ins *Insert) description() PrimitiveDescription { } other["VindexOffsetFromSelect"] = valuesOffsets } - if ins.Ignore { - other["InsertIgnore"] = true - } - if ins.ForceNonStreaming { - other["InputAsNonStreaming"] = true - } if len(ins.Mid) > 0 { shardQuery := fmt.Sprintf("%s%s%s", ins.Prefix, strings.Join(ins.Mid, ", "), ins.Suffix) if shardQuery != ins.Query { diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index 475e1d31528..6ec7bb9162c 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -618,6 +618,8 @@ func pushCommentDirectivesOnPlan(plan logicalPlan, stmt sqlparser.Statement) log plan.eroute.QueryTimeout = timeout case *primitiveWrapper: setDirective(plan.prim, multiShardAutoCommit, timeout) + case *insert: + setDirective(plan.eInsert, multiShardAutoCommit, timeout) } return true, logicalPlan, nil }) diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index a6a305296cc..daa7eaedf8b 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -22,13 +22,12 @@ import ( "strings" "vitess.io/vitess/go/sqltypes" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" - "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/semantics" "vitess.io/vitess/go/vt/vtgate/vindexes" ) @@ -98,7 +97,7 @@ func buildInsertUnshardedPlan(ins *sqlparser.Insert, table *vindexes.Table, rese eins.Query = generateQuery(ins) } else { eins.Input = plan.primitive - generateInsertSelectQuery(ins, eins) + eins.Prefix, _, eins.Suffix = generateInsertShardedQuery(ins) } return newPlanResult(eins, tc.getTables()...), nil case sqlparser.Values: @@ -244,7 +243,7 @@ func buildInsertSelectPlan(ins *sqlparser.Insert, table *vindexes.Table, reserve return nil, err } - generateInsertSelectQuery(ins, eins) + eins.Prefix, _, eins.Suffix = generateInsertShardedQuery(ins) return newPlanResult(eins, tc.getTables()...), nil } @@ -361,17 +360,6 @@ func populateInsertColumnlist(ins *sqlparser.Insert, table *vindexes.Table) { ins.Columns = cols } -func generateInsertSelectQuery(node *sqlparser.Insert, eins *engine.Insert) { - prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - prefixBuf.Myprintf("insert %v%sinto %v%v ", - node.Comments, node.Ignore.ToString(), - node.Table, node.Columns) - eins.Prefix = prefixBuf.String() - suffixBuf.Myprintf("%v", node.OnDup) - eins.Suffix = suffixBuf.String() -} - // modifyForAutoinc modifies the AST and the plan to generate necessary autoinc values. // For row values cases, bind variable names are generated using baseName. func modifyForAutoinc(ins *sqlparser.Insert, eins *engine.Insert) error { @@ -450,3 +438,46 @@ func isVindexChanging(setClauses sqlparser.UpdateExprs, colVindexes []*vindexes. } return false } + +type insert struct { + eInsert *engine.Insert + source logicalPlan + gen4Plan +} + +var _ logicalPlan = (*insert)(nil) + +func (i *insert) WireupGen4(ctx *plancontext.PlanningContext) error { + if i.source == nil { + return nil + } + return i.source.WireupGen4(ctx) +} + +func (i *insert) Primitive() engine.Primitive { + if i.source != nil { + i.eInsert.Input = i.source.Primitive() + } + return i.eInsert +} + +func (i *insert) Inputs() []logicalPlan { + if i.source == nil { + return nil + } + return []logicalPlan{i.source} +} + +func (i *insert) Rewrite(inputs ...logicalPlan) error { + //TODO implement me + panic("implement me") +} + +func (i *insert) ContainsTables() semantics.TableSet { + //TODO implement me + panic("implement me") +} + +func (i *insert) OutputColumns() []sqlparser.SelectExpr { + return nil +} diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index b25c4f14a48..25c1701bab8 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -22,27 +22,19 @@ import ( "strconv" "strings" + "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/slices2" - "vitess.io/vitess/go/vt/vtgate/engine/opcode" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - "vitess.io/vitess/go/sqltypes" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" - - "vitess.io/vitess/go/mysql/collations" - - "vitess.io/vitess/go/vt/vtgate/evalengine" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" - "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + "vitess.io/vitess/go/vt/vtgate/engine/opcode" + "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/vindexes" - - "vitess.io/vitess/go/vt/vterrors" ) func transformToLogicalPlan(ctx *plancontext.PlanningContext, op ops.Operator, isRoot bool) (logicalPlan, error) { @@ -367,7 +359,7 @@ func newRoutingParams(ctx *plancontext.PlanningContext, opCode engine.Opcode) *e func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) (logicalPlan, error) { switch src := op.Source.(type) { case *operators.Insert: - return transformInsertPlan(op, src) + return transformInsertPlan(ctx, op, src) case *operators.Update: return transformUpdatePlan(ctx, op, src) case *operators.Delete: @@ -401,34 +393,46 @@ func transformRoutePlan(ctx *plancontext.PlanningContext, op *operators.Route) ( } -func transformInsertPlan(op *operators.Route, ins *operators.Insert) (logicalPlan, error) { +func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, ins *operators.Insert) (i *insert, err error) { eins := &engine.Insert{ - Opcode: mapToInsertOpCode(op.Routing.OpCode()), - Keyspace: op.Routing.Keyspace(), - Query: generateQuery(ins.AST), - Table: ins.VTable, - VindexValues: ins.VindexValues, - ColVindexes: ins.ColVindexes, - Generate: autoIncGenerate(ins.AutoIncrement), - Ignore: ins.Ignore, + Opcode: mapToInsertOpCode(op.Routing.OpCode(), ins.Input != nil), + Keyspace: op.Routing.Keyspace(), + Table: ins.VTable, + ColVindexes: ins.ColVindexes, + Generate: autoIncGenerate(ins.AutoIncrement), + Ignore: ins.Ignore, + VindexValues: ins.VindexValues, + VindexValueOffset: ins.VindexValueOffset, } + i = &insert{eInsert: eins} + if eins.Opcode == engine.InsertSharded { eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) } - return &primitiveWrapper{prim: eins}, nil + if ins.Input == nil { + eins.Query = generateQuery(ins.AST) + } else { + i.source, err = transformToLogicalPlan(ctx, ins.Input, true) + if err != nil { + return + } + } + return } -func mapToInsertOpCode(code engine.Opcode) engine.InsertOpcode { - switch code { - case engine.Unsharded: +func mapToInsertOpCode(code engine.Opcode, insertSelect bool) engine.InsertOpcode { + if insertSelect { + return engine.InsertSelect + } + if code == engine.Unsharded { return engine.InsertUnsharded } return engine.InsertSharded } -func autoIncGenerate(gen operators.Generate) *engine.Generate { - if gen.Keyspace == nil { +func autoIncGenerate(gen *operators.Generate) *engine.Generate { + if gen == nil { return nil } selNext := &sqlparser.Select{ @@ -444,22 +448,29 @@ func autoIncGenerate(gen operators.Generate) *engine.Generate { } func generateInsertShardedQuery(ins *sqlparser.Insert) (prefix string, mid []string, suffix string) { - valueTuples := ins.Rows.(sqlparser.Values) prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - midBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - mid = make([]string, len(valueTuples)) prefixBuf.Myprintf("insert %v%sinto %v%v values ", ins.Comments, ins.Ignore.ToString(), ins.Table, ins.Columns) prefix = prefixBuf.String() + + suffixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) + suffixBuf.Myprintf("%v", ins.OnDup) + suffix = suffixBuf.String() + + valueTuples, isValues := ins.Rows.(sqlparser.Values) + if !isValues { + // this is a insert query using select to insert the rows. + return + } + + midBuf := sqlparser.NewTrackedBuffer(dmlFormatter) + mid = make([]string, len(valueTuples)) for rowNum, val := range valueTuples { midBuf.Myprintf("%v", val) mid[rowNum] = midBuf.String() midBuf.Reset() } - suffixBuf.Myprintf("%v", ins.OnDup) - suffix = suffixBuf.String() return } diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 9057976efc4..0be9f2cd360 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -28,6 +28,12 @@ type Insert struct { VTable *vindexes.Table AST *sqlparser.Insert + AutoIncrement *Generate + Ignore bool + + // ColVindexes are the vindexes that will use the VindexValues + ColVindexes []*vindexes.ColumnVindex + // VindexValues specifies values for all the vindex columns. // This is a three-dimensional data structure: // Insert.Values[i] represents the values to be inserted for the i'th colvindex (i < len(Insert.Table.ColumnVindexes)) @@ -35,17 +41,30 @@ type Insert struct { // Insert.Values[i].Values[j].Values[k] represents the value pulled from row k for that column: (k < len(ins.rows)) VindexValues [][][]evalengine.Expr - // ColVindexes are the vindexes that will use the VindexValues - ColVindexes []*vindexes.ColumnVindex + // VindexValueOffset stores the offset for each column in the ColumnVindex + // that will appear in the result set of the select query. + VindexValueOffset [][]int - AutoIncrement Generate - Ignore bool + // Insert using select query will have select plan as input + Input ops.Operator - noInputs noColumns noPredicates } +func (i *Insert) Inputs() []ops.Operator { + if i.Input == nil { + return nil + } + return []ops.Operator{i.Input} +} + +func (i *Insert) SetInputs(inputs []ops.Operator) { + if len(inputs) > 0 { + i.Input = inputs[0] + } +} + type Generate struct { Keyspace *vindexes.Keyspace TableName sqlparser.TableName @@ -58,6 +77,9 @@ type Generate struct { // Insert using Select, offset for auto increment column Offset int + + // The auto incremeent column was already present in the insert column list or was added. + added bool } func (i *Insert) Description() ops.OpDescription { @@ -78,14 +100,20 @@ func (i *Insert) GetOrdering() ([]ops.OrderBy, error) { var _ ops.Operator = (*Insert)(nil) func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { + var input ops.Operator + if len(inputs) > 0 { + input = inputs[0] + } return &Insert{ - QTable: i.QTable, - VTable: i.VTable, - AST: i.AST, - VindexValues: i.VindexValues, - ColVindexes: i.ColVindexes, - AutoIncrement: i.AutoIncrement, - Ignore: i.Ignore, + Input: input, + QTable: i.QTable, + VTable: i.VTable, + AST: i.AST, + AutoIncrement: i.AutoIncrement, + Ignore: i.Ignore, + ColVindexes: i.ColVindexes, + VindexValues: i.VindexValues, + VindexValueOffset: i.VindexValueOffset, } } diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 1ba1364f5dd..c483cb092d6 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -273,47 +273,118 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I } // Table column list is nil then add all the columns - // If the column list is empty then add only the auto-inc column and this happens on calling modifyForAutoinc + // If the column list is empty then add only the auto-inc column and + // this happens on calling modifyForAutoinc if ins.Columns == nil && valuesProvided(ins.Rows) { if vindexTable.ColumnListAuthoritative { ins = populateInsertColumnlist(ins, vindexTable) } else { - return nil, vterrors.VT13001(fmt.Sprintf("column list required for inserting data into '%s' table", vindexTable.Name)) + return nil, vterrors.VT09004() } } - rows, isRowValues := ins.Rows.(sqlparser.Values) - if !isRowValues { - return nil, vterrors.VT13001("needs implementation") + // modify column list or values for autoincrement column. + autoIncGen, err := modifyForAutoinc(ins, vindexTable) + if err != nil { + return nil, err } + insOp.AutoIncrement = autoIncGen - for _, row := range rows { - if len(ins.Columns) != len(row) { - return nil, vterrors.VT13001("column list does not match values") + insOp.ColVindexes = getColVindexes(insOp.VTable.ColumnVindexes) + if len(insOp.ColVindexes) == 0 { + return route, nil + } + + // set insert ignore. + insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil + + switch rows := ins.Rows.(type) { + case sqlparser.Values: + route.Source, err = insertRowsPlan(insOp, ins, rows) + if err != nil { + return nil, err } + case sqlparser.SelectStatement: + route.Source, err = insertSelectPlan(ctx, insOp, ins, rows) + if err != nil { + return nil, err + } + } + return route, nil +} + +func insertSelectPlan(ctx *plancontext.PlanningContext, insOp *Insert, ins *sqlparser.Insert, sel sqlparser.SelectStatement) (*Insert, error) { + if columnMismatch(insOp.AutoIncrement, ins, sel) { + return nil, vterrors.VT03006() } - autoIncGen, err := modifyForAutoinc(ins, vindexTable) + selOp, err := PlanQuery(ctx, sel) if err != nil { return nil, err } - insOp.AutoIncrement = autoIncGen - colVindexes := getColVindexes(insOp.VTable.ColumnVindexes) - if len(colVindexes) == 0 { - return route, nil + // select plan will be taken as input to insert rows into the table. + insOp.Input = selOp + + colVindexes := insOp.ColVindexes + vv := make([][]int, len(colVindexes)) + for idx, colVindex := range colVindexes { + for _, col := range colVindex.Columns { + colNum := findColumn(ins, col) + // sharding column values should be provided in the insert. + if colNum == -1 && idx == 0 { + return nil, vterrors.VT09003(col) + } + vv[idx] = append(vv[idx], colNum) + } + } + insOp.VindexValueOffset = vv + return insOp, nil +} + +func columnMismatch(gen *Generate, ins *sqlparser.Insert, sel sqlparser.SelectStatement) bool { + origColCount := len(ins.Columns) + if gen != nil && gen.added { + // One column got added to the insert query ast for auto increment column. + // adjusting it here for comparison. + origColCount-- + } + if origColCount < sel.GetColumnCount() { + return true } + if origColCount > sel.GetColumnCount() { + sel := sqlparser.GetFirstSelect(sel) + var hasStarExpr bool + for _, sExpr := range sel.SelectExprs { + if _, hasStarExpr = sExpr.(*sqlparser.StarExpr); hasStarExpr { + break + } + } + if !hasStarExpr { + return true + } + } + return false +} +func insertRowsPlan(insOp *Insert, ins *sqlparser.Insert, rows sqlparser.Values) (*Insert, error) { + for _, row := range rows { + if len(ins.Columns) != len(row) { + return nil, vterrors.VT13001("column list does not match values") + } + } + + colVindexes := insOp.ColVindexes routeValues := make([][][]evalengine.Expr, len(colVindexes)) for vIdx, colVindex := range colVindexes { routeValues[vIdx] = make([][]evalengine.Expr, len(colVindex.Columns)) for colIdx, col := range colVindex.Columns { - err = checkAndErrIfVindexChanging(sqlparser.UpdateExprs(ins.OnDup), col) + err := checkAndErrIfVindexChanging(sqlparser.UpdateExprs(ins.OnDup), col) if err != nil { return nil, err } routeValues[vIdx][colIdx] = make([]evalengine.Expr, len(rows)) - colNum := findOrAddColumn(ins, col) + colNum, _ := findOrAddColumn(ins, col) for rowNum, row := range rows { innerpv, err := evalengine.Translate(row[colNum], nil) if err != nil { @@ -326,18 +397,15 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I // here we are replacing the row value with the argument. for _, colVindex := range colVindexes { for _, col := range colVindex.Columns { - colNum := findOrAddColumn(ins, col) + colNum, _ := findOrAddColumn(ins, col) for rowNum, row := range rows { name := engine.InsertVarName(col, rowNum) row[colNum] = sqlparser.NewArgument(name) } } } - - insOp.ColVindexes = colVindexes insOp.VindexValues = routeValues - insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil - return route, nil + return insOp, nil } func valuesProvided(rows sqlparser.InsertRows) bool { @@ -375,11 +443,12 @@ func checkAndErrIfVindexChanging(setClauses sqlparser.UpdateExprs, col sqlparser } // findOrAddColumn finds the position of a column in the insert. If it's -// absent it appends it to the with NULL values and returns that position. -func findOrAddColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { +// absent it appends it to the with NULL values. +// It returns the position of the column and also boolean representing whether it was added or already present. +func findOrAddColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) (int, bool) { colNum := findColumn(ins, col) if colNum >= 0 { - return colNum + return colNum, false } colOffset := len(ins.Columns) ins.Columns = append(ins.Columns, col) @@ -388,7 +457,7 @@ func findOrAddColumn(ins *sqlparser.Insert, col sqlparser.IdentifierCI) int { rows[i] = append(rows[i], &sqlparser.NullVal{}) } } - return colOffset + return colOffset, true } // findColumn returns the column index where it is placed on the insert column list. @@ -413,16 +482,19 @@ func populateInsertColumnlist(ins *sqlparser.Insert, table *vindexes.Table) *sql // modifyForAutoinc modifies the AST and the plan to generate necessary autoinc values. // For row values cases, bind variable names are generated using baseName. -func modifyForAutoinc(ins *sqlparser.Insert, vTable *vindexes.Table) (gen Generate, err error) { +func modifyForAutoinc(ins *sqlparser.Insert, vTable *vindexes.Table) (*Generate, error) { if vTable.AutoIncrement == nil { - return + return nil, nil + } + gen := &Generate{ + Keyspace: vTable.AutoIncrement.Sequence.Keyspace, + TableName: sqlparser.TableName{Name: vTable.AutoIncrement.Sequence.Name}, } - gen.Keyspace = vTable.AutoIncrement.Sequence.Keyspace - gen.TableName = sqlparser.TableName{Name: vTable.AutoIncrement.Sequence.Name} - colNum := findOrAddColumn(ins, vTable.AutoIncrement.Column) + colNum, newColAdded := findOrAddColumn(ins, vTable.AutoIncrement.Column) switch rows := ins.Rows.(type) { case sqlparser.SelectStatement: gen.Offset = colNum + gen.added = newColAdded case sqlparser.Values: autoIncValues := make([]evalengine.Expr, 0, len(rows)) for rowNum, row := range rows { @@ -430,18 +502,16 @@ func modifyForAutoinc(ins *sqlparser.Insert, vTable *vindexes.Table) (gen Genera if _, ok := row[colNum].(*sqlparser.Default); ok { row[colNum] = &sqlparser.NullVal{} } - - var expr evalengine.Expr - expr, err = evalengine.Translate(row[colNum], nil) + expr, err := evalengine.Translate(row[colNum], nil) if err != nil { - return gen, err + return nil, err } autoIncValues = append(autoIncValues, expr) row[colNum] = sqlparser.NewArgument(engine.SeqVarName + strconv.Itoa(rowNum)) } gen.Values = evalengine.NewTupleExpr(autoIncValues...) } - return + return gen, nil } func getOperatorFromTableExpr(ctx *plancontext.PlanningContext, tableExpr sqlparser.TableExpr) (ops.Operator, error) { diff --git a/go/vt/vtgate/planbuilder/operators/operator.go b/go/vt/vtgate/planbuilder/operators/operator.go index b4037739d67..d2ce5cb77d0 100644 --- a/go/vt/vtgate/planbuilder/operators/operator.go +++ b/go/vt/vtgate/planbuilder/operators/operator.go @@ -52,8 +52,8 @@ type ( ) // PlanQuery creates a query plan for a given SQL statement -func PlanQuery(ctx *plancontext.PlanningContext, selStmt sqlparser.Statement) (ops.Operator, error) { - op, err := createLogicalOperatorFromAST(ctx, selStmt) +func PlanQuery(ctx *plancontext.PlanningContext, stmt sqlparser.Statement) (ops.Operator, error) { + op, err := createLogicalOperatorFromAST(ctx, stmt) if err != nil { return nil, err } diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 9d2e690d703..f4afe75d9cf 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -4842,7 +4842,7 @@ "Sharded": true }, "FieldQuery": "select * from `user` where 1 != 1", - "Query": "select * from `user` for update", + "Query": "select * from `user` lock in share mode", "Table": "`user`" } ] @@ -4930,7 +4930,7 @@ "Sharded": true }, "FieldQuery": "select id from `user` where 1 != 1", - "Query": "select id from `user` for update", + "Query": "select id from `user` lock in share mode", "Table": "`user`" } ] @@ -5003,7 +5003,7 @@ "Sharded": true }, "FieldQuery": "select null, id from `user` where 1 != 1", - "Query": "select null, id from `user` for update", + "Query": "select null, id from `user` lock in share mode", "Table": "`user`" } ] @@ -5235,7 +5235,7 @@ "Sharded": true }, "FieldQuery": "select col1, col2 from `user` where 1 != 1", - "Query": "select col1, col2 from `user` for update", + "Query": "select col1, col2 from `user` lock in share mode", "Table": "`user`" } ] @@ -5349,7 +5349,7 @@ "Sharded": true }, "FieldQuery": "select col1, col2 from t1 where 1 != 1", - "Query": "select col1, col2 from t1 for update", + "Query": "select col1, col2 from t1 lock in share mode", "Table": "t1" } ] @@ -5422,7 +5422,7 @@ "Sharded": false }, "FieldQuery": "select col1, col2 from unsharded_tab where 1 != 1", - "Query": "select col1, col2 from unsharded_tab for update", + "Query": "select col1, col2 from unsharded_tab lock in share mode", "Table": "unsharded_tab" } ] diff --git a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json index d88bcb93ff3..c3ad80ffc0a 100644 --- a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json @@ -183,12 +183,14 @@ { "comment": "unsharded insert, unqualified names and auto-inc combined", "query": "insert into unsharded_auto select col from unsharded", - "plan": "VT12001: unsupported: auto-increment and SELECT in INSERT" + "v3-plan": "VT12001: unsupported: auto-increment and SELECT in INSERT", + "gen4-plan": "VT09004: INSERT should contain column list or the table should have authoritative columns in vschema" }, { "comment": "unsharded insert, no col list with auto-inc", "query": "insert into unsharded_auto values(1,1)", - "plan": "VT13001: [BUG] column list required for tables with auto-inc columns" + "v3-plan": "VT13001: [BUG] column list required for tables with auto-inc columns", + "gen4-plan": "VT09004: INSERT should contain column list or the table should have authoritative columns in vschema" }, { "comment": "unsharded insert, col list does not match values", From 031df72e40fad65d8435aeba589ce6bef96e552a Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 00:05:28 +0530 Subject: [PATCH 12/21] gen4: added support for remaining cases in insert select and error on unsupported cases Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/gen4_planner.go | 11 ++++- .../planbuilder/operator_transformers.go | 6 +-- go/vt/vtgate/planbuilder/operators/insert.go | 2 - go/vt/vtgate/planbuilder/operators/logical.go | 43 ++++++++----------- .../planbuilder/testdata/dml_cases.json | 43 ++++++++++--------- .../testdata/unsupported_cases.json | 3 +- go/vt/vtgate/semantics/binder.go | 7 ++- go/vt/vtgate/semantics/check_invalid.go | 4 ++ go/vt/vtgate/semantics/errors.go | 14 ++++++ 9 files changed, 77 insertions(+), 56 deletions(-) diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index 6ec7bb9162c..eecf3f62ee2 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -428,13 +428,20 @@ func gen4InsertStmtPlanner(version querypb.ExecuteOptions_PlannerVersion, insStm // insert query does not support table alias. insStmt.Table.As = sqlparser.NewIdentifierCS("") - if ks, tables := semTable.SingleUnshardedKeyspace(); ks != nil && tables[0].AutoIncrement == nil { + // Check single unsharded. Even if the table is for single unsharded but sequence table is used. + // We cannot shortcut here as sequence column needs additional planning. + ks, tables := semTable.SingleUnshardedKeyspace() + if ks != nil && tables[0].AutoIncrement == nil { plan := insertUnshardedShortcut(insStmt, ks, tables) plan = pushCommentDirectivesOnPlan(plan, insStmt) return newPlanResult(plan.Primitive(), operators.QualifiedTables(ks, tables)...), nil } - if semTable.NotUnshardedErr != nil { + tblInfo, err := semTable.TableInfoFor(semTable.TableSetFor(insStmt.Table)) + if err != nil { + return nil, err + } + if tblInfo.GetVindexTable().Keyspace.Sharded && semTable.NotUnshardedErr != nil { return nil, semTable.NotUnshardedErr } diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 25c1701bab8..406e14dad47 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -422,12 +422,12 @@ func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, } func mapToInsertOpCode(code engine.Opcode, insertSelect bool) engine.InsertOpcode { - if insertSelect { - return engine.InsertSelect - } if code == engine.Unsharded { return engine.InsertUnsharded } + if insertSelect { + return engine.InsertSelect + } return engine.InsertSharded } diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 0be9f2cd360..3faafcc18f5 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -24,7 +24,6 @@ import ( ) type Insert struct { - QTable *QueryTable VTable *vindexes.Table AST *sqlparser.Insert @@ -106,7 +105,6 @@ func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { } return &Insert{ Input: input, - QTable: i.QTable, VTable: i.VTable, AST: i.AST, AutoIncrement: i.AutoIncrement, diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index c483cb092d6..1fb066e1680 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -249,8 +249,11 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I return nil, err } + if _, target := routing.(*TargetedRouting); target { + return nil, vterrors.VT12001("INSERT with a target destination") + } + insOp := &Insert{ - QTable: qt, VTable: vindexTable, AST: ins, } @@ -259,19 +262,6 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I Routing: routing, } - switch routing.(type) { - case *AnyShardRouting: - if vindexTable.AutoIncrement == nil { - return route, nil - } - case *TargetedRouting: - return nil, vterrors.VT12001("INSERT with a target destination") - case *ShardedRouting: - // to continue after switch - default: - return nil, vterrors.VT13001(fmt.Sprintf("INSERT with a unknown routing type: %T", routing)) - } - // Table column list is nil then add all the columns // If the column list is empty then add only the auto-inc column and // this happens on calling modifyForAutoinc @@ -290,14 +280,10 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I } insOp.AutoIncrement = autoIncGen - insOp.ColVindexes = getColVindexes(insOp.VTable.ColumnVindexes) - if len(insOp.ColVindexes) == 0 { - return route, nil - } - // set insert ignore. insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil + insOp.ColVindexes = getColVindexes(insOp.VTable.ColumnVindexes) switch rows := ins.Rows.(type) { case sqlparser.Values: route.Source, err = insertRowsPlan(insOp, ins, rows) @@ -326,6 +312,10 @@ func insertSelectPlan(ctx *plancontext.PlanningContext, insOp *Insert, ins *sqlp // select plan will be taken as input to insert rows into the table. insOp.Input = selOp + if len(insOp.ColVindexes) == 0 { + return insOp, nil + } + colVindexes := insOp.ColVindexes vv := make([][]int, len(colVindexes)) for idx, colVindex := range colVindexes { @@ -370,10 +360,14 @@ func columnMismatch(gen *Generate, ins *sqlparser.Insert, sel sqlparser.SelectSt func insertRowsPlan(insOp *Insert, ins *sqlparser.Insert, rows sqlparser.Values) (*Insert, error) { for _, row := range rows { if len(ins.Columns) != len(row) { - return nil, vterrors.VT13001("column list does not match values") + return nil, vterrors.VT03006() } } + if len(insOp.ColVindexes) == 0 { + return insOp, nil + } + colVindexes := insOp.ColVindexes routeValues := make([][][]evalengine.Expr, len(colVindexes)) for vIdx, colVindex := range colVindexes { @@ -636,11 +630,10 @@ func createQueryTableForDML(ctx *plancontext.PlanningContext, tableExpr sqlparse predicates = sqlparser.SplitAndExpression(nil, whereClause.Expr) } qt := &QueryTable{ - ID: tableID, - Alias: alTbl, - Table: tblName, - Predicates: predicates, - IsInfSchema: false, + ID: tableID, + Alias: alTbl, + Table: tblName, + Predicates: predicates, } return tableInfo, qt, nil } diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index f4afe75d9cf..93503f06c65 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -1665,7 +1665,8 @@ { "comment": "insert with mimatched column list", "query": "insert into user(id) values (1, 2)", - "plan": "VT13001: [BUG] column list does not match values" + "v3-plan": "VT13001: [BUG] column list does not match values", + "gen4-plan": "VT03006: column count does not match value count at row 1" }, { "comment": "insert no column list for sharded authoritative table", @@ -5073,15 +5074,15 @@ }, "Inputs": [ { - "OperatorType": "Projection", - "Expressions": [ - "INT64(1) as 1" - ], - "Inputs": [ - { - "OperatorType": "SingleRow" - } - ] + "OperatorType": "Route", + "Variant": "Reference", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "FieldQuery": "select 1 from dual where 1 != 1", + "Query": "select 1 from dual lock in share mode", + "Table": "dual" } ] }, @@ -5150,15 +5151,15 @@ }, "Inputs": [ { - "OperatorType": "Projection", - "Expressions": [ - "INT64(1) as 1" - ], - "Inputs": [ - { - "OperatorType": "SingleRow" - } - ] + "OperatorType": "Route", + "Variant": "Reference", + "Keyspace": { + "Name": "main", + "Sharded": false + }, + "FieldQuery": "select 1 from dual where 1 != 1", + "Query": "select 1 from dual lock in share mode", + "Table": "dual" } ] }, @@ -5487,7 +5488,7 @@ "Sharded": false }, "FieldQuery": "select col from unsharded_tab where 1 != 1", - "Query": "select col from unsharded_tab for update", + "Query": "select col from unsharded_tab lock in share mode", "Table": "unsharded_tab" } ] @@ -5552,7 +5553,7 @@ "Sharded": true }, "FieldQuery": "select col from t1 where 1 != 1", - "Query": "select col from t1 for update", + "Query": "select col from t1 lock in share mode", "Table": "t1" } ] diff --git a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json index c3ad80ffc0a..a47618f43ad 100644 --- a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json @@ -195,7 +195,8 @@ { "comment": "unsharded insert, col list does not match values", "query": "insert into unsharded_auto(id, val) values(1)", - "plan": "VT13001: [BUG] column list does not match values" + "v3-plan": "VT13001: [BUG] column list does not match values", + "gen4-plan": "VT03006: column count does not match value count at row 1" }, { "comment": "sharded upsert can't change vindex", diff --git a/go/vt/vtgate/semantics/binder.go b/go/vt/vtgate/semantics/binder.go index 51f65f7ccc0..b9239fae69f 100644 --- a/go/vt/vtgate/semantics/binder.go +++ b/go/vt/vtgate/semantics/binder.go @@ -19,9 +19,8 @@ package semantics import ( "strings" - "vitess.io/vitess/go/vt/vtgate/engine/opcode" - "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vtgate/engine/opcode" ) // binder is responsible for finding all the column references in @@ -62,6 +61,10 @@ func (b *binder) up(cursor *sqlparser.Cursor) error { switch node := cursor.Node().(type) { case *sqlparser.Subquery: currScope := b.scoper.currentScope() + // do not extract subquery in insert statement. + if _, isInsert := currScope.stmt.(*sqlparser.Insert); isInsert { + return nil + } sq, err := b.createExtractedSubquery(cursor, currScope, node) if err != nil { return err diff --git a/go/vt/vtgate/semantics/check_invalid.go b/go/vt/vtgate/semantics/check_invalid.go index 49e8dce04ed..84b5a8a0bbc 100644 --- a/go/vt/vtgate/semantics/check_invalid.go +++ b/go/vt/vtgate/semantics/check_invalid.go @@ -42,6 +42,10 @@ func (a *analyzer) checkForInvalidConstructs(cursor *sqlparser.Cursor) error { return checkDerived(node) case *sqlparser.AssignmentExpr: return vterrors.VT12001("Assignment expression") + case *sqlparser.Insert: + if node.Action == sqlparser.ReplaceAct { + return ShardedError{Inner: &UnsupportedConstruct{errString: "REPLACE INTO with sharded keyspace"}} + } } return nil diff --git a/go/vt/vtgate/semantics/errors.go b/go/vt/vtgate/semantics/errors.go index bf0c7dc3dbd..520dda98c42 100644 --- a/go/vt/vtgate/semantics/errors.go +++ b/go/vt/vtgate/semantics/errors.go @@ -269,3 +269,17 @@ func (e *AmbiguousColumnError) ErrorState() vterrors.State { func (e *AmbiguousColumnError) ErrorCode() vtrpcpb.Code { return vtrpcpb.Code_INVALID_ARGUMENT } + +type UnsupportedConstruct struct { + errString string +} + +func (e *UnsupportedConstruct) unsupported() {} + +func (e *UnsupportedConstruct) ErrorCode() vtrpcpb.Code { + return vtrpcpb.Code_UNIMPLEMENTED +} + +func (e *UnsupportedConstruct) Error() string { + return eprintf(e, e.errString) +} From cb4680042acf5c2a923762fd5e8758774e6b2edb Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 12:19:45 +0530 Subject: [PATCH 13/21] fix test expectation and query transformation Signed-off-by: Harshit Gangal --- go/vt/vtgate/autocommit_test.go | 2 +- go/vt/vtgate/executor_dml_test.go | 23 +++++++++---------- .../planbuilder/operator_transformers.go | 11 +++++++-- 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/go/vt/vtgate/autocommit_test.go b/go/vt/vtgate/autocommit_test.go index 94f0ef9b4d3..7e07639a755 100644 --- a/go/vt/vtgate/autocommit_test.go +++ b/go/vt/vtgate/autocommit_test.go @@ -358,7 +358,7 @@ func TestAutocommitInsertAutoinc(t *testing.T) { require.NoError(t, err) assertQueries(t, sbclookup, []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(1)}, }, { Sql: "insert into main1(id, `name`) values (:__seq0, 'myname')", diff --git a/go/vt/vtgate/executor_dml_test.go b/go/vt/vtgate/executor_dml_test.go index 36f8c741ffd..4ccca009dcf 100644 --- a/go/vt/vtgate/executor_dml_test.go +++ b/go/vt/vtgate/executor_dml_test.go @@ -22,19 +22,18 @@ import ( "strings" "testing" - "vitess.io/vitess/go/mysql" - "vitess.io/vitess/go/sqltypes" - "vitess.io/vitess/go/test/utils" - "vitess.io/vitess/go/vt/sqlparser" - _ "vitess.io/vitess/go/vt/vtgate/vindexes" - "vitess.io/vitess/go/vt/vttablet/sandboxconn" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "vitess.io/vitess/go/mysql" + "vitess.io/vitess/go/sqltypes" + "vitess.io/vitess/go/test/utils" querypb "vitess.io/vitess/go/vt/proto/query" vtgatepb "vitess.io/vitess/go/vt/proto/vtgate" vtrpcpb "vitess.io/vitess/go/vt/proto/vtrpc" + "vitess.io/vitess/go/vt/sqlparser" + _ "vitess.io/vitess/go/vt/vtgate/vindexes" + "vitess.io/vitess/go/vt/vttablet/sandboxconn" ) func TestUpdateEqual(t *testing.T) { @@ -1672,7 +1671,7 @@ func TestInsertGeneratorSharded(t *testing.T) { }} assertQueries(t, sbc, wantQueries) wantQueries = []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(1)}, }, { Sql: "insert into name_user_map(`name`, user_id) values (:name_0, :user_id_0)", @@ -1721,7 +1720,7 @@ func TestInsertGeneratorUnsharded(t *testing.T) { result, err := executorExec(executor, "insert into main1(id, name) values (null, 'myname')", nil) require.NoError(t, err) wantQueries := []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(1)}, }, { Sql: "insert into main1(id, `name`) values (:__seq0, 'myname')", @@ -1812,7 +1811,7 @@ func TestInsertLookupOwnedGenerator(t *testing.T) { }} assertQueries(t, sbc, wantQueries) wantQueries = []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(1)}, }, { Sql: "insert into music_user_map(music_id, user_id) values (:music_id_0, :user_id_0)", @@ -2069,7 +2068,7 @@ func TestMultiInsertGenerator(t *testing.T) { }} assertQueries(t, sbc, wantQueries) wantQueries = []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(2)}, }, { Sql: "insert into music_user_map(music_id, user_id) values (:music_id_0, :user_id_0), (:music_id_1, :user_id_1)", @@ -2117,7 +2116,7 @@ func TestMultiInsertGeneratorSparse(t *testing.T) { }} assertQueries(t, sbc, wantQueries) wantQueries = []*querypb.BoundQuery{{ - Sql: "select next :n values from user_seq", + Sql: "select next :n /* INT64 */ values from user_seq", BindVariables: map[string]*querypb.BindVariable{"n": sqltypes.Int64BindVariable(2)}, }, { Sql: "insert into music_user_map(music_id, user_id) values (:music_id_0, :user_id_0), (:music_id_1, :user_id_1), (:music_id_2, :user_id_2)", diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 406e14dad47..ed378f71810 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -448,8 +448,16 @@ func autoIncGenerate(gen *operators.Generate) *engine.Generate { } func generateInsertShardedQuery(ins *sqlparser.Insert) (prefix string, mid []string, suffix string) { + valueTuples, isValues := ins.Rows.(sqlparser.Values) + prefixFormat := "insert %v%sinto %v%v " + if isValues { + // the mid values are filled differently + // with select uses sqlparser.String for sqlparser.Values + // with rows uses string. + prefixFormat += "values " + } prefixBuf := sqlparser.NewTrackedBuffer(dmlFormatter) - prefixBuf.Myprintf("insert %v%sinto %v%v values ", + prefixBuf.Myprintf(prefixFormat, ins.Comments, ins.Ignore.ToString(), ins.Table, ins.Columns) prefix = prefixBuf.String() @@ -458,7 +466,6 @@ func generateInsertShardedQuery(ins *sqlparser.Insert) (prefix string, mid []str suffixBuf.Myprintf("%v", ins.OnDup) suffix = suffixBuf.String() - valueTuples, isValues := ins.Rows.(sqlparser.Values) if !isValues { // this is a insert query using select to insert the rows. return From 6837724f124de7bd3d78dc31b452ea0c4e525d6d Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 16:25:31 +0530 Subject: [PATCH 14/21] fix sequence table fix for unsharded to ignore column vindex and addressed review comments Signed-off-by: Harshit Gangal --- go/test/endtoend/vtgate/sequence/seq_test.go | 4 +- go/vt/sqlparser/ast.go | 8 ++-- go/vt/vtgate/planbuilder/gen4_planner.go | 2 +- go/vt/vtgate/planbuilder/insert.go | 8 ++-- .../planbuilder/operator_transformers.go | 2 +- go/vt/vtgate/planbuilder/operators/insert.go | 41 +++++++++---------- go/vt/vtgate/planbuilder/operators/logical.go | 11 +++-- 7 files changed, 40 insertions(+), 36 deletions(-) diff --git a/go/test/endtoend/vtgate/sequence/seq_test.go b/go/test/endtoend/vtgate/sequence/seq_test.go index f9583a4083b..918a463ca33 100644 --- a/go/test/endtoend/vtgate/sequence/seq_test.go +++ b/go/test/endtoend/vtgate/sequence/seq_test.go @@ -191,7 +191,7 @@ func TestMain(m *testing.M) { SchemaSQL: unshardedSQLSchema, VSchema: unshardedVSchema, } - if err := clusterInstance.StartUnshardedKeyspace(*uKeyspace, 1, false); err != nil { + if err := clusterInstance.StartUnshardedKeyspace(*uKeyspace, 0, false); err != nil { return 1 } @@ -200,7 +200,7 @@ func TestMain(m *testing.M) { SchemaSQL: shardedSQLSchema, VSchema: shardedVSchema, } - if err := clusterInstance.StartKeyspace(*sKeyspace, []string{"-80", "80-"}, 1, false); err != nil { + if err := clusterInstance.StartKeyspace(*sKeyspace, []string{"-80", "80-"}, 0, false); err != nil { return 1 } diff --git a/go/vt/sqlparser/ast.go b/go/vt/sqlparser/ast.go index 84157bf050a..63e52cc0f87 100644 --- a/go/vt/sqlparser/ast.go +++ b/go/vt/sqlparser/ast.go @@ -322,9 +322,11 @@ type ( // of the implications the deletion part may have on vindexes. // If you add fields here, consider adding them to calls to validateUnshardedRoute. Insert struct { - Action InsertAction - Comments *ParsedComments - Ignore Ignore + Action InsertAction + Comments *ParsedComments + Ignore Ignore + // The Insert as syntax still take TableName. + // The change is made for semantic analyzer as it takes AliasedTableExpr to provide TableInfo Table *AliasedTableExpr Partitions Partitions Columns Columns diff --git a/go/vt/vtgate/planbuilder/gen4_planner.go b/go/vt/vtgate/planbuilder/gen4_planner.go index eecf3f62ee2..87853dca885 100644 --- a/go/vt/vtgate/planbuilder/gen4_planner.go +++ b/go/vt/vtgate/planbuilder/gen4_planner.go @@ -479,7 +479,7 @@ func insertUnshardedShortcut(stmt *sqlparser.Insert, ks *vindexes.Keyspace, tabl eIns.Table = tables[0] eIns.Opcode = engine.InsertUnsharded eIns.Query = generateQuery(stmt) - return &primitiveWrapper{prim: eIns} + return &insert{eInsert: eIns} } func rewriteRoutedTables(stmt sqlparser.Statement, vschema plancontext.VSchema) error { diff --git a/go/vt/vtgate/planbuilder/insert.go b/go/vt/vtgate/planbuilder/insert.go index daa7eaedf8b..986d3d82d9c 100644 --- a/go/vt/vtgate/planbuilder/insert.go +++ b/go/vt/vtgate/planbuilder/insert.go @@ -469,15 +469,13 @@ func (i *insert) Inputs() []logicalPlan { } func (i *insert) Rewrite(inputs ...logicalPlan) error { - //TODO implement me - panic("implement me") + panic("does not expect insert to get rewrite call") } func (i *insert) ContainsTables() semantics.TableSet { - //TODO implement me - panic("implement me") + panic("does not expect insert to get contains tables call") } func (i *insert) OutputColumns() []sqlparser.SelectExpr { - return nil + panic("does not expect insert to get output columns call") } diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index ed378f71810..6ffd5d5d3dc 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -406,7 +406,7 @@ func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, } i = &insert{eInsert: eins} - if eins.Opcode == engine.InsertSharded { + if eins.Opcode == engine.InsertSharded || eins.Opcode == engine.InsertSelect { eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) } diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 3faafcc18f5..0100d8795af 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -23,28 +23,29 @@ import ( "vitess.io/vitess/go/vt/vtgate/vindexes" ) +// Insert represents an insert operation on a table. type Insert struct { + // VTable represents the target table for the insert operation. VTable *vindexes.Table - AST *sqlparser.Insert + // AST represents the insert statement from the SQL syntax. + AST *sqlparser.Insert + // AutoIncrement represents the auto-increment generator for the insert operation. AutoIncrement *Generate - Ignore bool + // Ignore specifies whether to ignore duplicate key errors during insertion. + Ignore bool - // ColVindexes are the vindexes that will use the VindexValues + // ColVindexes are the vindexes that will use the VindexValues or VindexValueOffset ColVindexes []*vindexes.ColumnVindex // VindexValues specifies values for all the vindex columns. - // This is a three-dimensional data structure: - // Insert.Values[i] represents the values to be inserted for the i'th colvindex (i < len(Insert.Table.ColumnVindexes)) - // Insert.Values[i].Values[j] represents values for the j'th column of the given colVindex (j < len(colVindex[i].Columns) - // Insert.Values[i].Values[j].Values[k] represents the value pulled from row k for that column: (k < len(ins.rows)) VindexValues [][][]evalengine.Expr // VindexValueOffset stores the offset for each column in the ColumnVindex // that will appear in the result set of the select query. VindexValueOffset [][]int - // Insert using select query will have select plan as input + // Insert using select query will have select plan as input operator for the insert operation. Input ops.Operator noColumns @@ -64,8 +65,11 @@ func (i *Insert) SetInputs(inputs []ops.Operator) { } } +// Generate represents an auto-increment generator for the insert operation. type Generate struct { - Keyspace *vindexes.Keyspace + // Keyspace represents the keyspace information for the table. + Keyspace *vindexes.Keyspace + // TableName represents the name of the table. TableName sqlparser.TableName // Values are the supplied values for the column, which @@ -73,27 +77,25 @@ type Generate struct { // values will be generated based on how many were not // supplied (NULL). Values evalengine.Expr - // Insert using Select, offset for auto increment column Offset int - // The auto incremeent column was already present in the insert column list or was added. + // added indicates whether the auto-increment column was already present in the insert column list or added. added bool } func (i *Insert) Description() ops.OpDescription { - //TODO implement me - panic("implement me") + return ops.OpDescription{ + OperatorType: "Insert", + } } func (i *Insert) ShortDescription() string { - //TODO implement me - panic("implement me") + return i.VTable.String() } func (i *Insert) GetOrdering() ([]ops.OrderBy, error) { - //TODO implement me - panic("implement me") + panic("does not expect insert operator to receive get ordering call") } var _ ops.Operator = (*Insert)(nil) @@ -116,8 +118,5 @@ func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { } func (i *Insert) TablesUsed() []string { - if i.VTable != nil { - return SingleQualifiedIdentifier(i.VTable.Keyspace, i.VTable.Name) - } - return nil + return SingleQualifiedIdentifier(i.VTable.Keyspace, i.VTable.Name) } diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 1fb066e1680..22a4f281dd7 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -283,7 +283,7 @@ func createOperatorFromInsert(ctx *plancontext.PlanningContext, ins *sqlparser.I // set insert ignore. insOp.Ignore = bool(ins.Ignore) || ins.OnDup != nil - insOp.ColVindexes = getColVindexes(insOp.VTable.ColumnVindexes) + insOp.ColVindexes = getColVindexes(insOp) switch rows := ins.Rows.(type) { case sqlparser.Values: route.Source, err = insertRowsPlan(insOp, ins, rows) @@ -412,8 +412,13 @@ func valuesProvided(rows sqlparser.InsertRows) bool { return false } -func getColVindexes(allColVindexes []*vindexes.ColumnVindex) (colVindexes []*vindexes.ColumnVindex) { - for _, colVindex := range allColVindexes { +func getColVindexes(insOp *Insert) (colVindexes []*vindexes.ColumnVindex) { + // For unsharded table the Column Vindex does not mean anything. + // And therefore should be ignored. + if !insOp.VTable.Keyspace.Sharded { + return + } + for _, colVindex := range insOp.VTable.ColumnVindexes { if colVindex.IsPartialVindex() { continue } From e3a11629abef53e1ba83a6498169df95431ee520 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 18:12:19 +0530 Subject: [PATCH 15/21] gen4: fix check vindex updates on dup in insert with select, populate prefix and suffix for all the cases Signed-off-by: Harshit Gangal --- go/vt/vtgate/planbuilder/operator_transformers.go | 4 +++- go/vt/vtgate/planbuilder/operators/logical.go | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index 6ffd5d5d3dc..ca8e8bc7fa7 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -406,7 +406,9 @@ func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, } i = &insert{eInsert: eins} - if eins.Opcode == engine.InsertSharded || eins.Opcode == engine.InsertSelect { + // we would need to generate the query on the fly. The only exception here is + // when unsharded query with autoincrement for that there is no input operator. + if eins.Opcode != engine.InsertUnsharded || ins.Input != nil { eins.Prefix, eins.Mid, eins.Suffix = generateInsertShardedQuery(ins.AST) } diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 22a4f281dd7..0324b17afbb 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -320,6 +320,11 @@ func insertSelectPlan(ctx *plancontext.PlanningContext, insOp *Insert, ins *sqlp vv := make([][]int, len(colVindexes)) for idx, colVindex := range colVindexes { for _, col := range colVindex.Columns { + err := checkAndErrIfVindexChanging(sqlparser.UpdateExprs(ins.OnDup), col) + if err != nil { + return nil, err + } + colNum := findColumn(ins, col) // sharding column values should be provided in the insert. if colNum == -1 && idx == 0 { From a8a4582c747f714cc863a23fb956c24c17fc14da Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 19:42:39 +0530 Subject: [PATCH 16/21] gen4: added check for non-streaming select when same tables involved Signed-off-by: Harshit Gangal --- .../planbuilder/operator_transformers.go | 5 +- .../planbuilder/operators/SQL_builder.go | 3 +- .../planbuilder/operators/aggregator.go | 8 +- go/vt/vtgate/planbuilder/operators/fuzz.go | 4 +- .../planbuilder/operators/horizon_planning.go | 4 +- .../operators/info_schema_planning.go | 5 +- go/vt/vtgate/planbuilder/operators/insert.go | 3 + go/vt/vtgate/planbuilder/operators/logical.go | 12 +++ go/vt/vtgate/planbuilder/operators/merging.go | 3 +- .../vtgate/planbuilder/operators/ordering.go | 1 - .../planbuilder/operators/projection.go | 5 +- .../planbuilder/operators/queryprojection.go | 7 +- .../operators/queryprojection_test.go | 9 +- .../planbuilder/operators/route_planning.go | 11 +-- .../planbuilder/operators/sharded_routing.go | 3 +- .../planbuilder/testdata/dml_cases.json | 82 +++++++++++++++++++ .../testdata/unsupported_cases.json | 5 ++ 17 files changed, 128 insertions(+), 42 deletions(-) diff --git a/go/vt/vtgate/planbuilder/operator_transformers.go b/go/vt/vtgate/planbuilder/operator_transformers.go index ca8e8bc7fa7..8da42d3b585 100644 --- a/go/vt/vtgate/planbuilder/operator_transformers.go +++ b/go/vt/vtgate/planbuilder/operator_transformers.go @@ -398,9 +398,10 @@ func transformInsertPlan(ctx *plancontext.PlanningContext, op *operators.Route, Opcode: mapToInsertOpCode(op.Routing.OpCode(), ins.Input != nil), Keyspace: op.Routing.Keyspace(), Table: ins.VTable, - ColVindexes: ins.ColVindexes, - Generate: autoIncGenerate(ins.AutoIncrement), Ignore: ins.Ignore, + ForceNonStreaming: ins.ForceNonStreaming, + Generate: autoIncGenerate(ins.AutoIncrement), + ColVindexes: ins.ColVindexes, VindexValues: ins.VindexValues, VindexValueOffset: ins.VindexValueOffset, } diff --git a/go/vt/vtgate/planbuilder/operators/SQL_builder.go b/go/vt/vtgate/planbuilder/operators/SQL_builder.go index b2f8a6a1766..07fa5fbbd9d 100644 --- a/go/vt/vtgate/planbuilder/operators/SQL_builder.go +++ b/go/vt/vtgate/planbuilder/operators/SQL_builder.go @@ -21,10 +21,9 @@ import ( "sort" "strings" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" ) diff --git a/go/vt/vtgate/planbuilder/operators/aggregator.go b/go/vt/vtgate/planbuilder/operators/aggregator.go index b49a0cb1b07..33d28ae34ae 100644 --- a/go/vt/vtgate/planbuilder/operators/aggregator.go +++ b/go/vt/vtgate/planbuilder/operators/aggregator.go @@ -20,17 +20,15 @@ import ( "fmt" "strings" - "vitess.io/vitess/go/vt/vterrors" - "vitess.io/vitess/go/vt/vtgate/semantics" - "golang.org/x/exp/slices" - "vitess.io/vitess/go/vt/vtgate/engine/opcode" - "vitess.io/vitess/go/slices2" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/engine/opcode" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/semantics" ) type ( diff --git a/go/vt/vtgate/planbuilder/operators/fuzz.go b/go/vt/vtgate/planbuilder/operators/fuzz.go index bb8c508e56b..6ee6b0bab83 100644 --- a/go/vt/vtgate/planbuilder/operators/fuzz.go +++ b/go/vt/vtgate/planbuilder/operators/fuzz.go @@ -17,10 +17,10 @@ limitations under the License. package operators import ( + fuzz "github.com/AdaLogics/go-fuzz-headers" + "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vtgate/semantics" - - fuzz "github.com/AdaLogics/go-fuzz-headers" ) // FuzzAnalyse implements the fuzzer diff --git a/go/vt/vtgate/planbuilder/operators/horizon_planning.go b/go/vt/vtgate/planbuilder/operators/horizon_planning.go index 1d783c9e904..6120c35a00a 100644 --- a/go/vt/vtgate/planbuilder/operators/horizon_planning.go +++ b/go/vt/vtgate/planbuilder/operators/horizon_planning.go @@ -21,14 +21,12 @@ import ( "io" "vitess.io/vitess/go/slices2" - "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" ) func errHorizonNotPlanned() error { diff --git a/go/vt/vtgate/planbuilder/operators/info_schema_planning.go b/go/vt/vtgate/planbuilder/operators/info_schema_planning.go index 92df6548abb..d0cfbbe521a 100644 --- a/go/vt/vtgate/planbuilder/operators/info_schema_planning.go +++ b/go/vt/vtgate/planbuilder/operators/info_schema_planning.go @@ -19,9 +19,6 @@ package operators import ( "strings" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - "vitess.io/vitess/go/vt/vtgate/vindexes" - "golang.org/x/exp/maps" "golang.org/x/exp/slices" @@ -31,7 +28,9 @@ import ( "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/vindexes" ) // InfoSchemaRouting used for information_schema queries. diff --git a/go/vt/vtgate/planbuilder/operators/insert.go b/go/vt/vtgate/planbuilder/operators/insert.go index 0100d8795af..225d285b73b 100644 --- a/go/vt/vtgate/planbuilder/operators/insert.go +++ b/go/vt/vtgate/planbuilder/operators/insert.go @@ -34,6 +34,8 @@ type Insert struct { AutoIncrement *Generate // Ignore specifies whether to ignore duplicate key errors during insertion. Ignore bool + // ForceNonStreaming when true, select first then insert, this is to avoid locking rows by select for insert. + ForceNonStreaming bool // ColVindexes are the vindexes that will use the VindexValues or VindexValueOffset ColVindexes []*vindexes.ColumnVindex @@ -111,6 +113,7 @@ func (i *Insert) Clone(inputs []ops.Operator) ops.Operator { AST: i.AST, AutoIncrement: i.AutoIncrement, Ignore: i.Ignore, + ForceNonStreaming: i.ForceNonStreaming, ColVindexes: i.ColVindexes, VindexValues: i.VindexValues, VindexValueOffset: i.VindexValueOffset, diff --git a/go/vt/vtgate/planbuilder/operators/logical.go b/go/vt/vtgate/planbuilder/operators/logical.go index 0324b17afbb..41396070089 100644 --- a/go/vt/vtgate/planbuilder/operators/logical.go +++ b/go/vt/vtgate/planbuilder/operators/logical.go @@ -312,6 +312,18 @@ func insertSelectPlan(ctx *plancontext.PlanningContext, insOp *Insert, ins *sqlp // select plan will be taken as input to insert rows into the table. insOp.Input = selOp + // When the table you are steaming data from and table you are inserting from are same. + // Then due to locking of the index range on the table we might not be able to insert into the table. + // Therefore, instead of streaming, this flag will ensure the records are first read and then inserted. + insertTbl := insOp.TablesUsed()[0] + selTables := TablesUsed(selOp) + for _, tbl := range selTables { + if insertTbl == tbl { + insOp.ForceNonStreaming = true + break + } + } + if len(insOp.ColVindexes) == 0 { return insOp, nil } diff --git a/go/vt/vtgate/planbuilder/operators/merging.go b/go/vt/vtgate/planbuilder/operators/merging.go index 846d9f11784..ef8da1ef280 100644 --- a/go/vt/vtgate/planbuilder/operators/merging.go +++ b/go/vt/vtgate/planbuilder/operators/merging.go @@ -21,9 +21,8 @@ import ( "reflect" "vitess.io/vitess/go/vt/sqlparser" - "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" ) // Merge checks whether two operators can be merged into a single one. diff --git a/go/vt/vtgate/planbuilder/operators/ordering.go b/go/vt/vtgate/planbuilder/operators/ordering.go index 60eff4bbaaf..a0c42fc8ecb 100644 --- a/go/vt/vtgate/planbuilder/operators/ordering.go +++ b/go/vt/vtgate/planbuilder/operators/ordering.go @@ -22,7 +22,6 @@ import ( "golang.org/x/exp/slices" "vitess.io/vitess/go/slices2" - "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" diff --git a/go/vt/vtgate/planbuilder/operators/projection.go b/go/vt/vtgate/planbuilder/operators/projection.go index b8ac95af4ad..a5a9f6d4492 100644 --- a/go/vt/vtgate/planbuilder/operators/projection.go +++ b/go/vt/vtgate/planbuilder/operators/projection.go @@ -22,13 +22,12 @@ import ( "golang.org/x/exp/slices" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" - "vitess.io/vitess/go/vt/vtgate/semantics" - "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vtgate/evalengine" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/semantics" ) type ( diff --git a/go/vt/vtgate/planbuilder/operators/queryprojection.go b/go/vt/vtgate/planbuilder/operators/queryprojection.go index d122330dc32..f0147ca7ec6 100644 --- a/go/vt/vtgate/planbuilder/operators/queryprojection.go +++ b/go/vt/vtgate/planbuilder/operators/queryprojection.go @@ -24,14 +24,13 @@ import ( "golang.org/x/exp/slices" + "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vterrors" + "vitess.io/vitess/go/vt/vtgate/engine/opcode" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" - - "vitess.io/vitess/go/vt/sqlparser" - "vitess.io/vitess/go/vt/vterrors" - "vitess.io/vitess/go/vt/vtgate/engine/opcode" ) type ( diff --git a/go/vt/vtgate/planbuilder/operators/queryprojection_test.go b/go/vt/vtgate/planbuilder/operators/queryprojection_test.go index 9b5221b60dc..2a89cd10716 100644 --- a/go/vt/vtgate/planbuilder/operators/queryprojection_test.go +++ b/go/vt/vtgate/planbuilder/operators/queryprojection_test.go @@ -19,16 +19,13 @@ package operators import ( "testing" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" - "vitess.io/vitess/go/vt/vtgate/semantics" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" "vitess.io/vitess/go/vt/sqlparser" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" + "vitess.io/vitess/go/vt/vtgate/semantics" ) func TestQP(t *testing.T) { diff --git a/go/vt/vtgate/planbuilder/operators/route_planning.go b/go/vt/vtgate/planbuilder/operators/route_planning.go index d8b5de8e223..1c052ec3691 100644 --- a/go/vt/vtgate/planbuilder/operators/route_planning.go +++ b/go/vt/vtgate/planbuilder/operators/route_planning.go @@ -20,20 +20,17 @@ import ( "bytes" "io" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" - - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - "vitess.io/vitess/go/vt/key" + querypb "vitess.io/vitess/go/vt/proto/query" + topodatapb "vitess.io/vitess/go/vt/proto/topodata" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/rewrite" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" "vitess.io/vitess/go/vt/vtgate/vindexes" - - querypb "vitess.io/vitess/go/vt/proto/query" - topodatapb "vitess.io/vitess/go/vt/proto/topodata" ) type ( diff --git a/go/vt/vtgate/planbuilder/operators/sharded_routing.go b/go/vt/vtgate/planbuilder/operators/sharded_routing.go index 42c9209f0c6..1303561634c 100644 --- a/go/vt/vtgate/planbuilder/operators/sharded_routing.go +++ b/go/vt/vtgate/planbuilder/operators/sharded_routing.go @@ -19,14 +19,13 @@ package operators import ( "golang.org/x/exp/slices" - "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" - "vitess.io/vitess/go/mysql/collations" "vitess.io/vitess/go/vt/sqlparser" "vitess.io/vitess/go/vt/vterrors" "vitess.io/vitess/go/vt/vtgate/engine" popcode "vitess.io/vitess/go/vt/vtgate/engine/opcode" "vitess.io/vitess/go/vt/vtgate/evalengine" + "vitess.io/vitess/go/vt/vtgate/planbuilder/operators/ops" "vitess.io/vitess/go/vt/vtgate/planbuilder/plancontext" "vitess.io/vitess/go/vt/vtgate/semantics" "vitess.io/vitess/go/vt/vtgate/vindexes" diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 93503f06c65..4555467cb71 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -6137,5 +6137,87 @@ "main.unsharded" ] } + }, + { + "comment": "insert with select using same tables, cannot stream parallel", + "query": "insert into music(id, user_id) select id, user_id from music where user_id = 1", + "v3-plan": { + "QueryType": "INSERT", + "Original": "insert into music(id, user_id) select id, user_id from music where user_id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "InputAsNonStreaming": true, + "TableName": "music", + "VindexOffsetFromSelect": { + "music_user_map": "[0]", + "user_index": "[1]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select id, user_id from music where 1 != 1", + "Query": "select id, user_id from music where user_id = 1 for update", + "Table": "music", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.music" + ] + }, + "gen4-plan": { + "QueryType": "INSERT", + "Original": "insert into music(id, user_id) select id, user_id from music where user_id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "InputAsNonStreaming": true, + "TableName": "music", + "VindexOffsetFromSelect": { + "music_user_map": "[0]", + "user_index": "[1]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select id, user_id from music where 1 != 1", + "Query": "select id, user_id from music where user_id = 1 lock in share mode", + "Table": "music", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.music" + ] + } } ] diff --git a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json index a47618f43ad..245ac390ce4 100644 --- a/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/unsupported_cases.json @@ -501,5 +501,10 @@ "query": "select max(u.foo*ue.bar) from user u join user_extra ue", "v3-plan": "VT12001: unsupported: cross-shard query with aggregates", "gen4-plan": "VT12001: unsupported: aggregation on columns from different sources: max(u.foo * ue.bar)" + }, + { + "comment": "extremum on input from both sides", + "query": "insert into music(user_id, id) select foo, bar from music on duplicate key update id = id+1", + "plan": "VT12001: unsupported: DML cannot update vindex column" } ] From 4360deba890bac4acdfeb494318459d1eff51a08 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 20:28:40 +0530 Subject: [PATCH 17/21] added new plan test for insert cases Signed-off-by: Harshit Gangal --- .../planbuilder/testdata/dml_cases.json | 220 ++++++++++++++++++ .../planbuilder/testdata/vschemas/schema.json | 36 +++ 2 files changed, 256 insertions(+) diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 4555467cb71..59b77b0682c 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -6219,5 +6219,225 @@ "user.music" ] } + }, + { + "comment": "insert + lookup vindex + auto increment on lookup column - not provided", + "query": "insert into mixed_tbl(shard_key) values (1),(4),(9)", + "plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key) values (1),(4),(9)", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Sharded", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(NULL, NULL, NULL)", + "Query": "insert into mixed_tbl(shard_key, lkp_key) values (:_shard_key_0, :_lkp_key_0), (:_shard_key_1, :_lkp_key_1), (:_shard_key_2, :_lkp_key_2)", + "TableName": "mixed_tbl", + "VindexValues": { + "lkp_shard_map": ":__seq0, :__seq1, :__seq2", + "shard_index": "INT64(1), INT64(4), INT64(9)" + } + }, + "TablesUsed": [ + "user.mixed_tbl" + ] + } + }, + { + "comment": "insert + lookup vindex + auto increment on lookup column - partially provided", + "query": "insert into mixed_tbl(shard_key, lkp_key) values (1, 1),(4, null),(9, 27)", + "plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key, lkp_key) values (1, 1),(4, null),(9, 27)", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Sharded", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Values::(INT64(1), NULL, INT64(27))", + "Query": "insert into mixed_tbl(shard_key, lkp_key) values (:_shard_key_0, :_lkp_key_0), (:_shard_key_1, :_lkp_key_1), (:_shard_key_2, :_lkp_key_2)", + "TableName": "mixed_tbl", + "VindexValues": { + "lkp_shard_map": ":__seq0, :__seq1, :__seq2", + "shard_index": "INT64(1), INT64(4), INT64(9)" + } + }, + "TablesUsed": [ + "user.mixed_tbl" + ] + } + }, + { + "comment": "insert + lookup vindex + auto increment on lookup column + select - not provided", + "query": "insert into mixed_tbl(shard_key) select foo from user where id = 1", + "v3-plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key) select foo from user where id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", + "TableName": "mixed_tbl", + "VindexOffsetFromSelect": { + "lkp_shard_map": "[1]", + "shard_index": "[0]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select foo from `user` where 1 != 1", + "Query": "select foo from `user` where id = 1 for update", + "Table": "`user`", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.mixed_tbl" + ] + }, + "gen4-plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key) select foo from user where id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", + "TableName": "mixed_tbl", + "VindexOffsetFromSelect": { + "lkp_shard_map": "[1]", + "shard_index": "[0]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select foo from `user` where 1 != 1", + "Query": "select foo from `user` where id = 1 lock in share mode", + "Table": "`user`", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.mixed_tbl", + "user.user" + ] + } + }, + { + "comment": "insert + lookup vindex + auto increment on lookup column + select - provided", + "query": "insert into mixed_tbl(shard_key, lkp_key) select foo, bar from user where id = 1", + "v3-plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key, lkp_key) select foo, bar from user where id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", + "TableName": "mixed_tbl", + "VindexOffsetFromSelect": { + "lkp_shard_map": "[1]", + "shard_index": "[0]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select foo, bar from `user` where 1 != 1", + "Query": "select foo, bar from `user` where id = 1 for update", + "Table": "`user`", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.mixed_tbl" + ] + }, + "gen4-plan": { + "QueryType": "INSERT", + "Original": "insert into mixed_tbl(shard_key, lkp_key) select foo, bar from user where id = 1", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(1)", + "TableName": "mixed_tbl", + "VindexOffsetFromSelect": { + "lkp_shard_map": "[1]", + "shard_index": "[0]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "EqualUnique", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select foo, bar from `user` where 1 != 1", + "Query": "select foo, bar from `user` where id = 1 lock in share mode", + "Table": "`user`", + "Values": [ + "INT64(1)" + ], + "Vindex": "user_index" + } + ] + }, + "TablesUsed": [ + "user.mixed_tbl", + "user.user" + ] + } } ] diff --git a/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json b/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json index b76ef254c2a..6c771070f1b 100644 --- a/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json +++ b/go/vt/vtgate/planbuilder/testdata/vschemas/schema.json @@ -133,6 +133,18 @@ "to": "keyspace_id" }, "owner": "user_metadata" + }, + "lkp_shard_map": { + "type": "name_lkp_test", + "owner": "mixed_tbl", + "params": { + "table": "lkp_shard_vdx", + "from": "lkp_key", + "to": "keyspace_id" + } + }, + "shard_index": { + "type": "xxhash" } }, "tables": { @@ -401,6 +413,30 @@ "name": "user_index" } ] + }, + "mixed_tbl": { + "column_vindexes": [ + { + "column": "shard_key", + "name": "shard_index" + }, + { + "column": "lkp_key", + "name": "lkp_shard_map" + } + ], + "auto_increment": { + "column": "lkp_key", + "sequence": "seq" + } + }, + "lkp_shard_vdx": { + "column_vindexes": [ + { + "column": "lkp_key", + "name": "shard_index" + } + ] } } }, From 44e5a590fea727bc4d666b123b8fa98198fb6219 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Wed, 31 May 2023 23:48:07 +0530 Subject: [PATCH 18/21] added additional test for lookup column as auto increment column Signed-off-by: Harshit Gangal --- .../vtgate/queries/dml/insert_test.go | 57 +++++++++++++++++++ .../endtoend/vtgate/queries/dml/main_test.go | 5 +- .../vtgate/queries/dml/sharded_schema.sql | 16 +++++- .../vtgate/queries/dml/unsharded_schema.sql | 10 ++++ .../endtoend/vtgate/queries/dml/vschema.json | 34 +++++++++++ 5 files changed, 120 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/vtgate/queries/dml/insert_test.go b/go/test/endtoend/vtgate/queries/dml/insert_test.go index a6b5d1a1fc4..867b3b46fc8 100644 --- a/go/test/endtoend/vtgate/queries/dml/insert_test.go +++ b/go/test/endtoend/vtgate/queries/dml/insert_test.go @@ -394,3 +394,60 @@ func TestRedactDupError(t *testing.T) { // inserting same rows, throws error. mcmp.AssertContainsError("insert into order_tbl(region_id, oid, cust_no) select region_id, oid, cust_no from order_tbl", `BindVars: {REDACTED}`) } + +// TestMixedCases test all the cases for insert when lookup column is also the auto increment column. +func TestMixedCases(t *testing.T) { + mcmp, closer := start(t) + defer closer() + + tcases := []struct { + insQuery string + selQuery string + exp string + }{{ + // values are provided for all columns + insQuery: "insert into mixed_tbl(shard_key, lkp_key) values (1, 1000)", + selQuery: "select * from mixed_tbl where lkp_key = 1000", + exp: "[[INT64(1000) INT64(1)]]", + }, { + // lookup column value not provided - auto increment value should be used. + insQuery: "insert into mixed_tbl(shard_key) values (2)", + selQuery: "select * from mixed_tbl where lkp_key = 1", + exp: "[[INT64(1) INT64(2)]]", + }, { + // lookup column value not provided in the select - auto increment value should be used. + insQuery: "insert into mixed_tbl(shard_key) select 3", + selQuery: "select * from mixed_tbl where lkp_key = 2", + exp: "[[INT64(2) INT64(3)]]", + }, { + // lookup column value provided as NULL in the select - auto increment value should be used. + insQuery: "insert into mixed_tbl(shard_key, lkp_key) select 4, null", + selQuery: "select * from mixed_tbl where lkp_key = 3", + exp: "[[INT64(3) INT64(4)]]", + }, { + // values are provided for all column in the select + insQuery: "insert into mixed_tbl(shard_key, lkp_key) select 5, 2000", + selQuery: "select * from mixed_tbl where lkp_key = 2000", + exp: "[[INT64(2000) INT64(5)]]", + }, { + // multiple values are inserted - lookup column value not provided - use auto increment value + insQuery: "insert into mixed_tbl(shard_key) select shard_key from mixed_tbl order by shard_key desc", + selQuery: "select * from mixed_tbl where lkp_key between 4 and 8 order by lkp_key", + exp: "[[INT64(4) INT64(5)] [INT64(5) INT64(4)] [INT64(6) INT64(3)] [INT64(7) INT64(2)] [INT64(8) INT64(1)]]", + }, { + // partial values are provided from lookup column - use auto increment value where missing. + insQuery: "insert into mixed_tbl(shard_key, lkp_key) (select 2, 3000 union select 5, null)", + selQuery: "select * from mixed_tbl where lkp_key in (9, 3000) order by lkp_key", + exp: "[[INT64(9) INT64(5)] [INT64(3000) INT64(2)]]", + }} + + for _, tc := range tcases { + t.Run(tc.insQuery, func(t *testing.T) { + utils.Exec(t, mcmp.VtConn, tc.insQuery) + utils.AssertMatches(t, mcmp.VtConn, tc.selQuery, tc.exp) + }) + } + + // final check count on the lookup vindex table. + utils.AssertMatches(t, mcmp.VtConn, "select count(*) from lkp_mixed_idx", "[[INT64(12)]]") +} diff --git a/go/test/endtoend/vtgate/queries/dml/main_test.go b/go/test/endtoend/vtgate/queries/dml/main_test.go index 7fb361837f8..c00e27fe3a0 100644 --- a/go/test/endtoend/vtgate/queries/dml/main_test.go +++ b/go/test/endtoend/vtgate/queries/dml/main_test.go @@ -57,6 +57,9 @@ var ( }, "auto_seq": { "type": "sequence" + }, + "mixed_seq": { + "type": "sequence" } } }` @@ -130,7 +133,7 @@ func start(t *testing.T) (utils.MySQLCompare, func()) { tables := []string{ "s_tbl", "num_vdx_tbl", "user_tbl", "order_tbl", "oevent_tbl", "oextra_tbl", - "auto_tbl", "oid_vdx_tbl", "unq_idx", "nonunq_idx", "u_tbl", + "auto_tbl", "oid_vdx_tbl", "unq_idx", "nonunq_idx", "u_tbl", "mixed_tbl", "lkp_map_idx", } for _, table := range tables { // TODO (@frouioui): following assertions produce different results between MySQL and Vitess diff --git a/go/test/endtoend/vtgate/queries/dml/sharded_schema.sql b/go/test/endtoend/vtgate/queries/dml/sharded_schema.sql index a6298b6e63c..3310724d420 100644 --- a/go/test/endtoend/vtgate/queries/dml/sharded_schema.sql +++ b/go/test/endtoend/vtgate/queries/dml/sharded_schema.sql @@ -71,4 +71,18 @@ create table nonunq_idx id bigint, keyspace_id varbinary(20), primary key (nonunq_col, id) -) Engine = InnoDB; \ No newline at end of file +) Engine = InnoDB; + +create table mixed_tbl +( + lkp_key bigint, + shard_key bigint, + primary key (lkp_key) +) Engine = InnoDB; + +create table lkp_mixed_idx +( + lkp_key bigint, + keyspace_id varbinary(20), + primary key (lkp_key) +) Engine = InnoDB; diff --git a/go/test/endtoend/vtgate/queries/dml/unsharded_schema.sql b/go/test/endtoend/vtgate/queries/dml/unsharded_schema.sql index 3a3d1f53602..4d2ad06618a 100644 --- a/go/test/endtoend/vtgate/queries/dml/unsharded_schema.sql +++ b/go/test/endtoend/vtgate/queries/dml/unsharded_schema.sql @@ -14,6 +14,14 @@ create table auto_seq primary key (id) ) comment 'vitess_sequence' Engine = InnoDB; +create table mixed_seq +( + id int default 0, + next_id bigint default null, + cache bigint default null, + primary key (id) +) comment 'vitess_sequence' Engine = InnoDB; + create table u_tbl ( id bigint, @@ -25,3 +33,5 @@ insert into user_seq(id, next_id, cache) values (0, 1, 1000); insert into auto_seq(id, next_id, cache) values (0, 666, 1000); +insert into mixed_seq(id, next_id, cache) +values (0, 1, 1000); \ No newline at end of file diff --git a/go/test/endtoend/vtgate/queries/dml/vschema.json b/go/test/endtoend/vtgate/queries/dml/vschema.json index 9f725955f89..a42a93d7403 100644 --- a/go/test/endtoend/vtgate/queries/dml/vschema.json +++ b/go/test/endtoend/vtgate/queries/dml/vschema.json @@ -41,6 +41,16 @@ "ignore_nulls": "true" }, "owner": "auto_tbl" + }, + "lkp_map_vdx": { + "type": "consistent_lookup_unique", + "params": { + "table": "lkp_mixed_idx", + "from": "lkp_key", + "to": "keyspace_id", + "ignore_nulls": "true" + }, + "owner": "mixed_tbl" } }, "tables": { @@ -154,6 +164,30 @@ "name": "hash" } ] + }, + "mixed_tbl": { + "auto_increment": { + "column": "lkp_key", + "sequence": "uks.mixed_seq" + }, + "column_vindexes": [ + { + "column": "shard_key", + "name": "hash" + }, + { + "column": "lkp_key", + "name": "lkp_map_vdx" + } + ] + }, + "lkp_mixed_idx": { + "column_vindexes": [ + { + "column": "lkp_key", + "name": "hash" + } + ] } } } \ No newline at end of file From 9f6c7f6158e070b649f95d271a2c00f96485f8f1 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 1 Jun 2023 16:39:30 +0530 Subject: [PATCH 19/21] added V3Insert planner version for user to use old v3 planner for insert, added release notes Signed-off-by: Harshit Gangal --- changelog/17.0/17.0.0/summary.md | 8 + go/vt/proto/query/query.pb.go | 1454 +++++++++-------- go/vt/vtgate/planbuilder/builder.go | 9 +- .../vtgate/planbuilder/plancontext/vschema.go | 5 +- .../planbuilder/testdata/dml_cases.json | 46 + proto/query.proto | 1 + web/vtadmin/src/proto/vtadmin.d.ts | 3 +- web/vtadmin/src/proto/vtadmin.js | 7 + 8 files changed, 805 insertions(+), 728 deletions(-) diff --git a/changelog/17.0/17.0.0/summary.md b/changelog/17.0/17.0.0/summary.md index 306a787fa71..f432d9c873f 100644 --- a/changelog/17.0/17.0.0/summary.md +++ b/changelog/17.0/17.0.0/summary.md @@ -29,6 +29,7 @@ - [Settings pool enabled](#settings-pool) - **[VTGate](#vtgate)** - [StreamExecute GRPC API](#stream-execute) + - [Insert Planner Gen4] (#insert-planner) - **[Deprecations and Deletions](#deprecations-and-deletions)** - [Deprecated Flags](#deprecated-flags) - [Deprecated Stats](#deprecated-stats) @@ -382,6 +383,13 @@ so that it can be persisted with the client and sent back to VTGate on the next This does not impact anyone using the mysql client library to connect to VTGate. This could be a breaking change for grpc api users based on how they have implemented their grpc clients. +#### Insert Planning with Gen4 + +Gen4 planner was made default in v14 for select queries. In v15 update and delete queries were moved to Gen4 framework. +With this release Insert planning is moved to Gen4. + +Clients can move to old v3 planner for inserts by using `V3Insert` planner version with `--planner-version` vtgate flag or with comment directive /*vt+ planner=` for individual query. + ### Deprecations and Deletions - The deprecated `automation` and `automationservice` protobuf definitions and associated client and server packages have been removed. diff --git a/go/vt/proto/query/query.pb.go b/go/vt/proto/query/query.pb.go index ea64d7569c0..d7a5809eea2 100644 --- a/go/vt/proto/query/query.pb.go +++ b/go/vt/proto/query/query.pb.go @@ -701,6 +701,7 @@ const ( ExecuteOptions_Gen4Left2Right ExecuteOptions_PlannerVersion = 4 ExecuteOptions_Gen4WithFallback ExecuteOptions_PlannerVersion = 5 ExecuteOptions_Gen4CompareV3 ExecuteOptions_PlannerVersion = 6 + ExecuteOptions_V3Insert ExecuteOptions_PlannerVersion = 7 ) // Enum value maps for ExecuteOptions_PlannerVersion. @@ -713,6 +714,7 @@ var ( 4: "Gen4Left2Right", 5: "Gen4WithFallback", 6: "Gen4CompareV3", + 7: "V3Insert", } ExecuteOptions_PlannerVersion_value = map[string]int32{ "DEFAULT_PLANNER": 0, @@ -722,6 +724,7 @@ var ( "Gen4Left2Right": 4, "Gen4WithFallback": 5, "Gen4CompareV3": 6, + "V3Insert": 7, } ) @@ -5679,7 +5682,7 @@ var file_query_proto_rawDesc = []byte{ 0x12, 0x29, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x56, 0x61, 0x72, 0x69, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, - 0x8a, 0x0b, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x98, 0x0b, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x4d, 0x0a, 0x0f, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, @@ -5744,7 +5747,7 @@ var file_query_proto_rawDesc = []byte{ 0x49, 0x5a, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x04, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x5f, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x05, 0x12, 0x0e, 0x0a, 0x0a, 0x41, - 0x55, 0x54, 0x4f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x06, 0x22, 0x84, 0x01, 0x0a, 0x0e, + 0x55, 0x54, 0x4f, 0x43, 0x4f, 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x06, 0x22, 0x92, 0x01, 0x0a, 0x0e, 0x50, 0x6c, 0x61, 0x6e, 0x6e, 0x65, 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x4e, 0x45, 0x52, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x56, 0x33, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x47, @@ -5753,210 +5756,193 @@ var file_query_proto_rawDesc = []byte{ 0x74, 0x32, 0x52, 0x69, 0x67, 0x68, 0x74, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x47, 0x65, 0x6e, 0x34, 0x57, 0x69, 0x74, 0x68, 0x46, 0x61, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x10, 0x05, 0x12, 0x11, 0x0a, 0x0d, 0x47, 0x65, 0x6e, 0x34, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x56, 0x33, - 0x10, 0x06, 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, - 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, - 0x54, 0x4f, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, - 0x00, 0x12, 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, - 0x52, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, - 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x41, - 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, - 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x52, - 0x45, 0x50, 0x4c, 0x49, 0x43, 0x41, 0x53, 0x10, 0x03, 0x22, 0x4f, 0x0a, 0x15, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4d, 0x6f, - 0x64, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, - 0x5f, 0x53, 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x52, - 0x45, 0x41, 0x44, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, - 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, - 0x4a, 0x04, 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xb8, 0x02, 0x0a, - 0x05, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6f, 0x72, 0x67, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6f, 0x72, 0x67, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, - 0x67, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, - 0x67, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, - 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, - 0x6c, 0x75, 0x6d, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, - 0x61, 0x72, 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, - 0x72, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, - 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, - 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, - 0x75, 0x6d, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x37, 0x0a, 0x03, 0x52, 0x6f, 0x77, 0x12, 0x18, - 0x0a, 0x07, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x12, 0x52, - 0x07, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, - 0x22, 0xe3, 0x01, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x24, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, - 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x6f, 0x77, 0x73, 0x5f, 0x61, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, - 0x6f, 0x77, 0x73, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, - 0x6e, 0x73, 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, - 0x69, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x52, - 0x6f, 0x77, 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x15, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x3c, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, - 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x22, 0xa0, 0x03, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, - 0x76, 0x65, 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x32, 0x0a, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, - 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x9e, 0x02, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, + 0x10, 0x06, 0x12, 0x0c, 0x0a, 0x08, 0x56, 0x33, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x10, 0x07, + 0x22, 0x84, 0x01, 0x0a, 0x0c, 0x43, 0x6f, 0x6e, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, + 0x72, 0x12, 0x1c, 0x0a, 0x18, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, + 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, + 0x19, 0x0a, 0x15, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x5f, + 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x43, 0x4f, + 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, + 0x45, 0x44, 0x10, 0x02, 0x12, 0x21, 0x0a, 0x1d, 0x43, 0x4f, 0x4e, 0x53, 0x4f, 0x4c, 0x49, 0x44, + 0x41, 0x54, 0x4f, 0x52, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x5f, 0x52, 0x45, 0x50, + 0x4c, 0x49, 0x43, 0x41, 0x53, 0x10, 0x03, 0x22, 0x4f, 0x0a, 0x15, 0x54, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4d, 0x6f, 0x64, 0x65, + 0x12, 0x17, 0x0a, 0x13, 0x43, 0x4f, 0x4e, 0x53, 0x49, 0x53, 0x54, 0x45, 0x4e, 0x54, 0x5f, 0x53, + 0x4e, 0x41, 0x50, 0x53, 0x48, 0x4f, 0x54, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x52, 0x45, 0x41, + 0x44, 0x5f, 0x57, 0x52, 0x49, 0x54, 0x45, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x41, + 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x4a, 0x04, 0x08, 0x01, 0x10, 0x02, 0x4a, 0x04, + 0x08, 0x02, 0x10, 0x03, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xb8, 0x02, 0x0a, 0x05, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0b, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, + 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x1b, 0x0a, 0x09, 0x6f, 0x72, 0x67, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x6f, 0x72, 0x67, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x67, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x67, 0x4e, + 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x6c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x63, 0x6f, 0x6c, 0x75, + 0x6d, 0x6e, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, + 0x73, 0x65, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x73, + 0x65, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x18, 0x09, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x65, 0x63, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12, 0x14, + 0x0a, 0x05, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x66, + 0x6c, 0x61, 0x67, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x75, 0x6d, 0x6e, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6c, 0x75, 0x6d, + 0x6e, 0x54, 0x79, 0x70, 0x65, 0x22, 0x37, 0x0a, 0x03, 0x52, 0x6f, 0x77, 0x12, 0x18, 0x0a, 0x07, + 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x12, 0x52, 0x07, 0x6c, + 0x65, 0x6e, 0x67, 0x74, 0x68, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x22, 0xe3, + 0x01, 0x0a, 0x0b, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x24, + 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x06, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x6f, 0x77, 0x73, 0x5f, 0x61, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x72, 0x6f, 0x77, + 0x73, 0x41, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x69, 0x6e, + 0x73, 0x65, 0x72, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x18, 0x04, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x52, 0x6f, 0x77, + 0x52, 0x04, 0x72, 0x6f, 0x77, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x69, 0x6e, 0x66, 0x6f, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x4a, 0x04, + 0x08, 0x05, 0x10, 0x06, 0x22, 0x3c, 0x0a, 0x0c, 0x51, 0x75, 0x65, 0x72, 0x79, 0x57, 0x61, 0x72, + 0x6e, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, + 0x67, 0x65, 0x22, 0xa0, 0x03, 0x0a, 0x0b, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, + 0x6e, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, - 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, - 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x52, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x46, 0x69, 0x65, 0x6c, - 0x64, 0x73, 0x12, 0x38, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, - 0x79, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x52, 0x6f, 0x77, 0x52, 0x10, 0x70, 0x72, 0x69, 0x6d, - 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, - 0x73, 0x71, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x22, 0x27, - 0x0a, 0x08, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x01, 0x12, 0x07, - 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x02, 0x22, 0xe1, 0x02, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, - 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, - 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, - 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, - 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, - 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x45, - 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x64, 0x0a, 0x0f, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x57, 0x69, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, - 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, - 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, - 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x22, 0xe7, 0x02, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x15, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, - 0xee, 0x01, 0x0a, 0x0c, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, - 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x0a, 0x73, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x12, 0x32, 0x0a, 0x0b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x1a, 0x9e, 0x02, 0x0a, 0x09, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x08, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x74, 0x72, + 0x65, 0x61, 0x6d, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x08, 0x63, 0x61, 0x74, + 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3a, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, + 0x6b, 0x65, 0x79, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x52, 0x10, + 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x4b, 0x65, 0x79, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x73, + 0x12, 0x38, 0x0a, 0x12, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x5f, 0x6b, 0x65, 0x79, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x52, 0x6f, 0x77, 0x52, 0x10, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, + 0x79, 0x4b, 0x65, 0x79, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x71, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x71, 0x6c, 0x22, 0x27, 0x0a, 0x08, + 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x4d, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, + 0x44, 0x44, 0x4c, 0x10, 0x02, 0x22, 0xe1, 0x02, 0x0a, 0x0e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, + 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, + 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, + 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, + 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x3d, 0x0a, 0x0f, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0x64, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x57, 0x69, 0x74, 0x68, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x05, 0x65, + 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, + 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe7, + 0x02, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, + 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, + 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, + 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x22, 0xa4, 0x01, 0x0a, 0x0d, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, - 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, - 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, - 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, - 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, - 0x31, 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x49, 0x64, 0x22, 0xe7, 0x01, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, - 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x10, - 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, - 0x64, 0x22, 0xfa, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, + 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, + 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x43, 0x0a, 0x15, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, + 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xee, 0x01, + 0x0a, 0x0c, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, + 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, + 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, + 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x2f, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa4, + 0x01, 0x0a, 0x0d, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, + 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, + 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, + 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, + 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xe5, 0x01, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, + 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x31, 0x0a, + 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, + 0x22, 0xe7, 0x01, 0x0a, 0x0f, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, @@ -5970,26 +5956,132 @@ var file_query_proto_rawDesc = []byte{ 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x11, - 0x0a, 0x0f, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xda, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x65, 0x70, - 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, - 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, - 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, - 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, - 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x18, - 0x0a, 0x16, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, 0x02, 0x0a, 0x17, 0x52, 0x6f, 0x6c, - 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x33, 0x0a, 0x10, 0x52, 0x6f, + 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, + 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, + 0xfa, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x11, 0x0a, 0x0f, + 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xda, 0x01, 0x0a, 0x15, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, + 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, + 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x18, 0x0a, 0x16, + 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x83, 0x02, 0x0a, 0x17, 0x52, 0x6f, 0x6c, 0x6c, 0x62, + 0x61, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x1a, 0x0a, 0x18, + 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x64, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x0c, 0x70, 0x61, 0x72, 0x74, + 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x0c, 0x70, + 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x12, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, + 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, + 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x61, + 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xfe, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, + 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, + 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, + 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdf, 0x01, 0x0a, 0x1a, 0x43, 0x6f, 0x6e, + 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, + 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, + 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, + 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x6f, + 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x16, 0x52, 0x65, + 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, @@ -6001,13 +6093,91 @@ var file_query_proto_rawDesc = []byte{ 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, - 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x1a, - 0x0a, 0x18, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, 0x63, 0x6b, 0x50, 0x72, 0x65, 0x70, 0x61, 0x72, - 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x90, 0x02, 0x0a, 0x18, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x52, 0x65, 0x61, 0x64, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe0, 0x02, 0x0a, 0x13, 0x42, + 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, + 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, + 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xfe, 0x01, + 0x0a, 0x14, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, + 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xe6, + 0x02, 0x0a, 0x19, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, + 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, + 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, + 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, + 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, + 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, + 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, + 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x84, 0x02, 0x0a, 0x1a, 0x42, 0x65, 0x67, 0x69, + 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, + 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, + 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xd9, + 0x01, 0x0a, 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, @@ -6019,84 +6189,33 @@ var file_query_proto_rawDesc = []byte{ 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x12, 0x31, 0x0a, 0x0c, 0x70, 0x61, - 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, - 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x1b, 0x0a, - 0x19, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x12, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, - 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, - 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, - 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, - 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, - 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, - 0x74, 0x61, 0x72, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, - 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, - 0x74, 0x69, 0x64, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x6c, 0x62, 0x61, - 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdf, 0x01, 0x0a, 0x1a, 0x43, - 0x6f, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x1d, 0x0a, 0x1b, - 0x43, 0x6f, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdb, 0x01, 0x0a, 0x16, - 0x52, 0x65, 0x61, 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, - 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x22, 0x51, 0x0a, 0x17, 0x52, 0x65, 0x61, - 0x64, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0xe0, 0x02, 0x0a, - 0x13, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x15, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, + 0xf6, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, + 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, + 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, + 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, + 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, + 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, + 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x40, 0x0a, 0x12, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x41, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, + 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, + 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe8, 0x02, 0x0a, 0x15, 0x52, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, @@ -6110,31 +6229,28 @@ var file_query_proto_rawDesc = []byte{ 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, - 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x1f, - 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, - 0xfe, 0x01, 0x0a, 0x14, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, - 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0xe6, 0x02, 0x0a, 0x19, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x25, 0x0a, 0x0e, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, + 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, + 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, + 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, + 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x22, 0xee, + 0x02, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, @@ -6152,402 +6268,290 @@ var file_query_proto_rawDesc = []byte{ 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, - 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, - 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x84, 0x02, 0x0a, 0x1a, 0x42, 0x65, - 0x67, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, - 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, - 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, - 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, - 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0xd9, 0x01, 0x0a, 0x14, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, - 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x43, 0x0a, 0x15, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, - 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x22, 0xf6, 0x01, 0x0a, 0x11, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x6b, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, - 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, - 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, - 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, - 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, - 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, - 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, - 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x03, 0x69, 0x64, - 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x40, 0x0a, 0x12, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x41, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x22, 0xe8, 0x02, 0x0a, - 0x15, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, - 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, - 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, - 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, - 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, - 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x25, - 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, + 0xcc, 0x01, 0x0a, 0x1c, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, + 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, + 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, + 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, + 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x22, 0xf4, + 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, + 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, + 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, + 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, - 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xc6, 0x01, 0x0a, 0x16, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, - 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, - 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, - 0x22, 0xee, 0x02, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x53, 0x74, 0x72, 0x65, - 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, - 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, - 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, - 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, - 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, - 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, - 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x1c, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, - 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, - 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, - 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, - 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, - 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, - 0x22, 0xf4, 0x02, 0x0a, 0x1a, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, - 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, - 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, - 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, - 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, - 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, - 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, - 0x74, 0x5f, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x42, 0x65, 0x67, 0x69, 0x6e, - 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, - 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, - 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, - 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, - 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, - 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, - 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, - 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, - 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, - 0x22, 0xfa, 0x02, 0x0a, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, - 0x6e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, - 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, - 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, - 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, - 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, - 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, - 0x72, 0x67, 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, - 0x64, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, - 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, - 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, - 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x71, 0x75, - 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6f, 0x73, - 0x74, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xac, 0x02, - 0x0a, 0x21, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x53, 0x74, - 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, - 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, - 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, - 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, - 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x87, 0x02, 0x0a, - 0x0e, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, - 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, - 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, - 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, - 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, - 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, - 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, - 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, - 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x72, - 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x22, 0xf6, 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, - 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x30, 0x0a, - 0x14, 0x62, 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x5f, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x62, 0x69, 0x6e, - 0x6c, 0x6f, 0x67, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, - 0x47, 0x0a, 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6c, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, - 0x6e, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x66, 0x69, 0x6c, 0x74, 0x65, - 0x72, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, - 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, - 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x63, 0x70, 0x75, - 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x01, 0x52, 0x03, 0x71, 0x70, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, - 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x69, 0x65, - 0x77, 0x5f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, - 0x18, 0x08, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x76, 0x69, 0x65, 0x77, 0x53, 0x63, 0x68, 0x65, - 0x6d, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0xf6, 0x01, 0x0a, 0x0e, 0x41, 0x67, - 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, - 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x68, 0x65, 0x61, 0x6c, - 0x74, 0x68, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, - 0x0a, 0x16, 0x75, 0x6e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, - 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, - 0x75, 0x6e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x43, - 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, - 0x6d, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x72, 0x65, 0x70, 0x6c, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, - 0x4d, 0x69, 0x6e, 0x12, 0x3d, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, 0x6d, - 0x61, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4d, - 0x61, 0x78, 0x22, 0xa9, 0x02, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, - 0x6c, 0x74, 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, + 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x74, 0x5f, + 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x51, 0x75, + 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xa6, 0x02, 0x0a, 0x1b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, + 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, + 0x12, 0x38, 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, + 0x61, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, + 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, + 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, + 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0xfa, + 0x02, 0x0a, 0x20, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x53, + 0x74, 0x72, 0x65, 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, + 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, + 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, + 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, + 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, + 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, - 0x65, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x12, 0x53, 0x0a, 0x26, - 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, - 0x79, 0x5f, 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x23, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, - 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x12, 0x3b, 0x0a, 0x0e, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, - 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, - 0x0d, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x38, - 0x0a, 0x0c, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0xae, - 0x01, 0x0a, 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x74, - 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, - 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, - 0x65, 0x5f, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x0c, - 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x52, 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, - 0x91, 0x01, 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, - 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x16, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, - 0x6d, 0x65, 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, - 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x74, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, - 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0x42, 0x0a, 0x14, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, - 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x92, 0x03, 0x0a, 0x09, 0x4d, 0x79, 0x53, 0x71, - 0x6c, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, - 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, 0x41, - 0x47, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x49, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, - 0x4c, 0x41, 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, - 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x55, - 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, - 0x08, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x10, - 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x5f, 0x46, 0x4c, 0x41, - 0x47, 0x10, 0x20, 0x12, 0x11, 0x0a, 0x0d, 0x5a, 0x45, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4c, 0x5f, - 0x46, 0x4c, 0x41, 0x47, 0x10, 0x40, 0x12, 0x10, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, - 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x01, 0x12, 0x0e, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, - 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, - 0x5f, 0x49, 0x4e, 0x43, 0x52, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, - 0x80, 0x04, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, - 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x08, 0x12, 0x0d, 0x0a, 0x08, 0x53, 0x45, 0x54, 0x5f, 0x46, - 0x4c, 0x41, 0x47, 0x10, 0x80, 0x10, 0x12, 0x1a, 0x0a, 0x15, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x46, - 0x41, 0x55, 0x4c, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, - 0x80, 0x20, 0x12, 0x17, 0x0a, 0x12, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, - 0x4e, 0x4f, 0x57, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x40, 0x12, 0x0e, 0x0a, 0x08, 0x4e, - 0x55, 0x4d, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x02, 0x12, 0x13, 0x0a, 0x0d, 0x50, - 0x41, 0x52, 0x54, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x01, - 0x12, 0x10, 0x0a, 0x0a, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, - 0x80, 0x02, 0x12, 0x11, 0x0a, 0x0b, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, - 0x47, 0x10, 0x80, 0x80, 0x04, 0x12, 0x11, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x43, 0x4d, 0x50, 0x5f, - 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x08, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0x6b, 0x0a, 0x04, - 0x46, 0x6c, 0x61, 0x67, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, - 0x0a, 0x0a, 0x49, 0x53, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x52, 0x41, 0x4c, 0x10, 0x80, 0x02, 0x12, - 0x0f, 0x0a, 0x0a, 0x49, 0x53, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x80, 0x04, - 0x12, 0x0c, 0x0a, 0x07, 0x49, 0x53, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x80, 0x08, 0x12, 0x0d, - 0x0a, 0x08, 0x49, 0x53, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x44, 0x10, 0x80, 0x10, 0x12, 0x0b, 0x0a, - 0x06, 0x49, 0x53, 0x54, 0x45, 0x58, 0x54, 0x10, 0x80, 0x20, 0x12, 0x0d, 0x0a, 0x08, 0x49, 0x53, - 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x80, 0x40, 0x2a, 0xc0, 0x03, 0x0a, 0x04, 0x54, 0x79, - 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, - 0x00, 0x12, 0x09, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x81, 0x02, 0x12, 0x0a, 0x0a, 0x05, - 0x55, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x82, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, - 0x36, 0x10, 0x83, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x84, - 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x85, 0x02, 0x12, 0x0b, 0x0a, - 0x06, 0x55, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x86, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, - 0x54, 0x33, 0x32, 0x10, 0x87, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, - 0x10, 0x88, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x89, 0x02, 0x12, - 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x8a, 0x06, 0x12, 0x0c, 0x0a, 0x07, - 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, 0x8b, 0x08, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, - 0x4f, 0x41, 0x54, 0x36, 0x34, 0x10, 0x8c, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, - 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x8d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, - 0x10, 0x8e, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x8f, 0x10, 0x12, 0x0d, - 0x0a, 0x08, 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x90, 0x10, 0x12, 0x09, 0x0a, - 0x04, 0x59, 0x45, 0x41, 0x52, 0x10, 0x91, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x49, - 0x4d, 0x41, 0x4c, 0x10, 0x12, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x93, 0x30, - 0x12, 0x09, 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x94, 0x50, 0x12, 0x0c, 0x0a, 0x07, 0x56, - 0x41, 0x52, 0x43, 0x48, 0x41, 0x52, 0x10, 0x95, 0x30, 0x12, 0x0e, 0x0a, 0x09, 0x56, 0x41, 0x52, - 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x96, 0x50, 0x12, 0x09, 0x0a, 0x04, 0x43, 0x48, 0x41, - 0x52, 0x10, 0x97, 0x30, 0x12, 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x98, - 0x50, 0x12, 0x08, 0x0a, 0x03, 0x42, 0x49, 0x54, 0x10, 0x99, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x45, - 0x4e, 0x55, 0x4d, 0x10, 0x9a, 0x10, 0x12, 0x08, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x9b, 0x10, - 0x12, 0x09, 0x0a, 0x05, 0x54, 0x55, 0x50, 0x4c, 0x45, 0x10, 0x1c, 0x12, 0x0d, 0x0a, 0x08, 0x47, - 0x45, 0x4f, 0x4d, 0x45, 0x54, 0x52, 0x59, 0x10, 0x9d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x4a, 0x53, - 0x4f, 0x4e, 0x10, 0x9e, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, - 0x49, 0x4f, 0x4e, 0x10, 0x1f, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x4e, 0x55, 0x4d, 0x10, - 0xa0, 0x20, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x56, 0x41, 0x4c, 0x10, 0xa1, 0x20, 0x12, - 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x54, 0x4e, 0x55, 0x4d, 0x10, 0xa2, 0x20, 0x2a, 0x46, 0x0a, 0x10, + 0x65, 0x74, 0x12, 0x27, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x11, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x52, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x12, 0x2f, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, + 0x70, 0x72, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, + 0x09, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x12, 0x2c, 0x0a, + 0x12, 0x70, 0x6f, 0x73, 0x74, 0x5f, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x5f, 0x71, 0x75, 0x65, 0x72, + 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x74, 0x42, + 0x65, 0x67, 0x69, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0xac, 0x02, 0x0a, 0x21, + 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x53, 0x74, 0x72, 0x65, + 0x61, 0x6d, 0x45, 0x78, 0x65, 0x63, 0x75, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x25, 0x0a, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, 0x70, 0x63, 0x2e, 0x52, 0x50, 0x43, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x2a, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, + 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x72, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, + 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x49, 0x64, 0x12, 0x38, 0x0a, 0x0c, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x32, 0x0a, 0x15, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, + 0x6e, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x73, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x53, 0x74, + 0x61, 0x74, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x22, 0x87, 0x02, 0x0a, 0x0e, 0x52, + 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3f, 0x0a, + 0x13, 0x65, 0x66, 0x66, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, 0x65, + 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x76, 0x74, 0x72, + 0x70, 0x63, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x44, 0x52, 0x11, 0x65, 0x66, 0x66, + 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x45, + 0x0a, 0x13, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x6c, 0x6c, + 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x71, 0x75, + 0x65, 0x72, 0x79, 0x2e, 0x56, 0x54, 0x47, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, 0x6c, 0x65, 0x72, + 0x49, 0x44, 0x52, 0x11, 0x69, 0x6d, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x74, 0x65, 0x43, 0x61, 0x6c, + 0x6c, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, + 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, + 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, + 0x65, 0x64, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x6c, 0x65, 0x61, 0x73, 0x65, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x53, 0x74, 0x72, 0x65, 0x61, + 0x6d, 0x48, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xf6, + 0x02, 0x0a, 0x0d, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, + 0x12, 0x21, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x5f, 0x65, 0x72, 0x72, 0x6f, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x45, 0x72, + 0x72, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x15, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x62, + 0x69, 0x6e, 0x6c, 0x6f, 0x67, 0x5f, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x5f, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x62, 0x69, 0x6e, 0x6c, 0x6f, + 0x67, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x47, 0x0a, + 0x20, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x1d, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, + 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x70, 0x75, 0x5f, 0x75, 0x73, + 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x01, 0x52, 0x08, 0x63, 0x70, 0x75, 0x55, 0x73, + 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x71, 0x70, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, + 0x52, 0x03, 0x71, 0x70, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x73, + 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x07, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x12, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x13, 0x76, 0x69, 0x65, 0x77, 0x5f, + 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x18, 0x08, + 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x76, 0x69, 0x65, 0x77, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, + 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x22, 0xf6, 0x01, 0x0a, 0x0e, 0x41, 0x67, 0x67, 0x72, + 0x65, 0x67, 0x61, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x30, 0x0a, 0x14, 0x68, 0x65, + 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x12, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, + 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x34, 0x0a, 0x16, + 0x75, 0x6e, 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x5f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, + 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x14, 0x75, 0x6e, + 0x68, 0x65, 0x61, 0x6c, 0x74, 0x68, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x43, 0x6f, 0x75, + 0x6e, 0x74, 0x12, 0x3d, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, 0x6d, 0x69, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4d, 0x69, + 0x6e, 0x12, 0x3d, 0x0a, 0x1b, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x6c, 0x61, 0x67, 0x5f, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x5f, 0x6d, 0x61, 0x78, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x72, 0x65, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x4c, 0x61, 0x67, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x73, 0x4d, 0x61, 0x78, + 0x22, 0xa9, 0x02, 0x0a, 0x14, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x48, 0x65, 0x61, 0x6c, 0x74, + 0x68, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, + 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, + 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x08, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x12, 0x53, 0x0a, 0x26, 0x74, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x5f, + 0x72, 0x65, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x23, 0x74, 0x61, 0x62, 0x6c, + 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x70, 0x61, + 0x72, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, + 0x3b, 0x0a, 0x0e, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x73, 0x74, 0x61, 0x74, + 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0d, 0x72, + 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x12, 0x38, 0x0a, 0x0c, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x74, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x70, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x54, 0x61, + 0x62, 0x6c, 0x65, 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x52, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x74, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x22, 0xae, 0x01, 0x0a, + 0x13, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x74, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x64, 0x74, 0x69, 0x64, 0x12, 0x2d, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, + 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, - 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, - 0x07, 0x50, 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, - 0x4d, 0x4d, 0x49, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, 0x42, 0x41, - 0x43, 0x4b, 0x10, 0x03, 0x2a, 0x31, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x45, 0x57, 0x53, - 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x53, 0x10, 0x01, 0x12, 0x07, - 0x0a, 0x03, 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x35, 0x0a, 0x0f, 0x69, 0x6f, 0x2e, 0x76, 0x69, - 0x74, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x22, 0x76, 0x69, 0x74, 0x65, - 0x73, 0x73, 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, - 0x76, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x69, 0x6d, 0x65, 0x5f, + 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x74, + 0x69, 0x6d, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x31, 0x0a, 0x0c, 0x70, 0x61, + 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, + 0x0c, 0x70, 0x61, 0x72, 0x74, 0x69, 0x63, 0x69, 0x70, 0x61, 0x6e, 0x74, 0x73, 0x22, 0x91, 0x01, + 0x0a, 0x10, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x25, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x54, 0x61, 0x72, 0x67, 0x65, + 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x35, 0x0a, 0x0a, 0x74, 0x61, 0x62, + 0x6c, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, + 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x61, 0x6d, 0x65, + 0x73, 0x22, 0xb1, 0x01, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x10, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x5f, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x2d, 0x2e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x53, 0x63, 0x68, + 0x65, 0x6d, 0x61, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0f, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x42, 0x0a, 0x14, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x92, 0x03, 0x0a, 0x09, 0x4d, 0x79, 0x53, 0x71, 0x6c, 0x46, + 0x6c, 0x61, 0x67, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x4d, 0x50, 0x54, 0x59, 0x10, 0x00, 0x12, 0x11, + 0x0a, 0x0d, 0x4e, 0x4f, 0x54, 0x5f, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x50, 0x52, 0x49, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, + 0x47, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x4b, 0x45, + 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x55, 0x4c, 0x54, + 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x08, 0x12, + 0x0d, 0x0a, 0x09, 0x42, 0x4c, 0x4f, 0x42, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x10, 0x12, 0x11, + 0x0a, 0x0d, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x20, 0x12, 0x11, 0x0a, 0x0d, 0x5a, 0x45, 0x52, 0x4f, 0x46, 0x49, 0x4c, 0x4c, 0x5f, 0x46, 0x4c, + 0x41, 0x47, 0x10, 0x40, 0x12, 0x10, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x5f, 0x46, + 0x4c, 0x41, 0x47, 0x10, 0x80, 0x01, 0x12, 0x0e, 0x0a, 0x09, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x46, + 0x4c, 0x41, 0x47, 0x10, 0x80, 0x02, 0x12, 0x18, 0x0a, 0x13, 0x41, 0x55, 0x54, 0x4f, 0x5f, 0x49, + 0x4e, 0x43, 0x52, 0x45, 0x4d, 0x45, 0x4e, 0x54, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x04, + 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x5f, 0x46, 0x4c, + 0x41, 0x47, 0x10, 0x80, 0x08, 0x12, 0x0d, 0x0a, 0x08, 0x53, 0x45, 0x54, 0x5f, 0x46, 0x4c, 0x41, + 0x47, 0x10, 0x80, 0x10, 0x12, 0x1a, 0x0a, 0x15, 0x4e, 0x4f, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, + 0x4c, 0x54, 0x5f, 0x56, 0x41, 0x4c, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x20, + 0x12, 0x17, 0x0a, 0x12, 0x4f, 0x4e, 0x5f, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x5f, 0x4e, 0x4f, + 0x57, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x40, 0x12, 0x0e, 0x0a, 0x08, 0x4e, 0x55, 0x4d, + 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x02, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x41, 0x52, + 0x54, 0x5f, 0x4b, 0x45, 0x59, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x01, 0x12, 0x10, + 0x0a, 0x0a, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, 0x80, 0x80, 0x02, + 0x12, 0x11, 0x0a, 0x0b, 0x55, 0x4e, 0x49, 0x51, 0x55, 0x45, 0x5f, 0x46, 0x4c, 0x41, 0x47, 0x10, + 0x80, 0x80, 0x04, 0x12, 0x11, 0x0a, 0x0b, 0x42, 0x49, 0x4e, 0x43, 0x4d, 0x50, 0x5f, 0x46, 0x4c, + 0x41, 0x47, 0x10, 0x80, 0x80, 0x08, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0x6b, 0x0a, 0x04, 0x46, 0x6c, + 0x61, 0x67, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0a, + 0x49, 0x53, 0x49, 0x4e, 0x54, 0x45, 0x47, 0x52, 0x41, 0x4c, 0x10, 0x80, 0x02, 0x12, 0x0f, 0x0a, + 0x0a, 0x49, 0x53, 0x55, 0x4e, 0x53, 0x49, 0x47, 0x4e, 0x45, 0x44, 0x10, 0x80, 0x04, 0x12, 0x0c, + 0x0a, 0x07, 0x49, 0x53, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x80, 0x08, 0x12, 0x0d, 0x0a, 0x08, + 0x49, 0x53, 0x51, 0x55, 0x4f, 0x54, 0x45, 0x44, 0x10, 0x80, 0x10, 0x12, 0x0b, 0x0a, 0x06, 0x49, + 0x53, 0x54, 0x45, 0x58, 0x54, 0x10, 0x80, 0x20, 0x12, 0x0d, 0x0a, 0x08, 0x49, 0x53, 0x42, 0x49, + 0x4e, 0x41, 0x52, 0x59, 0x10, 0x80, 0x40, 0x2a, 0xc0, 0x03, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x0d, 0x0a, 0x09, 0x4e, 0x55, 0x4c, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x10, 0x00, 0x12, + 0x09, 0x0a, 0x04, 0x49, 0x4e, 0x54, 0x38, 0x10, 0x81, 0x02, 0x12, 0x0a, 0x0a, 0x05, 0x55, 0x49, + 0x4e, 0x54, 0x38, 0x10, 0x82, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, + 0x83, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x31, 0x36, 0x10, 0x84, 0x06, 0x12, + 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x85, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, + 0x49, 0x4e, 0x54, 0x32, 0x34, 0x10, 0x86, 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x33, + 0x32, 0x10, 0x87, 0x02, 0x12, 0x0b, 0x0a, 0x06, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x88, + 0x06, 0x12, 0x0a, 0x0a, 0x05, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x89, 0x02, 0x12, 0x0b, 0x0a, + 0x06, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x8a, 0x06, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, + 0x4f, 0x41, 0x54, 0x33, 0x32, 0x10, 0x8b, 0x08, 0x12, 0x0c, 0x0a, 0x07, 0x46, 0x4c, 0x4f, 0x41, + 0x54, 0x36, 0x34, 0x10, 0x8c, 0x08, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, + 0x41, 0x4d, 0x50, 0x10, 0x8d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x44, 0x41, 0x54, 0x45, 0x10, 0x8e, + 0x10, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x8f, 0x10, 0x12, 0x0d, 0x0a, 0x08, + 0x44, 0x41, 0x54, 0x45, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x90, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x59, + 0x45, 0x41, 0x52, 0x10, 0x91, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x49, 0x4d, 0x41, + 0x4c, 0x10, 0x12, 0x12, 0x09, 0x0a, 0x04, 0x54, 0x45, 0x58, 0x54, 0x10, 0x93, 0x30, 0x12, 0x09, + 0x0a, 0x04, 0x42, 0x4c, 0x4f, 0x42, 0x10, 0x94, 0x50, 0x12, 0x0c, 0x0a, 0x07, 0x56, 0x41, 0x52, + 0x43, 0x48, 0x41, 0x52, 0x10, 0x95, 0x30, 0x12, 0x0e, 0x0a, 0x09, 0x56, 0x41, 0x52, 0x42, 0x49, + 0x4e, 0x41, 0x52, 0x59, 0x10, 0x96, 0x50, 0x12, 0x09, 0x0a, 0x04, 0x43, 0x48, 0x41, 0x52, 0x10, + 0x97, 0x30, 0x12, 0x0b, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x41, 0x52, 0x59, 0x10, 0x98, 0x50, 0x12, + 0x08, 0x0a, 0x03, 0x42, 0x49, 0x54, 0x10, 0x99, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x45, 0x4e, 0x55, + 0x4d, 0x10, 0x9a, 0x10, 0x12, 0x08, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x9b, 0x10, 0x12, 0x09, + 0x0a, 0x05, 0x54, 0x55, 0x50, 0x4c, 0x45, 0x10, 0x1c, 0x12, 0x0d, 0x0a, 0x08, 0x47, 0x45, 0x4f, + 0x4d, 0x45, 0x54, 0x52, 0x59, 0x10, 0x9d, 0x10, 0x12, 0x09, 0x0a, 0x04, 0x4a, 0x53, 0x4f, 0x4e, + 0x10, 0x9e, 0x10, 0x12, 0x0e, 0x0a, 0x0a, 0x45, 0x58, 0x50, 0x52, 0x45, 0x53, 0x53, 0x49, 0x4f, + 0x4e, 0x10, 0x1f, 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x4e, 0x55, 0x4d, 0x10, 0xa0, 0x20, + 0x12, 0x0b, 0x0a, 0x06, 0x48, 0x45, 0x58, 0x56, 0x41, 0x4c, 0x10, 0xa1, 0x20, 0x12, 0x0b, 0x0a, + 0x06, 0x42, 0x49, 0x54, 0x4e, 0x55, 0x4d, 0x10, 0xa2, 0x20, 0x2a, 0x46, 0x0a, 0x10, 0x54, 0x72, + 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, + 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x50, + 0x52, 0x45, 0x50, 0x41, 0x52, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4f, 0x4d, 0x4d, + 0x49, 0x54, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x52, 0x4f, 0x4c, 0x4c, 0x42, 0x41, 0x43, 0x4b, + 0x10, 0x03, 0x2a, 0x31, 0x0a, 0x0f, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x09, 0x0a, 0x05, 0x56, 0x49, 0x45, 0x57, 0x53, 0x10, 0x00, + 0x12, 0x0a, 0x0a, 0x06, 0x54, 0x41, 0x42, 0x4c, 0x45, 0x53, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, + 0x41, 0x4c, 0x4c, 0x10, 0x02, 0x42, 0x35, 0x0a, 0x0f, 0x69, 0x6f, 0x2e, 0x76, 0x69, 0x74, 0x65, + 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5a, 0x22, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, + 0x2e, 0x69, 0x6f, 0x2f, 0x76, 0x69, 0x74, 0x65, 0x73, 0x73, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x74, + 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/go/vt/vtgate/planbuilder/builder.go b/go/vt/vtgate/planbuilder/builder.go index 7a38d18267c..6d67bd2fba3 100644 --- a/go/vt/vtgate/planbuilder/builder.go +++ b/go/vt/vtgate/planbuilder/builder.go @@ -50,6 +50,8 @@ const ( Gen4WithFallback = querypb.ExecuteOptions_Gen4WithFallback // Gen4CompareV3 executes queries on both Gen4 and V3 to compare their results. Gen4CompareV3 = querypb.ExecuteOptions_Gen4CompareV3 + // V3Insert executes insert query on V3 and others on Gen4. + V3Insert = querypb.ExecuteOptions_V3Insert ) var ( @@ -147,10 +149,15 @@ func getConfiguredPlanner(vschema plancontext.VSchema, v3planner func(string) st return gen4Planner(query, planner), nil case Gen4WithFallback: fp := &fallbackPlanner{ - primary: gen4Planner(query, querypb.ExecuteOptions_Gen4), + primary: gen4Planner(query, Gen4), fallback: v3planner(query), } return fp.plan, nil + case V3Insert: + if _, isInsert := stmt.(*sqlparser.Insert); isInsert { + return v3planner(query), nil + } + return gen4Planner(query, Gen4), nil case V3: return v3planner(query), nil default: diff --git a/go/vt/vtgate/planbuilder/plancontext/vschema.go b/go/vt/vtgate/planbuilder/plancontext/vschema.go index d7c2b7cf657..489a9eafe8f 100644 --- a/go/vt/vtgate/planbuilder/plancontext/vschema.go +++ b/go/vt/vtgate/planbuilder/plancontext/vschema.go @@ -91,7 +91,7 @@ type VSchema interface { // PlannerNameToVersion returns the numerical representation of the planner func PlannerNameToVersion(s string) (PlannerVersion, bool) { - deprecationMessage := "The V3 planner is deprecated and will be removed in V17 of Vitess" + deprecationMessage := "The V3 planner is deprecated and will be removed in future release of Vitess" switch strings.ToLower(s) { case "v3": log.Warning(deprecationMessage) @@ -107,6 +107,9 @@ func PlannerNameToVersion(s string) (PlannerVersion, bool) { case "gen4comparev3": log.Warning(deprecationMessage) return querypb.ExecuteOptions_Gen4CompareV3, true + case "v3insert": + log.Warning(deprecationMessage) + return querypb.ExecuteOptions_V3Insert, true } return 0, false } diff --git a/go/vt/vtgate/planbuilder/testdata/dml_cases.json b/go/vt/vtgate/planbuilder/testdata/dml_cases.json index 59b77b0682c..8b92ffe9336 100644 --- a/go/vt/vtgate/planbuilder/testdata/dml_cases.json +++ b/go/vt/vtgate/planbuilder/testdata/dml_cases.json @@ -6439,5 +6439,51 @@ "user.user" ] } + }, + { + "comment": "insert into a vindex not allowed - gen4 produces different error - forcing a v3 plan here will have same output", + "query": "insert /*vt+ planner=v3insert */ into user_index(id) values(1)", + "plan": "VT12001: unsupported: multi-shard or vindex write statement" + }, + { + "comment": "insert with select takes shared lock in gen4 and for update in v3, as forcing v3 plan the output will remain same", + "query": "insert /*vt+ planner=v3insert */ into user(id) select id from user", + "plan": { + "QueryType": "INSERT", + "Original": "insert /*vt+ planner=v3insert */ into user(id) select id from user", + "Instructions": { + "OperatorType": "Insert", + "Variant": "Select", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "TargetTabletType": "PRIMARY", + "AutoIncrement": "select next :n /* INT64 */ values from seq:Offset(0)", + "InputAsNonStreaming": true, + "TableName": "user", + "VindexOffsetFromSelect": { + "costly_map": "[-1]", + "name_user_map": "[-1]", + "user_index": "[0]" + }, + "Inputs": [ + { + "OperatorType": "Route", + "Variant": "Scatter", + "Keyspace": { + "Name": "user", + "Sharded": true + }, + "FieldQuery": "select id from `user` where 1 != 1", + "Query": "select id from `user` for update", + "Table": "`user`" + } + ] + }, + "TablesUsed": [ + "user.user" + ] + } } ] diff --git a/proto/query.proto b/proto/query.proto index 436ce39564e..4c3f82eca2a 100644 --- a/proto/query.proto +++ b/proto/query.proto @@ -315,6 +315,7 @@ message ExecuteOptions { Gen4Left2Right = 4; Gen4WithFallback = 5; Gen4CompareV3 = 6; + V3Insert = 7; } // PlannerVersion specifies which planner to use. diff --git a/web/vtadmin/src/proto/vtadmin.d.ts b/web/vtadmin/src/proto/vtadmin.d.ts index 24a9c14f17d..d43e92fbfee 100644 --- a/web/vtadmin/src/proto/vtadmin.d.ts +++ b/web/vtadmin/src/proto/vtadmin.d.ts @@ -31379,7 +31379,8 @@ export namespace query { Gen4Greedy = 3, Gen4Left2Right = 4, Gen4WithFallback = 5, - Gen4CompareV3 = 6 + Gen4CompareV3 = 6, + V3Insert = 7 } /** Consolidator enum. */ diff --git a/web/vtadmin/src/proto/vtadmin.js b/web/vtadmin/src/proto/vtadmin.js index 4719452ef8a..5c968d90fef 100644 --- a/web/vtadmin/src/proto/vtadmin.js +++ b/web/vtadmin/src/proto/vtadmin.js @@ -73811,6 +73811,7 @@ export const query = $root.query = (() => { case 4: case 5: case 6: + case 7: break; } if (message.has_created_temp_tables != null && message.hasOwnProperty("has_created_temp_tables")) @@ -73988,6 +73989,10 @@ export const query = $root.query = (() => { case 6: message.planner_version = 6; break; + case "V3Insert": + case 7: + message.planner_version = 7; + break; } if (object.has_created_temp_tables != null) message.has_created_temp_tables = Boolean(object.has_created_temp_tables); @@ -74207,6 +74212,7 @@ export const query = $root.query = (() => { * @property {number} Gen4Left2Right=4 Gen4Left2Right value * @property {number} Gen4WithFallback=5 Gen4WithFallback value * @property {number} Gen4CompareV3=6 Gen4CompareV3 value + * @property {number} V3Insert=7 V3Insert value */ ExecuteOptions.PlannerVersion = (function() { const valuesById = {}, values = Object.create(valuesById); @@ -74217,6 +74223,7 @@ export const query = $root.query = (() => { values[valuesById[4] = "Gen4Left2Right"] = 4; values[valuesById[5] = "Gen4WithFallback"] = 5; values[valuesById[6] = "Gen4CompareV3"] = 6; + values[valuesById[7] = "V3Insert"] = 7; return values; })(); From 3630ff2e3e899e138968c5f4bd88acc926bc4555 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 1 Jun 2023 17:24:01 +0530 Subject: [PATCH 20/21] addressed review comments in release notes Signed-off-by: Harshit Gangal --- changelog/17.0/17.0.0/summary.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog/17.0/17.0.0/summary.md b/changelog/17.0/17.0.0/summary.md index f432d9c873f..9af7ffce3f5 100644 --- a/changelog/17.0/17.0.0/summary.md +++ b/changelog/17.0/17.0.0/summary.md @@ -29,7 +29,7 @@ - [Settings pool enabled](#settings-pool) - **[VTGate](#vtgate)** - [StreamExecute GRPC API](#stream-execute) - - [Insert Planner Gen4] (#insert-planner) + - [Insert Planner Gen4](#insert-planner) - **[Deprecations and Deletions](#deprecations-and-deletions)** - [Deprecated Flags](#deprecated-flags) - [Deprecated Stats](#deprecated-stats) @@ -385,8 +385,8 @@ This could be a breaking change for grpc api users based on how they have implem #### Insert Planning with Gen4 -Gen4 planner was made default in v14 for select queries. In v15 update and delete queries were moved to Gen4 framework. -With this release Insert planning is moved to Gen4. +Gen4 planner was made default in v14 for `SELECT` queries. In v15 `UPDATE` and `DELETE` queries were moved to Gen4 framework. +With this release `INSERT` queries are moved to Gen4. Clients can move to old v3 planner for inserts by using `V3Insert` planner version with `--planner-version` vtgate flag or with comment directive /*vt+ planner=` for individual query. From 4ee2352b469b8aebfe89eb58a3319c2b1dd43d25 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Thu, 1 Jun 2023 18:03:41 +0530 Subject: [PATCH 21/21] added V3Insert in multiple docs Signed-off-by: Harshit Gangal --- go/cmd/vtcombo/main.go | 2 +- go/cmd/vtgate/vtgate.go | 2 +- go/cmd/vttestserver/main.go | 2 +- go/flags/endtoend/vtgate.txt | 2 +- go/flags/endtoend/vttestserver.txt | 2 +- go/vt/vtgate/planbuilder/builder.go | 2 +- go/vt/vttest/local_cluster.go | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/go/cmd/vtcombo/main.go b/go/cmd/vtcombo/main.go index 10f8f3d3966..affbf0520e7 100644 --- a/go/cmd/vtcombo/main.go +++ b/go/cmd/vtcombo/main.go @@ -61,7 +61,7 @@ var ( mysqlPort = flags.Int("mysql_port", 3306, "mysql port") externalTopoServer = flags.Bool("external_topo_server", false, "Should vtcombo use an external topology server instead of starting its own in-memory topology server. "+ "If true, vtcombo will use the flags defined in topo/server.go to open topo server") - plannerName = flags.String("planner-version", "", "Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.") + plannerName = flags.String("planner-version", "", "Sets the default planner to use when the session has not changed it. Valid values are: V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.") tpb vttestpb.VTTestTopology ts *topo.Server diff --git a/go/cmd/vtgate/vtgate.go b/go/cmd/vtgate/vtgate.go index d043ecf4f95..f4fc21000a2 100644 --- a/go/cmd/vtgate/vtgate.go +++ b/go/cmd/vtgate/vtgate.go @@ -48,7 +48,7 @@ var ( func registerFlags(fs *pflag.FlagSet) { fs.StringVar(&cell, "cell", cell, "cell to use") fs.Var((*topoproto.TabletTypeListFlag)(&tabletTypesToWait), "tablet_types_to_wait", "Wait till connected for specified tablet types during Gateway initialization. Should be provided as a comma-separated set of tablet types.") - fs.StringVar(&plannerName, "planner-version", plannerName, "Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.") + fs.StringVar(&plannerName, "planner-version", plannerName, "Sets the default planner to use when the session has not changed it. Valid values are: V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails.") acl.RegisterFlags(fs) } diff --git a/go/cmd/vttestserver/main.go b/go/cmd/vttestserver/main.go index a91005f841c..e73b722d154 100644 --- a/go/cmd/vttestserver/main.go +++ b/go/cmd/vttestserver/main.go @@ -141,7 +141,7 @@ func registerFlags(fs *pflag.FlagSet) { fs.StringVar(&config.Charset, "charset", "utf8mb4", "MySQL charset") - fs.StringVar(&config.PlannerVersion, "planner-version", "", "Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the new gen4 planner and falls back to the V3 planner if the gen4 fails.") + fs.StringVar(&config.PlannerVersion, "planner-version", "", "Sets the default planner to use when the session has not changed it. Valid values are: V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the new gen4 planner and falls back to the V3 planner if the gen4 fails.") fs.StringVar(&config.SnapshotFile, "snapshot_file", "", "A MySQL DB snapshot file") diff --git a/go/flags/endtoend/vtgate.txt b/go/flags/endtoend/vtgate.txt index bb576961c29..8137013dc85 100644 --- a/go/flags/endtoend/vtgate.txt +++ b/go/flags/endtoend/vtgate.txt @@ -132,7 +132,7 @@ Usage of vtgate: --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --opentsdb_uri string URI of opentsdb /api/put method --pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. - --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails. + --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the gen4 planner and falls back to the V3 planner if the gen4 fails. --port int port for the server --pprof strings enable profiling --proxy_protocol Enable HAProxy PROXY protocol on MySQL listener socket diff --git a/go/flags/endtoend/vttestserver.txt b/go/flags/endtoend/vttestserver.txt index 4254f58c398..127d3c6ace0 100644 --- a/go/flags/endtoend/vttestserver.txt +++ b/go/flags/endtoend/vttestserver.txt @@ -89,7 +89,7 @@ Usage of vttestserver: --onterm_timeout duration wait no more than this for OnTermSync handlers before stopping (default 10s) --persistent_mode If this flag is set, the MySQL data directory is not cleaned up when LocalCluster.TearDown() is called. This is useful for running vttestserver as a database container in local developer environments. Note that db migration files (--schema_dir option) and seeding of random data (--initialize_with_random_data option) will only run during cluster startup if the data directory does not already exist. vschema migrations are run every time the cluster starts, since persistence for the topology server has not been implemented yet --pid_file string If set, the process will write its pid to the named file, and delete it on graceful shutdown. - --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: V3, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the new gen4 planner and falls back to the V3 planner if the gen4 fails. + --planner-version string Sets the default planner to use when the session has not changed it. Valid values are: V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback. Gen4Fallback tries the new gen4 planner and falls back to the V3 planner if the gen4 fails. --pool_hostname_resolve_interval duration if set force an update to all hostnames and reconnect if changed, defaults to 0 (disabled) --port int Port to use for vtcombo. If this is 0, a random port will be chosen. --pprof strings enable profiling diff --git a/go/vt/vtgate/planbuilder/builder.go b/go/vt/vtgate/planbuilder/builder.go index 6d67bd2fba3..3ebe7bd95d7 100644 --- a/go/vt/vtgate/planbuilder/builder.go +++ b/go/vt/vtgate/planbuilder/builder.go @@ -55,7 +55,7 @@ const ( ) var ( - plannerVersions = []plancontext.PlannerVersion{V3, Gen4, Gen4GreedyOnly, Gen4Left2Right, Gen4WithFallback, Gen4CompareV3} + plannerVersions = []plancontext.PlannerVersion{V3, V3Insert, Gen4, Gen4GreedyOnly, Gen4Left2Right, Gen4WithFallback, Gen4CompareV3} ) type ( diff --git a/go/vt/vttest/local_cluster.go b/go/vt/vttest/local_cluster.go index edbec948aec..389f21b3e1f 100644 --- a/go/vt/vttest/local_cluster.go +++ b/go/vt/vttest/local_cluster.go @@ -87,7 +87,7 @@ type Config struct { Charset string // PlannerVersion is the planner version to use for the vtgate. - // Choose between V3, Gen4, Gen4Greedy and Gen4Fallback + // Choose between V3, V3Insert, Gen4, Gen4Greedy and Gen4Fallback PlannerVersion string // ExtraMyCnf are the extra .CNF files to be added to the MySQL config