File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ type Config struct {
4646 ClientFoundRows bool // Return number of matching rows instead of rows changed
4747 ColumnsWithAlias bool // Prepend table alias to column names
4848 InterpolateParams bool // Interpolate placeholders into query string
49+ MultiStatements bool // Allow multiple statements in one query
4950 ParseTime bool // Parse time values to time.Time
5051 Strict bool // Return warnings as errors
5152}
@@ -235,6 +236,14 @@ func parseDSNParams(cfg *Config, params string) (err error) {
235236 return
236237 }
237238
239+ // multiple statements in one query
240+ case "multiStatements" :
241+ var isBool bool
242+ cfg .MultiStatements , isBool = readBool (value )
243+ if ! isBool {
244+ return errors .New ("invalid bool value: " + value )
245+ }
246+
238247 // time.Time parsing
239248 case "parseTime" :
240249 var isBool bool
Original file line number Diff line number Diff line change @@ -236,6 +236,10 @@ func (mc *mysqlConn) writeAuthPacket(cipher []byte) error {
236236 clientFlags |= clientSSL
237237 }
238238
239+ if mc .cfg .MultiStatements {
240+ clientFlags |= clientMultiStatements
241+ }
242+
239243 // User Password
240244 scrambleBuff := scramblePassword (cipher , []byte (mc .cfg .Passwd ))
241245
You can’t perform that action at this time.
0 commit comments