fix: init db conn for unbuffered cursor if not set (#26220)
* fix: init db conn for unbuffered cursor if not set * chore: check conn and not cursor --------- Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
parent
c0e779998d
commit
ba2715582b
1 changed files with 3 additions and 0 deletions
|
|
@ -532,6 +532,9 @@ class MariaDBDatabase(MariaDBConnectionUtil, MariaDBExceptionUtil, Database):
|
|||
from pymysql.cursors import SSCursor
|
||||
|
||||
try:
|
||||
if not self._conn:
|
||||
self.connect()
|
||||
|
||||
original_cursor = self._cursor
|
||||
new_cursor = self._cursor = self._conn.cursor(SSCursor)
|
||||
yield
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue