Skip to content

[db] Move get_long from DB_BASE to DB_CONN - #7402

Merged
davidpanderson merged 1 commit into
BOINC:masterfrom
qixuancao:fix/issue-6972
Nov 11, 2026
Merged

davidpanderson merged 1 commit into
BOINC:masterfrom
qixuancao:fix/issue-6972

Conversation

@qixuancao

@qixuancao qixuancao commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #6972

Description of the Change

Move arbitrary scalar integer queries to DB_CONN alongside get_double. Update DB_BASE::max_id and DB_BASE::count to use their connection, keeping their public behavior and the scalar conversion unchanged.

Alternate Designs

Move the existing implementation rather than adding a second query helper or retaining table-specific ownership.

Release Notes

N/A

Validation

  • Repository source-code and trailing-whitespace checks passed.
  • git diff --check passed.
  • Repository call sites were checked for references to the moved method. Autotools generation, server configuration, and make -j2 -C db passed in a Debian container. A complete server build and live database integration test have not been verified.

AI assistance

Codex assisted with implementation review, fixes, validation, and preparation of this description. The submitter has confirmed personal review and verification of the complete changes. Validation limits are stated above.


Summary by cubic

Fixes #6972. Moves get_long from DB_BASE to DB_CONN so arbitrary scalar integer queries live alongside get_double. Updates DB_BASE::max_id and DB_BASE::count to call db->get_long, preserving their public behavior. get_long is no longer available on DB_BASE; any external callers must use db->get_long instead.

Written for commit 7db58f7. Summary will update on new commits.

View guided diff

Move arbitrary scalar integer queries to DB_CONN alongside get_double. Update DB_BASE::max_id and DB_BASE::count to use their connection, keeping their public behavior and the scalar conversion unchanged.

Refs: BOINC#6972
Assisted-by: Codex:gpt-6-astra
@qixuancao
qixuancao marked this pull request as ready for review October 30, 2026 10:15

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

View guided diff | Re-trigger cubic

@AenBleidd

Copy link
Copy Markdown
Member

@davidpanderson, please review

@davidpanderson

Copy link
Copy Markdown
Contributor

What's the point of this change?

@qixuancao

Copy link
Copy Markdown
Contributor Author

This PR addresses #6972, which points out that get_long() performs arbitrary scalar queries and does not depend on the table-specific state in DB_BASE. Moving it to DB_CONN makes its ownership consistent with get_double().

The implementation and behavior are unchanged; the PR only moves the method and updates count() and max_id() to call it through their connection. This is a small API organization cleanup, not a functional bug fix or a performance improvement, so I agree its practical benefit is limited.

If you feel the API change isn't warranted for that benefit, I understand and can close the PR.

@github-project-automation github-project-automation Bot moved this from Backlog to Done in Server Nov 10, 2026
@github-project-automation github-project-automation Bot moved this from Done to TODO - Prioritized in Server Nov 11, 2026
@davidpanderson
davidpanderson merged commit 1091f90 into BOINC:master Nov 11, 2026
338 of 339 checks passed
@github-project-automation github-project-automation Bot moved this from TODO - Prioritized to Done in Server Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.64%. Comparing base (4d1529d) to head (7db58f7).
⚠️ Report is 85 commits behind head on master.

Files with missing lines Patch % Lines
db/db_base.cpp 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7402      +/-   ##
==========================================
- Coverage   13.08%   12.64%   -0.44%     
==========================================
  Files         237      238       +1     
  Lines       34439    36979    +2540     
  Branches     7752     9103    +1351     
==========================================
+ Hits         4507     4677     +170     
- Misses      29864    32233    +2369     
- Partials       68       69       +1     
Files with missing lines Coverage Δ
db/db_base.h 0.00% <ø> (ø)
db/db_base.cpp 0.72% <0.00%> (-0.04%) ⬇️

... and 25 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

DB API: wrong class for get_long()

3 participants