2008-03-04 12:58:21 +01:00
|
|
|
/* Copyright (C) 2006-2008 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; version 2 of the License.
|
|
|
|
|
|
|
|
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 */
|
|
|
|
|
2007-12-16 18:39:06 +01:00
|
|
|
#include "../maria_def.h"
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <tap.h>
|
|
|
|
#include "../trnman.h"
|
|
|
|
|
2011-05-13 15:22:05 +02:00
|
|
|
extern my_bool maria_log_remove(const char *testdir);
|
|
|
|
extern char *create_tmpdir(const char *progname);
|
2007-12-16 18:39:06 +01:00
|
|
|
|
|
|
|
#ifndef DBUG_OFF
|
|
|
|
static const char *default_dbug_option;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define PCACHE_SIZE (1024*1024*10)
|
|
|
|
#define PCACHE_PAGE TRANSLOG_PAGE_SIZE
|
|
|
|
#define LOG_FILE_SIZE (8*1024L*1024L)
|
|
|
|
#define LOG_FLAGS 0
|
|
|
|
#define LONG_BUFFER_SIZE (LOG_FILE_SIZE + LOG_FILE_SIZE / 2)
|
|
|
|
|
|
|
|
|
|
|
|
int main(int argc __attribute__((unused)), char *argv[])
|
|
|
|
{
|
|
|
|
ulong i;
|
|
|
|
uint pagen;
|
|
|
|
uchar long_tr_id[6];
|
|
|
|
PAGECACHE pagecache;
|
|
|
|
LSN lsn;
|
Injecting more "const" declarations into code which does not change
pointed data.
I ran gcc -Wcast-qual on storage/maria, this identified un-needed casts,
a couple of functions which said they had a const parameter though
they changed the pointed content! This is fixed here. Some suspicious
places receive a comment.
The original intention of running -Wcast-qual was to find what code
changes R-tree keys: I added const words, but hidden casts
like those of int2store (casts target to (uint16*)) removed const
checking; -Wcast-qual helped find those hidden casts.
Log handler does not change the content pointed by LEX_STRING::str it
receives, so we now use a struct which has a const inside, to emphasize
this and be able to pass "const uchar*" buffers to log handler
without fear of their content being changed by it.
One-line fix for a merge glitch (when merging from MyISAM).
include/m_string.h:
As Maria's log handler uses LEX_STRING but never changes the content
pointed by LEX_STRING::str, and assigns uchar* into this member most
of the time, we introduce a new struct LEX_CUSTRING
(C const U unsigned) for the log handler.
include/my_global.h:
In macros which read pointed content: use const pointers so that
gcc -Wcast-qual does not warn about casting a const pointer to non-const.
include/my_handler.h:
In macros which read pointed content: use const pointers so that
gcc -Wcast-qual does not warn about casting a const pointer to non-const.
ha_find_null() does not change *a.
include/my_sys.h:
insert_dynamic() does not change *element.
include/myisampack.h:
In macros which read pointed content: use const pointers so that
gcc -Wcast-qual does not warn about casting a const pointer to non-const.
mysys/array.c:
insert_dynamic() does not change *element
mysys/my_handler.c:
ha_find_null() does not change *a
storage/maria/ma_bitmap.c:
Log handler receives const strings now
storage/maria/ma_blockrec.c:
Log handler receives const strings now.
_ma_apply_undo_row_delete/update() do change *header.
storage/maria/ma_blockrec.h:
correct prototype
storage/maria/ma_check.c:
Log handler receives const strings now. Un-needed casts
storage/maria/ma_checkpoint.c:
Log handler receives const strings now
storage/maria/ma_checksum.c:
unneeded cast
storage/maria/ma_commit.c:
Log handler receives const strings now
storage/maria/ma_create.c:
Log handler receives const strings now
storage/maria/ma_dbug.c:
fixing warning of gcc -Wcast-qual
storage/maria/ma_delete.c:
Log handler receives const strings now
storage/maria/ma_delete_all.c:
Log handler receives const strings now
storage/maria/ma_delete_table.c:
Log handler receives const strings now
storage/maria/ma_dynrec.c:
fixing some warnings of gcc -Wcast-qual. Unneeded casts removed.
Comment about function which lies.
storage/maria/ma_ft_parser.c:
fix for warnings of gcc -Wcast-qual, removing unneeded casts
storage/maria/ma_ft_update.c:
less casts, comment
storage/maria/ma_key.c:
less casts, stay const (warnings of gcc -Wcast-qual)
storage/maria/ma_key_recover.c:
Log handler receives const strings now
storage/maria/ma_loghandler.c:
Log handler receives const strings now
storage/maria/ma_loghandler.h:
Log handler receives const strings now
storage/maria/ma_loghandler_lsn.h:
In macros which read pointed content: use const pointers so that
gcc -Wcast-qual does not warn about casting a const pointer to non-const.
storage/maria/ma_page.c:
Log handler receives const strings now; more const
storage/maria/ma_recovery.c:
Log handler receives const strings now
storage/maria/ma_rename.c:
Log handler receives const strings now
storage/maria/ma_rt_index.c:
more const, to emphasize that functions don't change pointed content.
best_key= NULL was forgotten during merge from MyISAM a few days ago,
was causing a Valgrind warning
storage/maria/ma_rt_index.h:
new proto
storage/maria/ma_rt_key.c:
more const
storage/maria/ma_rt_key.h:
new proto
storage/maria/ma_rt_mbr.c:
more const for functions which deserve it
storage/maria/ma_rt_mbr.h:
new prototype
storage/maria/ma_rt_split.c:
make const what is not changed.
storage/maria/ma_search.c:
un-needed casts, more const
storage/maria/ma_sp_key.c:
more const
storage/maria/ma_unique.c:
un-needed casts.
storage/maria/ma_write.c:
Log handler receives const strings now
storage/maria/maria_def.h:
some more const
storage/maria/unittest/ma_test_loghandler-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Log handler receives const strings now
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Log handler receives const strings now
2008-04-03 15:40:25 +02:00
|
|
|
LEX_CUSTRING parts[TRANSLOG_INTERNAL_PARTS + 1];
|
2007-12-16 18:39:06 +01:00
|
|
|
uchar *long_buffer= malloc(LONG_BUFFER_SIZE);
|
|
|
|
|
|
|
|
MY_INIT(argv[0]);
|
|
|
|
|
|
|
|
plan(2);
|
|
|
|
|
|
|
|
bzero(&pagecache, sizeof(pagecache));
|
|
|
|
bzero(long_buffer, LONG_BUFFER_SIZE);
|
2011-05-13 15:22:05 +02:00
|
|
|
maria_data_root= create_tmpdir(argv[0]);
|
|
|
|
if (maria_log_remove(0))
|
2007-12-16 18:39:06 +01:00
|
|
|
exit(1);
|
|
|
|
|
|
|
|
bzero(long_tr_id, 6);
|
|
|
|
#ifndef DBUG_OFF
|
|
|
|
#if defined(__WIN__)
|
|
|
|
default_dbug_option= "d:t:i:O,\\ma_test_loghandler.trace";
|
|
|
|
#else
|
|
|
|
default_dbug_option= "d:t:i:o,/tmp/ma_test_loghandler.trace";
|
|
|
|
#endif
|
|
|
|
if (argc > 1)
|
|
|
|
{
|
|
|
|
DBUG_SET(default_dbug_option);
|
|
|
|
DBUG_SET_INITIAL(default_dbug_option);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
Added versioning of row data
Will in future changeset (soon) av versioning of status variables (number of rows) and index
Changed some LEX_STRING to LEX_CUSTRING to avoid casts and warnings
Removed some not needed variables (as noticed by Guilhem)
include/maria.h:
Added prototypes for maria_chk_init_for_check(), maria_versioning() and maria_ignore_trids()
include/my_base.h:
Add new error HA_ERR_ROW_NOT_VISIBLE
include/myisamchk.h:
Added variables for checking visibility of rows during maria_chk
include/thr_lock.h:
Changed argument type from int to my_bool for get_status
Added variable allow_multiple_concurrent_insert, to signal if table supports multiple concurrent inserts
mysql-test/r/maria-page-checksum.result:
Added missing drop table
mysql-test/t/maria-page-checksum.test:
Added missing drop table
mysys/my_handler.c:
Added new error messages
mysys/thr_lock.c:
Added support for multiple concurrent inserts, if table handler supports it
sql/sql_yacc.yy:
Added LOCK TABLE table_name WRITE CONCURRENT
This was added (temporarly?) to be able to check versioning with Maria
storage/csv/ha_tina.cc:
Updated parameter for get_status
storage/maria/ha_maria.cc:
Added calls to maria_chk_init_status()
Fixed call to ma_control_file_open()
storage/maria/ma_blockrec.c:
Changed some LEX_STRING to LEX_CUSTRING to avoid casts and warnings
Changed back some 'header' parameters to const char*
Removed some casts
Added support for versioning:
- If info->row_flag & ROW_FLAG_TRANSID is set, store transaction id together with the row
- When reading rows, check if rows are visible. Give error if not
- When scanning table, ignore not visible rows
- Added function parameters to some functions, to be able to call _ma_compact_block_page() with different parameters depending of if the page is a HEAD or TAIL page
- _ma_compact_block_page() deletes transaction id's that are visible by all running transactions
- Added functions for thr_lock() to enable multiple concurrent inserts
- Added helper function 'mysql_versioning()' to enable/disable versioning
- Added helper function maria_ignore_trids(), used by maria_chk and maria_pack to see all rows.
storage/maria/ma_blockrec.h:
Updated parameters for some functions.
Added new functions to read/store state with thr_lock
storage/maria/ma_check.c:
Enable handling of transaction id's in rows
Give a readable error if a table contains a transation id that makes rows not visible
storage/maria/ma_control_file.c:
Added option to not give warning if control file doesn't exists.
storage/maria/ma_control_file.h:
Updated parameter lists for ma_control_file_open()
storage/maria/ma_delete.c:
Removed not used variable (suggestion by Guilhem)
storage/maria/ma_locking.c:
Changed type of argument from int -> my_bool
storage/maria/ma_open.c:
Removed not used variables 'key_write_undo_lsn' and 'key_delete_undo_lsn'
Added new thr_lock interface functions for BLOCK_RECORD to enable multiple concurrent insert
storage/maria/ma_test1.c:
Added option --versioning (-C) to check versioning
storage/maria/ma_test2.c:
Added option -C to check versioning
storage/maria/ma_test_recovery:
Forward argumetns to ma_test_recovery.pl
storage/maria/ma_write.c:
Removed not used variable key_write_undo_lsn
storage/maria/maria_chk.c:
Always read control file (if exist) at start
Initialize checking of tables by calling maria_chk_init_for_check()
In verbose mode and in case of error, print max found transaction id
storage/maria/maria_def.h:
Added Trid to MARIA_ROW to be able to check transaction id for found row
Moved 'base_length' from MARIA_ROW to MARIA_HA to be able to handle different base length (with and without TRANSID) without if's
Added default row_flag to MARIA_HA for the same reason
Changed LEX_STRING -> LEX_CUSTRING to avoid casts in ma_blockrec.c
Removed not needed variables key_write_undo_lsn and key_delete_undo_lsn
Added prototypes for new functions and fixed those that had changed
storage/maria/maria_pack.c:
Ensure we can read all rows from the file, independent of the used transaction id
storage/maria/maria_read_log.c:
Updated arguments to ma_control_file_open()
storage/maria/trnman.c:
If we have only one transaction, fixed that min_read_from contains current transaction
Fixed that trnman_can_read_from() returns that row is readable if it was written by current transaction
storage/maria/unittest/ma_control_file-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_all-t:
Added test of versioning
Removed printing of one extra space
storage/maria/unittest/ma_test_loghandler-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_recovery.expected:
Updated file with result from new tests
storage/maria/unittest/ma_test_recovery.pl:
Added options --abort-on-error and --verbose
In case of --verbose, print all excuted shell commands
Added test of versioning
storage/myisam/mi_locking.c:
Updated type of parameter
storage/myisam/myisamdef.h:
Updated type of parameter
mysql-test/r/maria-mvcc.result:
New BitKeeper file ``mysql-test/r/maria-mvcc.result''
mysql-test/t/maria-mvcc.test:
New BitKeeper file ``mysql-test/t/maria-mvcc.test''
2008-04-10 04:26:36 +02:00
|
|
|
if (ma_control_file_open(TRUE, TRUE))
|
2007-12-16 18:39:06 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "Can't init control file (%d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
|
|
|
PCACHE_PAGE, 0)) == 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
2011-05-13 15:22:05 +02:00
|
|
|
if (translog_init_with_table(maria_data_root, LOG_FILE_SIZE, 50112, 0, &pagecache,
|
2007-12-21 14:25:30 +01:00
|
|
|
LOG_FLAGS, 0, &translog_example_table_init,
|
|
|
|
0))
|
2007-12-16 18:39:06 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "Can't init loghandler (%d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
/* Suppressing of automatic record writing */
|
|
|
|
dummy_transaction_object.first_undo_lsn|= TRANSACTION_LOGGED_LONG_ID;
|
|
|
|
|
|
|
|
/* write more then 1 file */
|
|
|
|
int4store(long_tr_id, 0);
|
2008-08-06 16:03:27 +02:00
|
|
|
parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id;
|
2007-12-16 18:39:06 +01:00
|
|
|
parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6;
|
|
|
|
if (translog_write_record(&lsn,
|
|
|
|
LOGREC_FIXED_RECORD_0LSN_EXAMPLE,
|
|
|
|
&dummy_transaction_object, NULL, 6,
|
|
|
|
TRANSLOG_INTERNAL_PARTS + 1,
|
|
|
|
parts, NULL, NULL))
|
|
|
|
{
|
2008-08-06 16:03:27 +02:00
|
|
|
fprintf(stderr, "Can't write record #0\n");
|
2007-12-16 18:39:06 +01:00
|
|
|
translog_destroy();
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
for(i= 0; i < LOG_FILE_SIZE/6 && LSN_FILE_NO(lsn) == 1; i++)
|
|
|
|
{
|
|
|
|
if (translog_write_record(&lsn,
|
|
|
|
LOGREC_FIXED_RECORD_0LSN_EXAMPLE,
|
|
|
|
&dummy_transaction_object, NULL, 6,
|
|
|
|
TRANSLOG_INTERNAL_PARTS + 1,
|
|
|
|
parts, NULL, NULL))
|
|
|
|
{
|
2008-08-06 16:03:27 +02:00
|
|
|
fprintf(stderr, "Can't write record #0\n");
|
2007-12-16 18:39:06 +01:00
|
|
|
translog_destroy();
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
translog_destroy();
|
|
|
|
end_pagecache(&pagecache, 1);
|
|
|
|
ma_control_file_end();
|
|
|
|
|
|
|
|
{
|
|
|
|
char file_name[FN_REFLEN];
|
|
|
|
for (i= 1; i <= 2; i++)
|
|
|
|
{
|
|
|
|
translog_filename_by_fileno(i, file_name);
|
2008-01-03 08:45:46 +01:00
|
|
|
if (my_access(file_name, W_OK))
|
2007-12-16 18:39:06 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "No file '%s'\n", file_name);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if (my_delete(file_name, MYF(MY_WME)) != 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Error %d during removing file'%s'\n",
|
|
|
|
errno, file_name);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Added versioning of row data
Will in future changeset (soon) av versioning of status variables (number of rows) and index
Changed some LEX_STRING to LEX_CUSTRING to avoid casts and warnings
Removed some not needed variables (as noticed by Guilhem)
include/maria.h:
Added prototypes for maria_chk_init_for_check(), maria_versioning() and maria_ignore_trids()
include/my_base.h:
Add new error HA_ERR_ROW_NOT_VISIBLE
include/myisamchk.h:
Added variables for checking visibility of rows during maria_chk
include/thr_lock.h:
Changed argument type from int to my_bool for get_status
Added variable allow_multiple_concurrent_insert, to signal if table supports multiple concurrent inserts
mysql-test/r/maria-page-checksum.result:
Added missing drop table
mysql-test/t/maria-page-checksum.test:
Added missing drop table
mysys/my_handler.c:
Added new error messages
mysys/thr_lock.c:
Added support for multiple concurrent inserts, if table handler supports it
sql/sql_yacc.yy:
Added LOCK TABLE table_name WRITE CONCURRENT
This was added (temporarly?) to be able to check versioning with Maria
storage/csv/ha_tina.cc:
Updated parameter for get_status
storage/maria/ha_maria.cc:
Added calls to maria_chk_init_status()
Fixed call to ma_control_file_open()
storage/maria/ma_blockrec.c:
Changed some LEX_STRING to LEX_CUSTRING to avoid casts and warnings
Changed back some 'header' parameters to const char*
Removed some casts
Added support for versioning:
- If info->row_flag & ROW_FLAG_TRANSID is set, store transaction id together with the row
- When reading rows, check if rows are visible. Give error if not
- When scanning table, ignore not visible rows
- Added function parameters to some functions, to be able to call _ma_compact_block_page() with different parameters depending of if the page is a HEAD or TAIL page
- _ma_compact_block_page() deletes transaction id's that are visible by all running transactions
- Added functions for thr_lock() to enable multiple concurrent inserts
- Added helper function 'mysql_versioning()' to enable/disable versioning
- Added helper function maria_ignore_trids(), used by maria_chk and maria_pack to see all rows.
storage/maria/ma_blockrec.h:
Updated parameters for some functions.
Added new functions to read/store state with thr_lock
storage/maria/ma_check.c:
Enable handling of transaction id's in rows
Give a readable error if a table contains a transation id that makes rows not visible
storage/maria/ma_control_file.c:
Added option to not give warning if control file doesn't exists.
storage/maria/ma_control_file.h:
Updated parameter lists for ma_control_file_open()
storage/maria/ma_delete.c:
Removed not used variable (suggestion by Guilhem)
storage/maria/ma_locking.c:
Changed type of argument from int -> my_bool
storage/maria/ma_open.c:
Removed not used variables 'key_write_undo_lsn' and 'key_delete_undo_lsn'
Added new thr_lock interface functions for BLOCK_RECORD to enable multiple concurrent insert
storage/maria/ma_test1.c:
Added option --versioning (-C) to check versioning
storage/maria/ma_test2.c:
Added option -C to check versioning
storage/maria/ma_test_recovery:
Forward argumetns to ma_test_recovery.pl
storage/maria/ma_write.c:
Removed not used variable key_write_undo_lsn
storage/maria/maria_chk.c:
Always read control file (if exist) at start
Initialize checking of tables by calling maria_chk_init_for_check()
In verbose mode and in case of error, print max found transaction id
storage/maria/maria_def.h:
Added Trid to MARIA_ROW to be able to check transaction id for found row
Moved 'base_length' from MARIA_ROW to MARIA_HA to be able to handle different base length (with and without TRANSID) without if's
Added default row_flag to MARIA_HA for the same reason
Changed LEX_STRING -> LEX_CUSTRING to avoid casts in ma_blockrec.c
Removed not needed variables key_write_undo_lsn and key_delete_undo_lsn
Added prototypes for new functions and fixed those that had changed
storage/maria/maria_pack.c:
Ensure we can read all rows from the file, independent of the used transaction id
storage/maria/maria_read_log.c:
Updated arguments to ma_control_file_open()
storage/maria/trnman.c:
If we have only one transaction, fixed that min_read_from contains current transaction
Fixed that trnman_can_read_from() returns that row is readable if it was written by current transaction
storage/maria/unittest/ma_control_file-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_all-t:
Added test of versioning
Removed printing of one extra space
storage/maria/unittest/ma_test_loghandler-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_loghandler_purge-t.c:
Updated arguments to ma_control_file_open()
storage/maria/unittest/ma_test_recovery.expected:
Updated file with result from new tests
storage/maria/unittest/ma_test_recovery.pl:
Added options --abort-on-error and --verbose
In case of --verbose, print all excuted shell commands
Added test of versioning
storage/myisam/mi_locking.c:
Updated type of parameter
storage/myisam/myisamdef.h:
Updated type of parameter
mysql-test/r/maria-mvcc.result:
New BitKeeper file ``mysql-test/r/maria-mvcc.result''
mysql-test/t/maria-mvcc.test:
New BitKeeper file ``mysql-test/t/maria-mvcc.test''
2008-04-10 04:26:36 +02:00
|
|
|
if (ma_control_file_open(TRUE, TRUE))
|
2007-12-16 18:39:06 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "Can't init control file (%d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
if ((pagen= init_pagecache(&pagecache, PCACHE_SIZE, 0, 0,
|
|
|
|
PCACHE_PAGE, 0)) == 0)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Got error: init_pagecache() (errno: %d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
2011-05-13 15:22:05 +02:00
|
|
|
if (translog_init_with_table(maria_data_root, LOG_FILE_SIZE, 50112, 0, &pagecache,
|
2007-12-21 14:25:30 +01:00
|
|
|
LOG_FLAGS, 0, &translog_example_table_init,
|
|
|
|
1))
|
2007-12-16 18:39:06 +01:00
|
|
|
{
|
|
|
|
fprintf(stderr, "Can't init loghandler (%d)\n", errno);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
/* Suppressing of automatic record writing */
|
|
|
|
dummy_transaction_object.first_undo_lsn|= TRANSACTION_LOGGED_LONG_ID;
|
|
|
|
|
|
|
|
ok(1, "Log init OK");
|
|
|
|
|
|
|
|
int4store(long_tr_id, 0);
|
2008-08-06 16:03:27 +02:00
|
|
|
parts[TRANSLOG_INTERNAL_PARTS + 0].str= long_tr_id;
|
2007-12-16 18:39:06 +01:00
|
|
|
parts[TRANSLOG_INTERNAL_PARTS + 0].length= 6;
|
|
|
|
if (translog_write_record(&lsn,
|
|
|
|
LOGREC_FIXED_RECORD_0LSN_EXAMPLE,
|
|
|
|
&dummy_transaction_object, NULL, 6,
|
|
|
|
TRANSLOG_INTERNAL_PARTS + 1,
|
|
|
|
parts, NULL, NULL))
|
|
|
|
{
|
2008-08-06 16:03:27 +02:00
|
|
|
fprintf(stderr, "Can't write record #0\n");
|
2007-12-16 18:39:06 +01:00
|
|
|
translog_destroy();
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
translog_destroy();
|
|
|
|
end_pagecache(&pagecache, 1);
|
|
|
|
ma_control_file_end();
|
|
|
|
|
|
|
|
if (!translog_is_file(3))
|
|
|
|
{
|
|
|
|
fprintf(stderr, "No file #3\n");
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
ok(1, "New log is OK");
|
|
|
|
|
2011-05-13 15:22:05 +02:00
|
|
|
if (maria_log_remove(maria_data_root))
|
2007-12-16 18:39:06 +01:00
|
|
|
exit(1);
|
|
|
|
exit(0);
|
|
|
|
}
|
2011-04-25 17:22:25 +02:00
|
|
|
|
|
|
|
#include "../ma_check_standalone.h"
|