diff --git a/.bzrignore b/.bzrignore
index b344b511251e1ab8cd6e905c50fc19b00894a56a..ae028ae9426b9fa895be4f6984a32ea7ccc7a124 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -102,6 +102,7 @@ Makefile.in
 Makefile.in'
 PENDING/*
 TAGS
+VC++Files/client/mysql_amd64.dsp
 ac_available_languages_fragment
 acinclude.m4
 aclocal.m4
@@ -274,6 +275,8 @@ client/mysqlmanager-pwgen
 client/mysqlmanagerc
 client/mysqlshow
 client/mysqltest
+client/mysqltestmanager-pwgen
+client/mysqltestmanagerc
 client/mysys_priv.h
 client/select_test
 client/ssl_test
@@ -284,10 +287,12 @@ cmd-line-utils/libedit/common.h
 cmd-line-utils/libedit/makelist
 comon.h
 config.cache
+config.guess
 config.h
 config.h.in
 config.log
 config.status
+config.sub
 configure
 configure.lineno
 core
@@ -355,6 +360,7 @@ innobase/ib_config.h.in
 innobase/stamp-h1
 insert_test
 install
+install-sh
 isam/isamchk
 isam/isamlog
 isam/pack_isam
@@ -519,7 +525,9 @@ linked_libmysqldex_sources
 linked_server_sources
 linked_tools_sources
 locked
+ltmain.sh
 man/*.1
+missing
 mit-pthreads/config.flags
 mit-pthreads/include/bits
 mit-pthreads/include/pthread/machdep.h
@@ -936,6 +944,7 @@ scripts/mysqld_multi
 scripts/mysqld_safe
 scripts/mysqldumpslow
 scripts/mysqlhotcopy
+scripts/mysqlhotcopy.sh.rej
 scripts/safe_mysqld
 select_test
 server-tools/instance-manager/client.c
@@ -1100,18 +1109,10 @@ tmp/*
 tools/my_vsnprintf.c
 tools/mysqlmanager
 tools/mysqlmngd
+tools/mysqltestmanager
 tools/mysys_priv.h
 vi.h
 vio/test-ssl
 vio/test-sslclient
 vio/test-sslserver
 vio/viotest-ssl
-VC++Files/client/mysql_amd64.dsp
-client/mysqltestmanager-pwgen
-client/mysqltestmanagerc
-tools/mysqltestmanager
-config.guess
-config.sub
-install-sh
-ltmain.sh
-missing
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index eaf79d29cee6ef1d16963d62f18dca56fb8a139c..f1e98699ab0708d1a0e94edfd76ab395b079e20d 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -52,6 +52,7 @@ dlenev@build.mysql.com
 dlenev@jabberwock.localdomain
 dlenev@mysql.com
 ejonore@mc03.ndb.mysql.com
+elliot@mysql.com
 evgen@moonbone.(none)
 evgen@moonbone.local
 gbichot@bk-internal.mysql.com
diff --git a/myisam/mi_key.c b/myisam/mi_key.c
index 9fb673483ea2707a5caa28876db4fe9ab611e7e6..eec1d710045d9fa96e90ab37d73d500c9d854461 100644
--- a/myisam/mi_key.c
+++ b/myisam/mi_key.c
@@ -107,7 +107,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
     }
     if (keyseg->flag & HA_SPACE_PACK)
     {
-      end=pos+length;
+      FIX_LENGTH(cs, pos, length, char_length);
+      end= pos + char_length;
       if (type != HA_KEYTYPE_NUM)
       {
 	while (end > pos && end[-1] == ' ')
@@ -118,8 +119,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
 	while (pos < end && pos[0] == ' ')
 	  pos++;
       }
-      length=(uint) (end-pos);
-      FIX_LENGTH(cs, pos, length, char_length);
+      char_length= (uint) (end - pos);
       store_key_length_inc(key,char_length);
       memcpy((byte*) key,(byte*) pos,(size_t) char_length);
       key+=char_length;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 4be9139f20b432359b1ddfafaa5e8d41cc299e5b..95142caf36c326efad0d4b5f01e6794859fbd112 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -891,3 +891,14 @@ string
 create table t1 (a varchar(255)) default character set utf8;
 insert into t1 values (1.0);
 drop table t1;
+create table t1 (
+id int not null,
+city varchar(20) not null,
+key (city(7),id)
+) character set=utf8;
+insert into t1 values (1,'Durban North');
+insert into t1 values (2,'Durban');
+select * from t1 where city = 'Durban';
+id	city
+2	Durban
+drop table t1;
diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result
index 18bc76789b13ed13495de629bfb2b2851cd7df89..54c358732018f6e71c20bdd159a2be24277e473a 100644
--- a/mysql-test/r/ps_1general.result
+++ b/mysql-test/r/ps_1general.result
@@ -471,13 +471,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	14	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	4	Using filesort
@@ -487,13 +487,13 @@ execute stmt1 using @arg00;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	5	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	5	Y	0	31	8
 def					possible_keys	253	4096	7	Y	0	31	8
 def					key	253	64	7	Y	0	31	8
 def					key_len	253	4096	1	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	27	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	3	Using where; Using filesort
diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result
index 53fb3da8bb94a39a93c91cc10663c531e46da8e4..3df9b6dcb6e030bb897b6b06f1ace0d7e27fda51 100644
--- a/mysql-test/r/ps_2myisam.result
+++ b/mysql-test/r/ps_2myisam.result
@@ -1152,13 +1152,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result
index 658fd01dd0d715a0b6c27a11e352c43a3ff41526..851178e2aee88e4fdf8666656224c6afe0166be5 100644
--- a/mysql-test/r/ps_3innodb.result
+++ b/mysql-test/r/ps_3innodb.result
@@ -1152,13 +1152,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result
index f22317974cb4933ba40fa7fded6c449e7f088db6..60675a72bdc8ec8ae25eb9be038beede892c666f 100644
--- a/mysql-test/r/ps_4heap.result
+++ b/mysql-test/r/ps_4heap.result
@@ -1153,13 +1153,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result
index 2ce7eb34a10c60a473beeba34b9d58e92f34eb4e..a177290daa49ae678cb555733caef8e841657513 100644
--- a/mysql-test/r/ps_5merge.result
+++ b/mysql-test/r/ps_5merge.result
@@ -1195,13 +1195,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
@@ -4207,13 +4207,13 @@ execute stmt1;
 Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					id	8	3	1	N	32929	0	63
 def					select_type	253	19	6	N	1	31	8
-def					table	253	64	2	N	1	31	8
-def					type	253	10	3	N	1	31	8
+def					table	253	64	2	Y	0	31	8
+def					type	253	10	3	Y	0	31	8
 def					possible_keys	253	4096	0	Y	0	31	8
 def					key	253	64	0	Y	0	31	8
 def					key_len	253	4096	0	Y	128	31	63
 def					ref	253	1024	0	Y	0	31	8
-def					rows	8	10	1	N	32929	0	63
+def					rows	8	10	1	Y	32928	0	63
 def					Extra	253	255	0	N	1	31	8
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t9	ALL	NULL	NULL	NULL	NULL	2	
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index bac6e60c302a9989b7720807f6f54fc8f8d8ad9c..a281558e5a1ebba29c860335fb646af39b1f0e82 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -731,3 +731,17 @@ select ifnull(NULL, _utf8'string');
 create table t1 (a varchar(255)) default character set utf8;
 insert into t1 values (1.0);
 drop table t1;
+
+#
+# Bug#10253 compound index length and utf8 char set
+# produces invalid query results
+#
+create table t1 (
+ id int not null,
+ city varchar(20) not null,
+ key (city(7),id)
+) character set=utf8;
+insert into t1 values (1,'Durban North');
+insert into t1 values (2,'Durban');
+select * from t1 where city = 'Durban';
+drop table t1;
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 632174dc41a1ac4a6a626d5c89a6e5def584d80c..1c5cd6a4faf13381ab678f4ec3150c51dc3fee29 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -746,9 +746,15 @@ sub record_log_pos {
 	my ($file,$position) = get_row( $dbh, "show master status" );
 	die "master status is undefined" if !defined $file || !defined $position;
 	
-	my ($master_host, undef, undef, undef, $log_file, $log_pos ) 
-	    = get_row( $dbh, "show slave status" );
-	
+	my $row_hash = get_row_hash( $dbh, "show slave status" );
+	my ($master_host, $log_file, $log_pos ); 
+	if ( $dbh->{mysql_serverinfo} =~ /^3\.23/ ) {
+	    ($master_host, $log_file, $log_pos ) 
+	      = @{$row_hash}{ qw / Master_Host Log_File Pos / };
+	} else {
+	    ($master_host, $log_file, $log_pos ) 
+	      = @{$row_hash}{ qw / Master_Host Master_Log_File Read_Master_Log_Pos / };
+	}
 	my $hostname = hostname();
 	
 	$dbh->do( qq{ replace into $table_name 
@@ -773,6 +779,14 @@ sub get_row {
   return $sth->fetchrow_array();
 }
 
+sub get_row_hash {
+  my ( $dbh, $sql ) = @_;
+
+  my $sth = $dbh->prepare($sql);
+  $sth->execute;
+  return $sth->fetchrow_hashref();
+}
+
 sub scan_raid_dir {
     my ( $r_db_files, $data_dir, @raid_dir ) = @_;
 
diff --git a/sql/item_buff.cc b/sql/item_buff.cc
index 9e0fc096304e4a9923c8dff1ee63c2d0d21a3d35..688e4cca8463b9f2b5f557e1469032c3aa39c219 100644
--- a/sql/item_buff.cc
+++ b/sql/item_buff.cc
@@ -52,7 +52,7 @@ Item_buff::~Item_buff() {}
 */
 
 Item_str_buff::Item_str_buff(THD *thd, Item *arg)
