Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Populate cursor "messages" attribute when fast_executemany=True #1305

Merged
merged 1 commit into from
Feb 5, 2024

Conversation

keitherskine
Copy link
Collaborator

When fast_executemany is True, function ExecuteMulti() is called instead of execute(). ExecuteMulti() was not calling GetDiagRecs() to populate the cursor "messages" attribute. This now happens. I had to export GetDiagRecs() from cursor.cpp for that purpose.

Unit test added. Also beefed up an existing unit test for unicode messages.

Fixes #1299 .

When fast_executemany is True, function ExecuteMulti() is called instead of execute().  ExecuteMulti() was not calling GetDiagRecs() to populate the cursor "messages" attribute.  Made GetDiagRecs() public for that purpose.
@mkleehammer mkleehammer merged commit 9298c00 into mkleehammer:master Feb 5, 2024
9 checks passed
@mkleehammer
Copy link
Owner

This looks really nice. Thanks for beefing up the test.

I've never been fond of having two code paths that are so separate, regular and fast_execute_many. I'll be surprised if there aren't a lot of things like this. When the change was first submitted, I wanted to break things apart and make them use the same base components - especially binding parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to obtain INFO messages using fast_executemany from SQL Server connection
2 participants