2006-04-11 15:45:10 +02:00
|
|
|
/* Copyright (C) 2006 MySQL AB
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
|
|
|
|
|
|
|
/* This file should be included when using maria_funktions */
|
|
|
|
|
|
|
|
#ifndef _maria_h
|
|
|
|
#define _maria_h
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#ifndef _my_base_h
|
|
|
|
#include <my_base.h>
|
|
|
|
#endif
|
|
|
|
#ifndef _m_ctype_h
|
|
|
|
#include <m_ctype.h>
|
|
|
|
#endif
|
2007-06-11 16:29:53 +02:00
|
|
|
#include "../storage/maria/ma_pagecache.h"
|
2006-04-11 15:45:10 +02:00
|
|
|
#include "my_handler.h"
|
|
|
|
#include "ft_global.h"
|
|
|
|
#include <myisamchk.h>
|
|
|
|
#include <mysql/plugin.h>
|
|
|
|
|
|
|
|
/*
|
|
|
|
Limit max keys according to HA_MAX_POSSIBLE_KEY; See myisamchk.h for details
|
|
|
|
*/
|
|
|
|
|
|
|
|
#if MAX_INDEXES > HA_MAX_POSSIBLE_KEY
|
|
|
|
#define MARIA_MAX_KEY HA_MAX_POSSIBLE_KEY /* Max allowed keys */
|
|
|
|
#else
|
|
|
|
#define MARIA_MAX_KEY MAX_INDEXES /* Max allowed keys */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MARIA_MAX_MSG_BUF 1024 /* used in CHECK TABLE, REPAIR TABLE */
|
|
|
|
#define MARIA_NAME_IEXT ".MAI"
|
|
|
|
#define MARIA_NAME_DEXT ".MAD"
|
|
|
|
/* Max extra space to use when sorting keys */
|
|
|
|
#define MARIA_MAX_TEMP_LENGTH 2*1024L*1024L*1024L
|
|
|
|
/* Possible values for maria_block_size (must be power of 2) */
|
|
|
|
#define MARIA_KEY_BLOCK_LENGTH 8192 /* default key block length */
|
|
|
|
#define MARIA_MIN_KEY_BLOCK_LENGTH 1024 /* Min key block length */
|
|
|
|
#define MARIA_MAX_KEY_BLOCK_LENGTH 32768
|
2007-04-19 17:48:36 +02:00
|
|
|
/* Minimal page cache when we only want to be able to scan a table */
|
First part of redo/undo for key pages
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
For transactional tables, shift record number in keys up with 1 bit to have place to indicate if transid follows
Checksum for MyISAM now ignores NULL and not used part of VARCHAR
Renamed some variables that caused shadow compiler warnings
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
Fixed crashing bugs when using Maria TEMPORARY tables with TRUNCATE. Removed 'hack' code in sql directory to go around this bug.
pagecache_unlock_by_ulink() now has extra argument to say if page was changed.
Give error message if we fail to open control file
Mark page cache variables as not flushable
include/maria.h:
Made min page cache larger (needed for pinning key page)
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
Added write_comp_flag to move some runtime code to maria_open()
include/my_base.h:
Added new error message to be used when handler initialization failed
include/my_global.h:
Renamed dummy to swap_dummy to avoid conflicts with local 'dummy' variables
include/my_handler.h:
Added const to some parameters
mysys/array.c:
More DBUG
mysys/my_error.c:
Fixed indentation
mysys/my_handler.c:
Added const to some parameters
Added missing error messages
sql/field.h:
Renamed variables to avoid variable shadowing
sql/handler.h:
Renamed parameter to avoid variable name conflict
sql/item.h:
Renamed variables to avoid variable shadowing
sql/log_event_old.h:
Renamed variables to avoid variable shadowing
sql/set_var.h:
Renamed variables to avoid variable shadowing
sql/sql_delete.cc:
Removed maria hack for temporary tables
Fixed indentation
sql/sql_table.cc:
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
This was needed to ensure we don't do a PREPARE_FOR_DROP or similar call while the table is still in use.
sql/table.cc:
Copy page_checksum from share
Removed Maria hack
storage/maria/Makefile.am:
Added new files
storage/maria/ha_maria.cc:
Renamed records -> record_count and info -> create_info to avoid variable name conflicts
Mark page cache variables as not flushable
storage/maria/ma_blockrec.c:
Moved _ma_unpin_all_pages() to ma_key_recover.c
Moved init of info->pinned_pages to ma_open.c
Moved _ma_finalize_row() to maria_key_recover.h
Renamed some variables to avoid variable name conflicts
Mark page_link.changed for blocks we change directly
Simplify handling of undo link when writing LOGREC_UNDO_ROW_INSERT (old code crashed when having redo for index)
storage/maria/ma_blockrec.h:
Removed extra empty line
storage/maria/ma_checkpoint.c:
Remove not needed trnman.h
storage/maria/ma_close.c:
Free pinned pages (which are now always allocated)
storage/maria/ma_control_file.c:
Give error message if we fail to open control file
storage/maria/ma_delete.c:
Changes for redo logging (first part, logging of underflow not yet done)
- Log undo-key-delete
- Log delete of key
- Updated arguments to _ma_fetch_keypage(), _ma_dispose(), _ma_write_keypage(), _ma_insert()
- Added new arguments to some functions to be able to write redo information
- Mark key pages as changed when we write with PAGECACHE_LOCK_LEFT_WRITELOCKED
Remove one not needed _ma_write_keypage() in d_search() when upper level will do the write anyway
Changed 2 bmove_upp() to bmove() as this made code easer to understand
More function comments
Indentation fixes
storage/maria/ma_ft_update.c:
New arguments to _ma_write_keypage()
storage/maria/ma_loghandler.c:
Fixed some DBUG_PRINT messages
Simplify code
Added new log entrys for key page redo
Renamed some variables to avoid variable name shadowing
storage/maria/ma_loghandler.h:
Moved some defines here
Added define for storing key number on key pages
Added new translog record types
Added enum for type of operations in LOGREC_REDO_INDEX
storage/maria/ma_open.c:
Always allocate info.pinned_pages (we need now also for normal key page usage)
Update keyinfo->key_nr
Added virtual functions to convert record position o number to be stored on key pages
Update keyinfo->write_comp_flag to value of search flag to be used when writing key
storage/maria/ma_page.c:
Added redo for key pages
- Extended _ma_fetch_keypage() with type of lock to put on page and address to used MARIA_PINNED_PAGE
- _ma_fetch_keypage() now pin's pages if needed
- Extended _ma_write_keypage() with type of locks to be used
- ma_dispose() now locks info->s->state.key_del from other threads
- ma_dispose() writes redo log record
- ma_new() locks info->s->state.key_del from other threads if it was used
- ma_new() now pins read page
Other things:
- Removed some not needed arguments from _ma_new() and _ma_dispose)
- Added some new variables to simplify code
- If EXTRA_DEBUG is used, do crc on full page to catch not unitialized bytes
storage/maria/ma_pagecache.h:
Applied patch from Sanja to add extra argument to pagecache_unlock_by_ulink() to mark if page was changed
Added some defines for pagecache priority levels that one can use
storage/maria/ma_range.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_recovery.c:
- Added hooks for new translog types:
REDO_INDEX, REDO_INDEX_NEW_PAGE, REDO_INDEX_FREE_PAGE, UNDO_KEY_INSERT, UNDO_KEY_DELETE and
UNDO_KEY_DELETE_WITH_ROOT.
- Moved variable declarations to start of function (portability fixes)
- Removed some not needed initializations
- Set only relevant state changes for each redo/undo entry
storage/maria/lockman.c:
Removed end space
storage/maria/ma_check.c:
Removed end space
storage/maria/ma_create.c:
Removed end space
storage/maria/ma_locking.c:
Removed end space
storage/maria/ma_packrec.c:
Removed end space
storage/maria/ma_pagecache.c:
Removed end space
storage/maria/ma_panic.c:
Removed end space
storage/maria/ma_rt_index.c:
Added new arguments for call to _ma_fetch_keypage(), _ma_write_keypage(), _ma_dispose() and _ma_new()
Fixed indentation
storage/maria/ma_rt_key.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_rt_split.c:
Added new arguments for call to _ma_new()
Use new keypage header
Added new arguments for call to _ma_write_keypage()
storage/maria/ma_search.c:
Updated comments & indentation
Added new arguments for call to _ma_fetch_keypage()
Made some variables and arguments const
Added virtual functions for converting row position to number to be stored in key
use MARIA_RECORD_POS of record position instead of my_off_t
Record in MARIA_KEY_PARAM how page was changed one key insert (needed for REDO)
storage/maria/ma_sort.c:
Removed end space
storage/maria/ma_statrec.c:
Updated arguments for call to _ma_rec_pos()
storage/maria/ma_test1.c:
Fixed too small buffer to init_pagecache()
Fixed bug when using insert_count and test_flag
storage/maria/ma_test2.c:
Use more resonable pagecache size
Remove not used code
Reset blob_length to fix wrong output message
storage/maria/ma_test_all.sh:
Fixed wrong test
storage/maria/ma_write.c:
Lots of new code to handle REDO of key pages
No logic changes because of REDO code, mostly adding new arguments and adding new code for logging
Added new arguments for calls to _ma_fetch_keypage(), _ma_write_keypage() and similar functions
Move setting of comp_flag in ma_ck_wrte_btree() from runtime to maria_open()
Zerofill new used pages for:
- To remove possible sensitive data left in buffer
- To get idenitical data on pages after running redo
- Better compression of pages if archived
storage/maria/maria_chk.c:
Added information if table is crash safe
storage/maria/maria_def.h:
New virtual function to convert between record position on key and normal record position
Aded mutex and extra variables to handle locking of share->state.key_del
Moved some structure variables to get things more aligned
Added extra arguments to MARIA_KEY_PARAM to be able to remember what was changed on key page on key insert
Added argument to MARIA_PINNED_PAGE to indicate if page was changed
Updated prototypes for functions
Added some structures for signaling changes in REDO handling
storage/maria/unittest/ma_pagecache_single.c:
Updated arguments for changed function calls
storage/myisam/mi_check.c:
Made calc_check_checksum virtual
storage/myisam/mi_checksum.c:
Update checksums to ignore null columns
storage/myisam/mi_create.c:
Mark if table has null column (to know when we have to use mi_checksum())
storage/myisam/mi_open.c:
Added virtual function for calculating checksum to be able to easily ignore NULL fields
storage/myisam/mi_test2.c:
Fixed bug
storage/myisam/myisamdef.h:
Added virtual function for calculating checksum during check table
Removed ha_key_cmp() as this is in handler.h
storage/maria/ma_key_recover.c:
New BitKeeper file ``storage/maria/ma_key_recover.c''
storage/maria/ma_key_recover.h:
New BitKeeper file ``storage/maria/ma_key_recover.h''
storage/maria/ma_key_redo.c:
New BitKeeper file ``storage/maria/ma_key_redo.c''
2007-11-14 18:08:06 +01:00
|
|
|
#define MARIA_MIN_PAGE_CACHE_SIZE (8192L*16L)
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
In the following macros '_keyno_' is 0 .. keys-1.
|
|
|
|
If there can be more keys than bits in the key_map, the highest bit
|
|
|
|
is for all upper keys. They cannot be switched individually.
|
|
|
|
This means that clearing of high keys is ignored, setting one high key
|
|
|
|
sets all high keys.
|
|
|
|
*/
|
|
|
|
#define MARIA_KEYMAP_BITS (8 * SIZEOF_LONG_LONG)
|
|
|
|
#define MARIA_KEYMAP_HIGH_MASK (ULL(1) << (MARIA_KEYMAP_BITS - 1))
|
|
|
|
#define maria_get_mask_all_keys_active(_keys_) \
|
|
|
|
(((_keys_) < MARIA_KEYMAP_BITS) ? \
|
|
|
|
((ULL(1) << (_keys_)) - ULL(1)) : \
|
|
|
|
(~ ULL(0)))
|
|
|
|
#if MARIA_MAX_KEY > MARIA_KEYMAP_BITS
|
|
|
|
#define maria_is_key_active(_keymap_,_keyno_) \
|
|
|
|
(((_keyno_) < MARIA_KEYMAP_BITS) ? \
|
|
|
|
test((_keymap_) & (ULL(1) << (_keyno_))) : \
|
|
|
|
test((_keymap_) & MARIA_KEYMAP_HIGH_MASK))
|
|
|
|
#define maria_set_key_active(_keymap_,_keyno_) \
|
|
|
|
(_keymap_)|= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
|
|
|
|
(ULL(1) << (_keyno_)) : \
|
|
|
|
MARIA_KEYMAP_HIGH_MASK)
|
|
|
|
#define maria_clear_key_active(_keymap_,_keyno_) \
|
|
|
|
(_keymap_)&= (((_keyno_) < MARIA_KEYMAP_BITS) ? \
|
|
|
|
(~ (ULL(1) << (_keyno_))) : \
|
|
|
|
(~ (ULL(0))) /*ignore*/ )
|
|
|
|
#else
|
|
|
|
#define maria_is_key_active(_keymap_,_keyno_) \
|
|
|
|
test((_keymap_) & (ULL(1) << (_keyno_)))
|
|
|
|
#define maria_set_key_active(_keymap_,_keyno_) \
|
|
|
|
(_keymap_)|= (ULL(1) << (_keyno_))
|
|
|
|
#define maria_clear_key_active(_keymap_,_keyno_) \
|
|
|
|
(_keymap_)&= (~ (ULL(1) << (_keyno_)))
|
|
|
|
#endif
|
|
|
|
#define maria_is_any_key_active(_keymap_) \
|
|
|
|
test((_keymap_))
|
|
|
|
#define maria_is_all_keys_active(_keymap_,_keys_) \
|
|
|
|
((_keymap_) == maria_get_mask_all_keys_active(_keys_))
|
|
|
|
#define maria_set_all_keys_active(_keymap_,_keys_) \
|
|
|
|
(_keymap_)= maria_get_mask_all_keys_active(_keys_)
|
|
|
|
#define maria_clear_all_keys_active(_keymap_) \
|
|
|
|
(_keymap_)= 0
|
|
|
|
#define maria_intersect_keys_active(_to_,_from_) \
|
|
|
|
(_to_)&= (_from_)
|
|
|
|
#define maria_is_any_intersect_keys_active(_keymap1_,_keys_,_keymap2_) \
|
|
|
|
((_keymap1_) & (_keymap2_) & \
|
|
|
|
maria_get_mask_all_keys_active(_keys_))
|
|
|
|
#define maria_copy_keys_active(_to_,_maxkeys_,_from_) \
|
|
|
|
(_to_)= (maria_get_mask_all_keys_active(_maxkeys_) & \
|
|
|
|
(_from_))
|
|
|
|
|
|
|
|
/* Param to/from maria_info */
|
|
|
|
|
2007-01-18 20:38:14 +01:00
|
|
|
typedef ulonglong MARIA_RECORD_POS;
|
|
|
|
|
2007-10-09 20:09:50 +02:00
|
|
|
typedef struct st_maria_info
|
2006-04-11 15:45:10 +02:00
|
|
|
{
|
|
|
|
ha_rows records; /* Records in database */
|
|
|
|
ha_rows deleted; /* Deleted records in database */
|
2007-01-18 20:38:14 +01:00
|
|
|
MARIA_RECORD_POS recpos; /* Pos for last used record */
|
|
|
|
MARIA_RECORD_POS newrecpos; /* Pos if we write new record */
|
|
|
|
MARIA_RECORD_POS dup_key_pos; /* Position to record with dup key */
|
2006-04-11 15:45:10 +02:00
|
|
|
my_off_t data_file_length; /* Length of data file */
|
|
|
|
my_off_t max_data_file_length, index_file_length;
|
|
|
|
my_off_t max_index_file_length, delete_length;
|
|
|
|
ulonglong auto_increment;
|
|
|
|
ulonglong key_map; /* Which keys are used */
|
2007-04-05 13:38:05 +02:00
|
|
|
time_t create_time; /* When table was created */
|
|
|
|
time_t check_time;
|
|
|
|
time_t update_time;
|
|
|
|
ulong record_offset;
|
2007-10-09 20:09:50 +02:00
|
|
|
double *rec_per_key; /* for sql optimizing */
|
2007-04-05 13:38:05 +02:00
|
|
|
ulong reclength; /* Recordlength */
|
|
|
|
ulong mean_reclength; /* Mean recordlength (if packed) */
|
2006-04-11 15:45:10 +02:00
|
|
|
char *data_file_name, *index_file_name;
|
2007-04-05 13:38:05 +02:00
|
|
|
enum data_file_type data_file_type;
|
2006-04-11 15:45:10 +02:00
|
|
|
uint keys; /* Number of keys in use */
|
|
|
|
uint options; /* HA_OPTION_... used */
|
2007-04-05 13:38:05 +02:00
|
|
|
uint reflength;
|
2006-04-11 15:45:10 +02:00
|
|
|
int errkey, /* With key was dupplicated on err */
|
|
|
|
sortkey; /* clustered by this key */
|
|
|
|
File filenr; /* (uniq) filenr for datafile */
|
|
|
|
} MARIA_INFO;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct st_maria_create_info
|
|
|
|
{
|
|
|
|
const char *index_file_name, *data_file_name; /* If using symlinks */
|
|
|
|
ha_rows max_rows;
|
|
|
|
ha_rows reloc_rows;
|
|
|
|
ulonglong auto_increment;
|
|
|
|
ulonglong data_file_length;
|
|
|
|
ulonglong key_file_length;
|
2007-04-19 12:18:56 +02:00
|
|
|
/* Size of null bitmap at start of row */
|
2007-01-18 20:38:14 +01:00
|
|
|
uint null_bytes;
|
2006-04-11 15:45:10 +02:00
|
|
|
uint old_options;
|
2007-01-18 20:38:14 +01:00
|
|
|
enum data_file_type org_data_file_type;
|
2006-04-11 15:45:10 +02:00
|
|
|
uint8 language;
|
2007-01-18 20:38:14 +01:00
|
|
|
my_bool with_auto_increment, transactional;
|
2006-04-11 15:45:10 +02:00
|
|
|
} MARIA_CREATE_INFO;
|
|
|
|
|
|
|
|
struct st_maria_share;
|
2007-10-09 20:09:50 +02:00
|
|
|
struct st_maria_handler; /* For referense */
|
|
|
|
typedef struct st_maria_handler MARIA_HA;
|
2006-04-11 15:45:10 +02:00
|
|
|
struct st_maria_s_param;
|
|
|
|
|
|
|
|
typedef struct st_maria_keydef /* Key definition with open & info */
|
|
|
|
{
|
|
|
|
struct st_maria_share *share; /* Pointer to base (set in open) */
|
|
|
|
uint16 keysegs; /* Number of key-segment */
|
|
|
|
uint16 flag; /* NOSAME, PACK_USED */
|
|
|
|
|
|
|
|
uint8 key_alg; /* BTREE, RTREE */
|
First part of redo/undo for key pages
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
For transactional tables, shift record number in keys up with 1 bit to have place to indicate if transid follows
Checksum for MyISAM now ignores NULL and not used part of VARCHAR
Renamed some variables that caused shadow compiler warnings
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
Fixed crashing bugs when using Maria TEMPORARY tables with TRUNCATE. Removed 'hack' code in sql directory to go around this bug.
pagecache_unlock_by_ulink() now has extra argument to say if page was changed.
Give error message if we fail to open control file
Mark page cache variables as not flushable
include/maria.h:
Made min page cache larger (needed for pinning key page)
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
Added write_comp_flag to move some runtime code to maria_open()
include/my_base.h:
Added new error message to be used when handler initialization failed
include/my_global.h:
Renamed dummy to swap_dummy to avoid conflicts with local 'dummy' variables
include/my_handler.h:
Added const to some parameters
mysys/array.c:
More DBUG
mysys/my_error.c:
Fixed indentation
mysys/my_handler.c:
Added const to some parameters
Added missing error messages
sql/field.h:
Renamed variables to avoid variable shadowing
sql/handler.h:
Renamed parameter to avoid variable name conflict
sql/item.h:
Renamed variables to avoid variable shadowing
sql/log_event_old.h:
Renamed variables to avoid variable shadowing
sql/set_var.h:
Renamed variables to avoid variable shadowing
sql/sql_delete.cc:
Removed maria hack for temporary tables
Fixed indentation
sql/sql_table.cc:
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
This was needed to ensure we don't do a PREPARE_FOR_DROP or similar call while the table is still in use.
sql/table.cc:
Copy page_checksum from share
Removed Maria hack
storage/maria/Makefile.am:
Added new files
storage/maria/ha_maria.cc:
Renamed records -> record_count and info -> create_info to avoid variable name conflicts
Mark page cache variables as not flushable
storage/maria/ma_blockrec.c:
Moved _ma_unpin_all_pages() to ma_key_recover.c
Moved init of info->pinned_pages to ma_open.c
Moved _ma_finalize_row() to maria_key_recover.h
Renamed some variables to avoid variable name conflicts
Mark page_link.changed for blocks we change directly
Simplify handling of undo link when writing LOGREC_UNDO_ROW_INSERT (old code crashed when having redo for index)
storage/maria/ma_blockrec.h:
Removed extra empty line
storage/maria/ma_checkpoint.c:
Remove not needed trnman.h
storage/maria/ma_close.c:
Free pinned pages (which are now always allocated)
storage/maria/ma_control_file.c:
Give error message if we fail to open control file
storage/maria/ma_delete.c:
Changes for redo logging (first part, logging of underflow not yet done)
- Log undo-key-delete
- Log delete of key
- Updated arguments to _ma_fetch_keypage(), _ma_dispose(), _ma_write_keypage(), _ma_insert()
- Added new arguments to some functions to be able to write redo information
- Mark key pages as changed when we write with PAGECACHE_LOCK_LEFT_WRITELOCKED
Remove one not needed _ma_write_keypage() in d_search() when upper level will do the write anyway
Changed 2 bmove_upp() to bmove() as this made code easer to understand
More function comments
Indentation fixes
storage/maria/ma_ft_update.c:
New arguments to _ma_write_keypage()
storage/maria/ma_loghandler.c:
Fixed some DBUG_PRINT messages
Simplify code
Added new log entrys for key page redo
Renamed some variables to avoid variable name shadowing
storage/maria/ma_loghandler.h:
Moved some defines here
Added define for storing key number on key pages
Added new translog record types
Added enum for type of operations in LOGREC_REDO_INDEX
storage/maria/ma_open.c:
Always allocate info.pinned_pages (we need now also for normal key page usage)
Update keyinfo->key_nr
Added virtual functions to convert record position o number to be stored on key pages
Update keyinfo->write_comp_flag to value of search flag to be used when writing key
storage/maria/ma_page.c:
Added redo for key pages
- Extended _ma_fetch_keypage() with type of lock to put on page and address to used MARIA_PINNED_PAGE
- _ma_fetch_keypage() now pin's pages if needed
- Extended _ma_write_keypage() with type of locks to be used
- ma_dispose() now locks info->s->state.key_del from other threads
- ma_dispose() writes redo log record
- ma_new() locks info->s->state.key_del from other threads if it was used
- ma_new() now pins read page
Other things:
- Removed some not needed arguments from _ma_new() and _ma_dispose)
- Added some new variables to simplify code
- If EXTRA_DEBUG is used, do crc on full page to catch not unitialized bytes
storage/maria/ma_pagecache.h:
Applied patch from Sanja to add extra argument to pagecache_unlock_by_ulink() to mark if page was changed
Added some defines for pagecache priority levels that one can use
storage/maria/ma_range.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_recovery.c:
- Added hooks for new translog types:
REDO_INDEX, REDO_INDEX_NEW_PAGE, REDO_INDEX_FREE_PAGE, UNDO_KEY_INSERT, UNDO_KEY_DELETE and
UNDO_KEY_DELETE_WITH_ROOT.
- Moved variable declarations to start of function (portability fixes)
- Removed some not needed initializations
- Set only relevant state changes for each redo/undo entry
storage/maria/lockman.c:
Removed end space
storage/maria/ma_check.c:
Removed end space
storage/maria/ma_create.c:
Removed end space
storage/maria/ma_locking.c:
Removed end space
storage/maria/ma_packrec.c:
Removed end space
storage/maria/ma_pagecache.c:
Removed end space
storage/maria/ma_panic.c:
Removed end space
storage/maria/ma_rt_index.c:
Added new arguments for call to _ma_fetch_keypage(), _ma_write_keypage(), _ma_dispose() and _ma_new()
Fixed indentation
storage/maria/ma_rt_key.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_rt_split.c:
Added new arguments for call to _ma_new()
Use new keypage header
Added new arguments for call to _ma_write_keypage()
storage/maria/ma_search.c:
Updated comments & indentation
Added new arguments for call to _ma_fetch_keypage()
Made some variables and arguments const
Added virtual functions for converting row position to number to be stored in key
use MARIA_RECORD_POS of record position instead of my_off_t
Record in MARIA_KEY_PARAM how page was changed one key insert (needed for REDO)
storage/maria/ma_sort.c:
Removed end space
storage/maria/ma_statrec.c:
Updated arguments for call to _ma_rec_pos()
storage/maria/ma_test1.c:
Fixed too small buffer to init_pagecache()
Fixed bug when using insert_count and test_flag
storage/maria/ma_test2.c:
Use more resonable pagecache size
Remove not used code
Reset blob_length to fix wrong output message
storage/maria/ma_test_all.sh:
Fixed wrong test
storage/maria/ma_write.c:
Lots of new code to handle REDO of key pages
No logic changes because of REDO code, mostly adding new arguments and adding new code for logging
Added new arguments for calls to _ma_fetch_keypage(), _ma_write_keypage() and similar functions
Move setting of comp_flag in ma_ck_wrte_btree() from runtime to maria_open()
Zerofill new used pages for:
- To remove possible sensitive data left in buffer
- To get idenitical data on pages after running redo
- Better compression of pages if archived
storage/maria/maria_chk.c:
Added information if table is crash safe
storage/maria/maria_def.h:
New virtual function to convert between record position on key and normal record position
Aded mutex and extra variables to handle locking of share->state.key_del
Moved some structure variables to get things more aligned
Added extra arguments to MARIA_KEY_PARAM to be able to remember what was changed on key page on key insert
Added argument to MARIA_PINNED_PAGE to indicate if page was changed
Updated prototypes for functions
Added some structures for signaling changes in REDO handling
storage/maria/unittest/ma_pagecache_single.c:
Updated arguments for changed function calls
storage/myisam/mi_check.c:
Made calc_check_checksum virtual
storage/myisam/mi_checksum.c:
Update checksums to ignore null columns
storage/myisam/mi_create.c:
Mark if table has null column (to know when we have to use mi_checksum())
storage/myisam/mi_open.c:
Added virtual function for calculating checksum to be able to easily ignore NULL fields
storage/myisam/mi_test2.c:
Fixed bug
storage/myisam/myisamdef.h:
Added virtual function for calculating checksum during check table
Removed ha_key_cmp() as this is in handler.h
storage/maria/ma_key_recover.c:
New BitKeeper file ``storage/maria/ma_key_recover.c''
storage/maria/ma_key_recover.h:
New BitKeeper file ``storage/maria/ma_key_recover.h''
storage/maria/ma_key_redo.c:
New BitKeeper file ``storage/maria/ma_key_redo.c''
2007-11-14 18:08:06 +01:00
|
|
|
uint8 key_nr; /* key number (auto) */
|
2006-04-11 15:45:10 +02:00
|
|
|
uint16 block_length; /* Length of keyblock (auto) */
|
|
|
|
uint16 underflow_block_length; /* When to execute underflow */
|
|
|
|
uint16 keylength; /* Tot length of keyparts (auto) */
|
|
|
|
uint16 minlength; /* min length of (packed) key (auto) */
|
|
|
|
uint16 maxlength; /* max length of (packed) key (auto) */
|
First part of redo/undo for key pages
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
For transactional tables, shift record number in keys up with 1 bit to have place to indicate if transid follows
Checksum for MyISAM now ignores NULL and not used part of VARCHAR
Renamed some variables that caused shadow compiler warnings
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
Fixed crashing bugs when using Maria TEMPORARY tables with TRUNCATE. Removed 'hack' code in sql directory to go around this bug.
pagecache_unlock_by_ulink() now has extra argument to say if page was changed.
Give error message if we fail to open control file
Mark page cache variables as not flushable
include/maria.h:
Made min page cache larger (needed for pinning key page)
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
Added write_comp_flag to move some runtime code to maria_open()
include/my_base.h:
Added new error message to be used when handler initialization failed
include/my_global.h:
Renamed dummy to swap_dummy to avoid conflicts with local 'dummy' variables
include/my_handler.h:
Added const to some parameters
mysys/array.c:
More DBUG
mysys/my_error.c:
Fixed indentation
mysys/my_handler.c:
Added const to some parameters
Added missing error messages
sql/field.h:
Renamed variables to avoid variable shadowing
sql/handler.h:
Renamed parameter to avoid variable name conflict
sql/item.h:
Renamed variables to avoid variable shadowing
sql/log_event_old.h:
Renamed variables to avoid variable shadowing
sql/set_var.h:
Renamed variables to avoid variable shadowing
sql/sql_delete.cc:
Removed maria hack for temporary tables
Fixed indentation
sql/sql_table.cc:
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
This was needed to ensure we don't do a PREPARE_FOR_DROP or similar call while the table is still in use.
sql/table.cc:
Copy page_checksum from share
Removed Maria hack
storage/maria/Makefile.am:
Added new files
storage/maria/ha_maria.cc:
Renamed records -> record_count and info -> create_info to avoid variable name conflicts
Mark page cache variables as not flushable
storage/maria/ma_blockrec.c:
Moved _ma_unpin_all_pages() to ma_key_recover.c
Moved init of info->pinned_pages to ma_open.c
Moved _ma_finalize_row() to maria_key_recover.h
Renamed some variables to avoid variable name conflicts
Mark page_link.changed for blocks we change directly
Simplify handling of undo link when writing LOGREC_UNDO_ROW_INSERT (old code crashed when having redo for index)
storage/maria/ma_blockrec.h:
Removed extra empty line
storage/maria/ma_checkpoint.c:
Remove not needed trnman.h
storage/maria/ma_close.c:
Free pinned pages (which are now always allocated)
storage/maria/ma_control_file.c:
Give error message if we fail to open control file
storage/maria/ma_delete.c:
Changes for redo logging (first part, logging of underflow not yet done)
- Log undo-key-delete
- Log delete of key
- Updated arguments to _ma_fetch_keypage(), _ma_dispose(), _ma_write_keypage(), _ma_insert()
- Added new arguments to some functions to be able to write redo information
- Mark key pages as changed when we write with PAGECACHE_LOCK_LEFT_WRITELOCKED
Remove one not needed _ma_write_keypage() in d_search() when upper level will do the write anyway
Changed 2 bmove_upp() to bmove() as this made code easer to understand
More function comments
Indentation fixes
storage/maria/ma_ft_update.c:
New arguments to _ma_write_keypage()
storage/maria/ma_loghandler.c:
Fixed some DBUG_PRINT messages
Simplify code
Added new log entrys for key page redo
Renamed some variables to avoid variable name shadowing
storage/maria/ma_loghandler.h:
Moved some defines here
Added define for storing key number on key pages
Added new translog record types
Added enum for type of operations in LOGREC_REDO_INDEX
storage/maria/ma_open.c:
Always allocate info.pinned_pages (we need now also for normal key page usage)
Update keyinfo->key_nr
Added virtual functions to convert record position o number to be stored on key pages
Update keyinfo->write_comp_flag to value of search flag to be used when writing key
storage/maria/ma_page.c:
Added redo for key pages
- Extended _ma_fetch_keypage() with type of lock to put on page and address to used MARIA_PINNED_PAGE
- _ma_fetch_keypage() now pin's pages if needed
- Extended _ma_write_keypage() with type of locks to be used
- ma_dispose() now locks info->s->state.key_del from other threads
- ma_dispose() writes redo log record
- ma_new() locks info->s->state.key_del from other threads if it was used
- ma_new() now pins read page
Other things:
- Removed some not needed arguments from _ma_new() and _ma_dispose)
- Added some new variables to simplify code
- If EXTRA_DEBUG is used, do crc on full page to catch not unitialized bytes
storage/maria/ma_pagecache.h:
Applied patch from Sanja to add extra argument to pagecache_unlock_by_ulink() to mark if page was changed
Added some defines for pagecache priority levels that one can use
storage/maria/ma_range.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_recovery.c:
- Added hooks for new translog types:
REDO_INDEX, REDO_INDEX_NEW_PAGE, REDO_INDEX_FREE_PAGE, UNDO_KEY_INSERT, UNDO_KEY_DELETE and
UNDO_KEY_DELETE_WITH_ROOT.
- Moved variable declarations to start of function (portability fixes)
- Removed some not needed initializations
- Set only relevant state changes for each redo/undo entry
storage/maria/lockman.c:
Removed end space
storage/maria/ma_check.c:
Removed end space
storage/maria/ma_create.c:
Removed end space
storage/maria/ma_locking.c:
Removed end space
storage/maria/ma_packrec.c:
Removed end space
storage/maria/ma_pagecache.c:
Removed end space
storage/maria/ma_panic.c:
Removed end space
storage/maria/ma_rt_index.c:
Added new arguments for call to _ma_fetch_keypage(), _ma_write_keypage(), _ma_dispose() and _ma_new()
Fixed indentation
storage/maria/ma_rt_key.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_rt_split.c:
Added new arguments for call to _ma_new()
Use new keypage header
Added new arguments for call to _ma_write_keypage()
storage/maria/ma_search.c:
Updated comments & indentation
Added new arguments for call to _ma_fetch_keypage()
Made some variables and arguments const
Added virtual functions for converting row position to number to be stored in key
use MARIA_RECORD_POS of record position instead of my_off_t
Record in MARIA_KEY_PARAM how page was changed one key insert (needed for REDO)
storage/maria/ma_sort.c:
Removed end space
storage/maria/ma_statrec.c:
Updated arguments for call to _ma_rec_pos()
storage/maria/ma_test1.c:
Fixed too small buffer to init_pagecache()
Fixed bug when using insert_count and test_flag
storage/maria/ma_test2.c:
Use more resonable pagecache size
Remove not used code
Reset blob_length to fix wrong output message
storage/maria/ma_test_all.sh:
Fixed wrong test
storage/maria/ma_write.c:
Lots of new code to handle REDO of key pages
No logic changes because of REDO code, mostly adding new arguments and adding new code for logging
Added new arguments for calls to _ma_fetch_keypage(), _ma_write_keypage() and similar functions
Move setting of comp_flag in ma_ck_wrte_btree() from runtime to maria_open()
Zerofill new used pages for:
- To remove possible sensitive data left in buffer
- To get idenitical data on pages after running redo
- Better compression of pages if archived
storage/maria/maria_chk.c:
Added information if table is crash safe
storage/maria/maria_def.h:
New virtual function to convert between record position on key and normal record position
Aded mutex and extra variables to handle locking of share->state.key_del
Moved some structure variables to get things more aligned
Added extra arguments to MARIA_KEY_PARAM to be able to remember what was changed on key page on key insert
Added argument to MARIA_PINNED_PAGE to indicate if page was changed
Updated prototypes for functions
Added some structures for signaling changes in REDO handling
storage/maria/unittest/ma_pagecache_single.c:
Updated arguments for changed function calls
storage/myisam/mi_check.c:
Made calc_check_checksum virtual
storage/myisam/mi_checksum.c:
Update checksums to ignore null columns
storage/myisam/mi_create.c:
Mark if table has null column (to know when we have to use mi_checksum())
storage/myisam/mi_open.c:
Added virtual function for calculating checksum to be able to easily ignore NULL fields
storage/myisam/mi_test2.c:
Fixed bug
storage/myisam/myisamdef.h:
Added virtual function for calculating checksum during check table
Removed ha_key_cmp() as this is in handler.h
storage/maria/ma_key_recover.c:
New BitKeeper file ``storage/maria/ma_key_recover.c''
storage/maria/ma_key_recover.h:
New BitKeeper file ``storage/maria/ma_key_recover.h''
storage/maria/ma_key_redo.c:
New BitKeeper file ``storage/maria/ma_key_redo.c''
2007-11-14 18:08:06 +01:00
|
|
|
uint32 write_comp_flag; /* compare flag for write key (auto) */
|
2006-04-11 15:45:10 +02:00
|
|
|
uint32 version; /* For concurrent read/write */
|
|
|
|
uint32 ftparser_nr; /* distinct ftparser number */
|
|
|
|
|
|
|
|
HA_KEYSEG *seg, *end;
|
|
|
|
struct st_mysql_ftparser *parser; /* Fulltext [pre]parser */
|
2007-10-09 20:09:50 +02:00
|
|
|
int (*bin_search)(MARIA_HA *info,
|
First part of redo/undo for key pages
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
For transactional tables, shift record number in keys up with 1 bit to have place to indicate if transid follows
Checksum for MyISAM now ignores NULL and not used part of VARCHAR
Renamed some variables that caused shadow compiler warnings
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
Fixed crashing bugs when using Maria TEMPORARY tables with TRUNCATE. Removed 'hack' code in sql directory to go around this bug.
pagecache_unlock_by_ulink() now has extra argument to say if page was changed.
Give error message if we fail to open control file
Mark page cache variables as not flushable
include/maria.h:
Made min page cache larger (needed for pinning key page)
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
Added write_comp_flag to move some runtime code to maria_open()
include/my_base.h:
Added new error message to be used when handler initialization failed
include/my_global.h:
Renamed dummy to swap_dummy to avoid conflicts with local 'dummy' variables
include/my_handler.h:
Added const to some parameters
mysys/array.c:
More DBUG
mysys/my_error.c:
Fixed indentation
mysys/my_handler.c:
Added const to some parameters
Added missing error messages
sql/field.h:
Renamed variables to avoid variable shadowing
sql/handler.h:
Renamed parameter to avoid variable name conflict
sql/item.h:
Renamed variables to avoid variable shadowing
sql/log_event_old.h:
Renamed variables to avoid variable shadowing
sql/set_var.h:
Renamed variables to avoid variable shadowing
sql/sql_delete.cc:
Removed maria hack for temporary tables
Fixed indentation
sql/sql_table.cc:
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
This was needed to ensure we don't do a PREPARE_FOR_DROP or similar call while the table is still in use.
sql/table.cc:
Copy page_checksum from share
Removed Maria hack
storage/maria/Makefile.am:
Added new files
storage/maria/ha_maria.cc:
Renamed records -> record_count and info -> create_info to avoid variable name conflicts
Mark page cache variables as not flushable
storage/maria/ma_blockrec.c:
Moved _ma_unpin_all_pages() to ma_key_recover.c
Moved init of info->pinned_pages to ma_open.c
Moved _ma_finalize_row() to maria_key_recover.h
Renamed some variables to avoid variable name conflicts
Mark page_link.changed for blocks we change directly
Simplify handling of undo link when writing LOGREC_UNDO_ROW_INSERT (old code crashed when having redo for index)
storage/maria/ma_blockrec.h:
Removed extra empty line
storage/maria/ma_checkpoint.c:
Remove not needed trnman.h
storage/maria/ma_close.c:
Free pinned pages (which are now always allocated)
storage/maria/ma_control_file.c:
Give error message if we fail to open control file
storage/maria/ma_delete.c:
Changes for redo logging (first part, logging of underflow not yet done)
- Log undo-key-delete
- Log delete of key
- Updated arguments to _ma_fetch_keypage(), _ma_dispose(), _ma_write_keypage(), _ma_insert()
- Added new arguments to some functions to be able to write redo information
- Mark key pages as changed when we write with PAGECACHE_LOCK_LEFT_WRITELOCKED
Remove one not needed _ma_write_keypage() in d_search() when upper level will do the write anyway
Changed 2 bmove_upp() to bmove() as this made code easer to understand
More function comments
Indentation fixes
storage/maria/ma_ft_update.c:
New arguments to _ma_write_keypage()
storage/maria/ma_loghandler.c:
Fixed some DBUG_PRINT messages
Simplify code
Added new log entrys for key page redo
Renamed some variables to avoid variable name shadowing
storage/maria/ma_loghandler.h:
Moved some defines here
Added define for storing key number on key pages
Added new translog record types
Added enum for type of operations in LOGREC_REDO_INDEX
storage/maria/ma_open.c:
Always allocate info.pinned_pages (we need now also for normal key page usage)
Update keyinfo->key_nr
Added virtual functions to convert record position o number to be stored on key pages
Update keyinfo->write_comp_flag to value of search flag to be used when writing key
storage/maria/ma_page.c:
Added redo for key pages
- Extended _ma_fetch_keypage() with type of lock to put on page and address to used MARIA_PINNED_PAGE
- _ma_fetch_keypage() now pin's pages if needed
- Extended _ma_write_keypage() with type of locks to be used
- ma_dispose() now locks info->s->state.key_del from other threads
- ma_dispose() writes redo log record
- ma_new() locks info->s->state.key_del from other threads if it was used
- ma_new() now pins read page
Other things:
- Removed some not needed arguments from _ma_new() and _ma_dispose)
- Added some new variables to simplify code
- If EXTRA_DEBUG is used, do crc on full page to catch not unitialized bytes
storage/maria/ma_pagecache.h:
Applied patch from Sanja to add extra argument to pagecache_unlock_by_ulink() to mark if page was changed
Added some defines for pagecache priority levels that one can use
storage/maria/ma_range.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_recovery.c:
- Added hooks for new translog types:
REDO_INDEX, REDO_INDEX_NEW_PAGE, REDO_INDEX_FREE_PAGE, UNDO_KEY_INSERT, UNDO_KEY_DELETE and
UNDO_KEY_DELETE_WITH_ROOT.
- Moved variable declarations to start of function (portability fixes)
- Removed some not needed initializations
- Set only relevant state changes for each redo/undo entry
storage/maria/lockman.c:
Removed end space
storage/maria/ma_check.c:
Removed end space
storage/maria/ma_create.c:
Removed end space
storage/maria/ma_locking.c:
Removed end space
storage/maria/ma_packrec.c:
Removed end space
storage/maria/ma_pagecache.c:
Removed end space
storage/maria/ma_panic.c:
Removed end space
storage/maria/ma_rt_index.c:
Added new arguments for call to _ma_fetch_keypage(), _ma_write_keypage(), _ma_dispose() and _ma_new()
Fixed indentation
storage/maria/ma_rt_key.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_rt_split.c:
Added new arguments for call to _ma_new()
Use new keypage header
Added new arguments for call to _ma_write_keypage()
storage/maria/ma_search.c:
Updated comments & indentation
Added new arguments for call to _ma_fetch_keypage()
Made some variables and arguments const
Added virtual functions for converting row position to number to be stored in key
use MARIA_RECORD_POS of record position instead of my_off_t
Record in MARIA_KEY_PARAM how page was changed one key insert (needed for REDO)
storage/maria/ma_sort.c:
Removed end space
storage/maria/ma_statrec.c:
Updated arguments for call to _ma_rec_pos()
storage/maria/ma_test1.c:
Fixed too small buffer to init_pagecache()
Fixed bug when using insert_count and test_flag
storage/maria/ma_test2.c:
Use more resonable pagecache size
Remove not used code
Reset blob_length to fix wrong output message
storage/maria/ma_test_all.sh:
Fixed wrong test
storage/maria/ma_write.c:
Lots of new code to handle REDO of key pages
No logic changes because of REDO code, mostly adding new arguments and adding new code for logging
Added new arguments for calls to _ma_fetch_keypage(), _ma_write_keypage() and similar functions
Move setting of comp_flag in ma_ck_wrte_btree() from runtime to maria_open()
Zerofill new used pages for:
- To remove possible sensitive data left in buffer
- To get idenitical data on pages after running redo
- Better compression of pages if archived
storage/maria/maria_chk.c:
Added information if table is crash safe
storage/maria/maria_def.h:
New virtual function to convert between record position on key and normal record position
Aded mutex and extra variables to handle locking of share->state.key_del
Moved some structure variables to get things more aligned
Added extra arguments to MARIA_KEY_PARAM to be able to remember what was changed on key page on key insert
Added argument to MARIA_PINNED_PAGE to indicate if page was changed
Updated prototypes for functions
Added some structures for signaling changes in REDO handling
storage/maria/unittest/ma_pagecache_single.c:
Updated arguments for changed function calls
storage/myisam/mi_check.c:
Made calc_check_checksum virtual
storage/myisam/mi_checksum.c:
Update checksums to ignore null columns
storage/myisam/mi_create.c:
Mark if table has null column (to know when we have to use mi_checksum())
storage/myisam/mi_open.c:
Added virtual function for calculating checksum to be able to easily ignore NULL fields
storage/myisam/mi_test2.c:
Fixed bug
storage/myisam/myisamdef.h:
Added virtual function for calculating checksum during check table
Removed ha_key_cmp() as this is in handler.h
storage/maria/ma_key_recover.c:
New BitKeeper file ``storage/maria/ma_key_recover.c''
storage/maria/ma_key_recover.h:
New BitKeeper file ``storage/maria/ma_key_recover.h''
storage/maria/ma_key_redo.c:
New BitKeeper file ``storage/maria/ma_key_redo.c''
2007-11-14 18:08:06 +01:00
|
|
|
struct st_maria_keydef *keyinfo, uchar *page,
|
|
|
|
const uchar *key, uint key_len, uint comp_flag,
|
|
|
|
uchar **ret_pos,
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar *buff, my_bool *was_last_key);
|
First part of redo/undo for key pages
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
For transactional tables, shift record number in keys up with 1 bit to have place to indicate if transid follows
Checksum for MyISAM now ignores NULL and not used part of VARCHAR
Renamed some variables that caused shadow compiler warnings
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
Fixed crashing bugs when using Maria TEMPORARY tables with TRUNCATE. Removed 'hack' code in sql directory to go around this bug.
pagecache_unlock_by_ulink() now has extra argument to say if page was changed.
Give error message if we fail to open control file
Mark page cache variables as not flushable
include/maria.h:
Made min page cache larger (needed for pinning key page)
Added key_nr to st_maria_keydef for faster keyinfo->keynr conversion
Added write_comp_flag to move some runtime code to maria_open()
include/my_base.h:
Added new error message to be used when handler initialization failed
include/my_global.h:
Renamed dummy to swap_dummy to avoid conflicts with local 'dummy' variables
include/my_handler.h:
Added const to some parameters
mysys/array.c:
More DBUG
mysys/my_error.c:
Fixed indentation
mysys/my_handler.c:
Added const to some parameters
Added missing error messages
sql/field.h:
Renamed variables to avoid variable shadowing
sql/handler.h:
Renamed parameter to avoid variable name conflict
sql/item.h:
Renamed variables to avoid variable shadowing
sql/log_event_old.h:
Renamed variables to avoid variable shadowing
sql/set_var.h:
Renamed variables to avoid variable shadowing
sql/sql_delete.cc:
Removed maria hack for temporary tables
Fixed indentation
sql/sql_table.cc:
Moved extra() call when waiting for tables to not be used to after tables are removed from cache.
This was needed to ensure we don't do a PREPARE_FOR_DROP or similar call while the table is still in use.
sql/table.cc:
Copy page_checksum from share
Removed Maria hack
storage/maria/Makefile.am:
Added new files
storage/maria/ha_maria.cc:
Renamed records -> record_count and info -> create_info to avoid variable name conflicts
Mark page cache variables as not flushable
storage/maria/ma_blockrec.c:
Moved _ma_unpin_all_pages() to ma_key_recover.c
Moved init of info->pinned_pages to ma_open.c
Moved _ma_finalize_row() to maria_key_recover.h
Renamed some variables to avoid variable name conflicts
Mark page_link.changed for blocks we change directly
Simplify handling of undo link when writing LOGREC_UNDO_ROW_INSERT (old code crashed when having redo for index)
storage/maria/ma_blockrec.h:
Removed extra empty line
storage/maria/ma_checkpoint.c:
Remove not needed trnman.h
storage/maria/ma_close.c:
Free pinned pages (which are now always allocated)
storage/maria/ma_control_file.c:
Give error message if we fail to open control file
storage/maria/ma_delete.c:
Changes for redo logging (first part, logging of underflow not yet done)
- Log undo-key-delete
- Log delete of key
- Updated arguments to _ma_fetch_keypage(), _ma_dispose(), _ma_write_keypage(), _ma_insert()
- Added new arguments to some functions to be able to write redo information
- Mark key pages as changed when we write with PAGECACHE_LOCK_LEFT_WRITELOCKED
Remove one not needed _ma_write_keypage() in d_search() when upper level will do the write anyway
Changed 2 bmove_upp() to bmove() as this made code easer to understand
More function comments
Indentation fixes
storage/maria/ma_ft_update.c:
New arguments to _ma_write_keypage()
storage/maria/ma_loghandler.c:
Fixed some DBUG_PRINT messages
Simplify code
Added new log entrys for key page redo
Renamed some variables to avoid variable name shadowing
storage/maria/ma_loghandler.h:
Moved some defines here
Added define for storing key number on key pages
Added new translog record types
Added enum for type of operations in LOGREC_REDO_INDEX
storage/maria/ma_open.c:
Always allocate info.pinned_pages (we need now also for normal key page usage)
Update keyinfo->key_nr
Added virtual functions to convert record position o number to be stored on key pages
Update keyinfo->write_comp_flag to value of search flag to be used when writing key
storage/maria/ma_page.c:
Added redo for key pages
- Extended _ma_fetch_keypage() with type of lock to put on page and address to used MARIA_PINNED_PAGE
- _ma_fetch_keypage() now pin's pages if needed
- Extended _ma_write_keypage() with type of locks to be used
- ma_dispose() now locks info->s->state.key_del from other threads
- ma_dispose() writes redo log record
- ma_new() locks info->s->state.key_del from other threads if it was used
- ma_new() now pins read page
Other things:
- Removed some not needed arguments from _ma_new() and _ma_dispose)
- Added some new variables to simplify code
- If EXTRA_DEBUG is used, do crc on full page to catch not unitialized bytes
storage/maria/ma_pagecache.h:
Applied patch from Sanja to add extra argument to pagecache_unlock_by_ulink() to mark if page was changed
Added some defines for pagecache priority levels that one can use
storage/maria/ma_range.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_recovery.c:
- Added hooks for new translog types:
REDO_INDEX, REDO_INDEX_NEW_PAGE, REDO_INDEX_FREE_PAGE, UNDO_KEY_INSERT, UNDO_KEY_DELETE and
UNDO_KEY_DELETE_WITH_ROOT.
- Moved variable declarations to start of function (portability fixes)
- Removed some not needed initializations
- Set only relevant state changes for each redo/undo entry
storage/maria/lockman.c:
Removed end space
storage/maria/ma_check.c:
Removed end space
storage/maria/ma_create.c:
Removed end space
storage/maria/ma_locking.c:
Removed end space
storage/maria/ma_packrec.c:
Removed end space
storage/maria/ma_pagecache.c:
Removed end space
storage/maria/ma_panic.c:
Removed end space
storage/maria/ma_rt_index.c:
Added new arguments for call to _ma_fetch_keypage(), _ma_write_keypage(), _ma_dispose() and _ma_new()
Fixed indentation
storage/maria/ma_rt_key.c:
Added new arguments for call to _ma_fetch_keypage()
storage/maria/ma_rt_split.c:
Added new arguments for call to _ma_new()
Use new keypage header
Added new arguments for call to _ma_write_keypage()
storage/maria/ma_search.c:
Updated comments & indentation
Added new arguments for call to _ma_fetch_keypage()
Made some variables and arguments const
Added virtual functions for converting row position to number to be stored in key
use MARIA_RECORD_POS of record position instead of my_off_t
Record in MARIA_KEY_PARAM how page was changed one key insert (needed for REDO)
storage/maria/ma_sort.c:
Removed end space
storage/maria/ma_statrec.c:
Updated arguments for call to _ma_rec_pos()
storage/maria/ma_test1.c:
Fixed too small buffer to init_pagecache()
Fixed bug when using insert_count and test_flag
storage/maria/ma_test2.c:
Use more resonable pagecache size
Remove not used code
Reset blob_length to fix wrong output message
storage/maria/ma_test_all.sh:
Fixed wrong test
storage/maria/ma_write.c:
Lots of new code to handle REDO of key pages
No logic changes because of REDO code, mostly adding new arguments and adding new code for logging
Added new arguments for calls to _ma_fetch_keypage(), _ma_write_keypage() and similar functions
Move setting of comp_flag in ma_ck_wrte_btree() from runtime to maria_open()
Zerofill new used pages for:
- To remove possible sensitive data left in buffer
- To get idenitical data on pages after running redo
- Better compression of pages if archived
storage/maria/maria_chk.c:
Added information if table is crash safe
storage/maria/maria_def.h:
New virtual function to convert between record position on key and normal record position
Aded mutex and extra variables to handle locking of share->state.key_del
Moved some structure variables to get things more aligned
Added extra arguments to MARIA_KEY_PARAM to be able to remember what was changed on key page on key insert
Added argument to MARIA_PINNED_PAGE to indicate if page was changed
Updated prototypes for functions
Added some structures for signaling changes in REDO handling
storage/maria/unittest/ma_pagecache_single.c:
Updated arguments for changed function calls
storage/myisam/mi_check.c:
Made calc_check_checksum virtual
storage/myisam/mi_checksum.c:
Update checksums to ignore null columns
storage/myisam/mi_create.c:
Mark if table has null column (to know when we have to use mi_checksum())
storage/myisam/mi_open.c:
Added virtual function for calculating checksum to be able to easily ignore NULL fields
storage/myisam/mi_test2.c:
Fixed bug
storage/myisam/myisamdef.h:
Added virtual function for calculating checksum during check table
Removed ha_key_cmp() as this is in handler.h
storage/maria/ma_key_recover.c:
New BitKeeper file ``storage/maria/ma_key_recover.c''
storage/maria/ma_key_recover.h:
New BitKeeper file ``storage/maria/ma_key_recover.h''
storage/maria/ma_key_redo.c:
New BitKeeper file ``storage/maria/ma_key_redo.c''
2007-11-14 18:08:06 +01:00
|
|
|
uint(*get_key)(struct st_maria_keydef *keyinfo, uint nod_flag,
|
|
|
|
uchar **page, uchar *key);
|
2007-01-18 20:38:14 +01:00
|
|
|
int (*pack_key)(struct st_maria_keydef *keyinfo, uint nod_flag,
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar *next_key, uchar *org_key, uchar *prev_key,
|
|
|
|
const uchar *key, struct st_maria_s_param *s_temp);
|
|
|
|
void (*store_key)(struct st_maria_keydef *keyinfo, uchar *key_pos,
|
2006-04-11 15:45:10 +02:00
|
|
|
struct st_maria_s_param *s_temp);
|
2007-10-09 20:09:50 +02:00
|
|
|
int (*ck_insert)(MARIA_HA *inf, uint k_nr, uchar *k, uint klen);
|
|
|
|
int (*ck_delete)(MARIA_HA *inf, uint k_nr, uchar *k, uint klen);
|
2006-04-11 15:45:10 +02:00
|
|
|
} MARIA_KEYDEF;
|
|
|
|
|
|
|
|
|
|
|
|
#define MARIA_UNIQUE_HASH_LENGTH 4
|
|
|
|
|
|
|
|
typedef struct st_maria_unique_def /* Segment definition of unique */
|
|
|
|
{
|
|
|
|
uint16 keysegs; /* Number of key-segment */
|
2007-01-18 20:38:14 +01:00
|
|
|
uint8 key; /* Mapped to which key */
|
2006-04-11 15:45:10 +02:00
|
|
|
uint8 null_are_equal;
|
|
|
|
HA_KEYSEG *seg, *end;
|
|
|
|
} MARIA_UNIQUEDEF;
|
|
|
|
|
|
|
|
typedef struct st_maria_decode_tree /* Decode huff-table */
|
|
|
|
{
|
|
|
|
uint16 *table;
|
|
|
|
uint quick_table_bits;
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar *intervalls;
|
2006-04-11 15:45:10 +02:00
|
|
|
} MARIA_DECODE_TREE;
|
|
|
|
|
|
|
|
|
|
|
|
struct st_maria_bit_buff;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Note that null markers should always be first in a row !
|
|
|
|
When creating a column, one should only specify:
|
|
|
|
type, length, null_bit and null_pos
|
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct st_maria_columndef /* column information */
|
|
|
|
{
|
2007-01-18 20:38:14 +01:00
|
|
|
enum en_fieldtype type;
|
2007-10-09 20:09:50 +02:00
|
|
|
uint32 offset; /* Offset to position in row */
|
2006-04-11 15:45:10 +02:00
|
|
|
uint16 length; /* length of field */
|
2007-10-09 20:09:50 +02:00
|
|
|
uint16 column_nr;
|
2007-04-19 12:18:56 +02:00
|
|
|
/* Intern variable (size of total storage area for the row) */
|
2007-01-18 20:38:14 +01:00
|
|
|
uint16 fill_length;
|
|
|
|
uint16 null_pos; /* Position for null marker */
|
|
|
|
uint16 empty_pos; /* Position for empty marker */
|
|
|
|
uint8 null_bit; /* If column may be NULL */
|
2007-04-19 12:18:56 +02:00
|
|
|
/* Intern. Set if column should be zero packed (part of empty_bits) */
|
|
|
|
uint8 empty_bit;
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
#ifndef NOT_PACKED_DATABASES
|
2007-01-18 20:38:14 +01:00
|
|
|
void(*unpack)(struct st_maria_columndef *rec,
|
|
|
|
struct st_maria_bit_buff *buff,
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar *start, uchar *end);
|
2006-04-11 15:45:10 +02:00
|
|
|
enum en_fieldtype base_type;
|
|
|
|
uint space_length_bits, pack_type;
|
|
|
|
MARIA_DECODE_TREE *huff_tree;
|
|
|
|
#endif
|
|
|
|
} MARIA_COLUMNDEF;
|
|
|
|
|
|
|
|
|
WL#3071 - Maria checkpoint
* Preparation for having a background checkpoint thread:
frequency of checkpoint taken by that thread is now configurable
by the user: global variable maria_checkpoint_frequency, in seconds,
default 30 (checkpoint every 30th second); 0 means no checkpoints
(and thus no background thread, thus no background flushing, that
will probably only be used for testing).
* Don't take checkpoints in Recovery if it didn't do anything
significant; thus no checkpoint after a clean shutdown/restart. The
only checkpoint which is never skipped is the one at shutdown.
* fix for a test failure (after-merge fix)
include/maria.h:
new variable
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
result update
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
position update (=after merge fix, as this position was already changed
into 5.1 and not merged here, causing test to fail)
storage/maria/ha_maria.cc:
Checkpoint's frequency is now configurable by the user:
global variable maria_checkpoint_frequency. Changing it on the fly
requires us to shutdown/restart the background checkpoint thread,
as the loop done in that thread assumes a constant checkpoint
interval. Default value is 30: a checkpoint every 30 seconds (yes, I
know, physicists will remind that it should be named "period" then).
ha_maria now asks for a background checkpoint thread when it starts,
but this is still overruled (disabled) in ma_checkpoint_init().
storage/maria/ma_checkpoint.c:
Checkpoint's frequency is now configurable by the user: background thread
takes a checkpoint every maria_checkpoint_interval-th second.
If that variable is 0, no checkpoints are taken.
Note, I will enable the background thread only in a later changeset.
storage/maria/ma_recovery.c:
Don't take checkpoints at the end of the REDO phase and at the end of
Recovery if Recovery didn't make anything significant (didn't open
any tables, didn't rollback any transactions).
With this, after a clean shutdown, Recovery shouldn't take any
checkpoint, which makes starting faster (we save a few fsync()s of
the log and control file).
2007-10-09 10:38:31 +02:00
|
|
|
extern ulong maria_block_size, maria_checkpoint_frequency;
|
2006-04-11 15:45:10 +02:00
|
|
|
extern ulong maria_concurrent_insert;
|
2007-01-18 20:38:14 +01:00
|
|
|
extern my_bool maria_flush, maria_single_user;
|
2007-04-19 12:18:56 +02:00
|
|
|
extern my_bool maria_delay_key_write;
|
2006-04-11 15:45:10 +02:00
|
|
|
extern my_off_t maria_max_temp_length;
|
|
|
|
extern ulong maria_bulk_insert_tree_size, maria_data_pointer_size;
|
2007-04-04 22:37:09 +02:00
|
|
|
extern PAGECACHE maria_pagecache_var, *maria_pagecache;
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Prototypes for maria-functions */
|
|
|
|
|
|
|
|
extern int maria_init(void);
|
|
|
|
extern void maria_end(void);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_close(MARIA_HA *file);
|
|
|
|
extern int maria_delete(MARIA_HA *file, const uchar *buff);
|
|
|
|
extern MARIA_HA *maria_open(const char *name, int mode,
|
2006-04-11 15:45:10 +02:00
|
|
|
uint wait_if_locked);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern MARIA_HA *maria_clone(struct st_maria_share *share, int mode);
|
2006-04-11 15:45:10 +02:00
|
|
|
extern int maria_panic(enum ha_panic_function function);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_rfirst(MARIA_HA *file, uchar *buf, int inx);
|
|
|
|
extern int maria_rkey(MARIA_HA *file, uchar *buf, int inx,
|
2007-07-27 12:06:39 +02:00
|
|
|
const uchar *key, key_part_map keypart_map,
|
|
|
|
enum ha_rkey_function search_flag);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_rlast(MARIA_HA *file, uchar *buf, int inx);
|
|
|
|
extern int maria_rnext(MARIA_HA *file, uchar *buf, int inx);
|
|
|
|
extern int maria_rnext_same(MARIA_HA *info, uchar *buf);
|
|
|
|
extern int maria_rprev(MARIA_HA *file, uchar *buf, int inx);
|
|
|
|
extern int maria_rrnd(MARIA_HA *file, uchar *buf,
|
2007-01-18 20:38:14 +01:00
|
|
|
MARIA_RECORD_POS pos);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_scan_init(MARIA_HA *file);
|
|
|
|
extern int maria_scan(MARIA_HA *file, uchar *buf);
|
|
|
|
extern void maria_scan_end(MARIA_HA *file);
|
|
|
|
extern int maria_rsame(MARIA_HA *file, uchar *record, int inx);
|
|
|
|
extern int maria_rsame_with_pos(MARIA_HA *file, uchar *record,
|
2007-01-18 20:38:14 +01:00
|
|
|
int inx, MARIA_RECORD_POS pos);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_update(MARIA_HA *file, const uchar *old,
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar *new_record);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_write(MARIA_HA *file, uchar *buff);
|
|
|
|
extern MARIA_RECORD_POS maria_position(MARIA_HA *file);
|
|
|
|
extern int maria_status(MARIA_HA *info, MARIA_INFO *x, uint flag);
|
|
|
|
extern int maria_lock_database(MARIA_HA *file, int lock_type);
|
2007-01-18 20:38:14 +01:00
|
|
|
extern int maria_create(const char *name, enum data_file_type record_type,
|
|
|
|
uint keys, MARIA_KEYDEF *keydef,
|
2006-04-11 15:45:10 +02:00
|
|
|
uint columns, MARIA_COLUMNDEF *columndef,
|
|
|
|
uint uniques, MARIA_UNIQUEDEF *uniquedef,
|
|
|
|
MARIA_CREATE_INFO *create_info, uint flags);
|
|
|
|
extern int maria_delete_table(const char *name);
|
|
|
|
extern int maria_rename(const char *from, const char *to);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_extra(MARIA_HA *file,
|
2006-04-11 15:45:10 +02:00
|
|
|
enum ha_extra_function function, void *extra_arg);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_reset(MARIA_HA *file);
|
|
|
|
extern ha_rows maria_records_in_range(MARIA_HA *info, int inx,
|
2006-04-11 15:45:10 +02:00
|
|
|
key_range *min_key, key_range *max_key);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_is_changed(MARIA_HA *info);
|
|
|
|
extern int maria_delete_all_rows(MARIA_HA *info);
|
2006-04-11 15:45:10 +02:00
|
|
|
extern uint maria_get_pointer_length(ulonglong file_length, uint def);
|
2007-10-09 20:09:50 +02:00
|
|
|
extern int maria_commit(MARIA_HA *info);
|
|
|
|
extern int maria_begin(MARIA_HA *info);
|
2007-11-20 16:42:16 +01:00
|
|
|
extern void maria_disable_logging(MARIA_HA *info);
|
|
|
|
extern void maria_enable_logging(MARIA_HA *info);
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
/* this is used to pass to mysql_mariachk_table */
|
|
|
|
|
|
|
|
#define MARIA_CHK_REPAIR 1 /* equivalent to mariachk -r */
|
|
|
|
#define MARIA_CHK_VERIFY 2 /* Verify, run repair if failure */
|
|
|
|
|
2006-12-19 19:15:53 +01:00
|
|
|
typedef uint maria_bit_type;
|
|
|
|
|
|
|
|
typedef struct st_maria_bit_buff
|
|
|
|
{ /* Used for packing of record */
|
|
|
|
maria_bit_type current_byte;
|
|
|
|
uint bits;
|
|
|
|
uchar *pos, *end, *blob_pos, *blob_end;
|
|
|
|
uint error;
|
|
|
|
} MARIA_BIT_BUFF;
|
|
|
|
|
|
|
|
|
2006-04-11 15:45:10 +02:00
|
|
|
typedef struct st_maria_sort_info
|
|
|
|
{
|
|
|
|
#ifdef THREAD
|
|
|
|
/* sync things */
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
pthread_cond_t cond;
|
|
|
|
#endif
|
2007-07-01 15:20:57 +02:00
|
|
|
MARIA_HA *info, *new_info;
|
2006-04-11 15:45:10 +02:00
|
|
|
HA_CHECK *param;
|
|
|
|
char *buff;
|
|
|
|
SORT_KEY_BLOCKS *key_block, *key_block_end;
|
|
|
|
SORT_FT_BUF *ft_buf;
|
|
|
|
my_off_t filelength, dupp, buff_length;
|
2007-07-01 15:20:57 +02:00
|
|
|
ulonglong page;
|
2006-04-11 15:45:10 +02:00
|
|
|
ha_rows max_records;
|
|
|
|
uint current_key, total_keys;
|
|
|
|
uint got_error, threads_running;
|
|
|
|
myf myf_rw;
|
2007-07-01 15:20:57 +02:00
|
|
|
enum data_file_type new_data_file_type, org_data_file_type;
|
2006-04-11 15:45:10 +02:00
|
|
|
} MARIA_SORT_INFO;
|
|
|
|
|
|
|
|
typedef struct st_maria_sort_param
|
|
|
|
{
|
|
|
|
pthread_t thr;
|
|
|
|
IO_CACHE read_cache, tempfile, tempfile_for_exceptions;
|
|
|
|
DYNAMIC_ARRAY buffpek;
|
2006-12-19 19:15:53 +01:00
|
|
|
MARIA_BIT_BUFF bit_buff; /* For parallel repair of packrec. */
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
MARIA_KEYDEF *keyinfo;
|
|
|
|
MARIA_SORT_INFO *sort_info;
|
|
|
|
HA_KEYSEG *seg;
|
2007-07-02 19:45:15 +02:00
|
|
|
uchar **sort_keys;
|
|
|
|
uchar *rec_buff;
|
2006-04-11 15:45:10 +02:00
|
|
|
void *wordlist, *wordptr;
|
Completion of merge of mysql-5.1 into mysql-maria.
Manually imported changes done to MyISAM (include/myisam.h,
storage/myisam/*, sql/ha_myisam.*, mysql-test/t/myisam.test,
mysql-test/t/ps_2myisam.test) the last
months into Maria (tedious, should do it more frequently in the
future), including those not done at the previous 5.1->Maria merge
(please in the future don't forget to apply MyISAM changes to Maria
when you merge 5.1 into Maria).
Note: I didn't try to import anything which could be MyISAM-related
in other tests of mysql-test (I didn't want to dig in all csets),
but as QA is working to make most tests re-usable for other engines
(Falcon), it is likely that we'll benefit from this and just have
to set engine=Maria somewhere to run those tests on Maria.
func_group and partition tests fail but they already do in main 5.1
on my machine. No Valgrind error in t/*maria*.test.
Monty: please see the commit comment of maria.result and check.
BitKeeper/deleted/.del-ha_maria.m4:
Delete: config/ac-macros/ha_maria.m4
configure.in:
fix for the new way of enabling engines
include/maria.h:
importing changes done to MyISAM the last months into Maria
include/my_handler.h:
importing changes done to MyISAM the last months into Maria
include/myisam.h:
importing changes done to MyISAM the last months into Maria
mysql-test/r/maria.result:
identical to myisam.result, except the engine name in some places
AND in the line testing key_block_size=1000000000000000000:
Maria gives a key block size of 8192 while MyISAM gives 4096;
is it explainable by the difference between MARIA_KEY_BLOCK_LENGTH
and the same constant in MyISAM? Monty?
mysql-test/r/ps_maria.result:
identical to ps_2myisam.result (except the engine name in some places)
mysql-test/t/maria.test:
instead of engine=maria everywhere, I use @@storage_engine (reduces
the diff with myisam.test).
importing changes done to MyISAM the last months into Maria
mysys/my_handler.c:
importing changes done to MyISAM the last months into Maria
sql/ha_maria.cc:
importing changes done to MyISAM the last months into Maria
sql/ha_maria.h:
importing changes done to MyISAM the last months into Maria
sql/mysqld.cc:
unneeded
storage/maria/Makefile.am:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_check.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_create.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_delete_table.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_dynrec.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_extra.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_boolean_search.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_eval.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_nlq_search.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_parser.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_test1.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ft_update.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_ftdefs.h:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_key.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_open.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_page.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_rkey.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_rsamepos.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_rt_index.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_rt_mbr.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_search.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_sort.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_test1.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_test2.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_test3.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_update.c:
importing changes done to MyISAM the last months into Maria
storage/maria/ma_write.c:
importing changes done to MyISAM the last months into Maria
storage/maria/maria_chk.c:
importing changes done to MyISAM the last months into Maria
storage/maria/maria_def.h:
importing changes done to MyISAM the last months into Maria
storage/maria/maria_ftdump.c:
importing changes done to MyISAM the last months into Maria
storage/maria/maria_pack.c:
importing changes done to MyISAM the last months into Maria
2006-08-10 16:36:54 +02:00
|
|
|
MEM_ROOT wordroot;
|
2006-04-11 15:45:10 +02:00
|
|
|
char *record;
|
|
|
|
MY_TMPDIR *tmpdir;
|
|
|
|
|
|
|
|
/*
|
|
|
|
The next two are used to collect statistics, see maria_update_key_parts for
|
|
|
|
description.
|
|
|
|
*/
|
|
|
|
ulonglong unique[HA_MAX_KEY_SEG+1];
|
|
|
|
ulonglong notnull[HA_MAX_KEY_SEG+1];
|
|
|
|
|
2007-11-28 20:38:30 +01:00
|
|
|
MARIA_RECORD_POS pos,max_pos,filepos,start_recpos, current_filepos;
|
2006-04-11 15:45:10 +02:00
|
|
|
uint key, key_length,real_key_length,sortbuff_size;
|
|
|
|
uint maxbuffers, keys, find_length, sort_keys_length;
|
|
|
|
my_bool fix_datafile, master;
|
2006-12-19 19:15:53 +01:00
|
|
|
my_bool calc_checksum; /* calculate table checksum */
|
2007-07-02 19:45:15 +02:00
|
|
|
size_t rec_buff_size;
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
int (*key_cmp)(struct st_maria_sort_param *, const void *, const void *);
|
2007-07-02 19:45:15 +02:00
|
|
|
int (*key_read)(struct st_maria_sort_param *, uchar *);
|
|
|
|
int (*key_write)(struct st_maria_sort_param *, const uchar *);
|
2006-04-11 15:45:10 +02:00
|
|
|
void (*lock_in_memory)(HA_CHECK *);
|
2007-10-04 19:33:42 +02:00
|
|
|
int (*write_keys)(struct st_maria_sort_param *, register uchar **,
|
2006-04-11 15:45:10 +02:00
|
|
|
uint , struct st_buffpek *, IO_CACHE *);
|
2007-10-04 19:33:42 +02:00
|
|
|
uint (*read_to_buffer)(IO_CACHE *,struct st_buffpek *, uint);
|
|
|
|
int (*write_key)(struct st_maria_sort_param *, IO_CACHE *,uchar *,
|
|
|
|
uint, uint);
|
2006-04-11 15:45:10 +02:00
|
|
|
} MARIA_SORT_PARAM;
|
|
|
|
|
|
|
|
|
|
|
|
/* functions in maria_check */
|
2007-01-18 20:38:14 +01:00
|
|
|
void maria_chk_init(HA_CHECK *param);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_chk_status(HA_CHECK *param, MARIA_HA *info);
|
2007-11-28 20:38:30 +01:00
|
|
|
int maria_chk_del(HA_CHECK *param, MARIA_HA *info, uint test_flag);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_chk_size(HA_CHECK *param, MARIA_HA *info);
|
|
|
|
int maria_chk_key(HA_CHECK *param, MARIA_HA *info);
|
|
|
|
int maria_chk_data_link(HA_CHECK *param, MARIA_HA *info, int extend);
|
2007-11-28 20:38:30 +01:00
|
|
|
int maria_repair(HA_CHECK *param, MARIA_HA *info, char * name, uint rep_quick);
|
|
|
|
int maria_sort_index(HA_CHECK *param, MARIA_HA *info, char * name);
|
|
|
|
int maria_repair_by_sort(HA_CHECK *param, MARIA_HA *info,
|
|
|
|
const char *name, uint rep_quick);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_repair_parallel(HA_CHECK *param, register MARIA_HA *info,
|
2007-11-28 20:38:30 +01:00
|
|
|
const char *name, uint rep_quick);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_change_to_newfile(const char *filename, const char *old_ext,
|
2007-01-18 20:38:14 +01:00
|
|
|
const char *new_ext, myf myflags);
|
2006-04-11 15:45:10 +02:00
|
|
|
void maria_lock_memory(HA_CHECK *param);
|
|
|
|
int maria_update_state_info(HA_CHECK *param, MARIA_HA *info, uint update);
|
2007-10-09 20:09:50 +02:00
|
|
|
void maria_update_key_parts(MARIA_KEYDEF *keyinfo, double *rec_per_key_part,
|
2007-01-18 20:38:14 +01:00
|
|
|
ulonglong *unique, ulonglong *notnull,
|
|
|
|
ulonglong records);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_filecopy(HA_CHECK *param, File to, File from, my_off_t start,
|
2007-01-18 20:38:14 +01:00
|
|
|
my_off_t length, const char *type);
|
2007-07-02 19:45:15 +02:00
|
|
|
int maria_movepoint(MARIA_HA *info, uchar *record, my_off_t oldpos,
|
2007-01-18 20:38:14 +01:00
|
|
|
my_off_t newpos, uint prot_key);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_write_data_suffix(MARIA_SORT_INFO *sort_info, my_bool fix_datafile);
|
|
|
|
int maria_test_if_almost_full(MARIA_HA *info);
|
2007-01-18 20:38:14 +01:00
|
|
|
int maria_recreate_table(HA_CHECK *param, MARIA_HA **org_info, char *filename);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_disable_indexes(MARIA_HA *info);
|
|
|
|
int maria_enable_indexes(MARIA_HA *info);
|
|
|
|
int maria_indexes_are_disabled(MARIA_HA *info);
|
|
|
|
void maria_disable_non_unique_index(MARIA_HA *info, ha_rows rows);
|
|
|
|
my_bool maria_test_if_sort_rep(MARIA_HA *info, ha_rows rows, ulonglong key_map,
|
|
|
|
my_bool force);
|
|
|
|
|
|
|
|
int maria_init_bulk_insert(MARIA_HA *info, ulong cache_size, ha_rows rows);
|
|
|
|
void maria_flush_bulk_insert(MARIA_HA *info, uint inx);
|
|
|
|
void maria_end_bulk_insert(MARIA_HA *info);
|
2007-04-04 22:37:09 +02:00
|
|
|
int maria_assign_to_pagecache(MARIA_HA *info, ulonglong key_map,
|
|
|
|
PAGECACHE *key_cache);
|
|
|
|
void maria_change_pagecache(PAGECACHE *old_key_cache,
|
|
|
|
PAGECACHE *new_key_cache);
|
2006-04-11 15:45:10 +02:00
|
|
|
int maria_preload(MARIA_HA *info, ulonglong key_map, my_bool ignore_leaves);
|
|
|
|
|
|
|
|
/* fulltext functions */
|
2007-07-02 19:45:15 +02:00
|
|
|
FT_INFO *maria_ft_init_search(uint,void *, uint, uchar *, uint,
|
|
|
|
CHARSET_INFO *, uchar *);
|
2006-04-11 15:45:10 +02:00
|
|
|
|
|
|
|
/* 'Almost-internal' Maria functions */
|
|
|
|
|
|
|
|
void _ma_update_auto_increment_key(HA_CHECK *param, MARIA_HA *info,
|
|
|
|
my_bool repair);
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|