Bug #80948 can't parse a few basic sql when swe7 is set
Submitted: 4 Apr 2016 18:54 Modified: 14 Jun 2016 7:04
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Parser Severity:S4 (Feature request)
Version:5.x OS:Any
Assigned to: CPU Architecture:Any
Tags: swe7

[4 Apr 2016 18:54] Shane Bester
Description:
if current charset is swe7, it is causing some queries to fail with syntax error.

mysql> set names swe7;
Query OK, 0 rows affected (0.00 sec)

mysql> do (( '@,' )^( 60628 ))  ;
ERROR 1064 (42000): You have an error in your SQL synta
mysql> do (( 1.546392e+308 )^( '' ))  ;
ERROR 1064 (42000): You have an error in your SQL synta
mysql> do (( 0x25a2 )^( null ))  ;
ERROR 1064 (42000): You have an error in your SQL synta
mysql> do ~(1+1);
ERROR 1305 (42000): FUNCTION test.\007E does not exist
mysql> drop procedure if exists p;
Query OK, 0 rows affected (0.00 sec)
mysql> create procedure p() do ~(1+1);
Query OK, 0 rows affected (0.00 sec)
mysql> call p();
ERROR 3512 (HY000): Failed to load routine 'test.p'.

How to repeat:
# here are a few simple queries that fail:

set names swe7;
do (( '@,' )^( 60628 ))  ;
do (( 1.546392e+308 )^( '' ))  ;
do (( 0x25a2 )^( null ))  ;
do ~(1+1);
drop procedure if exists p;
create procedure p() do ~(1+1);
call p();

Suggested fix:
no idea. it seems to me this charset doesn't support all characters used by basic sql syntax, such as ^ and ~  to name a few?  maybe this is not a bug? unsure.

https://en.wikipedia.org/wiki/ISO/IEC_646
[6 Apr 2016 5:58] MySQL Verification Team
see also:  https://bugs.mysql.com/bug.php?id=35499
[14 Jun 2016 7:04] MySQL Verification Team
for now i'll consider this not-a-bug.  it is confusing to me why we support such a charset,  but that is not the point of this report...