Description
In 4.5.1 This query changes LET expression MISSING to NULL and causes wrong results.
In spock this even raises error saying "Duplicate variable o already in scope."
CREATE INDEX ix1 on default(x1);
|
INSERT INTO default VALUES ("k01",{"x1":5, "type":"doc", "x2": "abc"}), ("k02",{"x1":5, "type":"d", "x2": "def"});
|
EXPLAIN SELECT x1, x2 FROM default o LET o = CASE WHEN o.type = "doc" THEN o ELSE MISSING END WHERE x1 = 5;
|
|
{
|
"#operator": "Let",
|
"bindings": [
|
{
|
"expr": "case when ((`o`.`type`) = \"doc\") then `o` else null end",
|
"var": "o"
|
}
|
]
|
},
|
|
explain SELECT x1, x2 FROM default o LET o = MISSING WHERE x1 = 5;
|
{
|
"#operator": "Let",
|
"bindings": [
|
{
|
"expr": "null",
|
"var": "o"
|
}
|
]
|
}
|
Executing same query returns two documents instead of one or zero.
Attachments
Issue Links
- blocks
-
MB-22188 4.6.2 Minor Release
- Closed