Skip to content

mysql-python loses anything past the first message #612

@sam-leonard-ct

Description

@sam-leonard-ct

Describe the bug

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');
""")

assert cursor.messages == [('[01000] (0)', '[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]hi')]

assert cursor.nextset()
# on mysql-python this second message is missing
assert cursor.messages == [('[01000] (0)', '[Microsoft][ODBC Driver 18 for SQL Server][SQL Server]ih')]

assert not cursor.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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinginADOtriage doneIssues that are triaged by dev team and are in investigation.

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions