Below is the list of changes that have just been committed into a local
5.1 repository of cmiller. When cmiller does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-30 18:26:44-04:00, cmiller@stripped +22 -0
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.1
into zippy.cornsilk.net:/home/cmiller/work/mysql/merge/mysql-5.1-new-maint
MERGE: 1.2280.1.7
client/mysqltest.c@stripped, 2006-08-30 18:24:16-04:00, cmiller@stripped +0 -1
Auto merged
MERGE: 1.221.1.1
include/config-netware.h@stripped, 2006-08-30 18:24:16-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.16.1.1
mysql-test/r/func_time.result@stripped, 2006-08-30 18:24:16-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.68.1.3
mysql-test/t/func_time.test@stripped, 2006-08-30 18:24:16-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.54.1.3
sql/ha_innodb.cc@stripped, 2006-08-30 18:24:17-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.284.1.3
sql/item_timefunc.cc@stripped, 2006-08-30 18:24:17-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.129.1.3
sql/sql_acl.cc@stripped, 2006-08-30 18:24:17-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.204.1.4
storage/innobase/btr/btr0btr.c@stripped, 2006-08-30 18:25:54-04:00, cmiller@stripped +0 -1
Pulling from global tree.
MERGE: 1.44.1.1
storage/innobase/buf/buf0buf.c@stripped, 2006-08-30 18:26:34-04:00, cmiller@stripped +0 -3
Pulling from global tree.
MERGE: 1.53.1.1
storage/innobase/dict/dict0dict.c@stripped, 2006-08-30 18:26:35-04:00, cmiller@stripped +0 -4
Pulling from global tree.
MERGE: 1.83.1.1
storage/innobase/fil/fil0fil.c@stripped, 2006-08-30 18:26:36-04:00, cmiller@stripped +7 -13
Pulling from global tree.
MERGE: 1.65.1.1
storage/innobase/fsp/fsp0fsp.c@stripped, 2006-08-30 18:26:36-04:00, cmiller@stripped +0 -1
Pulling from global tree.
MERGE: 1.28.1.1
storage/innobase/include/btr0cur.ic@stripped, 2006-08-30 18:24:17-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.6.1.1
storage/innobase/include/buf0buf.ic@stripped, 2006-08-30 18:26:37-04:00, cmiller@stripped +0 -3
Pulling from global tree.
MERGE: 1.20.1.1
storage/innobase/log/log0log.c@stripped, 2006-08-30 18:26:37-04:00, cmiller@stripped +0 -1
Pulling from global tree.
MERGE: 1.47.1.1
storage/innobase/log/log0recv.c@stripped, 2006-08-30 18:26:38-04:00, cmiller@stripped +0 -2
Pulling from global tree.
MERGE: 1.55.1.1
storage/innobase/os/os0file.c@stripped, 2006-08-30 18:26:39-04:00, cmiller@stripped +0 -6
Pulling from global tree.
MERGE: 1.116.1.1
storage/innobase/row/row0mysql.c@stripped, 2006-08-30 18:26:39-04:00, cmiller@stripped +101 -19
Pulling from global tree.
MERGE: 1.128.1.1
storage/innobase/row/row0sel.c@stripped, 2006-08-30 18:26:40-04:00, cmiller@stripped +0 -1
Pulling from global tree.
MERGE: 1.106.1.1
storage/innobase/srv/srv0start.c@stripped, 2006-08-30 18:26:40-04:00, cmiller@stripped +0 -1
Pulling from global tree.
MERGE: 1.93.1.1
storage/innobase/ut/ut0dbg.c@stripped, 2006-08-30 18:26:41-04:00, cmiller@stripped +1 -2
Pulling from global tree.
MERGE: 1.11.1.1
tests/mysql_client_test.c@stripped, 2006-08-30 18:24:18-04:00, cmiller@stripped +0 -0
Auto merged
MERGE: 1.204.1.2
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: cmiller
# Host: zippy.cornsilk.net
# Root: /home/cmiller/work/mysql/merge/mysql-5.1-new-maint/RESYNC
--- 1.46/storage/innobase/btr/btr0btr.c 2006-08-30 18:26:53 -04:00
+++ 1.47/storage/innobase/btr/btr0btr.c 2006-08-30 18:26:53 -04:00
@@ -624,7 +624,7 @@
fputs(
"InnoDB: You should dump + drop + reimport the table to fix the\n"
"InnoDB: corruption. If the crash happens at the database startup, see\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html about\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html about\n"
"InnoDB: forcing recovery. Then dump + drop + reimport.\n", stderr);
}
--- 1.55/storage/innobase/buf/buf0buf.c 2006-08-30 18:26:53 -04:00
+++ 1.56/storage/innobase/buf/buf0buf.c 2006-08-30 18:26:53 -04:00
@@ -323,8 +323,7 @@
"InnoDB: is in the future! Current system log sequence number %lu %lu.\n"
"InnoDB: Your database may be corrupt or you may have copied the InnoDB\n"
"InnoDB: tablespace but not the InnoDB log files. See\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
-"InnoDB: for more information.\n",
+"http://dev.mysql.com/doc/mysql/en/backing-up.html for more information.\n",
(ulong) mach_read_from_4(read_buf + FIL_PAGE_OFFSET),
(ulong) ut_dulint_get_high(
mach_read_from_8(read_buf + FIL_PAGE_LSN)),
@@ -1924,7 +1923,7 @@
"InnoDB: the corrupt table. You can use CHECK\n"
"InnoDB: TABLE to scan your table for corruption.\n"
"InnoDB: See also "
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+ "http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
if (srv_force_recovery < SRV_FORCE_IGNORE_CORRUPT) {
--- 1.85/storage/innobase/dict/dict0dict.c 2006-08-30 18:26:53 -04:00
+++ 1.86/storage/innobase/dict/dict0dict.c 2006-08-30 18:26:53 -04:00
@@ -2215,8 +2215,8 @@
if (fk->foreign_index) {
fputs("The index in the foreign key in table is ", file);
ut_print_name(file, NULL, FALSE, fk->foreign_index->name);
- fputs("\n"
-"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n"
+ fputs(
+"\nSee http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
"for correct foreign key definition.\n",
file);
}
@@ -3119,7 +3119,7 @@
ut_print_name(ef, NULL, TRUE, name);
fprintf(ef, " where the columns appear\n"
"as the first columns. Constraint:\n%s\n"
-"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n"
+"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
"for correct foreign key definition.\n",
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
@@ -3387,7 +3387,7 @@
"Note that the internal storage type of ENUM and SET changed in\n"
"tables created with >= InnoDB-4.1.12, and such columns in old tables\n"
"cannot be referenced by such columns in new tables.\n"
-"See http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html\n"
+"See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
"for correct foreign key definition.\n",
start_of_latest_foreign);
mutex_exit(&dict_foreign_err_mutex);
@@ -3941,7 +3941,8 @@
fprintf(stderr,
" InnoDB: cannot calculate statistics for table %s\n"
"InnoDB: because the .ibd file is missing. For help, please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n",
+"InnoDB: "
+"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n",
table->name);
return;
--- 1.67/storage/innobase/fil/fil0fil.c 2006-08-30 18:26:53 -04:00
+++ 1.68/storage/innobase/fil/fil0fil.c 2006-08-30 18:26:53 -04:00
@@ -251,6 +251,9 @@
initialized. */
fil_system_t* fil_system = NULL;
+/* The tablespace memory cache hash table size */
+#define FIL_SYSTEM_HASH_SIZE 50 /* TODO: make bigger! */
+
/************************************************************************
NOTE: you must call fil_mutex_enter_and_prepare_for_io() first!
@@ -1320,17 +1323,11 @@
/*=====*/
ulint max_n_open) /* in: max number of open files */
{
- ulint hash_size;
-
ut_a(fil_system == NULL);
- if (srv_file_per_table) {
- hash_size = 50000;
- } else {
- hash_size = 5000;
- }
-
- fil_system = fil_system_create(hash_size, max_n_open);
+ /*printf("Initializing the tablespace cache with max %lu open files\n",
+ max_n_open); */
+ fil_system = fil_system_create(FIL_SYSTEM_HASH_SIZE, max_n_open);
}
/***********************************************************************
@@ -2563,7 +2560,7 @@
ut_print_timestamp(stderr);
fprintf(stderr,
-" InnoDB: Flush lsn in the tablespace file %lu to be imported\n"
+" InnoDB: Flush lsn in the tablespace file %lu to be imported\n"
"InnoDB: is %lu %lu, which exceeds current system lsn %lu %lu.\n"
"InnoDB: We reset the lsn's in the file ",
(ulong) space_id,
@@ -2688,7 +2685,8 @@
"InnoDB: It is also possible that this is a temporary table #sql...,\n"
"InnoDB: and MySQL removed the .ibd file for this.\n"
"InnoDB: Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"InnoDB:"
+" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: for how to resolve the issue.\n", stderr);
mem_free(filepath);
@@ -2727,7 +2725,8 @@
"InnoDB: Have you moved InnoDB .ibd files around without using the\n"
"InnoDB: commands DISCARD TABLESPACE and IMPORT TABLESPACE?\n"
"InnoDB: Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"InnoDB:"
+" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: for how to resolve the issue.\n", (ulong) space_id, (ulong) id);
ret = FALSE;
@@ -3374,7 +3373,8 @@
error_exit:
fputs(
"InnoDB: Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"InnoDB:"
+" http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: for how to resolve the issue.\n", stderr);
mem_free(path);
--- 1.30/storage/innobase/fsp/fsp0fsp.c 2006-08-30 18:26:53 -04:00
+++ 1.31/storage/innobase/fsp/fsp0fsp.c 2006-08-30 18:26:53 -04:00
@@ -2988,7 +2988,7 @@
crash:
fputs(
"InnoDB: Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
ut_error;
}
--- 1.8/storage/innobase/include/btr0cur.ic 2006-08-30 18:26:53 -04:00
+++ 1.9/storage/innobase/include/btr0cur.ic 2006-08-30 18:26:53 -04:00
@@ -52,7 +52,10 @@
/* out: pointer to page */
btr_cur_t* cursor) /* in: tree cursor */
{
- return(buf_frame_align(page_cur_get_rec(&(cursor->page_cur))));
+ page_t* page = buf_frame_align(page_cur_get_rec(&(cursor->page_cur)));
+ ut_ad(!!page_is_comp(page)
+ == dict_table_is_comp(cursor->index->table));
+ return(page);
}
/*************************************************************
--- 1.22/storage/innobase/include/buf0buf.ic 2006-08-30 18:26:53 -04:00
+++ 1.23/storage/innobase/include/buf0buf.ic 2006-08-30 18:26:53 -04:00
@@ -216,8 +216,8 @@
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
-"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
+"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
ptr, frame_zero,
buf_pool->high_end);
@@ -252,8 +252,8 @@
"InnoDB: Error: trying to access a stray pointer %p\n"
"InnoDB: buf pool start is at %p, end at %p\n"
"InnoDB: Probable reason is database corruption or memory\n"
-"InnoDB: corruption. If this happens in an InnoDB database recovery, see\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+"InnoDB: corruption. If this happens in an InnoDB database recovery,\n"
+"InnoDB: you can look from section 6.1 at http://www.innodb.com/ibman.html\n"
"InnoDB: how to force recovery.\n",
ptr, buf_pool->frame_zero,
buf_pool->high_end);
--- 1.49/storage/innobase/log/log0log.c 2006-08-30 18:26:53 -04:00
+++ 1.50/storage/innobase/log/log0log.c 2006-08-30 18:26:53 -04:00
@@ -720,7 +720,7 @@
"InnoDB: To get mysqld to start up, set innodb_thread_concurrency in my.cnf\n"
"InnoDB: to a lower value, for example, to 8. After an ERROR-FREE shutdown\n"
"InnoDB: of mysqld you can adjust the size of ib_logfiles, as explained in\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/adding-and-removing.html\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Adding_and_removing.html\n"
"InnoDB: Cannot continue operation. Calling exit(1).\n",
(ulong)srv_thread_concurrency);
--- 1.57/storage/innobase/log/log0recv.c 2006-08-30 18:26:53 -04:00
+++ 1.58/storage/innobase/log/log0recv.c 2006-08-30 18:26:53 -04:00
@@ -542,7 +542,7 @@
"InnoDB: the problem may be that during an earlier attempt you managed\n"
"InnoDB: to create the InnoDB data files, but log file creation failed.\n"
"InnoDB: If that is the case, please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html\n");
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Error_creating_InnoDB.html\n");
return(DB_ERROR);
}
@@ -1962,7 +1962,7 @@
"InnoDB: far enough in recovery! Please run CHECK TABLE\n"
"InnoDB: on your InnoDB tables to check that they are ok!\n"
"InnoDB: If mysqld crashes after this recovery, look at\n"
- "InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
fflush(stderr);
--- 1.118/storage/innobase/os/os0file.c 2006-08-30 18:26:53 -04:00
+++ 1.119/storage/innobase/os/os0file.c 2006-08-30 18:26:53 -04:00
@@ -248,7 +248,7 @@
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
- "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n");
+ "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
}
}
@@ -295,7 +295,7 @@
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
- "http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n");
+ "http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
}
}
@@ -688,7 +688,7 @@
/* TODO: test Windows symlinks */
/* TODO: MySQL has apparently its own symlink implementation in Windows,
dbname.sym can redirect a database directory:
-http://dev.mysql.com/doc/refman/5.1/en/windows-symbolic-links.html */
+http://www.mysql.com/doc/en/Windows_symbolic_links.html */
info->type = OS_FILE_TYPE_LINK;
} else if (lpFindFileData->dwFileAttributes
& FILE_ATTRIBUTE_DIRECTORY) {
@@ -2343,7 +2343,7 @@
"InnoDB: offset %lu %lu. Operating system error number %lu.\n"
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n",
+"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n",
name, (ulong) offset_high, (ulong) offset,
(ulong) GetLastError());
@@ -2408,7 +2408,7 @@
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n");
+"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
os_has_said_disk_full = TRUE;
}
@@ -2444,7 +2444,7 @@
fprintf(stderr,
"InnoDB: Some operating system error numbers are described at\n"
"InnoDB: "
-"http://dev.mysql.com/doc/refman/5.1/en/operating-system-error-codes.html\n");
+"http://dev.mysql.com/doc/mysql/en/Operating_System_error_codes.html\n");
os_has_said_disk_full = TRUE;
}
--- 1.130/storage/innobase/row/row0mysql.c 2006-08-30 18:26:53 -04:00
+++ 1.131/storage/innobase/row/row0mysql.c 2006-08-30 18:26:53 -04:00
@@ -54,6 +54,27 @@
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
@@ -529,7 +550,7 @@
"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/refman/5.1/en/forcing-recovery.html"
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html"
" for help.\n", stderr);
} else {
@@ -1062,7 +1083,7 @@
"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"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1298,7 +1319,7 @@
"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"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
@@ -1639,6 +1660,48 @@
}
/*************************************************************************
+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. */
@@ -1782,6 +1845,18 @@
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
@@ -1893,8 +1968,8 @@
"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/refman/5.1/en/innodb-troubleshooting.html\n",
- stderr);
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/"
+ "InnoDB_troubleshooting_datadict.html\n", stderr);
}
/* We may also get err == DB_ERROR if the .ibd file for the
@@ -1988,6 +2063,11 @@
}
}
+ if (row_mysql_is_recovered_tmp_table(index->table_name)) {
+
+ return(DB_SUCCESS);
+ }
+
heap = mem_heap_create(512);
trx->dict_operation = TRUE;
@@ -2062,6 +2142,11 @@
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,
@@ -2969,8 +3054,8 @@
"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/refman/5.1/en/innodb-troubleshooting.html\n",
- stderr);
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/"
+ "InnoDB_troubleshooting_datadict.html\n", stderr);
goto funct_exit;
}
@@ -3410,6 +3495,7 @@
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;
@@ -3447,10 +3533,15 @@
old_is_tmp = row_is_mysql_tmp_table_name(old_name);
new_is_tmp = row_is_mysql_tmp_table_name(new_name);
- /* Serialize data dictionary operations with dictionary mutex:
- no deadlocks can occur then in these operations */
+ if (row_mysql_is_recovered_tmp_table(new_name)) {
- row_mysql_lock_data_dictionary(trx);
+ recovering_temp_table = TRUE;
+ } else {
+ /* Serialize data dictionary operations with dictionary mutex:
+ no deadlocks can occur then in these operations */
+
+ row_mysql_lock_data_dictionary(trx);
+ }
table = dict_table_get_low(old_name);
@@ -3465,8 +3556,8 @@
"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/refman/5.1/en/innodb-troubleshooting.html\n",
- stderr);
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/"
+ "InnoDB_troubleshooting_datadict.html\n", stderr);
goto funct_exit;
}
@@ -3479,8 +3570,8 @@
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/refman/5.1/en/innodb-troubleshooting.html\n",
- stderr);
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/"
+ "InnoDB_troubleshooting_datadict.html\n", stderr);
goto funct_exit;
}
@@ -3628,7 +3719,8 @@
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/refman/5.1/en/innodb-troubleshooting.html\n"
+ "InnoDB: http://dev.mysql.com/doc/mysql/en/"
+ "InnoDB_troubleshooting_datadict.html\n"
"InnoDB: If table ", stderr);
ut_print_name(stderr, trx, TRUE, new_name);
fputs(
@@ -3656,8 +3748,8 @@
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);
@@ -3705,7 +3797,10 @@
funct_exit:
trx_commit_for_mysql(trx);
- row_mysql_unlock_data_dictionary(trx);
+
+ if (!recovering_temp_table) {
+ row_mysql_unlock_data_dictionary(trx);
+ }
if (UNIV_LIKELY_NULL(heap)) {
mem_heap_free(heap);
@@ -3873,7 +3968,7 @@
"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"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
return(DB_ERROR);
--- 1.108/storage/innobase/row/row0sel.c 2006-08-30 18:26:53 -04:00
+++ 1.109/storage/innobase/row/row0sel.c 2006-08-30 18:26:53 -04:00
@@ -3245,7 +3245,7 @@
"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"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/innodb-troubleshooting.html\n"
+"http://dev.mysql.com/doc/mysql/en/InnoDB_troubleshooting_datadict.html\n"
"InnoDB: how you can resolve the problem.\n",
prebuilt->table->name);
--- 1.95/storage/innobase/srv/srv0start.c 2006-08-30 18:26:53 -04:00
+++ 1.96/storage/innobase/srv/srv0start.c 2006-08-30 18:26:53 -04:00
@@ -1691,7 +1691,7 @@
"InnoDB: You have now successfully upgraded to the multiple tablespaces\n"
"InnoDB: format. You should NOT DOWNGRADE to an earlier version of\n"
"InnoDB: InnoDB! But if you absolutely need to downgrade, see\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/multiple-tablespaces.html\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Multiple_tablespaces.html\n"
"InnoDB: for instructions.\n");
}
--- 1.13/storage/innobase/ut/ut0dbg.c 2006-08-30 18:26:53 -04:00
+++ 1.14/storage/innobase/ut/ut0dbg.c 2006-08-30 18:26:53 -04:00
@@ -42,7 +42,7 @@
{
ut_print_timestamp(stderr);
fprintf(stderr,
- " InnoDB: Assertion failure in thread %lu"
+ "InnoDB: Assertion failure in thread %lu"
" in file %s line %lu\n",
os_thread_pf(os_thread_get_curr_id()), file, line);
if (expr) {
@@ -56,7 +56,7 @@
"InnoDB: If you get repeated assertion failures or crashes, even\n"
"InnoDB: immediately after the mysqld startup, there may be\n"
"InnoDB: corruption in the InnoDB tablespace. Please refer to\n"
-"InnoDB: http://dev.mysql.com/doc/refman/5.1/en/forcing-recovery.html\n"
+"InnoDB: http://dev.mysql.com/doc/mysql/en/Forcing_recovery.html\n"
"InnoDB: about forcing recovery.\n", stderr);
#if defined(UNIV_SYNC_DEBUG) || !defined(UT_DBG_USE_ABORT)
ut_dbg_stop_threads = TRUE;
| Thread |
|---|
| • bk commit into 5.1 tree (cmiller:1.2293) | Chad MILLER | 31 Aug |