diff --git a/SQL/optimisations_2017-02-19.sql b/SQL/optimisations_2017-02-19.sql index ec50f38b01dcb..bf864a99ecda1 100644 --- a/SQL/optimisations_2017-02-19.sql +++ b/SQL/optimisations_2017-02-19.sql @@ -111,7 +111,7 @@ ALTER TABLE `feedback`.`player` ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`; SET SQL_SAFE_UPDATES = 0; UPDATE `feedback`.`player` - SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(SUBSTRING_INDEX(`ip`, ':', 1)), ''), INET_ATON('0.0.0.0')); + SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(`ip`), ''), INET_ATON('0.0.0.0')); SET SQL_SAFE_UPDATES = 1; ALTER TABLE `feedback`.`player` DROP COLUMN `ip` @@ -128,7 +128,7 @@ ALTER TABLE `feedback`.`poll_question` , DROP COLUMN `for_trialmin`; SET SQL_SAFE_UPDATES = 0; UPDATE `feedback`.`poll_question` - SET `createdby_ipTEMP` = COALESCE(NULLIF(INET_ATON(SUBSTRING_INDEX(`createdby_ip`, ':', 1)), ''), INET_ATON('0.0.0.0')); + SET `createdby_ipTEMP` = COALESCE(NULLIF(INET_ATON(`ip`), ''), INET_ATON('0.0.0.0')); SET SQL_SAFE_UPDATES = 1; ALTER TABLE `feedback`.`poll_question` DROP COLUMN `createdby_ip` @@ -141,7 +141,7 @@ ALTER TABLE `feedback`.`poll_textreply` , ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`; SET SQL_SAFE_UPDATES = 0; UPDATE `feedback`.`poll_textreply` - SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(SUBSTRING_INDEX(`ip`, ':', 1)), ''), INET_ATON('0.0.0.0')); + SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(`ip`), ''), INET_ATON('0.0.0.0')); SET SQL_SAFE_UPDATES = 1; ALTER TABLE `feedback`.`poll_textreply` DROP COLUMN `ip` @@ -154,7 +154,7 @@ ALTER TABLE `feedback`.`poll_vote` , ADD COLUMN `ipTEMP` INT UNSIGNED NOT NULL AFTER `ip`; SET SQL_SAFE_UPDATES = 0; UPDATE `feedback`.`poll_vote` - SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(SUBSTRING_INDEX(`ip`, ':', 1)), ''), INET_ATON('0.0.0.0')); + SET `ipTEMP` = COALESCE(NULLIF(INET_ATON(`ip`), ''), INET_ATON('0.0.0.0')); SET SQL_SAFE_UPDATES = 1; ALTER TABLE `feedback`.`poll_vote` DROP COLUMN `ip`