]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Emit v2.0 deprecation warning for "implicit autocommit"
authorGord Thompson <gord@gordthompson.com>
Fri, 21 Aug 2020 16:29:29 +0000 (10:29 -0600)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 28 Aug 2020 20:32:05 +0000 (16:32 -0400)
commitdc91c7db7ff32243cd2f6fc04f4e3a6d62f7b11b
tree64841da523c61fcf389110bf433d07b2f02987f6
parent5bc2532bf509307cc96b4d6233dc64104e3ce105
Emit v2.0 deprecation warning for "implicit autocommit"

"Implicit autocommit", which is the COMMIT that occurs when a DML or DDL
statement is emitted on a connection, is deprecated and won't be part of
SQLAlchemy 2.0.   A 2.0-style warning is emitted when autocommit takes
effect, so that the calling code may be adjusted to use an explicit
transaction.

As part of this change, DDL methods such as
:meth:`_schema.MetaData.create_all` when used against a
:class:`_engine.Engine` or :class:`_engine.Connection` will run the
operation in a BEGIN block if one is not started already.

The MySQL and MariaDB dialects now query from the information_schema.tables
system view in order to determine if a particular table exists or not.
Previously, the "DESCRIBE" command was used with an exception catch to
detect non-existent,  which would have the undesirable effect of emitting a
ROLLBACK on the connection. There appeared to be legacy encoding issues
which prevented the use of "SHOW TABLES", for this, but as MySQL support is
now at 5.0.2  or above due to :ticket:`4189`, the information_schema tables
are now available in all cases.

Fixes: #4846
Change-Id: I733a7e0e17477a63607fb9931c87c393bbd7ac57
19 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/migration_20.rst
doc/build/changelog/unreleased_14/4846.rst [new file with mode: 0644]
doc/build/changelog/unreleased_14/mysql_has_table.rst [new file with mode: 0644]
doc/build/core/tutorial.rst
doc/build/errors.rst
doc/build/orm/tutorial.rst
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/engine/base.py
lib/sqlalchemy/exc.py
lib/sqlalchemy/testing/__init__.py
lib/sqlalchemy/testing/assertions.py
lib/sqlalchemy/testing/schema.py
lib/sqlalchemy/testing/suite/test_types.py
test/base/test_tutorials.py
test/dialect/mssql/test_reflection.py
test/dialect/oracle/test_reflection.py
test/engine/test_ddlevents.py
test/engine/test_deprecations.py