-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
sqlite: use Arc<> around StatementHandle instead of Copying it #1186
Conversation
This guarantees that StatementHandle is never used after calling `sqlite3_finalize`. Now `sqlite3_finalize` is only called when StatementHandle is dropped.
Otherwise some tests fail to close connection.
This is an attempt to fix persistent segfaults in |
let resp = match status { | ||
SQLITE_ROW => Ok(Either::Right(())), | ||
SQLITE_DONE => Ok(Either::Left(statement.changes())), | ||
_ => Err(statement.last_error().into()), | ||
}; | ||
resp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let resp = match status { | |
SQLITE_ROW => Ok(Either::Right(())), | |
SQLITE_DONE => Ok(Either::Left(statement.changes())), | |
_ => Err(statement.last_error().into()), | |
}; | |
resp | |
match status { | |
SQLITE_ROW => Ok(Either::Right(())), | |
SQLITE_DONE => Ok(Either::Left(statement.changes())), | |
_ => Err(statement.last_error().into()), | |
} |
resp | ||
} else { | ||
// Statement is already finalized. | ||
Err(Error::WorkerCrashed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strictly speaking, the worker didn't actually crash here. I'd consider a different error variant, maybe even a new one if none of the existing fit.
No description provided.