compare returns a DAG expression for a standard comparison operator but uses a call to the SuperSQL function "compare()" as standard comparisons do not handle nullsmax or cross-type comparisons (which can arise when the pool key value type changes).
(op string, lhs, rhs dag.Expr)
| 114 | // do not handle nullsmax or cross-type comparisons (which can arise when the |
| 115 | // pool key value type changes). |
| 116 | func compare(op string, lhs, rhs dag.Expr) *dag.BinaryExpr { |
| 117 | nullsMax := &dag.PrimitiveExpr{Kind: "PrimitiveExpr", Value: "true"} |
| 118 | call := dag.NewCall("compare", []dag.Expr{lhs, rhs, nullsMax}) |
| 119 | return dag.NewBinaryExpr(op, call, &dag.PrimitiveExpr{Kind: "PrimitiveExpr", Value: "0"}) |
| 120 | } |
| 121 | |
| 122 | func literalComparison(e *dag.BinaryExpr) (*dag.ThisExpr, *dag.PrimitiveExpr, string) { |
| 123 | switch lhs := e.LHS.(type) { |
no test coverage detected