Skip to content

[int] Parameterise SQL in FileManager#8704

Merged
fstagni merged 1 commit into
DIRACGrid:integrationfrom
sfayer:fix_dms_filemgr
Jul 13, 2026
Merged

[int] Parameterise SQL in FileManager#8704
fstagni merged 1 commit into
DIRACGrid:integrationfrom
sfayer:fix_dms_filemgr

Conversation

@sfayer

@sfayer sfayer commented Jul 12, 2026

Copy link
Copy Markdown
Member

It seems I missed this commit when I prepared the last batch of them... (Part of #8547).

BEGINRELEASENOTES
*DataManagement
FIX: Parameterise SQL in FileManager
ENDRELEASENOTES

@fstagni fstagni merged commit 1cabef6 into DIRACGrid:integration Jul 13, 2026
23 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Jul 13, 2026
chrisburr added a commit that referenced this pull request Jul 13, 2026
Three defects introduced when FileManager.py was parameterised (PR #8704):

- _findFileIDs: the per-directory clause opened '( DirID=%s AND FileName
  IN (' but only closed the IN list, leaving the outer parenthesis
  unbalanced once clauses were OR-joined -> syntax error on every lookup
  (breaks getReplicas and any LFN->FileID resolution).
- _getRepIDsForReplica: '(FileID,SEID) IN (' was filled with
  ','.join(['%s,%s']*n), yielding a flat scalar list 'IN (1,2,3,4)'
  against a 2-column row constructor -> MySQL error 1241. Use
  '(%s,%s)' groups so it renders 'IN ((1,2),(3,4))', and guard the
  empty-input case.
- __getFileIDReplicas: 'args = fileIDs' aliased the caller's list and
  args.extend(statusIDs) mutated it, so the backfill in _getFileReplicas
  inserted status ids as bogus FileID keys -> KeyError in getReplicas.
  Copy the list before extending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants