Details
-
Bug
-
Resolution: Fixed
-
Major
-
7.6.2
-
Untriaged
-
0
-
Yes
Description
prepare p2 AS with aa AS ([1,2,3]) SELECT d, aa FROM [1,2] AS d;
|
Second execution of p2 losses value
execute p2;
|
{
|
"requestID": "0ea587d4-634d-4545-a833-427d2c6fe007",
|
"signature": {
|
"d": "json",
|
"aa": "json"
|
},
|
"results": [
|
{
|
"d": 1,
|
"aa": [
|
1,
|
2,
|
3
|
]
|
},
|
{
|
"d": 2,
|
"aa": [
|
1,
|
2,
|
3
|
]
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "681.667µs",
|
"executionTime": "542.625µs",
|
"resultCount": 2,
|
"resultSize": 186,
|
"serviceLoad": 2
|
}
|
}
|
cbq> execute p2;
|
{
|
"requestID": "8552a837-65cc-49b7-9c97-5fd712c8cd3a",
|
"signature": {
|
"d": "json",
|
"aa": "json"
|
},
|
"results": [
|
{
|
"d": 1,
|
"aa": [
|
null,
|
null,
|
null
|
]
|
},
|
{
|
"d": 2,
|
"aa": [
|
null,
|
null,
|
null
|
]
|
}
|
],
|
"status": "success",
|
"metrics": {
|
"elapsedTime": "724.75µs",
|
"executionTime": "566.292µs",
|
"resultCount": 2,
|
"resultSize": 204,
|
"serviceLoad": 2
|
}
|
}
|
It looks like constant construct expression (Array, Object). Which evaluate and store in value.
Later we return.
Problem with this is prepare (but can happen correlated subquries too)
At the end of execution, it might recycled (not sure where) and giving array of nil values, second execution of prepare statement.
https://github.com/couchbase/query/blob/master/execution/with.go#L96
If call here with.Expression().ResetValue() it re-evalaute constants. Or some how track if it is constant.
Attachments
Issue Links
- relates to
-
MB-61526 Delay in releasing memory to the OS after using a CTE
-
- Closed
-