Fix another instance of the SQL UNION concatenation bug from PR 803 - #804
Merged
Merged
Conversation
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.
tmaeno
reviewed
Sep 24, 2026
… 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.
tmaeno
approved these changes
Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.