| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
Fixes: #7258
Change-Id: I3577f665eca04f2632b69bcb090f0a4ec9271db9
|
| |
|
|
|
|
| |
References: #6023
Change-Id: I0f6cbc34b3c0bfc0b8c86b3ebe4531e23039b6c0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reorganized the list of reserved words into two separate lists, one for
MySQL and one for MariaDB, so that these diverging sets of words can be
managed more accurately; adjusted the MySQL/MariaDB dialect to switch among
these lists based on either explicitly configured or
server-version-detected "MySQL" or "MariaDB" backend. Added all current
reserved words through MySQL 8 and current MariaDB versions including
recently added keywords like "lead" . Pull request courtesy Kevin Kirsche.
1. Move reserved words to it's own file.
2. Add missing reserved words from https://mariadb.com/kb/en/reserved-words/
* Note: this only adds MariaDB though links to MySQL, it also does not
include the reserved words for Oracle mode, as listed in the link.
Fixes: #7167
Supercedes: #7197
Closes: #7207
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7207
Pull-request-sha: 5a682e331069520ccad9e6bf3cc5e4a77a889ef0
Change-Id: Ib25be8148568899f56b5c9b42d4f530ade8a04e3
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue where "expanding IN" would fail to function correctly with
datatypes that use the :meth:`_types.TypeEngine.bind_expression` method,
where the method would need to be applied to each element of the
IN expression rather than the overall IN expression itself.
Fixed issue where IN expressions against a series of array elements, as can
be done with PostgreSQL, would fail to function correctly due to multiple
issues within the "expanding IN" feature of SQLAlchemy Core that was
standardized in version 1.4. The psycopg2 dialect now makes use of the
:meth:`_types.TypeEngine.bind_expression` method with :class:`_types.ARRAY`
to portably apply the correct casts to elements. The asyncpg dialect was
not affected by this issue as it applies bind-level casts at the driver
level rather than at the compiler level.
as part of this commit the "bind translate" feature has been
simplified and also applies to the names in the POSTCOMPILE tag to
accommodate for brackets.
Fixes: #7177
Change-Id: I08c703adb0a9bd6f5aeee5de3ff6f03cccdccdc5
|
| |/
|
|
|
|
|
|
| |
Also implement reflection of ON DELETE, ON UPDATE
as the data is right there.
Fixes: #7160
Change-Id: Ifff871a8cb1d1bea235616042e16ed3b5c5f19f9
|
| |
|
|
|
|
|
|
|
|
|
| |
Fixed issue with :meth:`.Inspector.has_table` where it would return False
if a local temp table with the same name from a different session happened
to be returned first when querying tempdb. This is a continuation of
:ticket:`6910` which accounted for the temp table existing only in the
alternate session and not the current one.
Fixes: #7168
Change-Id: I19dbb71a63184c6d41822b0e882b7b284ac83786
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue in MySQL :func:`_mysql.match` construct where passing a clause
expression such as :func:`_sql.bindparam` or other SQL expression for the
"against" parameter would fail. Pull request courtesy Anton Kovalevich.
Fixes: #7144
Closes: #7145
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7145
Pull-request-sha: 3757ffa51a3ff5919278165aaf906c8d2f9940c0
Change-Id: I7bb95f338afe3a17296a7b60e8c973f93b4f5e62
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
Added a "disconnect" condition for the "SSL SYSCALL error: Bad address"
error message as reported by psycopg2. Pull request courtesy Zeke Brechtel.
Fixes: #5387
Closes: #7087
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7087
Pull-request-sha: 66af76a107a22d9119edc8edcacc1e4ef66dc50d
Change-Id: Ia4afc9683b8175a8ca282e07e0f83c65657544ab
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes to accommodate for the MariaDB 10.6 series, including backwards
incompatible changes in both the mariadb-connector Python driver (supported
on SQLAlchemy 1.4 only) as well as the native 10.6 client libraries that
are used automatically by the mysqlclient DBAPI (applies to both 1.3 and
1.4). The "utf8mb3" encoding symbol is now reported by these client
libraries when the encoding is stated as "utf8", leading to lookup and
encoding errors within the MySQL dialect that does not expect this symbol.
Updates to both the MySQL base library to accommodate for this utf8mb3
symbol being reported as well as to the test suite. Thanks to Georg Richter
for support.
Fixes: #7136
Fixes: #7115
Change-Id: I655d9d9868aef76037023d0c602b8a7c881780b0
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixed bug in SQL Server ``DATETIMEOFFSET`` where the ODBC implementation
would not generate the correct DDL, for cases where the type were converted
using the ``dialect.type_descriptor()`` method, the usage of which is
illustrated in some documented examples for :class:`.TypeDecorator`, though
not necessary for most datatypes. Regression was introduced by
:ticket:`6366`. As part of this change, the full list of SQL Server date
types have been amended to return a "dialect impl" that generates the same
DDL name as the supertype.
Fixes: #7129
Change-Id: I7d9bea54c0c38e16d1a6ad978cca996006a1b624
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Updated test suite to pass correctly for MariaDB 10.6 when using the
mariadb-connector driver, which made some adjustments to default encoding.
Pull request courtesy Georg Richter.
Use character set utf8mb4 instead of utf8:
1) Character set for mariadb connector is utf8mb4 and
cannot be changed.
2) Since MariaDB 10.6.1 utf8 is mapped to utf8mb3, and
will be mapped to utf8mb4 in 10.7, see [MDEV-8334](https://jira.mariadb.org/browse/MDEV-8334) (rename
utf8 to utf8mb3)
utf8mb4 character set support was added 12 years ago and
will work with all non eoled MariaDB server versions.
Fixes: #7115
Closes: #7116
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7116
Pull-request-sha: 79516ccce2dead11e6658596c9ad400b964d24c9
Change-Id: I86c30fb636c46307cb551080641e324d2bbc1cb3
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
a few changes for py2k:
* map_imperatively() includes the check that a class
is being sent, this was only working for mapper() before
* the test suite didn't place the py2k "autouse" workaround
in the correct order, seemingly, tried to adjust the
per-test ordering setup in pytestplugin.py
Change-Id: I4cc39630724e810953cfda7b2afdadc8b948e3c2
|
| |
|
|
|
|
|
| |
* sqlalchemy.ext.declarative names
* declarative_base(bind)
Change-Id: I0ca26894b224458b58e46504c5ff7b5d3031a829
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve the interface used by adapted drivers, like the asyncio ones,
to access the actual connection object returned by the driver.
The :class:`_engine._ConnectionRecord` and
:class:`_engine._ConnectionFairy` now have two new attributes:
* ``dbapi_connection`` always represents a DBAPI compatible
object. For pep-249 drivers, this is the DBAPI connection as it always
has been, previously accessed under the ``.connection`` attribute.
For asyncio drivers that SQLAlchemy adapts into a pep-249 interface,
the returned object will normally be a SQLAlchemy adaption object
called :class:`_engine.AdaptedConnection`.
* ``driver_connection`` always represents the actual connection object
maintained by the third party pep-249 DBAPI or async driver in use.
For standard pep-249 DBAPIs, this will always be the same object
as that of the ``dbapi_connection``. For an asyncio driver, it will be
the underlying asyncio-only connection object.
The ``.connection`` attribute remains available and is now a legacy alias
of ``.dbapi_connection``.
Fixes: #6832
Change-Id: Ib72f97deefca96dce4e61e7c38ba430068d6a82e
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added initial support for the ``asyncmy`` asyncio database driver for MySQL
and MariaDB. This driver is very new, however appears to be the only
current alternative to the ``aiomysql`` driver which currently appears to
be unmaintained and is not working with current Python versions. Much
thanks to long2ice for the pull request for this dialect.
Fixes: #6993
Closes: #7000
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/7000
Pull-request-sha: f7d6c811fc72324a83c8af635bbca8b268b0098e
Change-Id: I4ef54b43334feff7e3a710fc4de6821437f3bb68
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
### Description
Alters the test for skip_locked to recognize that `SKIP LOCKED` was added to the MariaDB syntax in 10.6.0 https://mariadb.com/kb/en/select/#skip-locked.
### Checklist
This pull request is:
- [X] A minor test case fix
- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [ ] A short code fix
- please include the issue number, and create an issue if none exists, which
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests. one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.
**Have a nice day!**
:smile: You too :boat:
Note:
```
$ podman run --rm -d -e MARIADB_USER=scott -e MARIADB_PASSWORD=tiger -e MARIADB_DATABASE=test -e MARIADB_RANDOM_ROOT_PASSWORD=1 -P mariadb:10.6
7248491216e93320d7eff4c8c3a9f8c6b6c43cc84a7a65e721265616f8854f4d
$ podman port 7248491216e93320d7eff4c8c3a9f8c6b6c43cc84a7a65e721265616f8854f4d 3306
0.0.0.0:43809
$ pytest --db mariadb --dburi mariadb://scott:tiger@127.0.0.1:43809/test test/dialect/mysql/test_for_update.py
...
INTERNALERROR> File "/home/dan/.py3/lib64/python3.9/site-packages/MySQLdb/connections.py", line 185, in __init__
INTERNALERROR> super().__init__(*args, **kwargs2)
INTERNALERROR> sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (2002, "Can't connect to MySQL server on '127.0.0.1' (115)")
INTERNALERROR> (Background on this error at: https://sqlalche.me/e/14/e3q8)
```
Some queries where executed on the container instance however there's something in the test hard-coded to 3306 (observed in strace). And/or I'm doing something incorrectly.
Closes: #6998
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6998
Pull-request-sha: a8f9c05abea0795cfa39cd972e096e4581dbf892
Change-Id: I3cd41587d7207f0e6747dea97d6be1e33d7c7aa0
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* fix: lib/sqlalchemy/sql/lambdas.py
* fix: lib/sqlalchemy/sql/compiler.py
* fix: lib/sqlalchemy/sql/selectable.py
* fix: lib/sqlalchemy/orm/relationships.py
* fix: lib/sqlalchemy/dialects/mssql/base.py
* fix: lib/sql/test_compiler.py
* fix: lib/sqlalchemy/testing/requirements.py
* fix: lib/sqlalchemy/orm/path_registry.py
* fix: lib/sqlalchemy/dialects/postgresql/psycopg2.py
* fix: lib/sqlalchemy/cextension/immutabledict.c
* fix: lib/sqlalchemy/cextension/resultproxy.c
* fix: ./lib/sqlalchemy/dialects/oracle/cx_oracle.py
* fix: examples/versioned_rows/versioned_rows_w_versionid.py
* fix: examples/elementtree/optimized_al.py
* fix: test/orm/test_attribute.py
* fix: test/sql/test_compare.py
* fix: test/sql/test_type_expression.py
* fix: capitalization in test/dialect/mysql/test_compiler.py
* fix: typos in test/dialect/postgresql/test_reflection.py
* fix: typo in tox.ini comment
* fix: typo in /lib/sqlalchemy/orm/decl_api.py
* fix: typo in test/orm/test_update_delete.py
* fix: self-induced typo
* fix: typo in test/orm/test_query.py
* fix: typos in test/dialect/mssql/test_types.py
* fix: typo in test/sql/test_types.py
|
| |/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
any UPPERCASE datatype refers to that exact type name rendered
on the database. So PG's ENUM must render "ENUM" and is
"native" by definition. warn if this flag is passed.
The :class:`_postgresql.ENUM` datatype is PostgreSQL-native and therefore
should not be used with the ``native_enum=False`` flag. This flag is now
ignored if passed to the :class:`_postgresql.ENUM` datatype and a warning
is emitted; previously the flag would cause the type object to fail to
function correctly.
Fixes: #6106
Change-Id: I08e0ec6fcfafd068e1eaf6aec13c8010f09ce94a
|
| |
|
|
|
|
|
|
|
| |
Fixed bug where the error message for SQLite invalid isolation level on the
pysqlite driver would fail to indicate that "AUTOCOMMIT" is one of the
valid isolation levels.
Change-Id: Icbceab9a28af6a560859761fa92320b5473269a9
References: #6959
|
| |
|
|
|
|
|
|
|
| |
Fixes: #6912
Closes: #6920
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6920
Pull-request-sha: 79af75dfddef25435afd9623698354d280d7c879
Change-Id: Ib6b472452f978378d9f511d17a26988323a89459
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adjusted the "from linter" warning feature to accommodate for a chain of
joins more than one level deep where the ON clauses don't explicitly match
up the targets, such as an expression such as "ON TRUE". This mode of use
is intended to cancel the cartesian product warning simply by the fact that
there's a JOIN from "a to b", which was not working for the case where the
chain of joins had more than one element.
this incurs a bit more compiler overhead that comes out in profiling
but is not extensive.
Added the "is_comparison" flag to the PostgreSQL "overlaps",
"contained_by", "contains" operators, so that they work in relevant ORM
contexts as well as in conjunction with the "from linter" feature.
Fixes: #6886
Change-Id: I078dc3fe6d4f7871ffe4ebac3e71e62f3f213d12
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
this appears to be unnecessary and prevents end-user
literal_binds case from working.
Fixed issue where the ``literal_binds`` compiler flag, as used externally
to render bound parameters inline, would fail to work when used with a
certain class of parameters known as "literal_execute", which covers things
like LIMIT and OFFSET values for dialects where the drivers don't allow a
bound parameter, such as SQL Server's "TOP" clause. The issue locally
seemed to affect only the MSSQL dialect.
Fixes: #6863
Change-Id: Ia74cff5b0107b129a11b9b965883552b2962e449
|
| |/
|
|
| |
Change-Id: Ida86ed40c43d91813151621b847376976773a5f9
|
| |
|
|
|
|
|
|
|
| |
Fixed issue where the unit of work would internally use a 2.0-deprecated
SQL expression form, emitting a deprecation warning when SQLALCHEMY_WARN_20
were enabled.
Fixes: #6812
Change-Id: I0a031e728527a1c3382848b6ddc793939362b128
|
| |
|
|
| |
Change-Id: I04057cc3d3f93de60b02999803e2ba6a23cdf68d
|
| |\ |
|
| | |
| |
| |
| | |
Change-Id: I2ccb714a249350f23e2b5f78f5f9ffb0d4f7efb0
|
| |\ \
| |/
|/| |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue where a too-long constraint name rendered as part of the "ON
CONFLICT ON CONSTRAINT" element of the :class:`_postgresql.Insert`
construct due to naming convention generation would not correctly truncate
the name in the same way that it normally renders within a CREATE TABLE
statement, thus producing a non-matching and too-long constraint name.
Fixes: #6755
Change-Id: Ib27014a5ecbc9cd5861a396f8bb49fbc60bf49fe
|
| |\ \ |
|
| | |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added new method :meth:`_sql.HasCTE.add_cte` to each of the
:func:`_sql.select`, :func:`_sql.insert`, :func:`_sql.update` and
:func:`_sql.delete` constructs. This method will add the given
:class:`_sql.CTE` as an "independent" CTE of the statement, meaning it
renders in the WITH clause above the statement unconditionally even if it
is not otherwise referenced in the primary statement. This is a popular use
case on the PostgreSQL database where a CTE is used for a DML statement
that runs against database rows independently of the primary statement.
Fixes: #6752
Change-Id: Ibf635763e40269cbd10f4c17e208850d8e8d0188
|
| |\ \ |
|
| | | |
| | |
| | |
| | | |
Change-Id: I306cfbea9920b35100e3087dcc21d7ffa6c39c55
|
| | |/
|/|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue where the PostgreSQL ``ENUM`` datatype as embedded in the
``ARRAY`` datatype would fail to emit correctly in create/drop when the
``schema_translate_map`` feature were also in use. Additionally repairs a
related issue where the same ``schema_translate_map`` feature would not
work for the ``ENUM`` datatype in combination with a ``CAST``, that's also
intrinsic to how the ``ARRAY(ENUM)`` combination works on the PostgreSQL
dialect.
Fixes: #6739
Change-Id: I44b1ad4db4af3acbf639aa422c46c22dd3b0d3a6
|
| |/
|
|
|
|
| |
Also replace http://pypi.python.org/pypi with https://pypi.org/project
Change-Id: I84b5005c39969a82140706472989f2a30b0c7685
|
| |
|
|
|
|
| |
Eliminate engine.execute() and engine.scalar()
Change-Id: I99f76d0e615ddebab2da4fd07a40a0a2796995c7
|
| |
|
|
|
|
|
|
|
| |
Fixed regression where the special dotted-schema name handling for the SQL
Server dialect would not function correctly if the dotted schema name were
used within the ``schema_translate_map`` feature.
Fixes: #6697
Change-Id: Idb610755cbf8122e71223d5dd0a17fcb61b1b98d
|
| |
|
|
|
|
|
|
|
|
| |
Fixed issue in :meth:`_postgresql.Insert.on_conflict_do_nothing` and
:meth:`_postgresql.Insert.on_conflict_do_update` where the name of a unique
constraint passed as the ``constraint`` parameter would not be properly
quoted if it contained characters which required quoting.
Fixes: #6696
Change-Id: I4ffca9b8c72cef4ed39e2de96831ccc11a620422
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Made a small adjustment in the table reflection feature of the MySQL
dialect to accommodate for alternate MySQL-oriented databases such as TiDB
which include their own "comment" directives at the end of a constraint
directive within "CREATE TABLE" where the format doesn't have the
additional space character after the comment, in this case the TiDB
"clustered index" feature. Pull request courtesy Daniël van Eeden.
Fixes: #6659
Closes: #6660
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6660
Pull-request-sha: 98791a441b2e3d26aa7cef9d3e2907fac113e30f
Change-Id: I20d206e0cdb809e4c6997b87159edf41249f7cd9
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed bug where the "schema_translate_map" feature would fail to function
correctly in conjunction with an INSERT into a table that has an IDENTITY
column, where the value of the IDENTITY column were specified in the values
of the INSERT thus triggering SQLAlchemy's feature of setting IDENTITY
INSERT to "on"; it's in this directive where the schema translate map would
fail to be honored.
Fixes: #6658
Change-Id: I8235aa639dd465d038a2ad48e7a669f3e5c5c37c
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixed issue where the ``INTERVAL`` datatype on PostgreSQL and Oracle would
produce an ``AttributeError`` when used in the context of a comparison
operation against a ``timedelta()`` object. Pull request courtesy
MajorDallas.
Fixes: #6649
Closes: #6650
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6650
Pull-request-sha: dd217a975e5f0d3157e81c731791225b6a32889f
Change-Id: I773caf2673294fdb3c92b42895ad714e944d1bf8
|
| |/
|
|
|
|
|
|
|
|
|
|
|
| |
Added new construct :class:`_mysql.match`, which provides for the full
range of MySQL's MATCH operator including multiple column support and
modifiers. Pull request courtesy Anton Kovalevich.
Fixes: #6132
Closes: #6133
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/6133
Pull-request-sha: dc6842f13688849a848e2ecbb81600e6edf8b3a9
Change-Id: I66bbfd7947aa2e43a031772e9b5ae238d94e5223
|
| |
|
|
|
|
|
|
|
| |
Fixed issue where the pool "pre ping" feature would implicitly start a
transaction, which would then interfere with custom transactional flags
such as PostgreSQL's "read only" mode when used with the psycopg2 driver.
Fixes: #6621
Change-Id: I29117c393e50c090cc2587efcccfe1e986738928
|
| |\ |
|