From fa25358d0f171bd8a63729c5a8d76528f4ae74e9 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 14:39:43 +0900 Subject: [PATCH 01/30] deprecate passwd and db --- MySQLdb/connections.py | 4 ++-- doc/user_guide.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 8e226ffe..eca51ed5 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -62,9 +62,9 @@ def __init__(self, *args, **kwargs): :param str host: host to connect :param str user: user to connect as :param str password: password to use - :param str passwd: alias of password, for backward compatibility + :param str passwd: alias of password (deprecated) :param str database: database to use - :param str db: alias of database, for backward compatibility + :param str db: alias of database (deprecated) :param int port: TCP/IP port to connect to :param str unix_socket: location of unix_socket to use :param dict conv: conversion dictionary, see MySQLdb.converters diff --git a/doc/user_guide.rst b/doc/user_guide.rst index 83b800e8..decec78f 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -277,10 +277,10 @@ connect(parameters...) user user to authenticate as. Default: current effective user. - passwd + password password to authenticate with. Default: no password. - db + database database to use. Default: no default database. port From df0bc7d8e94e3d56150d05c22e5dd1d8840640b4 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 15:39:21 +0900 Subject: [PATCH 02/30] Remove INSTALL.rst It is not maintenanced. --- INSTALL.rst | 146 ---------------------------------------------------- MANIFEST.in | 1 - Makefile | 3 +- 3 files changed, 1 insertion(+), 149 deletions(-) delete mode 100644 INSTALL.rst diff --git a/INSTALL.rst b/INSTALL.rst deleted file mode 100644 index 0b49f3e6..00000000 --- a/INSTALL.rst +++ /dev/null @@ -1,146 +0,0 @@ -==================== -MySQLdb Installation -==================== - -.. contents:: -.. - -Prerequisites -------------- - -+ Python 3.5 or higher - -+ setuptools - - * https://pypi.org/project/setuptools/ - -+ MySQL 5.5 or higher - - * https://www.mysql.com/downloads/ - - * MySQL 5.1 may work, but not supported. - -+ C compiler - - * Most free software-based systems already have this, usually gcc. - - * Most commercial UNIX platforms also come with a C compiler, or - you can also use gcc. - - * If you have some Windows flavor, you should use Windows SDK or - Visual C++. - - -Building and installing ------------------------ - -The setup.py script uses mysql_config to find all compiler and linker -options, and should work as is on any POSIX-like platform, so long as -mysql_config is in your path. - -Depending on which version of MySQL you have, you may have the option -of using three different client libraries. To select the client library, -edit the [options] section of site.cfg: - - static - if True, try to link against a static library; otherwise link - against dynamic libraries (default). - This option doesn't work for MySQL>5.6 since libmysqlclient - requires libstdc++. If you want to use, add `-lstdc++` to - mysql_config manually. - -If `/lib` is not added to `/etc/ld.so.conf`, `import _mysql` -doesn't work. To fix this, (1) set `LD_LIBRARY_PATH`, or (2) add -`-Wl,-rpath,/lib` to ldflags in your mysql_config. - -Finally, putting it together:: - - $ tar xz mysqlclient-1.3.6.tar.gz - $ cd mysqlclient-1.3.6 - $ # edit site.cfg if necessary - $ python setup.py build - $ sudo python setup.py install # or su first - - -Windows -....... - -I don't do Windows. However if someone provides me with a package for -Windows, I'll make it available. Don't ask me for help with Windows -because I can't help you. - -Generally, though, running setup.py is similar to above:: - - C:\...> python setup.py install - C:\...> python setup.py bdist_wininst - -The latter example should build a Windows installer package, if you -have the correct tools. In any event, you *must* have a C compiler. -Additionally, you have to set an environment variable (mysqlroot) -which is the path to your MySQL installation. In theory, it would be -possible to get this information out of the registry, but like I said, -I don't do Windows, but I'll accept a patch that does this. - -On Windows, you will definitely have to edit site.cfg since there is -no mysql_config in the MySQL package. - - -Binary Packages ---------------- - -I don't plan to make binary packages any more. However, if someone -contributes one, I will make it available. Several OS vendors have -their own packages available. - - -Red Hat Linux -............. - -MySQL-python is pre-packaged in Red Hat Linux 7.x and newer. This -includes Fedora Core and Red Hat Enterprise Linux. - - -Debian GNU/Linux -................ - -Packaged as `python-mysqldb`_:: - - # apt-get install python-mysqldb - -Or use Synaptic. - -.. _`python-mysqldb`: http://packages.debian.org/python-mysqldb - - -Ubuntu -...... - -Same as with Debian. - - -Gentoo Linux -............ - -Packaged as `mysql-python`_. :: - - # emerge sync - # emerge mysql-python - # emerge zmysqlda # if you use Zope - -.. _`mysql-python`: https://packages.gentoo.org/packages/search?q=mysql-python - - -BSD -... - -MySQL-python is a ported package in FreeBSD, NetBSD, and OpenBSD, -although the name may vary to match OS conventions. - - -License -------- - -GPL or the original license based on Python 1.5.2's license. - - -:Author: Andy Dustman diff --git a/MANIFEST.in b/MANIFEST.in index 415a995a..07563caf 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ recursive-include tests *.py include doc/conf.py include MANIFEST.in include HISTORY.rst -include INSTALL.rst include README.md include LICENSE include metadata.cfg diff --git a/Makefile b/Makefile index 8c8cddc8..a3d65492 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,6 @@ doc: .PHONY: clean clean: + python3 setup.py clean find . -name '*.pyc' -delete find . -name '__pycache__' -delete - rm *.so - python3 setup.py clean From 3129b24328adbae873005d76c7c822e534d841dc Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 15:48:05 +0900 Subject: [PATCH 03/30] Update Makefile. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a3d65492..783d1919 100644 --- a/Makefile +++ b/Makefile @@ -13,3 +13,4 @@ clean: python3 setup.py clean find . -name '*.pyc' -delete find . -name '__pycache__' -delete + rm -rf build From 3e95f351d4b90590afe69f90d84382111a04f020 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 15:49:11 +0900 Subject: [PATCH 04/30] Move codecov.yml --- MySQLdb/codecov.yml => codecov.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename MySQLdb/codecov.yml => codecov.yml (100%) diff --git a/MySQLdb/codecov.yml b/codecov.yml similarity index 100% rename from MySQLdb/codecov.yml rename to codecov.yml From 729ec54e39b868dd6970ee9779fed8354657d9a4 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 16:03:50 +0900 Subject: [PATCH 05/30] Update README --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f65329cf..79617fd0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ # mysqlclient -[![Build Status](https://secure.travis-ci.org/PyMySQL/mysqlclient-python.png)](http://travis-ci.org/PyMySQL/mysqlclient-python) +This project is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). +This project adds Python 3 support and fixed many bugs. -This is a fork of [MySQLdb1](https://github.com/farcepest/MySQLdb1). - -This project adds Python 3 support and bug fixes. -I hope this fork is merged back to MySQLdb1 like distribute was merged back to setuptools. +* PyPI: https://pypi.org/project/mysqlclient/ +* GitHub: https://github.com/PyMySQL/mysqlclient ## Support @@ -83,4 +82,3 @@ $ pip install mysqlclient ### Documentation Documentation is hosted on [Read The Docs](https://mysqlclient.readthedocs.io/) - From af563dbf5186b406190d1337beea99f9f6f05cb9 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 16:28:06 +0900 Subject: [PATCH 06/30] Use unittest.mock instead of mock (#469) --- .github/workflows/tests.yaml | 2 +- tests/test_MySQLdb_times.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 748d2c2b..2544b397 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -25,7 +25,7 @@ jobs: TESTDB: actions.cnf run: | pip install -U pip - pip install -U mock coverage pytest pytest-cov + pip install -U coverage pytest pytest-cov pip install . pytest --cov ./MySQLdb - uses: codecov/codecov-action@v1 diff --git a/tests/test_MySQLdb_times.py b/tests/test_MySQLdb_times.py index 0947f3e5..2081b1ac 100644 --- a/tests/test_MySQLdb_times.py +++ b/tests/test_MySQLdb_times.py @@ -1,11 +1,11 @@ -import mock -import unittest -from time import gmtime from datetime import time, date, datetime, timedelta +from time import gmtime +import unittest +from unittest import mock +import warnings from MySQLdb import times -import warnings warnings.simplefilter("ignore") From 52c2a12861b5bb3cd53ac5438b5905affe254a97 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 16:29:52 +0900 Subject: [PATCH 07/30] Actions: Use fetch-depth:2 for codecov --- .github/workflows/tests.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2544b397..359ac575 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -16,6 +16,8 @@ jobs: sudo systemctl start mysql.service mysql -uroot -proot -e "CREATE DATABASE mysqldb_test" - uses: actions/checkout@v2 + with: + fetch-depth: 2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 67eb9c51346408049010f65bfb646978ebacc512 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 16:43:36 +0900 Subject: [PATCH 08/30] Actions: Fix pytest args (#470) --- .github/workflows/tests.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 359ac575..6f4bea3b 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -26,8 +26,7 @@ jobs: env: TESTDB: actions.cnf run: | - pip install -U pip pip install -U coverage pytest pytest-cov pip install . - pytest --cov ./MySQLdb + pytest --cov=MySQLdb tests - uses: codecov/codecov-action@v1 From ca3ed6ae6745a13365cd849a801ba61f076835ee Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 16:45:47 +0900 Subject: [PATCH 09/30] Actions: Use cache --- .github/workflows/tests.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6f4bea3b..ea0b29b3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -15,13 +15,23 @@ jobs: run: | sudo systemctl start mysql.service mysql -uroot -proot -e "CREATE DATABASE mysqldb_test" + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-1 + restore-keys: | + ${{ runner.os }}-pip- + - uses: actions/checkout@v2 with: fetch-depth: 2 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} + - name: Run tests env: TESTDB: actions.cnf @@ -29,4 +39,5 @@ jobs: pip install -U coverage pytest pytest-cov pip install . pytest --cov=MySQLdb tests + - uses: codecov/codecov-action@v1 From 44eace06defd6c192dc5be124d275f1b9268735a Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 17:31:17 +0900 Subject: [PATCH 10/30] Actions: Fix measuring coverage (#471) --- .github/workflows/tests.yaml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ea0b29b3..5d45b6a5 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -32,12 +32,18 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install dependencies + env: + PIP_NO_PYTHON_VERSION_WARNING: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 + run: | + pip install -U coverage pytest pytest-cov + python setup.py develop + - name: Run tests env: TESTDB: actions.cnf run: | - pip install -U coverage pytest pytest-cov - pip install . pytest --cov=MySQLdb tests - uses: codecov/codecov-action@v1 From 24aaa72c1503fe35cb1d0584ad553b41d10ddb48 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 8 Jan 2021 17:39:31 +0900 Subject: [PATCH 11/30] cleanup --- MySQLdb/__init__.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/MySQLdb/__init__.py b/MySQLdb/__init__.py index 824acace..f56d8101 100644 --- a/MySQLdb/__init__.py +++ b/MySQLdb/__init__.py @@ -54,11 +54,6 @@ TimestampFromTicks, ) -try: - frozenset -except NameError: - from sets import ImmutableSet as frozenset - threadsafety = 1 apilevel = "2.0" paramstyle = "format" From 8f1fd73dd365ebf2e1785e77c8045f3e6abe3529 Mon Sep 17 00:00:00 2001 From: Simon Lundmark Date: Fri, 3 Sep 2021 04:01:58 +0200 Subject: [PATCH 12/30] multi statements can be disabled (#500) --- MySQLdb/connections.py | 13 +++++++++++-- tests/test_connection.py | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 tests/test_connection.py diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index eca51ed5..7adc8835 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -110,6 +110,10 @@ class object, used to create cursors (keyword only) :param int client_flag: flags to use or 0 (see MySQL docs or constants/CLIENTS.py) + :param bool multi_statements: + If True, enable multi statements for clients >= 4.1. + Defaults to True. + :param str ssl_mode: specify the security settings for connection to the server; see the MySQL documentation for more details @@ -169,11 +173,16 @@ class object, used to create cursors (keyword only) self._binary_prefix = kwargs2.pop("binary_prefix", False) client_flag = kwargs.get("client_flag", 0) + client_version = tuple( [numeric_part(n) for n in _mysql.get_client_info().split(".")[:2]] ) - if client_version >= (4, 1): - client_flag |= CLIENT.MULTI_STATEMENTS + + multi_statements = kwargs2.pop("multi_statements", True) + if multi_statements: + if client_version >= (4, 1): + client_flag |= CLIENT.MULTI_STATEMENTS + if client_version >= (5, 0): client_flag |= CLIENT.MULTI_RESULTS diff --git a/tests/test_connection.py b/tests/test_connection.py new file mode 100644 index 00000000..960de572 --- /dev/null +++ b/tests/test_connection.py @@ -0,0 +1,26 @@ +import pytest + +from MySQLdb._exceptions import ProgrammingError + +from configdb import connection_factory + + +def test_multi_statements_default_true(): + conn = connection_factory() + cursor = conn.cursor() + + cursor.execute("select 17; select 2") + rows = cursor.fetchall() + assert rows == ((17,),) + + +def test_multi_statements_false(): + conn = connection_factory(multi_statements=False) + cursor = conn.cursor() + + with pytest.raises(ProgrammingError): + cursor.execute("select 17; select 2") + + cursor.execute("select 17") + rows = cursor.fetchall() + assert rows == ((17,),) From 355520dae017daf74505702a842443ff297dad06 Mon Sep 17 00:00:00 2001 From: Ryan Siemens Date: Thu, 2 Sep 2021 19:02:27 -0700 Subject: [PATCH 13/30] Remove bytes encoder that was specifically for Django 1.11 (#490) --- MySQLdb/connections.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 7adc8835..31f131db 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -195,13 +195,6 @@ class object, used to create cursors (keyword only) self.cursorclass = cursorclass self.encoders = {k: v for k, v in conv.items() if type(k) is not int} - # XXX THIS IS GARBAGE: While this is just a garbage and undocumented, - # Django 1.11 depends on it. And they don't fix it because - # they are in security-only fix mode. - # So keep this garbage for now. This will be removed in 1.5. - # See PyMySQL/mysqlclient-python#306 - self.encoders[bytes] = bytes - self._server_version = tuple( [numeric_part(n) for n in self.get_server_info().split(".")[:2]] ) From 62ddd30bb2b2585434d3f20c19e4869307faf8a1 Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 3 Sep 2021 04:02:49 +0200 Subject: [PATCH 14/30] update remnants of passwd and db also in docs (#488) --- doc/user_guide.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/user_guide.rst b/doc/user_guide.rst index decec78f..a00f292c 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -125,19 +125,19 @@ We haven't even begun to touch upon all the parameters ``connect()`` can take. For this reason, I prefer to use keyword parameters:: db=_mysql.connect(host="localhost",user="joebob", - passwd="moonpie",db="thangs") + password="moonpie",database="thangs") This does exactly what the last example did, but is arguably easier to read. But since the default host is "localhost", and if your login name really was "joebob", you could shorten it to this:: - db=_mysql.connect(passwd="moonpie",db="thangs") + db=_mysql.connect(password="moonpie",database="thangs") UNIX sockets and named pipes don't work over a network, so if you specify a host other than localhost, TCP will be used, and you can specify an odd port if you need to (the default port is 3306):: - db=_mysql.connect(host="outhouse",port=3307,passwd="moonpie",db="thangs") + db=_mysql.connect(host="outhouse",port=3307,password="moonpie",database="thangs") If you really had to, you could connect to the local host with TCP by specifying the full host name, or 127.0.0.1. @@ -145,7 +145,7 @@ specifying the full host name, or 127.0.0.1. Generally speaking, putting passwords in your code is not such a good idea:: - db=_mysql.connect(host="outhouse",db="thangs",read_default_file="~/.my.cnf") + db=_mysql.connect(host="outhouse",database="thangs",read_default_file="~/.my.cnf") This does what the previous example does, but gets the username and password and other parameters from ~/.my.cnf (UNIX-like systems). Read @@ -561,7 +561,7 @@ Some examples The ``connect()`` method works nearly the same as with `MySQLDB._mysql`_:: import MySQLdb - db=MySQLdb.connect(passwd="moonpie",db="thangs") + db=MySQLdb.connect(password="moonpie",database="thangs") To perform a query, you first need a cursor, and then you can execute queries on it:: From 180c9df4ab8325b75f6b26070951fd852ec76614 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 3 Sep 2021 11:05:26 +0900 Subject: [PATCH 15/30] Remove -lzstd for non-static build --- setup_posix.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_posix.py b/setup_posix.py index e556f5c5..99763cbc 100644 --- a/setup_posix.py +++ b/setup_posix.py @@ -128,7 +128,7 @@ def get_config(): if use_mysqlconfig_cflags: # mysql_config may have "-lmysqlclient -lz -lssl -lcrypto", but zlib and # ssl is not used by _mysql. They are needed only for static build. - for L in ("crypto", "ssl", "z"): + for L in ("crypto", "ssl", "z", "zstd"): if L in libraries: libraries.remove(L) From 4bb85b25775b9192923fd0c19b07db61a2e4002b Mon Sep 17 00:00:00 2001 From: Ben Buchwald Date: Thu, 2 Sep 2021 22:10:11 -0400 Subject: [PATCH 16/30] Better support for building on Windows (#484) --- README.md | 16 +++++++++++++++ setup_windows.py | 52 +++++++++++++++++++++++------------------------- site.cfg | 2 +- 3 files changed, 42 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 79617fd0..4dbc54d7 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,22 @@ Or when you have question about MySQL: Building mysqlclient on Windows is very hard. But there are some binary wheels you can install easily. +If binary wheels do not exist for your version of Python, it may be possible to +build from source, but if this does not work, **do not come asking for support.** +To build from source, download the +[MariaDB C Connector](https://mariadb.com/downloads/#connectors) and install +it. It must be installed in the default location +(usually "C:\Program Files\MariaDB\MariaDB Connector C" or +"C:\Program Files (x86)\MariaDB\MariaDB Connector C" for 32-bit). If you +build the connector yourself or install it in a different location, set the +environment variable `MYSQLCLIENT_CONNECTOR` before installing. Once you have +the connector installed and an appropriate version of Visual Studio for your +version of Python: + +``` +$ pip install mysqlclient +``` + ### macOS (Homebrew) Install MySQL and mysqlclient: diff --git a/setup_windows.py b/setup_windows.py index c25cc52b..b2feb7d2 100644 --- a/setup_windows.py +++ b/setup_windows.py @@ -1,6 +1,5 @@ import os import sys -from distutils.msvccompiler import get_build_version def get_config(): @@ -8,35 +7,34 @@ def get_config(): metadata, options = get_metadata_and_options() - connector = options["connector"] + client = "mariadbclient" + connector = os.environ.get("MYSQLCLIENT_CONNECTOR", options.get("connector")) + if not connector: + connector = os.path.join( + os.environ["ProgramFiles"], "MariaDB", "MariaDB Connector C" + ) extra_objects = [] - # client = "mysqlclient" - client = "mariadbclient" - - vcversion = int(get_build_version()) - if client == "mariadbclient": - library_dirs = [os.path.join(connector, "lib", "mariadb")] - libraries = [ - "kernel32", - "advapi32", - "wsock32", - "shlwapi", - "Ws2_32", - "crypt32", - "secur32", - "bcrypt", - client, - ] - include_dirs = [os.path.join(connector, "include", "mariadb")] - else: - library_dirs = [ - os.path.join(connector, r"lib\vs%d" % vcversion), - os.path.join(connector, "lib"), - ] - libraries = ["kernel32", "advapi32", "wsock32", client] - include_dirs = [os.path.join(connector, r"include")] + library_dirs = [ + os.path.join(connector, "lib", "mariadb"), + os.path.join(connector, "lib"), + ] + libraries = [ + "kernel32", + "advapi32", + "wsock32", + "shlwapi", + "Ws2_32", + "crypt32", + "secur32", + "bcrypt", + client, + ] + include_dirs = [ + os.path.join(connector, "include", "mariadb"), + os.path.join(connector, "include"), + ] extra_link_args = ["/MANIFEST"] diff --git a/site.cfg b/site.cfg index 6b4596a4..08a14b0e 100644 --- a/site.cfg +++ b/site.cfg @@ -9,4 +9,4 @@ static = False # http://stackoverflow.com/questions/1972259/mysql-python-install-problem-using-virtualenv-windows-pip # Windows connector libs for MySQL. You need a 32-bit connector for your 32-bit Python build. -connector = C:\Program Files (x86)\MySQL\MySQL Connector C 6.1 +connector = From aa28721d073de9d023a172904a7de4f032476219 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Fri, 3 Sep 2021 11:30:40 +0900 Subject: [PATCH 17/30] Use utf8mb4 in test_binary_prefix (#501) --- tests/test_MySQLdb_capabilities.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_MySQLdb_capabilities.py b/tests/test_MySQLdb_capabilities.py index 0b4dd21a..fc213b84 100644 --- a/tests/test_MySQLdb_capabilities.py +++ b/tests/test_MySQLdb_capabilities.py @@ -182,7 +182,7 @@ def test_binary_prefix(self): for binary_prefix in (True, False, None): kwargs = self.connect_kwargs.copy() # needs to be set to can guarantee CHARSET response for normal strings - kwargs["charset"] = "utf8" + kwargs["charset"] = "utf8mb4" if binary_prefix is not None: kwargs["binary_prefix"] = binary_prefix @@ -190,11 +190,11 @@ def test_binary_prefix(self): with closing(conn.cursor()) as c: c.execute("SELECT CHARSET(%s)", (MySQLdb.Binary(b"raw bytes"),)) self.assertEqual( - c.fetchall()[0][0], "binary" if binary_prefix else "utf8" + c.fetchall()[0][0], "binary" if binary_prefix else "utf8mb4" ) # normal strings should not get prefix c.execute("SELECT CHARSET(%s)", ("str",)) - self.assertEqual(c.fetchall()[0][0], "utf8") + self.assertEqual(c.fetchall()[0][0], "utf8mb4") if __name__ == "__main__": From 3ee07a031f06f660586765f5484d30953a69fe70 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 12:56:59 +0900 Subject: [PATCH 18/30] Windows: Update MariaDB Connector to 3.2.4 (#508) --- .github/workflows/windows.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yaml b/.github/workflows/windows.yaml index c65ce188..ac9b28da 100644 --- a/.github/workflows/windows.yaml +++ b/.github/workflows/windows.yaml @@ -10,7 +10,7 @@ jobs: build: runs-on: windows-latest env: - CONNECTOR_VERSION: "3.1.11" + CONNECTOR_VERSION: "3.2.4" steps: - name: Cache Connector @@ -61,14 +61,14 @@ jobs: shell: cmd working-directory: mysqlclient run: | + py -3.10 -m pip install -U setuptools wheel pip + py -3.10 setup.py bdist_wheel py -3.9 -m pip install -U setuptools wheel pip py -3.9 setup.py bdist_wheel py -3.8 -m pip install -U setuptools wheel pip py -3.8 setup.py bdist_wheel py -3.7 -m pip install -U setuptools wheel pip py -3.7 setup.py bdist_wheel - py -3.6 -m pip install -U setuptools wheel pip - py -3.6 setup.py bdist_wheel - name: Upload Wheel uses: actions/upload-artifact@v2 @@ -81,12 +81,12 @@ jobs: working-directory: mysqlclient/dist run: | ls -la + py -3.10 -m pip install --no-index --find-links . mysqlclient + py -3.10 -c "import MySQLdb; print(MySQLdb.version_info)" py -3.9 -m pip install --no-index --find-links . mysqlclient py -3.9 -c "import MySQLdb; print(MySQLdb.version_info)" py -3.8 -m pip install --no-index --find-links . mysqlclient py -3.8 -c "import MySQLdb; print(MySQLdb.version_info)" py -3.7 -m pip install --no-index --find-links . mysqlclient py -3.7 -c "import MySQLdb; print(MySQLdb.version_info)" - py -3.6 -m pip install --no-index --find-links . mysqlclient - py -3.6 -c "import MySQLdb; print(MySQLdb.version_info)" From dee7d882717ebccf5a468719254107a3c67561dd Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 13:11:16 +0900 Subject: [PATCH 19/30] set_character_set() sends "SET NAMES" always. (#509) Fix: #504. --- MySQLdb/connections.py | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 31f131db..482b12f0 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -200,10 +200,6 @@ class object, used to create cursors (keyword only) ) self.encoding = "ascii" # overridden in set_character_set() - db = proxy(self) - - def unicode_literal(u, dummy=None): - return db.string_literal(u.encode(db.encoding)) if not charset: charset = self.character_set_name() @@ -227,7 +223,13 @@ def unicode_literal(u, dummy=None): # MySQL may return JSON with charset==binary. self.converter[FIELD_TYPE.JSON] = str + db = proxy(self) + + def unicode_literal(u, dummy=None): + return db.string_literal(u.encode(db.encoding)) + self.encoders[str] = unicode_literal + self._transactional = self.server_capabilities & CLIENT.TRANSACTIONS if self._transactional: if autocommit is not None: @@ -300,32 +302,10 @@ def begin(self): """ self.query(b"BEGIN") - if not hasattr(_mysql.connection, "warning_count"): - - def warning_count(self): - """Return the number of warnings generated from the - last query. This is derived from the info() method.""" - info = self.info() - if info: - return int(info.split()[-1]) - else: - return 0 - def set_character_set(self, charset): - """Set the connection character set to charset. The character - set can only be changed in MySQL-4.1 and newer. If you try - to change the character set from the current value in an - older version, NotSupportedError will be raised.""" - py_charset = _charset_to_encoding.get(charset, charset) - if self.character_set_name() != charset: - try: - super().set_character_set(charset) - except AttributeError: - if self._server_version < (4, 1): - raise NotSupportedError("server is too old to set charset") - self.query("SET NAMES %s" % charset) - self.store_result() - self.encoding = py_charset + """Set the connection character set to charset.""" + super().set_character_set(charset) + self.encoding = _charset_to_encoding.get(charset, charset) def set_sql_mode(self, sql_mode): """Set the connection sql_mode. See MySQL documentation for From 16d139c61f6e927ad950dc5d15da11e4b4dd994e Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 13:19:58 +0900 Subject: [PATCH 20/30] Remove escape() and escape_string() from MySQLdb. (#511) --- MySQLdb/__init__.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/MySQLdb/__init__.py b/MySQLdb/__init__.py index f56d8101..b567363b 100644 --- a/MySQLdb/__init__.py +++ b/MySQLdb/__init__.py @@ -38,8 +38,6 @@ string_literal, MySQLError, DataError, - escape, - escape_string, DatabaseError, InternalError, Warning, @@ -164,8 +162,6 @@ def Connect(*args, **kwargs): "converters", "cursors", "debug", - "escape", - "escape_string", "get_client_info", "paramstyle", "string_literal", From 204fb123683454cdb670e0065f09e50d425b94c8 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 15:04:33 +0900 Subject: [PATCH 21/30] _mysql: db -> database, passwd -> password (#513) --- MySQLdb/_mysql.c | 2 +- MySQLdb/connections.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 27880ca2..0f6e9f5c 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -414,7 +414,7 @@ _mysql_ConnectionObject_Initialize( *db = NULL, *unix_socket = NULL; unsigned int port = 0; unsigned int client_flag = 0; - static char *kwlist[] = { "host", "user", "passwd", "db", "port", + static char *kwlist[] = { "host", "user", "password", "database", "port", "unix_socket", "conv", "connect_timeout", "compress", "named_pipe", "init_command", diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 482b12f0..89cb7c9a 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -148,10 +148,10 @@ class object, used to create cursors (keyword only) kwargs2 = kwargs.copy() - if "database" in kwargs2: - kwargs2["db"] = kwargs2.pop("database") - if "password" in kwargs2: - kwargs2["passwd"] = kwargs2.pop("password") + if "db" in kwargs2: + kwargs2["database"] = kwargs2.pop("db") + if "passwd" in kwargs2: + kwargs2["password"] = kwargs2.pop("passwd") if "conv" in kwargs: conv = kwargs["conv"] From 5c04abf87d32a3254dd481c03740a8c56520bc3a Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 15:25:19 +0900 Subject: [PATCH 22/30] Always set MULTI_RESULTS flag (#515) --- MySQLdb/connections.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/MySQLdb/connections.py b/MySQLdb/connections.py index 89cb7c9a..38324665 100644 --- a/MySQLdb/connections.py +++ b/MySQLdb/connections.py @@ -173,19 +173,10 @@ class object, used to create cursors (keyword only) self._binary_prefix = kwargs2.pop("binary_prefix", False) client_flag = kwargs.get("client_flag", 0) - - client_version = tuple( - [numeric_part(n) for n in _mysql.get_client_info().split(".")[:2]] - ) - + client_flag |= CLIENT.MULTI_RESULTS multi_statements = kwargs2.pop("multi_statements", True) if multi_statements: - if client_version >= (4, 1): - client_flag |= CLIENT.MULTI_STATEMENTS - - if client_version >= (5, 0): - client_flag |= CLIENT.MULTI_RESULTS - + client_flag |= CLIENT.MULTI_STATEMENTS kwargs2["client_flag"] = client_flag # PEP-249 requires autocommit to be initially off From cda3b37e9ef894c8913e33620471580fcf13c09a Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 15:58:58 +0900 Subject: [PATCH 23/30] Actions: Add Python 3.10 and remove 3.5. (#516) --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 5d45b6a5..e3c0fec1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - name: Start MySQL run: | From f837c5e00df1115002b4361f1b5ce6b07076faf5 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 15:59:17 +0900 Subject: [PATCH 24/30] Update metadata to support Python 3.10. --- metadata.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/metadata.cfg b/metadata.cfg index 2a2e64fa..c68840b2 100644 --- a/metadata.cfg +++ b/metadata.cfg @@ -24,6 +24,7 @@ classifiers: Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 Topic :: Database Topic :: Database :: Database Engines/Servers py_modules: From 4b48f627b31a34250188dca6e4f73cea3fee2ac1 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 16:53:38 +0900 Subject: [PATCH 25/30] 2.1.0rc1 --- metadata.cfg | 4 ++-- setup_common.py | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/metadata.cfg b/metadata.cfg index c68840b2..81523713 100644 --- a/metadata.cfg +++ b/metadata.cfg @@ -1,6 +1,6 @@ [metadata] -version: 2.0.3 -version_info: (2,0,3,'final',0) +version: 2.1.0rc1 +version_info: (2,1,0,'rc',1) description: Python interface to MySQL author: Inada Naoki author_email: songofacandy@gmail.com diff --git a/setup_common.py b/setup_common.py index 28c51829..60ad30f7 100644 --- a/setup_common.py +++ b/setup_common.py @@ -26,12 +26,11 @@ def enabled(options, option): def create_release_file(metadata): - with open("MySQLdb/release.py", "w") as rel: + with open("MySQLdb/release.py", "w", encoding="utf-8") as rel: rel.write( """ __author__ = "%(author)s <%(author_email)s>" version_info = %(version_info)s __version__ = "%(version)s" -""" - % metadata +""" % metadata ) From 8ff7f8f355bebd0603dadb31dd6590b1f84a1a0b Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 17:00:34 +0900 Subject: [PATCH 26/30] Update HISTORY --- HISTORY.rst | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 16fcbd59..0b39d23a 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -1,3 +1,22 @@ +====================== + What's new in 2.1.0 +====================== + +Release: 2021-10-19 (rc1) + +* Add ``multistatement=True`` option. You can disable multi statement. (#500). +* Remove unnecessary bytes encoder which is remained for Django 1.11 + compatibility (#490). +* Deprecate ``passwd`` and ``db`` keyword. Use ``password`` and ``database`` + instead. (#488). +* Windows: Binary wheels are built with MariaDB Connector/C 3.2.4. (#508) +* ``set_character_set()`` sends ``SET NAMES`` query always. This means + all new connections send it too. This solves compatibility issues + when server and client library are different version. (#509) +* Remove ``escape()`` and ``escape_string()`` from ``MySQLdb`` package. + (#511) +* Add Python 3.10 support and drop Python 3.5 support. + ====================== What's new in 2.0.3 ====================== From 267e784e5abe202862e679b27705c9ae03c7d096 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 19 Oct 2021 17:02:44 +0900 Subject: [PATCH 27/30] black --- setup_common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup_common.py b/setup_common.py index 60ad30f7..5b6927ac 100644 --- a/setup_common.py +++ b/setup_common.py @@ -32,5 +32,6 @@ def create_release_file(metadata): __author__ = "%(author)s <%(author_email)s>" version_info = %(version_info)s __version__ = "%(version)s" -""" % metadata +""" + % metadata ) From 8b920774f27d9d17bc85d1593e5d4a36a7ce3f65 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 20 Oct 2021 16:34:39 +0900 Subject: [PATCH 28/30] Action: Run Django tests (#519) --- .github/workflows/django.yaml | 53 +++++++++++++++++++++++++++++ .travis.yml | 63 ----------------------------------- ci/test_mysql.py | 8 ++--- 3 files changed, 57 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/django.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/django.yaml b/.github/workflows/django.yaml new file mode 100644 index 00000000..4e18374a --- /dev/null +++ b/.github/workflows/django.yaml @@ -0,0 +1,53 @@ +name: Django compat test + +on: + push: + +jobs: + build: + runs-on: ubuntu-20.04 + steps: + - name: Start MySQL + run: | + sudo systemctl start mysql.service + mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql + mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;" + + - uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-django-pip-1 + restore-keys: | + ${{ runner.os }}-pip- + + - name: Set up Python + uses: actions/setup-python@v2 + with: + # https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html + python-version: "3.8" + + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Install mysqlclient + env: + PIP_NO_PYTHON_VERSION_WARNING: 1 + PIP_DISABLE_PIP_VERSION_CHECK: 1 + run: | + pip install -U pytest pytest-cov tblib + pip install . + # pip install mysqlclient # Use stable version + + - name: Run Django test + env: + DJANGO_VERSION: "2.2.24" + run: | + sudo apt-get install libmemcached-dev + wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz + tar xf ${DJANGO_VERSION}.tar.gz + cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/ + cd django-${DJANGO_VERSION}/tests/ + pip install .. + pip install -r requirements/py3.txt + PYTHONPATH=.. python3 ./runtests.py --settings=test_mysql diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 75c6d425..00000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -dist: bionic -language: python - -# See aws s3 ls s3://travis-python-archives/binaries/ubuntu/18.04/x86_64/ -python: - - "nightly" - - "pypy3" - -cache: pip - -services: - - mysql - -install: - - pip install -U pip - - pip install -U mock coverage pytest pytest-cov codecov - -env: - global: - - TESTDB=travis.cnf - -before_script: - - "mysql --help" - - "mysql --print-defaults" - - "mysql -e 'create database mysqldb_test charset utf8mb4;'" - -script: - - pip install -e . - - pytest --cov ./MySQLdb - -after_success: - - codecov - -jobs: - fast_finish: true - include: - - &django_2_2 - name: "Django 2.2 test" - env: - - DJANGO_VERSION=2.2.7 - python: "3.8" - install: - - pip install -U pip - - wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz - - tar xf ${DJANGO_VERSION}.tar.gz - - pip install -e django-${DJANGO_VERSION}/ - - cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/ - - pip install . - - before_script: - - mysql -e 'create user django identified by "secret"' - - mysql -e 'grant all on *.* to django' - - mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql - - script: - - cd django-${DJANGO_VERSION}/tests/ - - ./runtests.py --parallel=2 --settings=test_mysql - #- &django_3_0 - # <<: *django_2_2 - # name: "Django 3.0 test (Python 3.8)" - # python: "3.8" - -# vim: sw=2 ts=2 sts=2 diff --git a/ci/test_mysql.py b/ci/test_mysql.py index 88a747a6..e285f4cf 100644 --- a/ci/test_mysql.py +++ b/ci/test_mysql.py @@ -16,17 +16,17 @@ "default": { "ENGINE": "django.db.backends.mysql", "NAME": "django_default", - "USER": "django", "HOST": "127.0.0.1", - "PASSWORD": "secret", + "USER": "scott", + "PASSWORD": "tiger", "TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"}, }, "other": { "ENGINE": "django.db.backends.mysql", "NAME": "django_other", - "USER": "django", "HOST": "127.0.0.1", - "PASSWORD": "secret", + "USER": "scott", + "PASSWORD": "tiger", "TEST": {"CHARSET": "utf8mb4", "COLLATION": "utf8mb4_general_ci"}, }, } From 6ebc1a1972dee69fb54b56867fc795ee220b5d79 Mon Sep 17 00:00:00 2001 From: Kian Meng Ang Date: Wed, 17 Nov 2021 16:38:58 +0800 Subject: [PATCH 29/30] Fix typos (#520) --- HISTORY.rst | 4 ++-- MySQLdb/_mysql.c | 2 +- MySQLdb/cursors.py | 4 ++-- doc/user_guide.rst | 2 +- tests/dbapi20.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 0b39d23a..8bd4c2cc 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -94,7 +94,7 @@ Release: 2019-08-09 * ``--static`` build supports ``libmariadbclient.a`` * Try ``mariadb_config`` when ``mysql_config`` is not found -* Fixed warning happend in Python 3.8 (#359) +* Fixed warning happened in Python 3.8 (#359) * Fixed ``from MySQLdb import *``, while I don't recommend it. (#369) * Fixed SEGV ``MySQLdb.escape_string("1")`` when libmariadb is used and no connection is created. (#367) @@ -294,7 +294,7 @@ More tests for date and time columns. (#41) Fix calling .execute() method for closed cursor cause TypeError. (#37) -Improve peformance to parse date. (#43) +Improve performance to parse date. (#43) Support geometry types (#49) diff --git a/MySQLdb/_mysql.c b/MySQLdb/_mysql.c index 0f6e9f5c..f10cd015 100644 --- a/MySQLdb/_mysql.c +++ b/MySQLdb/_mysql.c @@ -310,7 +310,7 @@ _mysql_ResultObject_Initialize( PyObject *fun2=NULL; int j, n2=PySequence_Size(fun); // BINARY_FLAG means ***_bin collation is used. - // To distinguish text and binary, we shoud use charsetnr==63 (binary). + // To distinguish text and binary, we should use charsetnr==63 (binary). // But we abuse BINARY_FLAG for historical reason. if (fields[i].charsetnr == 63) { flags |= BINARY_FLAG; diff --git a/MySQLdb/cursors.py b/MySQLdb/cursors.py index 451dab5f..f8a48640 100644 --- a/MySQLdb/cursors.py +++ b/MySQLdb/cursors.py @@ -375,7 +375,7 @@ def fetchmany(self, size=None): return result def fetchall(self): - """Fetchs all available rows from the cursor.""" + """Fetches all available rows from the cursor.""" self._check_executed() if self.rownumber: result = self._rows[self.rownumber :] @@ -437,7 +437,7 @@ def fetchmany(self, size=None): return r def fetchall(self): - """Fetchs all available rows from the cursor.""" + """Fetches all available rows from the cursor.""" self._check_executed() r = self._fetch_row(0) self.rownumber = self.rownumber + len(r) diff --git a/doc/user_guide.rst b/doc/user_guide.rst index a00f292c..555adf15 100644 --- a/doc/user_guide.rst +++ b/doc/user_guide.rst @@ -511,7 +511,7 @@ callproc(procname, args) can only be returned with a SELECT statement. Since a stored procedure may return zero or more result sets, it is impossible for MySQLdb to determine if there are result sets to fetch - before the modified parmeters are accessible. + before the modified parameters are accessible. The parameters are stored in the server as @_*procname*_*n*, where *n* is the position of the parameter. I.e., if you diff --git a/tests/dbapi20.py b/tests/dbapi20.py index 4824d9cc..4965c9bf 100644 --- a/tests/dbapi20.py +++ b/tests/dbapi20.py @@ -793,7 +793,7 @@ def test_setoutputsize_basic(self): con.close() def test_setoutputsize(self): - # Real test for setoutputsize is driver dependant + # Real test for setoutputsize is driver dependent raise NotImplementedError("Driver need to override this test") def test_None(self): From 5340191feb16b1f99a7b43fe7c74a2f690138cb1 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Wed, 17 Nov 2021 17:46:52 +0900 Subject: [PATCH 30/30] 2.1.0 --- HISTORY.rst | 2 +- metadata.cfg | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 8bd4c2cc..19d57bee 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,7 +2,7 @@ What's new in 2.1.0 ====================== -Release: 2021-10-19 (rc1) +Release: 2021-11-17 * Add ``multistatement=True`` option. You can disable multi statement. (#500). * Remove unnecessary bytes encoder which is remained for Django 1.11 diff --git a/metadata.cfg b/metadata.cfg index 81523713..95433ffb 100644 --- a/metadata.cfg +++ b/metadata.cfg @@ -1,6 +1,6 @@ [metadata] -version: 2.1.0rc1 -version_info: (2,1,0,'rc',1) +version: 2.1.0 +version_info: (2,1,0,'final',0) description: Python interface to MySQL author: Inada Naoki author_email: songofacandy@gmail.com