List:Internals« Previous MessageNext Message »
From:bar Date:October 11 2005 9:09am
Subject:bk commit into 5.0 tree (bar:1.2031) BUG#12547
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.2031 05/10/11 12:09:38 bar@stripped +3 -0
    Bug#12547: Inserting long string into varchar causes table crash in cp932
  ctype-cp932.c:
    Decrement for "pos" variable disappered somehow.
    Restoring it back.
  ctype_cp932.test: ctype_cp932.result:
    Adding test case.

  mysql-test/r/ctype_cp932.result
    1.6 05/10/11 12:08:41 bar@stripped +17 -0
    Adding test case

  mysql-test/t/ctype_cp932.test
    1.8 05/10/11 12:08:35 bar@stripped +10 -0
    Adding test case.

  strings/ctype-cp932.c
    1.10 05/10/11 12:07:19 bar@stripped +1 -1
    Bug#12547: Inserting long string into varchar causes table crash in cp932
    Decrement for "pos" variable disappered somehow.
    Restoring it back.

# 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.b12547

--- 1.5/mysql-test/r/ctype_cp932.result	2005-08-22 21:56:30 +05:00
+++ 1.6/mysql-test/r/ctype_cp932.result	2005-10-11 12:08:41 +05:00
@@ -11349,3 +11349,20 @@
 cp932_bin	61
 cp932_bin	6120
 drop table t1;
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+Warnings:
+Warning	1265	Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+insert into t1 values ('abc');
+Warnings:
+Warning	1265	Data truncated for column 'col1' at row 1
+select * from t1;
+col1
+a
+a
+a

--- 1.7/mysql-test/t/ctype_cp932.test	2005-08-22 21:56:30 +05:00
+++ 1.8/mysql-test/t/ctype_cp932.test	2005-10-11 12:08:35 +05:00
@@ -424,3 +424,13 @@
 -- source include/ctype_filesort.inc
 SET collation_connection='cp932_bin';
 -- source include/ctype_filesort.inc
+
+#
+# Bug#12547: Inserting long string into varchar causes table crash in cp932
+#
+create table t1 (col1 varchar(1)) character set cp932;
+insert into t1 values ('a');
+insert into t1 values ('ab');
+select * from t1;
+insert into t1 values ('abc');
+select * from t1;

--- 1.9/strings/ctype-cp932.c	2005-08-20 03:10:42 +05:00
+++ 1.10/strings/ctype-cp932.c	2005-10-11 12:07:19 +05:00
@@ -5417,7 +5417,7 @@
 {
   const char *b0= b;
   *error= 0;
-  while (pos && b < e)
+  while (pos-- && b < e)
   {
     /*
       Cast to int8 for extra safety.
Thread
bk commit into 5.0 tree (bar:1.2031) BUG#12547bar11 Oct