From a436418aec0f3e2265193bd29f7a3f782fd16947 Mon Sep 17 00:00:00 2001 From: Simon Fayer Date: Thu, 14 May 2026 17:40:31 +0100 Subject: [PATCH] feat: Add args parameter to allow for mysql parameterized queries --- src/DIRAC/Core/Utilities/MySQL.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DIRAC/Core/Utilities/MySQL.py b/src/DIRAC/Core/Utilities/MySQL.py index edf9a235025..79bf15cc73d 100755 --- a/src/DIRAC/Core/Utilities/MySQL.py +++ b/src/DIRAC/Core/Utilities/MySQL.py @@ -703,7 +703,7 @@ def _connect(self): return S_OK() @captureOptimizerTraces - def _query(self, cmd, *, conn=None, debug=True): + def _query(self, cmd, *, args=None, conn=None, debug=True): """ execute MySQL query command @@ -726,7 +726,7 @@ def _query(self, cmd, *, conn=None, debug=True): try: cursor = connection.cursor() - if cursor.execute(cmd): + if cursor.execute(cmd, args=args): res = cursor.fetchall() else: res = ()