Column names from DESCRIBE table to lowercase to match MySQL #56
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.
wp-cli's search-replace command fails when used against a WordPress installation using wp-sqlite-db, because it looks for text columns in tables by checking the output of
DESCRIBE tablename
for column types withtext
orvarchar
in them, case-sensitively. (See https://github.com/wp-cli/search-replace-command/blob/main/src/Search_Replace_Command.php#L714 for the details; they usestrpos
to check.)SQLite (and wp-sqlite-db) returns column type as
TEXT
, which does not match. This means that search-replace fails because it doesn't detect any text columns in tables.It would be nice if they used
stripos
(and I will file a PR over there as well), but making the wp-sqlite-db code convert the returned column type to lowercase fixes this problem, and makes it match MySQL's response more accurately, which seems like a good thing all round.