0037315: Avoid SQL query duplication in bugnote API - MantisBT

View Issue Details

IDProjectCategoryView StatusDate SubmittedLast Update
0037315mantisbtcode cleanuppublic2026年07月18日 12:422026年07月18日 12:44
Reporterdregad Assigned Todregad  
PrioritynormalSeveritytweakReproducibilityN/A
Status resolvedResolutionfixed 
Target Version2.29.0Fixed in Version2.29.0 
Summary0037315: 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.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 70c90e79

2026年06月03日 12:01

dregad


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
Powered by MantisBT 2.29.0-dev-master-e4ff7ef87
Copyright © 2000 - 2026 MantisBT Team
Contact administrator for assistance
Page execution time: 0.2924 seconds    

AltStyle によって変換されたページ (->オリジナル) /