summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-05-17 01:52:13 +0300
committerunknown <monty@mysql.com>2004-05-17 01:52:13 +0300
commita495f76c8eed91414d321cc7536d46d1bf7bcfee (patch)
treeb9fa88577b516df5fb27de3970ec9eab9aaef532 /innobase
parent8ef62cc1ef3e2b16795fa5fbbc45bcdf422f344c (diff)
parentfa163d0ba5f5fc22dbadbd66255879ceeb895c27 (diff)
downloadmariadb-git-a495f76c8eed91414d321cc7536d46d1bf7bcfee.tar.gz
Merge with 4.0.20
BitKeeper/etc/logging_ok: auto-union client/mysql.cc: Auto merged client/mysqltest.c: Auto merged innobase/btr/btr0btr.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/dict/dict0load.c: Auto merged innobase/eval/eval0eval.c: Auto merged innobase/ibuf/ibuf0ibuf.c: Auto merged innobase/include/ut0mem.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0sel.c: Auto merged innobase/row/row0umod.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/ut/ut0dbg.c: Auto merged innobase/ut/ut0mem.c: Auto merged myisam/mi_dynrec.c: Auto merged mysql-test/r/innodb.result: Auto merged mysql-test/t/fulltext.test: Auto merged mysql-test/t/rpl_rotate_logs.test: Auto merged scripts/make_binary_distribution.sh: Auto merged sql/ha_innodb.cc: Auto merged sql/item_func.cc: Auto merged sql/slave.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_show.cc: Auto merged innobase/os/os0file.c: Merge with 4.0.20 Ensure that we call F_UNLCK for files on which we call F_WRLCK. This is to ensure that this code will be portable accross most platforms. myisam/ft_boolean_search.c: Merge with 4.0.20 (keep original file) myisam/ft_parser.c: Merge with 4.0.20 (keep original file) myisam/ftdefs.h: Merge with 4.0.20 (keep original file)
Diffstat (limited to 'innobase')
-rw-r--r--innobase/btr/btr0btr.c2
-rw-r--r--innobase/dict/dict0dict.c2
-rw-r--r--innobase/dict/dict0load.c2
-rw-r--r--innobase/ibuf/ibuf0ibuf.c7
-rw-r--r--innobase/include/trx0trx.h6
-rw-r--r--innobase/lock/lock0lock.c40
-rw-r--r--innobase/os/os0file.c20
-rw-r--r--innobase/row/row0ins.c3
-rw-r--r--innobase/row/row0mysql.c7
-rw-r--r--innobase/row/row0sel.c3
-rw-r--r--innobase/row/row0umod.c3
-rw-r--r--innobase/row/row0upd.c3
-rw-r--r--innobase/trx/trx0rec.c22
-rw-r--r--innobase/trx/trx0trx.c4
-rw-r--r--innobase/ut/ut0dbg.c2
15 files changed, 83 insertions, 43 deletions
diff --git a/innobase/btr/btr0btr.c b/innobase/btr/btr0btr.c
index 8388009dc9c..09f5c66f687 100644
--- a/innobase/btr/btr0btr.c
+++ b/innobase/btr/btr0btr.c
@@ -883,7 +883,7 @@ btr_page_reorganize_low(
fprintf(stderr,
"InnoDB: Error: page old data size %lu new data size %lu\n"
"InnoDB: Error: page old max ins size %lu new max ins size %lu\n"
-"InnoDB: Make a detailed bug report and send it to mysql@lists.mysql.com\n",
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
(unsigned long) data_size1, (unsigned long) data_size2,
(unsigned long) max_ins_size1,
(unsigned long) max_ins_size2);
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index b22d93d6bd8..c9e3ac5ec66 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -4287,5 +4287,5 @@ dict_index_name_print(
fputs("index ", file);
ut_print_name(file, index->name);
fputs(" of table ", file);
- ut_print_name(stderr, index->table_name);
+ ut_print_name(file, index->table_name);
}
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index abb06b15ea7..bf8b4582f63 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -849,7 +849,7 @@ dict_load_table(
"InnoDB: the foreign key table or the referenced table!\n"
"InnoDB: The data dictionary of InnoDB is corrupt. You may need to drop\n"
"InnoDB: and recreate the foreign key table or the referenced table.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: Latest foreign key error printout:\n%s\n", dict_foreign_err_buf);
mutex_exit(&dict_foreign_err_mutex);
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 7dc0bd98001..9246bb03138 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -2770,7 +2770,7 @@ ibuf_insert_to_index_page(
fprintf(stderr, "Bitmap bits %lu\n", (ulong) old_bits);
fputs(
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
}
}
@@ -2833,7 +2833,7 @@ ibuf_delete_rec(
if (!success) {
fprintf(stderr,
- "InnoDB: ERROR: Send the output to mysql@lists.mysql.com\n"
+ "InnoDB: ERROR: Submit the output to http://bugs.mysql.com\n"
"InnoDB: ibuf cursor restoration fails!\n"
"InnoDB: ibuf record inserted to page %lu\n", (ulong) page_no);
fflush(stderr);
@@ -3025,8 +3025,7 @@ ibuf_merge_or_delete_for_page(
"InnoDB: We try to resolve the problem by skipping the insert buffer\n"
"InnoDB: merge for this page. Please run CHECK TABLE on your tables\n"
"InnoDB: to determine if they are corrupt after this.\n\n"
-"InnoDB: Please make a detailed bug report and send it to\n"
-"InnoDB: mysql@lists.mysql.com\n\n",
+"InnoDB: Please submit a detailed bug report to http://bugs.mysql.com\n\n",
(ulong) page_no,
(ulong) fil_page_get_type(page));
}
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 71269cb1e4e..07d5e5a8215 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -275,13 +275,15 @@ trx_commit_step(
que_thr_t* thr); /* in: query thread */
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
-own the kernel mutex. */
+own the kernel mutex and must have called
+innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
+InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
/*======*/
FILE* f, /* in: output stream */
- trx_t* trx); /* in: transaction */
+ trx_t* trx); /* in: transaction */
/* Signal to a transaction */
diff --git a/innobase/lock/lock0lock.c b/innobase/lock/lock0lock.c
index 056d502e858..223d9af78d1 100644
--- a/innobase/lock/lock0lock.c
+++ b/innobase/lock/lock0lock.c
@@ -17,6 +17,32 @@ Created 5/7/1996 Heikki Tuuri
#include "dict0mem.h"
#include "trx0sys.h"
+
+/* 2 function prototypes copied from ha_innodb.cc: */
+
+/*****************************************************************
+If you want to print a thd that is not associated with the current thread,
+you must call this function before reserving the InnoDB kernel_mutex, to
+protect MySQL from setting thd->query NULL. If you print a thd of the current
+thread, we know that MySQL cannot modify thd->query, and it is not necessary
+to call this. Call innobase_mysql_end_print_arbitrary_thd() after you release
+the kernel_mutex.
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+
+void
+innobase_mysql_prepare_print_arbitrary_thd(void);
+/*============================================*/
+
+/*****************************************************************
+Relases the mutex reserved by innobase_mysql_prepare_print_arbitrary_thd().
+NOTE that /mysql/innobase/lock/lock0lock.c must contain the prototype for this
+function! */
+
+void
+innobase_mysql_end_print_arbitrary_thd(void);
+/*========================================*/
+
/* Restricts the length of search we will do in the waits-for
graph of transactions */
#define LOCK_MAX_N_STEPS_IN_DEADLOCK_CHECK 1000000
@@ -1629,7 +1655,8 @@ lock_rec_enqueue_waiting(
" InnoDB: Error: a record lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, index->table_name);
- fputs(". Send a bug report to mysql@lists.mysql.com\n",
+ fputs(".\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3269,7 +3296,8 @@ lock_table_enqueue_waiting(
" InnoDB: Error: a table lock wait happens in a dictionary operation!\n"
"InnoDB: Table name ", stderr);
ut_print_name(stderr, table->name);
- fputs(". Send a bug report to mysql@lists.mysql.com\n",
+ fputs(".\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n",
stderr);
}
@@ -3975,6 +4003,11 @@ lock_print_info(
ulint i;
mtr_t mtr;
+ /* We must protect the MySQL thd->query field with a MySQL mutex, and
+ because the MySQL mutex must be reserved before the kernel_mutex of
+ InnoDB, we call innobase_mysql_prepare_print_arbitrary_thd() here. */
+
+ innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
if (lock_deadlock_found) {
@@ -4038,6 +4071,7 @@ loop:
if (trx == NULL) {
lock_mutex_exit_kernel();
+ innobase_mysql_end_print_arbitrary_thd();
ut_ad(lock_validate());
@@ -4102,6 +4136,7 @@ loop:
if (load_page_first) {
lock_mutex_exit_kernel();
+ innobase_mysql_end_print_arbitrary_thd();
mtr_start(&mtr);
@@ -4111,6 +4146,7 @@ loop:
load_page_first = FALSE;
+ innobase_mysql_prepare_print_arbitrary_thd();
lock_mutex_enter_kernel();
goto loop;
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c
index 79185c30f79..1a158372563 100644
--- a/innobase/os/os0file.c
+++ b/innobase/os/os0file.c
@@ -387,15 +387,17 @@ os_file_lock(
/*=========*/
/* out: 0 on success */
int fd, /* in: file descriptor */
- const char* name) /* in: file name */
+ const char* name, /* in: file name */
+ uint lock_type) /* in: lock_type */
{
struct flock lk;
- lk.l_type = F_WRLCK;
+ lk.l_type = lock_type;
lk.l_whence = SEEK_SET;
lk.l_start = lk.l_len = 0;
if (fcntl(fd, F_SETLK, &lk) == -1) {
fprintf(stderr,
- "InnoDB: Unable to lock %s", name);
+ "InnoDB: Unable to lock %s with lock %d, error: %d",
+ name, lock_type, errno);
perror (": fcntl");
close(fd);
return(-1);
@@ -862,7 +864,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -971,7 +973,7 @@ os_file_create_simple_no_error_handling(
if (file == -1) {
*success = FALSE;
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -1182,7 +1184,7 @@ try_again:
goto try_again;
}
#ifdef USE_FILE_LOCK
- } else if (os_file_lock(file, name)) {
+ } else if (os_file_lock(file, name, F_WRLCK)) {
*success = FALSE;
file = -1;
#endif
@@ -1383,6 +1385,9 @@ os_file_close(
#else
int ret;
+#ifdef USE_FILE_LOCK
+ (void) os_file_lock(file, "unknown", F_UNLCK);
+#endif
ret = close(file);
if (ret == -1) {
@@ -1419,6 +1424,9 @@ os_file_close_no_error_handling(
#else
int ret;
+#ifdef USE_FILE_LOCK
+ (void) os_file_lock(file, "unknown", F_UNLCK);
+#endif
ret = close(file);
if (ret == -1) {
diff --git a/innobase/row/row0ins.c b/innobase/row/row0ins.c
index a3f883b49c6..062f21369a7 100644
--- a/innobase/row/row0ins.c
+++ b/innobase/row/row0ins.c
@@ -803,8 +803,7 @@ row_ins_foreign_check_on_constraint(
"InnoDB: clustered record ", stderr);
rec_print(stderr, clust_rec);
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
err = DB_SUCCESS;
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 5432add37f7..154da11da58 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -714,7 +714,7 @@ run_again:
trx_start_if_not_started(trx);
- err = lock_table(0, prebuilt->table, prebuilt->select_lock_type, thr);
+ err = lock_table(0, prebuilt->table, LOCK_AUTO_INC, thr);
trx->error_state = err;
@@ -2526,10 +2526,11 @@ row_drop_database_for_mysql(
dict_table_t* table;
char* table_name;
int err = DB_SUCCESS;
+ ulint namelen = strlen(name);
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
ut_a(name != NULL);
- ut_a(name[strlen(name) - 1] == '/');
+ ut_a(name[namelen - 1] == '/');
trx->op_info = (char *) "dropping database";
@@ -2538,7 +2539,7 @@ loop:
row_mysql_lock_data_dictionary(trx);
while ((table_name = dict_get_first_table_name_in_db(name))) {
- ut_a(strcmp(table_name, name) == 0);
+ ut_a(memcmp(table_name, name, namelen) == 0);
table = dict_table_get_low(table_name);
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index 4c43f75125c..47d61459d47 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2410,8 +2410,7 @@ row_sel_get_clust_rec_for_mysql(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
}
clust_rec = NULL;
diff --git a/innobase/row/row0umod.c b/innobase/row/row0umod.c
index 3c181ed5493..d47227166f3 100644
--- a/innobase/row/row0umod.c
+++ b/innobase/row/row0umod.c
@@ -441,8 +441,7 @@ row_undo_mod_del_unmark_sec_and_undo_update(
putc('\n', stderr);
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
btr_cur_t* btr_cur = btr_pcur_get_btr_cur(&pcur);
diff --git a/innobase/row/row0upd.c b/innobase/row/row0upd.c
index 82eb112fc77..724e7bf91e7 100644
--- a/innobase/row/row0upd.c
+++ b/innobase/row/row0upd.c
@@ -1236,8 +1236,7 @@ row_upd_sec_index_entry(
trx_print(stderr, thr_get_trx(thr));
fputs("\n"
- "InnoDB: Make a detailed bug report and send it\n"
- "InnoDB: to mysql@lists.mysql.com\n", stderr);
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n", stderr);
} else {
/* Delete mark the old index record; it can already be
delete marked if we return after a lock wait in
diff --git a/innobase/trx/trx0rec.c b/innobase/trx/trx0rec.c
index 16f9f3d093d..382f723a05c 100644
--- a/innobase/trx/trx0rec.c
+++ b/innobase/trx/trx0rec.c
@@ -823,17 +823,16 @@ trx_undo_update_rec_get_update(
if (field_no >= dict_index_get_n_fields(index)) {
fprintf(stderr,
- "InnoDB: Error: trying to access"
- " update undo rec field %lu in ", (ulong) field_no);
+"InnoDB: Error: trying to access update undo rec field %lu in ", (ulong) field_no);
dict_index_name_print(stderr, index);
fprintf(stderr, "\n"
- "InnoDB: but index has only %lu fields\n"
- "InnoDB: Send a detailed bug report to mysql@lists.mysql.com\n"
- "InnoDB: Run also CHECK TABLE ",
+"InnoDB: but index has only %lu fields\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
+"InnoDB: Run also CHECK TABLE ",
(ulong) dict_index_get_n_fields(index));
ut_print_name(stderr, index->table_name);
fprintf(stderr, "\n"
- "InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
+"InnoDB: n_fields = %lu, i = %lu, ptr %p\n",
(ulong) n_fields, (ulong) i, ptr);
return(NULL);
}
@@ -1271,8 +1270,7 @@ trx_undo_prev_version_build(
" update undo rec for non-clustered ", stderr);
dict_index_name_print(stderr, index);
fputs("\n"
- "InnoDB: Send a detailed bug report to"
- " mysql@lists.mysql.com\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
"InnoDB: index record ", stderr);
rec_print(stderr, index_rec);
fputs("\n"
@@ -1320,11 +1318,9 @@ trx_undo_prev_version_build(
" update undo rec for table ", stderr);
ut_print_name(stderr, index->table_name);
fputs("\n"
- "InnoDB: but the table id in the"
- " undo record is wrong\n"
- "InnoDB: Send a detailed bug report to "
- "mysql@lists.mysql.com\n"
- "InnoDB: Run also CHECK TABLE ", stderr);
+"InnoDB: but the table id in the undo record is wrong\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com\n"
+"InnoDB: Run also CHECK TABLE ", stderr);
ut_print_name(stderr, index->table_name);
putc('\n', stderr);
}
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index fc0a67278d2..8128c8de13e 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -1564,7 +1564,9 @@ trx_mark_sql_stat_end(
/**************************************************************************
Prints info about a transaction to the standard output. The caller must
-own the kernel mutex. */
+own the kernel mutex and must have called
+innobase_mysql_prepare_print_arbitrary_thd(), unless he knows that MySQL or
+InnoDB cannot meanwhile change the info printed here. */
void
trx_print(
diff --git a/innobase/ut/ut0dbg.c b/innobase/ut/ut0dbg.c
index 3697e31050f..65703ec1c86 100644
--- a/innobase/ut/ut0dbg.c
+++ b/innobase/ut/ut0dbg.c
@@ -23,7 +23,7 @@ const char* ut_dbg_msg_assert_fail =
"InnoDB: Assertion failure in thread %lu in file %s line %lu\n";
const char* ut_dbg_msg_trap =
"InnoDB: We intentionally generate a memory trap.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com.\n"
+"InnoDB: Submit a detailed bug report to http://bugs.mysql.com.\n"
"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. See section 6.1 of\n"