AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   HLstatsX:CE (https://forums.alliedmods.net/forumdisplay.php?f=156)
-   -   [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) [solved] (https://forums.alliedmods.net/showthread.php?t=318515)

heavyisgps 09-04-2019 16:34

[SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) [solved]
 
This is the error when attempting to view the Teams&Actions page of a player.

(1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and (utf8mb4_unicode_ci,IMPLICIT) for operation '='

The attempted SQL code

Code:

                SELECT
                        IFNULL(hlstats_Roles.name, hlstats_Events_ChangeRole.role) AS name,
                        IFNULL(hlstats_Roles.code, hlstats_Events_ChangeRole.role) AS code,
                        COUNT(hlstats_Events_ChangeRole.id) AS rolecount,
                        ROUND(COUNT(hlstats_Events_ChangeRole.id) / IF(110 = 0, 1, 110) * 100, 2) AS percent,
                        hlstats_Frags_as_res.killsTotal,
                        hlstats_Frags_as_res.deathsTotal,
                        ROUND(hlstats_Frags_as_res.killsTotal / IF(hlstats_Frags_as_res.deathsTotal = 0, 1, hlstats_Frags_as_res.deathsTotal), 2) AS kpd
                FROM
                        hlstats_Events_ChangeRole
                LEFT JOIN
                        hlstats_Roles
                ON
                        hlstats_Events_ChangeRole.role = hlstats_Roles.code
                LEFT JOIN
                        hlstats_Frags_as_res
                ON
                        hlstats_Frags_as_res.role = hlstats_Events_ChangeRole.role
                WHERE
                        hlstats_Events_ChangeRole.playerId = 137
                        AND
                        (
                                hidden <> '1'
                                OR hidden IS NULL
                        )
                        AND hlstats_Roles.game = 'tf'
                GROUP BY
                        hlstats_Events_ChangeRole.role
                ORDER BY
                        rolecount desc,
                        name desc

Any ideas on how to fix this? I searched the forum and couldn't find anything on this particular error.

I've looked over the tables and I can't find any table that has utf8mb4_general_ci, everyone has utf8mb4_unicode_ci as far as I can tell.

bongotrommler 09-17-2019 15:43

Re: [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ..
 
check the structure of th table,too ;)

heavyisgps 09-21-2019 20:06

Re: [SQL Error] (1267) Illegal mix of collations (utf8mb4_general_ci,IMPLICIT) and ..
 
Quote:

Originally Posted by bongotrommler (Post 2667340)
check the structure of th table,too ;)

None of my tables are anything but utf8mb4_unicode_ci and I don't have any 'th' table.

EDIT:

Thanks, I got what you meant, my database itself was set to general and not unicode, not sure how that happened, but thanks for the tip!


All times are GMT -4. The time now is 00:13.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.