]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Apply type processing to untyped preexec default clause
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 27 Feb 2017 21:43:59 +0000 (16:43 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 30 Mar 2017 18:58:50 +0000 (14:58 -0400)
commit4eb4010c1a1c3e5c2529b9be9d8d56f1d6a4ec00
treebac9c2f192b43d097ee9122a1add4c4f952d2d8e
parent74f6c21747d07a8cf9902900df9280a84aadc2bb
Apply type processing to untyped preexec default clause

Fixed bug where a SQL-oriented Python-side column default could fail to
be executed properly upon INSERT in the "pre-execute" codepath, if the
SQL itself were an untyped expression, such as plain text.  The "pre-
execute" codepath is fairly uncommon however can apply to non-integer
primary key columns with SQL defaults when RETURNING is not used.

Tests exist here to ensure typing is applied to
a typed expression for default, but in the case of
an untyped SQL value, we know the type from the column,
so apply this.

Change-Id: I5d8b391611c137b9f700115a50a2bf5b30abfe94
Fixes: #3923
doc/build/changelog/changelog_12.rst
lib/sqlalchemy/engine/default.py
lib/sqlalchemy/sql/schema.py
test/engine/test_execute.py
test/sql/test_defaults.py