View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0037315 | mantisbt | code cleanup | public | 2026-07-18 12:42 | 2026-07-18 12:44 |
| Reporter | dregad | Assigned To | dregad | ||
| Priority | normal | Severity | tweak | Reproducibility | N/A |
| Status | resolved | Resolution | fixed | ||
| Target Version | 2.29.0 | Fixed in Version | 2.29.0 | ||
| Summary | 0037315: Avoid SQL query duplication in bugnote API | ||||
| Description | Nearly identical SQL query is used both in bugnote_get_all_bugnotes() and in bugnote_exists(). It should be factored out. | ||||
| Tags | No tags attached. | ||||
|
MantisBT: master 70c90e79 2026-06-03 12:01 Details Diff |
Avoid duplicating SQL statement Nearly identical SQL query is used both in bugnote_get_all_bugnotes() and in bugnote_exists(). Define a constant to extract the common part, and use DbQuery to build the differing WHERE clause and ORDER BY. Add type declarations to bugnote_get_all_bugnotes(), so we don't need to cast $p_bug_id to int all the time. Fixes 0037315 |
Affected Issues 0037315 |
|
| mod - core/bugnote_api.php | Diff File | ||