Commit 21fad4ee authored by Sergey Vojtovich's avatar Sergey Vojtovich

Merge of innodb-zip-ss6129 from 5.1 to mysql-trunk.

parents 26fc5583 2ebdc909
...@@ -6,8 +6,6 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment ...@@ -6,8 +6,6 @@ binlog.binlog_multi_engine # joro : NDB tests marked as experiment
funcs_1.charset_collation_1 # depends on compile-time decisions funcs_1.charset_collation_1 # depends on compile-time decisions
innodb.innodb_information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists main.ctype_gbk_binlog @solaris # Bug#46010: main.ctype_gbk_binlog fails sporadically : Table 't2' already exists
main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically main.information_schema # Bug#47449 2009-09-19 alik main.information_schema and innodb.innodb_information_schema fail sporadically
main.innodb-autoinc* # Bug#47809 2009-10-04 joro innodb-autoinc.test fails with valgrind errors with the innodb plugin main.innodb-autoinc* # Bug#47809 2009-10-04 joro innodb-autoinc.test fails with valgrind errors with the innodb plugin
......
This diff is collapsed.
innodb-index : Bug#47563 2009-06-11 svoj InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal innodb-index : Bug#47563 2009-06-11 svoj InnoDB: Error: table `test`.`t1#1` already exists in InnoDB internal
innodb_information_schema : Bug#47808 joro : innodb_information_schema.test fails when run under valgrind
...@@ -174,11 +174,11 @@ set innodb_strict_mode = on; ...@@ -174,11 +174,11 @@ set innodb_strict_mode = on;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 0; create table t1 (id int primary key) engine = innodb key_block_size = 0;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 9; create table t2 (id int primary key) engine = innodb key_block_size = 9;
show errors; show warnings;
create table t3 (id int primary key) engine = innodb key_block_size = 1; create table t3 (id int primary key) engine = innodb key_block_size = 1;
...@@ -204,22 +204,22 @@ key_block_size = 8 row_format = compressed; ...@@ -204,22 +204,22 @@ key_block_size = 8 row_format = compressed;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb create table t2 (id int primary key) engine = innodb
key_block_size = 8 row_format = redundant; key_block_size = 8 row_format = redundant;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb create table t3 (id int primary key) engine = innodb
key_block_size = 8 row_format = compact; key_block_size = 8 row_format = compact;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t4 (id int primary key) engine = innodb create table t4 (id int primary key) engine = innodb
key_block_size = 8 row_format = dynamic; key_block_size = 8 row_format = dynamic;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t5 (id int primary key) engine = innodb create table t5 (id int primary key) engine = innodb
key_block_size = 8 row_format = default; key_block_size = 8 row_format = default;
show errors; show warnings;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
...@@ -229,17 +229,17 @@ drop table t1; ...@@ -229,17 +229,17 @@ drop table t1;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb create table t1 (id int primary key) engine = innodb
key_block_size = 9 row_format = redundant; key_block_size = 9 row_format = redundant;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = compact; key_block_size = 9 row_format = compact;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb create table t2 (id int primary key) engine = innodb
key_block_size = 9 row_format = dynamic; key_block_size = 9 row_format = dynamic;
show errors; show warnings;
SELECT table_schema, table_name, row_format SELECT table_schema, table_name, row_format
FROM information_schema.tables WHERE engine='innodb'; FROM information_schema.tables WHERE engine='innodb';
...@@ -249,25 +249,25 @@ set global innodb_file_per_table = off; ...@@ -249,25 +249,25 @@ set global innodb_file_per_table = off;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 1; create table t1 (id int primary key) engine = innodb key_block_size = 1;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 2; create table t2 (id int primary key) engine = innodb key_block_size = 2;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb key_block_size = 4; create table t3 (id int primary key) engine = innodb key_block_size = 4;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t4 (id int primary key) engine = innodb key_block_size = 8; create table t4 (id int primary key) engine = innodb key_block_size = 8;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t5 (id int primary key) engine = innodb key_block_size = 16; create table t5 (id int primary key) engine = innodb key_block_size = 16;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t6 (id int primary key) engine = innodb row_format = compressed; create table t6 (id int primary key) engine = innodb row_format = compressed;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t7 (id int primary key) engine = innodb row_format = dynamic; create table t7 (id int primary key) engine = innodb row_format = dynamic;
show errors; show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact; create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant; create table t9 (id int primary key) engine = innodb row_format = redundant;
...@@ -281,25 +281,25 @@ set global innodb_file_format = `0`; ...@@ -281,25 +281,25 @@ set global innodb_file_format = `0`;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t1 (id int primary key) engine = innodb key_block_size = 1; create table t1 (id int primary key) engine = innodb key_block_size = 1;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t2 (id int primary key) engine = innodb key_block_size = 2; create table t2 (id int primary key) engine = innodb key_block_size = 2;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t3 (id int primary key) engine = innodb key_block_size = 4; create table t3 (id int primary key) engine = innodb key_block_size = 4;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t4 (id int primary key) engine = innodb key_block_size = 8; create table t4 (id int primary key) engine = innodb key_block_size = 8;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t5 (id int primary key) engine = innodb key_block_size = 16; create table t5 (id int primary key) engine = innodb key_block_size = 16;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t6 (id int primary key) engine = innodb row_format = compressed; create table t6 (id int primary key) engine = innodb row_format = compressed;
show errors; show warnings;
--error ER_CANT_CREATE_TABLE --error ER_CANT_CREATE_TABLE
create table t7 (id int primary key) engine = innodb row_format = dynamic; create table t7 (id int primary key) engine = innodb row_format = dynamic;
show errors; show warnings;
create table t8 (id int primary key) engine = innodb row_format = compact; create table t8 (id int primary key) engine = innodb row_format = compact;
create table t9 (id int primary key) engine = innodb row_format = redundant; create table t9 (id int primary key) engine = innodb row_format = redundant;
......
...@@ -109,14 +109,18 @@ SELECT * FROM ```t'\"_str` WHERE c1 = '3' FOR UPDATE; ...@@ -109,14 +109,18 @@ SELECT * FROM ```t'\"_str` WHERE c1 = '3' FOR UPDATE;
-- send -- send
SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE; SELECT * FROM ```t'\"_str` WHERE c1 = '4' FOR UPDATE;
# Give time to the above 2 queries to execute before continuing.
# Without this sleep it sometimes happens that the SELECT from innodb_locks
# executes before some of them, resulting in less than expected number
# of rows being selected from innodb_locks.
-- sleep 0.1
-- enable_result_log -- enable_result_log
-- connection con_verify_innodb_locks -- connection con_verify_innodb_locks
# Wait for the above queries to execute before continuing.
# Without this, it sometimes happens that the SELECT from innodb_locks
# executes before some of them, resulting in less than expected number
# of rows being selected from innodb_locks. If there is a bug and there
# are no 14 rows in innodb_locks then this test will fail with timeout.
let $count = 14;
let $table = INFORMATION_SCHEMA.INNODB_LOCKS;
-- source include/wait_until_rows_count.inc
# the above enables the query log, re-disable it
-- disable_query_log
SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data SELECT lock_mode, lock_type, lock_table, lock_index, lock_rec, lock_data
FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data; FROM INFORMATION_SCHEMA.INNODB_LOCKS ORDER BY lock_data;
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
# #
############################################################################## ##############################################################################
kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild. kill : Bug#37780 2008-12-03 HHunger need some changes to be robust enough for pushbuild.
innodb_bug39438 : Bug#42383 2009-01-28 lsoares "This fails in embedded and on windows. Note that this test is not run on windows and on embedded in PB for main trees currently"
query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically query_cache_28249 : Bug#43861 2009-03-25 main.query_cache_28249 fails sporadically
partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes partition_innodb_builtin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
partition_innodb_plugin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes partition_innodb_plugin : Bug#32430 2009-09-25 mattiasj Waiting for push of Innodb changes
innodb_bug46000 : Bug#47860 2009-10-16 satyab Test fails for innodb plugin 1.0.5
2009-10-29 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb-autoinc.result,
mysql-test/innodb-autoinc.test:
Fix Bug#47125 auto_increment start value is ignored if an index is
created and engine=innodb
2009-10-29 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb_bug47777.result,
mysql-test/innodb_bug47777.test:
Fix Bug#47777 innodb dies with spatial pk: Failing assertion: buf <=
original_buf + buf_len
2009-10-29 The InnoDB Team
* handler/ha_innodb.cc:
Fix Bug#38996 Race condition in ANALYZE TABLE
2009-10-29 The InnoDB Team
* handler/ha_innodb.cc:
Fix bug#42383: Can't create table 'test.bug39438'
2009-10-29 The InnoDB Team
* os/os0proc.c:
Fix Bug#48237 Error handling in os_mem_alloc_large appears to
be incorrect
2009-10-29 The InnoDB Team
* buf/buf0buf.c, buf/buf0lru.c, include/buf0buf.h, include/buf0buf.ic:
Fix corruption of the buf_pool->LRU_old list and improve debug
assertions.
2009-10-28 The InnoDB Team
* srv/srv0start.c:
Fix Bug#41490 After enlargement of InnoDB page size, the error message
become inaccurate
2009-10-26 The InnoDB Team
* row/row0ins.c:
When allocating a data tuple, zero out the system fields in order
to avoid Valgrind warnings about uninitialized fields in
dtuple_validate().
2009-10-22 The InnoDB Team
* handler/ha_innodb.cc, mysql-test/innodb-zip.result,
mysql-test/innodb-zip.test, mysql-test/innodb_bug44369.result,
mysql-test/innodb_bug44369.test:
Fix Bug#47233 Innodb calls push_warning(MYSQL_ERROR::WARN_LEVEL_ERROR)
2009-10-19 The InnoDB Team
* mysql-test/innodb_information_schema.test:
Fix Bug#47808 innodb_information_schema.test fails when run under
valgrind
2009-10-15 The InnoDB Team
* include/page0page.ic:
Fix Bug#47058 Failure to compile innodb_plugin on solaris 10u7 + spro
cc/CC 5.10
2009-10-05 The InnoDB Team
* buf/buf0buf.c:
Do not invalidate buffer pool while an LRU batch is active. Added code
to buf_pool_invalidate() to wait for the running batches to finish.
2009-10-01 The InnoDB Team
* handler/ha_innodb.cc:
Fix Bug#47763 typo in error message: Failed to open table %s after %lu
attemtps.
2009-10-01 The InnoDB Team 2009-10-01 The InnoDB Team
* fsp/fsp0fsp.c, row/row0merge.c: * fsp/fsp0fsp.c, row/row0merge.c:
......
...@@ -1163,10 +1163,15 @@ buf_relocate( ...@@ -1163,10 +1163,15 @@ buf_relocate(
#ifdef UNIV_LRU_DEBUG #ifdef UNIV_LRU_DEBUG
/* buf_pool->LRU_old must be the first item in the LRU list /* buf_pool->LRU_old must be the first item in the LRU list
whose "old" flag is set. */ whose "old" flag is set. */
ut_a(buf_pool->LRU_old->old);
ut_a(!UT_LIST_GET_PREV(LRU, buf_pool->LRU_old) ut_a(!UT_LIST_GET_PREV(LRU, buf_pool->LRU_old)
|| !UT_LIST_GET_PREV(LRU, buf_pool->LRU_old)->old); || !UT_LIST_GET_PREV(LRU, buf_pool->LRU_old)->old);
ut_a(!UT_LIST_GET_NEXT(LRU, buf_pool->LRU_old) ut_a(!UT_LIST_GET_NEXT(LRU, buf_pool->LRU_old)
|| UT_LIST_GET_NEXT(LRU, buf_pool->LRU_old)->old); || UT_LIST_GET_NEXT(LRU, buf_pool->LRU_old)->old);
} else {
/* Check that the "old" flag is consistent in
the block and its neighbours. */
buf_page_set_old(dpage, buf_page_is_old(dpage));
#endif /* UNIV_LRU_DEBUG */ #endif /* UNIV_LRU_DEBUG */
} }
......
...@@ -303,6 +303,28 @@ buf_flush_write_complete( ...@@ -303,6 +303,28 @@ buf_flush_write_complete(
} }
} }
/********************************************************************//**
Flush a batch of writes to the datafiles that have already been
written by the OS. */
static
void
buf_flush_sync_datafiles(void)
/*==========================*/
{
/* Wake possible simulated aio thread to actually post the
writes to the operating system */
os_aio_simulated_wake_handler_threads();
/* Wait that all async writes to tablespaces have been posted to
the OS */
os_aio_wait_until_no_pending_writes();
/* Now we flush the data to disk (for example, with fsync) */
fil_flush_file_spaces(FIL_TABLESPACE);
return;
}
/********************************************************************//** /********************************************************************//**
Flushes possible buffered writes from the doublewrite memory buffer to disk, Flushes possible buffered writes from the doublewrite memory buffer to disk,
and also wakes up the aio thread if simulated aio is used. It is very and also wakes up the aio thread if simulated aio is used. It is very
...@@ -320,8 +342,8 @@ buf_flush_buffered_writes(void) ...@@ -320,8 +342,8 @@ buf_flush_buffered_writes(void)
ulint i; ulint i;
if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) { if (!srv_use_doublewrite_buf || trx_doublewrite == NULL) {
os_aio_simulated_wake_handler_threads(); /* Sync the writes to the disk. */
buf_flush_sync_datafiles();
return; return;
} }
...@@ -529,22 +551,10 @@ flush: ...@@ -529,22 +551,10 @@ flush:
buf_LRU_stat_inc_io(); buf_LRU_stat_inc_io();
} }
/* Wake possible simulated aio thread to actually post the /* Sync the writes to the disk. */
writes to the operating system */ buf_flush_sync_datafiles();
os_aio_simulated_wake_handler_threads();
/* Wait that all async writes to tablespaces have been posted to
the OS */
os_aio_wait_until_no_pending_writes();
/* Now we flush the data to disk (for example, with fsync) */
fil_flush_file_spaces(FIL_TABLESPACE);
/* We can now reuse the doublewrite memory buffer: */ /* We can now reuse the doublewrite memory buffer: */
trx_doublewrite->first_free = 0; trx_doublewrite->first_free = 0;
mutex_exit(&(trx_doublewrite->mutex)); mutex_exit(&(trx_doublewrite->mutex));
......
...@@ -978,14 +978,14 @@ buf_LRU_old_adjust_len(void) ...@@ -978,14 +978,14 @@ buf_LRU_old_adjust_len(void)
#ifdef UNIV_LRU_DEBUG #ifdef UNIV_LRU_DEBUG
ut_a(!LRU_old->old); ut_a(!LRU_old->old);
#endif /* UNIV_LRU_DEBUG */ #endif /* UNIV_LRU_DEBUG */
buf_page_set_old(LRU_old, TRUE);
old_len = ++buf_pool->LRU_old_len; old_len = ++buf_pool->LRU_old_len;
buf_page_set_old(LRU_old, TRUE);
} else if (old_len > new_len + BUF_LRU_OLD_TOLERANCE) { } else if (old_len > new_len + BUF_LRU_OLD_TOLERANCE) {
buf_page_set_old(LRU_old, FALSE);
buf_pool->LRU_old = UT_LIST_GET_NEXT(LRU, LRU_old); buf_pool->LRU_old = UT_LIST_GET_NEXT(LRU, LRU_old);
old_len = --buf_pool->LRU_old_len; old_len = --buf_pool->LRU_old_len;
buf_page_set_old(LRU_old, FALSE);
} else { } else {
return; return;
} }
...@@ -1009,13 +1009,13 @@ buf_LRU_old_init(void) ...@@ -1009,13 +1009,13 @@ buf_LRU_old_init(void)
the adjust function to move the LRU_old pointer to the right the adjust function to move the LRU_old pointer to the right
position */ position */
bpage = UT_LIST_GET_FIRST(buf_pool->LRU); for (bpage = UT_LIST_GET_LAST(buf_pool->LRU); bpage != NULL;
bpage = UT_LIST_GET_PREV(LRU, bpage)) {
while (bpage != NULL) {
ut_ad(bpage->in_LRU_list); ut_ad(bpage->in_LRU_list);
ut_ad(buf_page_in_file(bpage)); ut_ad(buf_page_in_file(bpage));
buf_page_set_old(bpage, TRUE); /* This loop temporarily violates the
bpage = UT_LIST_GET_NEXT(LRU, bpage); assertions of buf_page_set_old(). */
bpage->old = TRUE;
} }
buf_pool->LRU_old = UT_LIST_GET_FIRST(buf_pool->LRU); buf_pool->LRU_old = UT_LIST_GET_FIRST(buf_pool->LRU);
...@@ -1091,10 +1091,19 @@ buf_LRU_remove_block( ...@@ -1091,10 +1091,19 @@ buf_LRU_remove_block(
buf_unzip_LRU_remove_block_if_needed(bpage); buf_unzip_LRU_remove_block_if_needed(bpage);
/* If the LRU list is so short that LRU_old not defined, return */ /* If the LRU list is so short that LRU_old is not defined,
clear the "old" flags and return */
if (UT_LIST_GET_LEN(buf_pool->LRU) < BUF_LRU_OLD_MIN_LEN) { if (UT_LIST_GET_LEN(buf_pool->LRU) < BUF_LRU_OLD_MIN_LEN) {
for (bpage = UT_LIST_GET_FIRST(buf_pool->LRU); bpage != NULL;
bpage = UT_LIST_GET_NEXT(LRU, bpage)) {
/* This loop temporarily violates the
assertions of buf_page_set_old(). */
bpage->old = FALSE;
}
buf_pool->LRU_old = NULL; buf_pool->LRU_old = NULL;
buf_pool->LRU_old_len = 0;
return; return;
} }
...@@ -1155,14 +1164,13 @@ buf_LRU_add_block_to_end_low( ...@@ -1155,14 +1164,13 @@ buf_LRU_add_block_to_end_low(
UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage); UT_LIST_ADD_LAST(LRU, buf_pool->LRU, bpage);
ut_d(bpage->in_LRU_list = TRUE); ut_d(bpage->in_LRU_list = TRUE);
buf_page_set_old(bpage, TRUE);
if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) {
ut_ad(buf_pool->LRU_old); ut_ad(buf_pool->LRU_old);
/* Adjust the length of the old block list if necessary */ /* Adjust the length of the old block list if necessary */
buf_page_set_old(bpage, TRUE);
buf_pool->LRU_old_len++; buf_pool->LRU_old_len++;
buf_LRU_old_adjust_len(); buf_LRU_old_adjust_len();
...@@ -1171,8 +1179,9 @@ buf_LRU_add_block_to_end_low( ...@@ -1171,8 +1179,9 @@ buf_LRU_add_block_to_end_low(
/* The LRU list is now long enough for LRU_old to become /* The LRU list is now long enough for LRU_old to become
defined: init it */ defined: init it */
buf_pool->LRU_old_len++;
buf_LRU_old_init(); buf_LRU_old_init();
} else {
buf_page_set_old(bpage, buf_pool->LRU_old != NULL);
} }
/* If this is a zipped block with decompressed frame as well /* If this is a zipped block with decompressed frame as well
...@@ -1223,14 +1232,13 @@ buf_LRU_add_block_low( ...@@ -1223,14 +1232,13 @@ buf_LRU_add_block_low(
ut_d(bpage->in_LRU_list = TRUE); ut_d(bpage->in_LRU_list = TRUE);
buf_page_set_old(bpage, old);
if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) { if (UT_LIST_GET_LEN(buf_pool->LRU) > BUF_LRU_OLD_MIN_LEN) {
ut_ad(buf_pool->LRU_old); ut_ad(buf_pool->LRU_old);
/* Adjust the length of the old block list if necessary */ /* Adjust the length of the old block list if necessary */
buf_page_set_old(bpage, old);
buf_LRU_old_adjust_len(); buf_LRU_old_adjust_len();
} else if (UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN) { } else if (UT_LIST_GET_LEN(buf_pool->LRU) == BUF_LRU_OLD_MIN_LEN) {
...@@ -1239,6 +1247,8 @@ buf_LRU_add_block_low( ...@@ -1239,6 +1247,8 @@ buf_LRU_add_block_low(
defined: init it */ defined: init it */
buf_LRU_old_init(); buf_LRU_old_init();
} else {
buf_page_set_old(bpage, buf_pool->LRU_old != NULL);
} }
/* If this is a zipped block with decompressed frame as well /* If this is a zipped block with decompressed frame as well
...@@ -1436,15 +1446,6 @@ alloc: ...@@ -1436,15 +1446,6 @@ alloc:
buf_pool->LRU_old = b; buf_pool->LRU_old = b;
} }
#ifdef UNIV_LRU_DEBUG
ut_a(prev_b->old
|| !UT_LIST_GET_NEXT(LRU, b)
|| UT_LIST_GET_NEXT(LRU, b)->old);
} else {
ut_a(!prev_b->old
|| !UT_LIST_GET_NEXT(LRU, b)
|| !UT_LIST_GET_NEXT(LRU, b)->old);
#endif /* UNIV_LRU_DEBUG */
} }
lru_len = UT_LIST_GET_LEN(buf_pool->LRU); lru_len = UT_LIST_GET_LEN(buf_pool->LRU);
...@@ -1460,6 +1461,11 @@ alloc: ...@@ -1460,6 +1461,11 @@ alloc:
defined: init it */ defined: init it */
buf_LRU_old_init(); buf_LRU_old_init();
} }
#ifdef UNIV_LRU_DEBUG
/* Check that the "old" flag is consistent
in the block and its neighbours. */
buf_page_set_old(b, buf_page_is_old(b));
#endif /* UNIV_LRU_DEBUG */
} else { } else {
ut_d(b->in_LRU_list = FALSE); ut_d(b->in_LRU_list = FALSE);
buf_LRU_add_block_low(b, buf_page_is_old(b)); buf_LRU_add_block_low(b, buf_page_is_old(b));
...@@ -1966,19 +1972,24 @@ buf_LRU_validate(void) ...@@ -1966,19 +1972,24 @@ buf_LRU_validate(void)
} }
if (buf_page_is_old(bpage)) { if (buf_page_is_old(bpage)) {
old_len++; const buf_page_t* prev
} = UT_LIST_GET_PREV(LRU, bpage);
const buf_page_t* next
= UT_LIST_GET_NEXT(LRU, bpage);
if (buf_pool->LRU_old && (old_len == 1)) { if (!old_len++) {
ut_a(buf_pool->LRU_old == bpage); ut_a(buf_pool->LRU_old == bpage);
} else {
ut_a(!prev || buf_page_is_old(prev));
}
ut_a(!next || buf_page_is_old(next));
} }
bpage = UT_LIST_GET_NEXT(LRU, bpage); bpage = UT_LIST_GET_NEXT(LRU, bpage);
} }
if (buf_pool->LRU_old) {
ut_a(buf_pool->LRU_old_len == old_len); ut_a(buf_pool->LRU_old_len == old_len);
}
UT_LIST_VALIDATE(list, buf_page_t, buf_pool->free, UT_LIST_VALIDATE(list, buf_page_t, buf_pool->free,
ut_ad(ut_list_node_313->in_free_list)); ut_ad(ut_list_node_313->in_free_list));
......
...@@ -659,6 +659,7 @@ fil_node_open_file( ...@@ -659,6 +659,7 @@ fil_node_open_file(
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
if (space->id == 0) { if (space->id == 0) {
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE); node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
os_file_close(node->handle);
goto add_size; goto add_size;
} }
#endif /* UNIV_HOTBACKUP */ #endif /* UNIV_HOTBACKUP */
...@@ -3244,7 +3245,7 @@ fil_load_single_table_tablespace( ...@@ -3244,7 +3245,7 @@ fil_load_single_table_tablespace(
fprintf(stderr, fprintf(stderr,
"InnoDB: Renaming tablespace %s of id %lu,\n" "InnoDB: Renaming tablespace %s of id %lu,\n"
"InnoDB: to %s_ibbackup_old_vers_<timestamp>\n" "InnoDB: to %s_ibbackup_old_vers_<timestamp>\n"
"InnoDB: because its size %lld is too small" "InnoDB: because its size %" PRId64 " is too small"
" (< 4 pages 16 kB each),\n" " (< 4 pages 16 kB each),\n"
"InnoDB: or the space id in the file header" "InnoDB: or the space id in the file header"
" is not sensible.\n" " is not sensible.\n"
......
This diff is collapsed.
...@@ -289,3 +289,21 @@ trx_t* ...@@ -289,3 +289,21 @@ trx_t*
innobase_trx_allocate( innobase_trx_allocate(
/*==================*/ /*==================*/
MYSQL_THD thd); /*!< in: user thread handle */ MYSQL_THD thd); /*!< in: user thread handle */
/*********************************************************************//**
This function checks each index name for a table against reserved
system default primary index name 'GEN_CLUST_INDEX'. If a name
matches, this function pushes an warning message to the client,
and returns true. */
extern "C"
bool
innobase_index_name_is_reserved(
/*============================*/
/* out: true if the index name
matches the reserved name */
const trx_t* trx, /* in: InnoDB transaction handle */
const KEY* key_info, /* in: Indexes to be created */
ulint num_of_keys); /* in: Number of indexes to
be created. */
...@@ -628,7 +628,7 @@ ha_innobase::add_index( ...@@ -628,7 +628,7 @@ ha_innobase::add_index(
ulint num_created = 0; ulint num_created = 0;
ibool dict_locked = FALSE; ibool dict_locked = FALSE;
ulint new_primary; ulint new_primary;
ulint error; int error;
DBUG_ENTER("ha_innobase::add_index"); DBUG_ENTER("ha_innobase::add_index");
ut_a(table); ut_a(table);
...@@ -656,9 +656,13 @@ ha_innobase::add_index( ...@@ -656,9 +656,13 @@ ha_innobase::add_index(
innodb_table = indexed_table innodb_table = indexed_table
= dict_table_get(prebuilt->table->name, FALSE); = dict_table_get(prebuilt->table->name, FALSE);
/* Check if the index name is reserved. */
if (innobase_index_name_is_reserved(trx, key_info, num_of_keys)) {
error = -1;
} else {
/* Check that index keys are sensible */ /* Check that index keys are sensible */
error = innobase_check_index_keys(key_info, num_of_keys); error = innobase_check_index_keys(key_info, num_of_keys);
}
if (UNIV_UNLIKELY(error)) { if (UNIV_UNLIKELY(error)) {
err_exit: err_exit:
......
...@@ -1129,7 +1129,7 @@ struct buf_page_struct{ ...@@ -1129,7 +1129,7 @@ struct buf_page_struct{
debugging */ debugging */
#endif /* UNIV_DEBUG */ #endif /* UNIV_DEBUG */
unsigned old:1; /*!< TRUE if the block is in the old unsigned old:1; /*!< TRUE if the block is in the old
blocks in the LRU list */ blocks in buf_pool->LRU_old */
unsigned freed_page_clock:31;/*!< the value of unsigned freed_page_clock:31;/*!< the value of
buf_pool->freed_page_clock buf_pool->freed_page_clock
when this block was the last when this block was the last
...@@ -1393,8 +1393,7 @@ struct buf_pool_struct{ ...@@ -1393,8 +1393,7 @@ struct buf_pool_struct{
the block to which LRU_old points the block to which LRU_old points
onward, including that block; onward, including that block;
see buf0lru.c for the restrictions see buf0lru.c for the restrictions
on this value; not defined if on this value; 0 if LRU_old == NULL;
LRU_old == NULL;
NOTE: LRU_old_len must be adjusted NOTE: LRU_old_len must be adjusted
whenever LRU_old shrinks or grows! */ whenever LRU_old shrinks or grows! */
......
...@@ -466,10 +466,19 @@ buf_page_set_old( ...@@ -466,10 +466,19 @@ buf_page_set_old(
ut_ad(bpage->in_LRU_list); ut_ad(bpage->in_LRU_list);
#ifdef UNIV_LRU_DEBUG #ifdef UNIV_LRU_DEBUG
if (UT_LIST_GET_PREV(LRU, bpage) && UT_LIST_GET_NEXT(LRU, bpage) ut_a((buf_pool->LRU_old_len == 0) == (buf_pool->LRU_old == NULL));
&& UT_LIST_GET_PREV(LRU, bpage)->old /* If a block is flagged "old", the LRU_old list must exist. */
== UT_LIST_GET_NEXT(LRU, bpage)->old) { ut_a(!old || buf_pool->LRU_old);
ut_a(UT_LIST_GET_PREV(LRU, bpage)->old == old);
if (UT_LIST_GET_PREV(LRU, bpage) && UT_LIST_GET_NEXT(LRU, bpage)) {
const buf_page_t* prev = UT_LIST_GET_PREV(LRU, bpage);
const buf_page_t* next = UT_LIST_GET_NEXT(LRU, bpage);
if (prev->old == next->old) {
ut_a(prev->old == old);
} else {
ut_a(!prev->old);
ut_a(buf_pool->LRU_old == (old ? bpage : next));
}
} }
#endif /* UNIV_LRU_DEBUG */ #endif /* UNIV_LRU_DEBUG */
......
...@@ -907,7 +907,7 @@ page_get_data_size( ...@@ -907,7 +907,7 @@ page_get_data_size(
/************************************************************//** /************************************************************//**
Allocates a block of memory from the free list of an index page. */ Allocates a block of memory from the free list of an index page. */
UNIV_INTERN UNIV_INLINE
void void
page_mem_alloc_free( page_mem_alloc_free(
/*================*/ /*================*/
......
...@@ -756,8 +756,6 @@ struct row_prebuilt_struct { ...@@ -756,8 +756,6 @@ struct row_prebuilt_struct {
store it here so that we can return store it here so that we can return
it to MySQL */ it to MySQL */
/*----------------------*/ /*----------------------*/
UT_LIST_NODE_T(row_prebuilt_t) prebuilts;
/*!< list node of table->prebuilts */
ulint magic_n2; /*!< this should be the same as ulint magic_n2; /*!< this should be the same as
magic_n */ magic_n */
}; };
......
...@@ -237,7 +237,7 @@ by one. */ ...@@ -237,7 +237,7 @@ by one. */
/* Linkage specifier for non-static InnoDB symbols (variables and functions) /* Linkage specifier for non-static InnoDB symbols (variables and functions)
that are only referenced from within InnoDB, not from MySQL */ that are only referenced from within InnoDB, not from MySQL */
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(UNIV_HOTBACKUP) #if defined(__GNUC__) && (__GNUC__ >= 4) || defined(__INTEL_COMPILER)
# define UNIV_INTERN __attribute__((visibility ("hidden"))) # define UNIV_INTERN __attribute__((visibility ("hidden")))
#else #else
# define UNIV_INTERN # define UNIV_INTERN
......
...@@ -832,6 +832,23 @@ next_file: ...@@ -832,6 +832,23 @@ next_file:
ret = stat(full_path, &statinfo); ret = stat(full_path, &statinfo);
if (ret) { if (ret) {
if (errno == ENOENT) {
/* readdir() returned a file that does not exist,
it must have been deleted in the meantime. Do what
would have happened if the file was deleted before
readdir() - ignore and go to the next entry.
If this is the last entry then info->name will still
contain the name of the deleted file when this
function returns, but this is not an issue since the
caller shouldn't be looking at info when end of
directory is returned. */
ut_free(full_path);
goto next_file;
}
os_file_handle_error_no_exit(full_path, "stat"); os_file_handle_error_no_exit(full_path, "stat");
ut_free(full_path); ut_free(full_path);
......
...@@ -97,6 +97,7 @@ os_mem_alloc_large( ...@@ -97,6 +97,7 @@ os_mem_alloc_large(
fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to" fprintf(stderr, "InnoDB: HugeTLB: Warning: Failed to"
" attach shared memory segment, errno %d\n", " attach shared memory segment, errno %d\n",
errno); errno);
ptr = NULL;
} }
/* Remove the shared memory segment so that it will be /* Remove the shared memory segment so that it will be
......
...@@ -141,7 +141,7 @@ row_ins_alloc_sys_fields( ...@@ -141,7 +141,7 @@ row_ins_alloc_sys_fields(
dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_ROW_ID_LEN); ptr = mem_heap_zalloc(heap, DATA_ROW_ID_LEN);
dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN); dfield_set_data(dfield, ptr, DATA_ROW_ID_LEN);
...@@ -152,7 +152,7 @@ row_ins_alloc_sys_fields( ...@@ -152,7 +152,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_TRX_ID); col = dict_table_get_sys_col(table, DATA_TRX_ID);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_TRX_ID_LEN); ptr = mem_heap_zalloc(heap, DATA_TRX_ID_LEN);
dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN); dfield_set_data(dfield, ptr, DATA_TRX_ID_LEN);
...@@ -163,7 +163,7 @@ row_ins_alloc_sys_fields( ...@@ -163,7 +163,7 @@ row_ins_alloc_sys_fields(
col = dict_table_get_sys_col(table, DATA_ROLL_PTR); col = dict_table_get_sys_col(table, DATA_ROLL_PTR);
dfield = dtuple_get_nth_field(row, dict_col_get_no(col)); dfield = dtuple_get_nth_field(row, dict_col_get_no(col));
ptr = mem_heap_alloc(heap, DATA_ROLL_PTR_LEN); ptr = mem_heap_zalloc(heap, DATA_ROLL_PTR_LEN);
dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN); dfield_set_data(dfield, ptr, DATA_ROLL_PTR_LEN);
} }
......
...@@ -2068,7 +2068,7 @@ Scans a table create SQL string and adds to the data dictionary ...@@ -2068,7 +2068,7 @@ Scans a table create SQL string and adds to the data dictionary
the foreign key constraints declared in the string. This function the foreign key constraints declared in the string. This function
should be called after the indexes for a table have been created. should be called after the indexes for a table have been created.
Each foreign key constraint must be accompanied with indexes in Each foreign key constraint must be accompanied with indexes in
bot participating tables. The indexes are allowed to contain more both participating tables. The indexes are allowed to contain more
fields than mentioned in the constraint. Check also that foreign key fields than mentioned in the constraint. Check also that foreign key
constraints which reference this table are ok. constraints which reference this table are ok.
@return error code or DB_SUCCESS */ @return error code or DB_SUCCESS */
......
...@@ -1376,7 +1376,7 @@ innobase_start_or_create_for_mysql(void) ...@@ -1376,7 +1376,7 @@ innobase_start_or_create_for_mysql(void)
sum_of_new_sizes += srv_data_file_sizes[i]; sum_of_new_sizes += srv_data_file_sizes[i];
} }
if (sum_of_new_sizes < 640) { if (sum_of_new_sizes < 10485760 / UNIV_PAGE_SIZE) {
fprintf(stderr, fprintf(stderr,
"InnoDB: Error: tablespace size must be" "InnoDB: Error: tablespace size must be"
" at least 10 MB\n"); " at least 10 MB\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment