diff options
author | jackpoz <giacomopoz@gmail.com> | 2015-02-05 21:31:50 +0100 |
---|---|---|
committer | jackpoz <giacomopoz@gmail.com> | 2015-02-05 21:44:57 +0100 |
commit | 919ab9157e7458257e300546e05312049b0872cd (patch) | |
tree | 84facb32d648b7d3b7d15832467d4f125e3168c5 | |
parent | 9db2e6dbbe216be9c87867e1412bb8b1b980bfdb (diff) |
SQL: Make sure the correct world db is select when executing SQL update scripts
Make sure script 2014_12_25_00_hotfixes_locale_broadcast_text.sql affects the correct world database version "TDB 6.00". This fixes an issue where the script would drop table "locales_broadcast_text" from a world database of another version (335, 434).
Issue added in df444890daf74e95d51a229f99996561a88ac71a
-rw-r--r-- | sql/base/dev/world_database.sql | 2 | ||||
-rw-r--r-- | sql/updates/hotfixes/2014_12_25_00_hotfixes_locale_broadcast_text.sql | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sql/base/dev/world_database.sql b/sql/base/dev/world_database.sql index 54a135f84b8..76c899b6aed 100644 --- a/sql/base/dev/world_database.sql +++ b/sql/base/dev/world_database.sql @@ -3769,6 +3769,8 @@ CREATE TABLE `version` ( ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Version Notes'; /*!40101 SET character_set_client = @saved_cs_client */; +INSERT INTO `version` (`core_version`) VALUES (''); + -- -- Table structure for table `warden_checks` -- diff --git a/sql/updates/hotfixes/2014_12_25_00_hotfixes_locale_broadcast_text.sql b/sql/updates/hotfixes/2014_12_25_00_hotfixes_locale_broadcast_text.sql index e6563bce913..305525d84ab 100644 --- a/sql/updates/hotfixes/2014_12_25_00_hotfixes_locale_broadcast_text.sql +++ b/sql/updates/hotfixes/2014_12_25_00_hotfixes_locale_broadcast_text.sql @@ -23,6 +23,15 @@ CREATE TABLE `locales_broadcast_text` ( PRIMARY KEY (`ID`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; +DELIMITER $$ +DROP PROCEDURE IF EXISTS `2014_12_25_00_hotfixes_locale_broadcast_text`$$ +CREATE PROCEDURE `2014_12_25_00_hotfixes_locale_broadcast_text`() +BEGIN +SET @querydbversion := CONCAT('SET @worlddbversion = (SELECT `db_version` FROM `', @world_db_name, '`.`version`);'); +PREPARE stmtdbversion FROM @querydbversion; +EXECUTE stmtdbversion; +DEALLOCATE PREPARE stmtdbversion; +IF @worlddbversion = 'TDB 6.00' THEN SET @query := CONCAT('INSERT INTO `locales_broadcast_text` SELECT * FROM `', @world_db_name, '`.`locales_broadcast_text`;'); PREPARE stmt FROM @query; EXECUTE stmt; @@ -32,3 +41,11 @@ SET @query := CONCAT('DROP TABLE IF EXISTS `', @world_db_name, '`.`locales_broad PREPARE stmt2 FROM @query; EXECUTE stmt2; DEALLOCATE PREPARE stmt2; +ELSE +CALL set_the_6x_world_database_name_at_line_1_of_this_script; +END IF; +END$$ + +CALL `2014_12_25_00_hotfixes_locale_broadcast_text`$$ +DROP PROCEDURE IF EXISTS `2014_12_25_00_hotfixes_locale_broadcast_text`$$ +DELIMITER ; |