List:Internals« Previous MessageNext Message »
From:igor Date:June 13 2005 3:10pm
Subject:bk commit into 4.1 tree (igor:1.2287) BUG#11167
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of igor. When igor 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.2287 05/06/13 06:10:19 igor@stripped +4 -0
  ctype_utf8.test, ctype_utf8.result:
    Added a test case for bug #11167.
  sql_select.cc:
    Fixed bug #11167.
    In 4.1 char/varchar fields are limited by 255 characters in
    length that make them longer than 255 bytes in size for such
    character sets as UTF8. The functions store_record_in_cache
    and read_cached_records did not take into account this
    Moreover the code did not take into account that the size
    of the varchar fields in 5.0 can be up to 65535 bytes

  BitKeeper/etc/logging_ok
    1.399 05/06/13 06:10:18 igor@stripped +1 -0
    Logging to logging@stripped accepted

  mysql-test/t/ctype_utf8.test
    1.56 05/06/13 06:08:49 igor@stripped +42 -0
    Added a test case for bug #11167.

  mysql-test/r/ctype_utf8.result
    1.56 05/06/13 06:08:21 igor@stripped +34 -0
    Added a test case for bug #11167.

  sql/sql_select.cc
    1.409 05/06/13 05:59:20 igor@stripped +6 -6
    Fixed bug #11167.
    In 4.1 char/varchar fields are limited by 255 characters in
    length that make them longer than 255 bytes in size for such
    character sets as UTF8. The functions store_record_in_cache
    and read_cached_records did not take into account this
    Moreover the code did not take into account that the size
    of the varchar fields in 5.0 can be up to 65535 bytes

# 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:	igor
# Host:	igor-inspiron.creware.com
# Root:	/home/igor/dev/mysql-4.1-0

--- 1.408/sql/sql_select.cc	Tue Jun  7 03:04:21 2005
+++ 1.409/sql/sql_select.cc	Mon Jun 13 05:59:20 2005
@@ -8112,9 +8112,9 @@
 	     end > str && end[-1] == ' ' ;
 	     end--) ;
 	length=(uint) (end-str);
