-
Notifications
You must be signed in to change notification settings - Fork 190
[BUG] Boolean fields aren't applied as filters in WHERE clauses #3317
Copy link
Copy link
Closed
Labels
SQLbugSomething isn't workingSomething isn't workingdynamic-testIssues found by or related to Dynamic TestingIssues found by or related to Dynamic Testingengine v2Issues related to v2 query engine only.Issues related to v2 query engine only.
Description
What is the bug?
Building on #3266, it turns out that variables as boolean clauses aren't applied correctly at all.
How can one reproduce the bug?
PUT test_index
POST _bulk
{ "create": { "_index": "test_index" } }
{ "x": 0, "y": false }
{ "create": { "_index": "test_index" } }
{ "x": 1, "y": true }
{ "create": { "_index": "test_index" } }
{ "x": 2, "y": null }
POST _plugins/_sql
{
"query": "SELECT x FROM test_index WHERE y"
}
{
"schema": [
{
"name": "x",
"type": "long"
}
],
"datarows": [
[0], [1], [2]
],
"total": 3,
"size": 3,
"status": 200
}What is the expected behavior?
{
"schema": [
{
"name": "x",
"type": "long"
}
],
"datarows": [
[1]
],
"total": 1,
"size": 1,
"status": 200
}What is your host/environment?
- Commit 1284c12
Do you have any screenshots?
N/A
Do you have any additional context?
Found by dynamic-testing via NoREC. Original failure:
Falsified after 0 passed tests.
> Labels of failing property:
39 != 15
Optimizing: SELECT j FROM test_34761613 WHERE z
Non-Optimizing: SELECT z FROM test_34761613
> ARG_0: SELECT j, k FROM test_34761613 WHERE z
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
SQLbugSomething isn't workingSomething isn't workingdynamic-testIssues found by or related to Dynamic TestingIssues found by or related to Dynamic Testingengine v2Issues related to v2 query engine only.Issues related to v2 query engine only.
Type
Projects
Status
Done