List:Commits« Previous MessageNext Message »
From:bar Date:May 31 2007 7:10am
Subject:bk commit into 5.1 tree (bar:1.2532)
View as plain text  
Below is the list of changes that have just been committed into a local
5.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@stripped, 2007-05-31 12:10:37+05:00, bar@stripped +1 -0
  Merge abarkov@stripped:/home/bk/mysql-5.1-rpl
  into  mysql.com:/home/bar/mysql-5.1.b28600
  MERGE: 1.2469.212.12

  sql/field.cc@stripped, 2007-05-31 12:10:32+05:00, bar@stripped +0 -0
    Auto merged
    MERGE: 1.385.2.1

# 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.myoffice.izhnet.ru
# Root:	/home/bar/mysql-5.1.b28600/RESYNC

--- 1.393/sql/field.cc	2007-05-18 01:27:06 +05:00
+++ 1.394/sql/field.cc	2007-05-31 12:10:32 +05:00
@@ -5911,6 +5911,7 @@
     well_formed_error_pos    - where not well formed data was first met
     cannot_convert_error_pos - where a not-convertable character was first met
     end                      - end of the string
+    cs                       - character set of the string
 
   NOTES
     As of version 5.0 both cases return the same error:
@@ -5930,7 +5931,8 @@
 check_string_copy_error(Field_str *field,
                         const char *well_formed_error_pos,
                         const char *cannot_convert_error_pos,
-                        const char *end)
+                        const char *end,
+                        CHARSET_INFO *cs)
 {
   const char *pos, *end_orig;
   char tmp[64], *t;
@@ -5944,8 +5946,18 @@
 
   for (t= tmp; pos < end; pos++)
   {
+    /*
+      If the source string is ASCII compatible (mbminlen==1)
+      and the source character is in ASCII printable range (0x20..0x7F),
+      then display the character as is.
+      
+      Otherwise, if the source string is not ASCII compatible (e.g. UCS2),
+      or the source character is not in the printable range,
+      then print the character using HEX notation.
+    */
     if (((unsigned char) *pos) >= 0x20 &&
-        ((unsigned char) *pos) <= 0x7F)
+        ((unsigned char) *pos) <= 0x7F &&
+        cs->mbminlen == 1)
     {
       *t++= *pos;
     }
@@ -6027,7 +6039,7 @@
                               field_charset->pad_char);
 
   if (check_string_copy_error(this, well_formed_error_pos,
-                              cannot_convert_error_pos, from + length))
+                              cannot_convert_error_pos, from + length, cs))
     return 2;
 
   /*
@@ -6479,7 +6491,7 @@
     int2store(ptr, copy_length);
 
   if (check_string_copy_error(this, well_formed_error_pos,
-                              cannot_convert_error_pos, from + length))
+                              cannot_convert_error_pos, from + length, cs))
     return 2;
 
   // Check if we lost something other than just trailing spaces
@@ -7160,7 +7172,7 @@
   bmove(ptr+packlength,(char*) &tmp,sizeof(char*));
 
   if (check_string_copy_error(this, well_formed_error_pos,
-                              cannot_convert_error_pos, from + length))
+                              cannot_convert_error_pos, from + length, cs))
     return 2;
 
   if (from_end_pos < from + length)
Thread
bk commit into 5.1 tree (bar:1.2532)bar31 May