Open ErikJansenIRefact opened 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Please do not close.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Do not close.
Please re-open.
Hello,
I encountered the same problem.
A temporary solution would be to ignore noData
and check the return of fetch().
So, this code :
while (!cursor.noData) {
const result = await cursor.fetch();
// use result here
}
can be written like this :
while(true) {
const result = await cursor.fetch();
if (result.length === 0) {
break;
}
// use result here
}
Describe your system
Describe the bug A prepared statement is created (a query) with a single parameter together with a bind for it's value. The prepared statement is executed as a cursor and an expected result is returned after which the cursor is closed.
A new bind value is passed to the statement and again the statement is executed as a cursor. In the second execute a result was expected but nothing was returned.
Expected behavior
To Reproduce
Code
Additional context
The logging of the result returned reveals something interesting: the value of the parameters property in the second execution reports a value [1] where a value 2 was bound. Nevertheless the query does not report a result (if the parameter would have had value 1 it still should have returned a record).
This is the console.log of the result object for the first and second statement:
First statement:
Second statement: