Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL: Nulls are returned when filtering with != #35233

Closed
matriv opened this issue Nov 4, 2018 · 1 comment
Closed

SQL: Nulls are returned when filtering with != #35233

matriv opened this issue Nov 4, 2018 · 1 comment

Comments

@matriv
Copy link
Contributor

matriv commented Nov 4, 2018

SELECT POSITION('x',LCASE("first_name")) pos, "first_name" FROM "test_emp" WHERE POSITION('x',LCASE("first_name")) != 0;

Returns:

      pos:i    |  first_name:s
---------------+---------------
4              |Guoxiang       
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
null           |null           
1              |Xinglin  

but it should be evaluated as null !=0 => null and because it's in the WHERE it should become false

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

matriv added a commit to matriv/elasticsearch that referenced this issue Nov 4, 2018
Add NotEquals node in parser to simplify expressions so that <value1> != <value2> is
no longer translated internally to NOT(<value1> = <value2>)

Closes: elastic#35210
Fixes: elastic#35233
matriv pushed a commit that referenced this issue Nov 5, 2018
Add NotEquals node in parser to simplify expressions so that <value1> != <value2> is
no longer translated internally to NOT(<value1> = <value2>)

Closes: #35210
Fixes: #35233
matriv pushed a commit that referenced this issue Nov 5, 2018
Add NotEquals node in parser to simplify expressions so that <value1> != <value2> is
no longer translated internally to NOT(<value1> = <value2>)

Closes: #35210
Fixes: #35233
matriv pushed a commit that referenced this issue Nov 5, 2018
Add NotEquals node in parser to simplify expressions so that <value1> != <value2> is
no longer translated internally to NOT(<value1> = <value2>)

Closes: #35210
Fixes: #35233
@colings86 colings86 added v6.5.0 and removed v6.5.1 labels Nov 9, 2018
@jimczi jimczi added v7.0.0-beta1 and removed v7.0.0 labels Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants