Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

escape quotes in mssql uuid literal renderer - #13449

#13449
Closed
dxbjavid wants to merge 1 commit into
sqlalchemy:mainsqlalchemy/sqlalchemy:mainfrom
dxbjavid:mssql-uuid-literal-quotingdxbjavid/sqlalchemy:mssql-uuid-literal-quotingCopy head branch name to clipboard
Closed

escape quotes in mssql uuid literal renderer#13449
dxbjavid wants to merge 1 commit into
sqlalchemy:mainsqlalchemy/sqlalchemy:mainfrom
dxbjavid:mssql-uuid-literal-quotingdxbjavid/sqlalchemy:mssql-uuid-literal-quotingCopy head branch name to clipboard

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

Description

MSUUid.literal_processor renders the native UNIQUEIDENTIFIER form with replace("''", "'"), which collapses doubled quotes rather than escaping single ones, so it does the opposite of the generic sqltypes.Uuid.literal_processor it overrides. With as_uuid=False the value is a plain string rather than a UUID object, so a quote inside it ends the rendered literal and the rest is parsed as SQL, both under literal_binds and for parameters marked literal_execute=True, which renders at execution time. Reversing the two arguments to replace() brings it back in line with the base type; a full example and the before/after output are in #13448.

Checklist

This pull request is:

  • A documentation / typographical / small typing error fix
    • Good to go, no issue or tests are needed
  • A short code fix
    • please include the issue number, and create an issue if none exists, which
      must include a complete example of the issue. one line code fixes without an
      issue and demonstration will not be accepted.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests. one line code fixes without tests will not be accepted.
  • A new feature implementation
    • please include the issue number, and create an issue if none exists, which must
      include a complete example of how the feature would look.
    • Please include: Fixes: #<issue number> in the commit message
    • please include tests.

Have a nice day!

@zzzeek

zzzeek commented Jul 22, 2026

Copy link
Copy Markdown
Member

ive created a general purpose auditing suite to catch all of these at https://gerrit.sqlalchemy.org/c/sqlalchemy/sqlalchemy/+/6843 . this fixes the UUID issue as well as NumericCommon and JSONPATH

@zzzeek zzzeek closed this Jul 22, 2026
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.