Comment 4 for bug 1680783

Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

copy from https://review.openstack.org/455154 comments

after debuging this issue, i found the root cause is:
panko is using CAST with UNION, but the "connection_collation" is still utf8_generic_ci.
The CAST return utf8_generic_ci collation and UNION with other utf8_unicode_ci field. So only Panko raise this error and others not.
There are two fix directs
1. like daidv does in this patch
2. add init-connect = 'SET NAMES utf8 COLLATE utf8_unicode_ci' into mysqld group in my.cnf
both are OK.
@inc for 1), the exsitance table will not be change when u changing the default mysql character and collation. So this patch is OK.
for 2) is setting the default collation connection variable during connection which works too.
For me, i prefer to use daidv's soltuion. due to utf8_generic_ci is the default value in mariadb when using utf8. and utf8_unicode_ci is random choosed by me actually.
So i +2 for this patch.