List:Internals« Previous MessageNext Message »
From:bar Date:April 6 2005 6:53am
Subject:bk commit into 4.1 tree (bar:1.2163)
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.2163 05/04/06 11:53:15 bar@stripped +12 -0
  Adding a new parameter for well_formed_length to 
  return error. We'll use it for better warnign reporting.

  strings/ctype-ujis.c
    1.62 05/04/06 11:53:09 bar@stripped +11 -2
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  strings/ctype-ucs2.c
    1.38 05/04/06 11:53:09 bar@stripped +3 -3
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  strings/ctype-sjis.c
    1.76 05/04/06 11:53:09 bar@stripped +4 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  strings/ctype-simple.c
    1.63 05/04/06 11:53:08 bar@stripped +3 -3
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  strings/ctype-mb.c
    1.38 05/04/06 11:53:08 bar@stripped +6 -3
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  strings/ctype-big5.c
    1.72 05/04/06 11:53:08 bar@stripped +5 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  sql/sql_yacc.yy
    1.380 05/04/06 11:53:08 bar@stripped +2 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  sql/field.cc
    1.214 05/04/06 11:53:08 bar@stripped +8 -7
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  ndb/src/ndbapi/NdbOperationSearch.cpp
    1.9 05/04/06 11:53:08 bar@stripped +3 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  ndb/src/ndbapi/NdbOperationDefine.cpp
    1.15 05/04/06 11:53:08 bar@stripped +3 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  ndb/src/ndbapi/NdbIndexOperation.cpp
    1.14 05/04/06 11:53:08 bar@stripped +3 -1
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

  include/m_ctype.h
    1.103 05/04/06 11:53:08 bar@stripped +6 -3
    Adding a new parameter for well_formed_length to 
    return error. We'll use it for better warnign reporting.

# 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

--- 1.102/include/m_ctype.h	2004-11-22 11:58:35 +04:00
+++ 1.103/include/m_ctype.h	2005-04-06 11:53:08 +05:00
@@ -147,7 +147,8 @@
   uint    (*numchars)(struct charset_info_st *, const char *b, const char *e);
   uint    (*charpos)(struct charset_info_st *, const char *b, const char *e, uint pos);
   uint    (*well_formed_len)(struct charset_info_st *,
-  			   const char *b,const char *e, uint nchars);
+                             const char *b,const char *e,
+                             uint nchars, int *error);
   uint    (*lengthsp)(struct charset_info_st *, const char *ptr, uint length);
   uint    (*numcells)(struct charset_info_st *, const char *b, const char *e);
   
@@ -341,7 +342,8 @@
 uint my_numchars_8bit(CHARSET_INFO *, const char *b, const char *e);
 uint my_numcells_8bit(CHARSET_INFO *, const char *b, const char *e);
 uint my_charpos_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_8bit(CHARSET_INFO *, const char *b, const char *e,
+                             uint pos, int *error);
 int my_mbcharlen_8bit(CHARSET_INFO *, uint c);
 
 
@@ -359,7 +361,8 @@
 uint my_numchars_mb(CHARSET_INFO *, const char *b, const char *e);
 uint my_numcells_mb(CHARSET_INFO *, const char *b, const char *e);
 uint my_charpos_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
-uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e, uint pos);
+uint my_well_formed_len_mb(CHARSET_INFO *, const char *b, const char *e,
+                           uint pos, int *error);
 uint my_instr_mb(struct charset_info_st *,
                  const char *b, uint b_length,
                  const char *s, uint s_length,

--- 1.213/sql/field.cc	2005-04-03 11:04:59 +05:00
+++ 1.214/sql/field.cc	2005-04-06 11:53:08 +05:00
@@ -4939,9 +4939,10 @@
     as well as don't copy a malformed data.
   */
   copy_length= field_charset->cset->well_formed_len(field_charset,
-						    from,from+length,
-						    field_length/
-						    field_charset->mbmaxlen);
+                                                    from,from+length,
+                                                    field_length/
+                                                    field_charset->mbmaxlen,
+                                                    &error);
   memcpy(ptr,from,copy_length);
   if (copy_length < field_length)	// Append spaces if shorter
     field_charset->cset->fill(field_charset,ptr+copy_length,
@@ -4958,7 +4959,6 @@
   }
   if (error)
     set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED, 1);
-
   return error;
 }
 
@@ -5577,9 +5577,10 @@
       the 'min()' call below.
     */
     copy_length= field_charset->cset->well_formed_len(field_charset,
-						      from,from +
-						      min(length, copy_length),
-						      copy_length);
+                                                      from,from +
+                                                      min(length, copy_length),
+                                                      copy_length,
+                                                      &error);
     if (copy_length < length)
       error= 1;
     Field_blob::store_length(copy_length);

