1. 20 Jul, 2010 1 commit
    • Calvin Sun's avatar
      Improve InnoDB synchronization primitives on Windows · d3ab61c2
      Calvin Sun authored
      This patch was originally developed by Vladislav Vaintroub.
      The main changes are:
      
       * Use TryEnterCriticalSection in os_fast_mutex_trylock().
       * Use lightweight condition variables on Vista or later Windows;
         but fall back to events on older Windows, such as XP.
      
      This patch also fixes the following bugs:
        bug# 52102 InnoDB Plugin shows performance drop compared to InnoDB
                   on Windows
        bug# 53204 os_fastmutex_trylock is implemented incorrectly on Windows
      
      rb://363 approved by Inaam Rana
      d3ab61c2
  2. 15 Jul, 2010 1 commit
  3. 13 Jul, 2010 1 commit
  4. 08 Jul, 2010 1 commit
  5. 01 Jul, 2010 1 commit
  6. 30 Jun, 2010 3 commits
    • Marko Mäkelä's avatar
      Merge a Bug #54358 error handling correction from mysql-5.1-innodb: · b8dfa772
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3534
      revision-id: marko.makela@oracle.com-20100630093847-7gkr1lh3bh2xksy0
      parent: marko.makela@oracle.com-20100630093149-wmc37t128gic933v
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-06-30 12:38:47 +0300
      message:
        Bug#54358 follow-up: Correct some error handling.
      b8dfa772
    • Marko Mäkelä's avatar
      Merge Bug #54358 comment corrections from mysql-5.1-innodb: · d927bc4b
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3533
      revision-id: marko.makela@oracle.com-20100630093149-wmc37t128gic933v
      parent: marko.makela@oracle.com-20100629131219-pjbkpk5rsqztmw27
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Wed 2010-06-30 12:31:49 +0300
      message:
        Correct some comments that were added in the fix of Bug #54358
        (READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED columns).
      
        Records that lack incompletely written externally stored columns may
        be accessed by READ UNCOMMITTED transaction even without involving a
        crash during an INSERT or UPDATE operation. I verified this as follows.
      
        (1) added a delay after the mini-transaction for writing the clustered
        index 'stub' record was committed (patch attached)
        (2) started mysqld in gdb, setting breakpoints to the where the
        assertions about READ UNCOMMITTED were added in the bug fix
        (3) invoked ibtest3 --create-options=key_block_size=2
        to create BLOBs in a COMPRESSED table
        (4) invoked the following:
        yes 'set transaction isolation level read uncommitted;
        checksum table blobt3;select sleep(1);'|mysql -uroot test
        (5) noted that one of the breakpoints was triggered
        (return(NULL) in btr_rec_copy_externally_stored_field())
      
        === modified file 'storage/innodb_plugin/row/row0ins.c'
        --- storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
        +++ storage/innodb_plugin/row/row0ins.c	2010-06-30 08:17:25 +0000
        @@ -2120,6 +2120,7 @@ function_exit:
         		rec_t*	rec;
         		ulint*	offsets;
         		mtr_start(&mtr);
        +		os_thread_sleep(5000000);
         
         		btr_cur_search_to_nth_level(index, 0, entry, PAGE_CUR_LE,
         					    BTR_MODIFY_TREE, &cursor, 0,
        
        === modified file 'storage/innodb_plugin/row/row0upd.c'
        --- storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
        +++ storage/innodb_plugin/row/row0upd.c	2010-06-30 08:11:55 +0000
        @@ -1763,6 +1763,7 @@ row_upd_clust_rec(
         		rec_offs_init(offsets_);
         
         		mtr_start(mtr);
        +		os_thread_sleep(5000000);
         
         		ut_a(btr_pcur_restore_position(BTR_MODIFY_TREE, pcur, mtr));
         		rec = btr_cur_get_rec(btr_cur);
      d927bc4b
    • Mark Leith's avatar
      Bug#54726 - Inconsistent reporting between mutex and RW lock spin rounds · b2185337
      Mark Leith authored
       - Add round counts to the output for RW s/x locks
      b2185337
  7. 29 Jun, 2010 3 commits
    • Marko Mäkelä's avatar
      Merge Bug#54408 fix from mysql-5.1-innodb: · 93b685f9
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3531
      revision-id: marko.makela@oracle.com-20100629130058-1ilqaj51u9sj9vqe
      parent: marko.makela@oracle.com-20100629125653-t799e5x30h31cvrd
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Tue 2010-06-29 16:00:58 +0300
      message:
        Bug#54408: txn rollback after recovery: row0umod.c:673
        dict_table_get_format(index->table)
      
        The REDUNDANT and COMPACT formats store a local 768-byte prefix of
        each externally stored column. No row_ext cache is needed, but we
        initialized one nevertheless. When the BLOB pointer was zero, we would
        ignore the locally stored prefix as well. This triggered an assertion
        failure in row_undo_mod_upd_exist_sec().
      
        row_build(): Allow ext==NULL when a REDUNDANT or COMPACT table
        contains externally stored columns.
      
        row_undo_search_clust_to_pcur(), row_upd_store_row(): Invoke
        row_build() with ext==NULL on REDUNDANT and COMPACT tables.
      
        rb://382 approved by Jimmy Yang
      93b685f9
    • Marko Mäkelä's avatar
      Merge Bug#54358 fix from mysql-5.1-innodb: · 1e9357f9
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3529
      revision-id: marko.makela@oracle.com-20100629125518-m3am4ia1ffjr0d0j
      parent: jimmy.yang@oracle.com-20100629024137-690sacm5sogruzvb
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Tue 2010-06-29 15:55:18 +0300
      message:
        Bug#54358: READ UNCOMMITTED access failure of off-page DYNAMIC or COMPRESSED
        columns
      
        When the server crashes after a record stub has been inserted and
        before all its off-page columns have been written, the record will
        contain incomplete off-page columns after crash recovery. Such records
        may only be accessed at the READ UNCOMMITTED isolation level or when
        rolling back a recovered transaction in recv_recovery_rollback_active().
        Skip these records at the READ UNCOMMITTED isolation level.
      
        TODO: Add assertions for checking the above assumptions hold when an
        incomplete BLOB is encountered.
      
        btr_rec_copy_externally_stored_field(): Return NULL if the field is
        incomplete.
      
        row_prebuilt_t::templ_contains_blob: Clarify what "BLOB" means in this
        context. Hint: MySQL BLOBs are not the same as InnoDB BLOBs.
      
        row_sel_store_mysql_rec(): Return FALSE if not all columns could be
        retrieved. Previously this function always returned TRUE.  Assert that
        the record is not delete-marked.
      
        row_sel_push_cache_row_for_mysql(): Return FALSE if not all columns
        could be retrieved.
      
        row_search_for_mysql(): Skip records containing incomplete off-page
        columns. Assert that the transaction isolation level is READ
        UNCOMMITTED.
      
        rb://380 approved by Jimmy Yang
      1e9357f9
    • Marko Mäkelä's avatar
      Bug#52199 utf32: mbminlen=4, mbmaxlen=4, type->mbminlen=0, type->mbmaxlen=4 · 717f7bf0
      Marko Mäkelä authored
      Merge and adjust a forgotten change to fix this bug.
      rb://393 approved by Jimmy Yang
        ------------------------------------------------------------------------
        r3794 | marko | 2009-01-07 14:14:53 +0000 (Wed, 07 Jan 2009) | 18 lines
      
        branches/6.0: Allow the minimum length of a multi-byte character to be
        up to 4 bytes. (Bug #35391)
      
        dtype_t, dict_col_t: Replace mbminlen:2, mbmaxlen:3 with mbminmaxlen:5.
        In this way, the 5 bits can hold two values of 0..4, and the storage size
        of the fields will not cross the 64-bit boundary.  Encode the values as
        DATA_MBMAX * mbmaxlen + mbminlen.  Define the auxiliary macros
        DB_MBMINLEN(mbminmaxlen), DB_MBMAXLEN(mbminmaxlen), and
        DB_MINMAXLEN(mbminlen, mbmaxlen).
      
        Try to trim and pad UTF-16 and UTF-32 with spaces as appropriate.
      
        Alexander Barkov suggested the use of cs->cset->fill(cs, buff, len, 0x20).
        ha_innobase::store_key_val_for_row() now does that, but the added function
        row_mysql_pad_col() does not, because it doesn't have the MySQL TABLE object.
      
        rb://49 approved by Heikki Tuuri
        ------------------------------------------------------------------------
      717f7bf0
  8. 28 Jun, 2010 1 commit
  9. 25 Jun, 2010 2 commits
    • Jimmy Yang's avatar
      f92f1b84
    • Sunny Bains's avatar
      Fix bug#54583. This change reverses r1530 by getting rid of a bogus assertion · d45eedec
      Sunny Bains authored
      and clarifies the invariant in dict_table_get_on_id().
        
      In Mar 2007 Marko observed a crash during recovery, the crash resulted from
      an UNDO operation on a system table. His solution was to acquire an X lock on
      the data dictionary, this in hindsight was an overkill. It is unclear what
      caused the crash, current hypothesis is that it was a memory corruption.
        
      The X lock results in performance issues by when undoing changes due to
      rollback during normal operation on regular tables.
        
      Why the change is safe:
      ======================
      The InnoDB code has changed since the original X lock change was made. In the
      new code we always lock the data dictionary in X mode during startup when
      UNDOing operations on the system tables (this is a given). This ensures that
      the crash Marko observed cannot happen as long as all transactions that update
      the system tables follow the standard rules by setting the appropriate DICT_OP
      flag when writing the log records when they make the changes.
        
      If transactions violate the above mentioned rule then during recovery (at
      startup) the rollback code (see trx0roll.c) will not acquire the X lock
      and we will see the crash again.  This will however be a different bug.
      d45eedec
  10. 24 Jun, 2010 5 commits
  11. 23 Jun, 2010 4 commits
    • Marko Mäkelä's avatar
    • Jimmy Yang's avatar
      Merge Bug#54044 fix from mysql-5.1-innodb: · f3f1727c
      Jimmy Yang authored
      ```---------------------------------------------------------
      revno: 3520
      committer: Jimmy Yang <jimmy.yang@oracle.com>
      branch nick: mysql-5.1-innodb
      timestamp: Tue 2010-06-22 19:04:31 -0700
      message:
        Fix bug #54044, Create temporary tables and using innodb crashes. Screen
        out NULL type columns, and return without creating the table.
        
        rb://378 approved by Marko
      ```
      
      ---------------------------------------------------------
      f3f1727c
    • Vasil Dimov's avatar
      Enable InnoDB's UNIV_DEBUG if MySQL's WITH_DEBUG[_FULL] is defined · ace41c96
      Vasil Dimov authored
      This will make PB2 test InnoDB with UNIV_DEBUG on its *_debug platforms
      
      Discussed with:	Marko (on IRC)
      ace41c96
    • Vasil Dimov's avatar
      Merge Bug#47991 fix from mysql-5.1-innodb · 3a1e13d0
      Vasil Dimov authored
        ------------------------------------------------------------
        revno: 3517
        revision-id: vasil.dimov@oracle.com-20100622163043-dc0lxy0byg74viet
        parent: marko.makela@oracle.com-20100621095148-8g73k8k68dpj080u
        committer: Vasil Dimov <vasil.dimov@oracle.com>
        branch nick: mysql-5.1-innodb
        timestamp: Tue 2010-06-22 19:30:43 +0300
        message:
          Fix Bug#47991 InnoDB Dictionary Cache memory usage increases indefinitely
          when renaming tables
          
          Allocate the table name using ut_malloc() instead of table->heap because
          the latter cannot be freed.
          
          Adjust dict_sys->size calculations all over the code.
          
          Change dict_table_t::name from const char* to char* because we need to
          ut_malloc()/ut_free() it.
          
          Reviewed by:	Inaam, Marko, Heikki (rb://384)
          Approved by:	Heikki (rb://384)
        ------------------------------------------------------------
      3a1e13d0
  12. 22 Jun, 2010 3 commits
    • Marko Mäkelä's avatar
      Merge Bug#54686 fix from mysql-5.1-innodb: · 57c876ec
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3517
      revision-id: marko.makela@oracle.com-20100622115215-kxtzx7xuugcxd375
      parent: marko.makela@oracle.com-20100621095148-8g73k8k68dpj080u
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Tue 2010-06-22 14:52:15 +0300
      message:
        Bug#54686 "field->col->mtype == type" assertion error at row/row0sel.c
        ha_innobase::index_read(), ha_innobase::records_in_range(): Check that
        the index is useable before invoking row_sel_convert_mysql_key_to_innobase().
      
        This fix is based on a suggestion by Yasufumi Kinoshita.
      57c876ec
    • Marko Mäkelä's avatar
      buf_flush_insert_in_flush_rbt(), buf_flush_validate_low(): · 909b48cd
      Marko Mäkelä authored
      Silence GCC warnings about dereferencing a type-punned pointer.
      Approved by Jimmy Yang.
      909b48cd
    • Marko Mäkelä's avatar
      dict_load_column_low(): Initialize pos. Improve documentation. · 808e632c
      Marko Mäkelä authored
      Approved by Jimmy Yang.
      808e632c
  13. 21 Jun, 2010 3 commits
    • Inaam Rana's avatar
      Fixes bug#39168. · 4236ba35
      Inaam Rana authored
      Make a call to log_free_check() on all DML paths.
      4236ba35
    • Vladislav Vaintroub's avatar
      Bug#53593: Add some instrumentation to improve Valgrind sensitivity. · 7f2b7cae
      Vladislav Vaintroub authored
      Implement WITH_VALGRIND for the CMake build.
      7f2b7cae
    • Marko Mäkelä's avatar
      Merge Bug #54658 fix from mysql-5.1-innodb: · c9242114
      Marko Mäkelä authored
      ------------------------------------------------------------
      revno: 3515
      revision-id: marko.makela@oracle.com-20100621094008-o9fa153s3f09merw
      parent: vasil.dimov@oracle.com-20100618085155-xnm469cbhedqea96
      committer: Marko Mäkelä <marko.makela@oracle.com>
      branch nick: 5.1-innodb
      timestamp: Mon 2010-06-21 12:40:08 +0300
      message:
        Bug #54658: InnoDB: Warning: allocated tablespace %lu, old maximum was 0
      
        dict_check_tablespaces_and_store_max_id(): Initialize max_space_id
        and fil_system->max_assigned_id from DICT_HDR_MAX_SPACE_ID.
      
        fil_space_create(): Suppress the warning unless !recv_recovery_on
        (do not complain while applying the redo log).
      c9242114
  14. 17 Jun, 2010 7 commits
  15. 15 Jun, 2010 4 commits