@@ -983,27 +983,50 @@ Feature: Do global search/replace
983
983
Given a WP install
984
984
And a test_db.sql file:
985
985
"""
986
- DROP TABLE IF EXISTS `wp_123_test`;
987
986
CREATE TABLE `wp_123_test` (
988
987
`name` varchar(50),
989
988
`value` varchar(5000),
990
989
`created_at` datetime NOT NULL,
991
990
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
992
991
PRIMARY KEY (`name`)
993
992
) ENGINE=InnoDB;
994
- INSERT INTO `wp_123_test` VALUES ('test_val','off','2016-11-15 14:41:33','2016-11-15 21:41:33');
995
- INSERT INTO `wp_123_test` VALUES ('123.','off','2016-11-15 14:41:33','2016-11-15 21:41:33');
996
- INSERT INTO `wp_123_test` VALUES ('quote\'quote','off','2016-11-15 14:41:33','2016-11-15 21:41:33');
997
- INSERT INTO `wp_123_test` VALUES ('0','off','2016-11-15 14:41:33','2016-11-15 21:41:33');
998
- INSERT INTO `wp_123_test` VALUES ('','off','2016-11-15 14:41:33','2016-11-15 21:41:33');
999
- """
993
+ INSERT INTO `wp_123_test` VALUES ('test_val','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
994
+ INSERT INTO `wp_123_test` VALUES ('123.','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
995
+ INSERT INTO `wp_123_test` VALUES ('quote\'quote','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
996
+ INSERT INTO `wp_123_test` VALUES ('0','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
997
+ INSERT INTO `wp_123_test` VALUES ('','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
998
+ INSERT INTO `wp_123_test` VALUES ('18446744073709551616','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
999
+ INSERT INTO `wp_123_test` VALUES ('-18446744073709551615','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
1000
+ INSERT INTO `wp_123_test` VALUES ('123456789012345678801234567890','wp_123_test_value_X','2016-11-15 14:41:33','2016-11-15 21:41:33');
1000
1001
1001
- When I run `wp db query "SOURCE test_db.sql;" `
1002
- Then STDERR should be empty
1002
+ CREATE TABLE `wp_123_test2` (`bigint_unsigned_key` BIGINT UNSIGNED NOT NULL, `value` VARCHAR(255), PRIMARY KEY (`bigint_unsigned_key`) );
1003
+ INSERT INTO `wp_123_test2` VALUES ('18446744073709551615','wp_123_test2_value_X');
1004
+
1005
+ CREATE TABLE `wp_123_test3` (`bigint_signed_key` BIGINT SIGNED NOT NULL, `value` VARCHAR(255), PRIMARY KEY (`bigint_signed_key`) );
1006
+ INSERT INTO `wp_123_test3` VALUES ('-9223372036854775808','wp_123_test3_value_X');
1007
+ """
1008
+ And I run `wp db query "SOURCE test_db.sql;" `
1003
1009
1004
1010
When I run `wp search-replace --dry-run --regex 'mytestdomain.com\/ ' 'mytestdomain2.com/' --all-tables-with-prefix --skip-columns=guid,domain`
1005
- Then STDERR should be empty
1006
- And STDOUT should contain:
1011
+ Then STDOUT should contain:
1007
1012
"""
1008
1013
Success: 0 replacements to be made.
1009
1014
"""
1015
+
1016
+ When I run `wp search-replace --dry-run --regex 'wp_123_test_value_X' 'wp_123_test_value_Y' --all-tables-with-prefix`
1017
+ Then STDOUT should contain:
1018
+ """
1019
+ Success: 8 replacements to be made.
1020
+ """
1021
+
1022
+ When I run `wp search-replace --dry-run --regex 'wp_123_test2_value_X' 'wp_123_test2_value_Y' --all-tables-with-prefix`
1023
+ Then STDOUT should contain:
1024
+ """
1025
+ Success: 1 replacement to be made.
1026
+ """
1027
+
1028
+ When I run `wp search-replace --dry-run --regex 'wp_123_test3_value_X' 'wp_123_test3_value_Y' --all-tables-with-prefix`
1029
+ Then STDOUT should contain:
1030
+ """
1031
+ Success: 1 replacement to be made.
1032
+ """
0 commit comments