Bug #118333 | The collation_connection value of the session connection does not match the expected value. | ||
---|---|---|---|
Submitted: | 3 Jun 3:44 | Modified: | 5 Jun 13:41 |
Reporter: | junhai wei | Email Updates: | |
Status: | Analyzing | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 8.0.41,all | OS: | Any |
Assigned to: | MySQL Verification Team | CPU Architecture: | Any |
[3 Jun 3:44]
junhai wei
[5 Jun 13:41]
junhai wei
To further supplement some information, the above issue will cause an intuitive impact: In step 3, execute the table creation statement and the view creation statement: mysql> CREATE TABLE tt(a int DEFAULT NULL, b varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; Query OK, 0 rows affected (0.09 sec) mysql> insert into tt values(1, 'a'),(2, 'b'); Query OK, 2 rows affected (0.02 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> CREATE VIEW tt_v AS select a, (case when (b in ('1','2')) then 'N' else 'Y' end) AS b from tt; Query OK, 0 rows affected (0.01 sec) At this time, executing the following command is successful, mysql> select * from tt_v where b='Y'; +------+---+ | a | b | +------+---+ | 1 | Y | | 2 | Y | +------+---+ 2 rows in set (0.01 sec) However, after executing step 4, it fails when executed in a new session. mysql> select * from tt_v where b='Y'; ERROR 1267 (HY000): Illegal mix of collations (utf8mb4_0900_ai_ci,COERCIBLE) and (utf8mb4_unicode_ci,COERCIBLE) for operation '='