From 3940368293134f3fcce418c8533143ab6f4581ec Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 1 Jan 2004 01:51:36 +0200 Subject: row0purge.c: Fix bug: if purge of a table was not possible because its .ibd file was missing, trx->dict_operation_lock_mode was left to a wrong value, causing an assertion failure innobase/row/row0purge.c: Fix bug: if purge of a table was not possible because its .ibd file was missing, trx->dict_operation_lock_mode was left to a wrong value, causing an assertion failure --- innobase/row/row0purge.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'innobase') diff --git a/innobase/row/row0purge.c b/innobase/row/row0purge.c index a455722f15a..d5895f20461 100644 --- a/innobase/row/row0purge.c +++ b/innobase/row/row0purge.c @@ -534,6 +534,8 @@ row_purge_parse_undo_rec( node->table = NULL; + row_mysql_unfreeze_data_dictionary(trx); + return(FALSE); } -- cgit v1.2.1 From 63f15064a48e4a3fbd5a15bda39d70ee5254a6ac Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 2 Jan 2004 16:21:58 +0200 Subject: log0recv.h, log0recv.c: Merge a log replay change required by ibbackup innobase/log/log0recv.c: Merge a log replay change required by ibbackup innobase/include/log0recv.h: Merge a log replay change required by ibbackup --- innobase/include/log0recv.h | 2 ++ innobase/log/log0recv.c | 24 ++++++++++++++++-------- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'innobase') diff --git a/innobase/include/log0recv.h b/innobase/include/log0recv.h index 5991960e8ae..c972c3ce977 100644 --- a/innobase/include/log0recv.h +++ b/innobase/include/log0recv.h @@ -15,6 +15,8 @@ Created 9/20/1997 Heikki Tuuri #include "hash0hash.h" #include "log0log.h" +extern ibool recv_replay_file_ops; + /*********************************************************************** Reads the checkpoint info needed in hot backup. */ diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c index b01474753bd..01679a374b0 100644 --- a/innobase/log/log0recv.c +++ b/innobase/log/log0recv.c @@ -34,6 +34,11 @@ Created 9/20/1997 Heikki Tuuri #include "dict0boot.h" #include "fil0fil.h" +/* This is set to FALSE if the backup was originally taken with the +ibbackup --include regexp option: then we do not want to create tables in +directories which were not included */ +ibool recv_replay_file_ops = TRUE; + /* Log records are stored in the hash table in chunks at most of this size; this must be less than UNIV_PAGE_SIZE as it is stored in the buffer pool */ #define RECV_DATA_BLOCK_SIZE (MEM_MAX_ALLOC_IN_BUF - sizeof(recv_data_t)) @@ -1974,18 +1979,21 @@ loop: || type == MLOG_FILE_RENAME || type == MLOG_FILE_DELETE)) { #ifdef UNIV_HOTBACKUP - /* In ibbackup --apply-log, replay an .ibd file - operation, if possible; note that - fil_path_to_mysql_datadir is set in ibbackup to - point to the datadir we should use there */ + if (recv_replay_file_ops) { + + /* In ibbackup --apply-log, replay an .ibd file + operation, if possible; note that + fil_path_to_mysql_datadir is set in ibbackup to + point to the datadir we should use there */ - if (NULL == fil_op_log_parse_or_replay(body, end_ptr, - type, TRUE, space)) { - fprintf(stderr, + if (NULL == fil_op_log_parse_or_replay(body, + end_ptr, type, TRUE, space)) { + fprintf(stderr, "InnoDB: Error: file op log record of type %lu space %lu not complete in\n" "InnoDB: the replay phase. Path %s\n", (ulint)type, space, (char*)(body + 2)); - ut_a(0); + ut_a(0); + } } #endif /* In normal mysqld crash recovery we do not try to -- cgit v1.2.1 From 0d770c43db695281fe24c1da18cb12216b30a542 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Jan 2004 13:10:57 +0200 Subject: srv0start.c: Add comment that the insert buffer format changed between 4.0 and 4.1.1, but the undo log format did not innobase/srv/srv0start.c: Add comment that the insert buffer format changed between 4.0 and 4.1.1, but the undo log format did not --- innobase/srv/srv0start.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'innobase') diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 5fe66f515bc..9dd270b6e15 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1603,6 +1603,19 @@ NetWare. */ fflush(stderr); if (trx_doublewrite_must_reset_space_ids) { + /* Actually, we did not change the undo log format between + 4.0 and 4.1.1, and we would not need to run purge to + completion. Note also that the purge algorithm in 4.1.1 + can process the the history list again even after a full + purge, because our algorithm does not cut the end of the + history list in all cases so that it would become empty + after a full purge. That mean that we may purge 4.0 type + undo log even after this phase. + + The insert buffer record format changed between 4.0 and + 4.1.1. It is essential that the insert buffer is emptied + here! */ + fprintf(stderr, "InnoDB: You are upgrading to an InnoDB version which allows multiple\n" "InnoDB: tablespaces. Wait that purge and insert buffer merge run to\n" -- cgit v1.2.1 From 079b4819a4a08cdf4e54eac802037efeb1e7f772 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Jan 2004 20:03:06 +0200 Subject: srv0start.c: More instructions about a downgrade 4.1.1 -> 4.0.18 innobase/srv/srv0start.c: More instructions about a downgrade 4.1.1 -> 4.0.18 --- innobase/srv/srv0start.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'innobase') diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index 9dd270b6e15..d7a14b8a9ec 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1638,8 +1638,9 @@ NetWare. */ fprintf(stderr, "InnoDB: You have now successfully upgraded to the multiple tablespaces\n" -"InnoDB: format. You should not downgrade again to an earlier version of\n" -"InnoDB: InnoDB!\n"); +"InnoDB: format. You should NOT DOWNGRADE again to an earlier version of\n" +"InnoDB: InnoDB! But if you absolutely need to downgrade, see section 4.6 of\n" +"InnoDB: http://www.innodb.com/ibman.php for instructions.\n"); } if (srv_force_recovery == 0) { -- cgit v1.2.1 From b321b7c00d5f41c47e652e0ae56489730309ee57 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 8 Jan 2004 18:56:21 +0200 Subject: row0mysql.c: Fix typo innobase/row/row0mysql.c: Fix typo --- innobase/row/row0mysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'innobase') diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index d5472219d09..cf7a3efcdfc 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -1447,7 +1447,7 @@ row_create_table_for_mysql( fprintf(stderr, " InnoDB: Error: table %s already exists in InnoDB internal\n" "InnoDB: data dictionary. Have you deleted the .frm file\n" - "InnoDB: and not used DROPT ABLE? Have you used DROP DATABASE\n" + "InnoDB: and not used DROP TABLE? Have you used DROP DATABASE\n" "InnoDB: for InnoDB tables in MySQL version <= 3.23.43?\n" "InnoDB: See the Restrictions section of the InnoDB manual.\n", table->name); -- cgit v1.2.1 From ea854327159c22dc811c9b64131918c694f49ae6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Jan 2004 04:05:38 +0200 Subject: row0sel.c: If MySQL tries to do SELECT from an InnoDB table, but has set no table locks at all in ::external_lock(), print a descriptive error message and assert; some subquery bugs were of this type innobase/row/row0sel.c: If MySQL tries to do SELECT from an InnoDB table, but has set no table locks at all in ::external_lock(), print a descriptive error message and assert; some subquery bugs were of this type --- innobase/row/row0sel.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'innobase') diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 2215e3feff8..a13aaa47af2 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2758,6 +2758,7 @@ row_search_for_mysql( ulint cnt = 0; ulint next_offs; mtr_t mtr; + char err_buf[1000]; ut_ad(index && pcur && search_tuple); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); @@ -2773,6 +2774,17 @@ row_search_for_mysql( ut_a(0); } + if (trx->n_mysql_tables_in_use == 0) { + + trx_print(err_buf, trx); + + fprintf(stderr, +"InnoDB: Error: MySQL is trying to perform a SELECT\n" +"InnoDB: but it has not locked any tables in ::external_lock()!\n%s\n", + err_buf); + ut_a(0); + } + /* printf("Match mode %lu\n search tuple ", match_mode); dtuple_print(search_tuple); @@ -3072,6 +3084,16 @@ shortcut_fails_too_big_rec: if (!prebuilt->sql_stat_start) { /* No need to set an intention lock or assign a read view */ + if (trx->read_view == NULL + && prebuilt->select_lock_type == LOCK_NONE) { + trx_print(err_buf, trx); + + fprintf(stderr, +"InnoDB: Error: MySQL is trying to perform a consistent read\n" +"InnoDB: but the read view is not assigned!\n%s\n", err_buf); + + ut_a(0); + } } else if (prebuilt->select_lock_type == LOCK_NONE) { /* This is a consistent read */ /* Assign a read view for the query */ -- cgit v1.2.1 From 79a4b2cd49b87da5dd327cd04242deda7188205f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Jan 2004 04:10:20 +0200 Subject: row0sel.c: Improve previous push: save 1000 bytes of thread stack in non-error cases innobase/row/row0sel.c: Improve previous push: save 1000 bytes of thread stack in non-error cases --- innobase/row/row0sel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'innobase') diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index a13aaa47af2..5a5da3ba59a 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2758,7 +2758,6 @@ row_search_for_mysql( ulint cnt = 0; ulint next_offs; mtr_t mtr; - char err_buf[1000]; ut_ad(index && pcur && search_tuple); ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); @@ -2775,7 +2774,8 @@ row_search_for_mysql( } if (trx->n_mysql_tables_in_use == 0) { - + char err_buf[1000]; + trx_print(err_buf, trx); fprintf(stderr, @@ -3086,6 +3086,8 @@ shortcut_fails_too_big_rec: if (trx->read_view == NULL && prebuilt->select_lock_type == LOCK_NONE) { + char err_buf[1000]; + trx_print(err_buf, trx); fprintf(stderr, -- cgit v1.2.1 From 9dfada0cba36d75fc3dc49cecefc8c3f9b5114d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 Jan 2004 17:13:03 +0200 Subject: srv0start.c, srv0srv.c: If UNIV_SYNC_DEBUG was switched on, the error monitor thread could reserve a mutex BEFORE the sync debug system was initialized, and that caused a sync debug assertion in startup: move the 2 sec. sleep to a safer place; note that this is only heuristics, and in theory it can assert still innobase/srv/srv0srv.c: If UNIV_SYNC_DEBUG was switched on, the error monitor thread could reserve a mutex BEFORE the sync debug system was initialized, and that caused a sync debug assertion in startup: move the 2 sec. sleep to a safer place; note that this is only heuristics, and in theory it can assert still innobase/srv/srv0start.c: If UNIV_SYNC_DEBUG was switched on, the error monitor thread could reserve a mutex BEFORE the sync debug system was initialized, and that caused a sync debug assertion in startup: move the 2 sec. sleep to a safer place; note that this is only heuristics, and in theory it can assert still --- innobase/srv/srv0srv.c | 4 ++-- innobase/srv/srv0start.c | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'innobase') diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index 027d7c8fb6e..d2368c5341f 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -2739,8 +2739,6 @@ loop: cnt++; - os_thread_sleep(2000000); - /* Try to track a strange bug reported by Harald Fuchs and others, where the lsn seems to decrease at times */ @@ -2782,6 +2780,8 @@ loop: fflush(stderr); fflush(stdout); + os_thread_sleep(2000000); + if (srv_shutdown_state < SRV_SHUTDOWN_LAST_PHASE) { goto loop; diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c index d7a14b8a9ec..e6fdc95fad0 100644 --- a/innobase/srv/srv0start.c +++ b/innobase/srv/srv0start.c @@ -1512,12 +1512,13 @@ NetWare. */ srv_is_being_started = FALSE; #ifdef UNIV_DEBUG - /* Wait a while so that creates threads have time to suspend themselves - before we switch sync debugging on; otherwise a thread may execute - mutex_enter() before the checks are on, and mutex_exit() after the - checks are on. */ + /* Wait a while so that the created threads have time to suspend + themselves before we switch sync debugging on; otherwise a thread may + execute mutex_enter() before the checks are on, and mutex_exit() after + the checks are on, which will cause an assertion failure in sync + debug. */ - os_thread_sleep(2000000); + os_thread_sleep(3000000); #endif sync_order_checks_on = TRUE; -- cgit v1.2.1 From 4e6744a45fd95a5ca86b183277fe0684b0c9d795 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 20 Jan 2004 17:35:51 +0200 Subject: row0sel.c: Remove extra mtr_start() innobase/row/row0sel.c: Remove extra mtr_start() --- innobase/row/row0sel.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'innobase') diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c index 5a5da3ba59a..57de309c090 100644 --- a/innobase/row/row0sel.c +++ b/innobase/row/row0sel.c @@ -2903,8 +2903,6 @@ row_search_for_mysql( mtr_start(&mtr); - mtr_start(&mtr); - /*-------------------------------------------------------------*/ /* PHASE 2: Try fast adaptive hash index search if possible */ -- cgit v1.2.1 From 86351fe428dae9686aa784f615b5c14ab786f572 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Jan 2004 15:08:22 +0200 Subject: ibuf0ibuf.c: Correct the comment about the ibuf record format in >= 4.1.1 innobase/ibuf/ibuf0ibuf.c: Correct the comment about the ibuf record format in >= 4.1.1 --- innobase/ibuf/ibuf0ibuf.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'innobase') diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c index b4a28d5fcd8..805f08af361 100644 --- a/innobase/ibuf/ibuf0ibuf.c +++ b/innobase/ibuf/ibuf0ibuf.c @@ -48,9 +48,12 @@ insert buffer tree, and that is in the system tablespace of InnoDB. 1. The first field is the space id. 2. The second field is a one-byte marker which differentiates records from the < 4.1.x storage format. -3. The third field contains the type info, where we have also added 2 bytes to - store the charset. -4. The rest of the fields contain the fields of the actual index record. +3. The third field is the page number. +4. The fourth field contains the type info, where we have also added 2 bytes to + store the charset. In the compressed table format of 5.0.x we must add more + information here so that we can build a dummy 'index' struct which 5.0.x + can use in the binary search on the index page in the ibuf merge phase. +5. The rest of the fields contain the fields of the actual index record. */ -- cgit v1.2.1