SQL: Fix missing ;

This commit is contained in:
Shauren
2026-04-22 21:09:45 +02:00
parent 4c14988578
commit a23aeafde7
2 changed files with 214 additions and 201 deletions
+1 -1
View File
@@ -4093,7 +4093,7 @@ INSERT INTO `updates` VALUES
('2026_02_06_00_characters.sql','90735F4481A137E79B8371F291008CF6051657AC','ARCHIVED','2026-02-06 12:45:48',0),
('2026_03_21_00_characters.sql','87963F4E341B195D4B4C4514A3119092DF127431','RELEASED','2026-03-21 00:42:13',0),
('2026_04_08_00_characters.sql','5A7FC8264EBD524E4EBAACF53D1CE89C6FF0D255','RELEASED','2026-04-07 10:24:16',0),
('2026_04_22_00_characters.sql','B154E0D8408CCE5636596EDC9C5024FFE41F2CD6','RELEASED','2026-04-22 19:26:05',0);
('2026_04_22_00_characters.sql','7EA266122924A3F8940D1D2E62F7C1BBC1D10333','RELEASED','2026-04-22 19:26:05',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1,28 +1,33 @@
-- Fill new situations
DELETE FROM `character_transmog_outfit_situation` WHERE `situationID` BETWEEN 32 AND 41;
-- All Weather
INSERT INTO `character_transmog_outfit_situation`
SELECT `guid`, `transmogOutfitId`, 32, 0, 0, 0 FROM `character_transmog_outfit_situation` GROUP BY guid, transmogOutfitId;
-- All Times
INSERT INTO `character_transmog_outfit_situation`
SELECT `guid`, `transmogOutfitId`, 37, 0, 0, 0 FROM `character_transmog_outfit_situation` GROUP BY guid, transmogOutfitId;
ALTER TABLE `character_transmog_outfit_slot` ADD `sheatheCategory` tinyint UNSIGNED AFTER `slotOption`;
UPDATE `character_transmog_outfit_slot` SET `sheatheCategory` = 0;
ALTER TABLE `character_transmog_outfit_slot` MODIFY `sheatheCategory` tinyint UNSIGNED NOT NULL AFTER `slotOption`;
DROP FUNCTION IF EXISTS `get_nth_token`;
CREATE FUNCTION `get_nth_token`(x TEXT, delim VARCHAR(16), pos INT) RETURNS TEXT NO SQL
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos), LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1), delim, '');
--
-- Table structure for table `character_select_screen_equipment_cache`
--
DROP TABLE IF EXISTS `character_select_screen_equipment_cache`;
CREATE TABLE `character_select_screen_equipment_cache` (
DELIMITER ;;
CREATE PROCEDURE apply_if_not_exists_2026_04_22_00() BEGIN
-- Fill new situations
DELETE FROM `character_transmog_outfit_situation` WHERE `situationID` BETWEEN 32 AND 41;
-- All Weather
INSERT INTO `character_transmog_outfit_situation`
SELECT `guid`, `transmogOutfitId`, 32, 0, 0, 0 FROM `character_transmog_outfit_situation` GROUP BY guid, transmogOutfitId;
-- All Times
INSERT INTO `character_transmog_outfit_situation`
SELECT `guid`, `transmogOutfitId`, 37, 0, 0, 0 FROM `character_transmog_outfit_situation` GROUP BY guid, transmogOutfitId;
IF NOT EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema`=SCHEMA() AND `table_name`='character_transmog_outfit_slot' AND `column_name`='sheatheCategory') THEN
ALTER TABLE `character_transmog_outfit_slot` ADD `sheatheCategory` tinyint UNSIGNED AFTER `slotOption`;
UPDATE `character_transmog_outfit_slot` SET `sheatheCategory` = 0;
ALTER TABLE `character_transmog_outfit_slot` MODIFY `sheatheCategory` tinyint UNSIGNED NOT NULL AFTER `slotOption`;
END IF;
IF EXISTS (SELECT * FROM `information_schema`.`columns` WHERE `table_schema`=SCHEMA() AND `table_name`='characters' AND `column_name`='equipmentCache') THEN
--
-- Table structure for table `character_select_screen_equipment_cache`
--
DROP TABLE IF EXISTS `character_select_screen_equipment_cache`;
CREATE TABLE `character_select_screen_equipment_cache` (
`guid` bigint unsigned NOT NULL,
`headEquippedItemID` int unsigned NOT NULL DEFAULT '0',
`headVisibleItemID` int unsigned NOT NULL DEFAULT '0',
@@ -177,9 +182,9 @@ CREATE TABLE `character_select_screen_equipment_cache` (
`tabardSecondaryItemModifiedAppearanceID` int NOT NULL DEFAULT '0',
`tabardSheatheCategory` tinyint unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`guid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `character_select_screen_equipment_cache` SELECT guid,
INSERT INTO `character_select_screen_equipment_cache` SELECT guid,
-- equipped item id | visible item id | subclass | inventory type | display id | enchant | secondary appearance | sheathe category
/* head */ 0 , 0 , get_nth_token(`equipmentCache`,' ', 4) , get_nth_token(`equipmentCache`,' ', 1) , get_nth_token(`equipmentCache`,' ', 2) , get_nth_token(`equipmentCache`,' ', 3) , get_nth_token(`equipmentCache`,' ', 5) , 0,
/* neck */ 0 , 0 , get_nth_token(`equipmentCache`,' ', 9) , get_nth_token(`equipmentCache`,' ', 6) , get_nth_token(`equipmentCache`,' ', 7) , get_nth_token(`equipmentCache`,' ', 8) , get_nth_token(`equipmentCache`,' ',10) , 0,
@@ -200,8 +205,16 @@ INSERT INTO `character_select_screen_equipment_cache` SELECT guid,
/* off hand */ 0 , 0 , get_nth_token(`equipmentCache`,' ',84) , get_nth_token(`equipmentCache`,' ',81) , get_nth_token(`equipmentCache`,' ',82) , get_nth_token(`equipmentCache`,' ',83) , get_nth_token(`equipmentCache`,' ',85) , 0,
/* ranged */ 0 , 0 , get_nth_token(`equipmentCache`,' ',89) , get_nth_token(`equipmentCache`,' ',86) , get_nth_token(`equipmentCache`,' ',87) , get_nth_token(`equipmentCache`,' ',88) , get_nth_token(`equipmentCache`,' ',90) , 0,
/* tabard */ 0 , 0 , get_nth_token(`equipmentCache`,' ',94) , get_nth_token(`equipmentCache`,' ',91) , get_nth_token(`equipmentCache`,' ',92) , get_nth_token(`equipmentCache`,' ',93) , get_nth_token(`equipmentCache`,' ',95) , 0
FROM `characters`;
FROM `characters`;
DROP FUNCTION IF EXISTS `get_nth_token`
ALTER TABLE `characters` DROP `equipmentCache`;
END IF;
END;;
ALTER TABLE `characters` DROP `equipmentCache`;
DELIMITER ;
CALL apply_if_not_exists_2026_04_22_00();
DROP PROCEDURE apply_if_not_exists_2026_04_22_00;
DROP FUNCTION `get_nth_token`;