Commit d9c18caa authored by heikki@donna.mysql.fi's avatar heikki@donna.mysql.fi
Browse files

manual.texi website address change

row0sel.c	CHECK TABLE now also for InnoDB, a join speed optimization
trx0trx.c	CHECK TABLE now also for InnoDB, a join speed optimization
rem0cmp.c	CHECK TABLE now also for InnoDB, a join speed optimization
row0mysql.c	CHECK TABLE now also for InnoDB, a join speed optimization
page0page.c	CHECK TABLE now also for InnoDB, a join speed optimization
row0mysql.h	CHECK TABLE now also for InnoDB, a join speed optimization
trx0trx.h	CHECK TABLE now also for InnoDB, a join speed optimization
btr0btr.h	CHECK TABLE now also for InnoDB, a join speed optimization
btr0cur.h	CHECK TABLE now also for InnoDB, a join speed optimization
btr0pcur.h	CHECK TABLE now also for InnoDB, a join speed optimization
btr0pcur.ic	CHECK TABLE now also for InnoDB, a join speed optimization
btr0btr.c	CHECK TABLE now also for InnoDB, a join speed optimization
btr0cur.c	CHECK TABLE now also for InnoDB, a join speed optimization
btr0sea.c	CHECK TABLE now also for InnoDB, a join speed optimization
innodb.result	CHECK TABLE now also for InnoDB, a join speed optimization
ha_innobase.cc	CHECK TABLE now also for InnoDB, a join speed optimization
ha_innobase.h	CHECK TABLE now also for InnoDB, a join speed optimization
parent f02ed5fe
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26712,7 +26712,7 @@ the maximum size for a table. The minimum tablespace size is 10 MB.
Contact information of Innobase Oy, producer of the InnoDB engine:
@example
Website: www.innobase.fi
Website: www.innodb.com
Heikki.Tuuri@@innobase.inet.fi
phone: 358-9-6969 3250 (office) 358-40-5617367 (mobile)
InnoDB Oy Inc.
+117 −6
Original line number Diff line number Diff line
@@ -2238,12 +2238,93 @@ btr_check_node_ptr(
	return(TRUE);
}

/****************************************************************
Checks the size and number of fields in a record based on the definition of
the index. */
static
ibool
btr_index_rec_validate(
/*====================*/
				/* out: TRUE if ok */
	rec_t*		rec,	/* in: index record */
	dict_index_t*	index)	/* in: index */
{
	dtype_t* type;
	byte*	data;
	ulint	len;
	ulint	n;
	ulint	i;
	
	n = dict_index_get_n_fields(index);

	if (rec_get_n_fields(rec) != n) {
		fprintf(stderr, "Record has %lu fields, should have %lu\n",
				rec_get_n_fields(rec), n);

		return(FALSE);
	}

	for (i = 0; i < n; i++) {
		data = rec_get_nth_field(rec, i, &len);

		type = dict_index_get_nth_type(index, i);
		
		if (len != UNIV_SQL_NULL && dtype_is_fixed_size(type)
		    && len != dtype_get_fixed_size(type)) {
			fprintf(stderr,
			"Record field %lu len is %lu, should be %lu\n",
				i, len, dtype_get_fixed_size(type));

			return(FALSE);
		}
	}

	return(TRUE);			
}

/****************************************************************
Checks the size and number of fields in records based on the definition of
the index. */
static
ibool
btr_index_page_validate(
/*====================*/
				/* out: TRUE if ok */
	page_t*		page,	/* in: index page */
	dict_index_t*	index)	/* in: index */
{
	rec_t*		rec;
	page_cur_t 	cur;
	ibool		ret	= TRUE;
	
	page_cur_set_before_first(page, &cur);
	page_cur_move_to_next(&cur);

	for (;;) {
		rec = (&cur)->rec;

		if (page_cur_is_after_last(&cur)) {
			break;
		}

		if (!btr_index_rec_validate(rec, index)) {

			ret = FALSE;
		}

		page_cur_move_to_next(&cur);
	}

	return(ret);	
}

