Skip to content

Commit

Permalink
test(database/sql): Incorrect conversion between integer types
Browse files Browse the repository at this point in the history
  • Loading branch information
searKing committed May 7, 2024
1 parent df92b02 commit 101bd42
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions third_party/github.com/golang/go/database/sql/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (db *DB) GetDatabase() (*sqlx.DB, error) {

maxConns := maxParallelism() * 2
if v := query.Get("max_conns"); v != "" {
s, err := strconv.ParseInt(v, 10, 64)
s, err := strconv.ParseInt(v, 10, 32)
if err != nil {
logger.Warn(fmt.Sprintf(`Query parameter "max_conns" value %v could not be parsed to int, falling back to default value %d`, v, maxConns), slog_.Error(err))
} else {
Expand All @@ -157,7 +157,7 @@ func (db *DB) GetDatabase() (*sqlx.DB, error) {

maxIdleConns := maxParallelism()
if v := query.Get("max_idle_conns"); v != "" {
s, err := strconv.ParseInt(v, 10, 64)
s, err := strconv.ParseInt(v, 10, 32)
if err != nil {
logger.Warn(fmt.Sprintf("max_idle_conns value %s could not be parsed to int: %s", v, err))
logger.Warn(fmt.Sprintf(`Query parameter "max_idle_conns" value %v could not be parsed to int, falling back to default value %d`, v, maxIdleConns), slog_.Error(err))
Expand Down

0 comments on commit 101bd42

Please sign in to comment.