diff options
author | unknown <marko@hundin.mysql.fi> | 2004-12-28 01:34:52 +0200 |
---|---|---|
committer | unknown <marko@hundin.mysql.fi> | 2004-12-28 01:34:52 +0200 |
commit | 7ce58befd33d78e1c11872fcbc696a9cfad698c2 (patch) | |
tree | 6da5ac10b2bcc95fc1120e9a5d69928fdbe40917 /innobase/rem | |
parent | e3c7697431c144215af2f752d5c23b5b06e29982 (diff) | |
download | mariadb-git-7ce58befd33d78e1c11872fcbc696a9cfad698c2.tar.gz |
InnoDB: Fix some bugs in the new record format. (Bug #7493)
innobase/btr/btr0btr.c:
Remove parameter n_fields from cmp_rec_rec()
innobase/btr/btr0cur.c:
Remove parameter n_fields from cmp_rec_rec_with_match()
innobase/btr/btr0pcur.c:
Remove parameter n_fields from cmp_rec_rec()
innobase/include/rem0cmp.h:
Remove parameter n from cmp_rec_rec_with_match() and cmp_rec_rec()
innobase/include/rem0cmp.ic:
Remove parameter n from cmp_rec_rec()
innobase/include/rem0rec.ic:
Correct the implementation of rec_offs_nth_size() (Bug #7493)
innobase/page/page0page.c:
Remove parameter n_fields from cmp_rec_rec()
innobase/rem/rem0cmp.c:
Remove parameter n from cmp_rec_rec_with_match()
innobase/rem/rem0rec.c:
rec_get_offsets(): Pass the number of allocated elements to
rec_offs_set_n_alloc() instead of the number of allocated bytes,
so that debugging assertions are more likely to detect
out-of-bounds errors.
Diffstat (limited to 'innobase/rem')
-rw-r--r-- | innobase/rem/rem0cmp.c | 14 | ||||
-rw-r--r-- | innobase/rem/rem0rec.c | 6 |
2 files changed, 5 insertions, 15 deletions
diff --git a/innobase/rem/rem0cmp.c b/innobase/rem/rem0cmp.c index 974fc7a24d0..6473d356ba8 100644 --- a/innobase/rem/rem0cmp.c +++ b/innobase/rem/rem0cmp.c @@ -728,10 +728,6 @@ cmp_rec_rec_with_match( const ulint* offsets1,/* in: rec_get_offsets(rec1, index) */ const ulint* offsets2,/* in: rec_get_offsets(rec2, index) */ dict_index_t* index, /* in: data dictionary index */ - ulint n, /* in: number of fields to compare, - or ULINT_UNDEFINED if both records - contain all fields, and all fields - should be compared */ ulint* matched_fields, /* in/out: number of already completely matched fields; when the function returns, contains the value the for current @@ -765,14 +761,8 @@ cmp_rec_rec_with_match( ut_ad(rec_offs_comp(offsets1) == rec_offs_comp(offsets2)); comp = rec_offs_comp(offsets1); - if (n == ULINT_UNDEFINED) { - rec1_n_fields = rec_offs_n_fields(offsets1); - rec2_n_fields = rec_offs_n_fields(offsets2); - } else { - ut_ad(n <= rec_offs_n_fields(offsets1)); - ut_ad(n <= rec_offs_n_fields(offsets2)); - rec1_n_fields = rec2_n_fields = n; - } + rec1_n_fields = rec_offs_n_fields(offsets1); + rec2_n_fields = rec_offs_n_fields(offsets2); cur_field = *matched_fields; cur_bytes = *matched_bytes; diff --git a/innobase/rem/rem0rec.c b/innobase/rem/rem0rec.c index 74876ad9402..90cbffe7a9e 100644 --- a/innobase/rem/rem0rec.c +++ b/innobase/rem/rem0rec.c @@ -333,14 +333,14 @@ rec_get_offsets_func( n = n_fields; } - size = (n + (1 + REC_OFFS_HEADER_SIZE)) * sizeof(ulint); + size = n + (1 + REC_OFFS_HEADER_SIZE); if (!offsets || rec_offs_get_n_alloc(offsets) < size) { if (!*heap) { - *heap = mem_heap_create_func(size, + *heap = mem_heap_create_func(size * sizeof(ulint), NULL, MEM_HEAP_DYNAMIC, file, line); } - offsets = mem_heap_alloc(*heap, size); + offsets = mem_heap_alloc(*heap, size * sizeof(ulint)); rec_offs_set_n_alloc(offsets, size); } |