Skip to content
Snippets Groups Projects
Commit 8be295c6 authored by Gordon Ball's avatar Gordon Ball
Browse files

New upstream version 1.4.6

parent 79628152
No related branches found
No related tags found
No related merge requests found
======================
What's new in 1.4.6
======================
Release: 2019-11-21
* The ``cp1252`` encoding is used when charset is "latin1". (#390)
======================
What's new in 1.4.5
======================
Release: 2019-11-06
* The ``auth_plugin`` option is added. (#389)
======================
What's new in 1.4.4
======================
......
......@@ -18,8 +18,8 @@ from MySQLdb.release import __version__, version_info, __author__
from . import _mysql
if version_info != _mysql.version_info:
raise ImportError("this is MySQLdb version %s, but _mysql is version %r" %
(version_info, _mysql.version_info))
raise ImportError("this is MySQLdb version %s, but _mysql is version %r\n_mysql: %r" %
(version_info, _mysql.version_info, _mysql.__file__))
threadsafety = 1
apilevel = "2.0"
......
......@@ -217,6 +217,9 @@ _get_encoding(MYSQL *mysql)
if (strncmp(utf8, cs.csname, 4) == 0) { // utf8, utf8mb3, utf8mb4
return utf8;
}
else if (strncmp("latin1", cs.csname, 6) == 0) {
return "cp1252";
}
else if (strncmp("koi8r", cs.csname, 5) == 0) {
return "koi8_r";
}
......@@ -398,6 +401,7 @@ _mysql_ConnectionObject_Initialize(
"client_flag", "ssl",
"local_infile",
"read_timeout", "write_timeout", "charset",
"auth_plugin",
NULL } ;
int connect_timeout = 0;
int read_timeout = 0;
......@@ -406,13 +410,14 @@ _mysql_ConnectionObject_Initialize(
char *init_command=NULL,
*read_default_file=NULL,
*read_default_group=NULL,
*charset=NULL;
*charset=NULL,
*auth_plugin=NULL;
self->converter = NULL;
self->open = 0;
if (!PyArg_ParseTupleAndKeywords(args, kwargs,
"|ssssisOiiisssiOiiis:connect",
"|ssssisOiiisssiOiiiss:connect",
kwlist,
&host, &user, &passwd, &db,
&port, &unix_socket, &conv,
......@@ -424,7 +429,8 @@ _mysql_ConnectionObject_Initialize(
&local_infile,
&read_timeout,
&write_timeout,
&charset
&charset,
&auth_plugin
))
return -1;
......@@ -491,6 +497,9 @@ _mysql_ConnectionObject_Initialize(
if (charset) {
mysql_options(&(self->connection), MYSQL_SET_CHARSET_NAME, charset);
}
if (auth_plugin) {
mysql_options(&(self->connection), MYSQL_DEFAULT_AUTH, auth_plugin);
}
conn = mysql_real_connect(&(self->connection), host, user, passwd, db,
port, unix_socket, client_flag);
......@@ -2296,7 +2305,7 @@ static struct PyMemberDef _mysql_ConnectionObject_memberlist[] = {
},
{
"server_capabilities",
T_UINT,
T_ULONG,
offsetof(_mysql_ConnectionObject,connection.server_capabilities),
READONLY,
"Capabilities of server; consult MySQLdb.constants.CLIENT"
......@@ -2310,7 +2319,7 @@ static struct PyMemberDef _mysql_ConnectionObject_memberlist[] = {
},
{
"client_flag",
T_UINT,
T_ULONG,
offsetof(_mysql_ConnectionObject,connection.client_flag),
READONLY,
"Client flags; refer to MySQLdb.constants.CLIENT"
......
......@@ -15,6 +15,14 @@ from MySQLdb._exceptions import (
NotSupportedError, ProgrammingError,
)
# Mapping from MySQL charset name to Python codec name
_charset_to_encoding = {
"utf8mb4": "utf8",
"utf8mb3": "utf8",
"latin1": "cp1252",
"koi8r": "koi8_r",
"koi8u": "koi8_u",
}
re_numeric_part = re.compile(r"^(\d+)")
......@@ -86,6 +94,11 @@ class Connection(_mysql.connection):
On Python 2, this option changes default value of `use_unicode`
option from False to True.
:param str auth_plugin:
If supplied, the connection default authentication plugin will be
changed to this value. Example values:
`mysql_native_password` or `caching_sha2_password`
:param str sql_mode:
If supplied, the session SQL mode will be changed to this
setting.
......@@ -284,10 +297,7 @@ class Connection(_mysql.connection):
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."""
if charset in ("utf8mb4", "utf8mb3"):
py_charset = "utf8"
else:
py_charset = charset
py_charset = _charset_to_encoding.get(charset, charset)
if self.character_set_name() != charset:
try:
super(Connection, self).set_character_set(charset)
......
__author__ = "Inada Naoki <songofacandy@gmail.com>"
version_info = (1,4,4,'final',0)
__version__ = "1.4.4"
version_info = (1,4,6,'final',0)
__version__ = "1.4.6"
Metadata-Version: 2.1
Name: mysqlclient
Version: 1.4.4
Version: 1.4.6
Summary: Python interface to MySQL
Home-page: https://github.com/PyMySQL/mysqlclient-python
Author: Inada Naoki
......@@ -23,7 +23,7 @@ Description: # mysqlclient
* `sudo apt-get install python-dev default-libmysqlclient-dev` # Debian / Ubuntu
* `sudo yum install python-devel mysql-devel` # Red Hat / CentOS
* `brew install mysql-connector-c` # macOS (Homebrew) (Currently, it has bug. See below)
* `brew install mysql-client` # macOS (Homebrew)
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.
......@@ -33,33 +33,6 @@ Description: # mysqlclient
`sudo yum install python3-devel ` # Red Hat / CentOS
#### **Note about bug of MySQL Connector/C on macOS**
See also: https://bugs.mysql.com/bug.php?id=86971
Versions of MySQL Connector/C may have incorrect default configuration options that cause compilation errors when `mysqlclient-python` is installed. (As of November 2017, this is known to be true for homebrew's `mysql-connector-c` and [official package](https://dev.mysql.com/downloads/connector/c/))
Modification of `mysql_config` resolves these issues as follows.
Change
```
# on macOS, on or about line 112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
```
to
```
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
```
An improper ssl configuration may also create issues; see, e.g, `brew info openssl` for details on macOS.
### Install from PyPI
`pip install mysqlclient`
......
......@@ -15,7 +15,7 @@ You may need to install the Python and MySQL development headers and libraries l
* `sudo apt-get install python-dev default-libmysqlclient-dev` # Debian / Ubuntu
* `sudo yum install python-devel mysql-devel` # Red Hat / CentOS
* `brew install mysql-connector-c` # macOS (Homebrew) (Currently, it has bug. See below)
* `brew install mysql-client` # macOS (Homebrew)
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.
......@@ -25,33 +25,6 @@ On Windows, there are binary wheels you can install without MySQLConnector/C or
`sudo yum install python3-devel ` # Red Hat / CentOS
#### **Note about bug of MySQL Connector/C on macOS**
See also: https://bugs.mysql.com/bug.php?id=86971
Versions of MySQL Connector/C may have incorrect default configuration options that cause compilation errors when `mysqlclient-python` is installed. (As of November 2017, this is known to be true for homebrew's `mysql-connector-c` and [official package](https://dev.mysql.com/downloads/connector/c/))
Modification of `mysql_config` resolves these issues as follows.
Change
```
# on macOS, on or about line 112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
```
to
```
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
```
An improper ssl configuration may also create issues; see, e.g, `brew info openssl` for details on macOS.
### Install from PyPI
`pip install mysqlclient`
......
......@@ -41,6 +41,23 @@ MySQLdb Package
:undoc-members:
:show-inheritance:
:mod:`_mysql` Module
--------------------
.. automodule:: MySQLdb._mysql
:members:
:undoc-members:
:show-inheritance:
:mod:`_exceptions` Module
-------------------------
.. automodule:: MySQLdb._exceptions
:members:
:undoc-members:
:show-inheritance:
Subpackages
-----------
......
_exceptions Module
========================
.. automodule:: MySQLdb._exceptions
:members:
:undoc-members:
:show-inheritance:
_mysql Module
=============
.. automodule:: MySQLdb._mysql
:members:
:undoc-members:
:show-inheritance:
......@@ -16,7 +16,7 @@ import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath('..'))
#sys.path.insert(0, os.path.abspath('..'))
# -- General configuration -----------------------------------------------------
......
MySQLdb
=======
.. toctree::
:maxdepth: 4
MySQLdb
......@@ -546,7 +546,7 @@ nextset()
Some examples
.............
The ``connect()`` method works nearly the same as with `_mysql`_::
The ``connect()`` method works nearly the same as with `MySQLDB._mysql`_::
import MySQLdb
db=MySQLdb.connect(passwd="moonpie",db="thangs")
......
[metadata]
version: 1.4.4
version_info: (1,4,4,'final',0)
version: 1.4.6
version_info: (1,4,6,'final',0)
description: Python interface to MySQL
author: Inada Naoki
author_email: songofacandy@gmail.com
......
Metadata-Version: 2.1
Name: mysqlclient
Version: 1.4.4
Version: 1.4.6
Summary: Python interface to MySQL
Home-page: https://github.com/PyMySQL/mysqlclient-python
Author: Inada Naoki
......@@ -23,7 +23,7 @@ Description: # mysqlclient
* `sudo apt-get install python-dev default-libmysqlclient-dev` # Debian / Ubuntu
* `sudo yum install python-devel mysql-devel` # Red Hat / CentOS
* `brew install mysql-connector-c` # macOS (Homebrew) (Currently, it has bug. See below)
* `brew install mysql-client` # macOS (Homebrew)
On Windows, there are binary wheels you can install without MySQLConnector/C or MSVC.
......@@ -33,33 +33,6 @@ Description: # mysqlclient
`sudo yum install python3-devel ` # Red Hat / CentOS
#### **Note about bug of MySQL Connector/C on macOS**
See also: https://bugs.mysql.com/bug.php?id=86971
Versions of MySQL Connector/C may have incorrect default configuration options that cause compilation errors when `mysqlclient-python` is installed. (As of November 2017, this is known to be true for homebrew's `mysql-connector-c` and [official package](https://dev.mysql.com/downloads/connector/c/))
Modification of `mysql_config` resolves these issues as follows.
Change
```
# on macOS, on or about line 112:
# Create options
libs="-L$pkglibdir"
libs="$libs -l "
```
to
```
# Create options
libs="-L$pkglibdir"
libs="$libs -lmysqlclient -lssl -lcrypto"
```
An improper ssl configuration may also create issues; see, e.g, `brew info openssl` for details on macOS.
### Install from PyPI
`pip install mysqlclient`
......
......@@ -27,11 +27,8 @@ MySQLdb/constants/__init__.py
doc/FAQ.rst
doc/MySQLdb.constants.rst
doc/MySQLdb.rst
doc/_exceptions.rst
doc/_mysql.rst
doc/conf.py
doc/index.rst
doc/modules.rst
doc/user_guide.rst
mysqlclient.egg-info/PKG-INFO
mysqlclient.egg-info/SOURCES.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment