New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: support sig push down in mocktikv. #4364

Merged
merged 6 commits into from Aug 30, 2017

Conversation

Projects
None yet
3 participants
@hanfei1991
Member

hanfei1991 commented Aug 29, 2017

No description provided.

if pc.client.IsRequestTypeSupported(kv.ReqTypeDAG, kv.ReqSubTypeSignature) {
code := expr.Function.PbCode()
if code > 0 {
return &tipb.Expr{Tp: tipb.ExprType_ScalarFunc, Sig: &code, Children: children, FieldType: toPBFieldType(expr.RetType)}

This comment has been minimized.

@zz-jason

zz-jason Aug 30, 2017

Member

code is a int32 value, it's not suitable to escape this local variable to be allocated on heap and keep a reference of it. we can change the pb or let Sig point to a global variable.

@zz-jason

zz-jason Aug 30, 2017

Member

code is a int32 value, it's not suitable to escape this local variable to be allocated on heap and keep a reference of it. we can change the pb or let Sig point to a global variable.

This comment has been minimized.

@hanfei1991

hanfei1991 Aug 30, 2017

Member

you are right. I will change this to a value in another pr

@hanfei1991

hanfei1991 Aug 30, 2017

Member

you are right. I will change this to a value in another pr

@@ -497,13 +497,11 @@ func (c *arithmeticDivideFunctionClass) getFunction(args []Expression, ctx conte
bf := newBaseBuiltinFuncWithTp(args, ctx, tpReal, tpReal, tpReal)
c.setType4DivReal(bf.tp)
sig := &builtinArithmeticDivideRealSig{baseRealBuiltinFunc{bf}}
sig.setPbCode(tipb.ScalarFuncSig_MultiplyReal)

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Aug 30, 2017

Contributor

forget to setPbCode(ipb.ScalarFuncSig_DivReal) ?

@XuHuaiyu

XuHuaiyu Aug 30, 2017

Contributor

forget to setPbCode(ipb.ScalarFuncSig_DivReal) ?

This comment has been minimized.

@hanfei1991

hanfei1991 Aug 30, 2017

Member

There is not this sig in pb

@hanfei1991

hanfei1991 Aug 30, 2017

Member

There is not this sig in pb

return sig.setSelf(sig), nil
}
bf := newBaseBuiltinFuncWithTp(args, ctx, tpDecimal, tpDecimal, tpDecimal)
c.setType4DivDecimal(bf.tp, tpA, tpB)
sig := &builtinArithmeticDivideDecimalSig{baseDecimalBuiltinFunc{bf}}
sig.setPbCode(tipb.ScalarFuncSig_MultiplyDecimal)

This comment has been minimized.

@XuHuaiyu

XuHuaiyu Aug 30, 2017

Contributor

ditto

@XuHuaiyu

XuHuaiyu Aug 30, 2017

Contributor

ditto

@XuHuaiyu

This comment has been minimized.

Show comment
Hide comment
@XuHuaiyu

XuHuaiyu Aug 30, 2017

Contributor

LGTM

Contributor

XuHuaiyu commented Aug 30, 2017

LGTM

@zz-jason

LGTM

@hanfei1991 hanfei1991 added status/LGT2 and removed status/LGT1 labels Aug 30, 2017

@hanfei1991 hanfei1991 merged commit d739d7f into master Aug 30, 2017

2 of 3 checks passed

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
ci/circleci Your tests passed on CircleCI!
Details
license/cla Contributor License Agreement is signed.
Details

@hanfei1991 hanfei1991 deleted the hanfei/push branch Aug 30, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment