Skip to content

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
@codecov
Copy link

codecov bot commented Jul 23, 2025

Codecov Report

❌ 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.

@swissspidy swissspidy merged commit b2a51db into main Jul 28, 2025
30 of 43 checks passed
@swissspidy swissspidy deleted the fix-290 branch July 28, 2025 08:13
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

3 participants