summaryrefslogtreecommitdiff
path: root/storage/innobase/row
diff options
context:
space:
mode:
authorunknown <tsmith@production.mysql.com>2006-08-15 01:42:57 +0200
committerunknown <tsmith@production.mysql.com>2006-08-15 01:42:57 +0200
commit2606cb9321d7d3179506587043a2a24782ee802e (patch)
treee3a22812444c7f852aa9dba5f4a480fe0b337888 /storage/innobase/row
parent2f48a59124c776c36ea6609f31543bf6c5f8ed86 (diff)
downloadmariadb-git-2606cb9321d7d3179506587043a2a24782ee802e.tar.gz
Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots.
All but ss677 are against the mysql-5.1 tree only. Fixes the following bugs: - Bug #19834: Using cursors when running in READ-COMMITTED can cause InnoDB to crash - Bug #20213: DBT2 testing cause mysqld to core using Innodb - Bug #20493: on partition tables, select and show command casue server crash - Bug #21113: Duplicate printout in SHOW INNODB STATUS - Bug #21313: rsql_..._recover_innodb_tmp_table is redundant and broken - Bug #21467: Manual URL wrong in InnoDB "page corrupted" error report mysql-test/r/innodb.result: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. innodb.result: Adjust Innodb_rows_inserted and Innodb_rows_updated to reflect the deleted statements in r420, which somehow reappeared in the MySQL tree. mysql-test/t/innodb.test: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. sql/ha_innodb.cc: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ha_innobase::start_stmt(): patch from Heikki: Do not call read_view_close_for_mysql(). (Bug #19834) Fix Bug#20213 and its duplicates: stress test crashes of InnoDB-5.1 Fix Bug #20493 : we must prepare prebuilt->trx to point to the trx of this thd before using it Add update_thd() to several places in ha_innodb.cc to make sure prebuilt->trx points to the right trx object; in other functions add assertions that prebuilt->trx is for this thd; when 5.1 stabilizes, we can change these assertions to ut_ad() debug version assertions Remove redundant check_trx_exists() and ut_a() from r701, as suggested by Marko Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/btr/btr0btr.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/buf/buf0buf.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/dict/dict0dict.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/fil/fil0fil.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Make the tablespace cache hash size 100 or 1000 times bigger. Fixes bug #21112. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/fsp/fsp0fsp.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/ibuf/ibuf0ibuf.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ibuf_print(): Don't print redundant information. Fixes bug #21113. Remove non-varying variable ibuf->meter and related constant IBUF_THRESHOLD. storage/innobase/include/btr0cur.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. btr_cur_get_page(): Remove buggy assertion. storage/innobase/include/buf0buf.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/include/ibuf0ibuf.ic: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Remove non-varying variable ibuf->meter and related constant IBUF_THRESHOLD. storage/innobase/log/log0log.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/log/log0recv.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/os/os0file.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0mysql.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Remove the special treatment of tables rsql_IDENTIFIER_recover_innodb_tmp_table, which is redundant and was broken with the introduction of the "safe" file name encoding of identifiers. (Bug #21313) ChangeSet@1.2181.173.1 2006-08-02 17:57:06+02:00 ingo@local Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Changed back the encoded temp file prefix to #sql. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0sel.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/row/row0vers.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. row_vers_build_for_semi_consistent_read(): rec_trx_id was uninitialized in a comparison. Initialize it. storage/innobase/srv/srv0start.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/ut/ut0dbg.c: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only. ut_dbg_assertion_failed(): Print space between timestamp and start of error message. After ut_print_timestamp(), always display " InnoDB:" (note two spaces). Correct all URLs pointing to the MySQL manual. (Bug #21467) storage/innobase/Makefile.am: Applied innodb-5.1-ss677, -ss680, -ss713, and -ss720 snapshots. All but ss677 are against the mysql-5.1 tree only.
Diffstat (limited to 'storage/innobase/row')
-rw-r--r--storage/innobase/row/row0mysql.c133
-rw-r--r--storage/innobase/row/row0sel.c2
-rw-r--r--storage/innobase/row/row0vers.c2
3 files changed, 21 insertions, 116 deletions
diff --git a/storage/innobase/row/row0mysql.c b/storage/innobase/row/row0mysql.c
index 5f4a882f4a8..f2d501e0ba7 100644
--- a/storage/innobase/row/row0mysql.c
+++ b/storage/innobase/row/row0mysql.c
@@ -54,27 +54,6 @@ static const char S_innodb_tablespace_monitor[] = "innodb_tablespace_monitor";
static const char S_innodb_table_monitor[] = "innodb_table_monitor";
static const char S_innodb_mem_validate[] = "innodb_mem_validate";
-/* Name suffix for recovered orphaned temporary tables */
-static const char S_recover_innodb_tmp_table[] = "_recover_innodb_tmp_table";
-/***********************************************************************
-Determine if the given name ends in the suffix reserved for recovered
-orphaned temporary tables. */
-static
-ibool
-row_mysql_is_recovered_tmp_table(
-/*=============================*/
- /* out: TRUE if table name ends in
- the reserved suffix */
- const char* name)
-{
- ulint namelen = strlen(name) + 1;
- return(namelen >= sizeof S_recover_innodb_tmp_table
- && !memcmp(name + namelen -
- sizeof S_recover_innodb_tmp_table,
- S_recover_innodb_tmp_table,
- sizeof S_recover_innodb_tmp_table));
-}
-
/***********************************************************************
Determine if the given name is a name reserved for MySQL system tables. */
static
@@ -550,7 +529,7 @@ handle_new_error:
"InnoDB: tables and recreate the whole InnoDB tablespace.\n"
"InnoDB: If the mysqld server crashes after the startup or when\n"
"InnoDB: you dump the tables, look at\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html"
+ "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html"
" for help.\n", stderr);
} else {
@@ -1083,7 +1062,7 @@ row_insert_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1319,7 +1298,7 @@ row_update_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1660,48 +1639,6 @@ row_get_mysql_key_number_for_index(
}
/*************************************************************************
-Recovers an orphaned tmp table inside InnoDB by renaming it. In the table
-name #sql becomes rsql, and "_recover_innodb_tmp_table" is catenated to
-the end of name. table->name should be of the form
-"dbname/rsql..._recover_innodb_tmp_table". This renames a table whose
-name is "#sql..." */
-static
-int
-row_mysql_recover_tmp_table(
-/*========================*/
- /* out: error code or DB_SUCCESS */
- dict_table_t* table, /* in: table definition */
- trx_t* trx) /* in: transaction handle */
-{
- const char* ptr = strstr(table->name, "/rsql");
-
- if (!ptr) {
- /* table name does not begin with "/rsql" */
- dict_mem_table_free(table);
- trx_commit_for_mysql(trx);
-
- return(DB_ERROR);
- }
- else {
- int status;
- int namelen = (int) strlen(table->name);
- char* old_name = mem_strdupl(table->name, namelen);
- /* replace "rsql" with "#sql" */
- old_name[ptr - table->name + 1] = '#';
- /* remove "_recover_innodb_tmp_table" suffix */
- ut_ad(namelen > (int) sizeof S_recover_innodb_tmp_table);
- ut_ad(!strcmp(old_name + namelen + 1 -
- sizeof S_recover_innodb_tmp_table,
- S_recover_innodb_tmp_table));
- old_name[namelen + 1 - sizeof S_recover_innodb_tmp_table] = 0;
- status = row_rename_table_for_mysql(old_name,
- table->name, trx);
- mem_free(old_name);
- return(status);
- }
-}
-
-/*************************************************************************
Locks the data dictionary in shared mode from modifications, for performing
foreign key check, rollback, or other operation invisible to MySQL. */
@@ -1845,18 +1782,6 @@ row_create_table_for_mysql(
trx_start_if_not_started(trx);
- if (row_mysql_is_recovered_tmp_table(table->name)) {
-
- /* MySQL prevents accessing of tables whose name begins
- with #sql, that is temporary tables. If mysqld crashes in
- the middle of an ALTER TABLE, we may get an orphaned
- #sql-table in the tablespace. We have here a special
- mechanism to recover such tables by renaming them to
- rsql... */
-
- return(row_mysql_recover_tmp_table(table, trx));
- }
-
/* The table name is prefixed with the database name and a '/'.
Certain table names starting with 'innodb_' have their special
meaning regardless of the database name. Thus, we need to
@@ -1968,8 +1893,8 @@ row_create_table_for_mysql(
"InnoDB: Then MySQL thinks the table exists, and DROP TABLE will\n"
"InnoDB: succeed.\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n",
+ stderr);
}
/* We may also get err == DB_ERROR if the .ibd file for the
@@ -2063,11 +1988,6 @@ row_create_index_for_mysql(
}
}
- if (row_mysql_is_recovered_tmp_table(index->table_name)) {
-
- return(DB_SUCCESS);
- }
-
heap = mem_heap_create(512);
trx->dict_operation = TRUE;
@@ -2142,11 +2062,6 @@ row_table_add_foreign_constraints(
trx_start_if_not_started(trx);
- if (row_mysql_is_recovered_tmp_table(name)) {
-
- return(DB_SUCCESS);
- }
-
trx->dict_operation = TRUE;
err = dict_create_foreign_constraints(trx, sql_string, name,
@@ -3054,8 +2969,8 @@ row_drop_table_for_mysql(
"InnoDB: Have you copied the .frm file of the table to the\n"
"InnoDB: MySQL database directory from another database?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3495,7 +3410,6 @@ row_rename_table_for_mysql(
mem_heap_t* heap = NULL;
const char** constraints_to_drop = NULL;
ulint n_constraints_to_drop = 0;
- ibool recovering_temp_table = FALSE;
ibool old_is_tmp, new_is_tmp;
pars_info_t* info = NULL;
@@ -3533,15 +3447,10 @@ row_rename_table_for_mysql(
old_is_tmp = row_is_mysql_tmp_table_name(old_name);
new_is_tmp = row_is_mysql_tmp_table_name(new_name);
- if (row_mysql_is_recovered_tmp_table(new_name)) {
-
- recovering_temp_table = TRUE;
- } else {
- /* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
+ /* Serialize data dictionary operations with dictionary mutex:
+ no deadlocks can occur then in these operations */
- row_mysql_lock_data_dictionary(trx);
- }
+ row_mysql_lock_data_dictionary(trx);
table = dict_table_get_low(old_name);
@@ -3556,8 +3465,8 @@ row_rename_table_for_mysql(
"InnoDB: Have you copied the .frm file of the table to the\n"
"InnoDB: MySQL database directory from another database?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3570,8 +3479,8 @@ row_rename_table_for_mysql(
fputs(
" does not have an .ibd file in the database directory.\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n", stderr);
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n",
+ stderr);
goto funct_exit;
}
@@ -3719,8 +3628,7 @@ end:
fputs(" to it.\n"
"InnoDB: Have you deleted the .frm file and not used DROP TABLE?\n"
"InnoDB: You can look for further help from\n"
- "InnoDB: http://dev.mysql.com/doc/mysql/en/"
- "InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
"InnoDB: If table ", stderr);
ut_print_name(stderr, trx, TRUE, new_name);
fputs(
@@ -3748,8 +3656,8 @@ end:
trx_general_rollback_for_mysql(trx, FALSE, NULL);
trx->error_state = DB_SUCCESS;
ut_print_timestamp(stderr);
- fputs(" InnoDB: Error in table rename, cannot rename ",
- stderr);
+ fputs(
+" InnoDB: Error in table rename, cannot rename ", stderr);
ut_print_name(stderr, trx, TRUE, old_name);
fputs(" to ", stderr);
ut_print_name(stderr, trx, TRUE, new_name);
@@ -3797,10 +3705,7 @@ end:
funct_exit:
trx_commit_for_mysql(trx);
-
- if (!recovering_temp_table) {
- row_mysql_unlock_data_dictionary(trx);
- }
+ row_mysql_unlock_data_dictionary(trx);
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
@@ -3968,7 +3873,7 @@ row_check_table_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
diff --git a/storage/innobase/row/row0sel.c b/storage/innobase/row/row0sel.c
index f79bda5d6d8..251ee95886f 100644
--- a/storage/innobase/row/row0sel.c
+++ b/storage/innobase/row/row0sel.c
@@ -3245,7 +3245,7 @@ row_search_for_mysql(
"InnoDB: Have you deleted the .ibd file from the database directory under\n"
"InnoDB: the MySQL datadir, or have you used DISCARD TABLESPACE?\n"
"InnoDB: Look from\n"
-"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
+"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
diff --git a/storage/innobase/row/row0vers.c b/storage/innobase/row/row0vers.c
index ab3b6385146..07b75a34347 100644
--- a/storage/innobase/row/row0vers.c
+++ b/storage/innobase/row/row0vers.c
@@ -553,7 +553,7 @@ row_vers_build_for_semi_consistent_read(
mem_heap_t* heap = NULL;
byte* buf;
ulint err;
- dulint rec_trx_id;
+ dulint rec_trx_id = ut_dulint_create(0, 0);
ut_ad(index->type & DICT_CLUSTERED);
ut_ad(mtr_memo_contains(mtr, buf_block_align(rec), MTR_MEMO_PAGE_X_FIX)