summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/archive/ha_archive.cc37
-rw-r--r--storage/innobase/handler/ha_innodb.cc1
-rw-r--r--storage/innodb_plugin/ChangeLog18
-rw-r--r--storage/innodb_plugin/handler/ha_innodb.cc1
-rw-r--r--storage/innodb_plugin/include/page0page.h4
-rw-r--r--storage/innodb_plugin/page/page0page.c4
-rw-r--r--storage/maria/ma_checkpoint.c7
-rw-r--r--storage/myisam/mi_close.c7
-rw-r--r--storage/myisam/mi_packrec.c7
-rw-r--r--storage/myisam/mi_preload.c3
-rw-r--r--storage/xtradb/handler/ha_innodb.cc1
-rw-r--r--storage/xtradb/page/page0page.c2
12 files changed, 71 insertions, 21 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index 0474fb61a7c..0549ba2d978 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -773,6 +773,7 @@ uint32 ha_archive::max_row_length(const uchar *buf)
ptr != end ;
ptr++)
{
+ if (!table->field[*ptr]->is_null())
length += 2 + ((Field_blob*)table->field[*ptr])->get_length();
}
@@ -1620,13 +1621,15 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
{
int rc= 0;
const char *old_proc_info;
- ha_rows count= share->rows_recorded;
+ ha_rows count;
DBUG_ENTER("ha_archive::check");
old_proc_info= thd_proc_info(thd, "Checking table");
- /* Flush any waiting data */
pthread_mutex_lock(&share->mutex);
- azflush(&(share->archive_write), Z_SYNC_FLUSH);
+ count= share->rows_recorded;
+ /* Flush any waiting data */
+ if (share->archive_write_open)
+ azflush(&(share->archive_write), Z_SYNC_FLUSH);
pthread_mutex_unlock(&share->mutex);
if (init_archive_reader())
@@ -1639,18 +1642,34 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
DBUG_RETURN(errno);
read_data_header(&archive);
+ for (ha_rows cur_count= count; cur_count; cur_count--)
+ {
+ if ((rc= get_row(&archive, table->record[0])))
+ goto error;
+ }
+ /*
+ Now read records that may have been inserted concurrently.
+ Acquire share->mutex so tail of the table is not modified by
+ concurrent writers.
+ */
+ pthread_mutex_lock(&share->mutex);
+ count= share->rows_recorded - count;
+ if (share->archive_write_open)
+ azflush(&(share->archive_write), Z_SYNC_FLUSH);
while (!(rc= get_row(&archive, table->record[0])))
count--;
-
- thd_proc_info(thd, old_proc_info);
+ pthread_mutex_unlock(&share->mutex);
if ((rc && rc != HA_ERR_END_OF_FILE) || count)
- {
- share->crashed= FALSE;
- DBUG_RETURN(HA_ADMIN_CORRUPT);
- }
+ goto error;
+ thd_proc_info(thd, old_proc_info);
DBUG_RETURN(HA_ADMIN_OK);
+
+error:
+ thd_proc_info(thd, old_proc_info);
+ share->crashed= FALSE;
+ DBUG_RETURN(HA_ADMIN_CORRUPT);
}
/*
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 0e520b11eaa..ddcad0a318e 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -4798,7 +4798,6 @@ ha_innobase::innobase_get_index(
dict_index_t* index = 0;
DBUG_ENTER("innobase_get_index");
- ha_statistic_increment(&SSV::ha_read_key_count);
ut_ad(user_thd == ha_thd());
ut_a(prebuilt->trx == thd_to_trx(user_thd));
diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog
index 951a1bd9c3b..d836b390c52 100644
--- a/storage/innodb_plugin/ChangeLog
+++ b/storage/innodb_plugin/ChangeLog
@@ -1,3 +1,14 @@
+2011-12-13 The InnoDB Team
+
+ * handler/ha_innodb.cc, innodb.test, innodb.result:
+ Fix Bug#13117023: InnoDB was incrementing the handler_read_key,
+ also the SSV::ha_read_key_count, at the wrong place.
+
+2011-12-10 The InnoDB Team
+
+ * include/page0page.h, page/page0page.c:
+ Fix Bug#13418887 ERROR IN DIAGNOSTIC FUNCTION PAGE_REC_PRINT()
+
2011-11-10 The InnoDB Team
* handler/ha_innodb.cc, row/row0ins.c, innodb_replace.test:
@@ -13,7 +24,12 @@
2011-10-27 The InnoDB Team
* row/row0mysql.c:
- Fix Bug#12884631 62146: TABLES ARE LOST FOR DDL
+ Fix Bug #12884631 62146: TABLES ARE LOST FOR DDL
+
+2011-10-25 The InnoDB Team
+
+ * handler/ha_innodb.cc, row/row0ins.c:
+ Fix Bug#13002783 PARTIALLY UNINITIALIZED CASCADE UPDATE VECTOR
2011-10-20 The InnoDB Team
diff --git a/storage/innodb_plugin/handler/ha_innodb.cc b/storage/innodb_plugin/handler/ha_innodb.cc
index 4170d20c632..982091063d4 100644
--- a/storage/innodb_plugin/handler/ha_innodb.cc
+++ b/storage/innodb_plugin/handler/ha_innodb.cc
@@ -5574,7 +5574,6 @@ ha_innobase::innobase_get_index(
dict_index_t* index = 0;
DBUG_ENTER("innobase_get_index");
- ha_statistic_increment(&SSV::ha_read_key_count);
if (keynr != MAX_KEY && table->s->keys > 0) {
key = table->key_info + keynr;
diff --git a/storage/innodb_plugin/include/page0page.h b/storage/innodb_plugin/include/page0page.h
index 12c4fed75d2..ea9c212581c 100644
--- a/storage/innodb_plugin/include/page0page.h
+++ b/storage/innodb_plugin/include/page0page.h
@@ -892,6 +892,7 @@ page_parse_create(
ulint comp, /*!< in: nonzero=compact page format */
buf_block_t* block, /*!< in: block or NULL */
mtr_t* mtr); /*!< in: mtr or NULL */
+#ifndef UNIV_HOTBACKUP
/************************************************************//**
Prints record contents including the data relevant only in
the index page context. */
@@ -901,6 +902,7 @@ page_rec_print(
/*===========*/
const rec_t* rec, /*!< in: physical record */
const ulint* offsets);/*!< in: record descriptor */
+# ifdef UNIV_BTR_PRINT
/***************************************************************//**
This is used to print the contents of the directory for
debugging purposes. */
@@ -940,6 +942,8 @@ page_print(
in directory */
ulint rn); /*!< in: print rn first and last records
in directory */
+# endif /* UNIV_BTR_PRINT */
+#endif /* !UNIV_HOTBACKUP */
/***************************************************************//**
The following is used to validate a record on a page. This function
differs from rec_validate as it can also check the n_owned field and
diff --git a/storage/innodb_plugin/page/page0page.c b/storage/innodb_plugin/page/page0page.c
index 93869e997b5..52f6678be0a 100644
--- a/storage/innodb_plugin/page/page0page.c
+++ b/storage/innodb_plugin/page/page0page.c
@@ -1613,13 +1613,14 @@ page_rec_print(
" n_owned: %lu; heap_no: %lu; next rec: %lu\n",
(ulong) rec_get_n_owned_old(rec),
(ulong) rec_get_heap_no_old(rec),
- (ulong) rec_get_next_offs(rec, TRUE));
+ (ulong) rec_get_next_offs(rec, FALSE));
}
page_rec_check(rec);
rec_validate(rec, offsets);
}
+# ifdef UNIV_BTR_PRINT
/***************************************************************//**
This is used to print the contents of the directory for
debugging purposes. */
@@ -1780,6 +1781,7 @@ page_print(
page_dir_print(page, dn);
page_print_list(block, index, rn);
}
+# endif /* UNIV_BTR_PRINT */
#endif /* !UNIV_HOTBACKUP */
/***************************************************************//**
diff --git a/storage/maria/ma_checkpoint.c b/storage/maria/ma_checkpoint.c
index 602e5da3065..e11a21581aa 100644
--- a/storage/maria/ma_checkpoint.c
+++ b/storage/maria/ma_checkpoint.c
@@ -916,6 +916,9 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
*/
}
translog_unlock();
+ if (state_copy == state_copies)
+ break; /* Nothing to do */
+
/**
We are going to flush these states.
Before, all records describing how to undo such state must be
@@ -940,13 +943,13 @@ static int collect_tables(LEX_STRING *str, LSN checkpoint_start_log_horizon)
if (translog_flush(state_copies_horizon))
goto err;
/* now we have cached states and they are WAL-safe*/
- state_copies_end= state_copy;
+ state_copies_end= state_copy-1;
state_copy= state_copies;
}
/* locate our state among these cached ones */
for ( ; state_copy->index != i; state_copy++)
- DBUG_ASSERT(state_copy < state_copies_end);
+ DBUG_ASSERT(state_copy <= state_copies_end);
/* OS file descriptors are ints which we stored in 4 bytes */
compile_time_assert(sizeof(int) <= 4);
diff --git a/storage/myisam/mi_close.c b/storage/myisam/mi_close.c
index c6e6289ffe1..f7424144cd8 100644
--- a/storage/myisam/mi_close.c
+++ b/storage/myisam/mi_close.c
@@ -90,7 +90,12 @@ int mi_close(register MI_INFO *info)
}
#ifdef HAVE_MMAP
if (share->file_map)
- _mi_unmap_file(info);
+ {
+ if (share->options & HA_OPTION_COMPRESS_RECORD)
+ _mi_unmap_file(info);
+ else
+ mi_munmap_file(info);
+ }
#endif
if (share->decode_trees)
{
diff --git a/storage/myisam/mi_packrec.c b/storage/myisam/mi_packrec.c
index 7b90ba8276b..dde3817c5e2 100644
--- a/storage/myisam/mi_packrec.c
+++ b/storage/myisam/mi_packrec.c
@@ -1554,13 +1554,14 @@ my_bool _mi_memmap_file(MI_INFO *info)
void _mi_unmap_file(MI_INFO *info)
{
- VOID(my_munmap((char*) info->s->file_map,
- (size_t) info->s->mmaped_length + MEMMAP_EXTRA_MARGIN));
+ DBUG_ASSERT(info->s->options & HA_OPTION_COMPRESS_RECORD);
+
+ VOID(my_munmap((char*) info->s->file_map, (size_t) info->s->mmaped_length));
if (myisam_mmap_size != SIZE_T_MAX)
{
pthread_mutex_lock(&THR_LOCK_myisam_mmap);
- myisam_mmap_used-= info->s->mmaped_length + MEMMAP_EXTRA_MARGIN;
+ myisam_mmap_used-= info->s->mmaped_length;
pthread_mutex_unlock(&THR_LOCK_myisam_mmap);
}
}
diff --git a/storage/myisam/mi_preload.c b/storage/myisam/mi_preload.c
index a2d751a709c..fad89215f35 100644
--- a/storage/myisam/mi_preload.c
+++ b/storage/myisam/mi_preload.c
@@ -56,6 +56,9 @@ int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves)
if (!keys || !mi_is_any_key_active(key_map) || key_file_length == pos)
DBUG_RETURN(0);
+ /* Preload into a non initialized key cache should never happen. */
+ DBUG_ASSERT(share->key_cache->key_cache_inited);
+
block_length= keyinfo[0].block_length;
if (ignore_leaves)
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 0d64a3f8b14..f890e95882d 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -6273,7 +6273,6 @@ ha_innobase::innobase_get_index(
dict_index_t* index = 0;
DBUG_ENTER("innobase_get_index");
- ha_statistic_increment(&SSV::ha_read_key_count);
if (keynr != MAX_KEY && table->s->keys > 0) {
key = table->key_info + keynr;
diff --git a/storage/xtradb/page/page0page.c b/storage/xtradb/page/page0page.c
index 0bc080199e6..cf1a48775a9 100644
--- a/storage/xtradb/page/page0page.c
+++ b/storage/xtradb/page/page0page.c
@@ -1625,7 +1625,7 @@ page_rec_print(
" n_owned: %lu; heap_no: %lu; next rec: %lu\n",
(ulong) rec_get_n_owned_old(rec),
(ulong) rec_get_heap_no_old(rec),
- (ulong) rec_get_next_offs(rec, TRUE));
+ (ulong) rec_get_next_offs(rec, FALSE));
}
page_rec_check(rec);