1. 03 Feb, 2010 2 commits
    • marko's avatar
      branches/zip: Clean up CHECK TABLE error handling. (Issue #220) · 5c4fe259
      marko authored
      ha_innobase::change_active_index(): Clean up code formatting.
      
      ha_innobase::check(): Incorporate the code from
      row_check_table_for_mysql().  Report errors to the client connection
      instead of writing them to the error log.
      
      row_check_table_for_mysql(): Remove.
      
      row_check_index_for_mysql(): Renamed from row_scan_and_check_index().
      Let the caller initialize prebuilt, and assume that the index is usable.
      
      rb://178 approved by Sunny Bains
      5c4fe259
    • jyang's avatar
      branches/zip: Relax assertion on the number of index defined · 0829a33c
      jyang authored
      in InnoDB must be comparable with that of MySQL to tolerate
      possible dictionary inconsistency. Fix Mantis issue #455,
      "UNIV_DEBUG+ assert ha_innodb.cc:3152 ib_num_index >= 
      mysql_num_index".
      
      rb://248 Approved by Marko.
       
      0829a33c
  2. 01 Feb, 2010 2 commits
    • marko's avatar
    • marko's avatar
      branches/zip: Merge revisions 6471:6538 from branches/5.1: · ae9752c3
      marko authored
        ------------------------------------------------------------------------
        r6488 | sunny | 2010-01-21 02:55:08 +0200 (Thu, 21 Jan 2010) | 2 lines
        Changed paths:
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: Factor out test for bug#44030 from innodb-autoinc.test
        into a separate test/result files.
        ------------------------------------------------------------------------
        r6489 | sunny | 2010-01-21 02:57:50 +0200 (Thu, 21 Jan 2010) | 2 lines
        Changed paths:
           A /branches/5.1/mysql-test/innodb-autoinc-44030.result
           A /branches/5.1/mysql-test/innodb-autoinc-44030.test
      
        branches/5.1: Factor out test for bug#44030 from innodb-autoinc.test
        into a separate test/result files.
        ------------------------------------------------------------------------
        r6492 | sunny | 2010-01-21 09:38:35 +0200 (Thu, 21 Jan 2010) | 1 line
        Changed paths:
           M /branches/5.1/mysql-test/innodb-autoinc-44030.test
      
        branches/5.1: Add reference to bug#47621 in the comment.
        ------------------------------------------------------------------------
        r6535 | sunny | 2010-01-30 00:08:40 +0200 (Sat, 30 Jan 2010) | 11 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
      
        branches/5.1: Undo the change from r6424. We need to return DB_SUCCESS even
        if we were unable to initialize the tabe autoinc value. This is required for
        the open to succeed. The only condition we currently treat as a hard error
        is if the autoinc field instance passed in by MySQL is NULL.
      
        Previously if the table autoinc value was 0 and the next value was requested
        we had an assertion that would fail. Change that assertion and treat a value
        of 0 to mean that the autoinc system is unavailable. Generation of next
        value will now return failure.
      
        rb://237
        ------------------------------------------------------------------------
        r6536 | sunny | 2010-01-30 00:13:42 +0200 (Sat, 30 Jan 2010) | 6 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: Check *first_value everytime against the column max
        value and  set *first_value to next autoinc if it's > col max value.
        ie.  not rely on what is passed in from MySQL.
      
        [49497] Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
        rb://236
        ------------------------------------------------------------------------
        r6537 | sunny | 2010-01-30 00:35:00 +0200 (Sat, 30 Jan 2010) | 2 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: Undo r6536.
        ------------------------------------------------------------------------
        r6538 | sunny | 2010-01-30 00:43:06 +0200 (Sat, 30 Jan 2010) | 6 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: Check *first_value every time against the column max
        value and  set *first_value to next autoinc if it's > col max value.
        ie.  not rely on what is passed in from MySQL.
      
        [49497] Error 1467 (ER_AUTOINC_READ_FAILED) on inserting a negative value
        rb://236
        ------------------------------------------------------------------------
      ae9752c3
  3. 29 Jan, 2010 3 commits
    • sunny's avatar
      branches/zip: Two changes to fix the problem: · 01bb13a3
      sunny authored
      1. First scan the joining transaction's locks and check if no other
      transaction is waiting for a lock held by the joining transaction.
      If no other transaction is waiting then  no deadlock an occur and
      we avoid doing an exhaustive search.
      
      2. Change the direction of the lock traversal from backward to forward.
      Previously we traversed backward from the lock that has to wait, the function
      to that fetched the previous node was very inefficient resulting in O(n^2)
      access to the rec lock list.
      
      Fix Bug #49047 InnoDB deadlock detection is CPU intensive with many locks on a single row.
      
      rb://218
      01bb13a3
    • calvin's avatar
      24a9a459
    • vasil's avatar
      branches/zip: · b4ab7239
      vasil authored
      Extend the comment about row_mysql_handle_errors().
      
      Suggested by:	Heikki
      b4ab7239
  4. 28 Jan, 2010 2 commits
    • jyang's avatar
      branches/zip: Add index translation table to map mysql index · f22c429a
      jyang authored
      number to InnoDB index structure directly. Fix Bug #47622:
      "the new index is added before the existing ones in MySQL,
      but after one in SE".
      
      rb://215, approved by Marko
      f22c429a
    • marko's avatar
      branches/zip: buf_LRU_invalidate_tablespace(): Do not unnecessarily · 4f3d9229
      marko authored
      acquire the block_mutex for every block in the LRU list. Only acquire
      it when holding buf_pool_mutex is not sufficient. This should speed up
      the function and considerably reduce traffic on the memory bus and
      caches.
      
      I noticed this deficiency when working on Issue #157.
      This deficiency popped up again in Issue #449 (Bug #35077),
      which this fix does not fully address.
      
      rb://78 revision 1 approved by Heikki Tuuri.
      4f3d9229
  5. 27 Jan, 2010 1 commit
    • marko's avatar
      branches/zip: Drop temporary tables at startup. · 64671e44
      marko authored
      This addresses the third aspect of Bug #41609.
      
      row_mysql_drop_temp_tables(): New function, to drop all temporary
      tables. These can be distinguished by the least significant bit of
      MIX_LEN. However, we will skip ROW_FORMAT=REDUNDANT tables, because in
      the records for those tables, that bit may be garbage.
      
      recv_recovery_from_checkpoint_finish(): Invoke
      row_mysql_drop_temp_tables().  Normally, if the .frm files for the
      temporary tables exist at startup, MySQL will ask InnoDB to drop the
      temporary tables.  However, if the files are deleted, for instance, by
      the boot scripts of the operating system, the tables would remain in
      the InnoDB data dictionary unless someone digs them up by
      innodb_table_monitor and creates .frm files for dropping the tables.
      
      rb://221 approved by Sunny Bains.
      64671e44
  6. 21 Jan, 2010 1 commit
    • marko's avatar
      branches/zip: buf_page_get_gen(): Obey recv_no_ibuf_operations · 6377f605
      marko authored
      and do not call ibuf_merge_or_delete_for_page() in crash recovery,
      before the redo log has been applied.
      This could cure some hard-to-repeat, hard-to-explain bugs
      related to secondary indexes.
      
      A possible recipe to repeat the bug:
      
      1. update a secondary index leaf page on a compressed table
      2. evict the page from the buffer pool while it is still dirty
      3. ibuf_insert() something for the page
      4. crash
      5. crash recovery; ibuf merge would be done too early,
      before applying redo log to the sec index page or the ibuf pages
      6377f605
  7. 15 Jan, 2010 2 commits
    • calvin's avatar
      branches/zip: fix bug#49396: innodb.innodb-index test fails in · 996e2ff9
      calvin authored
      embedded mode
      
      This is 2nd part of the fix for bug#49396. The 1st part is
      innodb.test. Tested in both embedded mode and normal server mode.
      996e2ff9
    • calvin's avatar
      branches/zip: Merge revisions 6425:6471 from branches/5.1 · 20b55b55
      calvin authored
      to pick up the first part fix of bug49396.
      
          ------------------------------------------------------------------------
          r6471 | calvin | 2010-01-15 17:43:27 -0600 (Fri, 15 Jan 2010) | 4 lines
      
          branches/5.1: fix bug#49396: main.innodb test fails in embedded mode
      
          Change replace_result by using $MYSQLD_DATADIR. Tested in both embedded
          mode and normal server mode.
          ------------------------------------------------------------------------
      20b55b55
  8. 14 Jan, 2010 2 commits
    • inaam's avatar
      branches/zip rb://226 · 910c08d4
      inaam authored
      log_sys->written_to_all_lsn does not accurately represent the LSN
      upto which write and flush has taken place. Under a race condition
      it can fall behind log_sys->flushed_to_disk_lsn which is accurate.
      Besides written_to_all_lsn is redundant as currently InnoDB supports
      only one log group.
      
      Approved by: Heikki
      910c08d4
    • marko's avatar
      branches/zip: page_copy_rec_list_end(), page_copy_rec_list_start(): · 7eadf3e7
      marko authored
      Update PAGE_MAX_TRX_ID before attempting to compress the page.  This
      fixes Issue #382 (a debug assertion failure in page_zip_reorganize())
      and reduces the generated redo log.  There was no bug or crash in
      non-debug builds.
      7eadf3e7
  9. 13 Jan, 2010 5 commits
  10. 12 Jan, 2010 2 commits
    • marko's avatar
      branches/zip: row_sel_sec_rec_is_for_clust_rec(): Document the return value · 0af43fe4
      marko authored
      more accurately.
      0af43fe4
    • marko's avatar
      branches/zip: Merge revisions 6350:6424 from branches/5.1: · 4fdd498c
      marko authored
        ------------------------------------------------------------------------
        r6421 | jyang | 2010-01-12 07:59:16 +0200 (Tue, 12 Jan 2010) | 8 lines
        Changed paths:
           M /branches/5.1/row/row0mysql.c
      
        branches/5.1: Fix bug #49238: Creating/Dropping a temporary table
        while at 1023 transactions will cause assert. Handle possible
        DB_TOO_MANY_CONCURRENT_TRXS when deleting metadata in
        row_drop_table_for_mysql().
      
        rb://220, approved by Marko
        ------------------------------------------------------------------------
        r6422 | marko | 2010-01-12 11:34:27 +0200 (Tue, 12 Jan 2010) | 3 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/handler/ha_innodb.h
      
        branches/5.1: Non-functional change:
        Make innobase_get_int_col_max_value() a static function.
        It does not access any fields of class ha_innobase.
        ------------------------------------------------------------------------
        r6424 | marko | 2010-01-12 12:22:19 +0200 (Tue, 12 Jan 2010) | 16 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/handler/ha_innodb.h
      
        branches/5.1: In innobase_initialize_autoinc(), do not attempt to read
        the maximum auto-increment value from the table if
        innodb_force_recovery is set to at least 4, so that writes are
        disabled. (Bug #46193)
      
        innobase_get_int_col_max_value(): Move the function definition before
        ha_innobase::innobase_initialize_autoinc(), because that function now
        calls this function.
      
        ha_innobase::innobase_initialize_autoinc(): Change the return type to
        void.  Do not attempt to read the maximum auto-increment value from
        the table if innodb_force_recovery is set to at least 4.  Issue
        ER_AUTOINC_READ_FAILED to the client when the auto-increment value
        cannot be read.
      
        rb://144 by Sunny, revised by Marko
        ------------------------------------------------------------------------
      4fdd498c
  11. 28 Dec, 2009 1 commit
  12. 26 Dec, 2009 1 commit
    • marko's avatar
      branches/zip: ibuf_bitmap_get_map_page(): · 87c59db2
      marko authored
      Define a wrapper macro that passes __FILE__, __LINE__ of the caller
      to buf_page_get_gen().
      This will ease the diagnosis of the likes of Issue #135.
      87c59db2
  13. 22 Dec, 2009 3 commits
    • marko's avatar
      branches/zip: Merge revisions 6206:6350 from branches/5.1, · 08cf3b39
      marko authored
      except r6347, r6349, r6350 which were committed separately
      to both branches, and r6310, which was backported from zip to 5.1.
      
        ------------------------------------------------------------------------
        r6206 | jyang | 2009-11-20 09:38:43 +0200 (Fri, 20 Nov 2009) | 3 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
      
        branches/5.1: Non-functional change, fix formatting.
        ------------------------------------------------------------------------
        r6230 | sunny | 2009-11-24 23:52:43 +0200 (Tue, 24 Nov 2009) | 3 lines
        Changed paths:
           M /branches/5.1/mysql-test/innodb-autoinc.result
      
        branches/5.1: Fix autoinc failing test results.
        (this should be skipped when merging 5.1 into zip)
        ------------------------------------------------------------------------
        r6231 | sunny | 2009-11-25 10:26:27 +0200 (Wed, 25 Nov 2009) | 7 lines
        Changed paths:
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
           M /branches/5.1/row/row0sel.c
      
        branches/5.1: Fix BUG#49032 - auto_increment field does not initialize to last value in InnoDB Storage Engine.
      
        We use the appropriate function to read the column value for non-integer
        autoinc column types, namely float and double.
      
        rb://208. Approved by Marko.
        ------------------------------------------------------------------------
        r6232 | sunny | 2009-11-25 10:27:39 +0200 (Wed, 25 Nov 2009) | 2 lines
        Changed paths:
           M /branches/5.1/row/row0sel.c
      
        branches/5.1: This is an interim fix, fix white space errors.
        ------------------------------------------------------------------------
        r6233 | sunny | 2009-11-25 10:28:35 +0200 (Wed, 25 Nov 2009) | 2 lines
        Changed paths:
           M /branches/5.1/include/mach0data.h
           M /branches/5.1/include/mach0data.ic
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
           M /branches/5.1/row/row0sel.c
      
        branches/5.1: This is an interim fix, fix tests and make read float/double arg const.
        ------------------------------------------------------------------------
        r6234 | sunny | 2009-11-25 10:29:03 +0200 (Wed, 25 Nov 2009) | 2 lines
        Changed paths:
           M /branches/5.1/row/row0sel.c
      
        branches/5.1: This is an interim fix, fix whitepsace issues.
        ------------------------------------------------------------------------
        r6235 | sunny | 2009-11-26 01:14:42 +0200 (Thu, 26 Nov 2009) | 9 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: Fix Bug#47720 - REPLACE INTO Autoincrement column with negative values.
      
        This bug is similiar to the negative autoinc filter patch from earlier,
        with the additional handling of filtering out the negative column values
        set explicitly by the user.
      
        rb://184
        Approved by Heikki.
        ------------------------------------------------------------------------
        r6242 | vasil | 2009-11-27 22:07:12 +0200 (Fri, 27 Nov 2009) | 4 lines
        Changed paths:
           M /branches/5.1/export.sh
      
        branches/5.1:
      
        Minor changes to support plugin snapshots.
        ------------------------------------------------------------------------
        r6306 | calvin | 2009-12-14 15:12:46 +0200 (Mon, 14 Dec 2009) | 5 lines
        Changed paths:
           M /branches/5.1/mysql-test/innodb-autoinc.result
           M /branches/5.1/mysql-test/innodb-autoinc.test
      
        branches/5.1: fix bug#49267: innodb-autoinc.test fails on windows
        because of different case mode
      
        There is no change to the InnoDB code, only to fix test case by
        changing "T1" to "t1".
        ------------------------------------------------------------------------
        r6324 | jyang | 2009-12-17 06:54:24 +0200 (Thu, 17 Dec 2009) | 8 lines
        Changed paths:
           M /branches/5.1/handler/ha_innodb.cc
           M /branches/5.1/include/lock0lock.h
           M /branches/5.1/include/srv0srv.h
           M /branches/5.1/lock/lock0lock.c
           M /branches/5.1/log/log0log.c
           M /branches/5.1/srv/srv0srv.c
           M /branches/5.1/srv/srv0start.c
      
        branches/5.1: Fix bug #47814 - Diagnostics are frequently not
        printed after a long lock wait in InnoDB. Separate out the
        lock wait timeout check thread from monitor information
        printing thread.
      
        rb://200 Approved by Marko.
        ------------------------------------------------------------------------
      08cf3b39
    • marko's avatar
    • marko's avatar
      branches/zip: Merge a change from MySQL: · a3bf31d8
      marko authored
      ------------------------------------------------------------
      revno: 3236
      committer: Satya B <satya.bn@sun.com>
      branch nick: mysql-5.1-bugteam
      timestamp: Tue 2009-12-01 17:48:57 +0530
      message:
        merge to mysql-5.1-bugteam
          ------------------------------------------------------------
          revno: 3234.1.1
          committer: Gleb Shchepa <gshchepa@mysql.com>
          branch nick: mysql-5.1-bugteam
          timestamp: Tue 2009-12-01 14:38:40 +0400
          message:
            Bug #38883 (reopened): thd_security_context is not thread safe, crashes?
      
            manual merge 5.0-->5.1, updating InnoDB plugin.
          ------------------------------------------------------------
          revno: 1810.3968.13
          committer: Gleb Shchepa <gshchepa@mysql.com>
          branch nick: mysql-5.0-bugteam
          timestamp: Tue 2009-12-01 14:24:44 +0400
          message:
            Bug #38883 (reopened): thd_security_context is not thread safe, crashes?
      
            The bug 38816 changed the lock that protects THD::query from
            LOCK_thread_count to LOCK_thd_data, but didn't update the associated
            InnoDB functions.
      
            1. The innobase_mysql_prepare_print_arbitrary_thd and the
            innobase_mysql_end_print_arbitrary_thd InnoDB functions have been
            removed, since now we have a per-thread mutex: now we don't need to wrap
            several inter-thread access tries to THD::query with a single global
            LOCK_thread_count lock, so we can simplify the code.
      
            2. The innobase_mysql_print_thd function has been modified to lock
            LOCK_thd_data in direct way.
      a3bf31d8
  14. 21 Dec, 2009 2 commits
  15. 16 Dec, 2009 2 commits
  16. 15 Dec, 2009 1 commit
  17. 14 Dec, 2009 1 commit
  18. 09 Dec, 2009 2 commits
    • marko's avatar
      branches/zip: row_upd_copy_columns(): Remove redundant code that was · 40e51174
      marko authored
      accidentally added in r1591, which introduced dfield_t::ext in order
      to make the merge sort of fast index creation support externally
      stored columns.
      
      Initially, I tried to allocate the bit for dfield_t::ext from
      dfield_t::len by making the length 31 bits and mapping UNIV_SQL_NULL
      to something that would fit in it.  Then I decided that it would be
      too risky.  The redundant check was part of the mapping.  The
      condition may have been dfield_is_null() initially.
      
      This is similar to the redundant code in row_sel_fetch_columns() that
      was noticed by Sergey Petrunya on the MySQL internals list and removed
      in r6285.  As far as I can tell, there are no redundant UNIV_SQL_NULL
      assignments remaining after this change.
      40e51174
    • marko's avatar
      branches/zip: row_sel_fetch_columns(): Remove redundant code that was · 91729dad
      marko authored
      accidentally added in r1591, which introduced dfield_t::ext in order
      to make the merge sort of fast index creation support externally
      stored columns,
      
      Initially, I tried to allocate the bit for dfield_t::ext from
      dfield_t::len by making the length 31 bits and mapping UNIV_SQL_NULL
      to something that would fit in it.  Then I decided that it would be
      too risky.  The redundant check was part of the mapping.  The
      condition may have been dfield_is_null() initially.
      
      This redundant code was noticed by Sergey Petrunya on the MySQL
      internals list.
      91729dad
  19. 08 Dec, 2009 1 commit
  20. 03 Dec, 2009 2 commits
    • pekka's avatar
      branches/zip: Minor changes which allow build with UNIV_HOTBACKUP · a5550052
      pekka authored
      defined to succeed:
      
      include/trx0sys.h: Allow Hot Backup build to see some
                         TRX_SYS_DOUBLEWRITE_... macros. 
      trx/trx0sys.c:     Exclude trx_sys_close() function from Hot Backup build.
      log/log0recv.[ch]: Exclude recv_sys_var_init() function from Hot Backup build.
      
      This change should not affect !UNIV_HOTBACKUP build.
      a5550052
    • marko's avatar
      branches/zip: dict_table_check_for_dup_indexes(): Assert that the · 759f7636
      marko authored
      data dictionary mutex is being held while table->indexes is accessed.
      This is already the case.
      
      Currently, only dict_table_get_next_index() and dict_table_get_first_index()
      are being invoked without holding dict_sys->mutex.
      759f7636
  21. 02 Dec, 2009 2 commits