merged 5.0-main to 5.0-bugteam
This commit is contained in:
commit
53fe782e74
@ -7,7 +7,7 @@ AC_INIT(sql/mysqld.cc)
|
|||||||
AC_CANONICAL_SYSTEM
|
AC_CANONICAL_SYSTEM
|
||||||
# The Docs Makefile.am parses this line!
|
# The Docs Makefile.am parses this line!
|
||||||
# remember to also change ndb version below and update version.c in ndb
|
# remember to also change ndb version below and update version.c in ndb
|
||||||
AM_INIT_AUTOMAKE(mysql, 5.0.68)
|
AM_INIT_AUTOMAKE(mysql, 5.0.70)
|
||||||
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
AM_CONFIG_HEADER([include/config.h:config.h.in])
|
||||||
|
|
||||||
PROTOCOL_VERSION=10
|
PROTOCOL_VERSION=10
|
||||||
@ -23,7 +23,7 @@ NDB_SHARED_LIB_VERSION=$NDB_SHARED_LIB_MAJOR_VERSION:0:0
|
|||||||
# ndb version
|
# ndb version
|
||||||
NDB_VERSION_MAJOR=5
|
NDB_VERSION_MAJOR=5
|
||||||
NDB_VERSION_MINOR=0
|
NDB_VERSION_MINOR=0
|
||||||
NDB_VERSION_BUILD=68
|
NDB_VERSION_BUILD=70
|
||||||
NDB_VERSION_STATUS=""
|
NDB_VERSION_STATUS=""
|
||||||
|
|
||||||
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
# Set all version vars based on $VERSION. How do we do this more elegant ?
|
||||||
|
@ -2260,6 +2260,7 @@ buf_print(void)
|
|||||||
ut_a(buf_validate());
|
ut_a(buf_validate());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef UNIV_DEBUG
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Returns the number of latched pages in the buffer pool. */
|
Returns the number of latched pages in the buffer pool. */
|
||||||
|
|
||||||
@ -2290,6 +2291,7 @@ buf_get_latched_pages_number(void)
|
|||||||
mutex_exit(&(buf_pool->mutex));
|
mutex_exit(&(buf_pool->mutex));
|
||||||
return fixed_pages_number;
|
return fixed_pages_number;
|
||||||
}
|
}
|
||||||
|
#endif /* UNIV_DEBUG */
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Returns the number of pending buf pool ios. */
|
Returns the number of pending buf pool ios. */
|
||||||
|
@ -3554,7 +3554,7 @@ loop:
|
|||||||
|
|
||||||
ptr = dict_accept(ptr, "FOREIGN", &success);
|
ptr = dict_accept(ptr, "FOREIGN", &success);
|
||||||
|
|
||||||
if (!success) {
|
if (!success || !ib_isspace(*ptr)) {
|
||||||
|
|
||||||
goto loop;
|
goto loop;
|
||||||
}
|
}
|
||||||
|
@ -495,7 +495,15 @@ Prints info of the buffer pool data structure. */
|
|||||||
void
|
void
|
||||||
buf_print(void);
|
buf_print(void);
|
||||||
/*============*/
|
/*============*/
|
||||||
|
|
||||||
|
/*************************************************************************
|
||||||
|
Returns the number of latched pages in the buffer pool. */
|
||||||
|
|
||||||
|
ulint
|
||||||
|
buf_get_latched_pages_number(void);
|
||||||
|
/*==============================*/
|
||||||
#endif /* UNIV_DEBUG */
|
#endif /* UNIV_DEBUG */
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
Prints a page to stderr. */
|
Prints a page to stderr. */
|
||||||
|
|
||||||
@ -503,12 +511,7 @@ void
|
|||||||
buf_page_print(
|
buf_page_print(
|
||||||
/*===========*/
|
/*===========*/
|
||||||
byte* read_buf); /* in: a database page */
|
byte* read_buf); /* in: a database page */
|
||||||
/*************************************************************************
|
|
||||||
Returns the number of latched pages in the buffer pool. */
|
|
||||||
|
|
||||||
ulint
|
|
||||||
buf_get_latched_pages_number(void);
|
|
||||||
/*==============================*/
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Returns the number of pending buf pool ios. */
|
Returns the number of pending buf pool ios. */
|
||||||
|
|
||||||
|
@ -531,7 +531,9 @@ struct export_var_struct{
|
|||||||
ulint innodb_buffer_pool_pages_dirty;
|
ulint innodb_buffer_pool_pages_dirty;
|
||||||
ulint innodb_buffer_pool_pages_misc;
|
ulint innodb_buffer_pool_pages_misc;
|
||||||
ulint innodb_buffer_pool_pages_free;
|
ulint innodb_buffer_pool_pages_free;
|
||||||
|
#ifdef UNIV_DEBUG
|
||||||
ulint innodb_buffer_pool_pages_latched;
|
ulint innodb_buffer_pool_pages_latched;
|
||||||
|
#endif /* UNIV_DEBUG */
|
||||||
ulint innodb_buffer_pool_read_requests;
|
ulint innodb_buffer_pool_read_requests;
|
||||||
ulint innodb_buffer_pool_reads;
|
ulint innodb_buffer_pool_reads;
|
||||||
ulint innodb_buffer_pool_wait_free;
|
ulint innodb_buffer_pool_wait_free;
|
||||||
|
@ -237,6 +237,7 @@ trx_undo_set_state_at_finish(
|
|||||||
/*=========================*/
|
/*=========================*/
|
||||||
/* out: undo log segment header page,
|
/* out: undo log segment header page,
|
||||||
x-latched */
|
x-latched */
|
||||||
|
trx_rseg_t* rseg, /* in: rollback segment memory object */
|
||||||
trx_t* trx, /* in: transaction */
|
trx_t* trx, /* in: transaction */
|
||||||
trx_undo_t* undo, /* in: undo log memory copy */
|
trx_undo_t* undo, /* in: undo log memory copy */
|
||||||
mtr_t* mtr); /* in: mtr */
|
mtr_t* mtr); /* in: mtr */
|
||||||
|
@ -1803,7 +1803,9 @@ srv_export_innodb_status(void)
|
|||||||
export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
|
export_vars.innodb_buffer_pool_pages_data= UT_LIST_GET_LEN(buf_pool->LRU);
|
||||||
export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
|
export_vars.innodb_buffer_pool_pages_dirty= UT_LIST_GET_LEN(buf_pool->flush_list);
|
||||||
export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
|
export_vars.innodb_buffer_pool_pages_free= UT_LIST_GET_LEN(buf_pool->free);
|
||||||
|
#ifdef UNIV_DEBUG
|
||||||
export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
|
export_vars.innodb_buffer_pool_pages_latched= buf_get_latched_pages_number();
|
||||||
|
#endif /* UNIV_DEBUG */
|
||||||
export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
|
export_vars.innodb_buffer_pool_pages_total= buf_pool->curr_size;
|
||||||
export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
|
export_vars.innodb_buffer_pool_pages_misc= buf_pool->max_size -
|
||||||
UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
|
UT_LIST_GET_LEN(buf_pool->LRU) - UT_LIST_GET_LEN(buf_pool->free);
|
||||||
|
@ -761,8 +761,8 @@ trx_commit_off_kernel(
|
|||||||
mutex_enter(&(rseg->mutex));
|
mutex_enter(&(rseg->mutex));
|
||||||
|
|
||||||
if (trx->insert_undo != NULL) {
|
if (trx->insert_undo != NULL) {
|
||||||
trx_undo_set_state_at_finish(trx, trx->insert_undo,
|
trx_undo_set_state_at_finish(
|
||||||
&mtr);
|
rseg, trx, trx->insert_undo, &mtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
undo = trx->update_undo;
|
undo = trx->update_undo;
|
||||||
@ -777,8 +777,8 @@ trx_commit_off_kernel(
|
|||||||
because only a single OS thread is allowed to do the
|
because only a single OS thread is allowed to do the
|
||||||
transaction commit for this transaction. */
|
transaction commit for this transaction. */
|
||||||
|
|
||||||
update_hdr_page = trx_undo_set_state_at_finish(trx,
|
update_hdr_page = trx_undo_set_state_at_finish(
|
||||||
undo, &mtr);
|
rseg, trx, undo, &mtr);
|
||||||
|
|
||||||
/* We have to do the cleanup for the update log while
|
/* We have to do the cleanup for the update log while
|
||||||
holding the rseg mutex because update log headers
|
holding the rseg mutex because update log headers
|
||||||
|
@ -1724,6 +1724,7 @@ trx_undo_set_state_at_finish(
|
|||||||
/*=========================*/
|
/*=========================*/
|
||||||
/* out: undo log segment header page,
|
/* out: undo log segment header page,
|
||||||
x-latched */
|
x-latched */
|
||||||
|
trx_rseg_t* rseg, /* in: rollback segment memory object */
|
||||||
trx_t* trx __attribute__((unused)), /* in: transaction */
|
trx_t* trx __attribute__((unused)), /* in: transaction */
|
||||||
trx_undo_t* undo, /* in: undo log memory copy */
|
trx_undo_t* undo, /* in: undo log memory copy */
|
||||||
mtr_t* mtr) /* in: mtr */
|
mtr_t* mtr) /* in: mtr */
|
||||||
@ -1733,7 +1734,9 @@ trx_undo_set_state_at_finish(
|
|||||||
page_t* undo_page;
|
page_t* undo_page;
|
||||||
ulint state;
|
ulint state;
|
||||||
|
|
||||||
ut_ad(trx && undo && mtr);
|
ut_ad(trx);
|
||||||
|
ut_ad(undo);
|
||||||
|
ut_ad(mtr);
|
||||||
|
|
||||||
if (undo->id >= TRX_RSEG_N_SLOTS) {
|
if (undo->id >= TRX_RSEG_N_SLOTS) {
|
||||||
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
|
fprintf(stderr, "InnoDB: Error: undo->id is %lu\n",
|
||||||
@ -1747,9 +1750,23 @@ trx_undo_set_state_at_finish(
|
|||||||
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
seg_hdr = undo_page + TRX_UNDO_SEG_HDR;
|
||||||
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
page_hdr = undo_page + TRX_UNDO_PAGE_HDR;
|
||||||
|
|
||||||
if (undo->size == 1 && mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
|
if (undo->size == 1
|
||||||
< TRX_UNDO_PAGE_REUSE_LIMIT) {
|
&& mach_read_from_2(page_hdr + TRX_UNDO_PAGE_FREE)
|
||||||
state = TRX_UNDO_CACHED;
|
< TRX_UNDO_PAGE_REUSE_LIMIT) {
|
||||||
|
|
||||||
|
/* This is a heuristic to avoid the problem of all UNDO
|
||||||
|
slots ending up in one of the UNDO lists. Previously if
|
||||||
|
the server crashed with all the slots in one of the lists,
|
||||||
|
transactions that required the slots of a different type
|
||||||
|
would fail for lack of slots. */
|
||||||
|
|
||||||
|
if (UT_LIST_GET_LEN(rseg->update_undo_list) < 500
|
||||||
|
&& UT_LIST_GET_LEN(rseg->insert_undo_list) < 500) {
|
||||||
|
|
||||||
|
state = TRX_UNDO_CACHED;
|
||||||
|
} else {
|
||||||
|
state = TRX_UNDO_TO_FREE;
|
||||||
|
}
|
||||||
|
|
||||||
} else if (undo->type == TRX_UNDO_INSERT) {
|
} else if (undo->type == TRX_UNDO_INSERT) {
|
||||||
|
|
||||||
|
6
mysql-test/r/innodb-autoinc-optimize.result
Normal file
6
mysql-test/r/innodb-autoinc-optimize.result
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
drop table if exists t1;
|
||||||
|
create table t1(a int not null auto_increment primary key) engine=innodb;
|
||||||
|
insert into t1 set a = -1;
|
||||||
|
optimize table t1;
|
||||||
|
Table Op Msg_type Msg_text
|
||||||
|
test.t1 optimize status OK
|
1
mysql-test/r/innodb_bug35220.result
Normal file
1
mysql-test/r/innodb_bug35220.result
Normal file
@ -0,0 +1 @@
|
|||||||
|
SET storage_engine=InnoDB;
|
16
mysql-test/t/innodb-autoinc-optimize.test
Normal file
16
mysql-test/t/innodb-autoinc-optimize.test
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
-- source include/have_innodb.inc
|
||||||
|
# embedded server ignores 'delayed', so skip this
|
||||||
|
-- source include/not_embedded.inc
|
||||||
|
|
||||||
|
--disable_warnings
|
||||||
|
drop table if exists t1;
|
||||||
|
--enable_warnings
|
||||||
|
|
||||||
|
#
|
||||||
|
# Bug 34286
|
||||||
|
#
|
||||||
|
create table t1(a int not null auto_increment primary key) engine=innodb;
|
||||||
|
insert into t1 set a = -1;
|
||||||
|
# NOTE: The database needs to be shutdown and restarted (here) for
|
||||||
|
# the test to work. It's included for reference only.
|
||||||
|
optimize table t1;
|
16
mysql-test/t/innodb_bug35220.test
Normal file
16
mysql-test/t/innodb_bug35220.test
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#
|
||||||
|
# Bug#35220 ALTER TABLE too picky on reserved word "foreign"
|
||||||
|
# http://bugs.mysql.com/35220
|
||||||
|
#
|
||||||
|
|
||||||
|
-- source include/have_innodb.inc
|
||||||
|
|
||||||
|
SET storage_engine=InnoDB;
|
||||||
|
|
||||||
|
# we care only that the following SQL commands do not produce errors
|
||||||
|
-- disable_query_log
|
||||||
|
-- disable_result_log
|
||||||
|
|
||||||
|
CREATE TABLE bug35220 (foreign_col INT, dummy_cant_delete_all_columns INT);
|
||||||
|
ALTER TABLE bug35220 DROP foreign_col;
|
||||||
|
DROP TABLE bug35220;
|
@ -244,8 +244,10 @@ struct show_var_st innodb_status_variables[]= {
|
|||||||
(char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG},
|
(char*) &export_vars.innodb_buffer_pool_pages_flushed, SHOW_LONG},
|
||||||
{"buffer_pool_pages_free",
|
{"buffer_pool_pages_free",
|
||||||
(char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
|
(char*) &export_vars.innodb_buffer_pool_pages_free, SHOW_LONG},
|
||||||
|
#ifdef UNIV_DEBUG
|
||||||
{"buffer_pool_pages_latched",
|
{"buffer_pool_pages_latched",
|
||||||
(char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG},
|
(char*) &export_vars.innodb_buffer_pool_pages_latched, SHOW_LONG},
|
||||||
|
#endif /* UNIV_DEBUG */
|
||||||
{"buffer_pool_pages_misc",
|
{"buffer_pool_pages_misc",
|
||||||
(char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG},
|
(char*) &export_vars.innodb_buffer_pool_pages_misc, SHOW_LONG},
|
||||||
{"buffer_pool_pages_total",
|
{"buffer_pool_pages_total",
|
||||||
@ -4250,7 +4252,7 @@ ha_innobase::rnd_pos(
|
|||||||
int error;
|
int error;
|
||||||
uint keynr = active_index;
|
uint keynr = active_index;
|
||||||
DBUG_ENTER("rnd_pos");
|
DBUG_ENTER("rnd_pos");
|
||||||
DBUG_DUMP("key", (uchar *)pos, ref_length);
|
DBUG_DUMP("key", (uchar*) pos, ref_length);
|
||||||
|
|
||||||
statistic_increment(current_thd->status_var.ha_read_rnd_count,
|
statistic_increment(current_thd->status_var.ha_read_rnd_count,
|
||||||
&LOCK_status);
|
&LOCK_status);
|
||||||
@ -6882,6 +6884,12 @@ ha_innobase::innobase_read_and_init_auto_inc(
|
|||||||
from a table when no table has been locked in ::external_lock(). */
|
from a table when no table has been locked in ::external_lock(). */
|
||||||
prebuilt->trx->n_mysql_tables_in_use++;
|
prebuilt->trx->n_mysql_tables_in_use++;
|
||||||
|
|
||||||
|
/* Since we will perform a MySQL SELECT query to determine the
|
||||||
|
auto-inc value, set prebuilt->sql_stat_start = TRUE so that it
|
||||||
|
is performed like any normal SELECT, regardless of the context
|
||||||
|
we come here. */
|
||||||
|
prebuilt->sql_stat_start = TRUE;
|
||||||
|
|
||||||
error = index_last(table->record[1]);
|
error = index_last(table->record[1]);
|
||||||
|
|
||||||
prebuilt->trx->n_mysql_tables_in_use--;
|
prebuilt->trx->n_mysql_tables_in_use--;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user