--- 1.379/sql/sql_yacc.yy	2005-02-18 17:19:04 +04:00
+++ 1.380/sql/sql_yacc.yy	2005-04-06 11:53:08 +05:00
@@ -5032,9 +5032,10 @@
 	    if (thd->charset_is_system_charset)
             {
               CHARSET_INFO *cs= system_charset_info;
+              int dummy_error;
               uint wlen= cs->cset->well_formed_len(cs, $1.str,
                                                    $1.str+$1.length,
-                                                   $1.length);
+                                                   $1.length, &dummy_error);
               if (wlen < $1.length)
               {
                 net_printf(YYTHD, ER_INVALID_CHARACTER_STRING, cs->csname,

--- 1.71/strings/ctype-big5.c	2005-03-29 16:18:57 +05:00
+++ 1.72/strings/ctype-big5.c	2005-04-06 11:53:08 +05:00
@@ -6278,10 +6278,13 @@
 */
 static
 uint my_well_formed_len_big5(CHARSET_INFO *cs __attribute__((unused)),
-                             const char *b, const char *e, uint pos)
+                             const char *b, const char *e,
+                             uint pos, int *error)
 {
   const char *b0= b;
   const char *emb= e - 1; /* Last possible end of an MB character */
+
+  *error= 0;
   while (pos && b < e)
   {
     if ((uchar) b[0] < 128)
@@ -6297,6 +6300,7 @@
     else
     {
       /* Wrong byte sequence */
+      *error= 1;
       break;
     }
   }

--- 1.75/strings/ctype-sjis.c	2005-03-29 16:23:17 +05:00
+++ 1.76/strings/ctype-sjis.c	2005-04-06 11:53:09 +05:00
@@ -4571,9 +4571,11 @@
 */
 static
 uint my_well_formed_len_sjis(CHARSET_INFO *cs __attribute__((unused)),
-                             const char *b, const char *e, uint pos)
+                             const char *b, const char *e,
+                             uint pos, int *error)
 {
   const char *b0= b;
+  *error= 0;
   while (pos && b < e)
   {
     if ((uchar) b[0] < 128)
@@ -4594,6 +4596,7 @@
     else
     {
       /* Wrong byte sequence */
+      *error= 1;
       break;
     }
   }

--- 1.61/strings/ctype-ujis.c	2004-12-10 16:08:12 +04:00
+++ 1.62/strings/ctype-ujis.c	2005-04-06 11:53:09 +05:00
@@ -8253,11 +8253,12 @@
 
 static
 uint my_well_formed_len_ujis(CHARSET_INFO *cs __attribute__((unused)),
-                             const char *beg, const char *end, uint pos)
+                             const char *beg, const char *end,
+                             uint pos, int *error)
 {
   const uchar *b= (uchar *) beg;
   
-  for ( ; pos && b < (uchar*) end; pos--, b++)
+  for ( *error= 0 ; pos && b < (uchar*) end; pos--, b++)
   {
     char *chbeg;
     uint ch= *b;
@@ -8267,12 +8268,16 @@
     
     chbeg= (char *) b++;
     if (b >= (uchar *) end)         /* need more bytes */
+    {
+      *error= 1;
       return chbeg - beg;           /* unexpected EOL  */ 
+    }
     
     if (ch == 0x8E)                 /* [x8E][xA0-xDF] */
     {
       if (*b >= 0xA0 && *b <= 0xDF)
         continue;
+      *error= 1;
       return chbeg - beg;           /* invalid sequence */
     }
     
@@ -8280,12 +8285,16 @@
     {
       ch= *b++;
       if (b >= (uchar*) end)
+      {
+        *error= 1;
         return chbeg - beg;         /* unexpected EOL */
+      }
     }
     
     if (ch >= 0xA1 && ch <= 0xFE &&
         *b >= 0xA1 && *b <= 0xFE)   /* [xA1-xFE][xA1-xFE] */
       continue;
+    *error= 1;
     return chbeg - beg;             /* invalid sequence */
   }
   return b - (uchar *) beg;

--- 1.37/strings/ctype-ucs2.c	2005-02-22 14:51:20 +04:00
+++ 1.38/strings/ctype-ucs2.c	2005-04-06 11:53:09 +05:00
@@ -1267,11 +1267,11 @@
 
 static
 uint my_well_formed_len_ucs2(CHARSET_INFO *cs __attribute__((unused)),
-			     const char *b,
-			     const char *e,
-			     uint nchars)
+                             const char *b, const char *e,
+                             uint nchars, int *error)
 {
   uint nbytes= (e-b) & ~ (uint)1;
+  *error= 0;
   nchars*= 2;
   return min(nbytes, nchars);
 }

--- 1.37/strings/ctype-mb.c	2005-02-01 18:27:03 +04:00
+++ 1.38/strings/ctype-mb.c	2005-04-06 11:53:08 +05:00
@@ -264,18 +264,21 @@
 }
 
 