/****************************************************************
Validates index tree level. */
static
void
ibool
btr_validate_level(
/*===============*/
				/* out: TRUE if ok */
	dict_tree_t*	tree,	/* in: index tree */
	ulint		level)	/* in: level number */
{
@@ -2260,6 +2341,8 @@ btr_validate_level(
	page_cur_t	cursor;
	mem_heap_t*	heap;
	dtuple_t*	node_ptr_tuple;
	ibool		ret	= TRUE;
	dict_index_t*	index;
	
	mtr_start(&mtr);

@@ -2278,12 +2361,30 @@ btr_validate_level(
		page = btr_node_ptr_get_child(node_ptr, &mtr);
	}

	index = UT_LIST_GET_FIRST(tree->tree_indexes);
	
	/* Now we are on the desired level */
loop:
	mtr_x_lock(dict_tree_get_lock(tree), &mtr);

	/* Check ordering of records */
	page_validate(page, UT_LIST_GET_FIRST(tree->tree_indexes));
	/* Check ordering etc. of records */

	if (!page_validate(page, index)) {
		fprintf(stderr, "Error in page %lu in index %s\n",
			buf_frame_get_page_no(page), index->name);

		ret = FALSE;
	}

	if (level == 0) {
		if (!btr_index_page_validate(page, index)) {
 			fprintf(stderr,
			"Error in page %lu in index %s\n",
				buf_frame_get_page_no(page), index->name);

			ret = FALSE;
		}
	}
	
	ut_a(btr_page_get_level(page, &mtr) == level);

@@ -2374,14 +2475,17 @@ btr_validate_level(

		goto loop;
	}

	return(ret);
}

/******************************************************************
Checks the consistency of an index tree. */

void
ibool
btr_validate_tree(
/*==============*/
				/* out: TRUE if ok */
	dict_tree_t*	tree)	/* in: tree */
{
	mtr_t	mtr;
@@ -2397,8 +2501,15 @@ btr_validate_tree(

	for (i = 0; i <= n; i++) {
		
		btr_validate_level(tree, n - i);
		if (!btr_validate_level(tree, n - i)) {

			mtr_commit(&mtr);

			return(FALSE);
		}
	}

	mtr_commit(&mtr);

	return(TRUE);
}
+7 −2
Original line number Diff line number Diff line
@@ -163,9 +163,14 @@ btr_cur_search_to_nth_level(
				BTR_INSERT and BTR_ESTIMATE;
				cursor->left_page is used to store a pointer
				to the left neighbor page, in the cases
				BTR_SEARCH_PREV and BTR_MODIFY_PREV */
				BTR_SEARCH_PREV and BTR_MODIFY_PREV;
				NOTE that if has_search_latch
				is != 0, we maybe do not have a latch set
				on the cursor page, we assume
				the caller uses his search latch
				to protect the record! */
	btr_cur_t*	cursor, /* in/out: tree cursor; the cursor page is
				s- or x-latched */
				   s- or x-latched, but see also above! */
	ulint		has_search_latch,/* in: info on the latch mode the
				caller currently has on btr_search_latch:
				RW_S_LATCH, or 0 */
+9 −2
Original line number Diff line number Diff line
@@ -601,7 +601,12 @@ btr_search_guess_on_hash(
	btr_search_t*	info,		/* in: index search info */
	dtuple_t*	tuple,		/* in: logical record */
	ulint		mode,		/* in: PAGE_CUR_L, ... */
	ulint		latch_mode, 	/* in: BTR_SEARCH_LEAF, ... */
	ulint		latch_mode, 	/* in: BTR_SEARCH_LEAF, ...;
					NOTE that only if has_search_latch
					is 0, we will have a latch set on
					the cursor page, otherwise we assume
					the caller uses his search latch
					to protect the record! */
	btr_cur_t*	cursor, 	/* out: tree cursor */
	ulint		has_search_latch,/* in: latch mode the caller
					currently has on btr_search_latch:
@@ -722,7 +727,9 @@ btr_search_guess_on_hash(
	}
	
	if (!success) {
		if (!has_search_latch) {
		          btr_leaf_page_release(page, latch_mode, mtr);
		}

		goto failure;
	}
+2 −1
Original line number Diff line number Diff line
@@ -376,9 +376,10 @@ btr_print_tree(
/******************************************************************
Checks the consistency of an index tree. */

void
ibool
btr_validate_tree(
/*==============*/
				/* out: TRUE if ok */
	dict_tree_t*	tree);	/* in: tree */

#define BTR_N_LEAF_PAGES 	1
Loading