10000 check local_infile option · uwydoc/PyMySQL@b5e17ce · GitHub
[go: up one dir, main page]

Skip to content

Commit b5e17ce

Browse files
committed
check local_infile option
1 parent 1669009 commit b5e17ce

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymysql/connections.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,8 @@ def __init__(self, host=None, user=None, password="",
600600
if compress or named_pipe:
601601
raise NotImplementedError("compress and named_pipe arguments are not supported")
602602

603-
if local_infile:
603< 8D99 /code>+
self._local_infile = bool(local_infile)
604+
if self._local_infile:
604605
client_flag |= CLIENT.LOCAL_FILES
605606

606607
self.ssl = False
@@ -1374,6 +1375,9 @@ def _read_ok_packet(self, first_packet):
13741375
self.has_next = ok_packet.has_next
13751376

13761377
def _read_load_local_packet(self, first_packet):
1378+
if not self.connection._local_infile:
1379+
raise RuntimeError(
1380+
"**WARN**: Received LOAD_LOCAL packet but local_infile option is false.")
13771381
load_packet = LoadLocalPacketWrapper(first_packet)
13781382
sender = LoadLocalFile(load_packet.filename, self.connection)
13791383
try:

0 commit comments

Comments
 (0)
0