-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
charset issues #780
Comments
The default for Can you send an extract of tcpdump traffic, to verify? Thank you |
Hi, I have the same issue. I run a test SQL and SHOW VARIABLES LIKE 'character_set%';" together to 3307 and it shows character_set_client/character_set_connection are both latin1. I also have confirmed the mysql-default_charset in proxysql is utf8. Cannot figure out the root cause yet. |
This is very odd, and I assume there is a something in your application that is not being handled correctly by ProxySQL. Can you please run this same test?
From the above, character set is handled correctly.
Thank you! |
Of course.
ProxySQL:
In fact the HG 0 and 1 are the same one mysql, distinguish from tcpdump file as below: |
I did what you say:
In mysql-cli, my result is not same as what you comment previous, what's wrong maybe with my mysql-client? Please help me on this.Thanks |
Hi Renecannao, Thanks for your quick reply. I also have done some test via CLI and confirm "--default-character-set" is okay to force proxysql use the specific charset. The most strange thing is I run 2 SQL as below via phpmyadmin web GUI but get different results. SQL 2: SELECT * FROM event limit 1; SELECT @@session.character_set_client;SHOW VARIABLES LIKE 'character_set%'; No idea why and maybe more information about how proxysql handle "SET NAMES xxx" is appreciated. Thanks. |
Im my case, mysql_query_rules is:
Seems that |
Our environment is also read/write split case. |
One quick note while I analyze the rest of the data: read/write split and query rules should not affect charset, because ProxySQL tracks it internally. |
From tcpdump, ProxySQL advertises itself to use
The client replies it want to use
Immediately after the explicitly ask to
The proxy replies with an unusual large OK packet:
But then the proxy set
I believe this is related to #554 : it seems that Grated that #554 is a bug, the reason why proxysql set |
I understand your thoughts.
immediately. But this statement hasn't be routed to the correct node. |
Oh, from dump I didn't even notice that the statement is sent as a prepared statement (0x16). Changing the charset during the connect phase should be the best option right now. |
How proxysql process the "set xxxx" command, I test several kind of "set" commands via proxysql |
Quoting myself:
That is the case: Similarly, if you issue a |
Got it, thanks for your reply. but @renecannao, excuse me But app(PDO or Laravel) send I simulate the same case with mysql-client (two read node with different data in table test.ljk)
That's the point, so with same phase same charset and same phase send same command, why mysql-client correct but PDO incorrect. |
Hi, After double checking, I think proxysql internal cannot handle "SET NAMES XXX" as expected after connection is established. I am not sure it is a bug or a special design. It means it is not possible to dynamically change charset after connection is created via proxysql. Laravel:
phpmyadmin: $link = mysqli_init();
|
@renecannao,@melson-jao I tcpdump this again, it show us: With Then let's consider the previous case:(with out So, I think there maybe a bug in ProxySQL to process |
@melson-jao , @jkklee : proxysql handles Although possible, I do not think you should set a
Note: charset is specified in the connection string. With regards to mysqli:
b)
|
Note to myself on how to fix this.
|
@renecannao I do not want to focus too much on Laravel, even PHP. Case A => OK Case B => FAIL PS. I run case B without proxysql and it works. The prepared statement set names take effect as expected. It means something wrong when proxysql handle the prepared statement in some case. |
Currently,I think a better way for Laravel to set charset is modify the
to
This will set the charset in phase of the |
@melson-jao: Thank you |
@renecannao
|
Yes, this is tracked in #554 . This has higher priority that handling |
Thanks for your work. |
I had some issues with setting the right character-set, too. Maybe they are caused by my setup, and i need help :). TL;DR -- Detailed explaination -- The second level, consists of four dedicated ProxySQL instances - here comes all together. All the logic, all the different database users, R/W-Splitting and so on. They distribute the traffic to our MySQL servers. Thats the third level: All our different databases are on all of our servers. One of these is a replication master. All MySQL servers are configured the same way, no differences in software configuration. The problem is this: I've tried different things with the mysql-client, for example starting with "--default-character-set=utf8" or "set names utf8". But nothing changed, everytime (before and after doing different queries) i got "latin1" as character_set_(client|results|connection). What i am missing? Maybe someone can help? |
@dwillbrandt : is this still an issue? |
Hello @renecannao, We are experiencing the same issue. We are running ProxySQL 1.4.9 on Debian Stretch. First, a Then, the client connects Then, the client issues as first request Then, queries are issued to a database/table that has In our case, we're hitting this because we are using Mariaex that has the |
Dose proxysql communicate with backend using charset of latin?
My app use utf8, and my table use utf8 too. In normal case, app will send "SET NAMES utf8" to the mysql server, every thing is ok.
After I add proxysql in the middle of app and mysql server, all chinese display incorrect in my app. I found that proxysql send "SET NAMES latin" to the backend server, and I think this is the point of my question.
But in proxysql, I found only one variables about charset
mysql-default_charset
which contorl the charset between client and proxysql.The text was updated successfully, but these errors were encountered: