Commit b2c37cab authored by gwenn's avatar gwenn

Simplify Exec method.

parent e2d13510
...@@ -73,9 +73,9 @@ func (e *ConnError) Filename() string { ...@@ -73,9 +73,9 @@ func (e *ConnError) Filename() string {
func (e *ConnError) Error() string { // FIXME code.Error() & e.msg are often redundant... func (e *ConnError) Error() string { // FIXME code.Error() & e.msg are often redundant...
if len(e.details) > 0 { if len(e.details) > 0 {
return fmt.Sprintf("%s: %s (%s)", e.code.Error(), e.msg, e.details) return fmt.Sprintf("%s; %s (%s)", e.code.Error(), e.msg, e.details)
} else if len(e.msg) > 0 { } else if len(e.msg) > 0 {
return fmt.Sprintf("%s: %s", e.code.Error(), e.msg) return fmt.Sprintf("%s; %s", e.code.Error(), e.msg)
} }
return e.code.Error() return e.code.Error()
} }
...@@ -319,9 +319,6 @@ func (c *Conn) Exec(cmd string, args ...interface{}) error { ...@@ -319,9 +319,6 @@ func (c *Conn) Exec(cmd string, args ...interface{}) 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
if err = s.finalize(); err != nil {
return err
}
continue continue
} }
err = s.Exec(args...) err = s.Exec(args...)
......
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