Commit bbb8125a authored by heikki@hundin.mysql.fi's avatar heikki@hundin.mysql.fi
Browse files

Many files:

  Merge InnoDB-3.23.52c; improve AUTO-INC algorithm with SHOW TABLE STATUS; new checksum in log
parent c5bdaee9
Loading
Loading
Loading
Loading
+15 −7
Original line number Diff line number Diff line
@@ -1707,10 +1707,11 @@ buf_print(void)

	mutex_enter(&(buf_pool->mutex));
	
	printf("LRU len %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
	printf("free len %lu \n", UT_LIST_GET_LEN(buf_pool->free));
	printf("flush len %lu \n", UT_LIST_GET_LEN(buf_pool->flush_list));
	printf("buf_pool size %lu \n", size);
	printf("database pages %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
	printf("free pages %lu \n", UT_LIST_GET_LEN(buf_pool->free));
	printf("modified database pages %lu \n",
				UT_LIST_GET_LEN(buf_pool->flush_list));

	printf("n pending reads %lu \n", buf_pool->n_pend_reads);

@@ -1819,13 +1820,20 @@ buf_print_io(
	mutex_enter(&(buf_pool->mutex));
	
	buf += sprintf(buf,
		"Free list length  %lu \n", UT_LIST_GET_LEN(buf_pool->free));
		"Buffer pool size   %lu\n", size);
	buf += sprintf(buf,
		"Free buffers       %lu\n", UT_LIST_GET_LEN(buf_pool->free));
	buf += sprintf(buf,
		"Database pages     %lu\n", UT_LIST_GET_LEN(buf_pool->LRU));
/*
	buf += sprintf(buf,
		"Lock heap buffers  %lu\n", buf_pool->n_lock_heap_pages);
	buf += sprintf(buf,
		"LRU list length   %lu \n", UT_LIST_GET_LEN(buf_pool->LRU));
		"Hash index buffers %lu\n", buf_pool->n_adaptive_hash_pages);
*/
	buf += sprintf(buf,
		"Flush list length %lu \n",
		"Modified db pages  %lu\n",
				UT_LIST_GET_LEN(buf_pool->flush_list));
	buf += sprintf(buf, "Buffer pool size  %lu\n", size);

	buf += sprintf(buf, "Pending reads %lu \n", buf_pool->n_pend_reads);

+31 −8
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ void
dict_table_autoinc_initialize(
/*==========================*/
	dict_table_t*	table,	/* in: table */
	ib_longlong	value)	/* in: value which was assigned to a row */
	ib_longlong	value)	/* in: next value to assign to a row */
{
	mutex_enter(&(table->autoinc_mutex));

@@ -281,8 +281,8 @@ dict_table_autoinc_initialize(
}

/************************************************************************
Gets the next autoinc value, 0 if not yet initialized. If initialized,
increments the counter by 1. */
Gets the next autoinc value (== autoinc counter value), 0 if not yet
initialized. If initialized, increments the counter by 1. */

ib_longlong
dict_table_autoinc_get(
@@ -298,8 +298,8 @@ dict_table_autoinc_get(

		value = 0;
	} else {
		table->autoinc = table->autoinc + 1;
		value = table->autoinc;
		table->autoinc = table->autoinc + 1;
	}
	
	mutex_exit(&(table->autoinc_mutex));
@@ -334,20 +334,43 @@ dict_table_autoinc_read(
}

/************************************************************************
Updates the autoinc counter if the value supplied is bigger than the
Peeks the autoinc counter value, 0 if not yet initialized. Does not
increment the counter. The read not protected by any mutex! */

ib_longlong
dict_table_autoinc_peek(
/*====================*/
				/* out: value of the counter */
	dict_table_t*	table)	/* in: table */
{
	ib_longlong	value;

	if (!table->autoinc_inited) {

		value = 0;
	} else {
		value = table->autoinc;
	}

	return(value);
}

/************************************************************************
Updates the autoinc counter if the value supplied is equal or bigger than the
current value. If not inited, does nothing. */

void
dict_table_autoinc_update(
/*======================*/

	dict_table_t*	table,	/* in: table */
	ib_longlong	value)	/* in: value which was assigned to a row */
{
	mutex_enter(&(table->autoinc_mutex));

	if (table->autoinc_inited) {
		if (value > table->autoinc) {
			table->autoinc = value;
		if (value >= table->autoinc) {
			table->autoinc = value + 1;
		}
	}	

+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ fil_read_flushed_lsn_and_arch_log_no(
	ulint	arch_log_no;

	buf2 = ut_malloc(2 * UNIV_PAGE_SIZE);
	/* Align the memory for a possibel read from a raw device */
	/* Align the memory for a possible read from a raw device */
	buf = ut_align(buf2, UNIV_PAGE_SIZE);
	
	os_file_read(data_file, buf, 0, 0, UNIV_PAGE_SIZE);
+30 −0
Original line number Diff line number Diff line
@@ -933,6 +933,36 @@ fsp_header_get_free_limit(
	return(limit);
}

/**************************************************************************
Gets the size of the tablespace from the tablespace header. If we do not
have an auto-extending data file, this should be equal to the size of the
data files. If there is an auto-extending data file, this can be smaller. */

ulint
fsp_header_get_tablespace_size(
/*===========================*/
			/* out: size in pages */
	ulint	space)	/* in: space id */
{
	fsp_header_t*	header;
	ulint		size;
	mtr_t		mtr;

	ut_a(space == 0); /* We have only one log_fsp_current_... variable */
	
	mtr_start(&mtr);

	mtr_x_lock(fil_space_get_latch(space), &mtr);	

	header = fsp_get_space_header(space, &mtr);

	size = mtr_read_ulint(header + FSP_SIZE, MLOG_4BYTES, &mtr);

	mtr_commit(&mtr);

	return(size);
}

/***************************************************************************
Tries to extend the last data file file if it is defined as auto-extending. */
static
+7 −2
Original line number Diff line number Diff line
@@ -335,6 +335,11 @@ ha_print_info(
		}
	}

	buf += sprintf(buf, "Hash table size %lu, used cells %lu\n",
					hash_get_n_cells(table), cells);
	buf += sprintf(buf,
"Hash table size %lu, used cells %lu", hash_get_n_cells(table), cells);

	if (table->heaps == NULL && table->heap != NULL) {
	        buf += sprintf(buf,
", node heap has %lu buffer(s)\n", UT_LIST_GET_LEN(table->heap->base));
	}
}	
Loading