Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mssql summary error #1516

Merged
merged 2 commits into from
May 30, 2019
Merged

Conversation

cproensa
Copy link
Contributor

When computing SUM, AVG, functions, sqlserver uses the column
datatype, which is INT. This datatype can be overflowed when a big
number of issues are included, since we are adding the total number
of seconds.
In that case, use an explicit cast to BIGINT to avoid that error.
Other databases are not affected becasue they use a runtime data
type allowing bigger integers.

Fixes: #25781

When computing SUM, AVG, functions, sqlserver uses the column
datatype, which is INT. This datatype can be overflowed when a big
number of issues are included, since we are adding the total number
of seconds.
In that case, use an explicit cast to BIGINT to avoid that error.
Other databases are not affected becasue they use a runtime data
type allowing bigger integers.

Fixes: #25781
Initialize the stats array to zero, for the case when there aren't
any issue, to still return a properly formatted value array.
@dregad dregad merged commit 49539f3 into mantisbt:master May 30, 2019
dregad pushed a commit that referenced this pull request May 30, 2019
When computing SUM & AVG functions, sqlserver uses the column
datatype, which is INT. This datatype can be overflowed when a big
number of issues are included, since we are adding the total number
of seconds.

In that case, use an explicit cast to BIGINT to avoid that error.
Other databases are not affected because they use a runtime data
type allowing bigger integers.

The stats array is initialized to zero, to return a properly formatted 
value array when there aren't any issues.

Fixes #25781
PR #1516
CasN pushed a commit to CasN/mantisbt that referenced this pull request Aug 29, 2022
When computing SUM & AVG functions, sqlserver uses the column
datatype, which is INT. This datatype can be overflowed when a big
number of issues are included, since we are adding the total number
of seconds.

In that case, use an explicit cast to BIGINT to avoid that error.
Other databases are not affected because they use a runtime data
type allowing bigger integers.

The stats array is initialized to zero, to return a properly formatted 
value array when there aren't any issues.

Fixes #25781
PR mantisbt#1516
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants