sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.04k stars 982 forks source link

unreadable code with emoji characters queried by proxysql #2462

Open kuberxy opened 4 years ago

kuberxy commented 4 years ago

env

$ uname -a
Linux cynode002 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

$ dpkg -l | egrep "mysql-server|proxysql"
ii  mysql-server                          8.0.17-1ubuntu18.04                amd64        MySQL Server meta package depending on latest version
ii  proxysql                              2.0.6                              amd64        High performance MySQL proxy

issue

query by direct mysql master

image

query by proxysql

image

query tools

image

character set

# mysql
> show variables like '%character%';
+--------------------------+--------------------------------+
| Variable_name            | Value                          |
+--------------------------+--------------------------------+
| character_set_client     | utf8mb4                        |
| character_set_connection | utf8mb4                        |
| character_set_database   | utf8mb4                        |
| character_set_filesystem | binary                         |
| character_set_results    | utf8mb4                        |
| character_set_server     | utf8mb4                        |
| character_set_system     | utf8                           |
| character_sets_dir       | /usr/share/mysql-8.0/charsets/ |
+--------------------------+--------------------------------+

# proxysql
Admin> show variables like '%char%';
+-----------------------+---------+
| Variable_name         | Value   |
+-----------------------+---------+
| mysql-default_charset | utf8mb4 |
+-----------------------+---------+
1 row in set (0.00 sec)
asad-awadia commented 4 years ago

bump - I am seeing this too - any @kuberxy updates?

renecannao commented 4 years ago

Do you have any way to reproduce this issue? We need some script/data to reproduce it.

Thanks

asad-awadia commented 4 years ago

have proxysql 2.0.4 infront of a mariaDB 10.1 that has charset latin1

make an insert to a text column that has an emoji - it gets converted to ???

columns that had the correct emoji bytes - when coming back out through proxysql on the read path - render as bytes rather than the emoji it self

Its fine now - we figured it out -- proxysql.cnf charset needs to be set to latin1 -- I guess by default its utf8

kuberxy commented 4 years ago

@renecannao Oh, so sorry. This is our company's environment. -----------env------------------------------------------------------ mysql-connector-java to proxyql to mysql --------------------------------------------------------------------- I found a very strange problem: everything is ok when I restart proxysql,but after running for a long time the above issue appear.

kuberxy commented 4 years ago

INSERT INTO test_db.article (title) VALUES ('😄');