Skip to content

Commit d8890cf

Browse files
author
Silviu Surcica
committed
Merge branch 'master' of https://github.com/PyMySQL/mysqlclient-python into MMA-3573
2 parents 55a47bb + 4c19501 commit d8890cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5381
-5540
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
name: Bug report
3+
about: Report an issue of this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
### Read this first
11+
12+
We don't use this issue tracker to help users. If you had trouble, please ask it on some user community.
13+
Please use this tracker only when you are sure about it is an issue of this software.
14+
15+
And please provide full information from first. I don't want to ask questions like "What is your Python version?", "Do you confirm MySQL error log?". If the issue report looks incomplete, I will just close it.
16+
17+
Are you ready? Please remove until here and make a good issue report!!
18+
19+
20+
### Describe the bug
21+
22+
A clear and concise description of what the bug is.
23+
24+
### To Reproduce
25+
26+
**Schema**
27+
28+
```
29+
create table ....
30+
```
31+
32+
**Code**
33+
34+
```py
35+
con = MySQLdb.connect(...)
36+
cur = con.cursor()
37+
cur.execute(...)
38+
```
39+
40+
### Environment
41+
42+
**MySQL Server**
43+
44+
- Server OS (e.g. Windows 10, Ubuntu 20.04):
45+
- Server Version (e.g. MariaDB 10.3.16):
46+
47+
**MySQL Client**
48+
49+
- OS (e.g. Windows 10, Ubuntu 20.04):
50+
51+
- Python (e.g. Homebrew Python 3.7.5):
52+
53+
- Connector/C (e.g. Homebrew mysql-client 8.0.18):
54+
55+
56+
### Additional context
57+
58+
Add any other context about the problem here.

.travis.yml

+64-18
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,81 @@
1-
sudo: false
1+
dist: bionic
22
language: python
3-
python: "3.5"
3+
4+
# See aws s3 ls s3://travis-python-archives/binaries/ubuntu/18.04/x86_64/
5+
python:
6+
- "nightly"
7+
- "pypy3"
8+
- "3.8"
9+
- "3.7"
10+
- "3.6"
11+
- "3.5"
412

513
cache: pip
6-
install:
7-
- pip install tox
814

9-
matrix:
10-
include:
11-
- python: "3.6-dev"
12-
env:
13-
- TOX_ENV=py36
14-
- TESTDB=travis.cnf
15+
services:
16+
- mysql
1517

18+
install:
19+
- pip install -U pip
20+
- pip install -U mock coverage pytest pytest-cov codecov
1621

1722
env:
18-
matrix:
19-
- TOX_ENV=py26
20-
- TOX_ENV=py27
21-
- TOX_ENV=pypy
22-
- TOX_ENV=py33
23-
- TOX_ENV=py34
24-
- TOX_ENV=py35
2523
global:
2624
- TESTDB=travis.cnf
25+
2726
before_script:
2827
- "mysql --help"
2928
- "mysql --print-defaults"
3029
- "mysql -e 'create database mysqldb_test charset utf8mb4;'"
3130

32-
script: tox -e $TOX_ENV
31+
script:
32+
- pip install -e .
33+
- pytest --cov ./MySQLdb
34+
35+
after_success:
36+
- codecov
37+
38+
jobs:
39+
fast_finish: true
40+
include:
41+
- &django_2_2
42+
name: "Django 2.2 test"
43+
env:
44+
- DJANGO_VERSION=2.2.7
45+
python: "3.5"
46+
install:
47+
- pip install -U pip
48+
- wget https://github.com/django/django/archive/${DJANGO_VERSION}.tar.gz
49+
- tar xf ${DJANGO_VERSION}.tar.gz
50+
- pip install -e django-${DJANGO_VERSION}/
51+
- cp ci/test_mysql.py django-${DJANGO_VERSION}/tests/
52+
- pip install .
53+
54+
before_script:
55+
- mysql -e 'create user django identified by "secret"'
56+
- mysql -e 'grant all on *.* to django'
57+
- mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql
3358

