fix: use buffer so that we can use fetchone when multi line
This commit is contained in:
parent
2e3ce28468
commit
7749a2735a
@ -18,13 +18,13 @@ class CMLAccountManager():
|
|||||||
|
|
||||||
def find_user(self, username):
|
def find_user(self, username):
|
||||||
try:
|
try:
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor(buffered=True)
|
||||||
except:
|
except:
|
||||||
if self.conn.is_connected():
|
if self.conn.is_connected():
|
||||||
self.conn.close()
|
self.conn.close()
|
||||||
print("Restart DB Connection")
|
print("Restart DB Connection")
|
||||||
self.conn = mysql.connector.connect(**self.config)
|
self.conn = mysql.connector.connect(**self.config)
|
||||||
cursor = self.conn.cursor()
|
cursor = self.conn.cursor(buffered=True)
|
||||||
|
|
||||||
query = "SELECT * FROM `People` WHERE `account`=%s"
|
query = "SELECT * FROM `People` WHERE `account`=%s"
|
||||||
param = (username, )
|
param = (username, )
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user