1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-04-17 17:31:31 +00:00

mssql_script: only pass params to cursor.execute() when provided (#11754)

* mssql_script: only pass params to cursor.execute() when provided

Fixes #11699

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* mssql_script: add changelog fragment for PR #11754

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Alexei Znamensky 2026-04-09 05:36:39 +12:00 committed by GitHub
parent bdd3174563
commit b780224d6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -377,7 +377,10 @@ def run_module():
for query in queries:
# Catch and exit on any bad query errors
try:
cursor.execute(query, sql_params)
if sql_params:
cursor.execute(query, sql_params)
else:
cursor.execute(query)
qry_result = []
rows = cursor.fetchall()
while rows: