@@ -176,7 +176,7 @@ func (mc *mysqlConn) escapeBytes(v []byte) string {
176
176
return "'" + string (escape (v )) + "'"
177
177
}
178
178
179
- func (mc * mysqlConn ) buildQuery (query string , args []driver.Value ) (string , error ) {
179
+ func (mc * mysqlConn ) interpolateParams (query string , args []driver.Value ) (string , error ) {
180
180
chunks := strings .Split (query , "?" )
181
181
if len (chunks ) != len (args )+ 1 {
182
182
return "" , driver .ErrSkip
@@ -196,7 +196,7 @@ func (mc *mysqlConn) buildQuery(query string, args []driver.Value) (string, erro
196
196
case int64 :
197
197
parts [pos ] = strconv .FormatInt (v , 10 )
198
198
case float64 :
199
- parts [pos ] = strconv .FormatFloat (v , 'f ' , - 1 , 64 )
199
+ parts [pos ] = strconv .FormatFloat (v , 'g ' , - 1 , 64 )
200
200
case bool :
201
201
if v {
202
202
parts [pos ] = "1"
@@ -242,7 +242,7 @@ func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, err
242
242
return nil , driver .ErrSkip
243
243
}
244
244
// try client-side prepare to reduce roundtrip
245
- prepared , err := mc .buildQuery (query , args )
245
+ prepared , err := mc .interpolateParams (query , args )
246
246
if err != nil {
247
247
return nil , err
248
248
}
@@ -293,7 +293,7 @@ func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, erro
293
293
return nil , driver .ErrSkip
294
294
}
295
295
// try client-side prepare to reduce roundtrip
296
- prepared , err := mc .buildQuery (query , args )
296
+ prepared , err := mc .interpolateParams (query , args )
297
297
if err != nil {
298
298
return nil , err
299
299
}
0 commit comments