-	memcpy(pos+1,str,length);
-	*pos=(uchar) length;
-	pos+=length+1;
+	memcpy(pos+sizeof(uint), str, length);
+	*((uint *) pos)= length;
+	pos+= length+sizeof(uint);
       }
       else
       {
@@ -8177,9 +8177,9 @@
     {
       if (copy->strip)
       {
-	memcpy(copy->str,pos+1,length=(uint) *pos);
-	memset(copy->str+length,' ',copy->length-length);
-	pos+=1+length;
+	memcpy(copy->str, pos+sizeof(uint), length= *((uint *) pos));
+	memset(copy->str+length, ' ', copy->length-length);
+	pos+= sizeof(uint)+length;
       }
       else
       {

--- 1.55/mysql-test/r/ctype_utf8.result	Tue Jun  7 05:09:41 2005
+++ 1.56/mysql-test/r/ctype_utf8.result	Mon Jun 13 06:08:21 2005
@@ -905,3 +905,37 @@
 id	city
 2	Durban
 drop table t1;
+SET NAMES UTF8;
+CREATE TABLE t1 (
+`id` int(20) NOT NULL auto_increment,
+`country` varchar(100) NOT NULL default '',
+`shortcode` varchar(100) NOT NULL default '',
+`operator` varchar(100) NOT NULL default '',
+`momid` varchar(30) NOT NULL default '',
+`keyword` varchar(160) NOT NULL default '',
+`content` varchar(160) NOT NULL default '',
+`second_token` varchar(160) default NULL,
+`gateway_id` int(11) NOT NULL default '0',
+`created` datetime NOT NULL default '0000-00-00 00:00:00',
+`msisdn` varchar(15) NOT NULL default '',
+PRIMARY KEY  (`id`),
+UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
+KEY `IX_mobile_originated_message_keyword` (`keyword`),
+KEY `IX_mobile_originated_message_created` (`created`),
+KEY `IX_mobile_originated_message_support`
(`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+INSERT INTO t1 VALUES 
+(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR
Имри.Афимим.Аеимимримдмримрмрирор имримримримр
имридм ирбднримрфмририримрфмфмим.Ад.Д
имдимримрад.Адимримримрмдиримримримр
м.Дадимфшьмримд им.Адимимрн
имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01
17:30:43','1234567890'),
+(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02
22:43:10','1234567890');
+CREATE TABLE t2 (
+`msisdn` varchar(15) NOT NULL default '',
+`operator_id` int(11) NOT NULL default '0',
+`created` datetime NOT NULL default '0000-00-00 00:00:00',
+UNIQUE KEY `PK_user` (`msisdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
+SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
+content	msisdn
+ERR Имри.Афимим.Аеимимримдмримрмрирор
имримримримр имридм
ирбднримрфмририримрфмфмим.Ад.Д
имдимримрад.Адимримримрмдиримримримр
м.Дадимфшьмримд им.Адимимрн имадми	1234567890
+11 g	1234567890
+DROP TABLE t1,t2;

--- 1.55/mysql-test/t/ctype_utf8.test	Tue Jun  7 05:09:41 2005
+++ 1.56/mysql-test/t/ctype_utf8.test	Mon Jun 13 06:08:49 2005
@@ -746,3 +746,45 @@
 select * from t1 where city = 'Durban';
 select * from t1 where city = 'Durban ';
 drop table t1;
+
+#
+# Test for bug #11167: join for utf8 varchar value longer than 255 bytes 
+#
+
+SET NAMES UTF8;
+
+CREATE TABLE t1 (
+  `id` int(20) NOT NULL auto_increment,
+  `country` varchar(100) NOT NULL default '',
+  `shortcode` varchar(100) NOT NULL default '',
+  `operator` varchar(100) NOT NULL default '',
+  `momid` varchar(30) NOT NULL default '',
+  `keyword` varchar(160) NOT NULL default '',
+  `content` varchar(160) NOT NULL default '',
+  `second_token` varchar(160) default NULL,
+  `gateway_id` int(11) NOT NULL default '0',
+  `created` datetime NOT NULL default '0000-00-00 00:00:00',
+  `msisdn` varchar(15) NOT NULL default '',
+  PRIMARY KEY  (`id`),
+  UNIQUE KEY `MSCCSPK_20030521130957121` (`momid`),
+  KEY `IX_mobile_originated_message_keyword` (`keyword`),
+  KEY `IX_mobile_originated_message_created` (`created`),
+  KEY `IX_mobile_originated_message_support`
(`msisdn`,`momid`,`keyword`,`gateway_id`,`created`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+INSERT INTO t1 VALUES 
+(1,'blah','464','aaa','fkc1c9ilc20x0hgae7lx6j09','ERR','ERR
Имри.Афимим.Аеимимримдмримрмрирор имримримримр
имридм ирбднримрфмририримрфмфмим.Ад.Д
имдимримрад.Адимримримрмдиримримримр
м.Дадимфшьмримд им.Адимимрн
имадми','ИМРИ.АФИМИМ.АЕИМИМРИМДМРИМРМРИРОР',3,'2005-06-01
17:30:43','1234567890'),
+(2,'blah','464','aaa','haxpl2ilc20x00bj4tt2m5ti','11','11 g','G',3,'2005-06-02
22:43:10','1234567890');
+
+CREATE TABLE t2 (
+  `msisdn` varchar(15) NOT NULL default '',
+  `operator_id` int(11) NOT NULL default '0',
+  `created` datetime NOT NULL default '0000-00-00 00:00:00',
+  UNIQUE KEY `PK_user` (`msisdn`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
+
+SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
+
+DROP TABLE t1,t2;

--- 1.398/BitKeeper/etc/logging_ok	Tue Jun  7 06:33:37 2005
+++ 1.399/BitKeeper/etc/logging_ok	Mon Jun 13 06:10:18 2005
@@ -80,6 +80,7 @@
 hf@genie.(none)
 holyfoot@stripped
 igor@stripped
+igor@stripped
 igor@stripped
 igor@stripped
 ingo@stripped
Thread
bk commit into 4.1 tree (igor:1.2287) BUG#11167igor13 Jun