Skip to content

Conversation

@jhartmann123
Copy link
Contributor

Fixes #2624

@jhartmann123 jhartmann123 force-pushed the 2624-prepared-transactions branch from 9560c3c to 06646d2 Compare January 24, 2023 17:22
@roji
Copy link
Member

roji commented Jan 26, 2023

Thanks @jhartmann123, yeah, this was pretty hacky. I'll take a look in a few days.

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this fix looks good.

More generally, doing a string lookup on the connection string is hacky; for example, there could theoretically be spaces in there, which are valid but which would cause detection failure.

A more complete solution would be to have a dictionary mapping the connection string to its Enlist setting, which we'd get once by actually parsing the connection string with NpgsqlConnectionStringBuilder. I didn't do this was to avoid the extra dictionary lookup each time, though that may be a bit exaggerated...

Will merge and backpotr this for now and see if others run into issues around it. Thanks for your contribution!

@roji roji merged commit 8fda219 into npgsql:main Jan 27, 2023
roji pushed a commit that referenced this pull request Jan 27, 2023
@roji
Copy link
Member

roji commented Jan 27, 2023

Backported to 7.0.2 via f711091

@jhartmann123 jhartmann123 deleted the 2624-prepared-transactions branch January 30, 2023 21:16
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.

Case sensitive string comparison causes prepared transactions

2 participants