Skip to content

Commit e2e895d

Browse files
committed
Update docs for local infile
1 parent 873dc39 commit e2e895d

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGES.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ next (unreleased)
1919
* | Bump setuptools to >=80, setuptools-scm to >=7, <10.
2020
| setuptools-scm must be at least 9.2.0 for consistent hash lengths of non-release builds.
2121

22+
* | Properly check whether loading of local files is enabled #1044
23+
| Loading local data now requires using the `local_infile` parameter, passing just the client flag through `client_flag` is no longer supported.
24+
| Fixes `GHSA-r397-ff8c-wv2g <https://github.com/aio-libs/aiomysql/security/advisories/GHSA-r397-ff8c-wv2g>`_
25+
| Thanks to @KonstantAnxiety for reporting this.
26+
2227
0.2.0 (2023-06-11)
2328
^^^^^^^^^^^^^^^^^^
2429

docs/connection.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Example::
4646
client_flag=0, cursorclass=Cursor, init_command=None,
4747
connect_timeout=None, read_default_group=None,
4848
autocommit=False, echo=False
49-
ssl=None, auth_plugin='', program_name='',
50-
server_public_key=None, loop=None)
49+
local_infile=False, loop=None, ssl=None, auth_plugin='',
50+
program_name='', server_public_key=None)
5151

5252
A :ref:`coroutine <coroutine>` that connects to MySQL.
5353

@@ -71,7 +71,8 @@ Example::
7171
See `pymysql.converters`.
7272
:param use_unicode: whether or not to default to unicode strings.
7373
:param client_flag: custom flags to send to MySQL. Find
74-
potential values in `pymysql.constants.CLIENT`.
74+
potential values in `pymysql.constants.CLIENT`. Refer to the
75+
`local_infile` parameter for enabling loading of local data.
7576
:param cursorclass: custom cursor class to use.
7677
:param str init_command: initial SQL statement to run when connection is
7778
established.
@@ -81,6 +82,10 @@ Example::
8182
file.
8283
:param autocommit: Autocommit mode. None means use server default.
8384
(default: ``False``)
85+
:param local_infile: Boolean to enable the use of `LOAD DATA LOCAL`
86+
command. This also enables the corresponding `client_flag`. aiomysql
87+
does not perform any validation of files requested by the server. Do
88+
not use this with untrusted servers. (default: ``False``)
8489
:param ssl: Optional SSL Context to force SSL
8590
:param auth_plugin: String to manually specify the authentication
8691
plugin to use, i.e you will want to use mysql_clear_password

0 commit comments

Comments
 (0)