-uint my_well_formed_len_mb(CHARSET_INFO *cs,
-			   const char *b, const char *e, uint pos)
+uint my_well_formed_len_mb(CHARSET_INFO *cs, const char *b, const char *e,
+                           uint pos, int *error)
 {
   const char *b_start= b;
-  
+  *error= 0;
   while (pos)
   {
     my_wc_t wc;
     int mblen;
 
     if ((mblen= cs->cset->mb_wc(cs, &wc, (uchar*) b, (uchar*) e)) <= 0)
+    {
+      *error= 1;
       break;
+    }
     b+= mblen;
     pos--;
   }

--- 1.62/strings/ctype-simple.c	2005-02-28 13:59:41 +04:00
+++ 1.63/strings/ctype-simple.c	2005-04-06 11:53:08 +05:00
@@ -1093,11 +1093,11 @@
 
 
 uint my_well_formed_len_8bit(CHARSET_INFO *cs __attribute__((unused)),
-			     const char *start,
-			     const char *end,
-			     uint nchars)
+                             const char *start, const char *end,
+                             uint nchars, int *error)
 {
   uint nbytes= (uint) (end-start);
+  *error= 0;
   return min(nbytes, nchars);
 }
 

--- 1.13/ndb/src/ndbapi/NdbIndexOperation.cpp	2004-11-18 14:48:59 +04:00
+++ 1.14/ndb/src/ndbapi/NdbIndexOperation.cpp	2005-04-06 11:53:08 +05:00
@@ -354,12 +354,14 @@
      *************************************************************************/
     if ((tOpType == WriteRequest)) {
       if (!tAttrInfo->m_indexOnly){
+        int dummy_error;
         // invalid data can crash kernel
         if (cs != NULL &&
             (*cs->cset->well_formed_len)(cs,
                                          aValueToWrite,
                                          aValueToWrite + sizeInBytes,
-                                         sizeInBytes) != sizeInBytes)
+                                         sizeInBytes,
+                                         &dummy_error) != sizeInBytes)
           goto equal_error4;
 	Uint32 ahValue;
 	Uint32 sz = totalSizeInWords;

--- 1.14/ndb/src/ndbapi/NdbOperationDefine.cpp	2004-12-22 16:27:46 +04:00
+++ 1.15/ndb/src/ndbapi/NdbOperationDefine.cpp	2005-04-06 11:53:08 +05:00
@@ -526,6 +526,7 @@
   const Uint32 sizeInBytes = tAttrInfo->m_attrSize * tAttrInfo->m_arraySize;
 
   CHARSET_INFO* cs = tAttrInfo->m_cs;
+  int dummy_error;
   // invalid data can crash kernel
   if (cs != NULL &&
       // fast fix bug#7340
@@ -533,7 +534,8 @@
      (*cs->cset->well_formed_len)(cs,
                                    aValue,
                                    aValue + sizeInBytes,
-                                   sizeInBytes) != sizeInBytes) {
+                                   sizeInBytes,
+                                   &dummy_error) != sizeInBytes) {
     setErrorCodeAbort(744);
     return -1;
   }

--- 1.8/ndb/src/ndbapi/NdbOperationSearch.cpp	2004-11-18 14:48:59 +04:00
+++ 1.9/ndb/src/ndbapi/NdbOperationSearch.cpp	2005-04-06 11:53:08 +05:00
@@ -226,12 +226,14 @@
     if ((tOpType == InsertRequest) ||
 	(tOpType == WriteRequest)) {
       if (!tAttrInfo->m_indexOnly){
+        int dummy_error;
         // invalid data can crash kernel
         if (cs != NULL &&
            (*cs->cset->well_formed_len)(cs,
                                         aValueToWrite,
                                         aValueToWrite + sizeInBytes,
-                                        sizeInBytes) != sizeInBytes)
+                                        sizeInBytes,
+                                        &dummy_error) != sizeInBytes)
           goto equal_error4;
 	Uint32 ahValue;
 	const Uint32 sz = totalSizeInWords;
Thread
bk commit into 4.1 tree (bar:1.2163)bar6 Apr