| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed a regression introduced in version 1.2 where a refactor
of the :class:`.SQLAlchemyError` base exception class introduced an
inappropriate coercion of a plain string message into Unicode under
python 2k, which is not handled by the Python interpreter for characters
outside of the platform's encoding (typically ascii). The
:class:`.SQLAlchemyError` class now passes a bytestring through under
Py2K for ``__str__()`` as is the behavior of exception objects in general
under Py2K, does a safe coercion to unicode utf-8 with
backslash fallback for ``__unicode__()``. For Py3K the message is
typically unicode already, but if not is again safe-coerced with utf-8
with backslash fallback for the ``__str__()`` method.
Fixes: #4429
Change-Id: I2289da3f2c45c7d0041fa43d838958f7614defc3
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reflection of an index based on SQL expressions are now skipped with a
warning, in the same way as that of the Postgresql dialect, where we currently
do not support reflecting indexes that have SQL expressions within them.
Previously, an index with columns of None were produced which would break
tools like Alembic.
Fixes: #4431
Change-Id: I1363ade912d206b42669331e2be2bb6f444b65a2
|
| |/
|
|
|
|
|
|
|
| |
Fixed issue where the DDL emitted for :class:`.DropTableComment`, which
will be used by an upcoming version of Alembic, was incorrect for the MySQL
and Oracle databases.
Fixes: #4436
Change-Id: I196de09495a37adface4caa9dcbc29a6d0ad159a
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Applied on top of a pure run of black -l 79 in
I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes
resolves all remaining flake8 conditions for those codes
we have enabled in setup.cfg.
Included are resolutions for all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.
Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a straight reformat run using black as is, with no edits
applied at all.
The black run will format code consistently, however in
some cases that are prevalent in SQLAlchemy code it produces
too-long lines. The too-long lines will be resolved in the
following commit that will resolve all remaining flake8 issues
including shadowed builtins, long lines, import order, unused
imports, duplicate imports, and docstring issues.
Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
|
| |
|
|
|
|
|
|
|
| |
Pass a list of all the types for the left side of an
IN expression to the visit_empty_set_expr() method, so that
the "empty expanding IN" can produce clauses for each element.
Fixes: #4271
Change-Id: I2738b9df2292ac01afda37f16d4fa56ae7bf9147
|
| |
|
|
|
|
|
| |
Add a test that asserts MySQL can't implicitly treat a decimal
bound parameter without context and everyone else can.
Change-Id: I40e24a463d6eb03fd677195895891e73624776c3
|
| |
|
|
|
|
|
|
|
|
|
| |
Added new logic to the "expanding IN" bound parameter feature whereby if
the given list is empty, a special "empty set" expression that is specific
to different backends is generated, thus allowing IN expressions to be
fully dynamic including empty IN expressions.
Fixes: #4271
Change-Id: Icc3c73bbd6005206b9d06baaeb14a097af5edd36
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/432
|
| |
|
|
|
|
|
|
|
| |
For cx_Oracle, Integer datatypes will now be bound to "int", per advice
from the cx_Oracle developers. Previously, using cx_Oracle.NUMBER caused a
loss in precision within the cx_Oracle 6.x series.
Change-Id: I4c6b2cca490aff5b98b7ceff3414715202881c89
Fixes: #4309
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug in MySQLdb dialect and variants such as PyMySQL where an
additional "unicode returns" check upon connection makes explicit use of
the "utf8" character set, which in MySQL 8.0 emits a warning that utf8mb4
should be used. This is now replaced with a utf8mb4 equivalent.
Documentation is also updated for the MySQL dialect to specify utf8mb4 in
all examples. Additional changes have been made to the test suite to use
utf8mb3 charsets and databases (there seem to be collation issues in some
edge cases with utf8mb4), and to support configuration default changes made
in MySQL 8.0 such as explicit_defaults_for_timestamp as well as new errors
raised for invalid MyISAM indexes.
Change-Id: Ib596ea7de4f69f976872a33bffa4c902d17dea25
Fixes: #4283
Fixes: #4192
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed INSERT FROM SELECT with CTEs for the Oracle and MySQL dialects, where
the CTE was being placed above the entire statement as is typical with
other databases, however Oracle and MariaDB 10.2 wants the CTE underneath
the "INSERT" segment. Note that the Oracle and MySQL dialects don't yet
work when a CTE is applied to a subquery inside of an UPDATE or DELETE
statement, as the CTE is still applied to the top rather than inside the
subquery.
Also adds test suite support CTEs against backends.
Change-Id: I8ac337104d5c546dd4f0cd305632ffb56ac8bf90
Fixes: #4275
Fixes: #4230
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed a 1.2 regression caused by :ticket:`4061` where the SQL Server
"BIT" type would be considered to be "native boolean". The goal here
was to avoid creating a CHECK constraint on the column, however the bigger
issue is that the BIT value does not behave like a true/false constant
and cannot be interpreted as a standalone expression, e.g.
"WHERE <column>". The SQL Server dialect now goes back to being
non-native boolean, but with an extra flag that still avoids creating
the CHECK constraint.
Change-Id: I4765d2a2a00b0d14f50282603cc4d48d4739dac1
Fixes: #4250
|
| |
|
|
|
|
|
|
|
| |
* Causes intermittent failure against Greenplum cluster
* Tested using Greenplum dialact:
https://github.com/PlaidCloud/sqlalchemy-greenplum
Change-Id: I6387e98f17a3667612fdaaadb27a08f79ec46398
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/440
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed 1.2 regression caused by :ticket:`4060` where the query used to
reflect SQL Server cross-schema foreign keys was limiting the criteria
incorrectly.
Additionally, added some rework of the inter-schema reflection tests
so that MySQL, MSSQL can be included, breaking out some of the
Postgresql-specific behaviors into separate requirements.
Fixes: #4234
Change-Id: I20c8e70707075f1767b79127c2c27d4b313c6515
|
| |
|
|
|
|
|
|
|
|
| |
Fixed issue where the compilation of an INSERT statement with the
"literal_binds" option that also uses an explicit sequence and "inline"
generation, as on Postgresql and Oracle, would fail to accommodate the
extra keyword argument within the sequence processing routine.
Change-Id: Ibdab7d340aea7429a210c9535ccf1a3e85f074fb
Fixes: #4231
|
| |
|
|
|
|
|
|
|
| |
The ON DELETE options for foreign keys are now part of
Oracle reflection. Oracle does not support ON UPDATE
cascades. Pull request courtesy Miroslav Shubernetskiy.
Change-Id: I135cd6cd3436354a86b2c1e1437c3785c38eed26
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/418
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This is the only way I could get this test pass on informix, basically I strip every whitespace.
The sql text as recorded in informix is:
```
((a > 1 ) AND (a < 5 ) )
((a = 1 ) OR ((a > 2 ) AND (a <5 ) ) )
```
Yes, this is absolutely bonkers, but that is what I get :(
Change-Id: I936e860f2b75b521e5560c05c452dbe72f0d3812
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/413
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed regression in 1.2 where newly repaired quoting
of collation names in :ticket:`3785` breaks SQL Server,
which explicitly does not understand a quoted collation
name. Whether or not mixed-case collation names are
quoted or not is now deferred down to a dialect-level
decision so that each dialect can prepare these identifiers
directly.
Change-Id: Iaf0a8123d9bf4711219e320896bb28c5d2649304
Fixes: #4154
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
MariaDB adds a JSON alias for the LONGTEXT datatype and
all the same json functions work against it in any case.
What doesn't work is reflection, since it's just an alias,
and also the CAST we were using in one of our tests doesn't seem
to work for JSON which is probably also because it's not
a real datatype.
Change-Id: I44e5503db29ca2f04de8e521527978f34675a5e0
|
| |/
|
|
|
|
|
|
|
| |
Fixed regression where the removal of most setinputsizes
rules from cx_Oracle dialect impacted the TIMESTAMP
datatype's ability to retrieve fractional seconds.
Fixes: #4157
Change-Id: Ic53109fd199aea8b9c4da14355e125849b8b198f
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Added a new exclusion rule group_by_complex_expression
which disables tests that use "GROUP BY <expr>", which seems
to be not viable for at least two third party dialects.
Change-Id: I47284513382ae93f5a3d12c734b3a44643147c99
|
| |/
|
|
|
|
|
|
| |
Removed an oracle-specific requirements rule from the public
test suite that was interfering with third party dialect
suites.
Change-Id: Iebae510edcb8ef908dcd9be9222888e12caed97d
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Added some additional rules to fully handle ``Decimal('Infinity')``,
``Decimal('-Infinity')`` values with cx_Oracle numerics when using
``asdecimal=True``.
Allow remaining cx_Oracle numeric tests that were waiting
for the refactor to be finished and forgot to get enabled.
Change-Id: I1e2365176e34559c0230c84f800a7cfe0a034ed5
Fixes: #4064
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Reworked the new "autoescape" feature introduced in
:ref:`change_2694` in 1.2.0b2 to be fully automatic; the escape
character now defaults to a forwards slash ``"/"`` and
is applied to percent, underscore, as well as the escape
character itself, for fully automatic escaping. The
character can also be changed using the "escape" parameter.
Change-Id: I74894a2576983c0f6eb89480c9e5727f49fa9c25
Fixes: #2694
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The test here commits even though integrityerror
was raised due to the fixture. Postgresql seems to allow
this even though it's usually strict about this. remove
the requirement that a database needs to be able to
commit after an integrity error was raised.
Change-Id: I437faadb04ff7a9c3f624c68646b4f4f504b504a
|
| |/
|
|
|
|
|
| |
I observed test runs that failed on 'test_bound_in_scalar' due to arbitrary ordering of the result set. The assertion not only tests for the elements to be present, but also for the correct ordering. Hence, the proposal to add an order_by clause to the select statements.
Change-Id: If1fbb864761e77dfd2a42ef857801c8aaf893bee
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/389
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixed bug where SQLite CHECK constraint reflection would fail
if the referenced table were in a remote schema, e.g. on SQLite a
remote database referred to by ATTACH.
Also add suite support for general CHECK constraint reflection.
Change-Id: I073a72cb47dc4f8c5683000d708768523759332f
Fixes: #4099
|
| |
|
|
|
|
|
|
|
| |
Drops support for cx_Oracle prior to version 5.x, reworks
numeric and binary support.
Fixes: #4064
Change-Id: Ib9ae9aba430c15cd2a6eeb4e5e3fd8e97b5fe480
|
| |
|
|
| |
Change-Id: Ie9bec6e8f51d52349dcbd8009981818e459e88b8
|
| |
|
|
| |
Change-Id: Ida0d01ae9bcc0573b86e24fddea620a38c962822
|
| |
|
|
|
|
|
| |
To support adding AUTOCOMMIT to more dialects, add a suite
test
Change-Id: I585dcce19fcdce70e8cf21aea4edaa97d7bf2bb9
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug in new percent-sign support (e.g. :ticket:`3740`) where a bound
parameter rendered with literal_binds would fail to escape percent-signs
for relevant dialects. In addition, ensured new table / column comment
support feature also fully makes use of literal-rendered parameters so that
this percent sign support takes place with table / column comment DDL as
well, allowing percent sign support for the mysql / psycopg2 backends that
require escaping of percent signs.
Change-Id: Ia4136a300933e9bc6a01a7b9afd5c7b9a3fee4e3
Fixes: #4054
Fixes: #4052
|
| |
|
|
| |
Change-Id: Id8156f6af15a36f7d5653dff56f68e81431692a6
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug where an index reflected under Oracle with an expression like
"column DESC" would not be returned, if the table also had no primary
key, as a result of logic that attempts to filter out the
index implicitly added by Oracle onto the primary key columns.
Reworked the "filter out the primary key index" logic in oracle
get_indexes() to be clearer.
This changeset also adds an internal check to ColumnCollection
to accomodate for the case of a column being added twice,
as well as adding a private _table argument to Index such that
reflection can specify the Table explicitly. The _table
argument can become part of public API in a later revision
or release if needed.
Change-Id: I745711e03b3e450b7f31185fc70e10d3823063fa
Fixes: #4042
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The result processor for the :class:`.Float` type now unconditionally
runs values through the ``float()`` processor if the dialect
specifies that it also supports "native decimal" mode. While most
backends will deliver Python ``float`` objects for a floating point
datatype, the MySQL backends in some cases lack the typing information
in order to provide this and return ``Decimal`` unless the float
conversion is done.
Change-Id: I638f1480fb00a507036efaf0e0080f26893d98ad
Fixes: #4020
|
| |
|
|
|
|
|
|
|
|
|
| |
Added some extra strictness to the handling of Python "float" values
passed to SQL statements. A "float" value will be associated with the
:class:`.Float` datatype and not the Decimal-coercing :class:`.Numeric`
datatype as was the case before, eliminating a confusing warning
emitted on SQLite as well as unecessary coercion to Decimal.
Change-Id: I1bb1810ff1d198c0d929ccba5656e55401d74119
Fixes: #4017
|
| |
|
|
|
|
|
|
| |
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/326
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/342
Fixes: #4002
Change-Id: I221fe8ba305fc455a03e3a5d15f803bf8ee2e8fb
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a new kind of :func:`.bindparam` called "expanding". This is
for use in ``IN`` expressions where the list of elements is rendered
into individual bound parameters at statement execution time, rather
than at statement compilation time. This allows both a single bound
parameter name to be linked to an IN expression of multiple elements,
as well as allows query caching to be used with IN expressions. The
new feature allows the related features of "select in" loading and
"polymorphic in" loading to make use of the baked query extension
to reduce call overhead. This feature should be considered to be
**experimental** for 1.2.
Fixes: #3953
Change-Id: Ie708414a3ab9c0af29998a2c7f239ff7633b1f6e
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This patch moves the "doubling" of percent signs into
the base compiler and makes it completely a product
of whether or not the paramstyle is format/pyformat or
not. Without this paramstyle, percent signs
are not doubled across text(), literal_column(), and
column().
Change-Id: Ie2f278ab1dbb94b5078f85c0096d74dbfa049197
Fixes: #3740
|
| |
|
|
|
|
|
| |
After bump minimum supported version to 2.7 (1da9d3752160430c91534a8868ceb8c5ad1451d4), we can use new syntax.
Change-Id: Ib064c75a00562e641d132f9c57e5e69744200e05
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/347
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added support for SQL comments on :class:`.Table` and :class:`.Column`
objects, via the new :paramref:`.Table.comment` and
:paramref:`.Column.comment` arguments. The comments are included
as part of DDL on table creation, either inline or via an appropriate
ALTER statement, and are also reflected back within table reflection,
as well as via the :class:`.Inspector`. Supported backends currently
include MySQL, Postgresql, and Oracle.
Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com>
Fixes: #1546
Change-Id: Ib90683850805a2b4ee198e420dc294f32f15d35d
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Oracle reflection now "normalizes" the name given to a foreign key
constraint, that is, returns it as all lower case for a case
insensitive name. This was already the behavior for indexes
and primary key constraints as well as all table and column names.
This will allow Alembic autogenerate scripts to compare and render
foreign key constraint names correctly when initially specified
as case insensitive.
Change-Id: Ibb34ec6ce7cb244d1c4ae9d44ce2d37d37227e69
Fixes: #3276
|
| |
|
|
|
|
|
|
|
|
|
| |
- Fixed bug where SQL Server dialects would attempt to select the
last row identity for an INSERT from SELECT, failing in the case when
the SELECT has no rows. For such a statement,
the inline flag is set to True indicating no last primary key
should be fetched.
Change-Id: Ic40d56d9eadadc3024a4d71245f9eed4c420024a
Fixes: #3876
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed issue in :class:`.Variant` where the "right hand coercion" logic,
inherited from :class:`.TypeDecorator`, would
coerce the right-hand side into the :class:`.Variant` itself, rather than
what the default type for the :class:`.Variant` would do. In the
case of :class:`.Variant`, we want the type to act mostly like the base
type so the default logic of :class:`.TypeDecorator` is now overridden
to fall back to the underlying wrapped type's logic. Is mostly relevant
for JSON at the moment.
This patch additionally adds documentation and basic tests to allow
for backend-agnostic comparison of JSON index elements to other objects.
A future version should attempt to improve upon this by providing
"astext", "asint" types of operators.
Change-Id: I7b7b45d604a4ae8d1dc236a5a1248695aab5232e
Fixes: #3859
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ported the fix for Oracle quoted-lowercase names to Firebird, so that
a table name that is quoted as lower case can be reflected properly
including when the table name comes from the get_table_names()
inspection function.
Also genericize the test to the test suite for denormlized name
dialects.
Fixes: #3548
Change-Id: I8ca62e8d2b359e363ccb01cfe2daa0995354a3cb
|