1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

UNDO of rows now puts back all part of the row on their original pages and positions

Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
Added --debug-on option to mysqld (to be able to turn of DBUG with --debug-on=0)
Fixed some bugs with 'non_flushable' marking of bitmap pages
Don't use 'non_flushable' marking of bitmap pages for not transactional tables
SHOW CREATE TABLE now shows if table was created with page checksums
Fixed a lot of bugs with BLOB handling in case of update/REDO and UNDO
More tests (especially for blobs) and DBUG_ASSERTS()
More readable output from maria_read_log and maria_chk
Fixed wrong shift that caused Maria to crash on files > 4G
Mark tables as crashed of REDO fails


dbug/dbug.c:
  Changed to use my_bool (allowed me to remove some windows specific code)
  Added variable _dbug_on_ to speed up execution when DBUG is not going to be used
  Removed initialization of variables if not needed
include/my_dbug.h:
  Use my_bool for some functions that was defined as BOOLEAN in dbug.c code
  Added DBUGGER_ON/DEBUGGER_OFF to speed up execution when DBUG is not used
include/my_global.h:
  Define my_bool early
  Increase MY_HOW_OFTEN_TO_WRITE as computers are now faster than 10 years ago
mysql-test/mysql-test-run.pl:
  Added debug-on=0 to speed up tests
mysql-test/r/maria-recovery.result:
  Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/r/maria.result:
  Added testing of page checksums
mysql-test/t/crash_commit_before-master.opt:
  Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-bitmap-master.opt:
  Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery-master.opt:
  Added --debug-on as test require DBUG to work
mysql-test/t/maria-recovery.test:
  Added new test by Guilhem to test if UNDO_ROW_DELETE preserves rowid
mysql-test/t/maria.test:
  Added testing of page checksums
sql/mysqld.cc:
  Added --debug-on option (to be able to turn of DBUG with --debug-on=0)
  Indentation fixes
  Removed end spaces
sql/sql_show.cc:
  Allow update_create_info() to inform MySQL if PACK_KEYS, NO_PACK_KEYS, CHECKSUM, PAGE_CHECKSUM or DELAY_KEY_WRITE is used
storage/maria/Makefile.am:
  Added ma_test_big.sh
storage/maria/ha_maria.cc:
  Store in create_info if page checksums are used (For SHOW CREATE TABLE)
storage/maria/ma_bitmap.c:
  Added _ma_bitmap_wait_or_flush() to cause reader of bitmap pages to wait with reading until bitmap is flushed.
  Use TAIL_PAGE_COUNT_MARKER for tail pages
  Set 'sub_blocks' for and only for the head page or for the first extent of a blob. This is needed for store_extent_info() to be able to set START_EXTENT_BIT's
  Don't allocate more than 0x3ffff pages in one extent (We need bit 0x4000 as a START_EXTENT_BIT)
  Increase the calculated 'head_length' with the number of bytes used for extents.
  Update row->space_on_head_page also in _ma_bitmap_find_new_place()
  Make _ma_bitmap_get_page_bits() global. (Needed for UNDO handling)
  Changed _ma_bitmap_flushable() to take MARIA_HA instead of MARIA_SHARE.
  This was needed to be able to mark the handler if we had a 'non_flushable' call pending or not.
  Don't use 'non_flushable' marking of bitmap pages for not transactional tables.
  Added BLOCKUSED_USE_ORG_BITMAP handling also for tail pages.
  Added more DBUG_ASSERT() to find possible errors in other code
  Some code simplications by adding new local variables
storage/maria/ma_blockrec.c:
  UNDO of rows now puts back all part of the row on their original pages and positions.
  Changed UNDO of DELETE and UNDO of UPDATE to contain information about the original length of data on head block and also extent information
  This changes a lot of logic as now an insert of a row on a page may happen to any position (and not just to the first or next free)
  Use PAGE_COUNT to mark if an extent is the start of of a blob. (Needed for extent_to_bitmap_blocks())
  Added check_directory() for checking that directroy entries are correct.
  Added checking of row checksums when reading rows (with EXTRA_DEBUG)
  Added make_space_for_directory() and extend_directory() for doing expansion of directory
  Added get_rowpos_in_head_or_tail_page() to be able to store head/tail on original position in UNDO
  Added extent_to_bitmap_blocks() to be able to generate original bitmap blocks from UNDO entry
  Added _ma_update_at_original_place() for UNDO of DELETES
  Added row->min_length to hold minmum required space needed on head page
  Changed find_free_position() to use make_space_for_directory()
  Changed make_empty_page() to allow optional creation of directory entry
  Changed delete_head_or_tail() and _ma_apply_undo_row_isnert() to not copy pagecache block (speed optimization)
  Changed _ma_apply_redo_insert_row_head_or_tail() to be able to insert new row at any position on 'new' page
  Changed _ma_apply_undo_row_delete() and _ma_apply_undo_row_update() to put row in it's original position
  Ensure allocation of tail blocks are of at least MIN_TAIL_SIZE.
  Ensure we store pages in pinned pages even if read failed. (If not we will have pages pinned forever in page cache)
  Write original extent information in UNDO entry, not compacted ones (we need position to tails!)
  When setting BLOCKUSED_USED, don't clear other bits (we have to preserve BLOCKUSED_USE_ORG_BITMAP)
  Fixed som bugs in directory handling
  Fixed bug where we wrote wrong lsn to blob pages
  Added separate blob_buffer for fixing bug when updating row that had char/varchar that spanned several pages and also had blobs
  Ensure we call _ma_bitmap_flushable() also in case of errors
  When doing an update, first delete old entries, then search in bitmap for where to put new information
  Info->s -> share
  Rowid -> rowid
  More DBUG_ASSERT()
storage/maria/ma_blockrec.h:
  Added START_EXTENT_BIT and TAIL_PAGE_COUNT_MARKER
  Added _ma_bitmap_wait_or_flush() and _ma_bitmap_get_page_bits()
storage/maria/ma_check.c:
  Don't write extra empty line if there is no deleted blocks
  Ignore START_EXTENT_BIT's in page count
  Call _ma_fast_unlock_key_del() to free key_del link
storage/maria/ma_close.c:
  Ensure that used_key_del is 0. (If not, someone forgot to call _ma_unlock_key_del())
storage/maria/ma_create.c:
  Changed constant to macro
storage/maria/ma_delete.c:
  For deleted keys, log also position to row
storage/maria/ma_extra.c:
  Release blob buffer at maria_reset() if bigger than MARIA_SMALL_BLOB_BUFFER
storage/maria/ma_key_recover.c:
  Added bzero() of LSN that confused paged cache in case of uninitialized block
  Mark file crashed if applying of index changes fails
  Added calls to _ma_fast_unlock_key_del() for protection of shared key_del link.
storage/maria/ma_locking.c:
  Added usage of MARIA_FILE_OPEN_COUNT_OFFSET
  Added _ma_mark_file_crashed()
storage/maria/ma_loghandler.c:
  Fixed bug where we logged uninitialized memory
storage/maria/ma_open.c:
  Moved state->changed to be at start of state info on disk to allow one to easly mark files as crashed
storage/maria/ma_page.c:
  Disable 'dummy' checksumming of pages as this gave false warnings.
  (Need to investigate if this is ever needed)
storage/maria/ma_pagecache.c:
  Fixed wrong shift that caused Maria to crash on files > 4G
storage/maria/ma_recovery.c:
  In case of errors, start writing on new line if we where in %## %## printing mode (Made errors more readable)
  Changed global variable name from warnings -> recovery_warnings
  Use MARIA_FILE_CREATE_RENAME_LSN_OFFSET instead of constant
  Removed special handling of row position for deleted keys. Keys now always includes row positions
  _ma_apply_undo_row_delete() now gets page and row position
  Added check that we don't loop forever when handling undo's (in case of bug in undo chain)
  Print name of failed REDO/UNDO
storage/maria/ma_recovery.h:
  Removed old comment
storage/maria/ma_static.c:
  Chaned version number of Maria files to not accidently use old ones (becasue of change of ordering of status variables)
storage/maria/ma_test2.c:
  Added option -u to specify number of rows to update
  Changed old option -u to be -A, as for ma_test1
  Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
  First created blob is now of max blob length to ensure we have at least one big blob in the table
storage/maria/ma_test_all.sh:
  More tests
storage/maria/ma_test_recovery.expected:
  Updated results
storage/maria/ma_test_recovery:
  Changed tests to use bigger blobs (not just 1K)
  Added new tests that tests recovery of update with blobs
  Removed comparision of .MAD file as it's not guranteed that recovery from scratch gives identical data file as original update
  (compact_page() may be called at different times during normal execution and during REDO)
storage/maria/ma_update.c:
  Simplify code (changed * to if)
storage/maria/maria_chk.c:
  Make output more readable
storage/maria/maria_def.h:
  Changed 'changed' to int to prepare for more bits
  Added 2 more bytes to status information
  Added 'st_mara_row->min_length' for storing min length needed on head page
  Added 'st_mara_handler->blob_buff & blob_buff_size' for storing blobs
  Moved all tunning parameters into one block
  Added MARIA_SMALL_BLOB_BUFFER
  Added _ma_mark_file_crashed()
storage/myisam/mi_test2.c:
  Fixed bug in update of rows with blobs (before blobs was always reset to empty on update)
storage/maria/ma_test_big.sh:
  Testing of insert, update, delete, recovery and undo of rows with blobs
  Thanks to the random-ness of ma_test2 this is likely to find most bugs in the row handling
This commit is contained in:
unknown
2007-12-30 22:40:03 +02:00
parent 630169c6d8
commit bfd5c273c4
41 changed files with 2288 additions and 857 deletions

View File

