From bbd402dc4f45947ff282775eea7b921c66667058 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Sep 2004 15:26:29 +0300 Subject: Fixed unique prefix key bug for multibyte character sets (BUG #4521) for InnoDB. This fixes also a second part of the same problem with prefix keys on a multibyte string column for InnoDB. innobase/btr/btr0btr.c: Multibyte character set prefix indexes are not any more fixed size. Therefore, we have to chect that length of the index field in not greater than prefix length. innobase/rem/rem0cmp.c: Remove unnecessary changes. innobase/row/row0ins.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0row.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0sel.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. innobase/row/row0upd.c: Fixed unique prefix key or prefix key using multibyte character set bugs for InnoDB (BUG #4521). For prefix keys we have to get the storage length for the prefix length of characters in the key. mysql-test/r/ctype_utf8.result: Added utf8 character test cases for InnoDB. mysql-test/t/ctype_utf8.test: Added utf8 character expected test results for InnoDB. sql/ha_innodb.cc: Added function innobase_get_at_most_n_mbchars to return position of the nth character in the multibyte character string. sql/ha_innodb.h: Remove unnecessary changes. --- innobase/btr/btr0btr.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'innobase/btr') diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 27d798f925a..e31aadbbfff 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -2400,14 +2400,17 @@ btr_index_rec_validate( dtype_t* type = dict_index_get_nth_type(index, i); rec_get_nth_field(rec, i, &len); - + + /* Note that prefix indexes are not fixed size even when + their type is CHAR. */ + if ((dict_index_get_nth_field(index, i)->prefix_len == 0 && len != UNIV_SQL_NULL && dtype_is_fixed_size(type) && len != dtype_get_fixed_size(type)) || (dict_index_get_nth_field(index, i)->prefix_len > 0 - && len != UNIV_SQL_NULL && dtype_is_fixed_size(type) - && len != + && len != UNIV_SQL_NULL + && len > dict_index_get_nth_field(index, i)->prefix_len)) { btr_index_rec_validate_report(page, rec, index); -- cgit v1.2.1 From 9ad42c70a3bc41819c5928c10c585f9e26134237 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 8 Sep 2004 14:24:13 +0300 Subject: InnoDB: Update links to the user manual innobase/btr/btr0btr.c: Update links to the user manual innobase/buf/buf0buf.c: Update links to the user manual innobase/dict/dict0dict.c: Update links to the user manual innobase/fsp/fsp0fsp.c: Update links to the user manual innobase/log/log0log.c: Update links to the user manual innobase/log/log0recv.c: Update links to the user manual innobase/os/os0file.c: Update links to the user manual innobase/row/row0mysql.c: Update links to the user manual innobase/ut/ut0dbg.c: Update links to the user manual --- innobase/btr/btr0btr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'innobase/btr') diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 81eb32467ad..d1ef1a77a9f 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -609,8 +609,8 @@ btr_page_get_father_for_rec( fputs( "InnoDB: You should dump + drop + reimport the table to fix the\n" "InnoDB: corruption. If the crash happens at the database startup, see\n" -"InnoDB: section 6.1 of http://www.innodb.com/ibman.php about forcing\n" -"InnoDB: recovery. Then dump + drop + reimport.\n", stderr); +"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html about\n" +"InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr); } ut_a(btr_node_ptr_get_child_page_no(node_ptr) == -- cgit v1.2.1 From a418a35ceba85354328b5f75bb4e908f88b6759f Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 1 Oct 2004 11:51:59 +0300 Subject: InnoDB: quote identifiers according to MySQL settings (Bug #5292) innobase/btr/btr0btr.c: Add parameter to ut_print_name() and dict_index_name_print() calls innobase/btr/btr0cur.c: Add parameter to dict_index_name_print() calls innobase/buf/buf0buf.c: Add parameter to dict_index_name_print() calls innobase/dict/dict0crea.c: Add parameter to ut_print_name() calls innobase/dict/dict0dict.c: Add parameter to ut_print_name() calls Update documentation links to http://dev.mysql.com innobase/dict/dict0load.c: Add parameter to ut_print_name() calls innobase/fil/fil0fil.c: Use ut_print_filename() Update links to documentation to http://dev.mysql.com innobase/ibuf/ibuf0ibuf.c: Replaced printf(...) with fprintf(stderr,...) innobase/include/dict0dict.h: Added trx parameters innobase/include/row0row.h: Added trx parameter innobase/include/row0sel.h: Added trx parameter innobase/include/row0upd.h: Added trx parameters innobase/include/row0upd.ic: Added trx parameter for dict_index_name_print() innobase/include/trx0rec.h: Added trx parameter innobase/include/ut0ut.h: Added ut_print_filename() Added trx parameter to ut_print_name() and ut_print_namel() innobase/lock/lock0lock.c: Added parameter to dict_index_name_print() and ut_print_name() calls innobase/page/page0page.c: Added parameter to dict_index_name_print() calls innobase/pars/pars0opt.c: Added parameter to dict_index_name_print() call innobase/pars/pars0pars.c: Added parameter to upd_field_set_field_no() call innobase/row/row0ins.c: Added trx parameters innobase/row/row0mysql.c: Added trx parameters innobase/row/row0purge.c: Added trx parameter innobase/row/row0row.c: Added trx parameter innobase/row/row0sel.c: Added trx parameters innobase/row/row0umod.c: Added trx parameters innobase/row/row0upd.c: Added trx parameters innobase/trx/trx0rec.c: Added trx parameters innobase/trx/trx0roll.c: Added parameter to ut_print_name() calls innobase/ut/ut0ut.c: Added ut_print_filename() Added trx parameter to ut_print_namel() and ut_print_name() calls sql/ha_innodb.cc: Added trx parameters Rewrote mysql_get_identifier_quote_char() sql/mysql_priv.h: Added get_quote_char_for_identifier() sql/sql_show.cc: Added get_quote_char_for_identifier() Removed append_quoted_simple_identifier() Make append_identifier() use get_quote_char_for_identifier() --- innobase/btr/btr0btr.c | 10 +++++----- innobase/btr/btr0cur.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'innobase/btr') diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c index 27d798f925a..2bbfb42b2aa 100644 --- a/innobase/btr/btr0btr.c +++ b/innobase/btr/btr0btr.c @@ -595,10 +595,10 @@ btr_page_get_father_for_rec( buf_page_print(buf_frame_align(node_ptr)); fputs("InnoDB: Corruption of an index tree: table ", stderr); - ut_print_name(stderr, + ut_print_name(stderr, NULL, UT_LIST_GET_FIRST(tree->tree_indexes)->table_name); fputs(", index ", stderr); - ut_print_name(stderr, + ut_print_name(stderr, NULL, UT_LIST_GET_FIRST(tree->tree_indexes)->name); fprintf(stderr, ",\n" "InnoDB: father ptr page no %lu, child page no %lu\n", @@ -2341,7 +2341,7 @@ btr_index_rec_validate_report( dict_index_t* index) /* in: index */ { fputs("InnoDB: Record in ", stderr); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, NULL, index); fprintf(stderr, ", page %lu, at offset %lu\n", buf_frame_get_page_no(page), (ulint)(rec - page)); } @@ -2479,7 +2479,7 @@ btr_validate_report1( { fprintf(stderr, "InnoDB: Error in page %lu of ", buf_frame_get_page_no(page)); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, NULL, index); if (level) { fprintf(stderr, ", index tree level %lu", level); } @@ -2500,7 +2500,7 @@ btr_validate_report2( fprintf(stderr, "InnoDB: Error in pages %lu and %lu of ", buf_frame_get_page_no(page1), buf_frame_get_page_no(page2)); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, NULL, index); if (level) { fprintf(stderr, ", index tree level %lu", level); } diff --git a/innobase/btr/btr0cur.c b/innobase/btr/btr0cur.c index be201da4510..48de5644908 100644 --- a/innobase/btr/btr0cur.c +++ b/innobase/btr/btr0cur.c @@ -839,7 +839,7 @@ static void btr_cur_trx_report( /*===============*/ - const trx_t* trx, /* in: transaction */ + trx_t* trx, /* in: transaction */ const dict_index_t* index, /* in: index */ const char* op) /* in: operation */ { @@ -847,7 +847,7 @@ btr_cur_trx_report( ut_dulint_get_high(trx->id), ut_dulint_get_low(trx->id)); fputs(op, stderr); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, trx, index); putc('\n', stderr); } @@ -899,7 +899,7 @@ btr_cur_optimistic_insert( if (!dtuple_check_typed_no_assert(entry)) { fputs("InnoDB: Error in a tuple to insert into ", stderr); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, thr_get_trx(thr), index); } if (btr_cur_print_record_ops && thr) { @@ -1001,7 +1001,7 @@ calculate_sizes_again: fputs("InnoDB: Error: cannot insert tuple ", stderr); dtuple_print(stderr, entry); fputs(" into ", stderr); - dict_index_name_print(stderr, index); + dict_index_name_print(stderr, thr_get_trx(thr), index); fprintf(stderr, "\nInnoDB: max insert size %lu\n", (ulong) max_size); ut_error; -- cgit v1.2.1