1. 16 Oct, 2008 2 commits
    • Guilhem Bichot's avatar
      Fix for BUG#39710 "Maria assertion in maria_disable_non_unique_index". · d80fea03
      Guilhem Bichot authored
      No testcase, this requires concurrency and is automatically tested by
      maria_bulk_insert.yy in pushbuild2.
      
      storage/maria/ha_maria.cc:
        The case of BUG#39710 is:
        two threads want to INSERT SELECT into the same table.
        Thread1 (T1) starts, does external_lock, thr_lock (store_lock sees 0 records so
        upgrades to TL_WRITE), goes into bulk insert, starts writes
        T2 starts, external_lock, thr_lock (store_lock sees 0 records so
        upgrades to TL_WRITE), blocks on existing thr_lock of T1.
        T1 ends writes, ends bulk insert, commits (ha_maria::implicit_commit()
        at end of dispatch_command()), external_lock and thr_unlock
        (close_thread_tables() at end of dispatch_command()).
        T2 wakes up, gets thr_lock, goes into start_bulk_insert() where
        file->state is out-of-date and still says that file->state->records==0,
        so maria_disable_non_unique_index() is called, which asserts because
        the actual number of records (share->state.state.records) is >0.
        The solution, maybe temporary, is to also check share->state.state.records==0
        when deciding to do bulk insert, with the idea that such operation cannot
        rely on the view of the start of the transaction, as it uses repair,
        and can safely read share->state as it has acquired the exclusive
        TL_WRITE.
        Question for reviewer: if we enter the if() branch, do we also need to do:
        *(file->state)= share->state.state;
        or even call some existing function which does that?
      d80fea03
    • Guilhem Bichot's avatar
      Fix for Windows build failure: __attribute__ does not exist under Windows · 943330ee
      Guilhem Bichot authored
      storage/maria/ma_static.c:
        __attribute__ does not exist under Windows, so it can be used only afer my_global.h which defines it to nothing.
      943330ee
  2. 15 Oct, 2008 3 commits
    • Guilhem Bichot's avatar
      Merge of my revision · 23582ace
      Guilhem Bichot authored
      23582ace
    • Guilhem Bichot's avatar
      Small fixes for pushbuild: compiler warnings, checking that partitioning is... · 7b9086e2
      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*)
      7b9086e2
    • Michael Widenius's avatar
      Automatic merge with main tree · 07d488f4
      Michael Widenius authored
      Fixed that mysql-test-run --skip-from starts from the given test
      
      mysql-test/lib/mtr_cases.pl:
        Moved testing of $opt_start_from to mysql-test-run.pl because tests are now run per suite and the old way would rerun not wanted tests
      mysql-test/mysql-test-run.pl:
        Fixed that mysql-test-run --skip-from starts from the given test
      07d488f4
  3. 14 Oct, 2008 4 commits
    • Michael Widenius's avatar
      Merging of changes from myisam -> maria missing in last 5.1 - 5.1->maria merge · 9f670524
      Michael Widenius authored
      MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
      
      include/maria.h:
        Remove MARIA_MAX_MSG_BUF; We are now using HA_MAX_MSG_BUF
        Added maria_test_invalid_symlink
      storage/maria/ha_maria.cc:
        MARIA_MAX_MSG_BUF -> HA_MAX_MSG_BUF
      storage/maria/ma_check.c:
        Removed tab in string constant
        Add extra argument to ma_open_datafile()
      storage/maria/ma_create.c:
        Set error number if table is in use
      storage/maria/ma_open.c:
        Added name argument to open functions for security check if filename is linked to another file in database directory
      storage/maria/ma_static.c:
        Default functions for checking if wrong symlink
      storage/maria/maria_chk.c:
        Add extra argument to _ma_open_datafile()
      storage/maria/maria_def.h:
        Add extra argument to _ma_open_datafile()
      9f670524
    • Guilhem Bichot's avatar
      _ma_bitmap_unpin_all() needs to unpin not-locked pages which were pinned by other threads · dc1607c2
      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
      dc1607c2
    • Guilhem Bichot's avatar
      WL#4595 "Maria - no write-lock when pinning bitmap pages": turns out that page cache · e1c00c8b
      Guilhem Bichot authored
      already supports pin-without-lock so implementation of this WL is instant and
      done here. This could improve concurrency. No testcase, this requires
      multiple threads and is automatically tested at push time by maria_stress.yy (pushbuild2).
      
      storage/maria/ma_bitmap.c:
        As the page cache supports pinning without write-locking, we don't take write lock
        in write_changed_bitmap(), only a pin; this could improve concurrency (WL#4595).
      e1c00c8b
    • Guilhem Bichot's avatar
      Fix for BUG#39210 "Maria deadlock in _ma_bitmap_wait_or_flush". It was a thread · 8cf2e497
      Guilhem Bichot authored
      which nobody woke up (see comment of ma_bitmap.c). No testcase, this requires
      multiple threads and is automatically tested at push time by maria_stress.yy (pushbuild2).
      
      storage/maria/ma_bitmap.c:
        * _ma_bitmap_wait_or_flush() didn't publish that it was waiting for bitmap to not
        be over-allocated (i.e. didn't modify bitmap->flush_all_requested) so nobody
        (_ma_bitmap_flushable(), _ma_bitmap_release_unused()) knew it had to wake it up
        => it stalled (BUG#39210). In fact the wait in _ma_bitmap_wait_or_flush()
        is not needed, it's ok if this function sends the over-allocated bitmap to page
        cache and keeps pin on it (_ma_bitmap_unpin_all() will unpin it later, and
        the one who added _ma_bitmap_wait_or_flush() didn't know it). Function
        is thus deleted, as _ma_bitmap_flush() can do its job.
        * After fixing that, test runs longer and BUG 39665 happens, which looks like
        a separate page cache bug.
        * Smaller changes: _ma_bitmap_flush_all() called write_changed_bitmap() even
        though it might not be changed; added some DBUG calls in functions; split
        assertions.
        * In _ma_bitmap_release_unused(), it's more logical to test non_flushable_state
        than now_transactional to know if we have to decrement non_flushable
        (it's exactly per the definition of non_flushable_state).
      storage/maria/ma_blockrec.c:
        _ma_bitmap_wait_or_flush() is not needed.
        ******
        new prototype and splitting assertion in three (3rd one fires: BUG 39665)
      storage/maria/ma_blockrec.h:
        _ma_bitmap_wait_or_flush() is not needed.
      8cf2e497
  4. 12 Oct, 2008 1 commit
    • Michael Widenius's avatar
      Fix for bug#39226 Maria: crash with FLUSH TABLES WITH READ LOCK after LOCK TABLES · 11050e99
      Michael Widenius authored
      - The problem was that we didn't inform the handler that we are going to close tables that are locked and may have (at least in Maria) be part of an active transaction.
      Fix for Bug#39227 Maria: crash with ALTER TABLE PARTITION
      Fix for Bug #39987 main.partition_not_windows fails under debug build
      Fixed some compiler errors & warnings found by pushbuild
      
      include/my_base.h:
        Added HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for signaling the handler that the file will be forced closed
      include/my_global.h:
        Removed 'register' from 'swap_variables' as this gives a warnings when the variables are structs. Compilers should also now be smart enough to figure out this themselves
      mysql-test/r/subselect_debug.result:
        Reset value of the debug variable;  Without setting this the subselect_innodb test will fail when run after this one
      mysql-test/suite/maria/r/maria.result:
        Merged test with myisam.test
        Added tests for new fixed bugs
      mysql-test/suite/maria/t/maria.test:
        Merged test with myisam.test
        Added tests for new fixed bugs
      mysql-test/t/subselect_debug.test:
        Reset value of the debug variable;  Without setting this the subselect_innodb test will fail when run after this one
      mysys/my_uuid.c:
        Fixed compiler error on windows
      sql/ha_partition.cc:
        Added support for the new extra flag: HA_EXTRA_PREPARE_FOR_FORCED_CLOSE (Bug #39226)
        Ensure that we call extra() for HA_EXTRA_PREPARE_FOR_DROP (Bug#39227)
      sql/mysqld.cc:
        Fix for Bug #39987 main.partition_not_windows fails under debug build
        The problem was that when compiling for purify/valgrind realpath() is not used, which causes test_if_data_home_dir to fail when it shouldn't
      sql/sql_base.cc:
        Call HA_EXTRA_PREPARE_FOR_FORCED_CLOSE for tables that are locked but we are going to force close without doing a commit
      sql/sql_parse.cc:
        More DBUG_PRINT. Fixed comments
      storage/maria/ma_extra.c:
        If HA_EXTRA_PREPARE_FOR_FORCED_CLOSE is called and the table is part of a transaction, remove the table from beeing part of a transaction.
        This is safe as this is only used as part of flush tables or when the table is not part of a transaction
      storage/myisam/mi_open.c:
        Indentation fix
      unittest/mysys/waiting_threads-t.c:
        Remove not needed 'volatile' to get rid of compiler warnings on windows
      11050e99
  5. 11 Oct, 2008 2 commits
  6. 10 Oct, 2008 1 commit
  7. 09 Oct, 2008 1 commit
    • Guilhem Bichot's avatar
      Fix for BUG#39697 "Maria: hang when failing to insert due to UNIQUE (seen in pushbuild2 too)" · 395ff6d0
      Guilhem Bichot authored
      It was a forgotten rw_unlock(), due to the deadlock detector feature (so bug was only in 5.1-maria, not
      6.0-maria).
      
      mysql-test/suite/maria/r/maria3.result:
        result, all fine
      mysql-test/suite/maria/t/maria3.test:
        Test of BUG#39697: two scenarios (transactional tables, and non-transactional table but dynamic row format so still taking the rwlock) where the hang happened.
        t2 added by this test was masked by a temporary table created earlier in the test, which we forgot to drop.
      storage/maria/ha_maria.cc:
        use new macro
      storage/maria/ma_blockrec.c:
        use new macro
      storage/maria/ma_commit.c:
        use new macro
      storage/maria/ma_init.c:
        putting address of dummy_transaction_object in --debug trace can be useful
      storage/maria/ma_open.c:
        use new macro
      storage/maria/ma_write.c:
        if local_lock_tree is true, we have acquired keyinfo->root_lock so need to release it before "goto err".
        A pair of assertions so that our usage of TrIDs is kept sensible.
      storage/maria/maria_def.h:
        A macro so that changes of MARIA_HA::trn can be tracked with --debug. It helped to understand in what cases,
        in maria_write(), we could have !(info->dup_key_trid == info->trn->trid) && !share->now_transactional
        (answer: ALTER TABLE adding UNIQUE index on transactional table).
      395ff6d0
  8. 07 Oct, 2008 2 commits
  9. 01 Oct, 2008 3 commits
    • Sergei Golubchik's avatar
      merged · d18d5364
      Sergei Golubchik authored
      d18d5364
    • Sergei Golubchik's avatar
      Implement conditional building correctly. · d1a2e16e
      Sergei Golubchik authored
      automake *must* know all sources in advance, listing a file in EXTRA_DIST
      doesn't make it a source, which breakes dependency tracking
      (.Po files aren't included)
      d1a2e16e
    • unknown's avatar
      Maria tests moved to separate suite. The suite made default for execution. · 17d54f33
      unknown authored
      mysql-test/mysql-test-run.pl:
        The maria suite made default for execution.
      mysql-test/suite/maria:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-autozerofill.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-big.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-big2.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-connect.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-gis-rtree-dynamic.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-gis-rtree-trans.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-gis-rtree.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-mvcc.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-no-logging.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-page-checksum.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-preload.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-purge.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recover.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recovery-big.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recovery-bitmap.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recovery-rtree-ft.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recovery.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria-recovery2.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria2.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria3.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/maria_notembedded.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/r/ps_maria.result:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-autozerofill.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-big.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-big2.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-connect.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-gis-rtree-dynamic.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-gis-rtree-trans.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-gis-rtree.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-mvcc.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-no-logging.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-page-checksum.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-preload.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-purge.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recover-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recover.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-big-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-big.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-bitmap-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-bitmap.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-rtree-ft-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery-rtree-ft.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery2-master.opt:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria-recovery2.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria2.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria3.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/maria_notembedded.test:
        Maria tests moved to separate suite.
      mysql-test/suite/maria/t/ps_maria.test:
        Maria tests moved to separate suite.
      17d54f33
  10. 28 Sep, 2008 1 commit
    • unknown's avatar
      Comparison of tables during altering fixed. (BUG#39399) · 48e6036c
      unknown authored
      mysql-test/r/maria.result:
        Test suite of BUG#39399.
      mysql-test/t/maria.test:
        Test suite of BUG#39399.
      storage/maria/ha_maria.cc:
        Comparison of tables during altering fixed. (BUG#39399)
        Unused function parameter removed.
      48e6036c
  11. 26 Sep, 2008 2 commits
    • Michael Widenius's avatar
      Fixed for Bug #39248 Maria: INSERT ON DUPLICATE KEY UPDATE gives error if using a view · 11342570
      Michael Widenius authored
      The bug was that prepared statements didn't downgrade TL_WRITE_CONCURRENT properly
      
      mysql-test/r/maria.result:
        Added test case
      mysql-test/t/maria.test:
        Added test case
      sql/mysql_priv.h:
        Make upgrade_lock_type() global
      sql/sql_base.cc:
        Fixed indentation
      sql/sql_insert.cc:
        Make upgrade_lock_type() global
      sql/sql_prepare.cc:
        Call upgrade_lock_type_for_insert() to get right lock to use
      sql/sql_view.cc:
        Indentation fix
      11342570
    • Michael Widenius's avatar
      Fix for Bug #39243 SELECT WHERE does not find row · fac3977a
      Michael Widenius authored
      Symptom was that records_in_range() found 0 matching keys which confused the optimizer to belive that there was no matching rows for the query
      
      mysql-test/r/maria.result:
        New testcase
      mysql-test/t/maria.test:
        New testcase
      storage/maria/ma_search.c:
        Fix bug in skip_key for keys that starts with a CHAR/VARCHAR NULL key.
      fac3977a
  12. 11 Sep, 2008 2 commits
  13. 10 Sep, 2008 4 commits
  14. 09 Sep, 2008 7 commits
    • Ramil Kalimullin's avatar
      Merge · 3363e185
      Ramil Kalimullin authored
      3363e185
    • Ramil Kalimullin's avatar
      Merge · c29da10e
      Ramil Kalimullin authored
      c29da10e
    • Martin Hansson's avatar
      Bug#35600: Auto merged. · da8fecaa
      Martin Hansson authored
      da8fecaa
    • Ramil Kalimullin's avatar
      Fix for bug#37526: asymertic operator <=> in trigger · 835f3528
      Ramil Kalimullin authored
      Problem: <=> operator may return wrong results 
      comparing NULL and a DATE/DATETIME/TIME value.
      
      Fix: properly check NULLs.
      
      
      mysql-test/r/type_datetime.result:
        Fix for bug#37526: asymertic operator <=> in trigger
          - test result.
      mysql-test/t/type_datetime.test:
        Fix for bug#37526: asymertic operator <=> in trigger
          - test case.
      sql/item_cmpfunc.cc:
        Fix for bug#37526: asymertic operator <=> in trigger
          - if is_nulls_eq is TRUE Arg_comparator::compare_datetime() 
        should return 1 only if both arguments are NULL.
      835f3528
    • Mats Kindahl's avatar
      Merging with 5.1-5.1.29-rc · 4fa5cd08
      Mats Kindahl authored
      4fa5cd08
    • Martin Hansson's avatar
      Bug#35600: Security breach via view, I_S table and prepared · 2f9486e4
      Martin Hansson authored
      statement/stored procedure
      
      View privileges are properly checked after the fix for bug no 
      36086, so the method TABLE_LIST::get_db_name() must be used 
      instead of field TABLE_LIST::db, as this only works for tables.
      Bug appears when accessing views in prepared statements.
      
      mysql-test/r/view_grant.result:
        Bug#35600: Extended existing test case.
      mysql-test/t/view_grant.test:
        Bug#35600: Extended existing test result.
      sql/sql_parse.cc:
        Bug#35600: Using method to retrieve database name instead of
        field.
      2f9486e4
    • Mats Kindahl's avatar
      Bug #39106: · 0dcca07f
      Mats Kindahl authored
      SUPER is not required to change binlog format for session
      
      A user without SUPER privileges can change the value of the
      session variable BINLOG_FORMAT, causing problems for a DBA.
      
      This changeset requires a user to have SUPER privileges to
      change the value of the session variable BINLOG_FORMAT, and
      not only the global variable BINLOG_FORMAT.
      
      
      mysql-test/suite/binlog/t/binlog_grant.test:
        Adding test to test grants needed for SQL_LOG_BIN and BINLOG_FORMAT.
      sql/set_var.cc:
        Adding code to check that user has SUPER permission
        needed to change the value of BINLOG_FORMAT.
      sql/set_var.h:
        Adding function sys_var_thd_binlog_format::check()
      0dcca07f
  15. 08 Sep, 2008 4 commits
  16. 05 Sep, 2008 1 commit