Jelajahi Sumber

fix: fix return wrong error object (#2228)

Signed-off-by: Song Gao <disxiaofei@163.com>
Song Gao 1 tahun lalu
induk
melakukan
bd2e83858b
1 mengubah file dengan 3 tambahan dan 2 penghapusan
  1. 3 2
      internal/xsql/valuer.go

+ 3 - 2
internal/xsql/valuer.go

@@ -777,9 +777,10 @@ func (v *ValuerEval) simpleDataEval(lhs, rhs interface{}, op ast.Token) interfac
 	// Evaluate if both sides are simple types.
 	switch lhs := lhs.(type) {
 	case bool:
-		rhs, ok := rhs.(bool)
+		originRHS := rhs
+		rhs, ok := originRHS.(bool)
 		if !ok {
-			return invalidOpError(lhs, op, rhs)
+			return invalidOpError(lhs, op, originRHS)
 		}
 		switch op {
 		case ast.AND: