From 00aaa80dbdfed41ea9704f4482d5a766b8725733 Mon Sep 17 00:00:00 2001 From: "ramil@mysql.com" <> Date: Wed, 23 Mar 2005 17:39:20 +0400 Subject: [PATCH 1/5] A fix (bug #9309: Wrong order in INFORMATION_SCHEMA) --- strings/ctype-utf8.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/ctype-utf8.c b/strings/ctype-utf8.c index 3b52577c358..cfb169043dc 100644 --- a/strings/ctype-utf8.c +++ b/strings/ctype-utf8.c @@ -2276,7 +2276,7 @@ static int my_strnxfrm_utf8(CHARSET_INFO *cs, } if (dst < de) /* Clear the last byte, if "dstlen" was an odd number */ - *de= 0x00; + *dst= 0x00; return dstlen; } From 7c40ac32bad13896a0eb79c14631d3b8f5fed570 Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Wed, 23 Mar 2005 18:00:22 +0200 Subject: [PATCH 2/5] ha_innodb.cc: Fix bug #9314 in InnoDB true VARCHAR: InnoDB stored the 'position' of a row wrong in a column prefix primary key index; this could cause MySQL to complain 'ERROR 1032: Can't find record in ...' in an update of the primary key, and also some ORDER BY or DISTINCT queries --- sql/ha_innodb.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 24f1579544b..89e6be3cdeb 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2439,7 +2439,14 @@ ha_innobase::store_key_val_for_row( (byte*) (record + (ulint)get_field_offset(table, field)), lenlen); + + /* In a column prefix index, we may need to truncate + the stored value: */ + if (len > key_part->length) { + len = key_part->length; + } + /* The length in a key value is always stored in 2 bytes */ @@ -2476,6 +2483,11 @@ ha_innobase::store_key_val_for_row( ut_a(get_field_offset(table, field) == key_part->offset); + + /* All indexes on BLOB and TEXT are column prefix + indexes, and we may need to truncate the data to be + stored in the kay value: */ + if (blob_len > key_part->length) { blob_len = key_part->length; } @@ -2494,11 +2506,17 @@ ha_innobase::store_key_val_for_row( buff += key_part->length; } else { + /* Here we handle all other data types except the + true VARCHAR, BLOB and TEXT. Note that the column + value we store may be also in a column prefix + index. */ + if (is_null) { buff += key_part->length; continue; } + memcpy(buff, record + key_part->offset, key_part->length); buff += key_part->length; From 555815734eb3a1ac5bb3ca138ba5eb4c069979b1 Mon Sep 17 00:00:00 2001 From: "paul@kite-hub.kitebird.com" <> Date: Wed, 23 Mar 2005 10:45:57 -0600 Subject: [PATCH 3/5] README: Fix typo. --- mysql-test/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysql-test/README b/mysql-test/README index bccb05c555c..65e6186613a 100644 --- a/mysql-test/README +++ b/mysql-test/README @@ -17,7 +17,7 @@ http://dev.mysql.com/doc/mysql/en/MySQL_test_suite.html You can create your own test cases. To create a test case: - xeamacs t/test_case_name.test + xemacs t/test_case_name.test in the file, put a set of SQL commands that will create some tables, load test data, run some queries to manipulate it. From 06cfe9a4a44d3c72249400141e1eb8b649f15b29 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 23 Mar 2005 21:36:15 +0300 Subject: [PATCH 4/5] A test case for Bug#6282 "Packet error with SELECT INTO" (the bug itself is no longer repeatable). --- mysql-test/r/variables.result | 8 ++++++++ mysql-test/t/variables.test | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 908709efba3..e3b6c2c5917 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -520,3 +520,11 @@ SHOW VARIABLES LIKE 'table_cache'; Variable_name Value table_cache 1 SET GLOBAL table_cache=DEFAULT; +create table t1 (a int); +select a into @x from t1; +Warnings: +Warning 1329 No data to FETCH +show warnings; +Level Code Message +Warning 1329 No data to FETCH +drop table t1; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 5310d50b7cb..ebd6edf4045 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -388,3 +388,12 @@ SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE'; SET GLOBAL table_cache=-1; SHOW VARIABLES LIKE 'table_cache'; SET GLOBAL table_cache=DEFAULT; + +# +# Bug#6282 Packet error with SELECT INTO +# +create table t1 (a int); +select a into @x from t1; +show warnings; +drop table t1; + From 7c2d154e76b8c7a3a677189303113201b6b011f0 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 23 Mar 2005 23:39:20 +0300 Subject: [PATCH 5/5] Fix a valgrind warning spotted while trying to repeat Bug#7166 "Server crashes when running out of connections" --- sql/sql_class.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 5fb91d9c1a4..cf7240e4dba 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -193,6 +193,7 @@ THD::THD() variables.pseudo_thread_id= 0; one_shot_set= 0; file_id = 0; + query_id= 0; warn_id= 0; db_charset= global_system_variables.collation_database; bzero(ha_data, sizeof(ha_data));