MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:bar Date:July 31 2006 8:03am
Subject:bk commit into 5.0 tree (bar:1.2221) BUG#17313
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 13:03:22+05:00, bar@stripped +3 -0
  Bug#17313: N'xxx' and _utf8'xxx' are not equivalent
    
    N'xxx' didn't unescape backslashes and double apostrophs.
    
    Fixed to reuse get_text() when parsing N'xxx', which
    makes N'xxx' and _utf8'xxx' work the same, like the manual states.
  

  mysql-test/r/ctype_utf8.result@stripped, 2006-07-31 13:03:17+05:00, bar@stripped +12 -0
    Adding test

  mysql-test/t/ctype_utf8.test@stripped, 2006-07-31 13:03:17+05:00, bar@stripped +11 -0
    Adding test

  sql/sql_lex.cc@stripped, 2006-07-31 13:03:18+05:00, bar@stripped +9 -12
    Reusing get_text() when parsing national strings.

# 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 13:03:32 +05:00
+++ 1.193/sql/sql_lex.cc	2006-07-31 13:03:32 +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 13:03:32 +05:00
+++ 1.93/mysql-test/r/ctype_utf8.result	2006-07-31 13:03:32 +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 13:03:32 +05:00
+++ 1.86/mysql-test/t/ctype_utf8.test	2006-07-31 13:03:32 +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) BUG#17313bar31 Jul