Commit 85da5133 authored by unknown's avatar unknown

Implement applying of REDO entries for

- LOGREC_REDO_INSERT_ROW_HEAD
- LOGREC_REDO_INSERT_ROW_TAIL
- LOGREC_REDO_PURGE_ROW_HEAD
- LOGREC_REDO_PURGE_ROW_TAIL


sql/sql_yacc.yy:
  Fixed typo in previous push
storage/maria/ma_bitmap.c:
  Ensure we flush the new bitmap on close
storage/maria/ma_blockrec.c:
  Implement applying of REDO entries for
  - LOGREC_REDO_INSERT_ROW_HEAD
  - LOGREC_REDO_INSERT_ROW_TAIL
  - LOGREC_REDO_PURGE_ROW_HEAD
  - LOGREC_REDO_PURGE_ROW_TAIL
  Split some functions into subfunctions to be able to reuse code
storage/maria/ma_blockrec.h:
  Added prototypes for REDO applying functions
storage/maria/ma_loghandler.h:
  Safety fix
storage/maria/ma_loghandler_lsn.h:
  Avoid compiler warnings
storage/maria/maria_read_log.c:
  Added hocks for:
  - REDO_INSERT_ROW_HEAD
  - REDO_INSERT_ROW_TAIL
  - REDO_PURGE_ROW_HEAD
  - REDO_PURGE_ROW_TAIL
  
  Added dummy hooks for:
  - UNDO_ROW_INSERT
  - UNDO_ROW_DELETE
  
  Changed to use maria_pagecache instead of own pagecache (fixed problem with unitialized share->pagecache)
  Use maria_panic() at end to ensure that all files are closed properly.
  Fixed option handling for --debug
parent ef7a757b
...@@ -4280,7 +4280,7 @@ row_types: ...@@ -4280,7 +4280,7 @@ row_types:
| DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; } | DYNAMIC_SYM { $$= ROW_TYPE_DYNAMIC; }
| COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; } | COMPRESSED_SYM { $$= ROW_TYPE_COMPRESSED; }
| REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; } | REDUNDANT_SYM { $$= ROW_TYPE_REDUNDANT; }
| COMPACT_SYM { $$= ROW_TYPE_COMPACT; }; | COMPACT_SYM { $$= ROW_TYPE_COMPACT; }
| PAGE_SYM { $$= ROW_TYPE_PAGE; }; | PAGE_SYM { $$= ROW_TYPE_PAGE; };
merge_insert_types: merge_insert_types:
......
...@@ -296,7 +296,7 @@ void _ma_bitmap_delete_all(MARIA_SHARE *share) ...@@ -296,7 +296,7 @@ void _ma_bitmap_delete_all(MARIA_SHARE *share)
{ {
bzero(bitmap->map, share->block_size); bzero(bitmap->map, share->block_size);
memcpy(bitmap->map + share->block_size - 2, maria_bitmap_marker, 2); memcpy(bitmap->map + share->block_size - 2, maria_bitmap_marker, 2);
bitmap->changed= 0; bitmap->changed= 1;
bitmap->page= 0; bitmap->page= 0;
bitmap->used_size= bitmap->total_size; bitmap->used_size= bitmap->total_size;
} }
......
This diff is collapsed.
...@@ -178,3 +178,11 @@ my_bool _ma_check_if_right_bitmap_type(MARIA_HA *info, ...@@ -178,3 +178,11 @@ my_bool _ma_check_if_right_bitmap_type(MARIA_HA *info,
ulonglong page, ulonglong page,
uint *bitmap_pattern); uint *bitmap_pattern);
void _ma_bitmap_delete_all(MARIA_SHARE *share); void _ma_bitmap_delete_all(MARIA_SHARE *share);
uint _ma_apply_redo_insert_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header,
const byte *data,
size_t data_length);
uint _ma_apply_redo_purge_row_head_or_tail(MARIA_HA *info, LSN lsn,
uint page_type,
const byte *header);
...@@ -62,7 +62,7 @@ struct st_maria_share; ...@@ -62,7 +62,7 @@ struct st_maria_share;
#define pagerange_store(T,A) int2store(T,A) #define pagerange_store(T,A) int2store(T,A)
#define fileid_korr(P) uint2korr(P) #define fileid_korr(P) uint2korr(P)
#define page_korr(P) uint5korr(P) #define page_korr(P) uint5korr(P)
#define dirpos_korr(P) (P[0]) #define dirpos_korr(P) ((P)[0])
#define pagerange_korr(P) uint2korr(P) #define pagerange_korr(P) uint2korr(P)
/* /*
......
...@@ -45,7 +45,7 @@ typedef TRANSLOG_ADDRESS LSN; ...@@ -45,7 +45,7 @@ typedef TRANSLOG_ADDRESS LSN;
#define LSN_OFFSET(L) ((L) & 0xFFFFFFFFL) #define LSN_OFFSET(L) ((L) & 0xFFFFFFFFL)
/* Makes lsn/log address from file number and record offset */ /* Makes lsn/log address from file number and record offset */
#define MAKE_LSN(F,S) ((((uint64)(F)) << 32) | (S)) #define MAKE_LSN(F,S) ((LSN) ((((uint64)(F)) << 32) | (S)))
/* checks LSN */ /* checks LSN */
#define LSN_VALID(L) \ #define LSN_VALID(L) \
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment