An error occurred fetching the project authors.
  1. 09 Aug, 2010 1 commit
  2. 09 Apr, 2010 1 commit
  3. 08 Apr, 2010 1 commit
  4. 02 Apr, 2010 1 commit
  5. 30 Mar, 2010 3 commits
    • Michael Widenius's avatar
      Removed compiler warning · d904739c
      Michael Widenius authored
      Disable pbxt for test cases not using pbxt (speeds up test suite)
      
      extra/comp_err.c:
        Added cast to get rid of compiler warning
      extra/libevent/kqueue.c:
        Added cast to get rid of compiler warning
      mysql-test/lib/mtr_cases.pm:
        Use --skip-pbxt for test cases that doesn't need pbxt
        Collect default-storage-engine from suite.opt file (should actually be my.cnf file, but that wasn't easy to do)
      mysql-test/suite/pbxt/t/suite.opt:
        Added marker for mysql-test-run.pl that this suite require pbxt
      mysys/mf_keycache.c:
        Use LINT_INIT() to remove compiler warnings
      mysys/my_gethostbyname.c:
        Remove compiler warnings
      sql/handler.cc:
        Reset variable that may be used uninitialized
      sql/item.h:
        Remove compiler warning
      sql/mysqld.cc:
        Use LINT_INIT() to remove compiler warnings
      sql/sql_class.h:
        Remove compiler warning
      sql/sql_table.cc:
        Ensure variable is always set (to remove compiler warning)
      sql/sql_view.cc:
        Use LINT_INIT() to remove compiler warnings
      storage/maria/ma_loghandler.c:
        Use LINT_INIT() to remove compiler warnings
      storage/myisammrg/ha_myisammrg.cc:
        Fixed wrong type to printf
      storage/myisammrg/myrg_open.c:
        Use LINT_INIT() to remove compiler warnings
      storage/xtradb/include/ut0lst.h:
        Trivial change of macro to remove compiler warning
      strings/ctype-ucs2.c:
        Use LINT_INIT() to remove compiler warnings
      strings/ctype-utf8.c:
        Use LINT_INIT() to remove compiler warnings
      support-files/compiler_warnings.supp:
        Suppress some not relevant warnings
      unittest/mysys/waiting_threads-t.c:
        Don't use ftruncate() as this gives warning about ignored return value
      d904739c
    • unknown's avatar
      Compiler warnings removed. · 515c2db0
      unknown authored
      storage/maria/ma_loghandler.c:
        compiler warnings removed.
      515c2db0
    • unknown's avatar
      Remove compiler warning · 8272a47f
      unknown authored
      storage/maria/ma_loghandler.c:
        Remove compiler warning.
      8272a47f
  6. 29 Mar, 2010 1 commit
  7. 10 Mar, 2010 1 commit
    • unknown's avatar
      Fix some compiler warnings seen in Buildbot. · 3e32ba3f
      unknown authored
      Add some extra error output and code cleanup in an attempt to fix/debug
      a rare random testsuite problem in check_warnings, where the exit code
      from mysqltest is somehow corrupted inside mysql-test-run.pl.
      
      include/my_global.h:
        Fix compiler warnings on some platforms.
      mysql-test/lib/My/SafeProcess.pm:
        Move dereference of $? subprocess exit code closer to where it is generated,
        to make the code more robust and on the chance that this will fix the
        occasional problems in check_warnings we see in Buildbot.
      mysql-test/mysql-test-run.pl:
        When check_warnings failed, also log the mysqld server for which it failed.
      sql/sql_lex.cc:
        Fix compiler warning about possibly uninitialised value, by rewriting a for()
        loop that is always executed at least once into a do .. while() loop with an
        assert.
      sql/table.cc:
        Fix compiler warning about uninitialised value.
      storage/federatedx/ha_federatedx.cc:
        Fix uninitialised variable.
      storage/maria/ma_delete.c:
        Fix compiler warning about uninitialised value.
      storage/maria/ma_loghandler.c:
        Fix compiler warning about uninitialised value.
      storage/myisam/ft_stopwords.c:
        Fix compiler warning.
      storage/myisam/mi_write.c:
        Fix compiler warning about possibly uninitialised value, by rewriting a while()
        loop that is always executed at least once into a do .. while() loop with an
        assert.
      storage/xtradb/btr/btr0cur.c:
        Fix compiler warning about possibly uninitialised value.
      support-files/compiler_warnings.supp:
        Fix warning suppression to cover all cases in yassl.
      vio/viossl.c:
        Fix compiler warning.
      3e32ba3f
  8. 12 Feb, 2010 1 commit
    • unknown's avatar
      Group commit for maria engine. · abb87914
      unknown authored
      mysql-test/suite/maria/r/group_commit.result:
        Test of gruoup commit.
      mysql-test/suite/maria/r/maria3.result:
        The new variables added.
      mysql-test/suite/maria/t/group_commit.test:
        Test of group commit.
      randgen:
        Randon query generator tests.
      randgen/conf:
        Random query generator tests.
      randgen/conf/maria_group_commit.yy:
        Random query generator test for group commit.
      storage/maria/ha_maria.cc:
        New variables and support procedures for group commit added.
      storage/maria/ma_init.c:
        Correct shutdown of group commit service thread and group commit.
      storage/maria/ma_loghandler.c:
        Group commit added.
        Initialization of variables for embeded server edded.
      storage/maria/ma_loghandler.h:
        Group commit types and routines.
      abb87914
  9. 06 Jan, 2010 1 commit
    • Michael Widenius's avatar
      Removed compiler warnings · b96f268a
      Michael Widenius authored
      Fixed sporadic test failure for suit/pbxt/t/lock_multi.test
      Fixed sporadic test faulure for suit/rpl/t/do_grant.test
      OpenSolaris 5.11-x86 now compiles (tested with 32 bit)
      
      BUILD/compile-solaris-amd64-debug-forte:
        Added execute bit
      BUILD/compile-solaris-x86-32:
        Added execute bit
      BUILD/compile-solaris-x86-32-debug:
        Added execute bit
      BUILD/compile-solaris-x86-32-debug-forte:
        Added execute bit
      BUILD/compile-solaris-x86-forte-32:
        Added execute bit
      extra/libevent/devpoll.c:
        Removed compiler warning
      extra/libevent/evbuffer.c:
        Removed compiler warning
      extra/libevent/select.c:
        Removed compiler warning
      mysql-test/mysql-test-run.pl:
        Fixed sporadic test faulure for suit/rpl/t/do_grant.test (Seen on OpenSolaris)
      mysql-test/suite/pbxt/r/lock_multi.result:
        Fixed sporadic test failure for suit/pbxt/t/lock_multi.test (seen in buildbot)
        This was done by merging the test with main/lock_multi.test
      mysql-test/suite/pbxt/t/lock_multi.test:
        Fixed sporadic test failure for suit/pbxt/t/lock_multi.test (seen in buildbot)
        This was done by merging the test with main/lock_multi.test
      mysys/my_sync.c:
        Removed compiler warnings
      sql/ha_ndbcluster.cc:
        Fixed linking error on OpenSolaris when compiling without ndb
        Bug #34866 Can't compile on Solaris 9/Sparc with gcc
      storage/archive/azlib.h:
        Removed compiler warning about redefined symbols
      storage/maria/ma_blockrec.c:
        Removed compiler warning
      storage/maria/ma_loghandler.c:
        Removed compiler warning
      storage/maria/ma_test3.c:
        Removed compiler warning
      storage/myisam/mi_test3.c:
        Removed compiler warning
      storage/pbxt/src/ha_pbxt.cc:
        Removed compiler warning
        thr_main -> thr_main_pbxt
      storage/pbxt/src/restart_xt.cc:
        thr_main -> thr_main_pbxt
      storage/pbxt/src/thread_xt.cc:
        thr_main -> thr_main_pbxt
        This was needed as thr_main() is an internal thread function on OpenSolaris()
      storage/pbxt/src/thread_xt.h:
        thr_main -> thr_main_pbxt
      storage/xtradb/srv/srv0srv.c:
        Use compatiblity macro to get code to work on OpenSolaris
      support-files/compiler_warnings.supp:
        Ignore compiler warning from yassl
      b96f268a
  10. 06 May, 2009 1 commit
    • unknown's avatar
      We are now using Valgrind rather than purify, and have for quite some time. · b125770a
      unknown authored
      Consequently, rename HAVE_purify to HAVE_valgrind, and related changes.
      Leave some comments about purify when not clear that they apply also to Valgrind.
      Fix redundant IF_VALGRIND declaration.
      
      Misc. small fixes:
       - Fixes for pool-of-threads patch.
       - Fixes for push of PBXT storage engine.
       - mysql-test-run.pl fix.
       - Fix build problem in compile-pentium64-max.
      
      
      BUILD/SETUP.sh:
        Rename purify -> valgrind.
      BUILD/build_mccge.sh:
        Rename purify -> valgrind.
      BUILD/compile-dist:
        Fix that PBXT was missing in source tarball after `BUILD/compile-dist && make dist`
      BUILD/compile-pentium64-max:
        Fix a build problem with BUILD/compile-pentium64-max on CentOS/Fedora Core 10 amd64.
              
        On these systems, there is libz.so but no libz.a. Finding libz.so, ./configure decides
        to use system zlib. But since BUILD/compile-pentium64-max builds a fully static binary
        with -all-static, the link of mysqld fails due to missing libz.a.
              
        Fix by using bundled zlib in the build script.
      BUILD/compile-solaris-sparc-purify:
        Rename purify -> valgrind.
      include/m_string.h:
        Rename purify -> valgrind.
      include/my_global.h:
        Rename purify -> valgrind.
      mysql-test/Makefile.am:
        Fix that PBXT test suite was missing from `make dist` source tarball.
      mysql-test/lib/mtr_unique.pm:
        Better fix to avoid races when chmod'ing the semaphore file.
        (Though using chmod 666 shared files in /tmp/ is still not a very good solution).
      mysql-test/t/pool_of_threads.cnf:
        Fix that test case pool_of_threads fails if run on mysqld with no --with-libevent support.
      mysys/mf_qsort.c:
        Rename purify -> valgrind.
      mysys/my_alloc.c:
        Rename purify -> valgrind.
      mysys/my_init.c:
        Rename purify -> valgrind.
      mysys/my_rnd.c:
        Rename purify -> valgrind.
      mysys/safemalloc.c:
        Rename purify -> valgrind.
      scripts/mysql_config.pl.in:
        Rename purify -> valgrind.
      scripts/mysql_config.sh:
        Rename purify -> valgrind.
      sql/field_conv.cc:
        Rename purify -> valgrind.
      sql/filesort.cc:
        Rename purify -> valgrind.
      sql/ha_partition.cc:
        Rename purify -> valgrind.
      sql/hostname.cc:
        Rename purify -> valgrind.
      sql/item_timefunc.cc:
        Rename purify -> valgrind.
      sql/log_event.cc:
        Rename purify -> valgrind.
      sql/log_event_old.cc:
        Rename purify -> valgrind.
      sql/my_decimal.h:
        Rename purify -> valgrind.
      sql/mysqld.cc:
        Rename purify -> valgrind.
        Fix redundant IF_VALGRIND declaration.
      sql/opt_range.cc:
        Rename purify -> valgrind.
      sql/opt_range.h:
        Rename purify -> valgrind.
      sql/records.cc:
        Rename purify -> valgrind.
      sql/rpl_rli.cc:
        Rename purify -> valgrind.
      sql/rpl_rli.h:
        Rename purify -> valgrind.
      sql/set_var.cc:
        Fix missing static declaration on pool_of_threads.
      sql/slave.cc:
        Rename purify -> valgrind.
      sql/sql_base.cc:
        Rename purify -> valgrind.
      sql/sql_binlog.cc:
        Rename purify -> valgrind.
      sql/sql_class.cc:
        Rename purify -> valgrind.
      sql/sql_list.h:
        Rename purify -> valgrind.
      sql/sql_load.cc:
        Rename purify -> valgrind.
      sql/sql_select.cc:
        Rename purify -> valgrind.
      sql/table.cc:
        Rename purify -> valgrind.
      storage/archive/azio.c:
        Rename purify -> valgrind.
      storage/innobase/buf/buf0buf.c:
        Rename purify -> valgrind.
      storage/innobase/include/univ.i:
        Rename purify -> valgrind.
      storage/innobase/srv/srv0start.c:
        Rename purify -> valgrind.
      storage/maria/ha_maria.cc:
        Rename purify -> valgrind.
      storage/maria/ma_blockrec.c:
        Rename purify -> valgrind.
      storage/maria/ma_check.c:
        Rename purify -> valgrind.
      storage/maria/ma_loghandler.c:
        Rename purify -> valgrind.
      storage/maria/ma_packrec.c:
        Rename purify -> valgrind.
      storage/maria/ma_page.c:
        Rename purify -> valgrind.
      storage/maria/ma_pagecrc.c:
        Rename purify -> valgrind.
      storage/maria/ma_search.c:
        Rename purify -> valgrind.
      storage/myisam/mi_check.c:
        Rename purify -> valgrind.
      storage/myisam/mi_page.c:
        Rename purify -> valgrind.
      storage/myisam/mi_search.c:
        Rename purify -> valgrind.
      storage/myisammrg/ha_myisammrg.cc:
        Rename purify -> valgrind.
      strings/bcmp.c:
        Rename purify -> valgrind.
      strings/decimal.c:
        Rename purify -> valgrind.
      strings/strmake.c:
        Rename purify -> valgrind.
      b125770a
  11. 17 Mar, 2009 1 commit
    • unknown's avatar
      Fixed bug of waiting for flush pass end. · 36252821
      unknown authored
      storage/maria/ma_loghandler.c:
        Fixed bug of waiting for flush pass end: in case of two sequential flushes waiting thread can not detect end of the pass it is waiting because till the time it will check the flush in progress flag will be set on again. Solution is to have pass number and compare the number before before waits start and check it as condition of the flush pass end (of course it does not matter if the counter of pass number overflows).
      36252821
  12. 05 Mar, 2009 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#42180 "Maria: maria-recovery-bitmap.test fails repeatedly" · 8a715a59
      Guilhem Bichot authored
      storage/maria/ma_loghandler.c:
        Normally, when we log LOGREC_LONG_TRANSACTION_ID, undo_lsn should be 0: assert this.
      storage/maria/ma_test_force_start.pl:
        this script does not work with mtr2, make it use mtr1
      storage/maria/trnman.c:
        The bug's cause was that: transaction would log LOGREC_LONG_TRANSACTION_ID, then Checkpoint would run
        and skip it (because its undo_lsn is still 0), then transaction would log REDO+UNDO, then crash. At Recovery,
        REDO phase would start from Checkpoint's record LSN, so wouldn't see LOGREC_LONG_TRANSACTION_ID, and
        as Checkpoint record does not mention transaction, transaction would be unknown, so its REDO+UNDO would
        be thrown away (assumed to belong to a transaction committed long ago as unknown), so transaction
        would not be rolled back, which is wrong. Fix is: it was wrong to skip a transaction if undo_lsn is 0;
        as soon as LOGREC_LONG_TRANSACTION_ID has been logged, it becomes potentially invisible to the REDO
        phase, and so we must include this transaction in the checkpoint record.
      8a715a59
  13. 04 Feb, 2009 1 commit
  14. 16 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Fixed issues in last push found by pushbuild · 364f8611
      Michael Widenius authored
      sql/sql_insert.cc:
        Removed DBUG_ASSERT() that is triggered by deadlock-innodb test
      storage/maria/ma_loghandler.c:
        Removed compiler warnings
      storage/maria/trnman_public.h:
        Fixed wrong code from last push
      364f8611
  15. 15 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Log queries to maria_log if compiled with EXTRA_DEBUG · 3fca2390
      Michael Widenius authored
      Added DBUG_ASSERT() to unlikely error senario
      Don't use errno == 0 in maria_create() / myisam_create()
      
      sql/sql_insert.cc:
        Added DBUG_ASSERT() for case that should never happen in real life
        Added my_error() to avoid assert if mysql_lock() or postlock() doesn't call my_error()
      storage/maria/ha_maria.cc:
        Log queries to maria_log if compiled with EXTRA_DEBUG
      storage/maria/ma_create.c:
        Don't use errno == 0
      storage/maria/ma_loghandler.c:
        Added logging of debug info to maria_log
      storage/maria/ma_loghandler.h:
        Added logging of debug info to maria_log
      storage/maria/ma_recovery.c:
        Added printing of debug info from maria_log
      storage/maria/trnman.c:
        Added functions to read/store state in TRN
      storage/maria/trnman.h:
        Added functions to read/store state in TRN
      storage/maria/trnman_public.h:
        Added state in TRN to remmeber if we have already logged the query
      storage/myisam/mi_create.c:
        Don't use errno == 0
      3fca2390
  16. 09 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Code cleanup: · 7eda7f13
      Michael Widenius authored
      - Removed not needed casts
      - Indentation fixes
      - Changed some buffer variables to uchar, to be able to remove casts
      
      
      storage/maria/ma_bitmap.c:
        Removed not needed casts
      storage/maria/ma_blockrec.c:
        Removed not needed casts
      storage/maria/ma_check.c:
        Removed not needed casts.
        Changed type of buffers to be able to remove casts
      storage/maria/ma_create.c:
        Removed not needed casts
      storage/maria/ma_delete.c:
        Removed not needed casts
      storage/maria/ma_dynrec.c:
        Removed not needed casts
      storage/maria/ma_extra.c:
        Removed not needed casts
      storage/maria/ma_ft_boolean_search.c:
        Removed not needed casts
      storage/maria/ma_ft_nlq_search.c:
        Removed not needed casts
      storage/maria/ma_ft_parser.c:
        Removed not needed casts
      storage/maria/ma_loghandler.c:
        Removed not needed casts
      storage/maria/ma_open.c:
        Removed not needed casts
      storage/maria/ma_packrec.c:
        Removed not needed casts
      storage/maria/ma_pagecache.c:
        Removed not needed casts
      storage/maria/ma_preload.c:
        Removed not needed casts
        Removed not needed initialization
      storage/maria/ma_rnext_same.c:
        Removed not needed casts
      storage/maria/ma_rt_index.c:
        Removed not needed casts
      storage/maria/ma_search.c:
        Removed not needed casts
      storage/maria/ma_sort.c:
        Removed not needed casts
        Removed not needed if
        Fixed indentation
      storage/maria/ma_statrec.c:
        Removed not needed casts
      storage/maria/ma_test2.c:
        Removed not needed casts
      storage/maria/ma_write.c:
        Removed not needed casts
        Indentation fixes
      storage/maria/maria_chk.c:
        Removed not needed casts
      storage/maria/maria_pack.c:
        Removed not needed casts
      7eda7f13
  17. 08 Dec, 2008 1 commit
    • unknown's avatar
      False alarm about incorrect mutex taking removed. · e1ee25e4
      unknown authored
      storage/maria/ma_loghandler.c:
        Number of the buffer now passed to buffer initialization function to assign buffer number and break false alarm "chain" by switching off deadlock detection for one buffer.
      e1ee25e4
  18. 05 Dec, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#41037 "Maria: recovery failure (pushbuild2)" (checkpoint bug). · 91bc9cc9
      Guilhem Bichot authored
      mysql-test/suite/maria/r/maria-recovery3.result:
        result.
      mysql-test/suite/maria/t/maria-recovery3-master.opt:
        usual recovery test options
      mysql-test/suite/maria/t/maria-recovery3.test:
        Test for BUG#41037. Without the bugfix, the test would hang because Recovery would fail with "undo_key_insert got error 126": Recovery would believe INSERT of 2 is uncommitted, try to execute its UNDO_KEY_INSERT, fail to find the key to delete because DELETE deleted it. That failure of _ma_ck_real_delete() would mark table as corrupted (see
        in d_search()) which is error 126 (HA_ERR_CRASHED).
      storage/maria/ma_blockrec.c:
        set trn->rec_lsn to LSN of commit record, when writing it.
      storage/maria/ma_blockrec.h:
        new function
      storage/maria/ma_commit.c:
        when committing or rolling back, rec_lsn should be LSN_IMPOSSIBLE: assertion is moved here
        from trnman_end_trn(), because now ma_commit() can set rec_lsn and so when we reach trnman_end_trn()
        it's not LSN_IMPOSSIBLE anymore.
        Adding debug possibility to pause between COMMIT record write and trnman_commit_trn(), to be
        able to fire checkpoint in between.
      storage/maria/ma_loghandler.c:
        in-write hook for COMMIT records
      storage/maria/ma_recovery.c:
        More debugging info in maria_recovery.trace, to see how the starting point of REDO phase is determined
      storage/maria/trnman.c:
        assertion cannot be here anymore see ma_commit.c
      91bc9cc9
  19. 02 Dec, 2008 1 commit
    • Michael Widenius's avatar
      WL#3262 add mutex lock order checking to safemutex (also called safe_mutex_deadlock_detector) · 32f81bab
      Michael Widenius authored
      This writes a warning on stderr if one uses mutex in different order,
      like if one in one case would lock mutex in the order A,B and in another case
      would lock mutex in the order B,A
      This is inspired by and loosely based on the LOCKDEP patch by Jonas
      Wrong mutex order is either fixed or mutex are marked with MYF_NO_DEADLOCK_DETECTION
      if used inconsistently (need to be fixed by server team)
      
      KNOWN_BUGS.txt:
        Added information that one need to dump and restore Maria tables
      include/hash.h:
        Added prototype function for walking over all elements in a hash
      include/my_pthread.h:
        Added my_pthread_mutex_init() and my_pthread_mutex_lock(); These should be used if one wants to disable mutex order checking.
        Changed names of the nonposix mutex_init functions to not conflict with my_phread_mutex_init()
        Added and extended structures for mutex deadlock detection.
        New arguments to sage_mutex_init() and safe_mutex_lock() to allow one to disable mutex order checking.
        Added variable 'safe_mutex_deadlock_detector' to enable/disable deadlock detection for all pthread_mutex_init()
      mysys/Makefile.am:
        Added cleaning of test files
        Added test_thr_mutex
      mysys/hash.c:
        Added hash_iterate() to iterate over all elements in a hash
        More comments
      mysys/my_init.c:
        Added calls to destory all mutex uses by mysys()
        Added waiting for threads to end before calling TERMINATE() to list not freed memory
      mysys/my_pthread.c:
        Changed names to free my_pthread_mutex_init() for mutex-lock-order-checking
      mysys/my_sleep.c:
        Fixed too long wait if using 1000000L as argument
      mysys/my_thr_init.c:
        Mark THR_LOCK_threads and THR_LOCK_malloc to not have mutex deadlock detection.
        (We can't have it enabled for this as these are internal mutex used by the detector  
        Call my_thread_init() early as we need thread specific variables enabled for the following pthread_mutex_init()
        Move code to wait for threads to end to my_wait_for_other_threads_to_die()
        Don't destroy mutex and conditions unless all threads have died
        Added my_thread_destroy_mutex() to destroy all mutex used by the mysys thread system
        Name the thread specific mutex as "mysys_var->mutex"
        Added my_thread_var_mutex_in_use() to return pointer to mutex in use or 0 if thread variables are not initialized
      mysys/mysys_priv.h:
        Added prototypes for functions used internally with mutex-wrong-usage detection
      mysys/thr_mutex.c:
        Added runtime detection of mutex used in conflicting order
        See WL#3262 or test_thr_mutex.c for examples
        The base idea is for each mutex have two hashes:
        - mutex->locked_mutex points to all mutex used after this one
        - mutex->used_mutex points to all mutex which has this mutex in it's mutex->locked_mutex
        There is a wrong mutex order if any mutex currently locked before this mutex is in the mutex->locked_mutex hash
      sql/event_queue.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/event_scheduler.cc:
        Declare the right order to take the mutex
      sql/events.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/ha_ndbcluster_binlog.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/log.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/mysqld.cc:
        Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
        This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
        Added call to free sp cache.
        Add destruction of LOCK_server_started and COND_server_started.
        Added register_mutex_order() function to register in which order mutex should be taken
        (to initiailize mutex_deadlock_detector).
        Added option to turn off safe_mutex_deadlock_detector
      sql/protocol.cc:
        Fixed wrong argument to DBUG_PRINT (found by valgrind)
      sql/rpl_mi.cc:
        Mark mutex used inconsistently (need to be fixed by server team)
      sql/set_var.cc:
        Remove wrong locking of LOCK_global_system_variables when reading and setting log variables
        (would cause inconsistent mutex order).
        Update global variables outside of logger.unlock() as LOCK_global_system_variables has to be taken before logger locks
        Reviewed by gluh
      sql/sp_cache.cc:
        Added function to destroy mutex used by sp cache
      sql/sp_cache.h:
        Added function to destroy mutex used by sp cache
      sql/sql_class.cc:
        Use pthread_mutex_trylock instead of pthread_mutex_unlock() when sending kill signal to thread
        This is needed to avoid wrong mutex order as normally one takes 'current_mutex' before mysys_var->mutex.
        Register order in which LOCK_delete and mysys_var->mutex is taken
      sql/sql_insert.cc:
        Give a name for Delayed_insert::mutex
        Mark mutex used inconsistently (need to be fixed by server team)
        Move closing of tables outside of di->mutex (to avoid wrong mutex order)
      sql/sql_show.cc:
        Don't keep LOCK_global_system_variables locked over value->show_type() as this leads to wrong mutex order
      storage/innobase/handler/ha_innodb.cc:
        Disable safe_muted_deadlock_detector for innobase intern mutex (to speed up page cache initialization)
      storage/maria/ha_maria.cc:
        Added flag to ha_maria::info() to signal if we need to lock table share or not.
        This is needed to avoid locking mutex in wrong order
      storage/maria/ha_maria.h:
        Added flag to ha_maria::info() to signal if we need to lock table share or not.
      storage/maria/ma_close.c:
        Destroy key_del_lock
        Simplify freeing ftparser_param
      storage/maria/ma_key.c:
        Better comment
      storage/maria/ma_loghandler.c:
        Mark mutex used inconsistently (need to be fixed by sanja)
      storage/maria/ma_state.c:
        More comments
      storage/maria/ma_test1.c:
        Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
      storage/maria/ma_test2.c:
        Ensure that safe_mutex_deadlock_detector is always on (should be, this is just for safety)
      32f81bab
  20. 15 Oct, 2008 1 commit
    • Guilhem Bichot's avatar
      Small fixes for pushbuild: compiler warnings, checking that partitioning is... · 5aa1e3b3
      Guilhem Bichot authored
      Small fixes for pushbuild: compiler warnings, checking that partitioning is enabled when testing it.
      Don't fsync() index file when closing Maria table if not transactional.
      
      mysql-test/suite/maria/r/maria.result:
        piece moved
      mysql-test/suite/maria/r/maria_partition.result:
        result
      mysql-test/suite/maria/t/maria.test:
        - reset default storage engine at end of test, not in the middle
        - move piece which requires partitioning, to maria_partition.test, otherwise test fails
        on builds without partitioning compiled in
      mysql-test/suite/maria/t/maria_partition.test:
        new test for those Maria bugs which are specific of partitioning
      mysys/my_uuid.c:
        compiler warning fix (fix imported from latest 5.1-main)
      storage/maria/ma_close.c:
        don't fsync() index file when closing table if not transactional
        (same test as in _ma_once_end_block_record() when fsync-ing data file)
      storage/maria/ma_create.c:
        compiler warning fix (char* assigned to uchar*)
      storage/maria/ma_loghandler.c:
        compiler warning fix (char* assigned to uchar*)
      5aa1e3b3
  21. 14 Oct, 2008 1 commit
    • Guilhem Bichot's avatar
      _ma_bitmap_unpin_all() needs to unpin not-locked pages which were pinned by other threads · 8ecda6cd
      Guilhem Bichot authored
      in write_changed_bitmap(), and page cache forbids that. Here we make the page
      cache more relaxed. Original patch by Sanja, simplified by me as limited to
      not-locked. See comment of ma_bitmap.c.
      With that, maria_stress.yy runs until hitting BUG 39665.
      
      storage/maria/ma_bitmap.c:
        A thread which unpins bitmap pages in _ma_bitmap_unpin_all() sometimes
        hit an assertion in the page cache (info!=0 in remove_pin()) which states
        that you can unpin/unlock only what *you* have pinned/locked.
        Fixed by setting the new last parameter of pagecache_unlock_by_link()
        to TRUE in _ma_bitmap_unpin_all().
      storage/maria/ma_blockrec.c:
        new prototype and splitting assertion in three (3rd one fires: BUG 39665)
      storage/maria/ma_check.c:
        new prototype
      storage/maria/ma_key_recover.c:
        new prototype
      storage/maria/ma_loghandler.c:
        new prototype
      storage/maria/ma_pagecache.c:
        Allow a thread to unpin, with pagecache_unlock_by_link(), a non-locked page pinned by others.
        This is a hack for _ma_bitmap_unpin_all() which needs to unpin pages which were
        pinned by other threads in write_changed_bitmap().
      storage/maria/ma_pagecache.h:
        new prototype
      storage/maria/ma_preload.c:
        new prototype
      storage/maria/unittest/ma_pagecache_rwconsist.c:
        new prototype
      storage/maria/unittest/ma_pagecache_single.c:
        new prototype
      8ecda6cd
  22. 25 Aug, 2008 1 commit
    • Michael Widenius's avatar
      Changed all file names in maria to LEX_STRING and removed some calls to strlen() · 1a5de5bc
      Michael Widenius authored
      Ensure that pagecache gives correct error number even if error for block happend
      
      
      mysys/my_pread.c:
        Indentation fix
      storage/maria/ha_maria.cc:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_check.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_checkpoint.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_create.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_dbug.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_delete.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_info.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_keycache.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_locking.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_loghandler.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_open.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_pagecache.c:
        Store error number for last failed operation in the page block
        This should fix some asserts() when errno was not properly set after failure to read block in another thread
      storage/maria/ma_recovery.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_update.c:
        filenames changed to be of type LEX_STRING
      storage/maria/ma_write.c:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_def.h:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_ftdump.c:
        filenames changed to be of type LEX_STRING
      storage/maria/maria_pack.c:
        filenames changed to be of type LEX_STRING
      1a5de5bc
  23. 04 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      compiler warnings · 83472904
      Sergei Golubchik authored
      trnman: remove old lockman code
      trnman: replace trid_to_committed_trn hash with trid_to_trn
      
      storage/maria/ma_blockrec.c:
        compiler warnings
      storage/maria/ma_loghandler.c:
        compiler warnings
      storage/maria/ma_write.c:
        compiler warnings
      storage/maria/trnman.c:
        remove old lockman code
        replace trid_to_committed_trn hash with trid_to_trn
      storage/maria/trnman.h:
        remove old lockman code
        replace trid_to_committed_trn hash with trid_to_trn
      storage/maria/unittest/ma_test_loghandler-t.c:
        compiler warnings
      storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
        compiler warnings
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        compiler warnings
      83472904
  24. 22 Jul, 2008 1 commit
    • unknown's avatar
      Fix for BUG#37737. · 8783b60a
      unknown authored
      Fixed prev_last_lsn assignment.
      
      storage/maria/ma_loghandler.c:
        Fix for BUG#37737:
         - buffer flush finish now can be done only in order
         - overlay processing fixed (no back direction bufferslocking now)
        Fixed prev_last_lsn assignment (now only for new buffer and only under buffer lock protection).
      8783b60a
  25. 09 Jul, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#37876 "Importing Maria table from other server via binary copy does not work": · 60b88ce4
      Guilhem Bichot authored
      - after auto-zerofill (ha_maria::check_and_repair()) kepts its state's LSNs unchanged, which could
      be the same as the create_rename_lsn of another pre-existing table, which would break versioning as this LSN
      serves as unique identifier in the versioning code (in maria_open()). Even the state pieces which
      maria_zerofill() did change were lost (because they didn't go to disk).
      - after this fix, if two tables were auto-zerofilled at the same time (by _ma_mark_changed())
      they could receive the same create_rename_lsn, which would break versioning again. Fix is to write a log
      record each time a table is imported.
      - Print state's LSNs (create_rename_lsn, is_of_horizon, skip_redo_lsn) and UUID in maria_chk -dvv.
      
      mysql-test/r/maria-autozerofill.result:
        result
      mysql-test/t/maria-autozerofill.test:
        Test for auto-zerofilling
      storage/maria/ha_maria.cc:
        The state changes done by auto-zerofilling never reached disk.
      storage/maria/ma_check.c:
        When zerofilling a table, including its pages' LSNs, new state LSNs are needed next time the table
        is imported into a Maria instance.
      storage/maria/ma_create.c:
        Write LOGREC_IMPORTED_TABLE when importing a table. This is informative and ensures
        that the table gets a unique create_rename_lsn even though multiple tables
        are imported by concurrent threads (it advances the log's end LSN).
      storage/maria/ma_key_recover.c:
        comment
      storage/maria/ma_locking.c:
        instead of using translog_get_horizon() for state's LSNs of imported table,
        use the LSN of to-be-written LOGREC_IMPORTED_TABLE.
      storage/maria/ma_loghandler.c:
        New type of log record
      storage/maria/ma_loghandler.h:
        New type of log record
      storage/maria/ma_loghandler_lsn.h:
        New name for constant as can be used not only by maria_chk but auto-zerofill now too.
      storage/maria/ma_open.c:
        instead of using translog_get_horizon() for state's LSNs of imported table,
        use the LSN of to-be-written LOGREC_IMPORTED_TABLE.
      storage/maria/ma_recovery.c:
        print content of LOGREC_IMPORTED_TABLE in maria_read_log.
      storage/maria/maria_chk.c:
        print info about LSNs of the table's state, and UUID, when maria_chk -dvv
      storage/maria/maria_pack.c:
        new name for constant
      storage/maria/unittest/ma_test_recovery.pl:
        Now that maria_chk -dvv shows state LSNs and UUID those need to be filtered out,
        as maria_read_log -a does not use the same as at original run.
      60b88ce4
  26. 26 Jun, 2008 2 commits
    • unknown's avatar
      Fixed maria-big test failure. · 7b8d4af1
      unknown authored
      storage/maria/ma_loghandler.c:
        Processed case when current buffer filled but there is no new LSN in the buffer generated (so it is no need to fluesh this buffer) and buffer->last_lsn is LSN_IMPOSSIBLE.
      7b8d4af1
    • Michael Widenius's avatar
      Added versioning of Maria index · 52cb0c24
      Michael Widenius authored
      Store max_trid in index file as state.create_trid. This is used to pack all transids in the index pages relative to max possible transid for file.
      Enable versioning for transactional tables with index. Tables with an auto-increment key, rtree or fulltext keys are not versioned.
      Changed info->lastkey to type MARIA_KEY. Removed info->lastkey_length as this is now part of info->lastkey
      Renamed old info->lastkey to info->lastkey_buff
      Use exact key lenghts for keys, not USE_WHOLE_KEY
      For partial key searches, use SEARCH_PART_KEY
      When searching to insert new key on page, use SEARCH_INSERT to mark that key has rowid
      
      Changes done in a lot of files:
      - Modified functions to use MARIA_KEY instead of key pointer and key length
      - Use keyinfo->root_lock instead of share->key_root_lock[keynr]
      - Simplify code by using local variable keyinfo instead if share->keyinfo[i]
      - Added #fdef EXTERNAL_LOCKING around removed state elements
      - HA_MAX_KEY_BUFF -> MARIA_MAX_KEY_BUFF (to reserve space for transid)
      - Changed type of 'nextflag' to uint32 to ensure all SEARCH_xxx flags fits into it
      
      .bzrignore:
        Added missing temporary directory
      extra/Makefile.am:
        comp_err is now deleted on make distclean
      include/maria.h:
        Added structure MARIA_KEY, which is used for intern key objects in Maria.
        Changed functions to take MARIA_KEY as an argument instead of pointer to packed key.
        Changed some functions that always return true or false to my_bool.
        Added virtual function make_key() to avoid if in _ma_make_key()
        Moved rw_lock_t for locking trees from share->key_root_lock to MARIA_KEYDEF. This makes usage of the locks simpler and faster
      include/my_base.h:
        Added HA_RTREE_INDEX flag to mark rtree index. Used for easier checks in ma_check()
        Added SEARCH_INSERT to be used when inserting new keys
        Added SEARCH_PART_KEY for partial searches
        Added SEARCH_USER_KEY_HAS_TRANSID to be used when key we use for searching in btree has a TRANSID
        Added SEARCH_PAGE_KEY_HAS_TRANSID to be used when key we found in btree has a transid
      include/my_handler.h:
        Make next_flag 32 bit to make sure we can handle all SEARCH_ bits
      mysql-test/include/maria_empty_logs.inc:
        Read and restore current database; Don't assume we are using mysqltest.
        Don't log use databasename to log. Using this include should not cause any result changes.
      mysql-test/r/maria-gis-rtree-dynamic.result:
        Updated results after adding some check table commands to help pinpoint errors
      mysql-test/r/maria-mvcc.result:
        New tests
      mysql-test/r/maria-purge.result:
        New result after adding removal of logs
      mysql-test/r/maria-recovery-big.result:
        maria_empty_logs doesn't log 'use mysqltest' anymore
      mysql-test/r/maria-recovery-bitmap.result:
        maria_empty_logs doesn't log 'use mysqltest' anymore
      mysql-test/r/maria-recovery-rtree-ft.result:
        maria_empty_logs doesn't log 'use mysqltest' anymore
      mysql-test/r/maria-recovery.result:
        maria_empty_logs doesn't log 'use mysqltest' anymore
      mysql-test/r/maria.result:
        New tests
      mysql-test/r/variables-big.result:
        Don't log id as it's not predictable
      mysql-test/suite/rpl_ndb/r/rpl_truncate_7ndb_2.result:
        Updated results to new binlog results. (Test has not been run in a long time as it requires --big)
      mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2-master.opt:
        Moved file to ndb replication test directory
      mysql-test/suite/rpl_ndb/t/rpl_truncate_7ndb_2.test:
        Fixed wrong path to included tests
      mysql-test/t/maria-gis-rtree-dynamic.test:
        Added some check table commands to help pinpoint errors
      mysql-test/t/maria-mvcc.test:
        New tests
      mysql-test/t/maria-purge.test:
        Remove logs to make test results predictable
      mysql-test/t/maria.test:
        New tests for some possible problems
      mysql-test/t/variables-big.test:
        Don't log id as it's not predictable
      mysys/my_handler.c:
        Updated function comment to reflect old code
        Changed nextflag to be uint32 to ensure we can have flags > 16 bit
        Changed checking if we are in insert with NULL keys as next_flag can now include additional bits that have to be ignored.
        Added SEARCH_INSERT flag to be used when inserting new keys in btree. This flag tells us the that the keys includes row position and it's thus safe to remove SEARCH_FIND
        Added comparision of transid. This is only done if the keys actually have a transid, which is indicated by nextflag
      mysys/my_lock.c:
        Fixed wrong test (Found by Guilhem)
      scripts/Makefile.am:
        Ensure that test programs are deleted by make clean
      sql/rpl_rli.cc:
        Moved assignment order to fix compiler warning
      storage/heap/hp_write.c:
        Add SEARCH_INSERT to signal ha_key_cmp that we we should also compare rowid for keys
      storage/maria/Makefile.am:
        Remove also maria log files when doing make distclean
      storage/maria/ha_maria.cc:
        Use 'file->start_state' as default state for transactional tables without versioning
        At table unlock, set file->state to point to live state. (Needed for information schema to pick up right number of rows)
        In ha_maria::implicit_commit() move all locked (ie open) tables to new transaction. This is needed to ensure ha_maria->info doesn't point to a deleted history event.
        Disable concurrent inserts for insert ... select and table changes with subqueries if statement based replication as this would cause wrong results on slave
      storage/maria/ma_blockrec.c:
        Updated comment
      storage/maria/ma_check.c:
        Compact key pages (removes transid) when doing --zerofill
        Check that 'page_flag' on key pages contains KEYPAGE_FLAG_HAS_TRANSID if there is a single key on the page with a transid
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Use new interface to _ma_rec_pos(), _ma_dpointer(), _ma_ft_del(), ma_update_state_lsn()
        Removed not needed argument from get_record_for_key()
        Fixed that we check doesn't give errors for RTREE; We now treath these like SPATIAL
        Remove some SPATIAL specific code where the virtual functions can handle this in a general manner
        Use info->lastkey_buff instead of info->lastkey
        _ma_dpos() -> _ma_row_pos_from_key()
        _ma_make_key() -> keyinfo->make_key()
        _ma_print_key() -> _ma_print_keydata()
        _ma_move_key() -> ma_copy_copy()
        Add SEARCH_INSERT to signal ha_key_cmp that we we should also compare rowid for keys
        Ensure that data on page doesn't overwrite page checksum position
        Use DBUG_DUMP_KEY instead of DBUG_DUMP
        Use exact key lengths instead of USE_WHOLE_KEY to ha_key_cmp()
        Fixed check if rowid points outside of BLOCK_RECORD data file
        Use info->lastkey_buff instead of key on stack in some safe places
        Added #fdef EXTERNAL_LOCKING around removed state elements
      storage/maria/ma_close.c:
        Use keyinfo->root_lock instead of share->key_root_lock[keynr]
      storage/maria/ma_create.c:
        Removed assert that is already checked in maria_init()
        Force transactinal tables to be of type BLOCK_RECORD
        Fixed wrong usage of HA_PACK_RECORD (should be HA_OPTION_PACK_RECORD)
        Mark keys that uses HA_KEY_ALG_RTREE with HA_RTREE_INDEX for easier handling of these in ma_check
        Store max_trid in index file as state.create_trid. This is used to pack all transids in the index pages relative to max possible transid for file.
      storage/maria/ma_dbug.c:
        Changed _ma_print_key() to use MARIA_KEY
      storage/maria/ma_delete.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        info->lastkey2-> info->lastkey_buff2
        Added SEARCH_INSERT to signal ha_key_cmp that we we should also compare rowid for keys
        Use new interface for get_key(), _ma_get_last_key() and others
        _ma_dpos() -> ma_row_pos_from_key()
        Simplify setting of prev_key in del()
        Ensure that KEYPAGE_FLAG_HAS_TRANSID is set in page_flag if key page has transid
        Treath key pages that may have a transid as if keys would be of variable length
      storage/maria/ma_delete_all.c:
        Reset history state if maria_delete_all_rows() are called
        Update parameters to _ma_update_state_lsns() call
      storage/maria/ma_extra.c:
        Store and restore info->lastkey
      storage/maria/ma_ft_boolean_search.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_ft_nlq_search.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Use lastkey_buff2 instead of info->lastkey+info->s->base.max_key_length (same thing)
      storage/maria/ma_ft_update.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_ftdefs.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_fulltext.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_init.c:
        Check if blocksize is legal
        (Moved test here from ma_open())
      storage/maria/ma_key.c:
        Added functions for storing/reading of transid 
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Moved _ma_sp_make_key() out of _ma_make_key() as we now use keyinfo->make_key to create keys
        Add transid to keys if table is versioned
        Added _ma_copy_key()
      storage/maria/ma_key_recover.c:
        Add logging of page_flag (holds information if there are keys with transid on page)
        Changed DBUG_PRINT("info" -> DBUG_PRINT("redo" as the redo logging can be quite extensive
        Added lots of DBUG_PRINT()
        Added support for index page operations: KEY_OP_SET_PAGEFLAG and KEY_OP_COMPACT_PAGE
      storage/maria/ma_key_recover.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_locking.c:
        Added new arguments to _ma_update_state_lsns_sub()
      storage/maria/ma_loghandler.c:
        Fixed all logging of LSN to look similar in DBUG log
        Changed if (left != 0) to if (left) as the later is used also later in the code
      storage/maria/ma_loghandler.h:
        Added new index page operations
      storage/maria/ma_open.c:
        Removed allocated "state_dummy" and instead use share->state.common for transactional tables that are not versioned
        This is needed to not get double increments of state.records (one in ma_write.c and on when log is written)
        Changed info->lastkey to MARIA_KEY type
        Removed resetting of MARIA_HA variables that have 0 as default value (as info is zerofilled)
        Enable versioning for transactional tables with index. Tables with an auto-increment key, rtree or fulltext keys are not versioned.
        Check on open that state.create_trid is correct
        Extend share->base.max_key_length in case of transactional table so that it can hold transid
        Removed 4.0 compatible fulltext key mode as this is not relevant for Maria
        Removed old and wrong #ifdef ENABLE_WHEN_WE_HAVE_TRANS_ROW_ID code block
        Initialize all new virtual function pointers
        Removed storing of state->unique, state->process and store state->create_trid instead
      storage/maria/ma_page.c:
        Added comment to describe key page structure
        Added functions to compact key page and log the compact operation
      storage/maria/ma_range.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Use SEARCH_PART_KEY indicator instead of USE_WHOLE_KEY to detect if we are doing a part key search
        Added handling of pages with transid
      storage/maria/ma_recovery.c:
        Don't assert if table we opened are not transactional. This may be a table which has been changed from transactional to not transactinal
        Added new arguments to _ma_update_state_lsns()
      storage/maria/ma_rename.c:
        Added new arguments to _ma_update_state_lsns()
      storage/maria/ma_rkey.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Don't use USE_WHOLE_KEY, use real length of key
        Use share->row_is_visible() to test if row is visible
        Moved search_flag == HA_READ_KEY_EXACT out of 'read-next-row' loop as this only need to be tested once
        Removed test if last_used_keyseg != 0 as this is always true
      storage/maria/ma_rnext.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Simplify code by using local variable keyinfo instead if share->keyinfo[i]
        Use share->row_is_visible() to test if row is visible
      storage/maria/ma_rnext_same.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        lastkey2 -> lastkey_buff2
      storage/maria/ma_rprev.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Simplify code by using local variable keyinfo instead if share->keyinfo[i]
        Use share->row_is_visible() to test if row is visible
      storage/maria/ma_rsame.c:
        Updated comment
        Simplify code by using local variable keyinfo instead if share->keyinfo[i]
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_rsamepos.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_rt_index.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Use better variable names
        Removed not needed casts
        _ma_dpos() -> _ma_row_pos_from_key()
        Use info->last_rtree_keypos to save position to key instead of info->int_keypos
        Simplify err: condition
        Changed return type for maria_rtree_insert() to my_bool as we are only intressed in ok/fail from this function
      storage/maria/ma_rt_index.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_rt_key.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Simplify maria_rtree_add_key by combining idenitcal code and removing added_len
      storage/maria/ma_rt_key.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_rt_mbr.c:
        Changed type of 'nextflag' to uint32
        Added 'to' argument to RT_PAGE_MBR_XXX functions to more clearly see which variables changes value
      storage/maria/ma_rt_mbr.h:
        Changed type of 'nextflag' to uint32
      storage/maria/ma_rt_split.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        key_length -> key_data_length to catch possible errors
      storage/maria/ma_rt_test.c:
        Fixed wrong comment
        Reset recinfo to avoid valgrind varnings
        Fixed wrong argument to create_record() that caused test to fail
      storage/maria/ma_search.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Added support of keys with optional trid
        Test for SEARCH_PART_KEY instead of USE_WHOLE_KEY to detect part key reads
        _ma_dpos() -> _ma_row_pos_from_key()
        If there may be keys with transid on the page, have _ma_bin_search() call _ma_seq_search()
        Add _ma_skip_xxx() functions to quickly step over keys (faster than calling get_key() in most cases as we don't have to copy key data)
        Combine similar code at end of _ma_get_binary_pack_key()
        Removed not used function _ma_move_key()
        In _ma_search_next() don't call _ma_search() if we aren't on a nod page.
        Update info->cur_row.trid with trid for found key
        
        
        
        Removed some not needed casts
        Added _ma_trid_from_key()
        Use MARIA_SHARE instead of MARIA_HA as arguments to _ma_rec_pos(), _ma_dpointer() and _ma_xxx_keypos_to_recpos() to make functions faster and smaller
      storage/maria/ma_sort.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_sp_defs.h:
        _ma_sp_make_key() now fills in and returns (MARIA_KEY *) value
      storage/maria/ma_sp_key.c:
        _ma_sp_make_key() now fills in and returns (MARIA_KEY *) value
        Don't test sizeof(double), test against 8 as we are using float8store()
        Use mi_float8store() instead of doing swap of value (same thing but faster)
      storage/maria/ma_state.c:
        maria_versioning() now only calls _ma_block_get_status() if table supports versioning
        Added _ma_row_visible_xxx() functions for different occasions
        When emptying history, set info->state to point to the first history event.
      storage/maria/ma_state.h:
        Added _ma_row_visible_xxx() prototypes
      storage/maria/ma_static.c:
        Indentation changes
      storage/maria/ma_statrec.c:
        Fixed arguments to _ma_dpointer() and _ma_rec_pos()
      storage/maria/ma_test1.c:
        Call init_thr_lock() if we have versioning
      storage/maria/ma_test2.c:
        Call init_thr_lock() if we have versioning
      storage/maria/ma_unique.c:
        Modified functions to use MARIA_KEY
      storage/maria/ma_update.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
      storage/maria/ma_write.c:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Simplify code by using local variable keyinfo instead if share->keyinfo[i]
        In _ma_enlarge_root(), mark in page_flag if new key has transid
        _ma_dpos() -> _ma_row_pos_from_key()
        Changed return type of _ma_ck_write_tree() to my_bool as we are only testing if result is true or not
        Moved 'reversed' to outside block as area was used later
      storage/maria/maria_chk.c:
        Added error if trying to sort with HA_BINARY_PACK_KEY
        Use new interface to get_key() and _ma_dpointer()
        _ma_dpos() -> _ma_row_pos_from_key()
      storage/maria/maria_def.h:
        Modified functions to use MARIA_KEY instead of key pointer and key length
        Added 'common' to MARIA_SHARE->state for storing state for transactional tables without versioning
        Added create_trid to MARIA_SHARE
        Removed not used state variables 'process' and 'unique'
        Added defines for handling TRID's in index pages
        Changed to use MARIA_SHARE instead of MARIA_HA for some functions
        Added 'have_versioning' flag if table supports versioning
        Moved key_root_lock from MARIA_SHARE to MARIA_KEYDEF
        Changed last_key to be of type MARIA_KEY. Removed lastkey_length
        lastkey -> lastkey_buff, lastkey2 -> lastkey_buff2
        Added _ma_get_used_and_nod_with_flag() for faster access to page data when page_flag is read
        Added DBUG_DUMP_KEY for easier DBUG_DUMP of a key
        Changed 'nextflag' and assocaited variables to uint32
      storage/maria/maria_ftdump.c:
        lastkey -> lastkey_buff
      storage/maria/trnman.c:
        Fixed wrong initialization of min_read_from and max_commit_trid
        Added trnman_get_min_safe_trid()
      storage/maria/unittest/ma_test_all-t:
        Added --start-from
      storage/myisam/mi_check.c:
        Added SEARCH_INSERT, as ha_key_cmp() needs it when doing key comparision for inserting key on page in rowid order
      storage/myisam/mi_delete.c:
        Added SEARCH_INSERT, as ha_key_cmp() needs it when doing key comparision for inserting key on page in rowid order
      storage/myisam/mi_range.c:
        Updated comment
      storage/myisam/mi_write.c:
        Added SEARCH_INSERT, as ha_key_cmp() needs it when doing key comparision for inserting key on page in rowid order
      storage/myisam/rt_index.c:
        Fixed wrong parameter to rtree_get_req() which could cause crash
      52cb0c24
  27. 12 Jun, 2008 1 commit
  28. 10 Jun, 2008 1 commit
    • unknown's avatar
      Fixed non-debug build. · 7c87c307
      unknown authored
      storage/maria/ma_loghandler.c:
        Now we need buffer number to set dirty buffers mask.
      7c87c307
  29. 09 Jun, 2008 1 commit
    • unknown's avatar
      WL#4401 "Maria - deserialize translog_flush() calls" · 3967b6cf
      unknown authored
      storage/maria/ma_loghandler.c:
        New flush procedure added.
      storage/maria/unittest/Makefile.am:
        Test of many multi-thread flush added
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Test of many multi-thread flush added
      3967b6cf
  30. 02 Jun, 2008 1 commit
    • Guilhem Bichot's avatar
      WL#4374 "Maria - force start if Recovery fails multiple times" · a5bcb63f
      Guilhem Bichot authored
      http://forge.mysql.com/worklog/task.php?id=4374
      new option --maria-force-start-after-recovery-failures=N; number of consecutive recovery failures (failures
      of log reading or recovery processing, anything in [translog_init(),maria_recovery_from_log()])
      is stored in the control file; if at a Maria start they are more than N, logs are removed. This is for automated
      systems which have to run whatever happens. As tables risk staying corrupted, --maria-recover should also
      be used on them: this revision makes maria-recover work (it was disabled).
      Fixed bug in translog_is_log_files(). translog_init() now prints message to error log if failed.
      Removed \0 in the output of SHOW ENGINE MARIA LOGS; removed hard-coded engine name there.
      
      KNOWN_BUGS.txt:
        As option --maria-force-start-after-recovery-failures is added, it corresponds to the wish "we should fix that if this happens etc".
        LOAD INDEX is not ignored since a few weeks. Listed concurrency bugs have been fixed some time ago.
        Recovery of fulltext and GIS indexes works since a few weeks.
      mysql-test/include/maria_make_snapshot.inc:
        configurable prefix in table's name (so far 't' or 't_corrupted')
      mysql-test/include/maria_make_snapshot_for_comparison.inc:
        configurable prefix in table's name (so far 't' or 't_corrupted')
      mysql-test/include/maria_make_snapshot_for_feeding_recovery.inc:
        configurable prefix in table's name (so far 't' or 't_corrupted')
      mysql-test/include/maria_verify_recovery.inc:
        configurable prefix in table's name (so far 't' or 't_corrupted')
      mysql-test/lib/mtr_report.pl:
        new test maria-recover.test generates expected corruption warnings in the error log. maria-recovery.test's corrupted table is renamed to t_corrupted1 instead of t1.
      mysql-test/r/maria-preload.result:
        result update. maria_pagecache_read* values are similar to the previous version of this file, though a bit bigger
        because using the information_schema and the join leads to some internal maria temp table being used, and thus some
        blocks of it being read.
      mysql-test/r/maria-purge.result:
        engine's name in SHOW ENGINE MARIA LOGS changed.
      mysql-test/r/maria-recover.result:
        result for new test. We see corruption messages at first SELECT and then none at second SELECT, expected.
      mysql-test/r/maria-recovery.result:
        result update
      mysql-test/r/maria.result:
        new variables show up
      mysql-test/t/disabled.def:
        BUG#34911 is not fixed but the test had been made independent of the bug (workaround). A new bug (crash) has popped recently, so it has to stay
        disabled (BUG#35107).
      mysql-test/t/maria-preload.test:
        Work around BUG#34911 "FLUSH STATUS doesn't flush what it should":
        compute differences in status variables before and after relevant queries
      mysql-test/t/maria-recover-master.opt:
        test --maria-recover
      mysql-test/t/maria-recover.test:
        Test of the --maria-recover option (build a corrupted table and see if it is auto-repaired)
      mysql-test/t/maria-recovery-big.test:
        update for new API of include/maria*.inc
      mysql-test/t/maria-recovery-bitmap.test:
        update for new API of include/maria*.inc
      mysql-test/t/maria-recovery.test:
        update for new API of include/maria*.inc. Corrupted table t1 renamed to t_corrupted1, so that mtr_report.pl
        does not blindly remove all corruption messages for t1 which is
        a common name.
      storage/maria/ha_maria.cc:
        Enabling maria-recover.
        Adding option and global variable --maria_force_start_after_recovery_failures: ha_maria_init()
        calls mark_recovery_start() and mark_recovery_success() to keep track of failed consecutive recoveries
        and remove logs if needed.
        Removed \0 in the output of SHOW ENGINE MARIA LOGS; removed hard-coded engine name there.
      storage/maria/ma_checkpoint.c:
        new prototype
      storage/maria/ma_control_file.c:
        Storing in one byte in the control file, the number of consecutive recovery failures.
      storage/maria/ma_control_file.h:
        new prototype
      storage/maria/ma_init.c:
        new prototype
      storage/maria/ma_locking.c:
        Need to update open_count on disk at first write and close for transactional tables, like we already did for
        non-transactional tables, otherwise we cannot notice that the table is dubious.
      storage/maria/ma_loghandler.c:
        translog_is_log_files() is made more generic to serve either to search or to delete logs (the latter is
        for --maria-force-start-after-recovery-failures). It also had a bug (always returned FALSE).
      storage/maria/ma_loghandler.h:
        export function because ha_maria::mark_recovery_start() needs it
      storage/maria/ma_recovery.c:
        changing name of maria_recover() to distinguish from the maria-recover option.
      storage/maria/ma_recovery.h:
        changing name of maria_recover() to distinguish from the maria-recover option.
      storage/maria/ma_test_force_start.pl:
        Test of --maria-force-start-after-recovery-failures (and also, to be realistic, of --maria-recover).
        This is standalone because mysql-test-run does not support testing that multiple mysqld restarts expectedly failed.
        I'll have to run it on my machine and also on a Windows machine.
      storage/maria/unittest/ma_control_file-t.c:
        adding recovery_failures to the test
      storage/maria/unittest/ma_test_loghandler_multigroup-t.c:
        fix for compiler warning (unused variable in non-debug build)
      a5bcb63f
  31. 22 Apr, 2008 1 commit
    • unknown's avatar
      Fixed bugs related to huge records where group list do not · bc31f005
      unknown authored
        fit in on one page (many chunks type 0 created) (BUG#34695).
      Maria log dump now can read unittest logs.
      
      
      storage/maria/CMakeLists.txt:
        Maria log dump now can read unittest logs.
      storage/maria/Makefile.am:
        Maria log dump now can read unittest logs.
      storage/maria/unittest/sequence_storage.c:
        New BitKeeper file ``storage/maria/unittest/sequence_storage.c''
      storage/maria/unittest/sequence_storage.h:
        New BitKeeper file ``storage/maria/unittest/sequence_storage.h''
      bc31f005
  32. 04 Apr, 2008 1 commit
    • unknown's avatar
      Store maximum transaction id into control file at clean shutdown. · 722a8ebe
      unknown authored
      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
      722a8ebe
  33. 03 Apr, 2008 2 commits
    • unknown's avatar
      Fixed problem switching to the new file is file appeared · de483409
      unknown authored
      to be bigger then limit.
      
      
      de483409
    • unknown's avatar
      Injecting more "const" declarations into code which does not change · f094eff1
      unknown authored
      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
      f094eff1
  34. 23 Mar, 2008 1 commit
  35. 21 Mar, 2008 1 commit
    • unknown's avatar
      Fix for pushbuild problems: innocuous Valgrind error (uninitialized · b8c56780
      unknown authored
      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.
      b8c56780
  36. 08 Mar, 2008 1 commit
    • unknown's avatar
      Maria's usage of my_stat() is unreliable on Windows. (BUG#35036) · 6ec6ae4a
      unknown authored
      %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.
      6ec6ae4a