-  :item(arg), value(min(arg->max_length, thd->variables. max_sort_length))
+  :item(arg), value(min(arg->max_length, thd->variables.max_sort_length))
 {}
 
 bool Item_str_buff::cmp(void)
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 438bfdbcb733a07eb6c39fc4908823b6db3610b3..165ce61d5d1bf0a03d5347cdc039369aa002a5ab 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -714,8 +714,10 @@ int THD::send_explain_fields(select_result *result)
   CHARSET_INFO *cs= system_charset_info;
   field_list.push_back(new Item_return_int("id",3, MYSQL_TYPE_LONGLONG));
   field_list.push_back(new Item_empty_string("select_type", 19, cs));
-  field_list.push_back(new Item_empty_string("table", NAME_LEN, cs));
-  field_list.push_back(new Item_empty_string("type", 10, cs));
+  field_list.push_back(item= new Item_empty_string("table", NAME_LEN, cs));
+  item->maybe_null= 1;
+  field_list.push_back(item= new Item_empty_string("type", 10, cs));
+  item->maybe_null= 1;
   field_list.push_back(item=new Item_empty_string("possible_keys",
 						  NAME_LEN*MAX_KEY, cs));
   item->maybe_null=1;
@@ -727,7 +729,9 @@ int THD::send_explain_fields(select_result *result)
   field_list.push_back(item=new Item_empty_string("ref",
 						  NAME_LEN*MAX_REF_PARTS, cs));
   item->maybe_null=1;
-  field_list.push_back(new Item_return_int("rows", 10, MYSQL_TYPE_LONGLONG));
+  field_list.push_back(item= new Item_return_int("rows", 10,
+                                                 MYSQL_TYPE_LONGLONG));
+  item->maybe_null= 1;
   field_list.push_back(new Item_empty_string("Extra", 255, cs));
   return (result->send_fields(field_list,
                               Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF));