Skip to content

Commit

Permalink
expression: Make UUID() a dynamic function (pingcap#3207)
Browse files Browse the repository at this point in the history
  • Loading branch information
shenli authored and hanfei1991 committed May 4, 2017
1 parent 1a67dd5 commit ab25fa9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion expression/builtin_miscellaneous.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,10 @@ type uuidFunctionClass struct {
}

func (c *uuidFunctionClass) getFunction(args []Expression, ctx context.Context) (builtinFunc, error) {
return &builtinUUIDSig{newBaseBuiltinFunc(args, ctx)}, errors.Trace(c.verifyArgs(args))
err := errors.Trace(c.verifyArgs(args))
bt := &builtinUUIDSig{newBaseBuiltinFunc(args, ctx)}
bt.deterministic = false
return bt, errors.Trace(err)
}

type builtinUUIDSig struct {
Expand Down
1 change: 1 addition & 0 deletions expression/evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ func (s *testEvaluatorSuite) TestDynamic(c *C) {
ast.SessionUser: 0,
ast.SystemUser: 0,
ast.RowCount: 0,
ast.UUID: 0,
}
for name, fc := range funcs {
f, _ := fc.getFunction(nil, s.ctx)
Expand Down

0 comments on commit ab25fa9

Please sign in to comment.