From a453ed7ceabf51a4b67e3f17fc66f15a96acfe02 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Fri, 21 Apr 2023 15:16:51 +0200 Subject: [PATCH] changes regarding encoding of tables --- pandora_console/extras/mr/63.sql | 7 +++++++ pandora_console/include/class/TipsWindow.class.php | 4 ++-- pandora_console/pandoradb.sql | 6 +++--- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 pandora_console/extras/mr/63.sql diff --git a/pandora_console/extras/mr/63.sql b/pandora_console/extras/mr/63.sql new file mode 100644 index 0000000000..30417b2dcc --- /dev/null +++ b/pandora_console/extras/mr/63.sql @@ -0,0 +1,7 @@ +START TRANSACTION; + +ALTER TABLE tpolicy_group_agents CONVERT TO CHARACTER SET UTF8MB4; +ALTER TABLE tevent_sound CONVERT TO CHARACTER SET UTF8MB4; +ALTER TABLE tsesion_filter CONVERT TO CHARACTER SET UTF8MB4; + +COMMIT; diff --git a/pandora_console/include/class/TipsWindow.class.php b/pandora_console/include/class/TipsWindow.class.php index 712fc62f0a..4f913f5a28 100644 --- a/pandora_console/include/class/TipsWindow.class.php +++ b/pandora_console/include/class/TipsWindow.class.php @@ -570,7 +570,7 @@ class TipsWindow $sql = sprintf( 'SELECT id, name AS language, title, text, url, enable FROM twelcome_tip t - LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci + LEFT JOIN tlanguage l ON t.id_lang COLLATE utf8mb4_unicode_ci = CONVERT(l.id_language USING utf8mb4) COLLATE utf8mb4_unicode_ci %s %s %s', $filter, $order, @@ -582,7 +582,7 @@ class TipsWindow $sqlCount = sprintf( 'SELECT count(*) FROM twelcome_tip t - LEFT JOIN tlanguage l ON t.id_lang = l.id_language COLLATE utf8mb4_unicode_ci + LEFT JOIN tlanguage l ON t.id_lang COLLATE utf8mb4_unicode_ci = CONVERT(l.id_language USING utf8mb4) COLLATE utf8mb4_unicode_ci %s', $filter ); diff --git a/pandora_console/pandoradb.sql b/pandora_console/pandoradb.sql index 981b8a5ded..6702300ce9 100644 --- a/pandora_console/pandoradb.sql +++ b/pandora_console/pandoradb.sql @@ -2610,7 +2610,7 @@ CREATE TABLE IF NOT EXISTS `tpolicy_group_agents` ( ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (`id_agent`) REFERENCES `tagente`(`id_agente`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- --------------------------------------------------------------------- -- Table `tdashboard` @@ -4237,7 +4237,7 @@ CREATE TABLE `tevent_sound` ( `name` TEXT NULL, `sound` TEXT NULL, `active` TINYINT NOT NULL DEFAULT '1', -PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8; +PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; -- --------------------------------------------------------------------- -- Table `tsesion_filter` @@ -4251,7 +4251,7 @@ CREATE TABLE IF NOT EXISTS `tsesion_filter` ( `type` TEXT NULL, `user` TEXT NULL, PRIMARY KEY (`id_filter`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4; CREATE TABLE IF NOT EXISTS `twelcome_tip` (