MySQL Lists are EOL. Please join:

List:Internals« Previous MessageNext Message »
From:bar Date:July 22 2005 4:13pm
Subject:bk commit into 5.0 tree (bar:1.1889)
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
  1.1889 05/07/22 21:13:15 bar@stripped +1 -0
  Merge mysql.com:/usr/home/bar/mysql-4.1.b11987
  into  mysql.com:/usr/home/bar/mysql-5.0

  strings/ctype-gbk.c
    1.74 05/07/22 21:13:01 bar@stripped +0 -0
    Auto merged

# 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/RESYNC

--- 1.73/strings/ctype-gbk.c	2005-07-20 13:40:10 +05:00
+++ 1.74/strings/ctype-gbk.c	2005-07-22 21:13:01 +05:00
@@ -9938,6 +9938,43 @@
 }
 
 
+/*
+  Returns well formed length of a GBK string.
+*/
+static
+uint my_well_formed_len_gbk(CHARSET_INFO *cs __attribute__((unused)),
+                            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)
+    {
+      /* Single byte ascii character */
+      b++;
+    }
+    else  if ((b < emb) && isgbkcode((uchar)*b, (uchar)b[1]))
+    {
+      /* Double byte character */
+      b+= 2;
+    }
+    else
+    {
+      /* Wrong byte sequence */
+      *error= 1;
+      break;
+    }
+  }
+  return b - b0;
+}
+
+
+                             
+
 static MY_COLLATION_HANDLER my_collation_ci_handler =
 {
   NULL,			/* init */
@@ -9960,7 +9997,7 @@
   mbcharlen_gbk,
   my_numchars_mb,
   my_charpos_mb,
-  my_well_formed_len_mb,
+  my_well_formed_len_gbk,
   my_lengthsp_8bit,
   my_numcells_8bit,
   my_mb_wc_gbk,
Thread
bk commit into 5.0 tree (bar:1.1889)bar22 Jul