Details
-
Bug
-
Resolution: Not a Bug
-
Critical
-
None
-
7.1.0
-
None
-
Untriaged
-
1
-
Unknown
Description
Please refer to the following patch where the javascript runner is correctly passing named arguments of type udf.Value to context.OpenStatement() as per contract:
http://review.couchbase.org/c/eventing-ee/+/164329
- The call to OpenStatement does not return error which means query has been prepared and registered.
- However, when we call handle.NextDocument() query returns the following error:
Evaluator error Exceptions from JS code : run queryselect failed:\nException: Error: Error evaluating LIMIT - cause: No value for named parameter $boolval (near line 1, column 36).
|
This can also be reproduced via the following:
Create a new Javascript UDF with the following definition:
function queryselect(rowlimit) {
|
var query = SELECT * from `travel-sample` LIMIT $rowlimit;
|
var acc = [];
|
for (const row of query) {
|
acc.push(row);
|
}
|
return acc;
|
}
|
Create a function as follows:
create function math2queryselect(rowlimit) language javascript as "queryselect" at "math2";
|
And execute this statement:
EXECUTE FUNCTION math2queryselect(100);
|
Error:
No value for named parameter $rowlimit