-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Prepared statement with cursor does not return result in second call with new bind. #330
Comments
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. 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:
The text was updated successfully, but these errors were encountered: