Commit c0230f6f authored by bar@mysql.com's avatar bar@mysql.com

ctype_latin1.result, ctype_latin1.test, charset.c:

  Treat unknown characters straight in a query as syntax error, rather skipping it as a space character.
parent c709ad87
...@@ -325,3 +325,8 @@ latin1_bin 6109 ...@@ -325,3 +325,8 @@ latin1_bin 6109
latin1_bin 61 latin1_bin 61
latin1_bin 6120 latin1_bin 6120
drop table t1; drop table t1;
CREATE TABLE a (a int);
ERROR 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 'a (a int)' at line 1
SELECT 'a' as str;
str
a
...@@ -66,3 +66,12 @@ SET collation_connection='latin1_swedish_ci'; ...@@ -66,3 +66,12 @@ SET collation_connection='latin1_swedish_ci';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
SET collation_connection='latin1_bin'; SET collation_connection='latin1_bin';
-- source include/ctype_filesort.inc -- source include/ctype_filesort.inc
#
# Bug#8041
# An unknown character (e.g. 0x84) should result in ERROR,
# It was treated like a space character earlier.
# Howerver, it should still work fine as a string part.
--error 1064
CREATE TABLE a (a int);
SELECT 'a' as str;
...@@ -64,7 +64,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs) ...@@ -64,7 +64,7 @@ static my_bool init_state_maps(CHARSET_INFO *cs)
else if (my_mbcharlen(cs, i)>1) else if (my_mbcharlen(cs, i)>1)
state_map[i]=(uchar) MY_LEX_IDENT; state_map[i]=(uchar) MY_LEX_IDENT;
#endif #endif
else if (!my_isgraph(cs,i)) else if (my_isspace(cs,i))
state_map[i]=(uchar) MY_LEX_SKIP; state_map[i]=(uchar) MY_LEX_SKIP;
else else
state_map[i]=(uchar) MY_LEX_CHAR; state_map[i]=(uchar) MY_LEX_CHAR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment