1. 28 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      wt: comments, OOM checks, test case for deadlock detection · 942651ea
      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
      942651ea
  2. 27 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      proc_info_hook, mysys access to thd->proc_info · ca23272e
      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
      ca23272e
  3. 08 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      wt_thd_lazy_init(), per-thread deadlock search depths and timeouts · e2219ec9
      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
      e2219ec9
  4. 07 Aug, 2008 1 commit
    • Sergei Golubchik's avatar
      move wt* maintainance from maria to the server · f8c1059c
      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
      f8c1059c
  5. 06 Aug, 2008 3 commits
    • Sergei Golubchik's avatar
      fixes for failing test suite · 5a4cdba5
      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.
      5a4cdba5
    • Sergei Golubchik's avatar
      maria: deadlock detection when waiting on unique key (useless until we can rollback) · 3971e262
      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()
      3971e262
    • Sergei Golubchik's avatar
      compiler warnings · 7ca3fc4f
      Sergei Golubchik authored
      7ca3fc4f
  6. 04 Aug, 2008 2 commits
    • Sergei Golubchik's avatar
      wt_thd_cond_timedwait() now allows the list of blockers to change after · 651f61fc
      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.
      
      651f61fc
    • 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
  7. 02 Aug, 2008 1 commit
  8. 29 Jul, 2008 1 commit
    • Sergei Golubchik's avatar
      WL#3064 - waiting threads - wait-for graph and deadlock detection · 6ba12f07
      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
      6ba12f07
  9. 12 Jul, 2008 2 commits
    • Michael Widenius's avatar
      Auto merge · 9e762653
      Michael Widenius authored
      mysql-test/r/maria2.result:
        Manual merge
      9e762653
    • Michael Widenius's avatar
      Fixing bug when using alter table on locked maria table · 50fa1eb8
      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
      50fa1eb8
  10. 11 Jul, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#38018 INSERT SELECT ON DUPLICATE KEY UPDATE and LOAD DATA CONCURRENT REPLACE · 6f8b889a
      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.
      6f8b889a
  11. 10 Jul, 2008 2 commits
  12. 09 Jul, 2008 6 commits
    • Guilhem Bichot's avatar
      Merge of latest mysql-maria · 8de480a2
      Guilhem Bichot authored
      8de480a2
    • Guilhem Bichot's avatar
      Fix for BUG#37873 "Client gets ok from INSERT VALUES before commit record is on disk": · 71f72bad
      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
      71f72bad
    • Michael Widenius's avatar
      Fixes for bug#37276: · 7f022824
      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.
      7f022824
    • Guilhem Bichot's avatar
      Test for fix made by Monty for BUG#37276 (CHECK TABLE said Invalid key block... · 942b3879
      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
      942b3879
    • Guilhem Bichot's avatar
      - lifting a limit: INSERT|REPLACE SELECT and LOAD DATA always prevented... · 81d3d3ac
      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.
      81d3d3ac
    • 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
  13. 05 Jul, 2008 2 commits
    • Michael Widenius's avatar
      Automatic merge · f9ef13d5
      Michael Widenius authored
      f9ef13d5
    • Michael Widenius's avatar
      Bug#37276 maria crash on insert around the time check table is run · 82d79389
      Michael Widenius authored
      Fixed several (but not all) issues found by the test program:
      - ASSERT on row_length in ma_blockrec.c::_ma_compact_block_page()
      - Fixed bug when splitting node pages
      - Fixed hang in 'closeing tables' (conflicting mutex order) by ensuring we first take trnman lock and then share->intern_lock
      
      storage/maria/ma_blockrec.c:
        When compacting a row page when allocating space for a new row, the min length of a the new block may be temporarly smaller than 'min_block_length'.
      storage/maria/ma_check.c:
        More DBUG output
      storage/maria/ma_checkpoint.c:
        Call new function _ma_remove_not_visible_states_with_lock() to ensure we first take lock on trnman and then on share->intern_lock
        +
      storage/maria/ma_close.c:
        Added comment
      storage/maria/ma_open.c:
        Added comment
      storage/maria/ma_search.c:
        Copy also node data; Caused bug when splitting node pages
      storage/maria/ma_state.c:
        Added _ma_remove_not_visible_states_with_lock() to ensure we take locks in right order
      storage/maria/ma_state.h:
        Added new prototype
      storage/maria/trnman.c:
        Added trnman_lock() and trnman_unlock().
        Needed by _ma_remove_not_visible_states_with_lock() to get mutex in right order
      storage/maria/trnman_public.h:
        Added new prototypes
      82d79389
  14. 03 Jul, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#35107 "maria-preload.test is disabled because unrepeatable page cache statistics" · 4d48802f
      Guilhem Bichot authored
      What varies accross machine is maria_pagecache_read_requests, but maria_pagecache_reads doesn't and
      is the most interesting (helps verify that disk wasn't touched after preloading), that's all we keep.
      
      mysql-test/r/maria-preload.result:
        unrepeatable variable removed
      mysql-test/t/maria-preload.test:
        unrepeatable variable removed
      storage/maria/ma_test_force_start.pl:
        portability fix for running under Windows
      4d48802f
  15. 02 Jul, 2008 1 commit
  16. 01 Jul, 2008 1 commit
    • Guilhem Bichot's avatar
      Back-port of changes made to 6.0-maria (to remove compiler warnings or fix simple test failures) · 3e37fb35
      Guilhem Bichot authored
      in the last days: substitution in tests has to work for absolute datadir (/dev/shm/...);
      internal temp tables (like information_schema) can be Maria; Maria may not be compiled in; splitting
      too long maria.test in two; mtr --embedded runs in mysql-test not mysql-test/var/master-data
      so we need some absolute paths in tests; can't restart mysqld in --embedded; missing DBUG_VOID_RETURN in
      mysqltest.c (fix from Serg); is_collation_character_set_applicability.test was too long name
      which broke tar's 99-char limit.
      3e37fb35
  17. 30 Jun, 2008 4 commits
    • Guilhem Bichot's avatar
      cutting test in two because it takes many things · 6559f5c2
      Guilhem Bichot authored
      mysql-test/r/maria-recovery.result:
        cutting test in two
      mysql-test/r/maria-recovery2.result:
        cutting test in two
      mysql-test/t/maria-recovery.test:
        cutting test in two
      mysql-test/t/maria-recovery2-master.opt:
        cutting test in two
      mysql-test/t/maria-recovery2.test:
        cutting test in two
      6559f5c2
    • Guilhem Bichot's avatar
      Fix for BUG#37288 "Maria - zerofill corrupts table". Testcase is running... · 24257638
      Guilhem Bichot authored
      Fix for BUG#37288 "Maria - zerofill corrupts table". Testcase is running ma_test_recovery.pl on Windows.
      
      storage/maria/ma_blockrec.c:
        comment
      storage/maria/ma_check.c:
        When zerofilling the data file, _ma_compact_block_page() may increase free space in a
        page so bitmap page needs to be corrected.
      24257638
    • Guilhem Bichot's avatar
      Fix for BUG#35107 "maria-preload.test is disabled because causes assertion". · fdebe278
      Guilhem Bichot authored
      maria-preload will be re-enabled later because other pieces of it have possibly random output.
      
      storage/maria/ma_check.c:
        Fix for BUG#35107 "maria-preload.test is disabled because causes assertion".
      fdebe278
    • Guilhem Bichot's avatar
      Fix for unit test failures. · 0432bc1e
      Guilhem Bichot authored
      storage/maria/ma_test1.c:
        rec_length was too short by one byte: at line 299 memcpy(record,read_record,rec_length) thus didn't copy the
        last byte, so 'record' was not ok for use by update_record(), contained an incomplete blob address, sometimes
        crashed on Itanium.
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Tests failed once, never before for hundreds of times, we don't know if test is correct, disabling.
      0432bc1e
  18. 28 Jun, 2008 5 commits
    • Michael Widenius's avatar
      Disable versioning (concurrent writes) if more than one unique key · f27efe69
      Michael Widenius authored
      The reason for this is that if we change one unique key and then get a failure on the second, we may not be able to rename the first one back before someone else writes the same key value.  In Maria 2.0, when we keep deleted key values in the tree, this will not be a problem anymore
      Fixed typedisable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation
      
      KNOWN_BUGS.txt:
        More comments
      storage/maria/ha_maria.cc:
        Fixed typo (REPLACE -> INSERT)
        Also disable concurrent insert/select for SQLCOM_LOAD as there are problems with concurrent threads during index recreation
      storage/maria/ma_open.c:
        Disable versioning (concurrent writes) if more than one unique key
      f27efe69
    • Michael Widenius's avatar
      Automatic merge · c5805837
      Michael Widenius authored
      Added some minor changes that was done in my tree while waiting for test to run:
      - Remove in Maria T_QUICK when retrying repair for enabling indexes, as the record file may be in use by other threads
      - Disable code that is only relevant for EXTERNAL_LOCKING
      
      include/m_string.h:
        Automatic merge
      storage/maria/ha_maria.cc:
        Remove T_QUICK when retrying repair for enabling indexes, as the record file may be in use by other threads
      storage/maria/ma_check.c:
        Automatic merge
      storage/maria/ma_key.c:
        Automatic merge
      storage/maria/ma_loghandler.c:
        Automatic merge
      storage/maria/ma_open.c:
        Disable code that is only relevant for EXTERNAL_LOCKING
      storage/maria/ma_sp_key.c:
        Automatic merge
      storage/maria/ma_write.c:
        Automatic merge
      storage/maria/trnman.c:
        Automatic merge
      c5805837
    • Michael Widenius's avatar
      Fix for Bug #37007 Maria: different checksum for MyISAM table depending on CHECKSUM=0|1 · d29e7f74
      Michael Widenius authored
      This also adds a check that MyISAM tables with incompatible checksums are detected by CHECK TABLE ... [FOR UPGRADE] and thus also by mysql_upgrade.
      The tables that are incomatible are MyISAM tables with ROW_FORMAT=fixed and has VARCHAR fields and have CHECKSUM enabled.
      Before these tables gave different checksum if you used CHECK TABLE with or without EXTENDED
      
      mysql-test/r/old-mode.result:
        Now we get same results with and without EXTENDED
      mysql-test/r/row-checksum-old.result:
        Initial results
      mysql-test/r/row-checksum.result:
        Initial results
      mysql-test/t/old-mode.test:
        Added test with QUICK to show that the live checksum is not used when running with --old
      mysql-test/t/row-checksum-old-master.opt:
        Start mysqld with --old mode to enable old checksum code
      mysql-test/t/row-checksum-old.test:
        Run row-checksum test under mysqld --old
      mysql-test/t/row-checksum.test:
        Verify that checksum are calculated the same way with and without EXTENDED
        We run this with several storage engines to ensure results are the same over storage engines
      sql/ha_partition.cc:
        Use new HA_HAS_xxx_CHECKSUM flags
      sql/handler.cc:
        Use new HA_HAS_xxx_CHECKSUM flags
      sql/handler.h:
        Split HA_HAS_CHECKSUM into HA_HAS_NEW_CHECKSUM and HA_HAS_OLD_CHECKSUM flags.
        This is a safe API change as only MyISAM and Maria should use these handler flags.
      sql/sql_show.cc:
        Use new HA_HAS_xxx_CHECKSUM flags
      sql/sql_table.cc:
        Use file->checksum() for live checksums if the life checksum method corresponds to the mysqld --old flag
      storage/maria/ha_maria.cc:
        Use new HA_HAS_xxx_CHECKSUM flags
      storage/myisam/ha_myisam.cc:
        Set HA_HAS_OLD_CHECKSUM and/or HA_HAS_NEW_CHECKSUM flags depending on if this is a new myisam or old myisam file
        Add method check_for_upgrade() to detect if the table is of old version with a checksum that is incompatible with CHECK TABLE ... EXTENDED
      storage/myisam/ha_myisam.h:
        Added check_for_upgrade()
      storage/myisam/mi_open.c:
        Removed not neede cast
        Initialize share->has_null_fields and share->has_varchar_fields variables
      storage/myisam/myisamdef.h:
        Added share->has_null_fields and share->has_varchar_fields
      d29e7f74
    • Sergei Golubchik's avatar
    • Michael Widenius's avatar
      Fix for Bug #36578 Maria: maria-recover may fail to autorepair a table · 9f589947
      Michael Widenius authored
      Fixed also some similar issues in MyISAM. This was not noticed before as MyISAM did a second retry without key cache (which just made the second repair attempty slower)
      
      storage/maria/ha_maria.cc:
        Print information if we retry without quick in case of CHECK TABLE table_name QUICK
        Remove T_QUICK flag when retrying repair, but set T_SAFE_REPAIR to ensure we don't loose any rows
        Remember T_RETRY_WITH_QUICK flag when restoring repair flags
        Don't print 'checking table' if we are not checking table in auto-repair
        Don't use T_QUICK in auto repair (safer)
        Changed parameter of type HA_PARAM &param to HA_PARAM *param
      storage/maria/ha_maria.h:
        Changed parameter of type HA_PARAM &param to HA_PARAM *param
      storage/maria/ma_check.c:
        Added retry without T_QUICK if there is a problem reading a row in BLOCK_RECORD
      storage/myisam/ha_myisam.cc:
        Remove T_QUICK flag when retrying repair, but set T_SAFE_REPAIR to ensure we don't loose any rows
        Remember T_RETRY_WITH_QUICK flag when restoring repair flags
      9f589947
  19. 26 Jun, 2008 4 commits
    • unknown's avatar
      merge · 38d024b5
      unknown authored
      38d024b5
    • 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
    • Guilhem Bichot's avatar
      Fixes for build errors under Windows and compiler warning under Linux · f0c53638
      Guilhem Bichot authored
      include/m_string.h:
        new macro like LINT_INIT but for struct. In m_string.h because bzero() becomes available only there
      storage/maria/ma_check.c:
        compiler error under Windows (declaration after statements...)
      storage/maria/ma_key.c:
        trnman.h is not in include/ but in storage/maria
      storage/maria/ma_sp_key.c:
        trnman.h is not in include/ but in storage/maria
      storage/maria/ma_write.c:
        avoid compiler warning (org_key.flag may be used uninitialized)
      f0c53638
    • Michael Widenius's avatar
      Merge; No notable changes · 1d726038
      Michael Widenius authored
      .bzr-mysql/default.conf:
        Automatic merge
      config/ac-macros/plugins.m4:
        Automatic merge
      configure.in:
        Automatic merge
      include/my_global.h:
        Automatic merge
      mysql-test/include/maria_empty_logs.inc:
        Use Guilmhems version, but don't echo use database
      mysql-test/r/maria-no-logging.result:
        Automatic merge
      mysql-test/r/maria-page-checksum.result:
        Automatic merge
      mysql-test/r/maria-recover.result:
        Automatic merge
      mysql-test/r/maria2.result:
        Automatic merge
      mysql-test/t/maria-no-logging.test:
        Automatic merge
      mysql-test/t/maria-page-checksum.test:
        Automatic merge
      mysql-test/t/maria-purge.test:
        Automatic merge
      mysql-test/t/maria-recover.test:
        Automatic merge
      mysql-test/t/maria2.test:
        Automatic merge
      sql/sql_table.cc:
        Automatic merge
      storage/maria/CMakeLists.txt:
        Automatic merge
      storage/maria/ma_ft_parser.c:
        Automatic merge
      storage/maria/ma_loghandler.c:
        Automatic merge
      storage/maria/ma_recovery.c:
        Automatic merge
      storage/maria/ma_rt_test.c:
        Manual merge
      storage/maria/ma_state.c:
        Automatic merge
      storage/maria/ma_test_force_start.pl:
        Automatic merge
      storage/maria/plug.in:
        Automatic merge
      storage/maria/unittest/CMakeLists.txt:
        Automatic merge
      storage/maria/unittest/Makefile.am:
        Automatic merge
      storage/maria/unittest/ma_test_all-t:
        Automatic merge
      storage/maria/unittest/ma_test_loghandler_multithread-t.c:
        Automatic merge
      storage/maria/unittest/ma_test_recovery.pl:
        Automatic merge
      storage/myisam/rt_test.c:
        Automatic merge
      1d726038