Commit cad01d2e authored by Julien Muchembled's avatar Julien Muchembled

mysql: minor optimization

parent 0b414488
...@@ -29,8 +29,7 @@ if useMySQLdb(): ...@@ -29,8 +29,7 @@ if useMySQLdb():
from MySQLdb.constants.CR import SERVER_GONE_ERROR, SERVER_LOST from MySQLdb.constants.CR import SERVER_GONE_ERROR, SERVER_LOST
from MySQLdb.constants.ER import DATA_TOO_LONG, DUP_ENTRY, NO_SUCH_TABLE from MySQLdb.constants.ER import DATA_TOO_LONG, DUP_ENTRY, NO_SUCH_TABLE
def fetch_all(conn): def fetch_all(conn):
r = conn.store_result() return conn.store_result().fetch_row(0)
return r.fetch_row(r.num_rows())
# for tests # for tests
from MySQLdb import NotSupportedError from MySQLdb import NotSupportedError
from MySQLdb.constants.ER import BAD_DB_ERROR, UNKNOWN_STORAGE_ENGINE from MySQLdb.constants.ER import BAD_DB_ERROR, UNKNOWN_STORAGE_ENGINE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment