Skip to content

Fix another instance of the SQL UNION concatenation bug from PR 803 - #804

Merged
EdwardKaravakis merged 2 commits into
masterfrom
fix-jumbo-affected-inputs-union
Sep 24, 2026
Merged

EdwardKaravakis merged 2 commits into
masterfrom
fix-jumbo-affected-inputs-union

Conversation

@EdwardKaravakis

Copy link
Copy Markdown
Member

Same pattern as PR #803: a plain = instead of += silently discards the first half of a UNION query. This instance is in the jumbo-job branch of building the "affected inputs" query for lost PandaIDs - only the second, more restrictive query (modificationTime>CURRENT_TIMESTAMP-365) ever actually ran, so affected input files older than 365 days were silently excluded from the file-status-update logic.

Found by scanning the codebase for the same bug shape after PR #803. Checked the rest of the codebase for similar cases - found a few other candidates with the same surface pattern (var reassigned with = after previously using +=), but all of those turned out to be legitimate (separate if/else branches, or a fresh unrelated string reusing a generic variable name) after checking each by hand. This is the only other real instance.

Same pattern as PR #803: a plain = instead of += silently discarded
the first half of a UNION query building the list of affected input
files for lost jumbo-job PandaIDs. Only the second, more restrictive
query (modificationTime>CURRENT_TIMESTAMP-365) was ever actually run,
so affected input files older than 365 days were silently excluded
from the file-status-update logic.

Found by scanning the codebase for the same bug shape after PR 803.
Comment thread pandaserver/taskbuffer/db_proxy_mods/misc_standalone_module.py Outdated
… review

The second query was pointing at the same live filesTable4 table as
the first, just with an added modificationTime filter - a strict
subset of the first query, which would have made the UNION pointless
even with += fixed. Tadashi correctly identified it should query
ATLAS_PANDAARCH.filesTable_ARCH instead, matching the established
convention used elsewhere (task_event_module.py, task_standalone_module.py)
for combining live and recently-archived file records.
@EdwardKaravakis
EdwardKaravakis merged commit 8a357e2 into master Sep 24, 2026
1 check passed
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