Skip to content

Fix missing table on wb db query output #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix missing table on wb db query output #295

wants to merge 1 commit into from

Conversation

mrsdizzie
Copy link
Member

In #277 this code was changed in order to support a count number for certain types of queries. That change had a side effect of removing the default table that MySQL/MariaDB prints for regular queries because that relies on TTY detection from MySQL/MariaDB itself. To revert to preivious behavior, only run the new code if we know it is a row modifying query that will just print the count. Otherwise, use the previous code path so things work exactly as they did before.

Fixes #290

In #277 this code was changed in order to support a count number for
certain types of queries. That change had a side effect of removing the
default table that MySQL/MariaDB prints for regular queries because that
relies on TTY detection from MySQL/MariaDB itself. To revert to
preivious behavior, only run the new code if we know it is a row
modifying query that will just print the count. Otherwise, use the
previous code path.

Fixes #290
@mrsdizzie mrsdizzie requested a review from a team as a code owner July 23, 2025 15:41
@mrsdizzie mrsdizzie added the bug label Jul 23, 2025
@mrsdizzie mrsdizzie added this to the 2.1.4 milestone Jul 23, 2025
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/DB_Command.php 83.33% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@swissspidy
Copy link
Member

Awesome, thanks!

Is this something we could easily add a test for?

@mrsdizzie
Copy link
Member Author

Awesome, thanks!

Is this something we could easily add a test for?

Unfortunately I don't think so, because it is checking isatty value somewhere and deciding to use the table based on that. It would probably require some 3rd party tools to try and fake that, which I'm not sure is worth it.

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

Successfully merging this pull request may close these issues.

wp db query no longer formats a table since 2.12.0
2 participants