mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Fix integer overflow for scene size on 32bit systems (#994)
* Fix integer overflow for scene size on 32bit systems * Cast to double in sqlite to prevent potential overflow * Add migration to reset scene sizes and scan logic to repopulate if empty
This commit is contained in:
@@ -332,16 +332,16 @@ func runCountQuery(query string, args []interface{}) (int, error) {
|
||||
return result.Int, nil
|
||||
}
|
||||
|
||||
func runSumQuery(query string, args []interface{}) (uint64, error) {
|
||||
func runSumQuery(query string, args []interface{}) (float64, error) {
|
||||
// Perform query and fetch result
|
||||
result := struct {
|
||||
Uint uint64 `db:"sum"`
|
||||
Float64 float64 `db:"sum"`
|
||||
}{0}
|
||||
if err := database.DB.Get(&result, query, args...); err != nil && err != sql.ErrNoRows {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return result.Uint, nil
|
||||
return result.Float64, nil
|
||||
}
|
||||
|
||||
func executeFindQuery(tableName string, body string, args []interface{}, sortAndPagination string, whereClauses []string, havingClauses []string) ([]int, int) {
|
||||
|
||||
Reference in New Issue
Block a user