【发布时间】:2020-11-11 18:57:32
【问题描述】:
我正在mysql中运行该过程,但由于以下错误而失败
错误 1267 (HY000):排序规则 (utf8mb4_general_ci,IMPLICIT) 和 (utf8mb4_unicode_ci,IMPLICIT) 用于操作“like”的非法混合
mysql> show PROCEDURE STATUS where name like 'PRE_PROCESSING';
+-----------------+----------------+-----------+-------------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| Db | Name | Type | Definer | Modified | Created | Security_type | Comment | character_set_client | collation_connection | Database Collation |
+-----------------+----------------+-----------+-------------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
| main_model | PRE_PROCESSING | PROCEDURE | main_model@% | 2020-09-18 20:30:18 | 2020-09-18 20:30:18 | DEFINER | | utf8mb4 | utf8mb4_general_ci | utf8mb4_unicode_ci |
+-----------------+----------------+-----------+-------------------+---------------------+---------------------+---------------+---------+----------------------+----------------------+--------------------+
mysql> show TABLE STATUS where name like 'Customer'; +-----------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | Name | Engine | Version | Row_format | Rows | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free | Auto_increment | Create_time | Update_time | Check_time | Collation | Checksum | Create_options | Comment | +-----------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ | Customer | InnoDB | 10 | Dynamic | 14174 | 338 | 4800512 | 0 | 3735552 | 2097152 | NULL | 2020-09-18 20:30:17 | NULL | NULL | utf8mb4_unicode_ci | NULL | | | +-----------+--------+---------+------------+-------+----------------+-------------+-----------------+--------------+-----------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+ 1 row in set (0.00 sec)
show variables like "%collation%";
+----------------------+--------------------+
| Variable_name | Value |
+----------------------+--------------------+
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+----------------------+--------------------+
【问题讨论】:
-
我会使用明确的排序规则指定。显示导致问题的语句。
-
请显示
show create procedure PRE_PROCESSING \G和show create table Customer \G的输出以及您发出的导致错误的请求。