Skip to content

Commit

Permalink
Try hard code DB table name
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewrmshin committed Oct 29, 2018
1 parent aa55bfd commit 6cca742
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions lib/cylc/rundb.py
Expand Up @@ -531,7 +531,7 @@ def select_checkpoint_id(self, callback, id_key=None):
If id_key is specified, add where id == id_key to select.
"""
stmt = r"SELECT id,time,event FROM %s" % self.TABLE_CHECKPOINT_ID
stmt = r"SELECT id,time,event FROM checkpoint_id"
stmt_args = []
if id_key is not None:
stmt += r" WHERE id==?"
Expand All @@ -542,8 +542,7 @@ def select_checkpoint_id(self, callback, id_key=None):

def select_checkpoint_id_restart_count(self):
"""Return number of restart event in checkpoint_id table."""
stmt = (r"SELECT COUNT(event) FROM " + self.TABLE_CHECKPOINT_ID +
r" WHERE event==?")
stmt = r"SELECT COUNT(event) FROM checkpoint_id WHERE event==?"
stmt_args = ['restart']
for row in self.connect().execute(stmt, stmt_args):
return row[0]
Expand Down Expand Up @@ -821,8 +820,7 @@ def take_checkpoints(self, event, other_daos=None):
"""
id_ = 1
for max_id, in self.connect().execute(
"SELECT MAX(id) FROM %(table)s" %
{"table": self.TABLE_CHECKPOINT_ID}):
"SELECT MAX(id) FROM checkpoint_id"):
if max_id >= id_:
id_ = max_id + 1
daos = [self]
Expand Down

0 comments on commit 6cca742

Please sign in to comment.