Skip to content
/ server Public

MDEV-38922 Fix cosmetic "stage done" output for REPAIR TABLE#4710

Open
amodhakal wants to merge 1 commit intoMariaDB:11.8from
amodhakal:fix/MDEV-38922
Open

MDEV-38922 Fix cosmetic "stage done" output for REPAIR TABLE#4710
amodhakal wants to merge 1 commit intoMariaDB:11.8from
amodhakal:fix/MDEV-38922

Conversation

@amodhakal
Copy link

The client shows "stage done" immediately after sending the query, before results were fetched. Move report_progress_end() into the result processing path so the message appears only after the stage actually completes.

Meant to fix https://jira.mariadb.org/browse/MDEV-38922

@CLAassistant
Copy link

CLAassistant commented Feb 28, 2026

CLA assistant check
All committers have signed the CLA.

@mariadb-RoelVandePaar
Copy link

The fix itself was tested and works, ref https://jira.mariadb.org/browse/MDEV-38922

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 2, 2026
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution! This is a preliminary review.

Please consider adding a regression test. See mysql-interactive.test on how to run CLI in interactive mode (so you'd see the progress reports).

Also, the commit message is somewhat misleading. Or maybe the function naming is: report_progress_end() does not actually print the message. It "erases it" by printing spaces atop of the last message printed.

I'd say that the fix consists of moving report_progress_end() from after the query is executed to after the caching of the resultset (where progress messages might get printed) so that any progress messages printed during the receiving of the resultset would get erased before the result set printing starts.

@amodhakal amodhakal requested a review from gkodinov March 2, 2026 21:19
Copy link
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after fixing the name.

Stand by for the final review please.

@amodhakal amodhakal force-pushed the fix/MDEV-38922 branch 2 times, most recently from 050ff57 to f65fe01 Compare March 4, 2026 19:01
@mariadb-RoelVandePaar
Copy link

The JIRA ticket lists 11.4 as the oldest affected version

@amodhakal Thanks. I've removed 11.4 from the Community Server version list. 11.8 Is the first CS affected version.

That said, MariaDB Enterprise Server 11.4 is affected.

@gkodinov @vuvova please note the need to push to ES 11.4, if so desired. Thanks

@amodhakal amodhakal changed the base branch from 11.4 to 11.8 March 5, 2026 02:17
Copy link
Contributor

@raghunandanbhat raghunandanbhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amodhakal, thanks for the contribution.
We already have lot of test files, I'd like you to move this test into one of those instead of creating a new one. May be mysql-interactive.test

@amodhakal
Copy link
Author

The following tests are failing in CI:

  • rpl.rpl_gtid_index 'mix'
  • main.alter_table_online_debug 'nobinlog'

Based on my investigation, I couldn't find a connection or a reason why they should be failing. Glad to hear if there's something I'm missing.

Copy link
Contributor

@raghunandanbhat raghunandanbhat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested the fix manually on GNOME terminal. While the mtr test passes (likely because of socat & pty), the artifcat stage done remains on the CLI output.
here's the output from my terminal-

MariaDB [tdb]> create table t (c int) engine=innodb;
Query OK, 0 rows affected (0.023 sec)

MariaDB [tdb]> repair table t;
+-------+------+----------+----------+
| Table | Op   | Msg_type | Msg_text |
+-------+------+----------+----------+
| tdb.t | repair | status   | OK       | stage done
+-------+------+----------+----------+
1 row in set (0.021 sec)       

@amodhakal, are you seeing this on your terminal too?

report_progress_end() erases progress messages by overwriting them
with spaces. It was called immediately after query execution, before
the result set was fetched. Progress messages can arrive during
result fetching, so moving the call to after the result set is cached
ensures any such messages are erased before the result set is printed.

Signed-off-by: Amodh Dhakal <amodhakal@gmail.com>
@amodhakal
Copy link
Author

raghunandanbhat I've moved all includes to the top of the file.

Regarding the stray stage done in the output: I wasn't able to reproduce this on macOS (Ghostty terminal), and another reviewer also couldn't reproduce it. Could you share your environment? That would help me find and resolve the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

6 participants