MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:bar Date:July 31 2006 7:47am
Subject:bk commit into 5.0 tree (bar:1.2221)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of bar. When bar does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-07-31 12:47:01+05:00, bar@stripped +3 -0
  N'xxx' and _utf8'xxx' are not equivalent
  Problem: Unescaping of '\' characters didn't work when processing N'xxx'.
  Fix: using get_text() instead of get_token() when scanning nationa strings.

  mysql-test/r/ctype_utf8.result@stripped, 2006-07-31 12:46:56+05:00, bar@stripped +12 -0
    Adding test case

  mysql-test/t/ctype_utf8.test@stripped, 2006-07-31 12:46:56+05:00, bar@stripped +11 -0
    Adding test case

  sql/sql_lex.cc@stripped, 2006-07-31 12:46:56+05:00, bar@stripped +9 -12
    Fixing to process national strings using get_tex(),
    i.e. the same way with usual strings, to make
    unescaping work.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-5.0.b17313

--- 1.192/sql/sql_lex.cc	2006-07-31 12:47:10 +05:00
+++ 1.193/sql/sql_lex.cc	2006-07-31 12:47:10 +05:00
@@ -557,23 +557,20 @@
 
     case MY_LEX_IDENT_OR_NCHAR:
       if (yyPeek() != '\'')
-      {					// Found x'hex-number'
+      {					
 	state= MY_LEX_IDENT;
 	break;
       }
-      yyGet();				// Skip '
-      while ((c = yyGet()) && (c !='\'')) ;
-      length=(lex->ptr - lex->tok_start);	// Length of hexnum+3
-      if (c != '\'')
+      /* Found N'string' */
+      lex->tok_start++;                 // Skip N
+      yySkip();                         // Skip '
+      if (!(yylval->lex_str.str = get_text(lex)))
       {
-	return(ABORT_SYM);		// Illegal hex constant
+	state= MY_LEX_CHAR;             // Read char by char
+	break;
       }
-      yyGet();				// get_token makes an unget
-      yylval->lex_str=get_token(lex,length);
-      yylval->lex_str.str+=2;		// Skip x'
-      yylval->lex_str.length-=3;	// Don't count x' and last '
-      lex->yytoklen-=3;
-      return (NCHAR_STRING);
+      yylval->lex_str.length= lex->yytoklen;
+      return(NCHAR_STRING);
 
     case MY_LEX_IDENT_OR_HEX:
       if (yyPeek() == '\'')

--- 1.92/mysql-test/r/ctype_utf8.result	2006-07-31 12:47:10 +05:00
+++ 1.93/mysql-test/r/ctype_utf8.result	2006-07-31 12:47:10 +05:00
@@ -1066,6 +1066,18 @@
 100
 DROP TABLE t2;
 DROP TABLE t1;
+CREATE TABLE t1 (item varchar(255)) default character set utf8;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+item
+Cote d'Ivoire
+Cote d'Ivoire
+\
+\
+DROP TABLE t1;
 SET NAMES utf8;
 DROP TABLE IF EXISTS t1;
 Warnings:

--- 1.85/mysql-test/t/ctype_utf8.test	2006-07-31 12:47:10 +05:00
+++ 1.86/mysql-test/t/ctype_utf8.test	2006-07-31 12:47:10 +05:00
@@ -879,6 +879,17 @@
 DROP TABLE t1;
 
 #
+# Bug#17313: N'xxx' and _utf8'xxx' are not equivalent
+#
+CREATE TABLE t1 (item varchar(255)) default character set utf8;
+INSERT INTO t1 VALUES (N'\\');
+INSERT INTO t1 VALUES (_utf8'\\');
+INSERT INTO t1 VALUES (N'Cote d\'Ivoire');
+INSERT INTO t1 VALUES (_utf8'Cote d\'Ivoire');
+SELECT item FROM t1 ORDER BY item;
+DROP TABLE t1;
+
+#
 # Bug#17705: Corruption of compressed index when index length changes between
 # 254 and 256
 #
Thread
bk commit into 5.0 tree (bar:1.2221)bar31 Jul