Commit 7ce58bef authored by unknown's avatar unknown
Browse files

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.
parent e3c76974
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -2735,9 +2735,8 @@ btr_validate_level(
					offsets, ULINT_UNDEFINED, &heap);
		offsets2 = rec_get_offsets(right_rec, index,
					offsets2, ULINT_UNDEFINED, &heap);
		if (cmp_rec_rec(rec, right_rec, offsets, offsets2,
			dict_index_get_n_fields(index),
			index) >= 0) {
		if (cmp_rec_rec(rec, right_rec, offsets, offsets2, index)
				>= 0) {

			btr_validate_report2(index, level, page, right_page);

+1 −1
Original line number Diff line number Diff line
@@ -2848,7 +2848,7 @@ btr_estimate_number_of_different_key_vals(

			cmp_rec_rec_with_match(rec, next_rec,
						offsets1, offsets2,
						index, n_cols, &matched_fields,
						index, &matched_fields,
						&matched_bytes);

			for (j = matched_fields + 1; j <= n_cols; j++) {
+1 −3
Original line number Diff line number Diff line
@@ -268,9 +268,7 @@ btr_pcur_restore_position(
						cursor->old_n_fields, &heap);

				ut_ad(cmp_rec_rec(cursor->old_rec,
					rec, offsets1, offsets2,
					cursor->old_n_fields,
					index) == 0);
					rec, offsets1, offsets2, index) == 0);
				mem_heap_free(heap);
#endif /* UNIV_DEBUG */
				return(TRUE);
+0 −8
Original line number Diff line number Diff line
@@ -137,10 +137,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
@@ -163,10 +159,6 @@ cmp_rec_rec(
	rec_t*		rec2,	/* in: physical record */
	const ulint*	offsets1,/* in: rec_get_offsets(rec1, index) */
	const ulint*	offsets2,/* in: rec_get_offsets(rec2, index) */
	ulint		n,	/* in: number of fields to compare,
				or ULINT_UNDEFINED if both records
				contain all fields, and all fields
				should be compared */
	dict_index_t*	index);	/* in: data dictionary index */


+1 −2
Original line number Diff line number Diff line
@@ -59,12 +59,11 @@ cmp_rec_rec(
	rec_t*		rec2,	/* in: physical record */
	const ulint*	offsets1,/* in: rec_get_offsets(rec1, index) */
	const ulint*	offsets2,/* in: rec_get_offsets(rec2, index) */
	ulint		n,	/* in: number of fields to compare */
	dict_index_t*	index)	/* in: data dictionary index */
{
	ulint	match_f		= 0;
	ulint	match_b		= 0;
	
	return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index, n,
	return(cmp_rec_rec_with_match(rec1, rec2, offsets1, offsets2, index,
					&match_f, &match_b));
}
Loading