-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
global sql_mode NO_BACKSLASH_ESCAPES doesn't behave as expected #51387
Comments
can't reproduce this on v7.6.0 and master ➜ ~ mysql -uroot -h127.0.0.1 -uroot -E -e "insert into test.t1 (id, a, c) values(1, 'insert+select_sql_mode', 'ab\\\\c'); select * from test.t1; SELECT @@session.sql_mode;" -P4000
*************************** 1. row ***************************
id: 1
a: insert+select_sql_mode
b: insert+select_sql_mode
c: ab\\c
*************************** 1. row ***************************
@@session.sql_mode: NO_BACKSLASH_ESCAPES
➜ ~ mysql -uroot -h127.0.0.1 -uroot -E -e " SELECT @@session.sql_mode; insert into test.t1 (id, a, c) values(2, 'select_sql_mode+insert', 'ab\\\\c'); select * from test.t1;" -P4000
*************************** 1. row ***************************
@@session.sql_mode: NO_BACKSLASH_ESCAPES
*************************** 1. row ***************************
id: 1
a: insert+select_sql_mode
b: insert+select_sql_mode
c: ab\\c
*************************** 2. row ***************************
id: 2
a: select_sql_mode+insert
b: select_sql_mode+insert
c: ab\\c |
Hi @aytrack , I think this issue should be label as |
@aytrack Thanks, i tests other cases:
In conclusion, i think this issue is caused by the incompatibility of maria-client with tidb-server. So, would you please assess if further investigation is needed? In addition, could you please check the scenario in |
It's because the first query doesn't load the variables, so it uses empty SQLMode. This bug only affects text protocol |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
2. What did you expect to see? (Required)
3. What did you see instead (Required)
4. What is your TiDB version? (Required)
mysql client version:
5. Another issue
With mysql driver in golang, we execute the following test:
5.1 Test DDLs
the result is as expected: the table structure of t1 is incorrect because it treats
\
as an escape character. And the table structure of t1 is correct.5.2 Test DMLs
And we got unexpected result in tidb:
The text was updated successfully, but these errors were encountered: