MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:bar Date:April 20 2006 5:56am
Subject:bk commit into 4.1 tree (bar:1.2464) BUG#17313
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 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
  1.2464 06/04/20 10:56:53 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.

  sql/sql_lex.cc
    1.152 06/04/20 10:56:46 bar@stripped +9 -12
    Reusing get_text() when parsing national string.

  mysql-test/t/ctype_utf8.test
    1.72 06/04/20 10:56:46 bar@stripped +11 -0
    Adding test case

  mysql-test/r/ctype_utf8.result
    1.70 06/04/20 10:56:46 bar@stripped +12 -0
    Adding test case

# 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-4.1.b17313

--- 1.151/sql/sql_lex.cc	2005-10-13 01:51:38 +05:00
+++ 1.152/sql/sql_lex.cc	2006-04-20 10:56:46 +05:00
@@ -567,23 +567,20 @@ int yylex(void *arg, void *yythd)
 
     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.69/mysql-test/r/ctype_utf8.result	2006-03-30 03:50:50 +05:00
+++ 1.70/mysql-test/r/ctype_utf8.result	2006-04-20 10:56:46 +05:00
@@ -1078,6 +1078,18 @@ LENGTH(bug)
 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.71/mysql-test/t/ctype_utf8.test	2006-03-30 03:50:50 +05:00
+++ 1.72/mysql-test/t/ctype_utf8.test	2006-04-20 10:56:46 +05:00
@@ -893,6 +893,17 @@ DROP TABLE t2;
 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 4.1 tree (bar:1.2464) BUG#17313bar20 Apr