2010-06-10 13:15:35 +02:00
|
|
|
/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
|
2006-04-10 17:06:12 +02:00
|
|
|
|
|
|
|
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
|
2006-12-27 02:23:51 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2006-04-10 17:06:12 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
Library for providing TAP support for testing C and C++ was written
|
|
|
|
by Mats Kindahl <mats@mysql.com>.
|
|
|
|
*/
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
#ifndef TAP_H
|
|
|
|
#define TAP_H
|
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
#include "my_global.h"
|
2006-04-10 17:06:12 +02:00
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
/*
|
|
|
|
@defgroup MyTAP MySQL support for performing unit tests according to
|
|
|
|
the Test Anything Protocol (TAP).
|
2006-04-10 17:06:12 +02:00
|
|
|
*/
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
#define NO_PLAN (0)
|
|
|
|
|
|
|
|
/**
|
|
|
|
Data about test plan.
|
|
|
|
|
2006-10-20 21:50:08 +02:00
|
|
|
@ingroup MyTAP_Internal
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
@internal We are using the "typedef struct X { ... } X" idiom to
|
|
|
|
create class/struct X both in C and C++.
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
typedef struct TEST_DATA {
|
|
|
|
/**
|
|
|
|
Number of tests that is planned to execute.
|
|
|
|
|
|
|
|
Can be zero (<code>NO_PLAN</code>) meaning that the plan string
|
|
|
|
will be printed at the end of test instead.
|
|
|
|
*/
|
|
|
|
int plan;
|
|
|
|
|
|
|
|
/** Number of last test that was done or skipped. */
|
|
|
|
int last;
|
|
|
|
|
|
|
|
/** Number of tests that failed. */
|
|
|
|
int failed;
|
|
|
|
|
|
|
|
/** Todo reason. */
|
|
|
|
char todo[128];
|
|
|
|
} TEST_DATA;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
This patch is a collection of patches from from Sanja, Sergei and Monty.
Added logging and pinning of pages to block format.
Integration of transaction manager, log handler.
Better page cache intergration
Split trnman.h into two files, so that we don't have to include my_atomic.h into C++ programs.
Renaming of structures, more comments, more debugging etc.
Fixed problem with small head block + long varchar.
Added extra argument to delete_record() and update_record() (needed for UNDO logging)
Small changes to interface of pagecache and log handler.
Change initialization of log_record_type_descriptors to not be depending on enum order.
Use array of LEX_STRING's to send data to log handler
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
include/lf.h:
Interface fixes
Rename of structures
(Patch from Sergei via Sanja)
include/my_atomic.h:
More comments
include/my_global.h:
Added MY_ERRPTR
include/pagecache.h:
Added undo LSN when unlocking pages
mysql-test/r/maria.result:
Updated results
mysql-test/t/maria.test:
Added autocommit around lock tables
(Patch from Sanja)
mysys/lf_alloc-pin.c:
Post-review fixes, simple optimizations
More comments
Struct slot renames
Check amount of memory on stack
(Patch from Sergei)
mysys/lf_dynarray.c:
More comments
mysys/lf_hash.c:
More comments
After review fixes
(Patch from Sergei)
storage/maria/ha_maria.cc:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
Move out all deferencing of the transaction structure.
Transaction manager integrated (Patch from Sergei)
storage/maria/ha_maria.h:
Added prototype for start_stmt()
storage/maria/lockman.c:
Function call rename
storage/maria/ma_bitmap.c:
Mark deleted pages free from page cache
storage/maria/ma_blockrec.c:
Offset -> rownr
More debugging
Fixed problem with small head block + long varchar
Added logging of changed pages
Added logging of undo (Including only loggging of changed fields in case of update)
Added pinning/unpinning of all changed pages
More comments
Added free_full_pages() as the same code was used in several places.
fill_rows_parts() renamed as fill_insert_undo_parts()
offset -> rownr
Added some optimization of not transactional tables
_ma_update_block_record() has new parameter, as we need original row to do efficent undo for update
storage/maria/ma_blockrec.h:
Added ROW_EXTENTS_ON_STACK
Changed prototype for update and delete of row
storage/maria/ma_check.c:
Added original row to delete_record() call
storage/maria/ma_control_file.h:
Added ifdefs for C++
storage/maria/ma_delete.c:
Added original row to delete_record() call
(Needed for efficent undo logging)
storage/maria/ma_dynrec.c:
Added extra argument to delete_record() and update_record()
Removed not used variable
storage/maria/ma_init.c:
Initialize log handler
storage/maria/ma_loghandler.c:
Removed not used variable
Change initialization of log_record_type_descriptors to not be depending on enum order
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_loghandler.h:
New defines
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_open.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
storage/maria/ma_pagecache.c:
Don't decrease number of readers when using pagecache_write()/pagecache_read()
In pagecache_write() decrement request count if page was left pinned
Added pagecache_delete_pages()
Removed some casts
Make trace output consistent with rest of code
Simplify calling of DBUG_ASSERT(0)
Only update LSN if the LSN is bigger than what's already on the page
Added LSN parameter pagecache_unpin_page(), pagecache_unpin(), and pagecache_unlock()
(Part of patch from Sanja)
storage/maria/ma_static.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Added default page cache
storage/maria/ma_statrec.c:
Added extra argument to delete_record() and update_record()
storage/maria/ma_test1.c:
Added option -T for transactions
storage/maria/ma_test2.c:
Added option -T for transactions
storage/maria/ma_test_all.sh:
Test with transactions
storage/maria/ma_update.c:
Changed prototype for update of row
storage/maria/maria_def.h:
Changed prototype for update & delete of row as block records need to access the old row
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
Added MARIA_MAX_TREE_LEVELS to allow us to calculate the number of possible pinned pages we may need.
Removed not used 'empty_bits_buffer'
Added pointer to transaction object
Added array for pinned pages
Added log_row_parts array for logging of field data.
Added MARIA_PINNED_PAGE to store pinned pages
storage/maria/trnman.c:
Added accessor functions to transaction object
Added missing DBUG_RETURN()
More debugging
More comments
Changed // comment of code to #ifdef NOT_USED
Transaction manager integrated.
Post review fixes
Part of patch originally from Sergei
storage/maria/trnman.h:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
storage/maria/unittest/ma_pagecache_single.c:
Added missing argument
Added SKIP_BIG_TESTS
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/trnman-t.c:
Stack overflow detection
(Patch from Sergei)
unittest/unit.pl:
Command-line options --big and --verbose
(Patch from Sergei)
unittest/mytap/tap.c:
Detect --big
(Patch from Sergei)
unittest/mytap/tap.h:
Skip_big_tests and SKIP_BIG_TESTS
(Patch from Sergei)
storage/maria/trnman_public.h:
New BitKeeper file ``storage/maria/trnman_public.h''
2007-05-29 19:13:56 +02:00
|
|
|
/**
|
|
|
|
Defines whether "big" tests should be skipped.
|
|
|
|
|
|
|
|
This variable is set by plan() function unless MYTAP_CONFIG environment
|
|
|
|
variable is set to the string "big". It is supposed to be used as
|
|
|
|
|
|
|
|
@code
|
|
|
|
if (skip_big_tests) {
|
|
|
|
skip(1, "Big test skipped");
|
|
|
|
} else {
|
|
|
|
ok(life_universe_and_everything() == 42, "The answer is CORRECT");
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see SKIP_BIG_TESTS
|
|
|
|
*/
|
|
|
|
extern int skip_big_tests;
|
|
|
|
|
2006-10-20 21:50:08 +02:00
|
|
|
/**
|
|
|
|
@defgroup MyTAP_API MyTAP API
|
|
|
|
|
|
|
|
MySQL support for performing unit tests according to TAP.
|
|
|
|
|
|
|
|
@{
|
|
|
|
*/
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
/**
|
|
|
|
Set number of tests that is planned to execute.
|
|
|
|
|
2010-06-10 13:15:35 +02:00
|
|
|
The function also accepts the predefined constant <code>NO_PLAN</code>.
|
|
|
|
If invoked with this constant -- or not invoked at all --
|
|
|
|
the test plan will be printed after all the test lines.
|
2006-04-04 18:16:15 +02:00
|
|
|
|
2006-08-25 13:53:16 +02:00
|
|
|
The plan() function will install signal handlers for all signals
|
|
|
|
that generate a core, so if you want to override these signals, do
|
|
|
|
it <em>after</em> you have called the plan() function.
|
|
|
|
|
This patch is a collection of patches from from Sanja, Sergei and Monty.
Added logging and pinning of pages to block format.
Integration of transaction manager, log handler.
Better page cache intergration
Split trnman.h into two files, so that we don't have to include my_atomic.h into C++ programs.
Renaming of structures, more comments, more debugging etc.
Fixed problem with small head block + long varchar.
Added extra argument to delete_record() and update_record() (needed for UNDO logging)
Small changes to interface of pagecache and log handler.
Change initialization of log_record_type_descriptors to not be depending on enum order.
Use array of LEX_STRING's to send data to log handler
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
include/lf.h:
Interface fixes
Rename of structures
(Patch from Sergei via Sanja)
include/my_atomic.h:
More comments
include/my_global.h:
Added MY_ERRPTR
include/pagecache.h:
Added undo LSN when unlocking pages
mysql-test/r/maria.result:
Updated results
mysql-test/t/maria.test:
Added autocommit around lock tables
(Patch from Sanja)
mysys/lf_alloc-pin.c:
Post-review fixes, simple optimizations
More comments
Struct slot renames
Check amount of memory on stack
(Patch from Sergei)
mysys/lf_dynarray.c:
More comments
mysys/lf_hash.c:
More comments
After review fixes
(Patch from Sergei)
storage/maria/ha_maria.cc:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
Move out all deferencing of the transaction structure.
Transaction manager integrated (Patch from Sergei)
storage/maria/ha_maria.h:
Added prototype for start_stmt()
storage/maria/lockman.c:
Function call rename
storage/maria/ma_bitmap.c:
Mark deleted pages free from page cache
storage/maria/ma_blockrec.c:
Offset -> rownr
More debugging
Fixed problem with small head block + long varchar
Added logging of changed pages
Added logging of undo (Including only loggging of changed fields in case of update)
Added pinning/unpinning of all changed pages
More comments
Added free_full_pages() as the same code was used in several places.
fill_rows_parts() renamed as fill_insert_undo_parts()
offset -> rownr
Added some optimization of not transactional tables
_ma_update_block_record() has new parameter, as we need original row to do efficent undo for update
storage/maria/ma_blockrec.h:
Added ROW_EXTENTS_ON_STACK
Changed prototype for update and delete of row
storage/maria/ma_check.c:
Added original row to delete_record() call
storage/maria/ma_control_file.h:
Added ifdefs for C++
storage/maria/ma_delete.c:
Added original row to delete_record() call
(Needed for efficent undo logging)
storage/maria/ma_dynrec.c:
Added extra argument to delete_record() and update_record()
Removed not used variable
storage/maria/ma_init.c:
Initialize log handler
storage/maria/ma_loghandler.c:
Removed not used variable
Change initialization of log_record_type_descriptors to not be depending on enum order
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_loghandler.h:
New defines
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_open.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
storage/maria/ma_pagecache.c:
Don't decrease number of readers when using pagecache_write()/pagecache_read()
In pagecache_write() decrement request count if page was left pinned
Added pagecache_delete_pages()
Removed some casts
Make trace output consistent with rest of code
Simplify calling of DBUG_ASSERT(0)
Only update LSN if the LSN is bigger than what's already on the page
Added LSN parameter pagecache_unpin_page(), pagecache_unpin(), and pagecache_unlock()
(Part of patch from Sanja)
storage/maria/ma_static.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Added default page cache
storage/maria/ma_statrec.c:
Added extra argument to delete_record() and update_record()
storage/maria/ma_test1.c:
Added option -T for transactions
storage/maria/ma_test2.c:
Added option -T for transactions
storage/maria/ma_test_all.sh:
Test with transactions
storage/maria/ma_update.c:
Changed prototype for update of row
storage/maria/maria_def.h:
Changed prototype for update & delete of row as block records need to access the old row
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
Added MARIA_MAX_TREE_LEVELS to allow us to calculate the number of possible pinned pages we may need.
Removed not used 'empty_bits_buffer'
Added pointer to transaction object
Added array for pinned pages
Added log_row_parts array for logging of field data.
Added MARIA_PINNED_PAGE to store pinned pages
storage/maria/trnman.c:
Added accessor functions to transaction object
Added missing DBUG_RETURN()
More debugging
More comments
Changed // comment of code to #ifdef NOT_USED
Transaction manager integrated.
Post review fixes
Part of patch originally from Sergei
storage/maria/trnman.h:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
storage/maria/unittest/ma_pagecache_single.c:
Added missing argument
Added SKIP_BIG_TESTS
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/trnman-t.c:
Stack overflow detection
(Patch from Sergei)
unittest/unit.pl:
Command-line options --big and --verbose
(Patch from Sergei)
unittest/mytap/tap.c:
Detect --big
(Patch from Sergei)
unittest/mytap/tap.h:
Skip_big_tests and SKIP_BIG_TESTS
(Patch from Sergei)
storage/maria/trnman_public.h:
New BitKeeper file ``storage/maria/trnman_public.h''
2007-05-29 19:13:56 +02:00
|
|
|
It will also set skip_big_tests variable if MYTAP_CONFIG environment
|
|
|
|
variable is defined.
|
|
|
|
|
|
|
|
@see skip_big_tests
|
|
|
|
|
|
|
|
@param count The planned number of tests to run.
|
2006-04-04 18:16:15 +02:00
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2010-08-11 12:55:54 +02:00
|
|
|
void plan(int count);
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Report test result as a TAP line.
|
|
|
|
|
|
|
|
Function used to write status of an individual test. Call this
|
|
|
|
function in the following manner:
|
|
|
|
|
|
|
|
@code
|
|
|
|
ok(ducks == paddling,
|
|
|
|
"%d ducks did not paddle", ducks - paddling);
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@param pass Zero if the test failed, non-zero if it passed.
|
2010-10-20 15:40:04 +02:00
|
|
|
@param fmt Format string in printf() format. NULL is not allowed,
|
|
|
|
use ok1() in this case.
|
2006-04-04 18:16:15 +02:00
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2010-08-11 12:55:54 +02:00
|
|
|
void ok(int pass, char const *fmt, ...)
|
2006-04-12 21:14:32 +02:00
|
|
|
__attribute__((format(printf,2,3)));
|
2006-04-04 18:16:15 +02:00
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2010-10-20 15:40:04 +02:00
|
|
|
/**
|
|
|
|
Report test result as a TAP line.
|
|
|
|
|
|
|
|
Same as ok() but does not take a message to be printed.
|
|
|
|
|
|
|
|
@param pass Zero if the test failed, non-zero if it passed.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void ok1(int const pass);
|
|
|
|
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
/**
|
|
|
|
Skip a determined number of tests.
|
|
|
|
|
2006-10-20 21:50:08 +02:00
|
|
|
Function to print that <em>how_many</em> tests have been skipped.
|
|
|
|
The reason is printed for each skipped test. Observe that this
|
|
|
|
function does not do the actual skipping for you, it just prints
|
|
|
|
information that tests have been skipped. This function is not
|
|
|
|
usually used, but rather the macro @c SKIP_BLOCK_IF, which does the
|
|
|
|
skipping for you.
|
|
|
|
|
|
|
|
It shall be used in the following manner:
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
@code
|
|
|
|
if (ducks == 0) {
|
|
|
|
skip(2, "No ducks in the pond");
|
|
|
|
} else {
|
|
|
|
int i;
|
|
|
|
for (i = 0 ; i < 2 ; ++i)
|
|
|
|
ok(duck[i] == paddling, "is duck %d paddling?", i);
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see SKIP_BLOCK_IF
|
|
|
|
|
|
|
|
@param how_many Number of tests that are to be skipped.
|
|
|
|
@param reason A reason for skipping the tests
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
void skip(int how_many, char const *reason, ...)
|
2006-04-12 21:14:32 +02:00
|
|
|
__attribute__((format(printf,2,3)));
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Helper macro to skip a block of code. The macro can be used to
|
|
|
|
simplify conditionally skipping a block of code. It is used in the
|
|
|
|
following manner:
|
|
|
|
|
|
|
|
@code
|
|
|
|
SKIP_BLOCK_IF(ducks == 0, 2, "No ducks in the pond")
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
for (i = 0 ; i < 2 ; ++i)
|
|
|
|
ok(duck[i] == paddling, "is duck %d paddling?", i);
|
|
|
|
}
|
2006-08-25 13:53:16 +02:00
|
|
|
@endcode
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
@see skip
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
#define SKIP_BLOCK_IF(SKIP_IF_TRUE, COUNT, REASON) \
|
|
|
|
if (SKIP_IF_TRUE) skip((COUNT),(REASON)); else
|
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
|
This patch is a collection of patches from from Sanja, Sergei and Monty.
Added logging and pinning of pages to block format.
Integration of transaction manager, log handler.
Better page cache intergration
Split trnman.h into two files, so that we don't have to include my_atomic.h into C++ programs.
Renaming of structures, more comments, more debugging etc.
Fixed problem with small head block + long varchar.
Added extra argument to delete_record() and update_record() (needed for UNDO logging)
Small changes to interface of pagecache and log handler.
Change initialization of log_record_type_descriptors to not be depending on enum order.
Use array of LEX_STRING's to send data to log handler
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
include/lf.h:
Interface fixes
Rename of structures
(Patch from Sergei via Sanja)
include/my_atomic.h:
More comments
include/my_global.h:
Added MY_ERRPTR
include/pagecache.h:
Added undo LSN when unlocking pages
mysql-test/r/maria.result:
Updated results
mysql-test/t/maria.test:
Added autocommit around lock tables
(Patch from Sanja)
mysys/lf_alloc-pin.c:
Post-review fixes, simple optimizations
More comments
Struct slot renames
Check amount of memory on stack
(Patch from Sergei)
mysys/lf_dynarray.c:
More comments
mysys/lf_hash.c:
More comments
After review fixes
(Patch from Sergei)
storage/maria/ha_maria.cc:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
Move out all deferencing of the transaction structure.
Transaction manager integrated (Patch from Sergei)
storage/maria/ha_maria.h:
Added prototype for start_stmt()
storage/maria/lockman.c:
Function call rename
storage/maria/ma_bitmap.c:
Mark deleted pages free from page cache
storage/maria/ma_blockrec.c:
Offset -> rownr
More debugging
Fixed problem with small head block + long varchar
Added logging of changed pages
Added logging of undo (Including only loggging of changed fields in case of update)
Added pinning/unpinning of all changed pages
More comments
Added free_full_pages() as the same code was used in several places.
fill_rows_parts() renamed as fill_insert_undo_parts()
offset -> rownr
Added some optimization of not transactional tables
_ma_update_block_record() has new parameter, as we need original row to do efficent undo for update
storage/maria/ma_blockrec.h:
Added ROW_EXTENTS_ON_STACK
Changed prototype for update and delete of row
storage/maria/ma_check.c:
Added original row to delete_record() call
storage/maria/ma_control_file.h:
Added ifdefs for C++
storage/maria/ma_delete.c:
Added original row to delete_record() call
(Needed for efficent undo logging)
storage/maria/ma_dynrec.c:
Added extra argument to delete_record() and update_record()
Removed not used variable
storage/maria/ma_init.c:
Initialize log handler
storage/maria/ma_loghandler.c:
Removed not used variable
Change initialization of log_record_type_descriptors to not be depending on enum order
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_loghandler.h:
New defines
Use array of LEX_STRING's to send data to log handler
storage/maria/ma_open.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
storage/maria/ma_pagecache.c:
Don't decrease number of readers when using pagecache_write()/pagecache_read()
In pagecache_write() decrement request count if page was left pinned
Added pagecache_delete_pages()
Removed some casts
Make trace output consistent with rest of code
Simplify calling of DBUG_ASSERT(0)
Only update LSN if the LSN is bigger than what's already on the page
Added LSN parameter pagecache_unpin_page(), pagecache_unpin(), and pagecache_unlock()
(Part of patch from Sanja)
storage/maria/ma_static.c:
Added 'dummy' transaction option to MARIA_INFO so that we can always assume 'trn' exists.
Added default page cache
storage/maria/ma_statrec.c:
Added extra argument to delete_record() and update_record()
storage/maria/ma_test1.c:
Added option -T for transactions
storage/maria/ma_test2.c:
Added option -T for transactions
storage/maria/ma_test_all.sh:
Test with transactions
storage/maria/ma_update.c:
Changed prototype for update of row
storage/maria/maria_def.h:
Changed prototype for update & delete of row as block records need to access the old row
Store in MARIA_SHARE->page_type if pages will have up to date LSN's
Added MARIA_MAX_TREE_LEVELS to allow us to calculate the number of possible pinned pages we may need.
Removed not used 'empty_bits_buffer'
Added pointer to transaction object
Added array for pinned pages
Added log_row_parts array for logging of field data.
Added MARIA_PINNED_PAGE to store pinned pages
storage/maria/trnman.c:
Added accessor functions to transaction object
Added missing DBUG_RETURN()
More debugging
More comments
Changed // comment of code to #ifdef NOT_USED
Transaction manager integrated.
Post review fixes
Part of patch originally from Sergei
storage/maria/trnman.h:
Split trnman.h into two files, so that we don't have to include my_atomic.h into the .cc program.
(Temporary fix to avoid bug in gcc)
storage/maria/unittest/ma_pagecache_single.c:
Added missing argument
Added SKIP_BIG_TESTS
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
Test logging with new LEX_STRING parameter
(Patch from Sanja)
storage/maria/unittest/trnman-t.c:
Stack overflow detection
(Patch from Sergei)
unittest/unit.pl:
Command-line options --big and --verbose
(Patch from Sergei)
unittest/mytap/tap.c:
Detect --big
(Patch from Sergei)
unittest/mytap/tap.h:
Skip_big_tests and SKIP_BIG_TESTS
(Patch from Sergei)
storage/maria/trnman_public.h:
New BitKeeper file ``storage/maria/trnman_public.h''
2007-05-29 19:13:56 +02:00
|
|
|
/**
|
|
|
|
Helper macro to skip a group of "big" tests. It is used in the following
|
|
|
|
manner:
|
|
|
|
|
|
|
|
@code
|
|
|
|
SKIP_BIG_TESTS(1)
|
|
|
|
{
|
|
|
|
ok(life_universe_and_everything() == 42, "The answer is CORRECT");
|
|
|
|
}
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see skip_big_tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define SKIP_BIG_TESTS(COUNT) \
|
|
|
|
if (skip_big_tests) skip((COUNT), "big test"); else
|
|
|
|
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
/**
|
|
|
|
Print a diagnostics message.
|
|
|
|
|
|
|
|
@param fmt Diagnostics message in printf() format.
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
void diag(char const *fmt, ...)
|
2006-04-12 21:14:32 +02:00
|
|
|
__attribute__((format(printf,1,2)));
|
2006-04-04 18:16:15 +02:00
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-08-25 13:53:16 +02:00
|
|
|
/**
|
|
|
|
Print a bail out message.
|
|
|
|
|
|
|
|
A bail out message can be issued when no further testing can be
|
|
|
|
done, e.g., when there are missing dependencies.
|
|
|
|
|
|
|
|
The test will exit with status 255. This function does not return.
|
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
@code
|
|
|
|
BAIL_OUT("Lost connection to server %s", server_name);
|
|
|
|
@endcode
|
|
|
|
|
2006-08-25 13:53:16 +02:00
|
|
|
@note A bail out message is printed if a signal that generates a
|
|
|
|
core is raised.
|
|
|
|
|
|
|
|
@param fmt Bail out message in printf() format.
|
|
|
|
*/
|
|
|
|
|
|
|
|
void BAIL_OUT(char const *fmt, ...)
|
|
|
|
__attribute__((noreturn, format(printf,1,2)));
|
|
|
|
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
/**
|
|
|
|
Print summary report and return exit status.
|
|
|
|
|
|
|
|
This function will print a summary report of how many tests passed,
|
|
|
|
how many were skipped, and how many remains to do. The function
|
|
|
|
should be called after all tests are executed in the following
|
|
|
|
manner:
|
|
|
|
|
|
|
|
@code
|
|
|
|
return exit_status();
|
|
|
|
@endcode
|
|
|
|
|
2006-10-20 21:50:08 +02:00
|
|
|
@returns @c EXIT_SUCCESS if all tests passed, @c EXIT_FAILURE if
|
|
|
|
one or more tests failed.
|
2006-04-04 18:16:15 +02:00
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
int exit_status(void);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Skip entire test suite.
|
|
|
|
|
|
|
|
To skip the entire test suite, use this function. It will
|
|
|
|
automatically call exit(), so there is no need to have checks
|
|
|
|
around it.
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
void skip_all(char const *reason, ...)
|
2006-04-12 21:14:32 +02:00
|
|
|
__attribute__((noreturn, format(printf, 1, 2)));
|
2006-04-04 18:16:15 +02:00
|
|
|
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
/**
|
|
|
|
Start section of tests that are not yet ready.
|
|
|
|
|
|
|
|
To start a section of tests that are not ready and are expected to
|
|
|
|
fail, use this function and todo_end() in the following manner:
|
|
|
|
|
|
|
|
@code
|
|
|
|
todo_start("Not ready yet");
|
|
|
|
ok(is_rocketeering(duck), "Rocket-propelled ducks");
|
|
|
|
ok(is_kamikaze(duck), "Kamikaze ducks");
|
|
|
|
todo_end();
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
@see todo_end
|
|
|
|
|
|
|
|
@note
|
|
|
|
It is not possible to nest todo sections.
|
|
|
|
|
|
|
|
@param message Message that will be printed before the todo tests.
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
void todo_start(char const *message, ...)
|
2006-08-29 22:23:56 +02:00
|
|
|
__attribute__((format(printf, 1, 2)));
|
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
End a section of tests that are not yet ready.
|
|
|
|
*/
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
void todo_end();
|
|
|
|
|
2006-10-20 21:50:08 +02:00
|
|
|
/** @} */
|
2006-08-29 22:23:56 +02:00
|
|
|
|
2006-04-04 18:16:15 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* TAP_H */
|