Skip to content

Commit c8a1e5a

Browse files
committed
test maybe
Signed-off-by: Weizhen Wang <[email protected]>
1 parent 1988eed commit c8a1e5a

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

pkg/planner/core/explain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ func (p *PhysicalMergeJoin) explainInfo(normalized bool) string {
722722
if normalized {
723723
fmt.Fprintf(buffer, ", left cond:%s", expression.SortedExplainNormalizedExpressionList(p.LeftConditions))
724724
} else {
725-
fmt.Fprintf(buffer, ", left cond:%s", p.LeftConditions)
725+
fmt.Fprintf(buffer, ", left cond:%s", sortedExplainExpressionList(evalCtx, p.LeftConditions))
726726
}
727727
}
728728
if len(p.RightConditions) > 0 {

pkg/planner/core/tests/redact/redact_test.go

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ func TestRedactExplain(t *testing.T) {
4040
// tidb_redact_log=MARKER
4141
// ---------------------------------------------------------------------------
4242
tk.MustExec("set session tidb_redact_log=MARKER")
43-
// join
44-
tk.MustQuery("explain select /*+ INL_JOIN(t2,t1) */ count(*) from t2 join t1 on t2.b = t1.b where t2.a in (1,2) and t1.a in (1,6) and t1.b in (1,6)").Check(testkit.Rows())
4543
// in multi-value
4644
tk.MustQuery("explain select 1 from t left join tlist on tlist.a=t.a where t.a in (12, 13)").
4745
Check(testkit.Rows(
@@ -206,3 +204,24 @@ func TestRedactForRangeInfo(t *testing.T) {
206204
" └─TableRowIDScan_9(Probe) 37.46 cop[tikv] table:t2 keep order:false, stats:pseudo",
207205
))
208206
}
207+
208+
func TestJoinNotSupportedByTiFlash(t *testing.T) {
209+
store := testkit.CreateMockStore(t)
210+
211+
tk := testkit.NewTestKit(t, store)
212+
tk.MustExec("use test")
213+
tk.MustExec("drop table if exists table_1")
214+
tk.MustExec("create table table_1(id int not null, bit_col bit(2) not null, datetime_col datetime not null, index idx(id, bit_col, datetime_col))")
215+
tk.MustExec("insert into table_1 values(1,b'1','2020-01-01 00:00:00'),(2,b'0','2020-01-01 00:00:00')")
216+
tk.MustExec("analyze table table_1")
217+
218+
tk.MustExec("insert into mysql.expr_pushdown_blacklist values('dayofmonth', 'tiflash', '');")
219+
tk.MustExec("admin reload expr_pushdown_blacklist;")
220+
tk.MustExec("set session tidb_redact_log=ON")
221+
tk.MustQuery("explain format = 'brief' select * from table_1 a left join table_1 b on a.id = b.id and dayofmonth(a.datetime_col) > 100").Check(testkit.Rows(
222+
"MergeJoin 2.00 root left outer join, left key:test.table_1.id, right key:test.table_1.id, left cond:gt(dayofmonth(test.table_1.datetime_col), ?)",
223+
"├─IndexReader(Build) 2.00 root index:IndexFullScan",
224+
"│ └─IndexFullScan 2.00 cop[tikv] table:b, index:idx(id, bit_col, datetime_col) keep order:true",
225+
"└─IndexReader(Probe) 2.00 root index:IndexFullScan",
226+
" └─IndexFullScan 2.00 cop[tikv] table:a, index:idx(id, bit_col, datetime_col) keep order:true"))
227+
}

0 commit comments

Comments
 (0)