2
0

send simple query if no args

no need to parse and sanitize the sql string when no args.
This commit is contained in:
jinhua luo
2019-06-27 13:16:35 +08:00
committed by GitHub
parent a5afe697d1
commit c5be74ca4e
+4
View File
@@ -522,6 +522,10 @@ func (c *Conn) readUntilRowDescription() ([]FieldDescription, error) {
}
func (c *Conn) sanitizeAndSendSimpleQuery(sql string, args ...interface{}) (err error) {
if len(args) == 0 {
return c.sendSimpleQuery(sql)
}
if c.RuntimeParams["standard_conforming_strings"] != "on" {
return errors.New("simple protocol queries must be run with standard_conforming_strings=on")
}