@@ -123,11 +123,7 @@
* Typedefs to make things more obvious.
*/
#ifndef __WIN__
typedef int BOOLEAN;
#else
#define BOOLEAN BOOL
#endif
#define BOOLEAN my_bool
/*
* Make it easy to change storage classes if necessary.
@@ -216,6 +212,7 @@ struct settings {
static BOOLEAN init_done= FALSE; /* Set to TRUE when initialization done */
static struct settings init_settings;
static const char *db_process= 0;/* Pointer to process name; argv[0] */
my_bool _dbug_on_= TRUE; /* FALSE if no debugging at all */
typedef struct _db_code_state_ {
const char *process; /* Pointer to process name; usually argv[0] */
@@ -248,7 +245,8 @@ typedef struct _db_code_state_ {
The test below is so we could call functions with DBUG_ENTER before
my_thread_init().
*/
#define get_code_state_or_return if (!cs && !((cs=code_state()))) return
#define get_code_state_if_not_set_or_return if (!cs && !((cs=code_state()))) return
#define get_code_state_or_return if (!((cs=code_state()))) return
/* Handling lists */
static struct link *ListAdd(struct link *, const char *, const char *);
@@ -332,13 +330,20 @@ static CODE_STATE *code_state(void)
{
CODE_STATE *cs, **cs_ptr;
/*
_dbug_on_ is reset if we don't plan to use any debug commands at all and
we want to run on maximum speed
*/
if (!_dbug_on_)
return 0;
if (!init_done)
{
init_done=TRUE;
pthread_mutex_init(&THR_LOCK_dbug,MY_MUTEX_INIT_FAST);
bzero(&init_settings, sizeof(init_settings));
init_settings.out_file=stderr;
init_settings.flags=OPEN_APPEND;
init_done=TRUE;
}
if (!(cs_ptr= (CODE_STATE**) my_thread_var_dbug()))
@@ -405,7 +410,7 @@ static CODE_STATE *code_state(void)
void _db_process_(const char *name)
{
CODE_STATE *cs=0;
CODE_STATE *cs;
if (!db_process)
db_process= name;
@@ -449,10 +454,10 @@ void _db_process_(const char *name)
void _db_set_(CODE_STATE *cs, const char *control)
{
const char *end;
int rel=0;
int rel;
struct settings *stack;
get_code_state_or_return;
get_code_state_if_not_set_or_return;
stack= cs->stack;
if (control[0] == '-' && control[1] == '#')
@@ -693,7 +698,7 @@ void _db_set_(CODE_STATE *cs, const char *control)
void _db_push_(const char *control)
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
PushState(cs);
_db_set_(cs, control);
@@ -742,7 +747,7 @@ void _db_set_init_(const char *control)
void _db_pop_()
{
struct settings *discard;
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
@@ -836,7 +841,7 @@ int _db_explain_ (CODE_STATE *cs, char *buf, size_t len)
{
char *start=buf, *end=buf+len-4;
get_code_state_or_return *buf=0;
get_code_state_if_not_set_or_return *buf=0;
op_list_to_buf('d', cs->stack->keywords, DEBUGGING);
op_int_to_buf ('D', cs->stack->delay, 0);
@@ -939,9 +944,15 @@ void _db_enter_(const char *_func_, const char *_file_,
uint _line_, const char **_sfunc_, const char **_sfile_,
uint *_slevel_, char ***_sframep_ __attribute__((unused)))
{
int save_errno=errno;
CODE_STATE *cs=0;
int save_errno;
CODE_STATE *cs;
if (!((cs=code_state())))
{
*_slevel_= 0; /* Set to avoid valgrind warnings if dbug is enabled later */
return;
}
get_code_state_or_return;
save_errno= errno;
*_sfunc_= cs->func;
*_sfile_= cs->file;
@@ -1015,7 +1026,7 @@ void _db_return_(uint _line_, const char **_sfunc_,
const char **_sfile_, uint *_slevel_)
{
int save_errno=errno;
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
if (cs->level != (int) *_slevel_)
@@ -1049,7 +1060,11 @@ void _db_return_(uint _line_, const char **_sfunc_,
dbug_flush(cs);
}
}
cs->level= *_slevel_-1;
/*
Check to not set level < 0. This can happen if DBUG was disabled when
function was entered and enabled in function.
*/
cs->level= *_slevel_ != 0 ? *_slevel_-1 : 0;
cs->func= *_sfunc_;
cs->file= *_sfile_;
#ifndef THREAD
@@ -1082,7 +1097,7 @@ void _db_return_(uint _line_, const char **_sfunc_,
void _db_pargs_(uint _line_, const char *keyword)
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
cs->u_line= _line_;
cs->u_keyword= keyword;
@@ -1118,8 +1133,7 @@ void _db_pargs_(uint _line_, const char *keyword)
void _db_doprnt_(const char *format,...)
{
va_list args;
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
va_start(args,format);
@@ -1167,8 +1181,7 @@ void _db_dump_(uint _line_, const char *keyword,
{
int pos;
char dbuff[90];
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
if (_db_keyword_(cs, keyword))
@@ -1480,8 +1493,12 @@ void _db_end_()
{
struct settings *discard;
static struct settings tmp;
CODE_STATE *cs=0;
CODE_STATE *cs;
/*
Set _dbug_on_ to be able to do full reset even when DEBUGGER_OFF was
called after dbug was initialized
*/
_dbug_on_= 1;
get_code_state_or_return;
while ((discard= cs->stack))
@@ -1568,7 +1585,7 @@ static BOOLEAN DoProfile(CODE_STATE *cs)
FILE *_db_fp_(void)
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return NULL;
return cs->stack->out_file;
}
@@ -1596,7 +1613,7 @@ FILE *_db_fp_(void)
BOOLEAN _db_strict_keyword_(const char *keyword)
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return FALSE;
if (!DEBUGGING || cs->stack->keywords == NULL)
return FALSE;
@@ -1630,7 +1647,7 @@ BOOLEAN _db_strict_keyword_(const char *keyword)
BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword)
{
get_code_state_or_return FALSE;
get_code_state_if_not_set_or_return FALSE;
return (DEBUGGING &&
(!TRACING || cs->level <= cs->stack->maxdepth) &&
@@ -2149,7 +2166,7 @@ static void ChangeOwner(CODE_STATE *cs, char *pathname)
EXPORT void _db_setjmp_()
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
cs->jmplevel= cs->level;
@@ -2176,7 +2193,7 @@ EXPORT void _db_setjmp_()
EXPORT void _db_longjmp_()
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
cs->level= cs->jmplevel;
@@ -2229,9 +2246,7 @@ char *s;
static void dbug_flush(CODE_STATE *cs)
{
#ifndef THREAD
if (cs->stack->flags & FLUSH_ON_WRITE)
#endif
{
#if defined(MSDOS) || defined(__WIN__)
if (cs->stack->out_file != stdout && cs->stack->out_file != stderr)
@@ -2258,7 +2273,7 @@ static void dbug_flush(CODE_STATE *cs)
void _db_lock_file_()
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked=1;
@@ -2266,7 +2281,7 @@ void _db_lock_file_()
void _db_unlock_file_()
{
CODE_STATE *cs=0;
CODE_STATE *cs;
get_code_state_or_return;
cs->locked=0;
pthread_mutex_unlock(&THR_LOCK_dbug);

View File

@@ -20,9 +20,10 @@
extern "C" {
#endif
#if !defined(DBUG_OFF) && !defined(_lint)
struct _db_code_state_;
extern int _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
extern int _db_strict_keyword_(const char *keyword);
struct _db_code_state_;
extern my_bool _dbug_on_;
extern my_bool _db_keyword_(struct _db_code_state_ *cs, const char *keyword);
extern my_bool _db_strict_keyword_(const char *keyword);
extern int _db_explain_(struct _db_code_state_ *cs, char *buf, size_t len);
extern int _db_explain_init_(char *buf, size_t len);
extern void _db_setjmp_(void);
@@ -45,7 +46,7 @@ extern void _db_dump_(uint _line_,const char *keyword,
extern void _db_end_(void);
extern void _db_lock_file_(void);
extern void _db_unlock_file_(void);
extern FILE *_db_fp_(void);
extern FILE *_db_fp_(void);
#define DBUG_ENTER(a) const char *_db_func_, *_db_file_; uint _db_level_; \
char **_db_framep_; \
@@ -80,6 +81,8 @@ extern FILE *_db_fp_(void);
#define DBUG_ASSERT(A) assert(A)
#define DBUG_EXPLAIN(buf,len) _db_explain_(0, (buf),(len))
#define DBUG_EXPLAIN_INITIAL(buf,len) _db_explain_init_((buf),(len))
#define DEBUGGER_OFF _dbug_on_= 0
#define DEBUGGER_ON _dbug_on_= 1
#define IF_DBUG(A) A
#else /* No debugger */
@@ -104,6 +107,8 @@ extern FILE *_db_fp_(void);
#define DBUG_ASSERT(A) do { } while(0)
#define DBUG_LOCK_FILE
#define DBUG_FILE (stderr)
#define DEBUGGER_OFF
#define DEBUGGER_ON
#define DBUG_UNLOCK_FILE
#define DBUG_EXPLAIN(buf,len)
#define DBUG_EXPLAIN_INITIAL(buf,len)

View File

@@ -642,6 +642,7 @@ C_MODE_END
# endif
#endif
typedef char my_bool; /* Small bool */
#include <my_dbug.h>
#define MIN_ARRAY_SIZE 0 /* Zero or One. Gcc allows zero*/
@@ -1072,7 +1073,6 @@ typedef off_t os_off_t;
typedef uint8 int7; /* Most effective integer 0 <= x <= 127 */
typedef short int15; /* Most effective integer 0 <= x <= 32767 */
typedef int myf; /* Type of MyFlags in my_funcs */
typedef char my_bool; /* Small bool */
#if !defined(bool) && !defined(bool_defined) && (!defined(HAVE_BOOL) || !defined(__cplusplus))
typedef char bool; /* Ordinary boolean values 0 1 */
#endif
@@ -1136,9 +1136,7 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define SCALE_SEC 100
#define SCALE_USEC 10000
#define MY_HOW_OFTEN_TO_ALARM 2 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 1000 /* How often we want info on screen */
#define MY_HOW_OFTEN_TO_WRITE 10000 /* How often we want info on screen */
/*
Define-funktions for reading and storing in machine independent format

View File

@@ -3039,6 +3039,7 @@ sub install_db ($$) {
mtr_add_arg($args, "--loose-skip-innodb");
mtr_add_arg($args, "--loose-skip-ndbcluster");
mtr_add_arg($args, "--sync-frm=0");
mtr_add_arg($args, "--loose-debug-on=0");
mtr_add_arg($args, "--tmpdir=.");
mtr_add_arg($args, "--core-file");
@@ -3780,6 +3781,7 @@ sub mysqld_arguments ($$$$) {
$mysqld->{'path_myddir'});
mtr_add_arg($args, "--sync-frm=0"); # Faster test
mtr_add_arg($args, "--loose-debug-on=0");
if ( $mysql_version_id >= 50106 )
{

View File

@@ -186,7 +186,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(6) DEFAULT NULL,
PRIMARY KEY (`i`),
KEY `c` (`c`)
) ENGINE=MARIA AUTO_INCREMENT=5 DEFAULT CHARSET=latin1
) ENGINE=MARIA AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
* TEST of UPDATE vs state.auto_increment
* copied t1 for feeding_recovery
update t1 set i=15 where c="a";
@@ -212,7 +212,28 @@ t1 CREATE TABLE `t1` (
`c` varchar(6) DEFAULT NULL,
PRIMARY KEY (`i`),
KEY `c` (`c`)
) ENGINE=MARIA AUTO_INCREMENT=16 DEFAULT CHARSET=latin1
) ENGINE=MARIA AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
drop table t1;
* TEST of UNDO_ROW_DELETE preserving rowid
create table t1(a int) engine=maria;
insert into t1 values(1),(2);
flush table t1;
* copied t1 for comparison
lock tables t1 write;
insert into t1 values(3);
delete from t1 where a in (1,2,3);
SET SESSION debug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global maria_checkpoint_interval=1;
ERROR HY000: Lost connection to MySQL server during query
* recovery happens
check table t1 extended;
Table Op Msg_type Msg_text
mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
use mysqltest;
drop table t1;
drop database mysqltest_for_feeding_recovery;
drop database mysqltest_for_comparison;

View File

@@ -1,5 +1,6 @@
set global storage_engine=maria;
set session storage_engine=maria;
set global maria_page_checksum=0;
set global maria_log_file_size=4294967296;
drop table if exists t1,t2;
SET SQL_WARNINGS=1;
@@ -2052,7 +2053,7 @@ maria_checkpoint_interval 30
maria_log_file_size 4294959104
maria_log_purge_type immediate
maria_max_sort_file_size 9223372036853727232
maria_page_checksum ON
maria_page_checksum OFF
maria_pagecache_age_threshold 300
maria_pagecache_buffer_size 8384512
maria_pagecache_division_limit 100
@@ -2069,6 +2070,14 @@ Maria_pagecache_read_requests #
Maria_pagecache_reads #
Maria_pagecache_write_requests #
Maria_pagecache_writes #
set global maria_page_checksum=1;
create table t1 (a int);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
drop table t1;
create table t1 (s varchar(25), fulltext(s)) TRANSACTIONAL= 1;
ERROR HY000: Maria can't yet handle SPATIAL or FULLTEXT keys in transactional mode. For now use TRANSACTIONAL=0
drop table if exists t1;

View File

@@ -1,2 +1 @@
--skip-stack-trace --skip-core-file
--skip-stack-trace --skip-core-file --loose-debug-on=1

View File

@@ -1,2 +1,2 @@
--skip-stack-trace --skip-core-file
--skip-stack-trace --skip-core-file --loose-debug-on=1

View File

@@ -1,2 +1,2 @@
--skip-stack-trace --skip-core-file
--skip-stack-trace --skip-core-file --loose-debug-on=1

View File

@@ -179,6 +179,22 @@ let $mvr_crash_statement= set global maria_checkpoint_interval=1;
show create table t1;
drop table t1;
--echo * TEST of UNDO_ROW_DELETE preserving rowid
# we want recovery to use the tables as they were at time of crash
let $mvr_restore_old_snapshot=0;
# UNDO phase prevents physical comparison, normally,
# so we'll only use checksums to compare.
let $mms_compare_physically=0;
let $mvr_crash_statement= set global maria_checkpoint_interval=1;
create table t1(a int) engine=maria;
insert into t1 values(1),(2);
-- source include/maria_make_snapshot_for_comparison.inc
lock tables t1 write;
insert into t1 values(3);
delete from t1 where a in (1,2,3);
-- source include/maria_verify_recovery.inc
drop table t1;
# clean up everything
let $mms_purpose=feeding_recovery;
eval drop database mysqltest_for_$mms_purpose;

View File

@@ -5,10 +5,11 @@
-- source include/have_maria.inc
let $default=`select @@global.storage_engine`;
let $default_engine=`select @@global.storage_engine`;
let $default_checksum=`select @@global.maria_page_checksum`;
set global storage_engine=maria;
set session storage_engine=maria;
set global maria_page_checksum=0;
set global maria_log_file_size=4294967296;
# Initialise
@@ -1306,6 +1307,14 @@ show variables like 'maria%';
--replace_column 2 #
show status like 'maria%';
#
# Show that page_checksum is remembered
#
set global maria_page_checksum=1;
create table t1 (a int);
show create table t1;
drop table t1;
#
# Show that we can't yet create fulltext or spatial index with Maria
#
@@ -1322,6 +1331,6 @@ drop table if exists t1;
--disable_result_log
--disable_query_log
eval set global storage_engine=$default;
eval set global storage_engine=$default_engine, maria_page_checksum=$default_checksum;
--enable_result_log
--enable_query_log

View File

@@ -1058,9 +1058,9 @@ static void __cdecl kill_server(int sig_ptr)
*/
if (!SetEvent(smem_event_connect_request))
{
DBUG_PRINT("error",
("Got error: %ld from SetEvent of smem_event_connect_request",
GetLastError()));
DBUG_PRINT("error",
("Got error: %ld from SetEvent of smem_event_connect_request",
GetLastError()));
}
#endif
@@ -5119,7 +5119,7 @@ enum options_mysqld
OPT_SECURE_FILE_PRIV,
OPT_MIN_EXAMINED_ROW_LIMIT,
OPT_LOG_SLOW_SLAVE_STATEMENTS,
OPT_DEBUG_CRC, OPT_OLD_MODE
OPT_DEBUG_CRC, OPT_DEBUG_ON, OPT_OLD_MODE
};
@@ -5248,6 +5248,11 @@ struct my_option my_long_options[] =
"Call my_debug_put_break_here() if crc matches this number (for debug).",
(uchar**) &opt_my_crc_dbug_check, (uchar**) &opt_my_crc_dbug_check,
0, GET_ULONG, REQUIRED_ARG, 0, 0, ~(ulong) 0L, 0, 0, 0},
{"debug-on", OPT_DEBUG_ON,
"Enable all DBUG commands. Needed if you want to use DBUG_EXECUTE without "
"starting mysqld with --debug",
(uchar**) &_dbug_on_, (uchar**) 0, 0, GET_BOOL, NO_ARG, 1,
0, 0, 0, 0, 0},
#endif
{"default-character-set", 'C', "Set the default character set (deprecated option, use --character-set-server instead).",
(uchar**) &default_character_set_name, (uchar**) &default_character_set_name,
@@ -7295,6 +7300,7 @@ mysqld_get_one_option(int optid,
#ifndef DBUG_OFF
DBUG_SET_INITIAL(argument ? argument : default_dbug_option);
#endif
DEBUGGER_ON;
opt_endinfo=1; /* unireg: memory allocation */
break;
case 'a':

View File

@@ -1185,8 +1185,10 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
key_info= table->key_info;
bzero((char*) &create_info, sizeof(create_info));
/* Allow update_create_info to update row type */
/* Allow update_create_info to update row type, page checksums and options */
create_info.row_type= share->row_type;
create_info.page_checksum= share->page_checksum;
create_info.options= share->db_create_options;
file->update_create_info(&create_info);
primary_key= share->primary_key;
@@ -1367,19 +1369,19 @@ int store_create_info(THD *thd, TABLE_LIST *table_list, String *packet,
packet->append(buff, (uint) (end - buff));
}
if (share->db_create_options & HA_OPTION_PACK_KEYS)
if (create_info.options & HA_OPTION_PACK_KEYS)
packet->append(STRING_WITH_LEN(" PACK_KEYS=1"));
if (share->db_create_options & HA_OPTION_NO_PACK_KEYS)
if (create_info.options & HA_OPTION_NO_PACK_KEYS)
packet->append(STRING_WITH_LEN(" PACK_KEYS=0"));
/* We use CHECKSUM, instead of TABLE_CHECKSUM, for backward compability */
if (share->db_create_options & HA_OPTION_CHECKSUM)
if (create_info.options & HA_OPTION_CHECKSUM)
packet->append(STRING_WITH_LEN(" CHECKSUM=1"));
if (share->page_checksum != HA_CHOICE_UNDEF)
if (create_info.page_checksum != HA_CHOICE_UNDEF)
{
packet->append(STRING_WITH_LEN(" PAGE_CHECKSUM="));
packet->append(ha_choice_values[(uint) share->page_checksum], 1);
packet->append(ha_choice_values[create_info.page_checksum], 1);
}
if (share->db_create_options & HA_OPTION_DELAY_KEY_WRITE)
if (create_info.options & HA_OPTION_DELAY_KEY_WRITE)
packet->append(STRING_WITH_LEN(" DELAY_KEY_WRITE=1"));
if (create_info.row_type != ROW_TYPE_DEFAULT)
{

View File

@@ -30,7 +30,8 @@ DEFS = @DEFS@
# "." is needed first because tests in unittest need libmaria
SUBDIRS = . unittest
EXTRA_DIST = ma_test_all.sh ma_test_all.res ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
EXTRA_DIST = ma_test_all.sh ma_test_all.res ma_test_big.sh \
ma_ft_stem.c CMakeLists.txt plug.in ma_test_recovery
pkgdata_DATA = ma_test_all ma_test_all.res ma_test_recovery
pkglib_LIBRARIES = libmaria.a
bin_PROGRAMS = maria_chk maria_pack maria_ftdump maria_read_log

View File

@@ -2169,6 +2169,12 @@ void ha_maria::update_create_info(HA_CREATE_INFO *create_info)
if (create_info->row_type != ROW_TYPE_DEFAULT &&
!(create_info->used_fields & HA_CREATE_USED_ROW_FORMAT))
create_info->row_type= get_row_type();
/*
Show always page checksums, as this can be forced with
maria_page_checksums variable
*/
if (file->s->options & HA_OPTION_PAGE_CHECKSUM)
create_info->page_checksum= HA_CHOICE_YES;
}
@@ -2267,7 +2273,8 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
create_flags|= HA_CREATE_CHECKSUM;
if (options & HA_OPTION_DELAY_KEY_WRITE)
create_flags|= HA_CREATE_DELAY_KEY_WRITE;
if ((ha_create_info->page_checksum == HA_CHOICE_UNDEF && maria_page_checksums) ||
if ((ha_create_info->page_checksum == HA_CHOICE_UNDEF &&
maria_page_checksums) ||
ha_create_info->page_checksum == HA_CHOICE_YES)
create_flags|= HA_CREATE_PAGE_CHECKSUM;

View File

@@ -319,8 +319,8 @@ my_bool _ma_bitmap_flush(MARIA_SHARE *share)
pthread_mutex_lock(&share->bitmap.bitmap_lock);
if (share->bitmap.changed)
{
res= write_changed_bitmap(share, &share->bitmap);
share->bitmap.changed= 0;
res= write_changed_bitmap(share, &share->bitmap);
}
pthread_mutex_unlock(&share->bitmap.bitmap_lock);
}
@@ -328,6 +328,38 @@ my_bool _ma_bitmap_flush(MARIA_SHARE *share)
}
/*
@brief Send updated bitmap to the page cache if bitmap is free
@note
This is used by reader threads which don't unpin things
*/
my_bool _ma_bitmap_wait_or_flush(MARIA_SHARE *share)
{
my_bool res= 0;
MARIA_FILE_BITMAP *bitmap= &share->bitmap;
DBUG_ENTER("_ma_bitmap_flush");
if (bitmap->changed)
{
pthread_mutex_lock(&bitmap->bitmap_lock);
while (bitmap->non_flushable && bitmap->changed)
{
DBUG_PRINT("info", ("waiting for bitmap to be flushable"));
pthread_cond_wait(&bitmap->bitmap_cond, &bitmap->bitmap_lock);
}
if (bitmap->changed)
{
bitmap->changed= 0;
res= write_changed_bitmap(share, bitmap);
}
pthread_mutex_unlock(&bitmap->bitmap_lock);
}
DBUG_RETURN(res);
}
/**
Dirty-page filtering criteria for bitmap pages
@@ -910,9 +942,9 @@ static void fill_block(MARIA_FILE_BITMAP *bitmap,
/* For each 6 bytes we have 6*8/3= 16 patterns */
page= (best_data - bitmap->map) / 6 * 16 + best_pos;
block->page= bitmap->page + 1 + page;
block->page_count= 1 + TAIL_BIT;
block->page_count= TAIL_PAGE_COUNT_MARKER;
block->empty_space= pattern_to_size(bitmap, best_bits);
block->sub_blocks= 1;
block->sub_blocks= 0;
block->org_bitmap_value= best_bits;
block->used= BLOCKUSED_TAIL; /* See _ma_bitmap_release_unused() */
@@ -1244,7 +1276,7 @@ static ulong allocate_full_pages(MARIA_FILE_BITMAP *bitmap,
block->page= bitmap->page + 1 + page;
block->page_count= best_area_size;
block->empty_space= 0;
block->sub_blocks= 1;
block->sub_blocks= 0;
block->org_bitmap_value= 0;
block->used= 0;
DBUG_PRINT("info", ("page: %lu page_count: %u",
@@ -1432,6 +1464,7 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
rest_length= 0;
}
first_block_pos= info->bitmap_blocks.elements;
if (pages)
{
MARIA_BITMAP_BLOCK *block;
@@ -1439,15 +1472,17 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
info->bitmap_blocks.elements +
pages / BLOB_SEGMENT_MIN_SIZE + 2))
DBUG_RETURN(1);
first_block_pos= info->bitmap_blocks.elements;
block= dynamic_element(&info->bitmap_blocks, info->bitmap_blocks.elements,
MARIA_BITMAP_BLOCK*);
first_block= block;
do
{
/*
We use 0x3fff here as the two upmost bits are reserved for
TAIL_BIT and START_EXTENT_BIT
*/
used= allocate_full_pages(bitmap,
(pages >= 65535 ? 65535 : (uint) pages), block,
0);
(pages >= 0x3fff ? 0x3fff : (uint) pages),
block, 0);
if (!used)
{
if (move_to_next_bitmap(info, bitmap))
@@ -1464,8 +1499,9 @@ static my_bool find_blob(MARIA_HA *info, ulong length)
if (rest_length && find_tail(info, rest_length,
info->bitmap_blocks.elements++))
DBUG_RETURN(1);
if (first_block)
first_block->sub_blocks= info->bitmap_blocks.elements - first_block_pos;
first_block= dynamic_element(&info->bitmap_blocks, first_block_pos,
MARIA_BITMAP_BLOCK*);
first_block->sub_blocks= info->bitmap_blocks.elements - first_block_pos;
DBUG_RETURN(0);
}
@@ -1535,7 +1571,6 @@ static void use_head(MARIA_HA *info, ulonglong page, uint size,
block->page= page;
block->page_count= 1 + TAIL_BIT;
block->empty_space= size;
block->sub_blocks= 1;
block->used= BLOCKUSED_TAIL;
/*
@@ -1572,9 +1607,16 @@ static void use_head(MARIA_HA *info, ulonglong page, uint size,
static uint find_where_to_split_row(MARIA_SHARE *share, MARIA_ROW *row,
uint extents_length, uint split_size)
{
uint row_length= row->base_length;
uint *lengths, *lengths_end;
/*
Ensure we have the minimum required space on head page:
- Header + length of field lengths (row->min_length)
- Number of extents
- One extent
*/
uint row_length= (row->min_length +
size_to_store_key_length(extents_length) +
ROW_EXTENT_SIZE);
DBUG_ASSERT(row_length < split_size);
/*
Store first in all_field_lengths the different parts that are written
@@ -1716,14 +1758,19 @@ my_bool _ma_bitmap_find_place(MARIA_HA *info, MARIA_ROW *row,
}
/*
First allocate all blobs (so that we can find out the needed size for
First allocate all blobs so that we can find out the needed size for
the main block.
*/
if (row->blob_length && allocate_blobs(info, row))
goto abort;
extents_length= row->extents_count * ROW_EXTENT_SIZE;
if ((head_length= (row->head_length + extents_length)) <= max_page_size)
/*
The + 3 here is space to be able to store the number of segments
in the row header.
*/
if ((head_length= (row->head_length + extents_length + 3)) <=
max_page_size)
{
/* Main row part fits into one page */
position= ELEMENTS_RESERVED_FOR_MAIN_PART - 1;
@@ -1747,6 +1794,7 @@ my_bool _ma_bitmap_find_place(MARIA_HA *info, MARIA_ROW *row,
if (find_head(info, row_length, position))
goto abort;
row->space_on_head_page= row_length;
rest_length= head_length - row_length;
if (write_rest_of_head(info, position, rest_length))
goto abort;
@@ -1820,11 +1868,12 @@ my_bool _ma_bitmap_find_new_place(MARIA_HA *info, MARIA_ROW *row,
goto abort;
extents_length= row->extents_count * ROW_EXTENT_SIZE;
if ((head_length= (row->head_length + extents_length)) <= free_size)
if ((head_length= (row->head_length + extents_length + 3)) <= free_size)
{
/* Main row part fits into one page */
position= ELEMENTS_RESERVED_FOR_MAIN_PART - 1;
use_head(info, page, head_length, position);
row->space_on_head_page= head_length;
goto end;
}
@@ -1838,8 +1887,9 @@ my_bool _ma_bitmap_find_new_place(MARIA_HA *info, MARIA_ROW *row,
if (head_length - row_length < MAX_TAIL_SIZE(share->block_size))
position= ELEMENTS_RESERVED_FOR_MAIN_PART -2; /* Only head and tail */
use_head(info, page, row_length, position);
rest_length= head_length - row_length;
row->space_on_head_page= row_length;
rest_length= head_length - row_length;
if (write_rest_of_head(info, position, rest_length))
goto abort;
@@ -1936,13 +1986,13 @@ static my_bool set_page_bits(MARIA_HA *info, MARIA_FILE_BITMAP *bitmap,
~0 Error (couldn't read page)
*/
static uint get_page_bits(MARIA_HA *info, MARIA_FILE_BITMAP *bitmap,
ulonglong page)
uint _ma_bitmap_get_page_bits(MARIA_HA *info, MARIA_FILE_BITMAP *bitmap,
ulonglong page)
{
ulonglong bitmap_page;
uint offset_page, offset, tmp;
uchar *data;
DBUG_ENTER("get_page_bits");
DBUG_ENTER("_ma_bitmap_get_page_bits");
bitmap_page= page - page % bitmap->pages_covered;
if (bitmap_page != bitmap->page &&
@@ -1994,6 +2044,8 @@ my_bool _ma_bitmap_reset_full_page_bits(MARIA_HA *info,
safe_mutex_assert_owner(&info->s->bitmap.bitmap_lock);
bitmap_page= page - page % bitmap->pages_covered;
DBUG_ASSERT(page != bitmap_page);
if (bitmap_page != bitmap->page &&
_ma_change_bitmap_page(info, bitmap, bitmap_page))
DBUG_RETURN(1);
@@ -2116,6 +2168,7 @@ my_bool _ma_bitmap_set_full_page_bits(MARIA_HA *info,
/**
@brief
Make a transition of MARIA_FILE_BITMAP::non_flushable.
If the bitmap becomes flushable, which requires that REDO-UNDO has been
logged and all bitmap pages touched by the thread have a correct
@@ -2125,29 +2178,34 @@ my_bool _ma_bitmap_set_full_page_bits(MARIA_HA *info,
unless a concurrent _ma_bitmap_flush_all() is happening, in which case the
function first waits for the flush to be done.
@note
info->non_flushable_state is set to 1 if we have incremented
bitmap->info->non_flushable and not yet decremented it.
@param share Table's share
@param non_flushable_inc Increment of MARIA_FILE_BITMAP::non_flushable
(-1 or +1).
*/
void _ma_bitmap_flushable(MARIA_SHARE *share, int non_flushable_inc)
void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc)
{
MARIA_SHARE *share= info->s;
MARIA_FILE_BITMAP *bitmap;
/*
Not transactional tables are never automaticly flushed and needs no
protection
*/
#ifndef EXTRA_DEBUG
if (!share->now_transactional)
return;
#endif
bitmap= &share->bitmap;
if (non_flushable_inc == -1)
{
pthread_mutex_lock(&bitmap->bitmap_lock);
DBUG_ASSERT(bitmap->non_flushable > 0);
DBUG_ASSERT((int) bitmap->non_flushable > 0 &&
info->non_flushable_state == 1);
info->non_flushable_state= 0;
if (--bitmap->non_flushable == 0)
{
_ma_bitmap_unpin_all(share);
@@ -2161,7 +2219,7 @@ void _ma_bitmap_flushable(MARIA_SHARE *share, int non_flushable_inc)
pthread_mutex_unlock(&bitmap->bitmap_lock);
return;
}
DBUG_ASSERT(non_flushable_inc == 1);
DBUG_ASSERT(non_flushable_inc == 1 && info->non_flushable_state == 0);
/* It is a read without mutex because only an optimization */
if (unlikely(bitmap->flush_all_requested))
{
@@ -2189,6 +2247,7 @@ void _ma_bitmap_flushable(MARIA_SHARE *share, int non_flushable_inc)
touch it we will take the mutex.
*/
bitmap->non_flushable++;
info->non_flushable_state= 1;
DBUG_PRINT("info", ("bitmap->non_flushable: %u", bitmap->non_flushable));
}
@@ -2240,17 +2299,24 @@ my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks)
/* First handle head block */
if (block->used & BLOCKUSED_USED)
{
DBUG_PRINT("info", ("head empty_space: %u", block->empty_space));
DBUG_PRINT("info", ("head page: %lu empty_space: %u",
(ulong) block->page, block->empty_space));
bits= _ma_free_size_to_head_pattern(bitmap, block->empty_space);
if (block->used & BLOCKUSED_USE_ORG_BITMAP)
current_bitmap_value= block->org_bitmap_value;
}
else
bits= block->org_bitmap_value;
if (bits != current_bitmap_value &&
set_page_bits(info, bitmap, block->page, bits))
goto err;
if (bits != current_bitmap_value)
{
if (set_page_bits(info, bitmap, block->page, bits))
goto err;
}
else
{
DBUG_ASSERT(current_bitmap_value ==
_ma_bitmap_get_page_bits(info, bitmap, block->page));
}
/* Handle all full pages and tail pages (for head page and blob) */
for (block++; block < end; block++)
@@ -2262,12 +2328,16 @@ my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks)
page_count= block->page_count;
if (block->used & BLOCKUSED_TAIL)
{
current_bitmap_value= FULL_TAIL_PAGE;
/* The bitmap page is only one page */
page_count= 1;
if (block->used & BLOCKUSED_USED)
{
DBUG_PRINT("info", ("tail empty_space: %u", block->empty_space));
DBUG_PRINT("info", ("tail page: %lu empty_space: %u",
(ulong) block->page, block->empty_space));
bits= free_size_to_tail_pattern(bitmap, block->empty_space);
if (block->used & BLOCKUSED_USE_ORG_BITMAP)
current_bitmap_value= block->org_bitmap_value;
}
else
bits= block->org_bitmap_value;
@@ -2276,7 +2346,7 @@ my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks)
The page has all bits set; The following test is an optimization
to not set the bits to the same value as before.
*/
if (bits != FULL_TAIL_PAGE &&
if (bits != current_bitmap_value &&
set_page_bits(info, bitmap, block->page, bits))
goto err;
}
@@ -2286,13 +2356,19 @@ my_bool _ma_bitmap_release_unused(MARIA_HA *info, MARIA_BITMAP_BLOCKS *blocks)
goto err;
}
if (--bitmap->non_flushable == 0)
if (info->s->now_transactional)
{
_ma_bitmap_unpin_all(info->s);
if (unlikely(bitmap->flush_all_requested))
DBUG_ASSERT((int) bitmap->non_flushable >= 0 &&
info->non_flushable_state);
info->non_flushable_state= 0;
if (--bitmap->non_flushable == 0)
{
DBUG_PRINT("info", ("bitmap flushable waking up flusher"));
pthread_cond_broadcast(&bitmap->bitmap_cond);
_ma_bitmap_unpin_all(info->s);
if (unlikely(bitmap->flush_all_requested))
{
DBUG_PRINT("info", ("bitmap flushable waking up flusher"));
pthread_cond_broadcast(&bitmap->bitmap_cond);
}
}
}
DBUG_PRINT("info", ("bitmap->non_flushable: %u", bitmap->non_flushable));
@@ -2327,28 +2403,29 @@ err:
my_bool _ma_bitmap_free_full_pages(MARIA_HA *info, const uchar *extents,
uint count)
{
MARIA_FILE_BITMAP *bitmap= &info->s->bitmap;
DBUG_ENTER("_ma_bitmap_free_full_pages");
pthread_mutex_lock(&info->s->bitmap.bitmap_lock);
pthread_mutex_lock(&bitmap->bitmap_lock);
for (; count--; extents+= ROW_EXTENT_SIZE)
{
ulonglong page= uint5korr(extents);
uint page_count= uint2korr(extents + ROW_EXTENT_PAGE_SIZE);
uint page_count= (uint2korr(extents + ROW_EXTENT_PAGE_SIZE) &
~START_EXTENT_BIT);
if (!(page_count & TAIL_BIT))
{
if (page == 0 && page_count == 0)
continue; /* Not used extent */
if (pagecache_delete_pages(info->s->pagecache, &info->dfile, page,
page_count, PAGECACHE_LOCK_WRITE, 1) ||
_ma_bitmap_reset_full_page_bits(info, &info->s->bitmap, page,
page_count))
_ma_bitmap_reset_full_page_bits(info, bitmap, page, page_count))
{
pthread_mutex_unlock(&info->s->bitmap.bitmap_lock);
pthread_mutex_unlock(&bitmap->bitmap_lock);
DBUG_RETURN(1);
}
}
}
pthread_mutex_unlock(&info->s->bitmap.bitmap_lock);
pthread_mutex_unlock(&bitmap->bitmap_lock);
DBUG_RETURN(0);
}
@@ -2429,8 +2506,8 @@ my_bool _ma_check_bitmap_data(MARIA_HA *info,
bits= 0; /* to satisfy compiler */
DBUG_ASSERT(0);
}
return (*bitmap_pattern= get_page_bits(info, &info->s->bitmap, page)) !=
bits;
return ((*bitmap_pattern= _ma_bitmap_get_page_bits(info, &info->s->bitmap,
page)) != bits);
}
@@ -2458,7 +2535,8 @@ my_bool _ma_check_if_right_bitmap_type(MARIA_HA *info,
ulonglong page,
uint *bitmap_pattern)
{
if ((*bitmap_pattern= get_page_bits(info, &info->s->bitmap, page)) > 7)
if ((*bitmap_pattern= _ma_bitmap_get_page_bits(info, &info->s->bitmap,
page)) > 7)
return 1; /* Couldn't read page */
switch (page_type) {
case HEAD_PAGE:

File diff suppressed because it is too large Load Diff

View File

@@ -38,6 +38,9 @@
#define BLOCK_FILLER_SIZE 2
#define ROW_EXTENT_SIZE (ROW_EXTENT_PAGE_SIZE + ROW_EXTENT_COUNT_SIZE)
#define TAIL_BIT 0x8000 /* Bit in page_count to signify tail */
#define START_EXTENT_BIT 0x4000 /* Bit in page_count to signify start*/
/* page_count set by bitmap code for tail pages */
#define TAIL_PAGE_COUNT_MARKER 0xffff
/* Number of extents reserved MARIA_BITMAP_BLOCKS to store head part */
#define ELEMENTS_RESERVED_FOR_MAIN_PART 4
/* This is just used to prealloc a dynamic array */
@@ -175,6 +178,7 @@ my_bool _ma_compare_block_record(register MARIA_HA *info,
my_bool _ma_bitmap_init(MARIA_SHARE *share, File file);
my_bool _ma_bitmap_end(MARIA_SHARE *share);
my_bool _ma_bitmap_flush(MARIA_SHARE *share);
my_bool _ma_bitmap_wait_or_flush(MARIA_SHARE *share);
my_bool _ma_bitmap_flush_all(MARIA_SHARE *share);
void _ma_bitmap_reset_cache(MARIA_SHARE *share);
my_bool _ma_bitmap_find_place(MARIA_HA *info, MARIA_ROW *row,
@@ -201,9 +205,11 @@ my_bool _ma_check_if_right_bitmap_type(MARIA_HA *info,
enum en_page_type page_type,
ulonglong page,
uint *bitmap_pattern);
uint _ma_bitmap_get_page_bits(MARIA_HA *info, MARIA_FILE_BITMAP *bitmap,
ulonglong page);
void _ma_bitmap_delete_all(MARIA_SHARE *share);
int _ma_bitmap_create_first(MARIA_SHARE *share);
void _ma_bitmap_flushable(MARIA_SHARE *share, int non_flushable_inc);
void _ma_bitmap_flushable(MARIA_HA *info, int non_flushable_inc);
#ifndef DBUG_OFF
void _ma_print_bitmap(MARIA_FILE_BITMAP *bitmap, uchar *data,
ulonglong page);

View File

@@ -41,7 +41,11 @@
*/
#include "ma_ftdefs.h"
#include <myisamchk.h>
#include "ma_rt_index.h"
#include "ma_blockrec.h"
#include "trnman.h"
#include "ma_key_recover.h"
#include <stdarg.h>
#include <my_getopt.h>
#ifdef HAVE_SYS_VADVISE_H
@@ -50,9 +54,6 @@
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include "ma_rt_index.h"
#include "ma_blockrec.h"
#include "trnman_public.h"
/* Functions defined in this file */
@@ -226,7 +227,7 @@ int maria_chk_del(HA_CHECK *param, register MARIA_HA *info, uint test_flag)
empty+=share->base.pack_reclength;
}
}
if (test_flag & T_VERBOSE)
if (info->state->del && (test_flag & T_VERBOSE))
puts("\n");
if (empty != info->state->empty)
{
@@ -255,7 +256,8 @@ int maria_chk_del(HA_CHECK *param, register MARIA_HA *info, uint test_flag)
wrong:
param->testflag|=T_RETRY_WITHOUT_QUICK;
if (test_flag & T_VERBOSE) puts("");
if (test_flag & T_VERBOSE)
puts("");
_ma_check_print_error(param,"record delete-link-chain corrupted");
DBUG_RETURN(1);
} /* maria_chk_del */
@@ -273,6 +275,9 @@ static int check_k_link(HA_CHECK *param, register MARIA_HA *info,
uchar *buff;
DBUG_ENTER("check_k_link");
if (next_link == HA_OFFSET_ERROR)
DBUG_RETURN(0); /* Avoid printing empty line */
records= (ha_rows) (info->state->key_file_length / block_size);
while (next_link != HA_OFFSET_ERROR && records > 0)
{
@@ -446,7 +451,8 @@ int maria_chk_key(HA_CHECK *param, register MARIA_HA *info)
DBUG_RETURN(-1);
}
if (!(param->testflag & T_SILENT)) puts("- check index reference");
if (!(param->testflag & T_SILENT))
puts("- check index reference");
all_keydata=all_totaldata=key_totlength=0;
init_checksum=param->record_checksum;
@@ -1627,7 +1633,7 @@ static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, uchar *record,
{
uint page, page_count, page_type;
page= uint5korr(extents);
page_count= uint2korr(extents+5);
page_count= uint2korr(extents+5) & ~START_EXTENT_BIT;
extents+= ROW_EXTENT_SIZE;
page_type= BLOB_PAGE;
if (page_count & TAIL_BIT)
@@ -1635,6 +1641,11 @@ static my_bool check_head_page(HA_CHECK *param, MARIA_HA *info, uchar *record,
page_count= 1;
page_type= TAIL_PAGE;
}
/*
TODO OPTIMIZE:
Check the whole extent with one test and only do the loop if
something is wrong (for exact error reporting)
*/
for ( ; page_count--; page++)
{
uint bitmap_pattern;
@@ -2638,8 +2649,8 @@ int maria_sort_index(HA_CHECK *param, register MARIA_HA *info, char *name)
int old_lock;
MARIA_SHARE *share= info->s;
MARIA_STATE_INFO old_state;
myf sync_dir= (share->now_transactional && !share->temporary) ?
MY_SYNC_DIR : 0;
myf sync_dir= ((share->now_transactional && !share->temporary) ?
MY_SYNC_DIR : 0);
DBUG_ENTER("maria_sort_index");
/* cannot sort index files with R-tree indexes */
@@ -3388,8 +3399,8 @@ int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
MARIA_SORT_INFO sort_info;
ulonglong key_map=share->state.key_map;
pthread_attr_t thr_attr;
myf sync_dir= (share->now_transactional && !share->temporary) ?
MY_SYNC_DIR : 0;
myf sync_dir= ((share->now_transactional && !share->temporary) ?
MY_SYNC_DIR : 0);
DBUG_ENTER("maria_repair_parallel");
got_error= 1;
@@ -4874,6 +4885,7 @@ static int sort_insert_key(MARIA_SORT_PARAM *sort_param,
key_file_length=info->state->key_file_length;
if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) == HA_OFFSET_ERROR)
DBUG_RETURN(1);
_ma_fast_unlock_key_del(info);
/* If we read the page from the key cache, we have to write it back to it */
if (page_link->changed)
@@ -4997,7 +5009,7 @@ int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param)
bzero(key_block->buff+length, keyinfo->block_length-length);
if ((filepos= _ma_new(info, DFLT_INIT_HITS, &page_link)) ==
HA_OFFSET_ERROR)
DBUG_RETURN(1);
goto err;
/* If we read the page from the key cache, we have to write it back */
if (page_link->changed)
@@ -5006,20 +5018,25 @@ int _ma_flush_pending_blocks(MARIA_SORT_PARAM *sort_param)
if (_ma_write_keypage(info, keyinfo, filepos,
PAGECACHE_LOCK_WRITE_UNLOCK,
DFLT_INIT_HITS, key_block->buff))
DBUG_RETURN(1);
goto err;
}
else
{
put_crc(key_block->buff, filepos, info->s);
if (my_pwrite(info->s->kfile.file, key_block->buff,
(uint) keyinfo->block_length,filepos, myf_rw))
DBUG_RETURN(1);
goto err;
}
DBUG_DUMP("buff",key_block->buff,length);
nod_flag=1;
}
info->s->state.key_root[sort_param->key]=filepos; /* Last is root for tree */
_ma_fast_unlock_key_del(info);
DBUG_RETURN(0);
err:
_ma_fast_unlock_key_del(info);
DBUG_RETURN(1);
} /* _ma_flush_pending_blocks */
/* alloc space and pointers for key_blocks */

View File

@@ -32,6 +32,9 @@ int maria_close(register MARIA_HA *info)
(long) info, (uint) share->reopen,
(uint) share->tot_locks));
/* Check that we have unlocked key delete-links properly */
DBUG_ASSERT(info->used_key_del == 0);
pthread_mutex_lock(&THR_LOCK_maria);
if (info->lock_type == F_EXTRA_LCK)
info->lock_type=F_UNLCK; /* HA_EXTRA_NO_USER_CHANGE */

View File

@@ -1339,6 +1339,7 @@ int _ma_update_create_rename_lsn_sub(MARIA_SHARE *share,
translog_deassign_id_from_share(share);
}
return my_pwrite(file, buf, sizeof(buf),
sizeof(share->state.header) + 2, MYF(MY_NABP)) ||
sizeof(share->state.header) +
MARIA_FILE_CREATE_RENAME_LSN_OFFSET, MYF(MY_NABP)) ||
(do_sync && my_sync(file, MYF(0)));
}

View File

@@ -192,6 +192,9 @@ int _ma_ck_delete(register MARIA_HA *info, uint keynr, uchar *key,
log_type= LOGREC_UNDO_KEY_DELETE_WITH_ROOT;
}
/* Log also position to row */
key_length+= share->rec_reflength;
/*
Note that for delete key, we don't log the reference to the record.
This is because the row may be inserted at a different place when
@@ -652,12 +655,12 @@ static int del(register MARIA_HA *info, MARIA_KEYDEF *keyinfo,
new_leaf_length))
goto err;
leaf_page_link->changed= 1; /* Safety */
if (new_leaf_length <= (info->quick_mode ? MARIA_MIN_KEYBLOCK_LENGTH :
(uint) keyinfo->underflow_block_length))
{
/* Underflow, leaf_page will be written by caller */
ret_value= 1;
leaf_page_link->changed= 1; /* Safety */
}
else
{

View File

@@ -380,13 +380,6 @@ int maria_extra(MARIA_HA *info, enum ha_extra_function function,
maria_mark_crashed(info); /* Fatal error found */
}
}
if (share->base.blobs && info->rec_buff_size >
share->base.default_rec_buff_size)
{
info->rec_buff_size= 1; /* Force realloc */
_ma_alloc_buffer(&info->rec_buff, &info->rec_buff_size,
share->base.default_rec_buff_size);
}
break;
case HA_EXTRA_NORMAL: /* Theese isn't in use */
info->quick_mode= 0;
@@ -489,13 +482,22 @@ int maria_reset(MARIA_HA *info)
info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
error= end_io_cache(&info->rec_cache);
}
if (share->base.blobs && info->rec_buff_size >
share->base.default_rec_buff_size)
/* Free memory used for keeping blobs */
if (share->base.blobs)
{
if (info->rec_buff_size > share->base.default_rec_buff_size)
{
info->rec_buff_size= 1; /* Force realloc */
_ma_alloc_buffer(&info->rec_buff, &info->rec_buff_size,
share->base.default_rec_buff_size);
}
if (info->blob_buff_size > MARIA_SMALL_BLOB_BUFFER)
{
info->blob_buff_size= 1; /* Force realloc */
_ma_alloc_buffer(&info->blob_buff, &info->blob_buff_size,
MARIA_SMALL_BLOB_BUFFER);
}
}
#if defined(HAVE_MMAP) && defined(HAVE_MADVISE)
if (info->opt_flag & MEMMAP_USED)
madvise((char*) share->file_map, share->state.state.data_file_length,

View File

@@ -33,8 +33,8 @@
undo (like on duplicate key errors)
@note
We unpin pages in the reverse order as they where pinned; This may not
be strictly necessary but may simplify things in the future.
We unpin pages in the reverse order as they where pinned; This is not
necessary now, but may simplify things in the future.
@return
@retval 0 ok
@@ -54,8 +54,15 @@ void _ma_unpin_all_pages(MARIA_HA *info, LSN undo_lsn)
while (pinned_page-- != page_link)
{
/*
Note this assert fails if we got a disk error or the record file
is corrupted, which means we should have this enabled only in debug
builds.
*/
#ifdef EXTRA_DEBUG
DBUG_ASSERT(!pinned_page->changed ||
undo_lsn != LSN_IMPOSSIBLE || !info->s->now_transactional);
#endif
pagecache_unlock_by_link(info->s->pagecache, pinned_page->link,
pinned_page->unlock, PAGECACHE_UNPIN,
info->trn->rec_lsn, undo_lsn,
@@ -595,6 +602,7 @@ uint _ma_apply_redo_index_new_page(MARIA_HA *info, LSN lsn,
else if (lsn_korr(buff) >= lsn)
{
/* Already applied */
DBUG_PRINT("info", ("Page is up to date, skipping redo"));
result= 0;
goto err;
}
@@ -603,6 +611,7 @@ uint _ma_apply_redo_index_new_page(MARIA_HA *info, LSN lsn,
}
/* Write modified page */
bzero(buff, LSN_STORE_SIZE);
memcpy(buff + LSN_STORE_SIZE, header, length);
bzero(buff + LSN_STORE_SIZE + length,
share->block_size - LSN_STORE_SIZE - KEYPAGE_CHECKSUM_SIZE - length);
@@ -772,6 +781,7 @@ uint _ma_apply_redo_index(MARIA_HA *info,
if (lsn_korr(buff) >= lsn)
{
/* Already applied */
DBUG_PRINT("info", ("Page is up to date, skipping redo"));
result= 0;
goto err;
}
@@ -905,6 +915,8 @@ err:
PAGECACHE_LOCK_WRITE_UNLOCK,
PAGECACHE_UNPIN, LSN_IMPOSSIBLE,
LSN_IMPOSSIBLE, 0);
if (result)
_ma_mark_file_crashed(share);
DBUG_RETURN(result);
}
@@ -941,7 +953,8 @@ my_bool _ma_apply_undo_key_insert(MARIA_HA *info, LSN undo_lsn,
new_root= share->state.key_root[keynr];
res= _ma_ck_real_delete(info, share->keyinfo+keynr, key,
length - share->rec_reflength, &new_root);
if (res)
_ma_mark_file_crashed(share);
msg.root= &share->state.key_root[keynr];
msg.value= new_root;
msg.keynr= keynr;
@@ -951,6 +964,7 @@ my_bool _ma_apply_undo_key_insert(MARIA_HA *info, LSN undo_lsn,
0, 0, &lsn, (void*) &msg))
res= 1;
_ma_fast_unlock_key_del(info);
_ma_unpin_all_pages_and_finalize_row(info, lsn);
DBUG_RETURN(res);
}
@@ -979,14 +993,15 @@ my_bool _ma_apply_undo_key_delete(MARIA_HA *info, LSN undo_lsn,
/* We have to copy key as _ma_ck_real_write_btree() may change it */
memcpy(key, header + KEY_NR_STORE_SIZE, length);
_ma_dpointer(info, key + length, info->cur_row.lastpos);
DBUG_DUMP("key", key, length + share->rec_reflength);
DBUG_DUMP("key", key, length);
new_root= share->state.key_root[keynr];
res= _ma_ck_real_write_btree(info, share->keyinfo+keynr, key,
length,
length - share->rec_reflength,
&new_root,
share->keyinfo[keynr].write_comp_flag);
if (res)
_ma_mark_file_crashed(share);
msg.root= &share->state.key_root[keynr];
msg.value= new_root;
@@ -998,6 +1013,7 @@ my_bool _ma_apply_undo_key_delete(MARIA_HA *info, LSN undo_lsn,
(void*) &msg))
res= 1;
_ma_fast_unlock_key_del(info);
_ma_unpin_all_pages_and_finalize_row(info, lsn);
DBUG_RETURN(res);
}

View File

@@ -497,9 +497,7 @@ int _ma_test_if_changed(register MARIA_HA *info)
/*
Put a mark in the .MYI file that someone is updating the table
DOCUMENTATION
state.open_count in the .MYI file is used the following way:
- For the first change of the .MYI file in this process open_count is
incremented by _ma_mark_file_changed(). (We have a write lock on the file
@@ -540,7 +538,8 @@ int _ma_mark_file_changed(MARIA_HA *info)
mi_int2store(buff,share->state.open_count);
buff[2]=1; /* Mark that it's changed */
DBUG_RETURN(my_pwrite(share->kfile.file, buff, sizeof(buff),
sizeof(share->state.header),
sizeof(share->state.header) +
MARIA_FILE_OPEN_COUNT_OFFSET,
MYF(MY_NABP)));
}
}
@@ -571,8 +570,9 @@ int _ma_decrement_open_count(MARIA_HA *info)
{
mi_int2store(buff,share->state.open_count);
write_error= my_pwrite(share->kfile.file, buff, sizeof(buff),
sizeof(share->state.header),
MYF(MY_NABP));
sizeof(share->state.header) +
MARIA_FILE_OPEN_COUNT_OFFSET,
MYF(MY_NABP));
}
}
if (!lock_error)
@@ -580,3 +580,19 @@ int _ma_decrement_open_count(MARIA_HA *info)
}
return test(lock_error || write_error);
}
/** @brief mark file as crashed */
int _ma_mark_file_crashed(MARIA_SHARE *share)
{
uchar buff[2];
DBUG_ENTER("_ma_mark_file_crashed");
share->state.changed|= STATE_CRASHED;
mi_int2store(buff, share->state.changed);
DBUG_RETURN(my_pwrite(share->kfile.file, buff, sizeof(buff),
sizeof(share->state.header) +
MARIA_FILE_CHANGED_OFFSET,
MYF(MY_NABP)));
}

View File

@@ -7347,7 +7347,7 @@ LSN translog_first_lsn_in_log()
uint16 chunk_offset;
uchar *page;
DBUG_ENTER("translog_first_lsn_in_log");
DBUG_PRINT("info", ("Horizon: (%lu,0x%lx)", LSN_IN_PARTS(addr)));
DBUG_PRINT("info", ("Horizon: (%lu,0x%lx)", LSN_IN_PARTS(horizon)));
DBUG_ASSERT(translog_status == TRANSLOG_OK ||
translog_status == TRANSLOG_READONLY);

View File

@@ -1124,6 +1124,9 @@ uint _ma_state_info_write_sub(File file, MARIA_STATE_INFO *state, uint pWrite)
/* open_count must be first because of _ma_mark_file_changed ! */
mi_int2store(ptr,state->open_count); ptr+= 2;
/* changed must be second, because of _ma_mark_file_crashed */
mi_int2store(ptr,state->changed); ptr+= 2;
/*
if you change the offset of create_rename_lsn/is_of_horizon inside the
index file's header, fix ma_create + ma_rename + ma_delete_all +
@@ -1131,8 +1134,6 @@ uint _ma_state_info_write_sub(File file, MARIA_STATE_INFO *state, uint pWrite)
*/
lsn_store(ptr, state->create_rename_lsn); ptr+= LSN_STORE_SIZE;
lsn_store(ptr, state->is_of_horizon); ptr+= LSN_STORE_SIZE;
*ptr++= (uchar)state->changed;
*ptr++= state->sortkey;
mi_rowstore(ptr,state->state.records); ptr+= 8;
mi_rowstore(ptr,state->state.del); ptr+= 8;
mi_rowstore(ptr,state->split); ptr+= 8;
@@ -1148,7 +1149,8 @@ uint _ma_state_info_write_sub(File file, MARIA_STATE_INFO *state, uint pWrite)
mi_int4store(ptr,state->unique); ptr+= 4;
mi_int4store(ptr,state->status); ptr+= 4;
mi_int4store(ptr,state->update_count); ptr+= 4;
*ptr++= state->sortkey;
*ptr++= 0; /* Reserved */
ptr+= state->state_diff_length;
for (i=0; i < keys; i++)
@@ -1194,10 +1196,9 @@ static uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
key_parts= mi_uint2korr(state->header.key_parts);
state->open_count = mi_uint2korr(ptr); ptr+= 2;
state->changed= mi_uint2korr(ptr); ptr+= 2;
state->create_rename_lsn= lsn_korr(ptr); ptr+= LSN_STORE_SIZE;
state->is_of_horizon= lsn_korr(ptr); ptr+= LSN_STORE_SIZE;
state->changed= (my_bool) *ptr++;
state->sortkey= (uint) *ptr++;
state->state.records= mi_rowkorr(ptr); ptr+= 8;
state->state.del = mi_rowkorr(ptr); ptr+= 8;
state->split = mi_rowkorr(ptr); ptr+= 8;
@@ -1215,6 +1216,8 @@ static uchar *_ma_state_info_read(uchar *ptr, MARIA_STATE_INFO *state)
state->unique = mi_uint4korr(ptr); ptr+= 4;
state->status = mi_uint4korr(ptr); ptr+= 4;
state->update_count=mi_uint4korr(ptr); ptr+= 4;
state->sortkey= (uint) *ptr++;
ptr++; /* reserved */
ptr+= state->state_diff_length;

View File

@@ -121,10 +121,11 @@ int _ma_write_keypage(register MARIA_HA *info,
/* Verify that keynr is correct */
DBUG_ASSERT(_ma_get_keynr(share, buff) == keyinfo->key_nr);
#if defined(EXTRA_DEBUG) && defined(HAVE_purify)
#if defined(EXTRA_DEBUG) && defined(HAVE_purify) && defined(NOT_ANYMORE)
{
/* This is here to catch uninitialized bytes */
ulong crc= my_checksum(0, buff, block_size - KEYPAGE_CHECKSUM_SIZE);
uint length= _ma_get_page_used(share, buff);
ulong crc= my_checksum(0, buff, length);
int4store(buff + block_size - KEYPAGE_CHECKSUM_SIZE, crc);
}
#endif
@@ -309,10 +310,6 @@ my_off_t _ma_new(register MARIA_HA *info, int level,
else
{
uchar *buff;
/*
TODO: replace PAGECACHE_PLAIN_PAGE with PAGECACHE_LSN_PAGE when
LSN on the pages will be implemented
*/
pos= share->current_key_del; /* Protected */
DBUG_ASSERT(share->pagecache->block_size == block_size);
if (!(buff= pagecache_read(share->pagecache,

View File

@@ -625,7 +625,7 @@ static uint pagecache_fwrite(PAGECACHE *pagecache,
}
DBUG_RETURN(my_pwrite(filedesc->file, buffer, pagecache->block_size,
(pageno)<<(pagecache->shift), flags));
((my_off_t) pageno << pagecache->shift), flags));
}
@@ -642,7 +642,7 @@ static uint pagecache_fwrite(PAGECACHE *pagecache,
*/
#define pagecache_fread(pagecache, filedesc, buffer, pageno, flags) \
my_pread((filedesc)->file, buffer, pagecache->block_size, \
(pageno)<<(pagecache->shift), flags)
((my_off_t) pageno << pagecache->shift), flags)
/**

View File

@@ -60,7 +60,8 @@ static my_bool skip_DDLs; /**< if REDO phase should skip DDL records */
static my_bool checkpoint_useful;
static my_bool procent_printed;
static ulonglong now; /**< for tracking execution time of phases */
uint warnings; /**< count of warnings */
static int (*save_error_handler_hook)(uint, const char *,myf);
static uint recovery_warnings; /**< count of warnings */
#define prototype_redo_exec_hook(R) \
static int exec_REDO_LOGREC_ ## R(const TRANSLOG_HEADER_BUFFER *rec)
@@ -194,6 +195,20 @@ void eprint(FILE *trace_file __attribute__ ((unused)),
}
/* Hook to ensure we get nicer output if we get an error */
int maria_recover_error_handler_hook(uint error, const char *str,
myf flags)
{
if (procent_printed)
{
procent_printed= 0;
fputc('\n', stderr);
fflush(stderr);
}
return (*save_error_handler_hook)(error, str, flags);
}
#define ALERT_USER() DBUG_ASSERT(0)
static void print_preamble()
@@ -289,7 +304,7 @@ int maria_apply_log(LSN from_lsn, enum maria_apply_log_way apply,
DBUG_ASSERT(apply == MARIA_LOG_APPLY || !should_run_undo_phase);
DBUG_ASSERT(!maria_multi_threaded);
warnings= 0;
recovery_warnings= 0;
/* checkpoints can happen only if TRNs have been built */
DBUG_ASSERT(should_run_undo_phase || !take_checkpoints);
all_active_trans= (struct st_trn_for_recovery *)
@@ -298,6 +313,10 @@ int maria_apply_log(LSN from_lsn, enum maria_apply_log_way apply,
all_tables= (struct st_table_for_recovery *)
my_malloc((SHARE_ID_MAX + 1) * sizeof(struct st_table_for_recovery),
MYF(MY_ZEROFILL));
save_error_handler_hook= error_handler_hook;
error_handler_hook= maria_recover_error_handler_hook;
if (!all_active_trans || !all_tables)
goto err;
@@ -390,9 +409,9 @@ int maria_apply_log(LSN from_lsn, enum maria_apply_log_way apply,
}
else if (uncommitted_trans > 0)
{
tprint(tracef, "***WARNING: %u uncommitted transactions; some tables may"
eprint(tracef, "***WARNING: %u uncommitted transactions; some tables may"
" be left inconsistent!***\n", uncommitted_trans);
warnings++;
recovery_warnings++;
}
old_now= now;
@@ -435,6 +454,7 @@ err:
error= 1;
tprint(tracef, "\nRecovery of tables with transaction logs FAILED\n");
end:
error_handler_hook= save_error_handler_hook;
hash_free(&all_dirty_pages);
bzero(&all_dirty_pages, sizeof(all_dirty_pages));
my_free(dirty_pages_pool, MYF(MY_ALLOW_ZERO_PTR));
@@ -447,10 +467,14 @@ end:
log_record_buffer.str= NULL;
log_record_buffer.length= 0;
ma_checkpoint_end();
*warnings_count= warnings;
*warnings_count= recovery_warnings;
if (recovery_message_printed != REC_MSG_NONE)
{
fprintf(stderr, "\n");
if (procent_printed)
{
procent_printed= 0;
fprintf(stderr, "\n");
}
if (!error)
ma_message_no_user(ME_JUST_INFO, "recovery done");
}
@@ -492,7 +516,8 @@ static int display_and_apply_record(const LOG_DESC *log_desc,
return 1;
}
if ((error= (*log_desc->record_execute_in_redo_phase)(rec)))
eprint(tracef, "Got error %d when executing record\n", my_errno);
eprint(tracef, "Got error %d when executing record %s\n",
my_errno, log_desc->name);
return error;
}
@@ -602,7 +627,7 @@ prototype_redo_exec_hook(INCOMPLETE_LOG)
" about insertion of data by ALTER TABLE and CREATE SELECT,"
" as they are not necessary for recovery;"
" present applying of log records may well not work.***\n");
warnings++;
recovery_warnings++;
return 0;
}
@@ -704,9 +729,11 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
kfile_header= (uchar *)ptr;
ptr+= kfile_size_before_extension;
/* set create_rename_lsn (for maria_read_log to be idempotent) */
lsn_store(kfile_header + sizeof(info->s->state.header) + 2, rec->lsn);
lsn_store(kfile_header + sizeof(info->s->state.header) +
MARIA_FILE_CREATE_RENAME_LSN_OFFSET, rec->lsn);
/* we also set is_of_horizon, like maria_create() does */
lsn_store(kfile_header + sizeof(info->s->state.header) + 2 + LSN_STORE_SIZE,
lsn_store(kfile_header + sizeof(info->s->state.header) +
MARIA_FILE_CREATE_RENAME_LSN_OFFSET + LSN_STORE_SIZE,
rec->lsn);
data_file_name= ptr;
ptr+= strlen(data_file_name) + 1;
@@ -725,7 +752,7 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
MY_APPEND_EXT);
linkname_ptr= NULL;
create_flag= MY_DELETE_OLD;
tprint(tracef, "Table '%s' creating as '%s'", name, filename);
tprint(tracef, "Table '%s' creating as '%s'\n", name, filename);
if ((kfile= my_create_with_symlink(linkname_ptr, filename, 0, create_mode,
MYF(MY_WME|create_flag))) < 0)
{
@@ -768,7 +795,6 @@ prototype_redo_exec_hook(REDO_CREATE_TABLE)
}
error= 0;
end:
tprint(tracef, "\n");
if (kfile >= 0)
error|= my_close(kfile, MYF(MY_WME));
if (info != NULL)
@@ -1615,7 +1641,8 @@ prototype_redo_exec_hook(UNDO_ROW_DELETE)
{
uchar buff[HA_CHECKSUM_STORE_SIZE];
if (translog_read_record(rec->lsn, LSN_STORE_SIZE + FILEID_STORE_SIZE +
PAGE_STORE_SIZE + DIRPOS_STORE_SIZE,
PAGE_STORE_SIZE + DIRPOS_STORE_SIZE + 2 +
PAGERANGE_STORE_SIZE,
HA_CHECKSUM_STORE_SIZE, buff, NULL) !=
HA_CHECKSUM_STORE_SIZE)
{
@@ -1780,25 +1807,6 @@ prototype_redo_exec_hook(COMMIT)
return 0;
}
/*
Set position for next active record that will have key inserted
*/
static void set_lastpos(MARIA_HA *info, uchar *pos)
{
ulonglong page;
uint dir_entry;
/* If we have checksum, it's before rowid */
if (info->s->calc_checksum)
pos+= HA_CHECKSUM_STORE_SIZE;
page= page_korr(pos);
dir_entry= dirpos_korr(pos + PAGE_STORE_SIZE);
info->cur_row.lastpos= ma_recordpos(page, dir_entry);
}
prototype_redo_exec_hook(CLR_END)
{
MARIA_HA *info= get_MARIA_HA_from_UNDO_record(rec);
@@ -1841,7 +1849,6 @@ prototype_redo_exec_hook(CLR_END)
case LOGREC_UNDO_ROW_DELETE:
row_entry= 1;
share->state.state.records++;
set_lastpos(info, logpos);
break;
case LOGREC_UNDO_ROW_INSERT:
share->state.state.records--;
@@ -1850,7 +1857,6 @@ prototype_redo_exec_hook(CLR_END)
break;
case LOGREC_UNDO_ROW_UPDATE:
row_entry= 1;
set_lastpos(info, logpos);
break;
case LOGREC_UNDO_KEY_INSERT:
case LOGREC_UNDO_KEY_DELETE:
@@ -1874,18 +1880,6 @@ prototype_redo_exec_hook(CLR_END)
share->state.state.checksum+= ha_checksum_korr(logpos);
share->state.changed|= STATE_CHANGED | STATE_NOT_ANALYZED;
}
else
{
/* We must set lastpos for upcoming undo delete keys */
switch (undone_record_type) {
case LOGREC_UNDO_ROW_DELETE:
case LOGREC_UNDO_ROW_UPDATE:
set_lastpos(info, logpos);
break;
default:
break;
}
}
if (row_entry)
tprint(tracef, " rows' count %lu\n", (ulong)share->state.state.records);
_ma_unpin_all_pages(info, rec->lsn);
@@ -1971,17 +1965,11 @@ prototype_undo_exec_hook(UNDO_ROW_DELETE)
}
info->trn= trn;
/*
For now we skip the page and directory entry. This is to be used
later when we mark rows as deleted.
*/
error= _ma_apply_undo_row_delete(info, previous_undo_lsn,
log_record_buffer.str + LSN_STORE_SIZE +
FILEID_STORE_SIZE + PAGE_STORE_SIZE +
DIRPOS_STORE_SIZE,
FILEID_STORE_SIZE,
rec->record_length -
(LSN_STORE_SIZE + FILEID_STORE_SIZE +
PAGE_STORE_SIZE + DIRPOS_STORE_SIZE));
(LSN_STORE_SIZE + FILEID_STORE_SIZE));
info->trn= 0;
tprint(tracef, " rows' count %lu\n undo_lsn now LSN (%lu,0x%lx)\n",
(ulong)share->state.state.records, LSN_IN_PARTS(previous_undo_lsn));
@@ -2478,6 +2466,7 @@ static uint end_of_redo_phase(my_bool prepare_for_undo_phase)
static int run_undo_phase(uint uncommitted)
{
LSN last_undo;
DBUG_ENTER("run_undo_phase");
if (uncommitted > 0)
@@ -2491,6 +2480,7 @@ static int run_undo_phase(uint uncommitted)
recovery_message_printed= REC_MSG_UNDO;
}
tprint(tracef, "%u transactions will be rolled back\n", uncommitted);
procent_printed= 1;
for( ; ; )
{
char llbuf[22];
@@ -2503,12 +2493,16 @@ static int run_undo_phase(uint uncommitted)
DBUG_ASSERT(trn != NULL);
llstr(trn->trid, llbuf);
tprint(tracef, "Rolling back transaction of long id %s\n", llbuf);
last_undo= trn->undo_lsn + 1;
/* Execute all undo entries */
while (trn->undo_lsn)
{
TRANSLOG_HEADER_BUFFER rec;
LOG_DESC *log_desc;
DBUG_ASSERT(trn->undo_lsn < last_undo);
last_undo= trn->undo_lsn;
if (translog_read_record_header(trn->undo_lsn, &rec) ==
RECHEADER_READ_ERROR)
DBUG_RETURN(1);
@@ -2516,7 +2510,8 @@ static int run_undo_phase(uint uncommitted)
display_record_position(log_desc, &rec, 0);
if (log_desc->record_execute_in_undo_phase(&rec, trn))
{
tprint(tracef, "Got error %d when executing undo\n", my_errno);
eprint(tracef, "Got error %d when executing undo %s\n", my_errno,
log_desc->name);
DBUG_RETURN(1);
}
}
@@ -2527,6 +2522,7 @@ static int run_undo_phase(uint uncommitted)
/* In the future, we want to have this phase *online* */
}
}
procent_printed= 0;
DBUG_RETURN(0);
}

View File

@@ -16,7 +16,6 @@
/*
WL#3072 Maria recovery
First version written by Guilhem Bichot on 2006-04-27.
Does not compile yet.
*/
/* This is the interface of this module. */

View File

@@ -25,7 +25,7 @@
LIST *maria_open_list=0;
uchar maria_file_magic[]=
{ (uchar) 254, (uchar) 254, (uchar) 9, '\001', };
{ (uchar) 254, (uchar) 254, (uchar) 9, '\002', };
uchar maria_pack_file_magic[]=
{ (uchar) 254, (uchar) 254, (uchar) 10, '\001', };
/* Unique number for this maria instance */

View File

@@ -44,18 +44,17 @@ static void put_blob_in_record(uchar *blob_pos,char **blob_buffer,
ulong *length);
static void copy_key(MARIA_HA *info, uint inx, uchar *record, uchar *key);
static int verbose=0,testflag=0,
first_key=0,async_io=0,pagecacheing=0,write_cacheing=0,locking=0,
rec_pointer_size=0,pack_fields=1,silent=0,
opt_quick_mode=0, transactional= 0, skip_update= 0,
die_in_middle_of_transaction= 0;
static int pack_seg=HA_SPACE_PACK,pack_type=HA_PACK_KEY,remove_count=-1;
static int verbose= 0, testflag= 0, first_key= 0, async_io= 0, pagecacheing= 0;
static int write_cacheing= 0, locking= 0, rec_pointer_size= 0, pack_fields= 1;
static int silent= 0, opt_quick_mode= 0, transactional= 0, skip_update= 0;
static int die_in_middle_of_transaction= 0;
static int pack_seg= HA_SPACE_PACK, pack_type= HA_PACK_KEY, remove_count= -1;
static int create_flag= 0, srand_arg= 0, checkpoint= 0;
static uint use_blob= 0, update_count= 0;
static ulong pagecache_size=8192*32;
static enum data_file_type record_type= DYNAMIC_RECORD;
static uint keys=MARIA_KEYS,recant=1000;
static uint use_blob=0;
static uint16 key1[1001],key3[5000];
static uchar record[300],record2[300],key[100],key2[100];
static uchar read_record[300],read_record2[300],read_record3[300];
@@ -357,7 +356,10 @@ int main(int argc, char *argv[])
printf("- Update\n");
if (srand_arg)
srand(srand_arg);
for (i=0 ; i<recant/10 ; i++)
if (!update_count)
update_count= recant/10;
for (i=0 ; i < update_count ; i++)
{
n1=rnd(1000); n2=rnd(100); n3=rnd(5000);
sprintf((char*) record2,"%6d:%4d:%8d:XXX: %4d ",n1,n2,n3,update);
@@ -385,9 +387,9 @@ int main(int argc, char *argv[])
{
ulong blob_length;
if (i & 1)
put_blob_in_record(record+blob_pos,&blob_buffer, &blob_length);
put_blob_in_record(record2+blob_pos,&blob_buffer, &blob_length);
else
bmove(record+blob_pos,read_record+blob_pos,8);
bmove(record2+blob_pos, read_record+blob_pos, 4 + sizeof(char*));
}
if (skip_update)
continue;
@@ -874,7 +876,7 @@ int main(int argc, char *argv[])
}
if (maria_delete(file,read_record))
{
printf("can't delete record: %6.6s, delete_count: %d\n",
printf("can't delete record: %6.6s, delete_count: %d\n",
read_record, opt_delete);
maria_scan_end(file);
goto err;
@@ -1036,7 +1038,7 @@ static void get_options(int argc, char **argv)
case 'L':
locking=1;
break;
case 'A': /* use asyncron io */
case 'a': /* use asyncron io */
async_io=1;
if (*++pos)
my_default_record_cache_size=atoi(pos);
@@ -1098,9 +1100,14 @@ static void get_options(int argc, char **argv)
case 'T':
transactional= 1;
break;
case 'u':
case 'A':
die_in_middle_of_transaction= atoi(++pos);
break;
case 'u':
update_count=atoi(++pos);
if (!update_count)
skip_update= 1;
break;
case 'q':
opt_quick_mode=1;
break;
@@ -1116,8 +1123,8 @@ static void get_options(int argc, char **argv)
case '?':
case 'I':
case 'V':
printf("%s Ver 1.0 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE);
puts("By Monty, for your professional use\n");
printf("%s Ver 1.1 for %s at %s\n",progname,SYSTEM_TYPE,MACHINE_TYPE);
puts("By Monty, for testing Maria\n");
printf("Usage: %s [-?AbBcDIKLPRqSsTVWltv] [-k#] [-f#] [-m#] [-e#] [-E#] [-t#]\n",
progname);
exit(0);
@@ -1151,7 +1158,9 @@ static void fix_length(uchar *rec, uint length)
} /* fix_length */
/* Put maybe a blob in record */
/* Put maybe a blob in record */
static int first_entry;
static void put_blob_in_record(uchar *blob_pos, char **blob_buffer,
ulong *blob_length)
@@ -1160,15 +1169,21 @@ static void put_blob_in_record(uchar *blob_pos, char **blob_buffer,
*blob_length= 0;
if (use_blob)
{
if (! *blob_buffer &&
!(*blob_buffer=my_malloc((uint) use_blob,MYF(MY_WME))))
{
use_blob= 0;
return;
}
if (rnd(10) == 0)
{
if (! *blob_buffer &&
!(*blob_buffer=my_malloc((uint) use_blob,MYF(MY_WME))))
if (first_entry++ == 0)
{
use_blob=0;
return;
/* Ensure we have at least one blob of max length in file */
length= use_blob;
}
length=rnd(use_blob);
else
length=rnd(use_blob);
for (i=0 ; i < length ; i++)
(*blob_buffer)[i]=(char) (length+i);
int4store(blob_pos,length);

View File

@@ -107,6 +107,11 @@ run_tests()
$maria_path/maria_chk$suffix -sm test2
$maria_path/ma_test2$suffix $silent -L -K -W -P -A $row_type
$maria_path/maria_chk$suffix -sm test2
$maria_path/ma_test2$suffix $silent -L -K -W -P -b32768 $row_type
$maria_path/maria_chk$suffix -sm test2
$maria_path/ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -m300
$maria_path/maria_chk$suffix -sm test2
$maria_path/ma_test2$suffix $silent -L -K -P -R3 -m50 -b1000000 $row_type
$maria_path/maria_chk$suffix -sm test2
$maria_path/ma_test2$suffix $silent -L -B $row_type
@@ -239,13 +244,13 @@ $maria_path/maria_chk$suffix -ssm test2
#
/bin/sh $maria_path/ma_test_recovery
#
#x1
# Extra tests that has caused failures in the past
#
# Problem with re-executing CLR's
rm -f maria_log.* maria_log_control
$maria_path/ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u1
$maria_path/ma_test2 -s -L -K -W -P -M -T -c -b -t2 -A1
cp maria_log_control tmp
$maria_path/maria_read_log -a -s
$maria_path/maria_chk -s -e test2
@@ -253,15 +258,29 @@ cp tmp/maria_log_control .
rm test2.MA?
$maria_path/maria_read_log -a -s
$maria_path/maria_chk -s -e test2
rm test2.MA?
# Problem with re-executing CLR's
rm -f maria_log.* maria_log_control
$maria_path/ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u1
$maria_path/ma_test2 -s -L -K -W -P -M -T -c -b -t2 -A1
$maria_path/maria_read_log -a -s
$maria_path/maria_chk -s -e test2
rm test2.MA?
$maria_path/maria_read_log -a -s
$maria_path/maria_chk -e -s test2
rm test2.MA?
# Problem with re-executing clrs:
rm -f maria_log.* maria_log_control
ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A1
maria_read_log -a -s
maria_chk -es test2
maria_read_log -a -s
maria_chk -es test2
rm test2.MA?
maria_read_log -a -s
maria_chk -es test2
rm test2.MA?
#
# Some timing tests

View File

@@ -0,0 +1,22 @@
#!/bin/sh
#
# This tests is good to find bugs in the redo/undo handling and in
# finding bugs in blob handling
#
set -e
a=15
while test $a -le 5000
do
echo $a
rm -f maria_log*
ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A1 -m$a > /dev/null
maria_read_log -a -s >& /dev/null
maria_chk -es test2
maria_read_log -a -s >& /dev/null
maria_chk -es test2
rm test2.MA?
maria_read_log -a -s >& /dev/null
maria_chk -es test2
a=$((a+1))
done

View File

@@ -1,5 +1,7 @@
#!/bin/sh
# Remove comment from next line if this script fails and you need more
# information of what's going on
#set -x -v
set -e
silent="-s"
@@ -122,12 +124,13 @@ echo "Testing the REDO AND UNDO PHASE"
for take_checkpoint in "no" "yes"
do
for blobs in "" "-b" # we test table without blobs and then table with blobs
# we test table without blobs and then table with blobs
for blobs in "" "-b32768"
do
for test_undo in 1 2 3 4
do
# first iteration tests rollback of insert, second tests rollback of delete
set -- "ma_test1 $silent -M -T -c -N $blobs -H1" "--testflag=1" "--testflag=2 --test-undo=" "ma_test1 $silent -M -T -c -N $blobs -H2" "--testflag=3" "--testflag=4 --test-undo=" "ma_test1 $silent -M -T -c -N $blobs -H2 " "--testflag=2" "--testflag=3 --test-undo=" "ma_test2 $silent -L -K -W -P -M -T -c $blobs -H1" "-t1" "-t2 -u"
set -- "ma_test1 $silent -M -T -c -N $blobs -H1" "--testflag=1" "--testflag=2 --test-undo=" "ma_test1 $silent -M -T -c -N $blobs -H2" "--testflag=3" "--testflag=4 --test-undo=" "ma_test1 $silent -M -T -c -N $blobs -H2 " "--testflag=2" "--testflag=3 --test-undo=" "ma_test2 $silent -L -K -W -P -M -T -c $blobs -H1" "-t1" "-t2 -A" "ma_test2 $silent -L -K -W -P -M -T -c $blobs -H1" "-t1" "-t4 -A"
# -N (create NULL fields) is needed because --test-undo adds it anyway
while [ $# != 0 ]
do
@@ -178,18 +181,21 @@ do
check_table_is_same
echo "testing idempotency"
apply_log "shouldnotchangelog"
cmp $table.MAD $tmp/$table.MAD.after_undo
# We can't do a binary compary as there may have been different number
# of calls to compact_page. We can enable this if we first call
# maria-check to generate identically compacted pages.
# cmp $table.MAD $tmp/$table.MAD.after_undo
# can't do this, creation time differs at least; enable it if you
# have a "cmp" which ignores the header.
# cmp $table.MAI $tmp/$table.MAI.after_undo
cmp $table.MAI $tmp/$table.MAI.after_undo
check_table_is_same
echo "testing applying of CLRs to recreate table"
rm $table.MA?
# cp $tmp/maria_log* $maria_path #unneeded
apply_log "shouldnotchangelog"
cmp $table.MAD $tmp/$table.MAD.after_undo
# cmp $table.MAD $tmp/$table.MAD.after_undo
# can't do this, creation time differs at least
# cmp $table.MAI $tmp/$table.MAI.after_undo
cmp $table.MAI $tmp/$table.MAI.after_undo
check_table_is_same
shift 3
done
@@ -200,6 +206,12 @@ done
) 2>&1 > $tmp/ma_test_recovery.output
if [ "$?" != 0 ]
then
echo "Some test failed"
exit 1
fi
# also note that maria_chk -dvv shows differences for ma_test2 in UNDO phase,
# this is normal: removing records does not shrink the data/key file,
# does not put back the "analyzed,optimized keys"(etc) index state.

View File

@@ -42,7 +42,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -u1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t4 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -100,7 +129,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -u2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t4 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -158,7 +216,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -u3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t4 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -216,7 +303,7 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -u4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t2 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -244,8 +331,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 --test-undo=1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -t4 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 --test-undo=1 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -253,9 +369,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=4 --test-undo=1 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=4 --test-undo=1 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -263,9 +379,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 --test-undo=1 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 --test-undo=1 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -273,8 +389,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t2 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -302,8 +418,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 --test-undo=2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 --test-undo=2 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -311,9 +456,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=4 --test-undo=2 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=4 --test-undo=2 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -321,9 +466,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 --test-undo=2 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 --test-undo=2 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -331,8 +476,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t2 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -360,8 +505,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 --test-undo=3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 --test-undo=3 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -369,9 +543,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=4 --test-undo=3 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=4 --test-undo=3 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -379,9 +553,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 --test-undo=3 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 --test-undo=3 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -389,8 +563,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t2 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -418,8 +592,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 --test-undo=4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 --test-undo=4 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -427,9 +630,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=4 --test-undo=4 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=4 --test-undo=4 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -437,9 +640,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b --testflag=3 --test-undo=4 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 --testflag=3 --test-undo=4 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -447,8 +650,37 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -t2 -u4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t2 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -t4 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -506,7 +738,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -u1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t4 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -564,7 +825,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -u2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t4 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -622,7 +912,36 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -u3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t4 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -680,7 +999,7 @@ applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -u4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t2 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -708,8 +1027,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=2 --test-undo=1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -H1 -t4 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=2 --test-undo=1 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -717,9 +1065,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=4 --test-undo=1 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=4 --test-undo=1 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -727,9 +1075,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 --test-undo=1 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 --test-undo=1 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -737,8 +1085,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t2 -u1 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t2 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -766,8 +1114,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=2 --test-undo=2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t4 -A1 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=2 --test-undo=2 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -775,9 +1152,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=4 --test-undo=2 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=4 --test-undo=2 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -785,9 +1162,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 --test-undo=2 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 --test-undo=2 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -795,8 +1172,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t2 -u2 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t2 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -824,8 +1201,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=2 --test-undo=3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t4 -A2 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=2 --test-undo=3 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -833,9 +1239,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=4 --test-undo=3 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=4 --test-undo=3 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -843,9 +1249,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 --test-undo=3 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 --test-undo=3 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -853,8 +1259,8 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t2 -u3 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t2 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
@@ -882,8 +1288,37 @@ Differences in maria_chk -dvv, recovery not yet perfect !
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b -H1 --testflag=2 --test-undo=4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t4 -A3 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=1 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H1 --testflag=2 --test-undo=4 (additional aborted work)
Terminating after inserts
Dying on request without maria_commit()/maria_close()
applying log
@@ -891,9 +1326,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 (commit at end)
Terminating after updates
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=4 --test-undo=4 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=4 --test-undo=4 (additional aborted work)
Terminating after deletes
Dying on request without maria_commit()/maria_close()
applying log
@@ -901,9 +1336,9 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=2 (commit at end)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=2 (commit at end)
Terminating after inserts
TEST WITH ma_test1 -s -M -T -c -N -b -H2 --testflag=3 --test-undo=4 (additional aborted work)
TEST WITH ma_test1 -s -M -T -c -N -b32768 -H2 --testflag=3 --test-undo=4 (additional aborted work)
Terminating after updates
Dying on request without maria_commit()/maria_close()
applying log
@@ -911,8 +1346,37 @@ testing idempotency
applying log
testing applying of CLRs to recreate table
applying log
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b -H1 -t2 -u4 (additional aborted work)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t2 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing idempotency
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
testing applying of CLRs to recreate table
applying log
Differences in maria_chk -dvv, recovery not yet perfect !
========DIFF START=======
6c6
< Status: checked,analyzed,optimized keys,sorted index pages
---
> Status: changed
========DIFF END=======
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t1 (commit at end)
TEST WITH ma_test2 -s -L -K -W -P -M -T -c -b32768 -H1 -t4 -A4 (additional aborted work)
Dying on request without maria_commit()/maria_close()
applying log
Differences in maria_chk -dvv, recovery not yet perfect !

View File

@@ -139,9 +139,10 @@ int maria_update(register MARIA_HA *info, const uchar *oldrec, uchar *newrec)
If (*update_record)() fails, table will be marked corrupted so no need
to revert the live checksum change.
*/
info->state->checksum+= !share->now_transactional *
((info->cur_row.checksum= (*share->calc_checksum)(info, newrec)) -
(info->new_row.checksum= (*share->calc_checksum)(info, oldrec)));
info->cur_row.checksum= (*share->calc_checksum)(info, newrec);
info->new_row.checksum= (*share->calc_checksum)(info, oldrec);
if (!share->now_transactional)
info->state->checksum+= info->cur_row.checksum - info->new_row.checksum;
}
{
/*

View File

@@ -1275,7 +1275,7 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
enum en_fieldtype type;
MARIA_SHARE *share= info->s;
char llbuff[22],llbuff2[22];
DBUG_ENTER("describe");
DBUG_ENTER("descript");
if (param->testflag & T_VERY_SILENT)
{
@@ -1329,12 +1329,6 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
pos[-1]=0; /* Remove extra ',' */
}
printf("Status: %s\n",buff);
if (share->base.auto_key)
{
printf("Auto increment key: %16d Last value: %18s\n",
share->base.auto_key,
llstr(share->state.auto_increment,llbuff));
}
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
printf("Checksum: %26s\n",llstr(info->state->checksum,llbuff));
;
@@ -1343,6 +1337,12 @@ static void descript(HA_CHECK *param, register MARIA_HA *info, char *name)
if (share->options & HA_OPTION_PAGE_CHECKSUM)
printf("Page checksums are used\n");
if (share->base.auto_key)
{
printf("Auto increment key: %16d Last value: %18s\n",
share->base.auto_key,
llstr(share->state.auto_increment,llbuff));
}
}
printf("Data records: %16s Deleted blocks: %18s\n",
llstr(info->state->records,llbuff),llstr(info->state->del,llbuff2));

View File

@@ -40,7 +40,6 @@
#define MAX_NONMAPPED_INSERTS 1000
#define MARIA_MAX_TREE_LEVELS 32
#define MARIA_MAX_CONTROL_FILE_LOCK_RETRY 30 /* Retry this many times */
struct st_transaction;
@@ -106,7 +105,7 @@ typedef struct st_maria_state_info
time_t check_time; /* Time for last check */
uint sortkey; /* sorted by this key (not used) */
uint open_count;
uint8 changed; /* Changed since mariachk */
uint changed; /* Changed since maria_chk */
LSN create_rename_lsn; /**< LSN when table was last created/renamed */
/** @brief Log horizon when state was last updated on disk */
TRANSLOG_ADDRESS is_of_horizon;
@@ -119,7 +118,11 @@ typedef struct st_maria_state_info
#define MARIA_STATE_INFO_SIZE \
(24 + LSN_STORE_SIZE*2 + 4 + 11*8 + 4*4 + 8 + 3*4 + 5*8)
(24 + 2 + LSN_STORE_SIZE*2 + 4 + 11*8 + 4*4 + 8 + 3*4 + 5*8)
#define MARIA_FILE_OPEN_COUNT_OFFSET 0
#define MARIA_FILE_CHANGED_OFFSET 2
#define MARIA_FILE_CREATE_RENAME_LSN_OFFSET 4
#define MARIA_STATE_KEY_SIZE (8 + 4)
#define MARIA_STATE_KEYBLOCK_SIZE 8
#define MARIA_STATE_KEYSEG_SIZE 12
@@ -405,8 +408,8 @@ typedef struct st_maria_row
uchar *empty_bits, *field_lengths;
uint *null_field_lengths; /* All null field lengths */
ulong *blob_lengths; /* Length for each blob */
ulong base_length, normal_length, char_length, varchar_length, blob_length;
ulong head_length, total_length;
ulong base_length, min_length, normal_length, char_length, varchar_length;
ulong blob_length, head_length, total_length;
size_t extents_buffer_length; /* Size of 'extents' buffer */
uint field_lengths_length; /* Length of data in field_lengths */
uint extents_count; /* number of extents in 'extents' */
@@ -451,6 +454,7 @@ struct st_maria_handler
uchar *lastkey, *lastkey2; /* Last used search key */
uchar *first_mbr_key; /* Searhed spatial key */
uchar *rec_buff; /* Temp buffer for recordpack */
uchar *blob_buff; /* Temp buffer for blobs */
uchar *int_keypos, /* Save position for next/previous */
*int_maxpos; /* -""- */
uchar *update_field_data; /* Used by update in rows-in-block */
@@ -473,7 +477,7 @@ struct st_maria_handler
as they are not compatible with parallel repair
*/
ulong packed_length, blob_length; /* Length of found, packed record */
size_t rec_buff_size;
size_t rec_buff_size, blob_buff_size;
PAGECACHE_FILE dfile; /* The datafile */
IO_CACHE rec_cache; /* When cacheing records */
LIST open_list;
@@ -483,6 +487,7 @@ struct st_maria_handler
int lastinx; /* Last used index */
uint lastkey_length; /* Length of key in lastkey */
uint last_rkey_length; /* Last length in maria_rkey() */
uint non_flushable_state;
enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
uint save_lastkey_length;
uint pack_key_length; /* For MARIAMRG */
@@ -658,12 +663,6 @@ struct st_maria_handler
#define MARIA_BLOCK_SIZE(key_length,data_pointer,key_pointer,block_size) (((((key_length)+(data_pointer)+(key_pointer))*4+(key_pointer)+2)/(block_size)+1)*(block_size))
#define MARIA_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */
#define MARIA_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
#define MARIA_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
#define MARIA_MIN_ROWS_TO_USE_BULK_INSERT 100
#define MARIA_MIN_ROWS_TO_DISABLE_INDEXES 100
#define MARIA_MIN_ROWS_TO_USE_WRITE_CACHE 10
/* Marker for impossible delete link */
#define IMPOSSIBLE_PAGE_NO LL(0xFFFFFFFFFF)
@@ -682,6 +681,16 @@ extern pthread_mutex_t THR_LOCK_maria;
#define rw_unlock(A) {}
#endif
/* Some tuning parameters */
#define MARIA_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */
#define MARIA_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */
#define MARIA_MIN_ROWS_TO_USE_BULK_INSERT 100
#define MARIA_MIN_ROWS_TO_DISABLE_INDEXES 100
#define MARIA_MIN_ROWS_TO_USE_WRITE_CACHE 10
/* Keep a small buffer for tables only using small blobs */
#define MARIA_SMALL_BLOB_BUFFER 1024
#define MARIA_MAX_CONTROL_FILE_LOCK_RETRY 30 /* Retry this many times */
/* Some extern variables */
extern LIST *maria_open_list;
@@ -799,6 +808,7 @@ extern int _ma_readinfo(MARIA_HA *info, int lock_flag, int check_keybuffer);
extern int _ma_writeinfo(MARIA_HA *info, uint options);
extern int _ma_test_if_changed(MARIA_HA *info);
extern int _ma_mark_file_changed(MARIA_HA *info);
extern int _ma_mark_file_crashed(MARIA_SHARE *share);
extern int _ma_decrement_open_count(MARIA_HA *info);
extern int _ma_check_index(MARIA_HA *info, int inx);
extern int _ma_search(MARIA_HA *info, MARIA_KEYDEF *keyinfo, uchar *key,

View File

@@ -334,9 +334,9 @@ int main(int argc, char *argv[])
if (use_blob)
{
if (i & 1)
put_blob_in_record(record+blob_pos,&blob_buffer);
put_blob_in_record(record2+blob_pos,&blob_buffer);
else
bmove(record+blob_pos,read_record+blob_pos,8);
bmove(record2+blob_pos,read_record+blob_pos,8);
}
if (mi_update(file,read_record,record2))
{