diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-11-15 16:58:50 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-11 13:26:05 -0500 |
commit | ba5cbf9366e9b2c5ed8e27e91815d7a2c3b63e41 (patch) | |
tree | 038f2263d581d5e49d74731af68febc4bf64eb19 /lib/sqlalchemy/dialects/mysql/provision.py | |
parent | 87d58b6d8188ccff808b3207d5f9398bb9adf9b9 (diff) | |
download | sqlalchemy-ba5cbf9366e9b2c5ed8e27e91815d7a2c3b63e41.tar.gz |
correct for "autocommit" deprecation warning
Ensure no autocommit warnings occur internally or
within tests.
Also includes fixes for SQL Server full text tests
which apparently have not been working at all for a long
time, as it used long removed APIs. CI has not had
fulltext running for some years and is now installed.
Change-Id: Id806e1856c9da9f0a9eac88cebc7a94ecc95eb96
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/provision.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/provision.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/provision.py b/lib/sqlalchemy/dialects/mysql/provision.py index c1d83bbb7..50b6e3c85 100644 --- a/lib/sqlalchemy/dialects/mysql/provision.py +++ b/lib/sqlalchemy/dialects/mysql/provision.py @@ -41,12 +41,13 @@ def generate_driver_url(url, driver, query_str): @create_db.for_db("mysql", "mariadb") def _mysql_create_db(cfg, eng, ident): - with eng.connect() as conn: + with eng.begin() as conn: try: _mysql_drop_db(cfg, conn, ident) except Exception: pass + with eng.begin() as conn: conn.exec_driver_sql( "CREATE DATABASE %s CHARACTER SET utf8mb4" % ident ) @@ -66,7 +67,7 @@ def _mysql_configure_follower(config, ident): @drop_db.for_db("mysql", "mariadb") def _mysql_drop_db(cfg, eng, ident): - with eng.connect() as conn: + with eng.begin() as conn: conn.exec_driver_sql("DROP DATABASE %s_test_schema" % ident) conn.exec_driver_sql("DROP DATABASE %s_test_schema_2" % ident) conn.exec_driver_sql("DROP DATABASE %s" % ident) |