-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
"another row available" error for single row query #709
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
Comments
I print stack, which shows below. Keep debugging
|
Lines 157 to 167 in 31f5bb8
This library unconditionally assigns to info.DBError when preparing the trace callback. The SQLite documentation doesn't actually specify what you get back from sqlite3_errcode , etc. if the last call didn't fail, but from the look of things, it's giving back the last result code, which in this case was SQLITE_ROW . (From your stack trace, I'm assuming what happened was you called QueryRowContext . That in turn called sqlite3_step , which returned SQLITE_ROW , and then called sqlite3_reset , which invoked the trace callback. Thus sqlite3_reset hasn't actually finished yet, which is why we get SQLITE_ROW from the previous call to sqlite3_step , instead of SQLITE_OK , which sqlite3_reset is going to return.)
https://github.com/leslie-wang/samples/blob/49dc0e7f45df687974899879da0f30fd5d806cb4/go-sqlite3/main.go#L19 @mattn I assume the proper fix for this library would be to only assign to Lines 79 to 84 in 31f5bb8
|
@rittneje Thanks for the detail explanation. |
Probably similiar with #681. It also show
another row available
. It can show up with below simple codes. You can also check source codes at https://github.com/leslie-wang/samples/blob/master/go-sqlite3/main.go.Got below output.
I'm mostly concerned about the line which should not be an error.
The text was updated successfully, but these errors were encountered: