Reset the state after Cursor’s bind

This commit is contained in:
Ivan Ukhov
2015-08-03 17:28:48 -04:00
parent 0e41f32222
commit c5efaedc73
2 changed files with 6 additions and 2 deletions

View File

@ -11,6 +11,7 @@ pub struct Cursor<'l> {
impl<'l> Cursor<'l> {
/// Bind values to all parameters.
pub fn bind(&mut self, values: &[Value]) -> Result<()> {
self.state = None;
try!(self.statement.reset());
for (i, value) in values.iter().enumerate() {
try!(self.statement.bind(i + 1, value));