fix(db): use int for netspeed_active to prevent overflow
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
GetZoneStatsData and GetZoneStatsV2's netspeed_active values can exceed 2 billion, causing 32-bit integer overflow. Changed from int32/uint32 to int (64-bit on modern systems) to handle large network speed totals. - Update sqlc column overrides to use int type - Fix type compatibility in dnsanswers.go zoneTotals map - Regenerate database code with new types Fixes https://community.ntppool.org/t/error-message-displayed-on-the-monitoring-score-page/4063
This commit is contained in:
@@ -18,4 +18,8 @@ sql:
|
||||
- column: log_scores.attributes
|
||||
go_type: go.ntppool.org/common/types.LogScoreAttributes
|
||||
- column: "server_netspeed.netspeed_active"
|
||||
go_type: "uint64"
|
||||
go_type: "int"
|
||||
- column: "zone_server_counts.netspeed_active"
|
||||
go_type: "int"
|
||||
- db_type: "bigint"
|
||||
go_type: "int"
|
||||
|
||||
Reference in New Issue
Block a user