1. 01 Sep, 2008 1 commit
  2. 31 Aug, 2008 2 commits
  3. 30 Aug, 2008 2 commits
  4. 29 Aug, 2008 3 commits
  5. 28 Aug, 2008 2 commits
    • Sergei Golubchik's avatar
      merge · 7b97a8ad
      Sergei Golubchik authored
      7b97a8ad
    • Sergei Golubchik's avatar
      wt: comments, OOM checks, test case for deadlock detection · b0870404
      Sergei Golubchik authored
      include/waiting_threads.h:
        make wt_thd_dontwait private
      mysql-test/r/maria.result:
        deadlock example
      mysql-test/t/maria.test:
        deadlock example
      mysys/waiting_threads.c:
        comments, OOM checks
      sql/mysqld.cc:
        fix variables
      sql/sql_class.cc:
        move wt_lazy_init to THD constructor
      sql/sql_class.h:
        move wt_lazy_init to THD constructor
      storage/maria/ha_maria.cc:
        backport from 6.0
      storage/maria/ma_write.c:
        poset-review fixes, set thd->proc_info
      storage/maria/trnman.c:
        bugfixing
      storage/myisam/mi_check.c:
        warnings
      storage/myisam/mi_page.c:
        warnings
      storage/myisam/mi_search.c:
        warnings
      storage/myisammrg/myrg_create.c:
        warnings
      unittest/mysys/waiting_threads-t.c:
        fixes
      b0870404
  6. 27 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      proc_info_hook, mysys access to thd->proc_info · 0005df9e
      Sergei Golubchik authored
      include/my_global.h:
        move __func__ definition to my_global.h
      include/my_sys.h:
        proc_info_hook
      mysys/my_static.c:
        proc_info_hook
      sql/mysqld.cc:
        proc_info_hook
      sql/sql_class.cc:
        support thd==0 in set_thd_proc_info
      sql/sql_profile.cc:
        move __func__ definition to my_global.h
      sql/sql_profile.h:
        move __func__ definition to my_global.h
      0005df9e
  7. 26 Aug, 2008 1 commit
    • Michael Widenius's avatar
      Fix for Bug#36499 Maria: potential deadlock · 3cc4babd
      Michael Widenius authored
      This was done by introducing another mutex for handling the key_del link
      I also renamed all key_del variables to start with key_del prefix
      
      
      storage/maria/ma_close.c:
        Rename of key_del variables
      storage/maria/ma_key_recover.c:
        Changed key_del to be protexted by it's own mutex: key_del_lock
        Rename of key_del variables
        Removed comment for old bug
      storage/maria/ma_key_recover.h:
        Rename of key_del variables
      storage/maria/ma_open.c:
        Initialization for new key_del_lock mutex
        Renamed intern_cond to key_del_cond as it was only used for protection of key_del
      storage/maria/ma_page.c:
        Rename of key_del variables
      storage/maria/ma_write.c:
        Rename of key_del variables
      storage/maria/maria_def.h:
        Rename of key_del variables
        Added key_del_lock
      3cc4babd
  8. 25 Aug, 2008 4 commits
    • Michael Widenius's avatar
      Fixed some wrong usage of my_bool · a3af9a78
      Michael Widenius authored
      Fixed compiler warning
      Ensure that pagecache returns correct error number
      
      
      storage/maria/ma_pagecache.c:
        Ensure that block->error contain error code from my_errno (not return value from pread/pwrite)
        Went through usage of my_pread/my_pwrite and ensured that result was threated correctly
        Fixed some wrong usage of my_bool
      a3af9a78
    • Michael Widenius's avatar
      Automatic merge · 8fef39de
      Michael Widenius authored
      8fef39de
    • Michael Widenius's avatar
      Changed all file names in maria to LEX_STRING and removed some calls to strlen() · 42f2e104
      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
      42f2e104
    • Sergei Golubchik's avatar
      BUG#38606: delete in lock write concurrent · 4db7c046
      Sergei Golubchik authored
      (sanja's patch)
      4db7c046
  9. 24 Aug, 2008 1 commit
    • Michael Widenius's avatar
      Fix for bug#38484 DELETE causes crash or index corruption · c34d4579
      Michael Widenius authored
      There is no test cases as it's not trivial to do a test case for this.
      The new code for Maria is however executed by the test case in the bug report.
      
      mysql-test/mysql-test-run.pl:
        Avoid warnings when running with --extern
      storage/maria/ha_maria.cc:
        Disable not complete assert until Sanja can push a proper fix
      storage/maria/ma_delete.c:
        Fix that pageflag for page is calculated based on original values
      storage/maria/ma_search.c:
        Ensure that prev_length structure variable is properly reset when not used
      storage/myisam/mi_search.c:
        Ensure that prev_length structure variable is properly reset when not used
      c34d4579
  10. 18 Aug, 2008 2 commits
    • Michael Widenius's avatar
      Automatic merge · a4a53b3f
      Michael Widenius authored
      a4a53b3f
    • Michael Widenius's avatar
      Fixes for Bug #38016 Maria: trying to access freed memory when committing a transaction · fe816e0b
      Michael Widenius authored
      Don't write out states if they haven't changed
      
      sql/sql_base.cc:
        Call extra(HA_EXTRA_PREPARE_FOR_DROP) before doing a drop of a table
        More DBUG
      sql/sql_table.cc:
        Call extra(HA_EXTRA_PREPARE_FOR_RENAME) before renaming a table
      storage/maria/ha_maria.cc:
        Ensure that file->trn is set when we call extra(HA_EXTRA_PREPARE_FOR_DROP/RENAME)
      storage/maria/ma_close.c:
        When doing close, assert if we have pointers in trn->table_list that points to the MARIA_SHARE
      storage/maria/ma_extra.c:
        Reset info->state_start in case of drop/rename. This fixes the problem of accessing freed memory in repair
        Don't write state changed if they haven't changed
      storage/maria/ma_open.c:
        Reset share->changed after we have written out a state (speed optimization to not write states when they haven't changed)
      storage/maria/ma_state.c:
        Decrement share->in_trans properly in DBUG_BINARY to ensure that the DBUG_ASSERT() in maria_close() works
        More DBUG
      fe816e0b
  11. 16 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      Bug#38466 maria: range query returns no data · cd5e02f9
      Sergei Golubchik authored
      storage/maria/ma_search.c:
        when we found a matching key on the node page and want to search in the left leaf
        we must use only SEARCH_FIND flag, and never SEARCH_BIGGER, SEARCH_SMALLER, or SEARCH_LAST
      cd5e02f9
  12. 11 Aug, 2008 1 commit
  13. 08 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      wt_thd_lazy_init(), per-thread deadlock search depths and timeouts · 98990a07
      Sergei Golubchik authored
      mysys/array.c:
        lazy alloc in dynamic array
      sql-common/client.c:
        for dynamic array, specify init_alloc==alloc_increment explicitly
      sql/mysqld.cc:
        per-thread deadlock search depths and timeouts
      sql/set_var.cc:
        per-thread deadlock search depths and timeouts
      sql/sql_class.h:
        per-thread deadlock search depths and timeouts
      98990a07
  14. 07 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      move wt* maintainance from maria to the server · 521dd0f2
      Sergei Golubchik authored
      include/waiting_threads.h:
        C_MODE_START/END
      mysys/waiting_threads.c:
        relax the checks - auto init thd in will_wait_for,
        allow to destroy uninited thd (=noop),
        allow a "release" an unexistent resource (=noop),
      sql/sql_class.cc:
        move wt* maintainance from maria to the server.
        do THD::cleanup after ha_close_connection() and plugin_thdvar_cleanup().
      storage/maria/unittest/trnman-t.c:
        update to new prototype
      521dd0f2
  15. 06 Aug, 2008 3 commits
    • Sergei Golubchik's avatar
      fixes for failing test suite · e8b0d677
      Sergei Golubchik authored
      storage/maria/ma_write.c:
        select ... group by ... - take temporary tables into account, they have TRN->pins == 0
      storage/maria/trnman.c:
        one cannot modify TRN->trid, it's a key in the trid_to_trn
        hash, if trid is modified, TRN won't be found (and deleted in
        trnman_free_trn) from the hash.
      e8b0d677
    • Sergei Golubchik's avatar
      maria: deadlock detection when waiting on unique key (useless until we can rollback) · 9423c79b
      Sergei Golubchik authored
      include/my_pthread.h:
        cleanup
      include/waiting_threads.h:
        header guard
      mysys/waiting_threads.c:
        bug - kill strategy were not applied to deadlocks of length 1.
        cast timeout to ulonglong.
      storage/maria/ma_static.c:
        declare WT_RESOURCE_TYPE ma_rc_dup_unique
      storage/maria/ma_write.c:
        deadlock detection when waiting on unique key (useless until we can rollback)
      storage/maria/maria_def.h:
        deadlock detection when waiting on unique key (useless until we can rollback)
      storage/maria/trnman.c:
        use deadlock detector.
        protect state transitions of a TRN with a mutex.
        trnman_trid_to_trn() function.
      storage/maria/trnman.h:
        trnman_trid_to_trn() function
        protect state transitions of a TRN with a mutex
        use deadlock detector.
      storage/maria/trnman_public.h:
        trnman_trid_to_trn()
      9423c79b
    • Sergei Golubchik's avatar
      compiler warnings · 72ffd154
      Sergei Golubchik authored
      72ffd154
  16. 04 Aug, 2008 2 commits
    • Sergei Golubchik's avatar
      wt_thd_cond_timedwait() now allows the list of blockers to change after · 57cf6371
      Sergei Golubchik authored
      wt_thd_will_wait_for() was called. That is a caller doesn't need to hold a
      mutex all the time preventing blockers from releasing a resource.
      57cf6371
    • Sergei Golubchik's avatar
      compiler warnings · 9dc11507
      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
      9dc11507
  17. 02 Aug, 2008 1 commit
  18. 29 Jul, 2008 1 commit
    • Sergei Golubchik's avatar
      WL#3064 - waiting threads - wait-for graph and deadlock detection · cca54d3e
      Sergei Golubchik authored
      client/mysqltest.c:
        compiler warnings
      configure.in:
        remove old tests for unused programs
        disable the use of gcc built-ins if smp assembler atomics were selected explictily.
        add waiting_threads.o to THREAD_LOBJECTS
      include/lf.h:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
        constructor/destructor in lf-alloc
      include/my_pthread.h:
        shuffle set_timespec/set_timespec_nsec macros a bit to be able to fill
        several timeout structures with only one my_getsystime() call
      include/waiting_threads.h:
        waiting threads - wait-for graph and deadlock detection
      mysys/Makefile.am:
        add waiting_threads.c
      mysys/lf_alloc-pin.c:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
        constructor/destructor in lf-alloc
      mysys/lf_hash.c:
        constructor/destructor in lf-alloc
      mysys/my_thr_init.c:
        remember end-of-stack pointer in the mysys_var
      mysys/waiting_threads.c:
        waiting threads - wait-for graph and deadlock detection
      storage/maria/ha_maria.cc:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
      storage/maria/ma_commit.c:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
      storage/maria/trnman.c:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
      storage/maria/trnman_public.h:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
      storage/maria/unittest/trnman-t.c:
        replace the end-of-stack pointer with the pointer to the end-of-stack pointer.
        the latter could be stored in THD (mysys_vars) and updated in pool-of-threads
        scheduler.
      unittest/mysys/Makefile.am:
        add waiting_threads-t
      unittest/mysys/lf-t.c:
        factor out the common code for multi-threaded stress unit tests
        move lf tests to a separate file
      unittest/mysys/my_atomic-t.c:
        factor out the common code for multi-threaded stress unit tests
        move lf tests to a separate file
      unittest/mysys/thr_template.c:
        factor out the common code for multi-threaded stress unit tests
      unittest/mysys/waiting_threads-t.c:
        wt tests
      cca54d3e
  19. 12 Jul, 2008 2 commits
    • Michael Widenius's avatar
      Auto merge · 701795d0
      Michael Widenius authored
      mysql-test/r/maria2.result:
        Manual merge
      701795d0
    • Michael Widenius's avatar
      Fixing bug when using alter table on locked maria table · 03b19409
      Michael Widenius authored
      Reset history when we reenable logging for transactional tables (safety fix)
      
      mysql-test/r/maria2.result:
        New results
      mysql-test/t/maria2.test:
        Added test case for alter table on locked maria table
      mysql-test/valgrind.supp:
        Added suppression rules for warnings in libc / libld
      storage/maria/ma_extra.c:
        Remove table from trnman list if we are going to drop or rename it; We don't want not existing shares in the list when we do commit!
      storage/maria/ma_recovery.c:
        Ensure that info->state don't point to history event when we disable logging for a table;  This is needed as alter table will first do commit and then unlock, which would cause us to access a non existing object when we reenable logging.
        Reset history when we reenable logging (safety fix)
      storage/maria/ma_state.c:
        Do less work when share->now_transactional is not set. (Safety fix)
        Added function to remove shares to be deleted from trnman->used_tables
        Added function to reset history to current context
      storage/maria/ma_state.h:
        Prototypes for new function
      03b19409
  20. 11 Jul, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#38018 INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE · 41744ed2
      Guilhem Bichot authored
      used TL_WRITE_CONCURRENT_INSERT though they may update/delete a row. This could cause concurrent SELECTs
      to see a changing table while the SELECT happens, or if the query was made of a group of SELECTs,
      some SELECTs would see different versions of the table. And anyway versioning in Maria was so far coded
      to support only insertions. REPLACE SELECT, INSERT VALUES ON DUPLICATE KEY UPDATE, LOAD DATA REPLACE
      were ok.
      
      mysql-test/r/maria2.result:
        result. Without the code fix, the assertion added to ha_maria::update_row() would fire twice.
      mysql-test/t/maria2.test:
        test when INSERT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE do update rows
      storage/maria/ha_maria.cc:
        Assert that update_row and delete_row never see TL_WRITE_CONCURRENT_INSERT.
        INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE
        must upgrade TL_WRITE_CONCURRENT_INSERT to TL_WRITE because they may update/delete a row.
      41744ed2
  21. 10 Jul, 2008 2 commits
  22. 09 Jul, 2008 5 commits
    • Guilhem Bichot's avatar
      Merge of latest mysql-maria · 28aa03b6
      Guilhem Bichot authored
      28aa03b6
    • Guilhem Bichot's avatar
      Fix for BUG#37873 "Client gets ok from INSERT VALUES before commit record is on disk": · dc0b5534
      Guilhem Bichot authored
      this was true also for INSERT SELECT, UPDATE, DELETE. This fix will be removed when Maria supports COMMIT/ROLLBACK
      ("Maria 2.0"), because then Maria will trans_register_ha() and so participate in ha_commit_trans().
      Without the fix, the assertion added to ha_maria::external_lock() fires many times in *maria*.test.
      
      sql/sql_parse.cc:
        Before sending OK to client, commit transaction in Maria.
      storage/maria/ha_maria.cc:
        Assertion added to external_lock() when committing: OK should not have been sent yet (ACI*D*).
        In ha_maria::implicit_commit(), possibility to not create a new transaction, this is used
        before net_end_statement(), when the next step is close_thread_tables();
        in this use case, ha_maria::implicit_commit() should not commit if under LOCK TABLES.
      storage/maria/ha_maria.h:
        new prototype
      dc0b5534
    • Michael Widenius's avatar
      Fixes for bug#37276: · ffd2cd89
      Michael Widenius authored
      - Fixes key corruption where pages wasn't marked that they contained transid.
      - Fixed bug in block record that could create too small rows when transid was removed. This fixed some asserts() when testing block length
      
      Added --abort-source-on-error to the mysql client. (Very helpfull when debugging wrong .sql files)
      
      client/client_priv.h:
        Added enum for new option to mysql
      client/mysql.cc:
        Added new option --abort-source-on-error to allow one to get 'source' to stop on error. This is 0 by default, to keep old behaviour.
        Print file name and line number when getting an error when doing source filename
      sql/field.cc:
        Removed old dead code
      sql/sql_class.cc:
        Removed old dead code
      storage/maria/ma_blockrec.c:
        Added checking of min block length to check_directory()
        When creating new directory entry, set length to 0; This ensures that the assert checks() on block lengths works properly.
        Added more DBUG_ASSERT() and more calls to check_directory()
        In get_head_or_tail_page(), send in correct min_block_length. This is now safe as the length of new blocks are now 0
      storage/maria/ma_delete.c:
        When moving key to parent page, mark page if key has transid
      storage/maria/ma_write.c:
        Fixed bug where _ma_find_last_pos() didn't set int_key->flag.
        Simpilifed code by unrolling loop.
      ffd2cd89
    • Guilhem Bichot's avatar
      Test for fix made by Monty for BUG#37276 (CHECK TABLE said Invalid key block... · 2fcea810
      Guilhem Bichot authored
      Test for fix made by Monty for BUG#37276 (CHECK TABLE said Invalid key block position: 15731098820608  key
      +# block size: 8192  file_length: 425984). Other corruption cases still not fixed.
      Without the fix, the test would yield the corruption message in CHECK TABLE.
      
      mysql-test/r/maria-big2.result:
        result
      mysql-test/t/maria-big2.test:
        test for bugfix
      2fcea810
    • Guilhem Bichot's avatar
      - lifting a limit: INSERT|REPLACE SELECT and LOAD DATA always prevented... · e7cc9959
      Guilhem Bichot authored
      - lifting a limit: INSERT|REPLACE SELECT and LOAD DATA always prevented versioning, now what do so is if
      the table is empty.
      - lifting another limit: versioning was disabled if table had more than one unique index
      - correcting test of statement-based binlogging, when converting read locks to TL_READ_NO_INSERT
      
      KNOWN_BUGS.txt:
        removing mostly fixed limitation (see ha_maria.cc)
      mysql-test/r/maria-mvcc.result:
        result update
      mysql-test/t/maria-mvcc.test:
        now when table is empty it does not do versioning, so test hung; inserting one row at start of the test,
        to enable versioning.
      sql/sql_parse.cc:
        Maria team wrongly removed this "break", thanks Davi for noticing
      storage/maria/ha_maria.cc:
        - We used to prevent versioning in INSERT/REPLACE SELECT and LOAD DATA, because the index rebuild done by
        bulk insert sometimes, is unsafe when versioning is on. Here we change that: in store_lock(), if the table is empty
        (which is required for index rebuild to be used), we disable versioning; in start_bulk_insert(), we don't do
        index rebuild if versioning is enabled.
        - Test for statement-based binlogging was incomplete: statement-based binlogging is on for this statement
        if binlog is open and statement has binlogging enabled and statement is not doing row-based binlogging
      storage/maria/ma_open.c:
        Monty and I agreed that it's ok to have versioning on a table with more than one unique index: if an INSERT
        hits a duplicate key when inserting the second index' key, no other thread should be able to touch the 
        first index' just-inserted key, because that key has an uncommitted transaction id, so the first thread
        should have time to remove the first index' key.
      e7cc9959