summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <monty@mishka.local>2004-04-27 15:33:40 +0300
committerunknown <monty@mishka.local>2004-04-27 15:33:40 +0300
commita3828081cde644ab551c21a621b8e6ab69923e6a (patch)
tree4b29146428c84ab3e10e4007d26e3c0b4b2b1074 /innobase
parent1065f2bbd66ac4b1161f5c188171a54cbad5b422 (diff)
downloadmariadb-git-a3828081cde644ab551c21a621b8e6ab69923e6a.tar.gz
After merge fixes
Changed 'SHOW FIELD STATUS' to use 'Engine' instead of 'Type' client/client_priv.h: Added option 'create_options' for mysqldump client/mysqldump.c: Changed '--all' to '--create-options' as the old name was meaningless innobase/buf/buf0buf.c: After merge fixes innobase/buf/buf0lru.c: After merge fixes innobase/buf/buf0rea.c: After merge fixes innobase/dict/dict0load.c: After merge fixes innobase/fil/fil0fil.c: After merge fixes innobase/ibuf/ibuf0ibuf.c: After merge fixes innobase/include/fil0fil.h: After merge fixes innobase/include/row0mysql.h: After merge fixes innobase/include/ut0mem.h: After merge fixes innobase/log/log0recv.c: After merge fixes innobase/row/row0mysql.c: After merge fixes innobase/row/row0sel.c: After merge fixes innobase/srv/srv0start.c: After merge fixes innobase/sync/sync0rw.c: After merge fixes innobase/sync/sync0sync.c: After merge fixes myisam/ft_boolean_search.c: After merge fixes myisam/ft_nlq_search.c: After merge fixes mysql-test/r/mysqldump.result: After merge fixes mysql-test/t/mysqldump.test: Make result file smaller Some new tests sql/ha_innodb.cc: After merge fixes sql/set_var.cc: Removed compiler warning sql/slave.cc: After merge fixes sql/slave.h: After merge fixes sql/sql_show.cc: Type -> Engine
Diffstat (limited to 'innobase')
-rw-r--r--innobase/buf/buf0buf.c5
-rw-r--r--innobase/buf/buf0lru.c11
-rw-r--r--innobase/buf/buf0rea.c5
-rw-r--r--innobase/dict/dict0load.c1
-rw-r--r--innobase/fil/fil0fil.c8
-rw-r--r--innobase/ibuf/ibuf0ibuf.c18
-rw-r--r--innobase/include/fil0fil.h2
-rw-r--r--innobase/include/row0mysql.h2
-rw-r--r--innobase/include/ut0mem.h3
-rw-r--r--innobase/log/log0recv.c2
-rw-r--r--innobase/row/row0mysql.c94
-rw-r--r--innobase/row/row0sel.c25
-rw-r--r--innobase/srv/srv0start.c4
-rw-r--r--innobase/sync/sync0rw.c2
-rw-r--r--innobase/sync/sync0sync.c2
15 files changed, 72 insertions, 112 deletions
diff --git a/innobase/buf/buf0buf.c b/innobase/buf/buf0buf.c
index d96bc7586e6..7a5ef3c5e14 100644
--- a/innobase/buf/buf0buf.c
+++ b/innobase/buf/buf0buf.c
@@ -1545,11 +1545,12 @@ buf_page_init(
"InnoDB: Error: page %lu %lu already found from the hash table\n",
(ulong) space,
(ulong) offset);
+#ifdef UNIV_DEBUG
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
-
+#endif /* UNIV_DEBUG */
ut_a(0);
}
@@ -2243,7 +2244,7 @@ buf_print_io(
/ time_elapsed);
if (srv_use_awe) {
- buf += sprintf(buf, "AWE: %.2f page remaps/s\n",
+ fprintf(file, "AWE: %.2f page remaps/s\n",
(buf_pool->n_pages_awe_remapped
- buf_pool->n_pages_awe_remapped_old)
/ time_elapsed);
diff --git a/innobase/buf/buf0lru.c b/innobase/buf/buf0lru.c
index 55d638989b5..053161986e4 100644
--- a/innobase/buf/buf0lru.c
+++ b/innobase/buf/buf0lru.c
@@ -97,13 +97,14 @@ scan_again:
}
if (block->space == id) {
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
printf(
"Dropping space %lu page %lu\n",
(ulong) block->space,
(ulong) block->offset);
}
-
+#endif
if (block->is_hashed) {
page_no = block->offset;
@@ -207,6 +208,7 @@ buf_LRU_search_and_free_block(
while (block != NULL) {
ut_a(block->in_LRU_list);
if (buf_flush_ready_for_replace(block)) {
+
#ifdef UNIV_DEBUG
if (buf_debug_prints) {
fprintf(stderr,
@@ -215,6 +217,7 @@ buf_LRU_search_and_free_block(
(ulong) block->offset);
}
#endif /* UNIV_DEBUG */
+
buf_LRU_block_remove_hashed_page(block);
mutex_exit(&(buf_pool->mutex));
@@ -419,7 +422,8 @@ loop:
(ulong) n_iterations,
(ulong) fil_n_pending_log_flushes,
(ulong) fil_n_pending_tablespace_flushes,
- (ulong) os_n_file_reads, (ulong) os_n_file_writes, (ulong) os_n_fsyncs);
+ (ulong) os_n_file_reads, (ulong) os_n_file_writes,
+ (ulong) os_n_fsyncs);
mon_value_was = srv_print_innodb_monitor;
started_monitor = TRUE;
@@ -849,11 +853,12 @@ buf_LRU_block_remove_hashed_page(
(ulong) block);
}
+#ifdef UNIV_DEBUG
buf_print();
buf_LRU_print();
buf_validate();
buf_LRU_validate();
-
+#endif
ut_a(0);
}
diff --git a/innobase/buf/buf0rea.c b/innobase/buf/buf0rea.c
index 0c0b0f6a89d..e0f8291977e 100644
--- a/innobase/buf/buf0rea.c
+++ b/innobase/buf/buf0rea.c
@@ -125,11 +125,14 @@ buf_read_page_low(
return(0);
}
+#ifdef UNIV_DEBUG
if (buf_debug_prints) {
- printf("Posting read request for page %lu, sync %lu\n",
+ fprintf(stderr,
+ "Posting read request for page %lu, sync %lu\n",
(ulong) offset,
(ulong) sync);
}
+#endif
ut_a(block->state == BUF_BLOCK_FILE_PAGE);
diff --git a/innobase/dict/dict0load.c b/innobase/dict/dict0load.c
index 1f60d625284..abb06b15ea7 100644
--- a/innobase/dict/dict0load.c
+++ b/innobase/dict/dict0load.c
@@ -121,7 +121,6 @@ dict_print(void)
byte* field;
ulint len;
mtr_t mtr;
- char table_name[10000];
mutex_enter(&(dict_sys->mutex));
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index b3cf1457225..b9aff246802 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -86,7 +86,7 @@ the count drops to zero. */
/* When mysqld is run, the default directory "." is the mysqld datadir,
but in the MySQL Embedded Server Library and ibbackup it is not the default
directory, and we must set the base file path explicitly */
-const char* fil_path_to_mysql_datadir = (char*)".";
+const char* fil_path_to_mysql_datadir = ".";
ulint fil_n_pending_log_flushes = 0;
ulint fil_n_pending_tablespace_flushes = 0;
@@ -2727,7 +2727,7 @@ fil_load_single_table_tablespaces(void)
/* The datadir of MySQL is always the default directory of mysqld */
- dir = os_file_opendir(fil_path_to_mysql_datadir, TRUE);
+ dir = os_file_opendir((char*) fil_path_to_mysql_datadir, TRUE);
if (dir == NULL) {
@@ -2739,7 +2739,7 @@ fil_load_single_table_tablespaces(void)
/* Scan all directories under the datadir. They are the database
directories of MySQL. */
- ret = os_file_readdir_next_file(fil_path_to_mysql_datadir, dir,
+ ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir, dir,
&dbinfo);
while (ret == 0) {
/* printf("Looking at %s in datadir\n", dbinfo.name); */
@@ -2800,7 +2800,7 @@ next_file_item:
}
next_datadir_item:
- ret = os_file_readdir_next_file(fil_path_to_mysql_datadir,
+ ret = os_file_readdir_next_file((char*) fil_path_to_mysql_datadir,
dir, &dbinfo);
}
diff --git a/innobase/ibuf/ibuf0ibuf.c b/innobase/ibuf/ibuf0ibuf.c
index 2973c9880ae..ecdcf08e4c6 100644
--- a/innobase/ibuf/ibuf0ibuf.c
+++ b/innobase/ibuf/ibuf0ibuf.c
@@ -332,9 +332,9 @@ ibuf_count_get(
return(*(ibuf_counts[space] + page_no));
}
-#ifdef UNIV_IBUF_DEBUG
/**********************************************************************
Sets the ibuf count for a given page. */
+#ifdef UNIV_IBUF_DEBUG
static
void
ibuf_count_set(
@@ -2710,17 +2710,17 @@ ibuf_insert_to_index_page(
fprintf(stderr,
"InnoDB: Trying to insert a record from the insert buffer to an index page\n"
-"InnoDB: but the number of fields does not match!\n%s\n", errbuf);
+"InnoDB: but the number of fields does not match!\n");
buf_page_print(page);
- dtuple_sprintf(errbuf, 900, entry);
+ dtuple_print(stderr, entry);
- fprintf(stderr,
+ fputs(
"InnoDB: The table where where this index record belongs\n"
"InnoDB: is now probably corrupt. Please run CHECK TABLE on\n"
"InnoDB: your tables.\n"
-"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n");
+"InnoDB: Send a detailed bug report to mysql@lists.mysql.com!\n", stderr);
return;
}
@@ -3386,13 +3386,17 @@ ibuf_print(
(ulong) data->seg_size);
if (data->empty) {
- buf += sprintf(buf, " is empty\n");
+ fputs(" is empty\n", file);
} else {
- buf += sprintf(buf, " is not empty\n");
+ fputs(" is not empty\n", file);
}
fprintf(file,
"Ibuf for space %lu: size %lu, free list len %lu, seg size %lu,\n"
"%lu inserts, %lu merged recs, %lu merges\n",
+ (ulong) data->space,
+ (ulong) data->size,
+ (ulong) data->free_list_len,
+ (ulong) data->seg_size,
(ulong) data->n_inserts,
(ulong) data->n_merged_recs,
(ulong) data->n_merges);
diff --git a/innobase/include/fil0fil.h b/innobase/include/fil0fil.h
index 310336af38e..f7cdeb7f195 100644
--- a/innobase/include/fil0fil.h
+++ b/innobase/include/fil0fil.h
@@ -19,7 +19,7 @@ Created 10/25/1995 Heikki Tuuri
/* When mysqld is run, the default directory "." is the mysqld datadir, but in
ibbackup we must set it explicitly; the patgh must NOT contain the trailing
'/' or '\' */
-extern char* fil_path_to_mysql_datadir;
+extern const char* fil_path_to_mysql_datadir;
/* Initial size of a single-table tablespace in pages */
#define FIL_IBD_FILE_INITIAL_SIZE 4
diff --git a/innobase/include/row0mysql.h b/innobase/include/row0mysql.h
index 13898e75216..0fb2994a414 100644
--- a/innobase/include/row0mysql.h
+++ b/innobase/include/row0mysql.h
@@ -339,6 +339,8 @@ row_drop_table_for_mysql(
char* name, /* in: table name */
trx_t* trx, /* in: transaction handle */
ibool drop_db);/* in: TRUE=dropping whole database */
+
+/*************************************************************************
Discards the tablespace of a table which stored in an .ibd file. Discarding
means that this function deletes the .ibd file and assigns a new table id for
the table. Also the flag table->ibd_file_missing is set TRUE.
diff --git a/innobase/include/ut0mem.h b/innobase/include/ut0mem.h
index 7ca2c26e840..b208fac8691 100644
--- a/innobase/include/ut0mem.h
+++ b/innobase/include/ut0mem.h
@@ -128,6 +128,8 @@ ut_str_catenate(
/* out, own: catenated null-terminated string */
char* str1, /* in: null-terminated string */
char* str2); /* in: null-terminated string */
+
+/**************************************************************************
Return a copy of the given string. The returned string must be freed
using mem_free. */
@@ -136,7 +138,6 @@ ut_strdup(
/*======*/
/* out, own: cnull-terminated string */
char* str); /* in: null-terminated string */
-/**************************************************************************
#ifndef UNIV_NONINL
#include "ut0mem.ic"
diff --git a/innobase/log/log0recv.c b/innobase/log/log0recv.c
index 0df79f07f63..4f4220962f0 100644
--- a/innobase/log/log0recv.c
+++ b/innobase/log/log0recv.c
@@ -1868,7 +1868,7 @@ recv_report_corrupt_log(
"InnoDB: Recv offset %lu, prev %lu\n",
(ulong) type, (ulong) space, (ulong) page_no,
(ulong) ut_dulint_get_high(recv_sys->recovered_lsn),
- (ulong) ut_dulint_get_low(recv_sys->recovered_lsn));
+ (ulong) ut_dulint_get_low(recv_sys->recovered_lsn),
(ulong) recv_previous_parsed_rec_type,
(ulong) recv_previous_parsed_rec_is_multi,
(ulong) (ptr - recv_sys->buf),
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c
index 804c809eaee..4da27bca1a9 100644
--- a/innobase/row/row0mysql.c
+++ b/innobase/row/row0mysql.c
@@ -1318,6 +1318,7 @@ Does a table creation operation for MySQL. If the name of the table
to be created is equal with one of the predefined magic table names,
then this also starts printing the corresponding monitor output by
the master thread. */
+
int
row_create_table_for_mysql(
/*=======================*/
@@ -2116,79 +2117,6 @@ row_drop_table_for_mysql(
"PROCEDURE DROP_TABLE_PROC () IS\n"
"table_name CHAR;\n"
"sys_foreign_id CHAR;\n"
-
- ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
- ut_a(name != NULL);
-
- if (srv_created_new_raw) {
- fprintf(stderr,
- "InnoDB: A new raw disk partition was initialized or\n"
- "InnoDB: innodb_force_recovery is on: we do not allow\n"
- "InnoDB: database modifications by the user. Shut down\n"
- "InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
- "InnoDB: with raw, and innodb_force_... is removed.\n");
-
- return(DB_ERROR);
- }
-
- trx->op_info = (char *) "dropping table";
-
- trx_start_if_not_started(trx);
-
- namelen = ut_strlen(name);
- keywordlen = ut_strlen((char *) "innodb_monitor");
-
- if (namelen >= keywordlen
- && 0 == ut_memcmp(name + namelen - keywordlen,
- (char *) "innodb_monitor", keywordlen)) {
-
- /* Table name ends to characters innodb_monitor:
- stop monitor prints */
-
- srv_print_innodb_monitor = FALSE;
- srv_print_innodb_lock_monitor = FALSE;
- }
-
- keywordlen = ut_strlen((char *) "innodb_lock_monitor");
-
- if (namelen >= keywordlen
- && 0 == ut_memcmp(name + namelen - keywordlen,
- (char *) "innodb_lock_monitor",
- keywordlen)) {
-
- srv_print_innodb_monitor = FALSE;
- srv_print_innodb_lock_monitor = FALSE;
- }
-
- keywordlen = ut_strlen((char *) "innodb_tablespace_monitor");
-
- if (namelen >= keywordlen
- && 0 == ut_memcmp(name + namelen - keywordlen,
- (char *) "innodb_tablespace_monitor",
- keywordlen)) {
-
- srv_print_innodb_tablespace_monitor = FALSE;
- }
-
- keywordlen = ut_strlen((char *) "innodb_table_monitor");
-
- if (namelen >= keywordlen
- && 0 == ut_memcmp(name + namelen - keywordlen,
- (char *) "innodb_table_monitor",
- keywordlen)) {
-
- srv_print_innodb_table_monitor = FALSE;
- }
-
- /* We use the private SQL parser of Innobase to generate the
- query graphs needed in deleting the dictionary data from system
- tables in Innobase. Deleting a row from SYS_INDEXES table also
- frees the file segments of the B-tree associated with the index. */
-
- str1 = (char *)
- "PROCEDURE DROP_TABLE_PROC () IS\n"
- "table_name CHAR;\n"
- "sys_foreign_id CHAR;\n"
"table_id CHAR;\n"
"index_id CHAR;\n"
"foreign_id CHAR;\n"
@@ -2256,7 +2184,7 @@ row_drop_table_for_mysql(
"InnoDB: database modifications by the user. Shut down\n"
"InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
"InnoDB: with raw, and innodb_force_... is removed.\n",
- stderr);
+ stderr);
return(DB_ERROR);
}
@@ -2279,7 +2207,6 @@ row_drop_table_for_mysql(
} else if (namelen == sizeof S_innodb_lock_monitor
&& !memcmp(name, S_innodb_lock_monitor,
sizeof S_innodb_lock_monitor)) {
-
srv_print_innodb_monitor = FALSE;
srv_print_innodb_lock_monitor = FALSE;
} else if (namelen == sizeof S_innodb_tablespace_monitor
@@ -2294,6 +2221,21 @@ row_drop_table_for_mysql(
srv_print_innodb_table_monitor = FALSE;
}
+ ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
+ ut_a(name != NULL);
+
+ if (srv_created_new_raw) {
+ fputs(
+ "InnoDB: A new raw disk partition was initialized or\n"
+ "InnoDB: innodb_force_recovery is on: we do not allow\n"
+ "InnoDB: database modifications by the user. Shut down\n"
+ "InnoDB: mysqld and edit my.cnf so that newraw is replaced\n"
+ "InnoDB: with raw, and innodb_force_... is removed.\n",
+ stderr);
+
+ return(DB_ERROR);
+ }
+
quoted_name = mem_strdupq(name, '\'');
namelen = strlen(quoted_name);
sql = mem_alloc((sizeof str1) + (sizeof str2) - 2 + 1 + namelen);
@@ -2676,7 +2618,7 @@ row_rename_table_for_mysql(
ibool recovering_temp_table = FALSE;
ulint len;
ulint i;
- ibool success;
+ ibool success;
/* length of database name; 0 if not renaming to a temporary table */
ulint db_name_len;
char* sql;
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index fc7436683d2..4c43f75125c 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2035,8 +2035,7 @@ row_sel_convert_mysql_key_to_innobase(
(ulong) data_field_len,
(ulong) (key_ptr - key_end));
fflush(stderr);
- ut_print_buf(original_key_ptr, key_len);
- fflush(stdout);
+ ut_print_buf(stderr, original_key_ptr, key_len);
fprintf(stderr, "\n");
if (!is_null) {
@@ -2772,14 +2771,12 @@ row_search_for_mysql(
}
if (trx->n_mysql_tables_in_use == 0) {
- char err_buf[1000];
-
- trx_print(err_buf, trx);
-
- fprintf(stderr,
+ fputs(
"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);
+"InnoDB: but it has not locked any tables in ::external_lock()!\n",
+ stderr);
+ trx_print(stderr, trx);
+ fputc('\n', stderr);
ut_a(0);
}
@@ -3092,14 +3089,12 @@ 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,
+ fputs(
"InnoDB: Error: MySQL is trying to perform a consistent read\n"
-"InnoDB: but the read view is not assigned!\n%s\n", err_buf);
-
+"InnoDB: but the read view is not assigned!\n", stderr);
+ trx_print(stderr, trx);
+ fputc('\n', stderr);
ut_a(0);
}
} else if (prebuilt->select_lock_type == LOCK_NONE) {
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index 93957f2fd35..33d84cfaa8e 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -520,6 +520,8 @@ ulint
open_or_create_log_file(
/*====================*/
/* out: DB_SUCCESS or error code */
+ ibool create_new_db, /* in: TRUE if we should create a
+ new database */
ibool* log_file_created, /* out: TRUE if new log file
created */
ibool log_file_has_been_opened,/* in: TRUE if a log file has been
@@ -533,6 +535,8 @@ open_or_create_log_file(
ulint size_high;
char name[10000];
+ UT_NOT_USED(create_new_db);
+
*log_file_created = FALSE;
srv_normalize_path_for_win(srv_log_group_home_dirs[k]);
diff --git a/innobase/sync/sync0rw.c b/innobase/sync/sync0rw.c
index 3d219f27fb6..43f8d646eaa 100644
--- a/innobase/sync/sync0rw.c
+++ b/innobase/sync/sync0rw.c
@@ -146,7 +146,9 @@ rw_lock_free(
/*=========*/
rw_lock_t* lock) /* in: rw-lock */
{
+#ifdef UNIV_DEBUG
ut_a(rw_lock_validate(lock));
+#endif /* UNIV_DEBUG */
ut_a(rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED);
ut_a(rw_lock_get_waiters(lock) == 0);
ut_a(rw_lock_get_reader_count(lock) == 0);
diff --git a/innobase/sync/sync0sync.c b/innobase/sync/sync0sync.c
index 5c42876a7bb..e711acbf84e 100644
--- a/innobase/sync/sync0sync.c
+++ b/innobase/sync/sync0sync.c
@@ -251,7 +251,9 @@ mutex_free(
/*=======*/
mutex_t* mutex) /* in: mutex */
{
+#ifdef UNIV_DEBUG
ut_a(mutex_validate(mutex));
+#endif /* UNIV_DEBUG */
ut_a(mutex_get_lock_word(mutex) == 0);
ut_a(mutex_get_waiters(mutex) == 0);