changing pseudocode to use the structures of the Maria pagecache
("pagecache->changed_blocks" etc) and other Maria structures
inherited from MyISAM (THR_LOCK_maria etc).
mysys/mf_pagecache.c:
comment
storage/maria/ma_checkpoint.c:
changing pseudocode to use the structures of the Maria pagecache
("pagecache->changed_blocks" etc) and other Maria structures
inherited from MyISAM (THR_LOCK_maria etc).
storage/maria/ma_checkpoint.h:
copyright
storage/maria/ma_control_file.c:
copyright
storage/maria/ma_control_file.h:
copyright
storage/maria/ma_least_recently_dirtied.c:
copyright
storage/maria/ma_least_recently_dirtied.h:
copyright
storage/maria/ma_recovery.c:
copyright
storage/maria/ma_recovery.h:
copyright
storage/maria/unittest/Makefile.am:
copyright
Fitting ma_control_file_test into the mytap unittest framework:
new directories:
- unittest/storage/ for unit tests of any storage engine
- unittest/storage/maria for ... Maria, containing ma_control_file-t.
Later, older tests like ma_test*, ma_test_all (but which is Unix
dependent in its current form) could move here too.
The plugins macro enable building of unittest/storage/X for any
enabled engine X which has such a directory.
If Falcon wants to have unit tests there too, I may have to merge
this patch into 5.x one day.
config/ac-macros/plugins.m4:
If a storage engine has a directory in unittest/storage, build this
directory.
configure.in:
build storage engines' unit tests.
storage/maria/Makefile.am:
ma_control_file_test moves to unittest/storage/maria
storage/maria/ma_control_file.c:
more error codes when opening the control file fails.
ma_control_file_end() may now return an error if my_close() failed.
storage/maria/ma_control_file.h:
more error codes when opening the control file fails.
unittest/Makefile.am:
adding unit tests for storage engines.
Note that unit.pl simply recurses into "storage", so if a unit test for
storage engine X has been built previously, and now you re-configure
(without making clean) to disable this engine, then the unit test of
X will not be rebuilt but will still be present in storage/X, so will
be run.
unittest/storage/maria/ma_control_file-t.c:
Making the test fit the mytap framework (return all the way up
the stack instead of assert(); use the mytap functions plan(), ok() etc).
Adding test of file too short/long.
unittest/storage/maria/Makefile.am:
a_control_file-t is added to the Maria unit tests.
Later, older tests (ma_test1 etc) could also move here.
unittest/storage/Makefile.am:
New BitKeeper file ``unittest/storage/Makefile.am''
added checksum of the file. Now we have size + magic string + checksum
to detect that all is ok.
Plus misc fixes for "make dist" to work and the resulting tarball to build
include/Makefile.am:
adding pagecache.h to help the tarball build.
The model of pagecache.h, keycache.h, is in pkginclude_HEADERS,
wonder why. Adding pagecache.h to noinst_HEADERS for now.
storage/maria/Makefile.am:
adding ma_control_file.h to help the tarball build
storage/maria/ma_control_file.c:
adding a simple checksum to the control file.
We protect against corruption of this file like this:
- test size
- test magic string at start
- test checksum
I also add some simple my_message() errors (to be changed to a better
reporting later).
storage/maria/ma_control_file.h:
comments
storage/maria/ma_control_file_test.c:
test of wrong checksum in control file
storage/maria/CMakeLists.txt:
just to make "make dist" happy for now.
- fixes to the control file module
- unit test for it
- renames of all Maria files I created to start with ma_
storage/maria/ma_checkpoint.c:
Rename: storage/maria/checkpoint.c -> storage/maria/ma_checkpoint.c
storage/maria/ma_checkpoint.h:
Rename: storage/maria/checkpoint.h -> storage/maria/ma_checkpoint.h
storage/maria/ma_least_recently_dirtied.c:
Rename: storage/maria/least_recently_dirtied.c -> storage/maria/ma_least_recently_dirtied.c
storage/maria/ma_least_recently_dirtied.h:
Rename: storage/maria/least_recently_dirtied.h -> storage/maria/ma_least_recently_dirtied.h
storage/maria/ma_recovery.c:
Rename: storage/maria/recovery.c -> storage/maria/ma_recovery.c
storage/maria/ma_recovery.h:
Rename: storage/maria/recovery.h -> storage/maria/ma_recovery.h
storage/maria/Makefile.am:
control file module and its unit test program
storage/maria/ma_control_file.c:
DBUG_ tags. Fix for gcc warnings.
log_no -> logno (I felt "_no" sounded like a standalone "No" word).
ma_ prefix for some functions.
last_checkpoint_lsn_at_startup -> last_checkpoint_lsn (no need
to make special vars for the values at startup). Same for last_logno.
ma_control_file_write_and_force() now updates last_checkpoint_lsn
and last_logno, the idea being that they belong to the module,
others should not update them.
And thus when the module shuts down, it zeroes those vars.
storage/maria/ma_control_file.h:
importing structs from Sanja to get the control file module to compile;
we'll remove that when Sanja pushes the log handler.
CONTROL_FILE_IMPOSSIBLE_LOGNO is 0, not FFFFFFFF.
storage/maria/ma_control_file_test.c:
Unit test program for the Maria control file module.
Modelled after other ma_test* files in this directory (so, does
not follow the unit test framework recently introduced with libtap;
TODO as a task on all ma_test* programs).
We test that writing to the control file works, and re-reading from it
too, we check (by reading the file by ourselves) that its content
on disk is correct, and check that a corrupted control file is detected.