Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
qw4990 committed Sep 11, 2023
1 parent 02ceded commit dd180ef
Showing 1 changed file with 4 additions and 16 deletions.
20 changes: 4 additions & 16 deletions planner/core/casetest/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1230,28 +1230,16 @@ func TestFixControl45132(t *testing.T) {
}
tk.MustExec(`analyze table t`)
// the cost model prefers to use TableScan instead of IndexLookup to avoid double requests.
tk.MustQuery(`explain select * from t where a=2`).Check(testkit.Rows(
`TableReader_7 128.00 root data:Selection_6`,
`└─Selection_6 128.00 cop[tikv] eq(test.t.a, 2)`,
` └─TableFullScan_5 12928.00 cop[tikv] table:t keep order:false`))
require.True(t, tk.HasPlan(`select * from t where a=2`, `TableFullScan`))

tk.MustExec(`set @@tidb_opt_fix_control = "45132:99"`)
tk.MustQuery(`explain select * from t where a=2`).Check(testkit.Rows(
`IndexLookUp_7 128.00 root `,
`├─IndexRangeScan_5(Build) 128.00 cop[tikv] table:t, index:a(a) range:[2,2], keep order:false`,
`└─TableRowIDScan_6(Probe) 128.00 cop[tikv] table:t keep order:false`))
tk.MustIndexLookup(`select * from t where a=2`) // index lookup

tk.MustExec(`set @@tidb_opt_fix_control = "45132:500"`)
tk.MustQuery(`explain select * from t where a=2`).Check(testkit.Rows(
`TableReader_7 128.00 root data:Selection_6`,
`└─Selection_6 128.00 cop[tikv] eq(test.t.a, 2)`,
` └─TableFullScan_5 12928.00 cop[tikv] table:t keep order:false`))
require.True(t, tk.HasPlan(`select * from t where a=2`, `TableFullScan`))

tk.MustExec(`set @@tidb_opt_fix_control = "45132:0"`)
tk.MustQuery(`explain select * from t where a=2`).Check(testkit.Rows(
`TableReader_7 128.00 root data:Selection_6`,
`└─Selection_6 128.00 cop[tikv] eq(test.t.a, 2)`,
` └─TableFullScan_5 12928.00 cop[tikv] table:t keep order:false`))
require.True(t, tk.HasPlan(`select * from t where a=2`, `TableFullScan`))
}

func TestFixControl44262(t *testing.T) {
Expand Down

0 comments on commit dd180ef

Please sign in to comment.