diff --git a/enginetest/join_op_tests.go b/enginetest/join_op_tests.go index c39237f5ca..8c0d0b73d8 100644 --- a/enginetest/join_op_tests.go +++ b/enginetest/join_op_tests.go @@ -286,6 +286,10 @@ var joinOpTests = []struct { setup.XyData[0], }, tests: []JoinOpTests{ + { + Query: `SELECT * from xy join uv on x = u and y = NOW()`, + Expected: []sql.Row{}, + }, { Query: `SELECT xy.x, xy.y FROM xy diff --git a/sql/expression/function/time.go b/sql/expression/function/time.go index 06cd6852dd..375ace8255 100644 --- a/sql/expression/function/time.go +++ b/sql/expression/function/time.go @@ -929,6 +929,9 @@ func (n *Now) Children() []sql.Expression { return nil } // Eval implements the sql.Expression interface. func (n *Now) Eval(ctx *sql.Context, _ sql.Row) (interface{}, error) { + if ctx == nil { + return nil, fmt.Errorf("cannot Eval Now with nil context") + } t := ctx.QueryTime() // TODO: Now should return a string formatted depending on context. This code handles string formatting // and should be enabled at the time we fix the return type