]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
alter the collation of string type for collate()
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 5 Jul 2024 13:30:10 +0000 (09:30 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jul 2024 20:03:09 +0000 (16:03 -0400)
commit7831d6de0121ec25152d822bce4a4501ce64263b
tree3a8ef35525be48bda32d228ff1af7660f75c4c5d
parent5e495e16da87644bcb07aa76c9021d486053b81d
alter the collation of string type for collate()

Fixed issue where the :func:`_sql.collate` construct, which explicitly sets
a collation for a given expression, would maintain collation settings for
the underlying type object from the expression, causing SQL expressions to
have both collations stated at once when used in further expressions for
specific dialects that render explicit type casts, such as that of asyncpg.
The :func:`_sql.collate` construct now assigns its own type to explicitly
include the new collation, assuming it's a string type.

Fixes: #11576
Change-Id: I6fc8904d2bcbc21f11bbca57e4a451ed0edbd879
(cherry picked from commit 35c178c405c44798810ceac540faf8385b4632c4)
doc/build/changelog/unreleased_20/11576.rst [new file with mode: 0644]
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/sqltypes.py
lib/sqlalchemy/sql/type_api.py
test/sql/test_types.py