1. 10 Feb, 2009 2 commits
  2. 09 Feb, 2009 3 commits
    • Guilhem Bichot's avatar
      Callers of translog_deassign_id_from_share() need intern_lock. · 9653feb1
      Guilhem Bichot authored
      Assert that keys don't point to bitmap pages.
      
      storage/maria/ma_blockrec.h:
        assertion
      storage/maria/ma_locking.c:
        With concurrent INSERTs, it is possible that two threads enter _ma_mark_file_changed()
        at the same time, so they should serialize their access to the "changed" state/share
        members; another reason is that this function may call _ma_update_state_lsns_sub()
        which may call translog_deassign_id_from_share() (I saw it during testing of
        online backup) which requires the intern_lock mutex.
        As INSERTs only change from "not changed" to "changed", we can first check without mutex:
        if it says "changed", some other thread has set or is setting the variables now,
        we don't need to do it; if it says "not changed", we serialize and re-check.
      9653feb1
    • Guilhem Bichot's avatar
      Comments. Take bitmap mutex lock when changing bitmap.changed. · 554eb6c2
      Guilhem Bichot authored
      storage/maria/ha_maria.cc:
        comment
      storage/maria/ma_checkpoint.c:
        comment
      storage/maria/ma_extra.c:
        use bitmap mutex when changing bitmap.changed, sounds safer
      storage/maria/ma_pagecache.c:
        comment
      storage/maria/ma_recovery.c:
        comments
      554eb6c2
    • Guilhem Bichot's avatar
      merge with latest 5.1-maria · 790fbc56
      Guilhem Bichot authored
      790fbc56
  3. 06 Feb, 2009 1 commit
  4. 05 Feb, 2009 1 commit
  5. 04 Feb, 2009 2 commits
  6. 01 Feb, 2009 1 commit
    • Michael Widenius's avatar
      Fixes Bug #40711 "Maria crash in my_no_flags_free" · f0da84c3
      Michael Widenius authored
      storage/maria/ma_close.c:
        Reset state_history when closing file.
        This fixes a race condition when the checkpoint is using the file while the file is beeing closed.
        The bug was that checkpoint was accessing the freed state_history.
      f0da84c3
  7. 26 Jan, 2009 2 commits
  8. 19 Jan, 2009 1 commit
  9. 16 Jan, 2009 7 commits
    • Sergei Golubchik's avatar
      merged · e3da48ba
      Sergei Golubchik authored
      e3da48ba
    • Sergei Golubchik's avatar
      bug#41963 Maria: error_simulation and subselect_debug fail · 141a75fa
      Sergei Golubchik authored
      added a missing DBUG_VOID_RETURN
      141a75fa
    • Guilhem Bichot's avatar
      merge · 92c42182
      Guilhem Bichot authored
      92c42182
    • Guilhem Bichot's avatar
      Fix for BUG#42112 "Maria: recovery failure (pushbuild2) Assertion `rownr == 0 && new_page' failed" · 3907cb1d
      Guilhem Bichot authored
      mysql-test/suite/maria/r/maria-recovery3.result:
        result update
      mysql-test/suite/maria/t/maria-recovery3.test:
        Test for BUG#42112; before the bugfix, recovery would assert like this:
        ma_blockrec.c:6051: _ma_apply_redo_insert_row_head_or_tail: Assertion `rownr == 0 && new_page' failed.
      storage/maria/ma_create.c:
        Fix for BUG#42112; plus some intentional crashes to test the fix. The bug was that if crash happened during
        TRUNCATE TABLE, in maria_create(), after the index file's state has been written but before its LSNs
        have been updated (so, if crash happened between _ma_state_info_write_sub() and _ma_update_state__lsns_sub()),
        then that would leave a table with create_rename_lsn==0. Recovery would then try old pre-TRUNCATE REDOs
        on this table, and fail as this table is already partly shortened. Fix is to write create_rename_lsn==LSN_MAX
        as soon as TRUNCATE touches the index file, so that Recovery ignores this table. This allows Maria to start;
        the table is still corrupted but the user can successfully repeat TRUNCATE TABLE (which required Maria to start).
      storage/maria/ma_delete_all.c:
        A comment.
      3907cb1d
    • Sergei Golubchik's avatar
      mysql-test-run --list-options · 5a6a6c2e
      Sergei Golubchik authored
      5a6a6c2e
    • Sergei Golubchik's avatar
      merged · 60f3a340
      Sergei Golubchik authored
      trnman_get_state/trnman_set_state renamed to trnman_get/set_flags
      TRN::state - to TRN::flags accordingly
      60f3a340
    • 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
  10. 15 Jan, 2009 4 commits
    • 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
    • Sergei Golubchik's avatar
      post-review fixes · 9c96fde1
      Sergei Golubchik authored
      include/atomic/generic-msvc.h:
        prevent possible compiler warnings
      include/lf.h:
        comments, better definition for LF_HASH_OVERHEAD
      include/maria.h:
        define MARIA_CANNOT_ROLLBACK here
      include/my_pthread.h:
        avoid possible name clash
      include/waiting_threads.h:
        comments, const, move WT_RESOURCE to waiting_threads.c
      mysql-test/suite/maria/r/maria_notembedded.result:
        new test
      mysql-test/suite/maria/t/maria_notembedded.test:
        new test - 5-way deadlock
      mysys/lf_hash.c:
        better definition for LF_HASH_OVERHEAD
      mysys/my_static.c:
        comment
      mysys/my_thr_init.c:
        casts
      mysys/waiting_threads.c:
        comments, asserts, etc
      server-tools/instance-manager/parse.cc:
        fix my_init_dynamic_array() to follow new calling conventions
      sql/mysqld.cc:
        call wt_init after set_proper_floating_point_mode
      sql/sql_class.h:
        comment
      storage/maria/ha_maria.cc:
        move MARIA_CANNOT_ROLLBACK to a common header
      storage/maria/ma_commit.c:
        comment
      storage/maria/ma_write.c:
        comments, check for HA_ERR_FOUND_DUPP_KEY
      storage/maria/trnman.c:
        comments, assert
      storage/maria/trnman.h:
        comments
      storage/maria/unittest/trnman-t.c:
        be paranoid
      unittest/mysys/lf-t.c:
        comments
      unittest/mysys/waiting_threads-t.c:
        comments, safety, memory leak
      9c96fde1
    • Guilhem Bichot's avatar
      Fix for BUG#41493 "Maria: two recovery failures (wrong logging of BLOB pages)"... · a955efc4
      Guilhem Bichot authored
      Fix for BUG#41493 "Maria: two recovery failures (wrong logging of BLOB pages)" and some more debugging
      output related to this.
      
      mysql-test/suite/maria/r/maria-recovery3.result:
        result update
      mysql-test/suite/maria/t/maria-recovery3.test:
        Test for bug; before the fix, the "CHECK TABLE EXTENDED" would mention a bad bitmap, because the
        REDO_INSERT_ROW_BLOBS was containing a page number which was actually the one of a tail, so execution of this
        record would mark the tail page as full in bitmap (like if it were a blob page), though it wasn't full.
        Also, the assertion added around ma_blockrec.c:6580 in the present revision fired.
      storage/maria/ma_blockrec.c:
        - fix for BUG#41493: if we found out that logging was not needed at this point (blob_length==0 i.e. tail page),
        then we forgot to increment tmp_block, so in the second iteration (assuming two BLOB columns), we would log the
        page range of the first iteration (i.e. the tail page's number) for this second BLOB, which would cause
        Recovery to overwrite the tail page with the second BLOB.
        - assert when marking the table corrupted during REDO phase; this catches some problems earlier
        otherwise they get caught only when a later record wants to use the table.
        - _ma_apply_redo_insert_row_blobs() now fills some synthetic info about the blobs and pages involved
        in a REDO_INSERT_ROW_BLOBS record, for inclusion into maria_recovery.trace: number of blobs, of ranges,
        first and last page (does not tell about any gaps in the middle, but good enough for now). It also asserts
        that it's not overwriting a tail/head page (which happened in the bug).
      storage/maria/ma_blockrec.h:
        new prototype for _ma_apply_redo_insert_row_blobs
      storage/maria/ma_recovery.c:
        Print info got from _ma_apply_redo_insert_row_blobs() to maria_recovery.trace (so far this file had mentioned
        what head and tail pages a record touched, but not blob pages).
      a955efc4
    • Guilhem Bichot's avatar
      Fix for BUG#42012 "Maria: test maria-recovery2 fails with --embedded" and for simple failures · ae3aaa5e
      Guilhem Bichot authored
      of Maria tests with --big (back-ports from 6.0-maria)
      
      mysql-test/suite/maria/r/maria-big.result:
        result update
      mysql-test/suite/maria/r/maria-recovery-big.result:
        result update
      mysql-test/suite/maria/t/maria-big.test:
        this test didn't work anymore due to changes in 5.1 around max_allowed_packet allowed settings
        (fix back-ported from 6.0-maria)
      mysql-test/suite/maria/t/maria-recovery-big-master.opt:
        this test didn't work anymore due to changes in 5.1 around max_allowed_packet allowed settings
        (fix back-ported from 6.0-maria)
      mysql-test/suite/maria/t/maria-recovery-big.test:
        this test didn't work anymore due to changes in 5.1 around max_allowed_packet allowed settings
        (fix back-ported from 6.0-maria)
      mysql-test/suite/maria/t/maria-recovery2-master.opt:
        Fix for BUG#42012 "Maria: test maria-recovery2 fails with --embedded": file is updated like
        maria-recovery-master.opt had already been in guilhem@mysql.com-20080701204709-pa4megwfvllq3s7g
      ae3aaa5e
  11. 13 Jan, 2009 1 commit
  12. 12 Jan, 2009 1 commit
  13. 09 Jan, 2009 1 commit
    • Michael Widenius's avatar
      Fixed bugs from my latest patch found by pushbuild: · 7dc83c50
      Michael Widenius authored
      Bug #41962 Maria: view-related test failures (insert, view, maria, trigger tests)
      Added error handling for wrong update of view.
      See Bug #41760 Inserting into multiple-table views is not working
      
      mysql-test/r/delayed.result:
        Fixed test as we are now testing values before fields.
        Added new tests to test all error combinations
      mysql-test/suite/maria/r/maria.result:
        Added error handling for not supported update of view.
      mysql-test/suite/maria/t/maria.test:
        Added error handling for not supported update of view.
      mysql-test/t/delayed.test:
        Fixed test as we are now testing values before fields.
        Added new tests to test all error combinations
      sql/sql_base.cc:
        Fixed warning from valgrind
      sql/sql_insert.cc:
        Don't test from which table values are in case of INSERT ... SELECT
        Run fix_fields() in values before we do it on fields.
        This is needed becasue check_view_single_update() are accessing values.
      storage/maria/ma_blockrec.c:
        Don't call pagecache_delete_pages() if no pages to delete.
        This fixes a DBUG_ASSERT() error in maria_test_recovery
      7dc83c50
  14. 08 Jan, 2009 1 commit
  15. 07 Jan, 2009 1 commit
  16. 05 Jan, 2009 1 commit
  17. 29 Dec, 2008 1 commit
    • unknown's avatar
      Fixed mutex taking order on recovery of bulk insert. · 4da218f0
      unknown authored
      storage/maria/ma_key_recover.c:
        Takes intern_lock before writing CLR_END of bulk insert.
        Added debug info about writing trigger.
        Check of mutex taken in _ma_state_info_write() where we need it.
      4da218f0
  18. 27 Dec, 2008 1 commit
    • Michael Widenius's avatar
      Fixed bugs found by pushbuild · 910284e6
      Michael Widenius authored
      Added code to detect and give error when doing an insert into a view where we accessed fields in a not yet read table
      Disabled test in subselect.test as the CHECK_OPTION for views doesn't work for insert.
      This needs to be fixed properly later.
      
      The problem with views are described in Bug #41760 Inserting into multiple-table views is not working
      
      mysql-test/r/insert.result:
        Fixed wrong usage of insert into view.
      mysql-test/r/subselect.result:
        Disabled wrong test (temporary)
      mysql-test/suite/maria/r/maria.result:
        Added test of size of table
      mysql-test/suite/maria/t/maria.test:
        Added test of size of table
      mysql-test/t/insert.test:
        Fixed wrong usage of insert into view
        The bug is that during insert/update we currently don't read any of the referenced tables of the view.
        This means that we can't get a value from another table to use as part of the update.
      mysql-test/t/subselect.test:
        Disabled not working test until someone has time to fix insert into view properly
        Here we where refering to last used value in t2, which is wrong.
      sql/sql_insert.cc:
        Detect if we are trying to update one table in a view based on value in another, not yet read, table.
        This fixes the problem discovered in insert.test
      storage/maria/ma_blockrec.c:
        Don't ignore not critical changes to the last page in the table.
        We need to write the last page as otherwise we can during aborting of a row with a duplicate key get
        state.data_file_length and the real length of file out of sync
      storage/maria/ma_check.c:
        Flush the page cache even if we got an error during zerofill.
        (This fixes a call to assert() in case of a too short data file)
      storage/maria/ma_pagecache.c:
        Mark page as read when we do a write of a full page.
        This fixes a bug when we got an error during read and then used direct write to page to update it
      storage/maria/ma_state.c:
        Restore info->lock.type after call to maria_versioning.
        Fixed crash in maria_recover.test
      storage/maria/maria_read_log.c:
        Don't write thread id in debug log. (Not needed as maria_read_log is a single treaded program)
      910284e6
  19. 23 Dec, 2008 1 commit
  20. 22 Dec, 2008 3 commits
    • Michael Widenius's avatar
      3ef5b1fd
    • Michael Widenius's avatar
      3ecbee7c
    • Michael Widenius's avatar
      Fix for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test: · 86fcfb15
      Michael Widenius authored
      Fixed bug when removing a newly inserted record (in case of duplicate key).
      The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
      Don't change state_history if nothing changed (speed optimization that also simplifies logic).
      Reset state_history if we added/deleted or updated rows without versioning.
      Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
      
      Other bugs fixed:
      Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT.
      Item_equal::update_used_tables() didn't calculate const_item_cache properly.
      Added assert's to detect if join_read_const_table() was called under wrong assumptions..
      Fixed that _ma_setup_live_state() is called from thr_lock() instead of handler::external_lock().
      This was needed to get versioning information to be setup correctly.
      Fixed error in debug binaries during a call to _ma_check_table_is_closed() when another thread was opening/closing a table.
      Fixed wrong test when finding right history_state to use.
      
      mysql-test/suite/maria/r/maria.result:
        Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
      mysql-test/suite/maria/t/maria.test:
        Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
      mysys/thr_lock.c:
        Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT
      sql/item_cmpfunc.cc:
        Item_equal::update_used_tables() didn't calculate const_item_cache properly, which later caused a wrong result for item->const_item()
      sql/sql_base.cc:
        In debug mode, Initilize record buffer with unexpected data to catch usage of uninitialized memory
      sql/sql_select.cc:
        Fixed indentation
        Added assert's to detect if join_read_const_table() was called under wrong assumptions.
        One assert() is disabled for now as Item_equal() doesn't behave as expected.
      storage/maria/ha_maria.cc:
        Move calling to _ma_setup_live_state() to ma_state.c::_ma_block_get_status()
        This was needed as _ma_setup_live_state() needed to know if the table will be used concurrently or not
      storage/maria/ma_blockrec.c:
        Fixed bug when removing a newly inserted record (in case of duplicate key).
        The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
      storage/maria/ma_dbug.c:
        Added mutex to protect the open table list during _ma_check_table_is_closed().
        Without the protection we could get a error in debug binaries during a call to _ma_check_table_is_closed()
      storage/maria/ma_delete_table.c:
        Removed not used code
      storage/maria/ma_rename.c:
        Removed not used code
      storage/maria/ma_state.c:
        Fixed wrong test when finding right history_state to use
        Mark in tables->state_current.no_transid if we are using transid's or not.
        Don't change state_history if nothing changed (speed optimization that also simplifies logic)
        Reset state_history if we added/deleted or updated rows without versioning.
        More DBUG_ASSERT's and more DBUG
        Updated maria_versioning() to initialize environment before calling _ma_blok_get_status(). This was needed because of the new logic in _ma_block_get_status()
      storage/maria/ma_state.h:
        Added flags to detect if table changed and/or if we changed table without versioning
      storage/maria/ma_write.c:
        Simple cleanups (No logic changes)
      storage/maria/trnman.c:
        Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
      86fcfb15
  21. 15 Dec, 2008 1 commit
  22. 10 Dec, 2008 3 commits