You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mysql-python loses anything past the first message #612
mssql-python doesn't return anything after the first message
To reproduce
This is the minimum test case I could get to reproduce the bug, this script passes when cursor is from pyodbc, but not when cursor is from mysql-python.
cursor.execute("""PRINT('hi');PRINT('ih');""")
assertcursor.messages== [('[01000] (0)', '[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]hi')]
assertcursor.nextset()
# on mysql-python this second message is missingassertcursor.messages== [('[01000] (0)', '[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]ih')]
assertnotcursor.nextset()
Expected behavior
All messages from the operation should be returned via cursor.messages at some point before cursor.nextset() returns False, preferably in the order detailed in the above script.
Further technical details
Python version: 3.12.11
SQL Server version: SQL SERVER 2017
Operating system: macOS 26.5
We've triaged this and confirmed it's a bug. The root cause is that cursor.nextset() calls SQLMoreResults under the hood but doesn't check for SQL_SUCCESS_WITH_INFO to capture diagnostic messages (like PRINT output). The first PRINT is captured correctly by execute(), but any subsequent messages delivered via SQLMoreResults were silently dropped.
We've triaged this and confirmed it's a bug. The root cause is that cursor.nextset() calls SQLMoreResults under the hood but doesn't check for SQL_SUCCESS_WITH_INFO to capture diagnostic messages (like PRINT output). The first PRINT is captured correctly by execute(), but any subsequent messages delivered via SQLMoreResults were silently dropped.
Sam Leonard (@sam-leonard-ct) We have merged the PR and it this bug will be resolved in our next release. Thank you for detecting bug and helping us improve our driver. Keep trying out our driver!
Activity
github-actions commentedon Jun 1, 2026
Hi Sam Leonard (@sam-leonard-ct), thank you for opening this issue!
Our team will review it shortly. We aim to triage all new issues within 24-48 hours and get back to you.
If you have additional information to share, please feel free to update the issue.
Thank you for your patience!
jahnvi480 commentedon Jun 1, 2026
Thanks for the detailed report and repro, Sam Leonard (@sam-leonard-ct)!
We've triaged this and confirmed it's a bug. The root cause is that cursor.nextset() calls SQLMoreResults under the hood but doesn't check for SQL_SUCCESS_WITH_INFO to capture diagnostic messages (like PRINT output). The first PRINT is captured correctly by execute(), but any subsequent messages delivered via SQLMoreResults were silently dropped.
We'll have a PR up shortly with the fix.
sam-leonard-ct commentedon Jun 2, 2026
Awesome, thanks for the quick debugging!
FIX: Capture PRINT messages in nextset() via SQL_SUCCESS_WITH_INFO (G…
FIX: Capture PRINT messages in nextset() via SQL_SUCCESS_WITH_INFO (G…
FIX: Capture PRINT messages in nextset() via SQL_SUCCESS_WITH_INFO (G…
FIX: Capture PRINT messages in nextset() via SQL_SUCCESS_WITH_INFO (#618
jahnvi480 commentedon Jun 8, 2026
Sam Leonard (@sam-leonard-ct) We have merged the PR and it this bug will be resolved in our next release. Thank you for detecting bug and helping us improve our driver. Keep trying out our driver!
RELEASE:1.9.0 (#633)