comparison sat/memory/sqlite.py @ 2720:453a12ff6f51

core (memory/sqlite): do not call commitStatements if there is nothing to commit in checkUpdates
author Goffi <goffi@goffi.org>
date Mon, 10 Dec 2018 21:06:20 +0100
parents 06160b529da6
children 4aaa47f62d8d
comparison
equal deleted inserted replaced
2719:45189c8bd165 2720:453a12ff6f51
988 for version in xrange(local_version + 1, CURRENT_DB_VERSION + 1): 988 for version in xrange(local_version + 1, CURRENT_DB_VERSION + 1):
989 try: 989 try:
990 update_data = DATABASE_SCHEMAS[version] 990 update_data = DATABASE_SCHEMAS[version]
991 except KeyError: 991 except KeyError:
992 raise exceptions.InternalError("Missing update definition (version %d)" % version) 992 raise exceptions.InternalError("Missing update definition (version %d)" % version)
993 if "specific" in update_data: 993 if "specific" in update_data and update_raw:
994 # if we have a specific, we must commit current statements 994 # if we have a specific, we must commit current statements
995 # because a specific may modify database itself, and the database 995 # because a specific may modify database itself, and the database
996 # must be in the expected state of the previous version. 996 # must be in the expected state of the previous version.
997 yield self.sqlite_storage.commitStatements(update_raw) 997 yield self.sqlite_storage.commitStatements(update_raw)
998 del update_raw[:] 998 del update_raw[:]