From 4651dc3d67b6099ea51f3a37e16146ef4a2fc2fe Mon Sep 17 00:00:00 2001 From: Scott Nemes Date: Tue, 17 Feb 2026 18:51:14 -0800 Subject: [PATCH 1/2] Add new variable to separately track watch iterrations --- mycli/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mycli/main.py b/mycli/main.py index edc30d8f..c8350bd7 100755 --- a/mycli/main.py +++ b/mycli/main.py @@ -900,7 +900,7 @@ def show_suggestion_tip() -> bool: def output_res(results: Generator[SQLResult], start: float) -> None: nonlocal mutating - result_count = 0 + result_count = watch_count = 0 for result in results: title = result.title cur = result.results @@ -915,13 +915,15 @@ def output_res(results: Generator[SQLResult], start: float) -> None: # If this is a watch query, offset the start time on the 2nd+ iteration # to account for the sleep duration if command is not None and command["name"] == "watch": - if result_count > 0: + if watch_count > 0: try: watch_seconds = float(command["seconds"]) start += watch_seconds except ValueError as e: self.echo(f"Invalid watch sleep time provided ({e}).", err=True, fg="red") sys.exit(1) + else: + watch_count += 1 if is_select(status) and isinstance(cur, Cursor) and cur.rowcount > threshold: self.echo( f"The result set has more than {threshold} rows.", From 606b46248450f1c2c86e05ba659bbf057e38d25a Mon Sep 17 00:00:00 2001 From: Scott Nemes Date: Wed, 18 Feb 2026 14:29:40 -0800 Subject: [PATCH 2/2] Update changelog --- changelog.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/changelog.md b/changelog.md index 6eb0c557..9f62f650 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,11 @@ +Upcoming (TBD) +============== + +Bug Fixes +--------- +* Watch command now returns correct time when ran as part of a multi-part query (#1565) + + 1.54.1 (2026/02/17) ==============