Skip to content

mysql-python loses anything past the first message #612

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: api-compliancePython API behavior and typing: DB-API 2.0, exceptions, type stubs, new APIs.bugSomething isn't workinginADOtriage doneIssues that are triaged by dev team and are in investigation.

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions