]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
call setinputsizes() for integer types
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 18 May 2018 16:51:40 +0000 (12:51 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 18 May 2018 23:29:48 +0000 (19:29 -0400)
commitdf445f3543a1db5aac82c478f743bc66d4911eb2
tree36d3970183ce55611aab89ab7140073a972a47bc
parent93bf6db9efaf8fceef665766637ec4e7d5507a8d
call setinputsizes() for integer types

Altered the Oracle dialect such that when an :class:`.Integer` type is in
use, the cx_Oracle.NUMERIC type is set up for setinputsizes().  In
SQLAlchemy 1.1 and earlier, cx_Oracle.NUMERIC was passed for all numeric
types unconditionally, and in 1.2 this was removed to allow for better
numeric precision.  However, for integers, some database/client setups
will fail to coerce boolean values True/False into integers which introduces
regressive behavior when using SQLAlchemy 1.2.  Overall, the setinputsizes
logic seems like it will need a lot more flexibility going forward so this
is a start for that.

Change-Id: Ida80cc2c2c37ffc0e05da4b5df2dadfab55a01f2
Fixes: #4259
(cherry picked from commit c7ae04d1c5c4aa6c6099584ae386d6ab9ef7b290)
doc/build/changelog/unreleased_12/4259.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/oracle/cx_oracle.py
lib/sqlalchemy/engine/default.py
test/dialect/oracle/test_types.py