View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0025781 | mantisbt | reports | public | 2019-05-22 08:11 | 2019-06-14 02:39 |
Reporter | mchendl | Assigned To | cproensa | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.21.0 | ||||
Target Version | 2.21.1 | Fixed in Version | 2.21.1 | ||
Summary | 0025781: Summary statistics db error message | ||||
Description | After upgrading from 2.12.0 to 2.21.0 the summary stats without filters doesn't work anymore: DB error message. I saw 0025693 and the other features introduced in 2.20.0. | ||||
Steps To Reproduce |
| ||||
Additional Information | APPLICATION ERROR 0000401 Datenbankabfrage fehlgeschlagen. Die Reportmeldung lautet 0008115: SQLState: 22003 | ||||
Tags | No tags attached. | ||||
Please check your manage overview page, what database driver does it show? That query runs fine in my tests: |
|
So you say, that this error happens when a big number of issues are included in the summary, and with fewer issues (when filtered), it works ok? Please can you test this modification: |
|
Database driver "mssqlnative" with mssql ODBC Driver 13. Our db_stats: |
|
my guess is that sum() overflows the default datatype, that's the reason for trying |
|
looks like AVG() is also affected @mchendl, please try this modification: |
|
Looks great! It works like a charm! |
|
I merged the PR, and cherry-picked the commit onto 2.21 since it's a regression introduced by that version. |
|
MantisBT: master 49539f33 2019-05-30 02:04 Committer: dregad Details Diff |
Fix mssql summary error 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 0025781 PR https://github.com/mantisbt/mantisbt/pull/1516 |
Affected Issues 0025781 |
|
mod - core/summary_api.php | Diff File | ||
MantisBT: master-2.21 5bade1d5 2019-05-30 02:04 Committer: dregad Details Diff |
Fix mssql summary error 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 0025781 PR https://github.com/mantisbt/mantisbt/pull/1516 |
Affected Issues 0025781 |
|
mod - core/summary_api.php | Diff File |