You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.
query('SELECT...) returns tuple (0L, 0L) sometimes,
as if it is query('INSERT...) or query('UPDATE...).
In almost all cases exactly the same query returns expected "result.rows" and "result.fields".
But then it suddenly returns tuple (0L, 0L) and this behaviour can be cured by reconnecting to DB.
I catch this bug several times a day, so I may add any debug code - please advise.
Current workaround:
result=db_conn.query(sql, values)
ifsql.lstrip().startswith('SELECT') andisinstance(result, tuple):
log.error('reconnecting to db on tuple SELECT: {}'.format(result)) # Logs: (0L, 0L)try:
db_conn.close()
exceptException:
passdb_conn=umysql.Connection()
db_conn.connect(...)
returndb_conn.query(sql, values) # Normal "result.rows" this time.returnresult
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Versions: umysql-2.61, python-2.7.6, gevent-1.0.1.
query('SELECT...) returns tuple (0L, 0L) sometimes,
as if it is query('INSERT...) or query('UPDATE...).
In almost all cases exactly the same query returns expected "result.rows" and "result.fields".
But then it suddenly returns tuple (0L, 0L) and this behaviour can be cured by reconnecting to DB.
I catch this bug several times a day, so I may add any debug code - please advise.
Current workaround:
The text was updated successfully, but these errors were encountered: