Bug #89619 Wrong view definition made from cp932 client in case of including 0x5c.
Submitted: 11 Feb 2018 21:57 Modified: 12 Feb 2018 5:32
Reporter: Meiji Kimura Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DDL Severity:S3 (Non-critical)
Version:5.6, 5.7 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[11 Feb 2018 21:57] Meiji Kimura
Description:
cp932(and sjis) is often used for Japanese Windows users.

But that character set includes 0x5c as 2nd bye of kanji character, so it's cause of miss handling strings.

In this case, it affects to view definition.

If I make a view including 0x5c from the client with cp932, view definition is made with additional 0x5c, so it become wrong definition.

How to repeat:
mysql> set names cp932;
Query OK, 0 rows affected (0.00 sec)

mysql> create or replace view v_test
    -> as
    -> select '十';
Query OK, 0 rows affected (0.05 sec)

mysql> show create table v_test\G
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''十\'

Suggested fix:
No additional 0x5c(\) for escaping for 2nd byte of cp932(sjis) character.

[Work around]
Use UTF-8 client for such a view (e.g. MySQL Workbench for Windows).
[12 Feb 2018 5:32] Umesh Shastry
Hello Meiji-San,

Thank you for the report.

Thanks,
Umesh