Skip to content

Commit 9c2894e

Browse files
vitess-bot[bot]frouiouisystay
authored
[release-19.0] Avoid rewriting unsharded queries and split semantic analysis in two (#15217) (#15230)
Signed-off-by: Andres Taylor <andres@planetscale.com> Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr> Co-authored-by: Florent Poinsard <35779988+frouioui@users.noreply.github.com> Co-authored-by: Andres Taylor <andres@planetscale.com>
1 parent 7c8572a commit 9c2894e

27 files changed

+643
-437
lines changed

go/vt/sqlparser/impossible_query.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ package sqlparser
2727
func FormatImpossibleQuery(buf *TrackedBuffer, node SQLNode) {
2828
switch node := node.(type) {
2929
case *Select:
30+
if node.With != nil {
31+
node.With.Format(buf)
32+
}
3033
buf.Myprintf("select %v from ", node.SelectExprs)
3134
var prefix string
3235
for _, n := range node.From {

go/vt/vtgate/planbuilder/operators/aggregator.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ func (a *Aggregator) SetInputs(operators []Operator) {
8080
}
8181

8282
func (a *Aggregator) AddPredicate(_ *plancontext.PlanningContext, expr sqlparser.Expr) Operator {
83-
return &Filter{
84-
Source: a,
85-
Predicates: []sqlparser.Expr{expr},
86-
}
83+
return newFilter(a, expr)
8784
}
8885

8986
func (a *Aggregator) addColumnWithoutPushing(_ *plancontext.PlanningContext, expr *sqlparser.AliasedExpr, addToGroupBy bool) int {

go/vt/vtgate/planbuilder/operators/apply_join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ func (aj *ApplyJoin) Clone(inputs []Operator) Operator {
112112
}
113113

114114
func (aj *ApplyJoin) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.Expr) Operator {
115-
return AddPredicate(ctx, aj, expr, false, newFilter)
115+
return AddPredicate(ctx, aj, expr, false, newFilterSinglePredicate)
116116
}
117117

118118
// Inputs implements the Operator interface

go/vt/vtgate/planbuilder/operators/filter.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ type Filter struct {
3939
Truncate int
4040
}
4141

42-
func newFilter(op Operator, expr sqlparser.Expr) Operator {
42+
func newFilterSinglePredicate(op Operator, expr sqlparser.Expr) Operator {
43+
return newFilter(op, expr)
44+
}
45+
46+
func newFilter(op Operator, expr ...sqlparser.Expr) Operator {
4347
return &Filter{
44-
Source: op, Predicates: []sqlparser.Expr{expr},
48+
Source: op, Predicates: expr,
4549
}
4650
}
4751

go/vt/vtgate/planbuilder/operators/hash_join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (hj *HashJoin) SetInputs(operators []Operator) {
106106
}
107107

108108
func (hj *HashJoin) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.Expr) Operator {
109-
return AddPredicate(ctx, hj, expr, false, newFilter)
109+
return AddPredicate(ctx, hj, expr, false, newFilterSinglePredicate)
110110
}
111111

112112
func (hj *HashJoin) AddColumn(ctx *plancontext.PlanningContext, reuseExisting bool, addToGroupBy bool, expr *sqlparser.AliasedExpr) int {

go/vt/vtgate/planbuilder/operators/horizon.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,14 @@ func (h *Horizon) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.
9494
tableInfo, err := ctx.SemTable.TableInfoForExpr(expr)
9595
if err != nil {
9696
if errors.Is(err, semantics.ErrNotSingleTable) {
97-
return &Filter{
98-
Source: h,
99-
Predicates: []sqlparser.Expr{expr},
100-
}
97+
return newFilter(h, expr)
10198
}
10299
panic(err)
103100
}
104101

105102
newExpr := semantics.RewriteDerivedTableExpression(expr, tableInfo)
106103
if sqlparser.ContainsAggregation(newExpr) {
107-
return &Filter{Source: h, Predicates: []sqlparser.Expr{expr}}
104+
return newFilter(h, expr)
108105
}
109106
h.Source = h.Source.AddPredicate(ctx, newExpr)
110107
return h

go/vt/vtgate/planbuilder/operators/join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ func createInnerJoin(ctx *plancontext.PlanningContext, tableExpr *sqlparser.Join
128128
}
129129

130130
func (j *Join) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.Expr) Operator {
131-
return AddPredicate(ctx, j, expr, false, newFilter)
131+
return AddPredicate(ctx, j, expr, false, newFilterSinglePredicate)
132132
}
133133

134134
var _ JoinOp = (*Join)(nil)

go/vt/vtgate/planbuilder/operators/route_planning.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func pushJoinPredicates(ctx *plancontext.PlanningContext, exprs []sqlparser.Expr
580580
}
581581

582582
for _, expr := range exprs {
583-
AddPredicate(ctx, op, expr, true, newFilter)
583+
AddPredicate(ctx, op, expr, true, newFilterSinglePredicate)
584584
}
585585

586586
return op

go/vt/vtgate/planbuilder/operators/subquery.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ func (sq *SubQuery) settleFilter(ctx *plancontext.PlanningContext, outer Operato
269269
predicates = append(predicates, rhsPred)
270270
sq.SubqueryValueName = sq.ArgName
271271
}
272-
return &Filter{
273-
Source: outer,
274-
Predicates: predicates,
275-
}
272+
return newFilter(outer, predicates...)
276273
}
277274

278275
func dontEnterSubqueries(node, _ sqlparser.SQLNode) bool {

go/vt/vtgate/planbuilder/operators/subquery_planning.go

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ func tryMergeSubqueriesRecursively(
484484
finalResult = finalResult.Merge(res)
485485
}
486486

487-
op.Source = &Filter{Source: outer.Source, Predicates: []sqlparser.Expr{subQuery.Original}}
487+
op.Source = newFilter(outer.Source, subQuery.Original)
488488
return op, finalResult.Merge(Rewrote("merge outer of two subqueries"))
489489
}
490490

@@ -503,7 +503,7 @@ func tryMergeSubqueryWithOuter(ctx *plancontext.PlanningContext, subQuery *SubQu
503503
return outer, NoRewrite
504504
}
505505
if !subQuery.IsProjection {
506-
op.Source = &Filter{Source: outer.Source, Predicates: []sqlparser.Expr{subQuery.Original}}
506+
op.Source = newFilter(outer.Source, subQuery.Original)
507507
}
508508
ctx.MergedSubqueries = append(ctx.MergedSubqueries, subQuery.originalSubquery)
509509
return op, Rewrote("merged subquery with outer")
@@ -608,10 +608,7 @@ func (s *subqueryRouteMerger) merge(ctx *plancontext.PlanningContext, inner, out
608608
if isSharded {
609609
src = s.outer.Source
610610
if !s.subq.IsProjection {
611-
src = &Filter{
612-
Source: s.outer.Source,
613-
Predicates: []sqlparser.Expr{s.original},
614-
}
611+
src = newFilter(s.outer.Source, s.original)
615612
}
616613
} else {
617614
src = s.rewriteASTExpression(ctx, inner)
@@ -681,10 +678,7 @@ func (s *subqueryRouteMerger) rewriteASTExpression(ctx *plancontext.PlanningCont
681678
cursor.Replace(subq)
682679
}
683680
}, ctx.SemTable.CopySemanticInfo).(sqlparser.Expr)
684-
src = &Filter{
685-
Source: s.outer.Source,
686-
Predicates: []sqlparser.Expr{sQuery},
687-
}
681+
src = newFilter(s.outer.Source, sQuery)
688682
}
689683
return src
690684
}

go/vt/vtgate/planbuilder/operators/union.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ func (u *Union) AddPredicate(ctx *plancontext.PlanningContext, expr sqlparser.Ex
105105

106106
needsFilter, exprPerSource := u.predicatePerSource(expr, offsets)
107107
if needsFilter {
108-
return &Filter{
109-
Source: u,
110-
Predicates: []sqlparser.Expr{expr},
111-
}
108+
return newFilter(u, expr)
112109
}
113110

114111
for i, src := range u.Sources {

go/vt/vtgate/planbuilder/testdata/cte_cases.json

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,8 @@
13691369
"Name": "main",
13701370
"Sharded": false
13711371
},
1372-
"FieldQuery": "select u.* from (select * from unsharded where 1 != 1) as u where 1 != 1",
1373-
"Query": "select u.* from (select * from unsharded) as u",
1372+
"FieldQuery": "with u as (select * from unsharded where 1 != 1) select u.* from u where 1 != 1",
1373+
"Query": "with u as (select * from unsharded) select u.* from u",
13741374
"Table": "unsharded"
13751375
},
13761376
"TablesUsed": [
@@ -1709,8 +1709,8 @@
17091709
"Name": "main",
17101710
"Sharded": false
17111711
},
1712-
"FieldQuery": "select col from (select col from unsharded join unsharded_b where 1 != 1) as u join unsharded_a as ua where 1 != 1",
1713-
"Query": "select col from (select col from unsharded join unsharded_b) as u join unsharded_a as ua limit 1",
1712+
"FieldQuery": "with u as (select col from unsharded join unsharded_b where 1 != 1) select col from u join unsharded_a as ua where 1 != 1",
1713+
"Query": "with u as (select col from unsharded join unsharded_b) select col from u join unsharded_a as ua limit 1",
17141714
"Table": "unsharded, unsharded_a, unsharded_b"
17151715
},
17161716
"TablesUsed": [
@@ -1840,5 +1840,28 @@
18401840
"user.user"
18411841
]
18421842
}
1843+
},
1844+
{
1845+
"comment": "recursive WITH against an unsharded database",
1846+
"query": "WITH RECURSIVE cte (n) AS ( SELECT 1 UNION ALL SELECT n + 1 FROM cte WHERE n < 5 ) SELECT cte.n FROM unsharded join cte on unsharded.id = cte.n ",
1847+
"plan": {
1848+
"QueryType": "SELECT",
1849+
"Original": "WITH RECURSIVE cte (n) AS ( SELECT 1 UNION ALL SELECT n + 1 FROM cte WHERE n < 5 ) SELECT cte.n FROM unsharded join cte on unsharded.id = cte.n ",
1850+
"Instructions": {
1851+
"OperatorType": "Route",
1852+
"Variant": "Unsharded",
1853+
"Keyspace": {
1854+
"Name": "main",
1855+
"Sharded": false
1856+
},
1857+
"FieldQuery": "with recursive cte(n) as (select 1 from dual where 1 != 1 union all select n + 1 from cte where 1 != 1) select cte.n from unsharded join cte on unsharded.id = cte.n where 1 != 1",
1858+
"Query": "with recursive cte(n) as (select 1 from dual union all select n + 1 from cte where n < 5) select cte.n from unsharded join cte on unsharded.id = cte.n",
1859+
"Table": "dual, unsharded"
1860+
},
1861+
"TablesUsed": [
1862+
"main.dual",
1863+
"main.unsharded"
1864+
]
1865+
}
18431866
}
18441867
]

go/vt/vtgate/planbuilder/testdata/ddl_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@
260260
"Name": "main",
261261
"Sharded": false
262262
},
263-
"Query": "create view view_a as select col1, col2 from (select col1, col2 from unsharded where id = 1 union select col1, col2 from unsharded where id = 3) as a"
263+
"Query": "create view view_a as select * from (select col1, col2 from unsharded where id = 1 union select col1, col2 from unsharded where id = 3) as a"
264264
},
265265
"TablesUsed": [
266266
"main.view_a"

go/vt/vtgate/planbuilder/testdata/filter_cases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4086,7 +4086,7 @@
40864086
"Sharded": false
40874087
},
40884088
"FieldQuery": "select col + 2 as a from unsharded where 1 != 1",
4089-
"Query": "select col + 2 as a from unsharded having col + 2 = 42",
4089+
"Query": "select col + 2 as a from unsharded having a = 42",
40904090
"Table": "unsharded"
40914091
},
40924092
"TablesUsed": [

go/vt/vtgate/planbuilder/testdata/foreignkey_cases.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@
816816
"Sharded": false
817817
},
818818
"FieldQuery": "select 1 from u_tbl2 left join u_tbl1 on u_tbl1.col1 = cast(u_tbl2.col1 + 'bar' as CHAR) where 1 != 1",
819-
"Query": "select 1 from u_tbl2 left join u_tbl1 on u_tbl1.col1 = cast(u_tbl2.col1 + 'bar' as CHAR) where cast(u_tbl2.col1 + 'bar' as CHAR) is not null and not (u_tbl2.col2) <=> (cast(u_tbl2.col1 + 'bar' as CHAR)) and u_tbl2.id = 1 and u_tbl1.col1 is null limit 1 for share",
819+
"Query": "select 1 from u_tbl2 left join u_tbl1 on u_tbl1.col1 = cast(u_tbl2.col1 + 'bar' as CHAR) where u_tbl1.col1 is null and cast(u_tbl2.col1 + 'bar' as CHAR) is not null and not (u_tbl2.col2) <=> (cast(u_tbl2.col1 + 'bar' as CHAR)) and u_tbl2.id = 1 limit 1 for share",
820820
"Table": "u_tbl1, u_tbl2"
821821
},
822822
{
@@ -1523,7 +1523,7 @@
15231523
"Sharded": false
15241524
},
15251525
"FieldQuery": "select 1 from u_tbl8 left join u_tbl9 on u_tbl9.col9 = cast('foo' as CHAR) where 1 != 1",
1526-
"Query": "select 1 from u_tbl8 left join u_tbl9 on u_tbl9.col9 = cast('foo' as CHAR) where not (u_tbl8.col8) <=> (cast('foo' as CHAR)) and (u_tbl8.col8) in ::fkc_vals and u_tbl9.col9 is null limit 1 for share nowait",
1526+
"Query": "select 1 from u_tbl8 left join u_tbl9 on u_tbl9.col9 = cast('foo' as CHAR) where u_tbl9.col9 is null and cast('foo' as CHAR) is not null and not (u_tbl8.col8) <=> (cast('foo' as CHAR)) and (u_tbl8.col8) in ::fkc_vals limit 1 for share nowait",
15271527
"Table": "u_tbl8, u_tbl9"
15281528
},
15291529
{
@@ -1599,7 +1599,7 @@
15991599
"Sharded": false
16001600
},
16011601
"FieldQuery": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast('foo' as CHAR) where 1 != 1",
1602-
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast('foo' as CHAR) where not (u_tbl4.col4) <=> (cast('foo' as CHAR)) and (u_tbl4.col4) in ::fkc_vals and u_tbl3.col3 is null limit 1 for share",
1602+
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast('foo' as CHAR) where u_tbl3.col3 is null and cast('foo' as CHAR) is not null and not (u_tbl4.col4) <=> (cast('foo' as CHAR)) and (u_tbl4.col4) in ::fkc_vals limit 1 for share",
16031603
"Table": "u_tbl3, u_tbl4"
16041604
},
16051605
{
@@ -1611,7 +1611,7 @@
16111611
"Sharded": false
16121612
},
16131613
"FieldQuery": "select 1 from u_tbl4, u_tbl9 where 1 != 1",
1614-
"Query": "select 1 from u_tbl4, u_tbl9 where (u_tbl4.col4) in ::fkc_vals and (u_tbl9.col9) not in ((cast('foo' as CHAR))) and u_tbl4.col4 = u_tbl9.col9 limit 1 for share",
1614+
"Query": "select 1 from u_tbl4, u_tbl9 where u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast('foo' as CHAR) is null or (u_tbl9.col9) not in ((cast('foo' as CHAR)))) and u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast('foo' as CHAR) is null or (u_tbl9.col9) not in ((cast('foo' as CHAR)))) limit 1 for share",
16151615
"Table": "u_tbl4, u_tbl9"
16161616
},
16171617
{
@@ -1688,7 +1688,7 @@
16881688
"Sharded": false
16891689
},
16901690
"FieldQuery": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:v1 as CHAR) where 1 != 1",
1691-
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:v1 as CHAR) where not (u_tbl4.col4) <=> (cast(:v1 as CHAR)) and (u_tbl4.col4) in ::fkc_vals and cast(:v1 as CHAR) is not null and u_tbl3.col3 is null limit 1 for share",
1691+
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:v1 as CHAR) where u_tbl3.col3 is null and cast(:v1 as CHAR) is not null and not (u_tbl4.col4) <=> (cast(:v1 as CHAR)) and (u_tbl4.col4) in ::fkc_vals limit 1 for share",
16921692
"Table": "u_tbl3, u_tbl4"
16931693
},
16941694
{
@@ -1700,7 +1700,7 @@
17001700
"Sharded": false
17011701
},
17021702
"FieldQuery": "select 1 from u_tbl4, u_tbl9 where 1 != 1",
1703-
"Query": "select 1 from u_tbl4, u_tbl9 where (u_tbl4.col4) in ::fkc_vals and (cast(:v1 as CHAR) is null or (u_tbl9.col9) not in ((cast(:v1 as CHAR)))) and u_tbl4.col4 = u_tbl9.col9 limit 1 for share",
1703+
"Query": "select 1 from u_tbl4, u_tbl9 where u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast(:v1 as CHAR) is null or (u_tbl9.col9) not in ((cast(:v1 as CHAR)))) and u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast(:v1 as CHAR) is null or (u_tbl9.col9) not in ((cast(:v1 as CHAR)))) limit 1 for share",
17041704
"Table": "u_tbl4, u_tbl9"
17051705
},
17061706
{
@@ -2362,7 +2362,7 @@
23622362
"Sharded": false
23632363
},
23642364
"FieldQuery": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:fkc_upd as CHAR) where 1 != 1",
2365-
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:fkc_upd as CHAR) where not (u_tbl4.col4) <=> (cast(:fkc_upd as CHAR)) and (u_tbl4.col4) in ::fkc_vals and cast(:fkc_upd as CHAR) is not null and u_tbl3.col3 is null limit 1 for share",
2365+
"Query": "select 1 from u_tbl4 left join u_tbl3 on u_tbl3.col3 = cast(:fkc_upd as CHAR) where u_tbl3.col3 is null and cast(:fkc_upd as CHAR) is not null and not (u_tbl4.col4) <=> (cast(:fkc_upd as CHAR)) and (u_tbl4.col4) in ::fkc_vals limit 1 for share",
23662366
"Table": "u_tbl3, u_tbl4"
23672367
},
23682368
{
@@ -2374,7 +2374,7 @@
23742374
"Sharded": false
23752375
},
23762376
"FieldQuery": "select 1 from u_tbl4, u_tbl9 where 1 != 1",
2377-
"Query": "select 1 from u_tbl4, u_tbl9 where (u_tbl4.col4) in ::fkc_vals and (cast(:fkc_upd as CHAR) is null or (u_tbl9.col9) not in ((cast(:fkc_upd as CHAR)))) and u_tbl4.col4 = u_tbl9.col9 limit 1 for share",
2377+
"Query": "select 1 from u_tbl4, u_tbl9 where u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast(:fkc_upd as CHAR) is null or (u_tbl9.col9) not in ((cast(:fkc_upd as CHAR)))) and u_tbl4.col4 = u_tbl9.col9 and (u_tbl4.col4) in ::fkc_vals and (cast(:fkc_upd as CHAR) is null or (u_tbl9.col9) not in ((cast(:fkc_upd as CHAR)))) limit 1 for share",
23782378
"Table": "u_tbl4, u_tbl9"
23792379
},
23802380
{
@@ -2537,7 +2537,7 @@
25372537
"Sharded": false
25382538
},
25392539
"FieldQuery": "select 1 from u_multicol_tbl2 left join u_multicol_tbl1 on u_multicol_tbl1.cola = 2 and u_multicol_tbl1.colb = u_multicol_tbl2.colc - 2 where 1 != 1",
2540-
"Query": "select 1 from u_multicol_tbl2 left join u_multicol_tbl1 on u_multicol_tbl1.cola = 2 and u_multicol_tbl1.colb = u_multicol_tbl2.colc - 2 where u_multicol_tbl2.colc - 2 is not null and not (u_multicol_tbl2.cola, u_multicol_tbl2.colb) <=> (2, u_multicol_tbl2.colc - 2) and u_multicol_tbl2.id = 7 and u_multicol_tbl1.cola is null and u_multicol_tbl1.colb is null limit 1 for share",
2540+
"Query": "select 1 from u_multicol_tbl2 left join u_multicol_tbl1 on u_multicol_tbl1.cola = 2 and u_multicol_tbl1.colb = u_multicol_tbl2.colc - 2 where u_multicol_tbl1.cola is null and 2 is not null and u_multicol_tbl1.colb is null and u_multicol_tbl2.colc - 2 is not null and not (u_multicol_tbl2.cola, u_multicol_tbl2.colb) <=> (2, u_multicol_tbl2.colc - 2) and u_multicol_tbl2.id = 7 limit 1 for share",
25412541
"Table": "u_multicol_tbl1, u_multicol_tbl2"
25422542
},
25432543
{
@@ -3139,7 +3139,7 @@
31393139
"Sharded": false
31403140
},
31413141
"FieldQuery": "select u_tbl6.col6 from u_tbl6 as u, u_tbl5 as m where 1 != 1",
3142-
"Query": "select u_tbl6.col6 from u_tbl6 as u, u_tbl5 as m where u.col2 = 4 and m.col3 = 6 and u.col = m.col for update",
3142+
"Query": "select u_tbl6.col6 from u_tbl6 as u, u_tbl5 as m where u.col = m.col and u.col2 = 4 and m.col3 = 6 and u.col = m.col and u.col2 = 4 and m.col3 = 6 for update",
31433143
"Table": "u_tbl5, u_tbl6"
31443144
},
31453145
{
@@ -3197,7 +3197,7 @@
31973197
"Sharded": false
31983198
},
31993199
"FieldQuery": "select u_tbl10.col from u_tbl10, u_tbl11 where 1 != 1",
3200-
"Query": "select u_tbl10.col from u_tbl10, u_tbl11 where u_tbl10.id = 5 and u_tbl10.id = u_tbl11.id for update",
3200+
"Query": "select u_tbl10.col from u_tbl10, u_tbl11 where u_tbl10.id = u_tbl11.id and u_tbl10.id = 5 and u_tbl10.id = u_tbl11.id and u_tbl10.id = 5 for update",
32013201
"Table": "u_tbl10, u_tbl11"
32023202
},
32033203
{
@@ -3254,7 +3254,7 @@
32543254
"Sharded": false
32553255
},
32563256
"FieldQuery": "select u_tbl1.col1 from u_tbl10, u_tbl1 where 1 != 1",
3257-
"Query": "select u_tbl1.col1 from u_tbl10, u_tbl1 where u_tbl10.col = u_tbl1.col for update",
3257+
"Query": "select u_tbl1.col1 from u_tbl10, u_tbl1 where u_tbl10.col = u_tbl1.col and u_tbl10.col = u_tbl1.col for update",
32583258
"Table": "u_tbl1, u_tbl10"
32593259
},
32603260
{

0 commit comments

Comments
 (0)