File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55Release date: TBD
66
7+ * Fixed SSCursor raising OperationalError for query timeouts on wrong statement (#1032 )
78* Exposed ` Cursor.warning_count ` to check for warnings without additional query (#1056 )
89
10+
911## v1.0.3
1012
1113Release date: TBD
Original file line number Diff line number Diff line change @@ -1262,7 +1262,20 @@ def _finish_unbuffered_query(self):
12621262 # in fact, no way to stop MySQL from sending all the data after
12631263 # executing a query, so we just spin, and wait for an EOF packet.
12641264 while self .unbuffered_active :
1265- packet = self .connection ._read_packet ()
1265+ try :
1266+ packet = self .connection ._read_packet ()
1267+ except err .OperationalError as e :
1268+ if e .args [0 ] in (
1269+ ER .QUERY_TIMEOUT ,
1270+ ER .STATEMENT_TIMEOUT ,
1271+ ):
1272+ # if the query timed out we can simply ignore this error
1273+ self .unbuffered_active = False
1274+ self .connection = None
1275+ return
1276+
1277+ raise
1278+
12661279 if self ._check_packet_is_eof (packet ):
12671280 self .unbuffered_active = False
12681281 self .connection = None # release reference to kill cyclic reference.
You can’t perform that action at this time.
0 commit comments