Commit cbd9900c authored by gwenn's avatar gwenn

Ensure stmts are finalized without error.

parent 786dc13f
...@@ -233,7 +233,9 @@ func (c *Conn) Exec(cmd string, args ...interface{}) os.Error { ...@@ -233,7 +233,9 @@ func (c *Conn) Exec(cmd string, args ...interface{}) os.Error {
} else if s.stmt == nil { } else if s.stmt == nil {
// this happens for a comment or white-space // this happens for a comment or white-space
cmd = s.tail cmd = s.tail
s.Finalize() if err = s.Finalize(); err != nil {
return err
}
continue continue
} }
err = s.Exec(args...) err = s.Exec(args...)
...@@ -248,7 +250,9 @@ func (c *Conn) Exec(cmd string, args ...interface{}) os.Error { ...@@ -248,7 +250,9 @@ func (c *Conn) Exec(cmd string, args ...interface{}) os.Error {
} }
} }
cmd = s.tail cmd = s.tail
s.Finalize() if err = s.Finalize(); err != nil {
return err
}
} }
return nil return nil
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment