Skip to content

Commit

Permalink
Merge pull request #889 from SUPLA/develop
Browse files Browse the repository at this point in the history
Illegal mix of collations
  • Loading branch information
przemyslawzygmunt authored Sep 25, 2024
2 parents 7795e20 + 282ec72 commit fbff2a1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
DROP PROCEDURE IF EXISTS `supla_set_channel_json_config`;

CREATE PROCEDURE `supla_set_channel_json_config`(IN `_user_id` INT, IN `_channel_id` INT, IN `_user_config` TEXT,
IN `_user_config_md5` VARCHAR(32), IN `_properties` TEXT,
CREATE PROCEDURE `supla_set_channel_json_config`(IN `_user_id` INT, IN `_channel_id` INT, IN `_user_config` TEXT CHARSET utf8mb4,
IN `_user_config_md5` VARCHAR(32), IN `_properties` TEXT CHARSET utf8mb4,
IN `_properties_md5` VARCHAR(32))
NOT DETERMINISTIC
CONTAINS SQL SQL SECURITY DEFINER
Expand All @@ -13,7 +13,7 @@ BEGIN
AND user_id = _user_id
AND MD5(IFNULL(user_config, '')) = _user_config_md5
AND MD5(IFNULL(properties, '')) = _properties_md5;
SELECT ABS(STRCMP(user_config, _user_config)) + ABS(STRCMP(properties, _properties))
SELECT ABS(STRCMP(user_config, _user_config COLLATE utf8mb4_unicode_ci)) + ABS(STRCMP(properties, _properties COLLATE utf8mb4_unicode_ci))
FROM supla_dev_channel
WHERE id = _channel_id
AND user_id = _user_id;
Expand Down

0 comments on commit fbff2a1

Please sign in to comment.