Skip to content

Commit

Permalink
more query fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordie0608 authored Mar 3, 2017
1 parent d48ce42 commit fe42f62
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions SQL/optimisations_2017-02-19.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand Down

0 comments on commit fe42f62

Please sign in to comment.