Rewrite wp_get_table_names to deal correctly with wildcards.#4624
Merged
schlessera merged 6 commits intomasterfrom Jan 24, 2018
Merged
Rewrite wp_get_table_names to deal correctly with wildcards.#4624schlessera merged 6 commits intomasterfrom
schlessera merged 6 commits intomasterfrom
Conversation
schlessera
requested changes
Jan 23, 2018
features/utils-wp.feature
Outdated
| wp_posts | ||
| """ | ||
|
|
||
| Scenario: Get WP table names for single site install |
Member
There was a problem hiding this comment.
single site install => multisite install
schlessera
approved these changes
Jan 24, 2018
Member
|
Big props to @BhargavBhandari90 for doing a lot of the preliminary work. |
This was referenced Jan 24, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See issue wp-cli/db-command#73 and PRs wp-cli/db-command#78 and #4606
Rewrites
Utils\wp_get_table_names()to deal correctly with wildcards by getting the WP tables first and then filtering through the$args.It's a backward compatibility (BC) change in that various buggy behaviours no longer happen, eg
wp db tables no_such_tablewill return an error rather thanno_such_table.Also introduces some avoidable BC breaks:
scopeis not ignored whennetworkgiven (it doesn't make sense to me that it should be).wpdborder currently if not givenall-tablesorall-tables-with-prefix).Also adds
Utils\esc_sql_ident()fromDB_Commandtoutils.php.(May fail phpcs at the moment - let's see!)
Edit: will break tests for
db-command/features/db-search.featureanddb-command/features/db-tables.featureandsearch-replace-command/features/search-replace-export.featureandsearch-replace-command/features/search-replace.featureuntil they're adjusted.