diff --git a/executor/adapter.go b/executor/adapter.go index b40005a3a2dd3..351414b4b1e23 100644 --- a/executor/adapter.go +++ b/executor/adapter.go @@ -424,9 +424,6 @@ func IsPointGetWithPKOrUniqueKeyByAutoCommit(ctx sessionctx.Context, p plan.Plan case *plan.PhysicalIndexReader: indexScan := v.IndexPlans[0].(*plan.PhysicalIndexScan) return indexScan.IsPointGetByUniqueKey(ctx.GetSessionVars().StmtCtx), nil - case *plan.PhysicalIndexLookUpReader: - indexScan := v.IndexPlans[0].(*plan.PhysicalIndexScan) - return indexScan.IsPointGetByUniqueKey(ctx.GetSessionVars().StmtCtx), nil case *plan.PhysicalTableReader: tableScan := v.TablePlans[0].(*plan.PhysicalTableScan) return len(tableScan.Ranges) == 1 && tableScan.Ranges[0].IsPoint(ctx.GetSessionVars().StmtCtx), nil diff --git a/executor/executor_test.go b/executor/executor_test.go index 3c873a09a1cca..f875f805a95a0 100644 --- a/executor/executor_test.go +++ b/executor/executor_test.go @@ -1784,7 +1784,8 @@ func (s *testSuite) TestPointGet(c *C) { tk.MustExec("use mysql") ctx := tk.Se.(sessionctx.Context) tests := map[string]bool{ - "select * from help_topic where name='aaa'": true, + "select 1 from help_topic where name='aaa'": true, + "select * from help_topic where name='aaa'": false, "select * from help_topic where help_topic_id=1": true, "select * from help_topic where help_category_id=1": false, } @@ -2440,7 +2441,7 @@ func (s *testContextOptionSuite) TestCoprocessorPriority(c *C) { cli.priority = pb.CommandPri_High tk.MustQuery("select id from t where id = 1") - tk.MustQuery("select * from t1 where id = 1") + tk.MustQuery("select 1 from t1 where id = 1") cli.priority = pb.CommandPri_Normal tk.MustQuery("select count(*) from t") @@ -2458,7 +2459,7 @@ func (s *testContextOptionSuite) TestCoprocessorPriority(c *C) { cli.priority = pb.CommandPri_High tk.MustQuery("select id from t where id = 1") - tk.MustQuery("select * from t1 where id = 1") + tk.MustQuery("select 1 from t1 where id = 1") cli.priority = pb.CommandPri_Low tk.MustQuery("select count(*) from t")