From: jun923.gu Date: Fri, 30 Nov 2018 05:21:29 +0000 (-0500) Subject: Add the write_timeout option for mysql. X-Git-Tag: rel_1_3_0b2~80^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a8454ded311010927af04db30a57d683cf67dd4;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Add the write_timeout option for mysql. As MySQLdb support read_timeout and write_timeout option, and sqlalchemy just support read_timeout option. So sqlalchemy need to add write_timeout option. Fixes: #4381 Change-Id: I2bea80bdd6f20fafc72b48fa0e5d795626d9d9b9 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4385 --- diff --git a/doc/build/changelog/unreleased_12/4381.rst b/doc/build/changelog/unreleased_12/4381.rst new file mode 100644 index 0000000000..8e6dff9549 --- /dev/null +++ b/doc/build/changelog/unreleased_12/4381.rst @@ -0,0 +1,6 @@ +.. change:: + :tag: feature, mysql + :tickets: 4381 + + Added support for the ``write_timeout`` flag accepted by mysqlclient and + pymysql to be passed in the URL string. diff --git a/lib/sqlalchemy/dialects/mysql/mysqldb.py b/lib/sqlalchemy/dialects/mysql/mysqldb.py index dfa9b52df8..edac816feb 100644 --- a/lib/sqlalchemy/dialects/mysql/mysqldb.py +++ b/lib/sqlalchemy/dialects/mysql/mysqldb.py @@ -162,6 +162,7 @@ class MySQLDialect_mysqldb(MySQLDialect): util.coerce_kw_type(opts, 'compress', bool) util.coerce_kw_type(opts, 'connect_timeout', int) util.coerce_kw_type(opts, 'read_timeout', int) + util.coerce_kw_type(opts, 'write_timeout', int) util.coerce_kw_type(opts, 'client_flag', int) util.coerce_kw_type(opts, 'local_infile', int) # Note: using either of the below will cause all strings to be diff --git a/test/dialect/mysql/test_dialect.py b/test/dialect/mysql/test_dialect.py index d06b0ddd40..44f786ee03 100644 --- a/test/dialect/mysql/test_dialect.py +++ b/test/dialect/mysql/test_dialect.py @@ -54,6 +54,7 @@ class DialectTest(fixtures.TestBase): ('compress', True), ('connect_timeout', 30), ('read_timeout', 30), + ('write_timeout', 30), ('client_flag', 1234), ('local_infile', 1234), ('use_unicode', False),