59+
script:
60+
- cd django-${DJANGO_VERSION}/tests/
61+
- ./runtests.py --parallel=1 --settings=test_mysql
62+
- name: flake8
63+
python: "3.8"
64+
install:
65+
- pip install -U pip
66+
- pip install flake8
67+
script:
68+
- flake8 --ignore=E203,E501,W503 --max-line-length=88 .
69+
- name: black
70+
python: "3.8"
71+
install:
72+
- pip install -U pip
73+
- pip install black
74+
script:
75+
- black --check --exclude=doc/ .
76+
#- &django_3_0
77+
# <<: *django_2_2
78+
# name: "Django 3.0 test (Python 3.8)"
79+
# python: "3.8"
3480

3581
# vim: sw=2 ts=2 sts=2

HISTORY renamed to HISTORY.rst

+203-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,208 @@
1+
======================
2+
What's new in 2.0.0
3+
======================
4+
5+
Release: TBD
6+
7+
* Dropped Python 2 support
8+
* Dropped Django 1.11 support
9+
* Add context manager interface to Connection which closes the connection on ``__exit__``.
10+
11+
12+
======================
13+
What's new in 1.4.6
14+
======================
15+
16+
Release: 2019-11-21
17+
18+
* The ``cp1252`` encoding is used when charset is "latin1". (#390)
19+
20+
======================
21+
What's new in 1.4.5
22+
======================
23+
24+
Release: 2019-11-06
25+
26+
* The ``auth_plugin`` option is added. (#389)
27+
28+
29+
======================
30+
What's new in 1.4.4
31+
======================
32+
33+
Release: 2019-08-12
34+
35+
* ``charset`` option is passed to ``mysql_options(mysql, MYSQL_SET_CHARSET_NAME, charset)``
36+
before ``mysql_real_connect`` is called.
37+
This avoid extra ``SET NAMES <charset>`` query when creating connection.
38+
39+
40+
======================
41+
What's new in 1.4.3
42+
======================
43+
44+
Release: 2019-08-09
45+
46+
* ``--static`` build supports ``libmariadbclient.a``
47+
* Try ``mariadb_config`` when ``mysql_config`` is not found
48+
* Fixed warning happend in Python 3.8 (#359)
49+
* Fixed ``from MySQLdb import *``, while I don't recommend it. (#369)
50+
* Fixed SEGV ``MySQLdb.escape_string("1")`` when libmariadb is used and
51+
no connection is created. (#367)
52+
* Fixed many circular references are created in ``Cursor.executemany()``. (#375)
53+
54+
55+
======================
56+
What's new in 1.4.2
57+
======================
58+
59+
Release: 2019-02-08
60+
61+
* Fix Django 1.11 compatibility. (#327)
62+
mysqlclient 1.5 will not support Django 1.11. It is not because
63+
mysqlclient will break backward compatibility, but Django used
64+
unsupported APIs and Django 1.11 don't fix bugs including
65+
compatibility issues.
66+
67+
======================
68+
What's new in 1.4.1
69+
======================
70+
71+
Release: 2019-01-19
72+
73+
* Fix dict parameter support (#323, regression of 1.4.0)
74+
75+
======================
76+
What's new in 1.4.0
77+
======================
78+
79+
Release: 2019-01-18
80+
81+
* Dropped Python 3.4 support.
82+
83+
* Removed ``threadsafe`` and ``embedded`` build options.
84+
85+
* Remove some deprecated cursor classes and methods.
86+
87+
* ``_mysql`` and ``_mysql_exceptions`` modules are moved under
88+
``MySQLdb`` package. (#293)
89+
90+
* Remove ``errorhandler`` from Connection and Cursor classes.
91+
92+
* Remove context manager API from Connection. It was for transaction.
93+
New context manager API for closing connection will be added in future version.
94+
95+
* Remove ``waiter`` option from Connection.
96+
97+
* Remove ``escape_sequence``, and ``escape_dict`` methods from Connection class.
98+
99+
* Remove automatic MySQL warning checking.
100+
101+
* Drop support for MySQL Connector/C with MySQL<5.1.12.
102+
103+
* Remove ``_mysql.NULL`` constant.
104+
105+
* Remove ``_mysql.thread_safe()`` function.
106+
107+
* Support non-ASCII field name with non-UTF-8 connection encoding. (#210)
108+
109+
* Optimize decoding speed of string and integer types.
110+
111+
* Remove ``MySQLdb.constants.REFRESH`` module.
112+
113+
* Remove support for old datetime format for MySQL < 4.1.
114+
115+
* Fix wrong errno is raised when ``mysql_real_connect`` is failed. (#316)
116+
117+
118+
======================
119+
What's new in 1.3.14
120+
======================
121+
122+
Release: 2018-12-04
123+
124+
* Support static linking of MariaDB Connector/C (#265)
125+
126+
* Better converter for Decimal and Float (#267, #268, #273, #286)
127+
128+
* Add ``Connection._get_native_connection`` for XTA project (#269)
129+
130+
* Fix SEGV on MariaDB Connector/C when some methods of ``Connection``
131+
objects are called after ``Connection.close()`` is called. (#270, #272, #276)
132+
See https://jira.mariadb.org/browse/CONC-289
133+
134+
* Fix ``Connection.client_flag`` (#266)
135+
136+
* Fix SSCursor may raise same exception twice (#282)
137+
138+
* This removed ``Cursor._last_executed`` which was duplicate of ``Cursor._executed``.
139+
Both members are private. So this type of changes are not documented in changelog
140+
generally. But Django used the private member for ``last_executed_query`` implementation.
141+
If you use the method the method directly or indirectly, this version will break
142+
your application. See https://code.djangoproject.com/ticket/30013
143+
144+
* ``waiter`` option is now deprecated. (#285)
145+
146+
* Fixed SSL support is not detected when built with MySQL < 5.1 (#291)
147+
148+
149+
======================
150+
What's new in 1.3.13
151+
======================
152+
153+
Support build with MySQL 8
154+
155+
Fix decoding tiny/medium/long blobs (#215)
156+
157+
Remove broken row_seek() and row_tell() APIs (#220)
158+
159+
Reduce callproc roundtrip time (#223)
160+
161+
162+
======================
163+
What's new in 1.3.12
164+
======================
165+
166+
Fix tuple argument again (#201)
167+
168+
InterfaceError is raised when Connection.query() is called for closed connection (#202)
169+
170+
======================
171+
What's new in 1.3.11
172+
======================
173+
174+
Support MariaDB 10.2 client library (#197, #177, #200)
175+
176+
Add NEWDECIMAL to the NUMBER DBAPISet (#167)
177+
178+
Allow bulk insert which no space around `VALUES` (#179)
179+
180+
Fix leak of `connection->converter`. (#182)
181+
182+
Support error `numbers > CR_MAX_ERROR` (#188)
183+
184+
Fix tuple argument support (#145)
185+
186+
187+
======================
188+
What's new in 1.3.10
189+
======================
190+
191+
Added `binary_prefix` option (disabled by default) to support
192+
`_binary` prefix again. (#134)
193+
194+
Fix SEGV of `_mysql.result()` when argument's type is unexpected. (#138)
195+
196+
Deprecate context interface of Connection object. (#149)
197+
198+
Don't use workaround of `bytes.decode('ascii', 'surrogateescape')` on Python 3.6+. (#150)
199+
200+
1201
=====================
2202
What's new in 1.3.9
3203
=====================
4204

5-
Revert adding _binary prefix for bytes/bytearray parameter. It broke backward compatibility.
205+
Revert adding `_binary` prefix for bytes/bytearray parameter. It broke backward compatibility.
6206

7207
Fix Windows compile error on MSVC.
8208

@@ -13,7 +213,7 @@ Fix Windows compile error on MSVC.
13213

14214
Update error constants (#113)
15215

16-
Use _binary prefix for bytes/bytearray parameters (#106)
216+
Use `_binary` prefix for bytes/bytearray parameters (#106)
17217

18218
Use mysql_real_escape_string_quote() if exists (#109)
19219

@@ -135,7 +335,7 @@ beta 5
135335

136336
Another internal fix for handling remapped character sets.
137337

138-
_mysql.c was broken for the case where read_timeout was *not* available. (Issue #6)
338+
`_mysql.c` was broken for the case where read_timeout was *not* available. (Issue #6)
139339

140340
Documentation was converted to sphinx but there is a lot of cleanup left to do.
141341

0 commit comments

Comments
 (0)