]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Column._copy() duplicates "user defined" nullable state exactly
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 21 Aug 2022 15:58:20 +0000 (11:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 21 Aug 2022 15:58:20 +0000 (11:58 -0400)
commit7842678484b9d00a64fab29cdc9e252754ac19ae
treec341b202110136657ff375d0d4afd3a161c5a6a3
parentf55ae66f70d6b28fbccd75ac9089f11e951c4c39
Column._copy() duplicates "user defined" nullable state exactly

To accommodate how mapped_column() works, after many
attempts to get this working it became clear that _copy()
should just transfer "nullable" state exactly as it was,
including the state where .nullable was set but user_defined_nullable
remains at not user set.

additionally, added a similar step to _merge() that was needed
to preserve the nullability behavior when Identity is present.

server / client default objects are not copied within column._copy()
and this should be fixed.

Fixes: #8410
Change-Id: Ib09df52b71f3e58e67e9f19b893d40a6cc4eec5c
lib/sqlalchemy/sql/schema.py
test/orm/declarative/test_typed_mapping.py
test/sql/test_metadata.py