generate the following sql
Oracle treats '' as NULL, so expression something <> '' is trivial false due to Oracle's rule that nothing can be equal or not equal to NULL.
Hi @flamber
Yes, its my case. Upvoted.
By the way, the last post in that topic, makes me fill that you probable incorrectly indentify rootcause.
For Oracle:
WHERE ("PUBLIC"."PRODUCTS"."CATEGORY" IS NOT NULL AND "PUBLIC"."PRODUCTS"."CATEGORY" <> '') is always empty set
"PUBLIC"."PRODUCTS"."CATEGORY" <> '' is always false.
Hi @flamber
It looks that problem is related to query_proccessor/ correct-null-behaviour.
(defn- correct-null-behaviour
[driver [op & args]]
(let [field-arg (mbql.u/match-one args
FieldInstance &match
:field &match)]
;; We must not transform the head again else we'll have an infinite loop
;; (and we can't do it at the call-site as then it will be harder to fish out field references)
[:or (into [op] (map (partial ->honeysql driver)) args)
[ := (->honeysql driver field-arg) nil]]))
1.:= used for "=" and "!=" , I guess should be somthig like this
[op (->honeysql driver field-arg) nil]]))
2. it looks like correct-null-behaviour executed for any expression.
generates sql
Not error, but looks a bit strange