Skip to content

Commit

Permalink
Merge branch 'master' into tests-stable
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta authored Mar 31, 2021
2 parents 2d4b4b6 + 51a5a3d commit 15885ee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions executor/tiflash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ func (s *tiflashTestSuite) TestMppExecution(c *C) {
tk.MustQuery("select t1.c1 from t t1 join t t2 on t1.c1 = t2.c1 order by t1.c1").Check(testkit.Rows("1.00000", "1.00001", "1.00010"))
tk.MustQuery("select t1.c1 from t t1 join t t2 on t1.c1 = t2.c3 order by t1.c1").Check(testkit.Rows("1.00000", "1.00000", "1.00010"))
tk.MustQuery("select t1.c4 from t t1 join t t2 on t1.c4 = t2.c3 order by t1.c4").Check(testkit.Rows("1.0000", "1.0000", "1.0001"))
// let this query choose hash join
tk.MustQuery("select /*+ nth_plan(2) */ t1.c1 from t t1 join t t2 on t1.c1 = t2.c3 order by t1.c1").Check(testkit.Rows("1.00000", "1.00000", "1.00010"))
}

func (s *tiflashTestSuite) TestInjectExtraProj(c *C) {
Expand Down
2 changes: 1 addition & 1 deletion planner/core/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ func (ds *DataSource) findBestTask(prop *property.PhysicalProperty, planCounter
return
}
if prop.CanAddEnforcer {
prop = oldProp
*prop = *oldProp
t = enforceProperty(prop, t, ds.basePlan.ctx)
prop.CanAddEnforcer = true
}
Expand Down
3 changes: 3 additions & 0 deletions planner/core/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,9 @@ func (p *PhysicalHashJoin) convertDecimalKeyIfNeed(lTask, rTask *mppTask) (*mppT
rProj = getProj(p.ctx, rp)
rp = rProj
}
newEqCondition := make([]*expression.ScalarFunction, 0, len(p.EqualConditions))
newEqCondition = append(newEqCondition, p.EqualConditions...)
p.EqualConditions = newEqCondition
lKeys := make([]*expression.Column, 0, len(p.EqualConditions))
rKeys := make([]*expression.Column, 0, len(p.EqualConditions))
for i, eqFunc := range p.EqualConditions {
Expand Down
7 changes: 6 additions & 1 deletion store/mockstore/mocktikv/mvcc_leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ func (mvcc *MVCCLevelDB) MvccGetByStartTS(starTS uint64) (*kvrpcpb.MvccInfo, []b
iter.Next()
}

return mvcc.MvccGetByKey(key), key
return mvcc.mvccGetByKeyNoLock(key), key
}

var valueTypeOpMap = [...]kvrpcpb.Op{
Expand All @@ -1684,6 +1684,11 @@ func (mvcc *MVCCLevelDB) MvccGetByKey(key []byte) *kvrpcpb.MvccInfo {
mvcc.mu.RLock()
defer mvcc.mu.RUnlock()

return mvcc.mvccGetByKeyNoLock(key)
}

// mvcc.mu.RLock must be held before calling mvccGetByKeyNoLock.
func (mvcc *MVCCLevelDB) mvccGetByKeyNoLock(key []byte) *kvrpcpb.MvccInfo {
info := &kvrpcpb.MvccInfo{}

startKey := mvccEncode(key, lockVer)
Expand Down

0 comments on commit 15885ee

Please sign in to comment.