From 6f8a1f03c061869dfe1676fd67cfaf6fef840ad8 Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Fri, 21 Jan 2005 07:53:02 +0100 Subject: [PATCH 1/3] Bug#8051 - ndb Make sure to ship error code in system error signal --- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index a8ad4008a74..d6315ab259e 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -2976,6 +2976,8 @@ void Dbdih::execCOPY_FRAGREF(Signal* signal) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + sysErr->data1 = errorCode; + sysErr->data2 = 0; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); return; @@ -4492,6 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); + signal->data1= 0; + signal->data2= __LINE__; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); } From e0df86cd357e92215ac78c5563d1cafd217fae9a Mon Sep 17 00:00:00 2001 From: "joreland@mysql.com" <> Date: Fri, 21 Jan 2005 08:28:23 +0100 Subject: [PATCH 2/3] bug#8051 - ndb, typo, more info on crash --- ndb/src/kernel/blocks/dbdih/DbdihMain.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp index d6315ab259e..dba1efbba9a 100644 --- a/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp +++ b/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp @@ -4494,8 +4494,8 @@ void Dbdih::handleTakeOverNewMaster(Signal* signal, Uint32 takeOverPtrI) SystemError * const sysErr = (SystemError*)&signal->theData[0]; sysErr->errorCode = SystemError::CopyFragRefError; sysErr->errorRef = reference(); - signal->data1= 0; - signal->data2= __LINE__; + sysErr->data1= 0; + sysErr->data2= __LINE__; sendSignal(cntrRef, GSN_SYSTEM_ERROR, signal, SystemError::SignalLength, JBB); } From 2f6e0864ad0039cad473e028cade2095d45fe699 Mon Sep 17 00:00:00 2001 From: "bar@mysql.com" <> Date: Fri, 21 Jan 2005 16:49:20 +0400 Subject: [PATCH 3/3] Bug#7943: Wrong prefix lengths reported on UTF-8 columns SHOW KEYS FROM t1 now displays number of characters in Sub_part, not number of bytes, to be compatible with SHOW CREATE TABLE. --- mysql-test/r/ctype_mb.result | 4 ++-- sql/sql_show.cc | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/ctype_mb.result b/mysql-test/r/ctype_mb.result index 5e273b3c800..dbdb9c1343c 100644 --- a/mysql-test/r/ctype_mb.result +++ b/mysql-test/r/ctype_mb.result @@ -33,7 +33,7 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE ALTER TABLE t1 CHANGE a a CHAR(4); SHOW CREATE TABLE t1; Table Create Table @@ -53,5 +53,5 @@ t1 CREATE TABLE `t1` ( ) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW KEYS FROM t1; Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment -t1 1 key_a 1 a A NULL 9 NULL YES BTREE +t1 1 key_a 1 a A NULL 3 NULL YES BTREE DROP TABLE t1; diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 8929872c466..91cac29f3a3 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -1025,7 +1025,8 @@ mysqld_show_keys(THD *thd, TABLE_LIST *table_list) /* Check if we have a key part that only uses part of the field */ if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field || key_part->length != table->field[key_part->fieldnr-1]->key_length())) - protocol->store_tiny((longlong) key_part->length); + protocol->store_tiny((longlong) key_part->length / + key_part->field->charset()->mbmaxlen); else protocol->store_null(); protocol->store_null(); // No pack_information yet