Commit graph

3255 commits

Author SHA1 Message Date
unknown
3ad087366e Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into  gbichot4.local:/home/mysql_src/mysql-maria-clean
2008-04-16 16:32:25 +02:00
unknown
75c8e2f4be Fix for ma_test_all-t failure and dbug/tests-t failure on Solaris:
on that machine, "perl" calls /usr/local/bin/perl (so this is what
runs unittest's unit.pl), while some test scripts (ma_test_recovery.pl
etc) use /usr/bin/perl which seems to either conflict with /usr/local/bin/perl
or have problems of its own (Perl errors when loading modules).
Instead we use perl from the PATH. /usr/bin/env seems to be available
on lots of Unix machines.


dbug/tests-t.pl:
  look for perl in PATH
storage/maria/unittest/ma_test_all-t:
  Look for perl in PATH
storage/maria/unittest/ma_test_recovery.pl:
  Look for perl in PATH. Close MY_LOG to flush buffers to that diff sees
  the whole file
2008-04-16 16:31:38 +02:00
unknown
e5b4c350b7 possible BUG#22320 removed because it does not help. 2008-04-15 22:42:50 +03:00
unknown
130fb4ddd9 Bug#22320 workaround (second attempt) 2008-04-15 17:41:48 +03:00
unknown
d12c8374bc BUG#22320 work around 2008-04-14 17:33:43 +03:00
unknown
28131daa26 Fix for BUG#35351 "Maria: R-tree index does not return all expected rows"
BitKeeper/triggers/post-commit:
  commits to Maria public list
mysql-test/r/maria-gis-rtree.result:
  result is good now, similar to MyISAM's (gis-rtree.result)
storage/maria/ma_rt_index.c:
  R-tree key-reading code used info->buff as a cache for the next key read,
  but between key read and next key read, there is record read, which
  uses info->buff too. In detail, during a SELECT:
  First key read: maria_rfirst() is called, which calls maria_rtree_find_first() which calls 
  maria_rtree_find_req() which comes here
          if (after_key < last)
          {
            // ! the list of keys is copied to info->buff
            // and info->buff is remembered in info->int_keypos
            info->int_keypos= info->buff;
            info->int_maxpos= info->buff + (last - after_key);
            memcpy(info->buff, after_key, last - after_key);
            info->keyread_buff_used= 0;
          }
  Then record read:
  _ma_read_block_record() (as well as some other functions of
  ma_blockrec.c) overwrites info->buff:
    if (!(buff= pagecache_read(share->pagecache,
                               &info->dfile, ma_recordpos_to_page(record_pos), 0,
                               info->buff, share->page_type,
                               PAGECACHE_LOCK_LEFT_UNLOCKED, 0)))
  So, this has the effect that the keys saved by maria_rtree_find_req() are now lost:
  info->int_keypos now contains a copy of a data page!
  Then maria_rnext_same() runs (to find second row), calls maria_rtree_find_next() which
  does:
    if (!info->keyread_buff_used)
    {
      uchar *key= info->int_keypos;
      while (key < info->int_maxpos)
      {
        if (!maria_rtree_key_cmp(keyinfo->seg,
                                 info->first_mbr_key, key,
                                 info->last_rkey_length, search_flag))
  
  i.e. maria_rtree_key_cmp() is doing comparisons on values it reads from the data page.
  Naturally this is bad and no row is found.
  Origin of the bug: MARIA_HA::keyread_buff is new in Maria.
  Solution: use keyread_buff instead of buff (like _ma_search_next() does),
  in R-tree code. Note that ma_blockrec.c functions also use keyread_buff
  but they all are write-functions, which should not be running close
  to next-key-read. Also note that some ma_rt_index.c functions still
  use info->buff, but they are about writes too.
  Thanks Monty for the idea.
2008-04-11 11:53:21 +02:00
unknown
b765997467 WL#3072 - Maria recovery
When applying a REDO_INDEX_[FREE|NEW]_PAGE, update state members only
if record is newer than current state.
Print a warning when an old Maria is zero-ing out portions of the
control file which it does not know.


storage/maria/ma_control_file.c:
  Print a warning when an old Maria is zero-ing out portions of the
  control file which it does not know; it may help us when helping
  troubleshoot customers' and users' problems.
storage/maria/ma_key_recover.c:
  When applying a REDO_INDEX_[FREE|NEW]_PAGE, we should update the state
  members (key_root, key_del) only if this REDO is newer than the current
  state. We cannot just update it unconditionally, because that may
  change it to an old state, which may not be later corrected if all later
  REDOs are entirely skipped due to their page not being in the dirty pages
  list of the checkpoint record.
2008-04-08 15:27:39 +02:00
unknown
2d327efd89 Fixing the little bug that if a new version reads an old control file,
it couldn't entirely write its new information (it could not write
more bytes than the old format wrote).


storage/maria/ma_control_file.c:
  Let ma_control_file_write_and_force() return error if called when
  file is not open.
  When the file was of an old version (no room for our changeable part)
  we upgrade this part. When the file was of a new version we re-use its
  format but zero the parts which we can't maintain.
storage/maria/ma_init.c:
  ma_control_file_write_and_force() now does not assert if called
  when control file is not open.
storage/maria/ma_recovery.c:
  missing ";" (thanks Peter Zaitsev for the bug report and Monty for the patch)
2008-04-07 18:59:20 +02:00
unknown
722a8ebe5b Store maximum transaction id into control file at clean shutdown.
This can serve to maria_chk to check that trids found in rows and keys
are not too big. Also used by Recovery when logs are lost.
Options --require-control-file, --datadir, --log-dir (yes, the dashes are
inconsistent but I imitated mysqld --datadir and --maria-log-dir) for
maria_chk.
Lock control file _before_ reading its content.


storage/maria/ha_maria.cc:
  new prototype
storage/maria/ma_check.c:
  A function to find the max trid in the system (consults transaction
  manager and control file), to check tables.
storage/maria/ma_checkpoint.c:
  new prototype
storage/maria/ma_control_file.c:
  Store max trid into control file, in a backward-compatible way
  (can still read old control files).
  Parameter to ma_control_file_open(), to not create the log if it's
  missing (maria_chk needs that).
  Lock control file _before_ reading its content.
  Fix for a segfault when reading an old control file (bzero() with a
  negative second argument)
storage/maria/ma_control_file.h:
  changes to the control file module's API
storage/maria/ma_init.c:
  When Maria shuts down cleanly, store max trid into control file.
storage/maria/ma_loghandler.c:
  new prototype
storage/maria/ma_recovery.c:
  During recovery, consult max trid stored in control file, in case it is
  bigger than what we found in log (case of logs manually removed by user).
storage/maria/ma_test1.c:
  new prototype
storage/maria/ma_test2.c:
  new prototype
storage/maria/maria_chk.c:
  New option --require-control-file (abort if control file not found),
  --datadir (path for control file (and for logs if --log-dir not specified)),
  --log-dir (path for logs).
  Try to open control file when maria_chk starts.
storage/maria/maria_read_log.c:
  new prototype
storage/maria/trnman.c:
  A new function to know max trid in transaction manager
storage/maria/trnman_public.h:
  New function
storage/maria/unittest/ma_control_file-t.c:
  new prototypes. Testing storing and retrieving the max trid to/from
  control file
storage/maria/unittest/ma_test_loghandler-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  new prototype
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  new prototype
2008-04-04 19:10:53 +02:00
unknown
f094eff1d9 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
unknown
3651e3285d Merge of changes in MyISAM since December 16 -> April 1
Fixes bugs:
Bug#28837  MyISAM storage engine error (134) doing delete with self-join
Bug#31277  myisamchk --unpack corrupts table
Bug#4692   DISABLE/ENABLE KEYS waste a space
Bug#31305  myisam tables crash when they are near capacity


BitKeeper/etc/ignore:
  added unittest/tmp/*
mysql-test/r/maria.result:
  Moved missing tests from myisam.test to maria.test
mysql-test/t/maria.test:
  Moved missing tests from myisam.test to maria.test
storage/maria/ha_maria.cc:
  Merge of changes in MyISAM since December 16 -> April 1
  Fixes bug in self join (Bug#28837: MyISAM storage engine error (134) doing delete with self-join)
storage/maria/ha_maria.h:
  Merge of changes in MyISAM since December 16 -> April 1
storage/maria/ma_blockrec.c:
  Merge of changes in MyISAM since December 16 -> April 1
  Fixes bug in self join (Bug#28837: MyISAM storage engine error (134) doing delete with self-join)
  The problem is that we may be using a cached key page with old information. Versioning will fix this
storage/maria/ma_check.c:
  Merge of changes in MyISAM since December 16 -> April 1
  This fixes a problem with pack_reclength not beeing big enough (Bug #31277 myisamchk --unpack corrupts table)
  BUG#4692 - DISABLE/ENABLE KEYS waste a space
storage/maria/ma_delete.c:
  Indentation fixes
storage/maria/ma_dynrec.c:
  Merge of changes in MyISAM since December 16 -> April 1
  Fixes Bug#31305 myisam tables crash when they are near capacity.
  (This uses a simpler fix than in MyISAM by remembering the length of the current row)
storage/maria/ma_ft_boolean_search.c:
  Merge of all changes from myisam/ft_boolean_search.c (This file had not been kept up to date)
storage/maria/ma_open.c:
  Merge of changes in MyISAM since December 16 -> April 1
  Calculate default_rec_buff_size more exact to be sure it's always big enough
storage/maria/ma_packrec.c:
  Merge of changes in MyISAM since December 16 -> April 1
  Update default_rec_buff_size to be big enough to hold one packed row
  Related to Bug#31277 myisamchk --unpack corrupts table
storage/maria/ma_rnext_same.c:
  Indentation fixes
storage/maria/ma_rt_index.c:
  Merge of changes in MyISAM since December 16 -> April 1
storage/maria/ma_rt_mbr.c:
  Merge of changes in MyISAM since December 16 -> April 1
  (Added comment)
storage/maria/ma_search.c:
  Merge of changes in MyISAM since December 16 -> April 1
  (Added comment)
storage/maria/ma_sort.c:
  Merge of changes in MyISAM since December 16 -> April 1
storage/maria/ma_statrec.c:
  Indentation fixes
storage/maria/ma_test2.c:
  Indentation fixes
storage/maria/maria_chk.c:
  Indentation fixes
storage/maria/maria_pack.c:
  Merge of changes in MyISAM since December 16 -> April 1
2008-04-01 17:57:30 +03:00
unknown
c63e18f43c Fixed bug of non-unlocked rw-lock in case of
absence of opened files.
2008-03-24 01:38:57 +02:00
unknown
b8c56780b6 Fix for pushbuild problems: innocuous Valgrind error (uninitialized
bytes in unimportant, unused pieces of index pages) and test failure
because test requires Maria. Compiler warning.
About Valgrind error, two of the three bzero() added here are
needed to silence the error (the third is added for symmetry).


mysql-test/t/maria-gis-rtree.test:
  requires Maria
storage/maria/ma_loghandler.c:
  "uint64->uint16 possible loss of precision" on Windows
storage/maria/ma_rt_index.c:
  We bzero the entire new page, as is done in _ma_enlarge_root()
  for B-tree pages. This silences Valgrind warnings and allows
  better compression.
storage/maria/ma_rt_split.c:
  We bzero the entire new page, as is done in _ma_enlarge_root()
  for B-tree pages. This silences Valgrind warnings and allows
  better compression.
2008-03-21 22:29:05 +01:00
unknown
b29d8bd22f Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into  gbichot4.local:/home/mysql_src/mysql-maria-monty
2008-03-20 16:06:11 +01:00
unknown
2e22de68f3 Fix for BUG#35441 "Cannot change PAGE_CHECKSUM table option".
A big test was written and is committed, which found 3 bugs in total:
- ALTER TABLE PAGE_CHECKSUM=0 sometimes had no effect
- ALTER TABLE ENGINE=MARIA sometimes changed page checksumming in
the table
- SHOW CREATE TABLE and 'maria_chk -dv' disagreed on the presence
of page checksumming.
They are all fixed here. Side-effect is that SHOW CREATE TABLE now
always prints a PAGE_CHECKSUM clause for Maria tables.


mysql-test/mysql-test-run.pl:
  allow calling maria_chk and maria_pack in tests
mysql-test/r/maria.result:
  PAGE_CHECKSUM=0 is now always printed
mysql-test/t/create.test:
  PAGE_CHECKSUM= is now always present in SHOW CREATE TABLE of Maria tables
mysql-test/t/disabled.def:
  better bug number
sql/sql_table.cc:
  If ALTER TABLE PAGE_CHECKSUM=#, it affects the engine's data (structure
  of data pages) so a full table rebuild is needed. We already did
  so for ROW_FORMAT=#, following same logic. This fixes disagreements
  between SHOW CREATE TABLE and 'maria_chk -dv' regarding the
  presence of page checksums after certain ALTER TABLE (as seen
  with the attached testcase).
storage/maria/ha_maria.cc:
  In ALTER TABLE PAGE_CHECKSUM=0, ha_maria::update_create_info() started
  with create_info->page_checksum=HA_CHOICE_NO and wrongly set it
  to the table's original setting, which is HA_CHOICE_YES if the table
  had page checksums, in which case the ALTER left page checksum
  in the table.
  The fix for this bug is: only if create_info->page_checksum is
  undefined (no clause in the ALTER TABLE, or we are in SHOW CREATE TABLE)
  we may set HA_CHOICE_YES.
  The second bug in this file was that the code left HA_CHOICE_UNDEF if
  the table didn't have page checksums originally, leading ALTER TABLE
  ENGINE=MARIA to change the table's page checksum to the value of
  maria_page_checksum.
  This is fixed by setting create_info->page_checksum to HA_CHOICE_NO
  if UNDEF and table does not have page checksum.
  The side-effect of this last fix, because ha_maria::update_create_info()
  is also called by SHOW CREATE TABLE, is that:
  SET GLOBAL maria_page_checksum=0;
  CREATE TABLE t(a INT) ENGINE=MARIA;
  SHOW CREATE TABLE t;
  which used to not show a PAGE_CHECKSUM= clause, now shows PAGE_CHECKSUM=0.
  I consider this side-effect good:
  - clearer for users: it eliminates the differences between the
  above and this:
  SET GLOBAL maria_page_checksum=0;
  CREATE TABLE t(a INT) ENGINE=MARIA PAGE_CHECKSUM=0;
  SHOW CREATE TABLE t;
  which already showed PAGE_CHECKSUM=0; difference which is not easy
  to explain.
  - if using mysqldump to copy from one server to another, it eliminates
  the dependency on the value of maria_page_checksum being the same on
  original server and new server.
mysql-test/r/maria-page-checksum.result:
  Result. If you undo the code fixes and run the test, the new result
  file will show bugs at:
  error lineno 56 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 73 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 110 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 164 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 181 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 218 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 253 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 307 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 361 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 415 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 488 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 505 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 542 : expected PAGE_CHECKSUM=1, got Page checksums are not used
  error lineno 577 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  error lineno 631 : expected PAGE_CHECKSUM=0, got ) ENGINE=MARIA DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  (lineno is line number in the result file)
mysql-test/t/maria-page-checksum.test:
  Test for the 3 bugs
2008-03-20 16:05:23 +01:00
unknown
60af50f6d7 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/tmp/work-maria-bug35036
2008-03-19 00:09:16 +02:00
unknown
86fc80d5af Merge gbichot@bk-internal.mysql.com:/home/bk/mysql-maria
into  gbichot4.local:/home/mysql_src/mysql-maria-monty
2008-03-17 23:07:29 +01:00
unknown
1d791be480 Fix for BUG#35273 "Corrupted table if using GIS index":
when modifying R-tree indices we forgot to unpin pages (causing
flush at-end-of-statement to fail - because page is pinned - and thus
mark table corrupted) and also to unlock key_del (causing assertion
failure info->used_key_del==0 at maria_close()).


storage/maria/ma_rt_index.c:
  When modifying pages of R-tree indices we keep them pinned, and
  lock key_del, so we here make sure to unpin and unlock at the end
  of the modification. I checked all functions which add to info->pinned_pages
  or call _ma_lock_key_del(): the parent is always maria_rtree_insert()
  or maria_rtree_delete(), which thus do the unpin/unlock now.
mysql-test/r/maria-gis-rtree.result:
  new result, which is incorrect (filed as BUG#35351) but at least
  test does not crash anymore
mysql-test/t/maria-gis-rtree.test:
  test of Maria's GIS functionality (R-tree indices etc); copied from
  MyISAM's gis-rtree.test; used to crash without the bugfixes.
2008-03-17 22:31:50 +01:00
unknown
98fd06a234 Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-bug35036


storage/maria/ma_loghandler.c:
  Auto merged
2008-03-16 18:12:06 +02:00
unknown
f0da1ea667 Fixed statistic calculation.
(BUG#35030 maria_pagecache_read* status
variables updated at wrong moment)


storage/maria/ma_pagecache.c:
  Fixed statistic calculation.
2008-03-11 18:12:08 +02:00
unknown
61788ff484 Very small changes.
storage/maria/ma_locking.c:
  define 'share' only in block which needs it
storage/maria/unittest/ma_test_recovery.pl:
  more straightforward way to compute file's MD5
2008-03-10 18:55:33 +01:00
unknown
6ec6ae4a58 Maria's usage of my_stat() is unreliable on Windows. (BUG#35036)
%llu replaces with %s/llstr() as in other MySQL code.


storage/maria/ma_loghandler.c:
  my_stat is not reliable under windows for determinating file
  length so it is replaced with my_seek.
  %llu replaces with %s/llstr() as in other MySQL code.
2008-03-08 11:44:46 +02:00
unknown
351bdaef10 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-bug34712
2008-03-08 10:18:44 +02:00
unknown
82b01fcdb7 Merge bk-internal.mysql.com:/home/bk/mysql-maria
into  mysql.com:/home/my/mysql-maria
2008-03-08 02:10:14 +02:00
unknown
42455c483c Fix for #Bug35048 "maria table corruption reported when transactional=0
Problem was that page in bitmap was marked as full even if there was free places in page directory


mysql-test/r/maria.result:
  Test case for problem with head/tail page with 255 entries
  (Bug 35048 "maria table corruption reported when transactional=0)
mysql-test/t/maria.test:
  Test case for problem with head/tail page with 255 entries
  (Bug 35048 "maria table corruption reported when transactional=0)
storage/maria/ma_blockrec.c:
  Fix to ensure that bitmap is marked 'full' when the head/tail page directory is full
storage/maria/ma_check.c:
  Better check when directory for head/tail pages are marked full (The page directory can't hold a row tail + blob tails)
2008-03-08 02:07:03 +02:00
unknown
6a3f3245dc Avoiding changing log on flush call
if nothing was added to the log
(BUG#34712 maria_read_log changes log
file content on several platforms though not needed)
Fixed callback call (now under loghandler lock).


storage/maria/ma_loghandler.c:
  Flag that signaling about "everythig-flushed" state of
  the log added, to avoid changing log on flush request
  if nothing was written but horizon placed on the page boarder.
  Fixed callback call (now under loghandler lock).
2008-03-07 21:00:00 +02:00
unknown
fe54297020 Removed external call to md5sum and added
an internal procedure for it. Removed my_which()
as unneccessary.
2008-03-07 17:23:52 +02:00
unknown
d6a868cc20 Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-bug34161


storage/maria/ma_pagecache.c:
  Auto merged
2008-03-05 10:40:52 +02:00
unknown
cb805686ce Misplaced variable declaration fixed. 2008-03-05 08:48:59 +02:00
unknown
555c12c157 Merge desktop.sanja.is.com.ua:/home/bell/mysql/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-bug34634


storage/maria/ma_pagecache.c:
  Auto merged
2008-03-04 23:15:55 +02:00
unknown
7a6342c21f Fixed problem of deleting blocks which are being evicted at
the moment. (BUG#34634)
Fixed potential bug in pinning schema.


storage/maria/ma_pagecache.c:
  Fixed problem of deleting blocks which are being evicted at
  the moment.
  Fixed potential bug in pinning schema.
2008-03-04 23:12:19 +02:00
unknown
963cd16722 Fixed excessive assertion reported in BUG#35031
"Using maria-block-size != 8192 makes Maria crash or say "error 174""


storage/maria/ma_create.c:
  fixed excessive assertion
2008-03-04 21:47:07 +01:00
unknown
33c253534a Merge gbichot4.local:/home/mysql_src/mysql-maria-monty
into  gbichot4.local:/home/mysql_src/mysql-maria-clean


storage/maria/ha_maria.cc:
  Auto merged
storage/maria/ma_pagecache.c:
  Auto merged
2008-03-04 17:16:23 +01:00
unknown
29b9fdff4b Making ma_pagecache_rwconsist_1k-t unit test build under Windows
storage/maria/unittest/CMakeLists.txt:
  build unit test under Windows too
storage/maria/unittest/ma_pagecache_rwconsist.c:
  portability fix for Windows
2008-03-04 17:07:55 +01:00
unknown
09e4e954c3 Fixed crashing bug when starting mysqld with --dbug
Fixed crash when using other maria block size than 8192
Fixed bug that caused tables to be reported as crashed if maria_log_control was deleted


mysql-test/valgrind.supp:
  Suppress leaks on SuSE 10.3, x86 64 bit
sql/mysqld.cc:
  Don't give warning in case of timeout for pthread_cond_timedwait
  Fixed crashing bug when starting mysqld with --dbug
storage/maria/ha_maria.cc:
  Fixed crash when using other block size than 8192 (Crash happend later in bitmap page handling)
storage/maria/ma_locking.c:
  When we write a new uuid for a zerofilled file, also update the lsn's
storage/maria/ma_open.c:
  Don't update lsn on open. Wait until first time file is changed
  Fixed bug that caused tables to be reported as crashed if maria_log_control was deleted
strings/strmake.c:
  Fixed warnings for strings without end 0 when running under valgrind.
2008-03-04 17:13:34 +02:00
unknown
ea3ae3c470 copyright and license info
storage/maria/Makefile.am:
  copyright
storage/maria/ma_pagecache.c:
  copyright
storage/maria/ma_pagecache.h:
  copyright
storage/maria/ma_pagecaches.c:
  copyright
storage/maria/ma_pagecrc.c:
  copyright
storage/maria/unittest/Makefile.am:
  copyright
storage/maria/unittest/lockman-t.c:
  copyright
storage/maria/unittest/lockman1-t.c:
  copyright
storage/maria/unittest/lockman2-t.c:
  copyright
storage/maria/unittest/ma_control_file-t.c:
  copyright
storage/maria/unittest/ma_loghandler_examples.c:
  copyright
storage/maria/unittest/ma_maria_log_cleanup.c:
  copyright
storage/maria/unittest/ma_pagecache_consist.c:
  copyright
storage/maria/unittest/ma_pagecache_rwconsist.c:
  copyright
storage/maria/unittest/ma_pagecache_single.c:
  copyright
storage/maria/unittest/ma_test_loghandler-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_first_lsn-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_max_lsn-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_multithread-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_noflush-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_nologs-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_pagecache-t.c:
  copyright
storage/maria/unittest/ma_test_loghandler_purge-t.c:
  copyright
storage/maria/unittest/test_file.c:
  copyright
storage/maria/unittest/test_file.h:
  copyright
storage/maria/unittest/trnman-t.c:
  copyright
2008-03-04 12:58:21 +01:00
unknown
1bbb098104 Fix for BUG#34089 "Maria crash on LOAD INDEX after FLUSH TABLES".
storage/maria/ha_maria.cc:
  enable LOAD INDEX for Maria
storage/maria/ma_preload.c:
  Making index preloading work for Maria.
storage/maria/maria_def.h:
  We don't need this #define anymore, ma_test_recovery.pl uses
  zerofill to do comparisons of physical files.
mysql-test/r/maria-preload.result:
  result. The values of maria_pagecache_reads look too high, see
  BUG#35030 "maria_pagecache_read* status variables updated at wrong moment"
mysql-test/t/maria-preload.test:
  Test of index preloading in Maria
2008-03-04 12:47:02 +01:00
unknown
79ca1004cb Merge bk-internal.mysql.com:/home/bk/mysql-maria
into  mysql.com:/home/my/mysql-maria
2008-03-04 02:46:51 +02:00
unknown
77dec6470c Incorrect function prefix fixed. (thanks Guilhem for spotting it)
storage/maria/ma_pagecache.c:
  Incorrect function prefix fixed.
2008-03-03 23:29:44 +02:00
unknown
33268ef214 Removed incorrect clearing IN_SWITCH status. (BUG#34161)
storage/maria/ma_pagecache.c:
  Removed incorrect clearing IN_SWITCH status.
2008-03-03 23:23:21 +02:00
unknown
6e71829eb3 Fix for BUG#34936 "Table can stay locked if writing of LOGREC_FILE_ID fails"
storage/maria/ma_loghandler.c:
  forgotten unlock
2008-02-29 12:11:31 +01:00
unknown
b01c9528d1 WL#3072 Maria Recovery
fixes for ma_test_recovery.pl to work in release builds too:
- bugfix in maria_zerofill_index()
- applying of LOGREC_INSERT_ROW_BLOBS now zeroes unused end of non-full
blob page (a mutation of tail page when it takes >75% of maria_block_size)
like write_full_pages() does.


storage/maria/ma_blockrec.c:
  When we write a non-full blob page at run-time, we zero the rest of
  it (see write_full_pages()). We now do the same in
  _ma_apply_redo_insert_row_blobs(): this is consistent and helps
  having log-applying produce the same page as run-time.
storage/maria/ma_check.c:
  maria_zerofill_index() was wrong: it didn't zero certain bytes
  because it believed that the count of relevant bytes is
  _ma_get_page_used(share, buff) + share->keypage_header,
  whereas it's only the first term.
storage/maria/ma_pagecache.c:
  typo
storage/maria/ma_pagecache.h:
  typo
storage/maria/maria_chk.c:
  enable --zerofill-keep-lsn in all builds
storage/maria/unittest/ma_test_recovery.pl:
  now even release builds can run ma_test_recovery.pl, because zerofill
  makes tables of this test (made by run-time and by log-applying)
  identical.
2008-02-26 21:32:07 +01:00
unknown
b2724a6a94 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/tmp/work-maria-rwlock-push
2008-02-26 01:09:49 +02:00
unknown
446c13a801 Fixes to how ma_test_recovery.pl uses --zerofill-keep-lsn
storage/maria/unittest/ma_test_recovery.pl:
  Tell how many tables were zerofilled (just for information, a varying
  number does not make the test fail).
  Don't let --zerofill-keep-lsn influence next runs (which it shouldn't
  do in theory anyway, but testing should not believe theory): restore
  non-zerofilled tables right after comparison is finished.
2008-02-25 23:46:01 +01:00
unknown
c45172ec38 Merge abelkin@bk-internal.mysql.com:/home/bk/mysql-maria
into  desktop.sanja.is.com.ua:/home/bell/mysql/bk/work-maria-rwlock-push
2008-02-26 00:07:40 +02:00
unknown
c0356dad39 No error message from maria_dump_log when reaching a log's EOF.
storage/maria/ma_loghandler.c:
  change the flags, otherwise when maria_dump_log reaches the end of the
  log it prints an "EOF error" to the user.
2008-02-25 19:43:58 +01:00
unknown
1b4c6fa6df Build maria_dump_log under Windows. Enable maria_chk --zerofill-keep-lsn
in release builds, use it to fine-tune physical file comparisons in
ma_test_recovery.pl.


storage/maria/CMakeLists.txt:
  build maria_dump_log under Windows too
storage/maria/maria_chk.c:
  make --zerofill-keep-lsn usable in release builds too, it makes sense.
  This option needn't reset state's LSNs, and it's more useful if it
  does not (see added comment) as it changes less the table.
storage/maria/unittest/ma_test_recovery.pl:
  - getting rid of 'cmp'
  - if physical comparison of two MAD or MAI files fails, it might
  be in irrelevant portions (unushed index or data page pieces):
  we use --zerofill-keep-lsn and retry the comparison. This fixes
  a part of test failures under Windows.
2008-02-25 17:31:55 +01:00
unknown
e6349ff7f3 postmerge fix
storage/maria/unittest/ma_pagecache_consist.c:
  postmerge fix.
storage/maria/unittest/ma_pagecache_rwconsist.c:
  postmerge fix.
2008-02-22 23:35:38 +02:00
unknown
daacf696e5 Merge 88-214-96-46.dialup.umc.net.ua:/Users/bell/mysql/bk/mysql-maria
into  88-214-96-46.dialup.umc.net.ua:/Users/bell/mysql/bk/work-maria-test


storage/maria/ma_pagecache.c:
  Auto merged
storage/maria/unittest/Makefile.am:
  merge
storage/maria/unittest/ma_pagecache_consist.c:
  merge
2008-02-22 23:21:27 +02:00
unknown
190de95f6f Locking for read and write made waiting for each other (with loose
scheme for the same thread locking).


include/my_pthread.h:
  Added variable for lock diffirentiation.
include/wqueue.h:
  New release call.
mysys/wqueue.c:
  New release call in case of read/write lock.
storage/maria/ma_pagecache.c:
  Locking for read and write made waitimg for each other.
storage/maria/unittest/Makefile.am:
  New test added.
storage/maria/unittest/ma_pagecache_consist.c:
  Fixed thread initialization in the test.
storage/maria/unittest/ma_pagecache_rwconsist.c:
  New BitKeeper file ``storage/maria/unittest/ma_pagecache_rwconsist.c''
2008-02-22 22:32:34 +02:00