@@ -100,7 +100,6 @@ const (
100100 numericCutSet = " \t \n \r "
101101)
102102
103-
104103type NumberTypeImpl_ struct {
105104 baseType query.Type
106105 displayWidth int
@@ -1008,8 +1007,8 @@ func convertToInt64(ctx context.Context, t NumberTypeImpl_, v interface{}) (int6
10081007 if err == nil {
10091008 return i , sql .InRange , nil
10101009 }
1011-
1012- // Check if MySQL string-to-number mode is enabled before trying full float parsing
1010+
1011+ // Check if MySQL string-to-number mode is enabled before trying full float parsing
10131012 if sqlCtx , ok := ctx .(* sql.Context ); ok && sql .ValidateStringToNumberMode (sqlCtx ) {
10141013 // Use MySQL-compatible integer parsing (no scientific notation)
10151014 s := mysqlIntNumre .FindString (originalV )
@@ -1021,7 +1020,7 @@ func convertToInt64(ctx context.Context, t NumberTypeImpl_, v interface{}) (int6
10211020 }
10221021 return 0 , sql .InRange , nil
10231022 }
1024-
1023+
10251024 // If that fails, try as a float and truncate it to integral (original behavior)
10261025 f , err := strconv .ParseFloat (v , 64 )
10271026 if err != nil {
@@ -1565,13 +1564,13 @@ func convertToFloat64(ctx context.Context, t NumberTypeImpl_, v interface{}) (fl
15651564 // Extract numeric prefix using appropriate regex
15661565 var extractedFloat float64
15671566 var s string
1568-
1567+
15691568 if sqlCtx , ok := ctx .(* sql.Context ); ok && sql .ValidateStringToNumberMode (sqlCtx ) {
15701569 s = mysqlFloatNumre .FindString (originalV )
15711570 } else {
15721571 s = numre .FindString (originalV )
15731572 }
1574-
1573+
15751574 if s != "" {
15761575 if f , parseErr := strconv .ParseFloat (strings .TrimSpace (s ), 64 ); parseErr == nil {
15771576 extractedFloat = f
0 commit comments