Please do test on attached table & data
1.CTRL+F 2.text to find: "_1" 3.check replace "" 4.replace all
Observe sql-s created, no logic that I can see in any of those
UPDATE `test`.`test` SET `f`='foo' WHERE `f`='foo_1';
/* SQL Error (1062): Duplicate entry 'foo' for key 'Index 1' */
UPDATE `test`.`test` SET `f`='foo' WHERE `f`='foo_1';
/* SQL Error (1062): Duplicate entry 'foo' for key 'Index 1' */
UPDATE `test`.`test` SET `f`='faa' WHERE `f`='foo_1' AND `f`='faa_1';
Besides, no smart way to leave table data tab, 'duplicate' keeps popping up. I think I already mentioned once: "Search & replace text" should have "ignore duplicates" option.
You can't break this search & replace, imagine 50 rows or hell more,
" WHERE f
='foo_1' AND f
='faa_1'" tends to get longer and longer. if there are more columns in table. I think for each row in table with 10 columns, updates generated are +/- 10 !
CREATE TABLE IF NOT EXISTS `test` (
`f` varchar(50) COLLATE utf8_slovenian_ci NOT NULL DEFAULT '0',
`tttt` varchar(50) COLLATE utf8_slovenian_ci DEFAULT NULL,
UNIQUE KEY `Index 1` (`f`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_slovenian_ci;
DELETE FROM `test`;
INSERT INTO `test` (`f`, `tttt`) VALUES
('foo', '1'),
('foo_1', '1'),
('faa', '2'),
('faa_1', '2'),
('fbb_1', '2'),
('fbb', '2');