You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp search-replace --precise skips a row with an integer-looking text primary key #259
wp search-replace --precise can match distinct text keys like '001' and '1' in the same lookup. I reproduced this locally with two seeded rows in Wordfence's file-change table. The command reported one replacement and left row '1' unchanged. Wordfence
Describe how other contributors can replicate this bug
Run these commands on a disposable WordPress install with MySQL and the default wp_ prefix.
wp db query "CREATE TABLE wp_sr_key_test ( id VARCHAR(10) NOT NULL PRIMARY KEY, url TEXT NOT NULL);INSERT INTO wp_sr_key_test (id, url) VALUES ('001', 'https://old.example/foo'), ('1', 'https://old.example/bar');"
wp search-replace 'https://old.example''https://new.example' wp_sr_key_test \
--all-tables-with-prefix --include-columns=url --precise
wp db query "SELECT id, url FROM wp_sr_key_test ORDER BY id;"
The command reports Success: Made 1 replacement. The query returns these rows.
id url
001 https://new.example/foo
1 https://old.example/bar
Describe what you would expect as the correct outcome
The command should report two replacements. Key '001' should contain https://new.example/foo, and key '1' should contain https://new.example/bar.
Let us know what environment you are running this on
Activity