1. 20 Apr, 2011 1 commit
  2. 12 Apr, 2011 1 commit
    • Marko Mäkelä's avatar
      Bug #12329920 ASSERT UT_ERROR IN SYNC_THREAD_LEVELS_NONEMPTY_TRX · d7b7551e
      Marko Mäkelä authored
      SRV_CONC_FORCE_EXIT_INNODB
      
      This is a bogus UNIV_SYNC_DEBUG assertion failure that I introduced
      when introducing assertions for checking that InnoDB is not holding
      any mutexes or rw-locks when returning control to MySQL.
      
      srv_suspend_mysql_thread(): Release dict_operation_lock before
      invoking srv_conc_force_exit_innodb(), which would now check that the
      thread is not holding any mutexes or rw-locks.  After resuming, check
      sync_thread_levels_nonempty_trx() and do srv_conc_force_enter_innodb()
      before reacquiring the dict_operation_lock.
      
      rb:646 approved by Sunny Bains
      d7b7551e
  3. 11 Apr, 2011 2 commits
    • Marko Mäkelä's avatar
      a7cabe44
    • Marko Mäkelä's avatar
      Bug #11760042 - 52409: Assertion failure: long semaphore wait · 2122383e
      Marko Mäkelä authored
      In ha_innobase::create(), we check some things while holding an
      exclusive lock on the data dictionary. Defer the locking and the
      creation of transactions until after the checks have passed. The
      THDVAR could hang due to a mutex wait (see Bug #11750569 - 41163:
      deadlock in mysqld: LOCK_global_system_variables and LOCK_open), and
      we want to avoid waiting while holding InnoDB mutexes.
      
      innobase_index_name_is_reserved(): Replace the parameter trx_t with
      THD, so that the test can be performed before starting an InnoDB
      transaction. We only needed trx->mysql_thd.
      
      ha_innobase::create(): Create transaction and lock the data dictionary
      only after passing the basic tests.
      
      create_table_def(): Move the IS_MAGIC_TABLE_AND_USER_DENIED_ACCESS
      check to ha_innobase::create(). Assign to srv_lower_case_table_names
      while holding dict_sys->mutex.
      
      ha_innobase::delete_table(), ha_innobase::rename_table(),
      innobase_rename_table(): Assign srv_lower_case_table_names as late as
      possible. Here, the variable is not necessarily protected by
      dict_sys->mutex.
      
      ha_innobase::add_index(): Invoke innobase_index_name_is_reserved() and
      innobase_check_index_keys() before allocating anything.
      
      rb:618 approved by Jimmy Yang
      2122383e
  4. 08 Apr, 2011 1 commit
  5. 07 Apr, 2011 1 commit
    • Marko Mäkelä's avatar
      Bug #11766513 - 59641: Prepared XA transaction in system after hard crash · 8a22d1ad
      Marko Mäkelä authored
      causes future shutdown hang
      
      InnoDB would hang on shutdown if any XA transactions exist in the
      system in the PREPARED state. This has been masked by the fact that
      MySQL would roll back any PREPARED transaction on shutdown, in the
      spirit of Bug #12161 Xa recovery and client disconnection.
      
      [mysql-test-run] do_shutdown_server: Interpret --shutdown_server 0 as
      a request to kill the server immediately without initiating a
      shutdown procedure.
      
      xid_cache_insert(): Initialize XID_STATE::rm_error in order to avoid a
      bogus error message on XA ROLLBACK of a recovered PREPARED transaction.
      
      innobase_commit_by_xid(), innobase_rollback_by_xid(): Free the InnoDB
      transaction object after rolling back a PREPARED transaction.
      
      trx_get_trx_by_xid(): Only consider transactions whose
      trx->is_prepared flag is set. The MySQL layer seems to prevent
      attempts to roll back connected transactions that are in the PREPARED
      state from another connection, but it is better to play it safe. The
      is_prepared flag was introduced in the InnoDB Plugin.
      
      trx_n_prepared: A new counter, counting the number of InnoDB
      transactions in the PREPARED state.
      
      logs_empty_and_mark_files_at_shutdown(): On shutdown, allow
      trx_n_prepared transactions to exist in the system.
      
      trx_undo_free_prepared(), trx_free_prepared(): New functions, to free
      the memory objects of PREPARED transactions on shutdown. This is not
      needed in the built-in InnoDB, because it would collect all allocated
      memory on shutdown. The InnoDB Plugin needs this because of
      innodb_use_sys_malloc.
      
      trx_sys_close(): Invoke trx_free_prepared() on all remaining
      transactions.
      8a22d1ad
  6. 06 Apr, 2011 4 commits
  7. 05 Apr, 2011 8 commits
    • Marko Mäkelä's avatar
      2553c8f9
    • Marko Mäkelä's avatar
      Remove unused functions. · 7d8f3f17
      Marko Mäkelä authored
      os_thread_get_curr(), os_thread_get_priority(), os_thread_set_priority(),
      os_thread_get_last_error(): Remove.
      7d8f3f17
    • Vasil Dimov's avatar
      Merge mysql-5.1-innodb -> mysql-5.5-innodb · 2e027889
      Vasil Dimov authored
      2e027889
    • Vasil Dimov's avatar
      426427fd
    • Vasil Dimov's avatar
      Add the testcase for Bug#59410 to 5.1/InnoDB Plugin · bdc15bce
      Vasil Dimov authored
      Bug#59410 read uncommitted: unlock row could not find a 3 mode lock
      on the record
      
      This bug is present only in 5.6 but I am adding the test case to earlier
      versions to ensure it never appears in earlier versions too.
      bdc15bce
    • Vasil Dimov's avatar
      Add the testcase for Bug#59410 to 5.1/builtin · 1ce71296
      Vasil Dimov authored
      Bug#59410 read uncommitted: unlock row could not find a 3 mode lock
      on the record
      
      This bug is present only in 5.6 but I am adding the test case to earlier
      versions to ensure it never appears in earlier versions too.
      1ce71296
    • Marko Mäkelä's avatar
      Bug 12323643 - CLEAN UP THE INNODB THREAD SHUTDOWN AND ASSERTIONS (WL#5136) · 6da09385
      Marko Mäkelä authored
      On shutdown, do not exit threads in os_event_wait(). This method of
      exiting was only used by the I/O handler threads. Exit them on a
      higher level.
      
      os_event_wait_low(), os_event_wait_time_low(): Do not exit on shutdown.
      
      os_thread_exit(), ut_dbg_assertion_failed(), ut_print_timestamp(): Add
      attribute cold, so that GCC knows that these functions are rarely
      invoked and can be optimized for size.
      
      os_aio_linux_collect(): Return on shutdown.
      
      os_aio_linux_handle(), os_aio_simulated_handle(), os_aio_windows_handle():
      Set *message1 = *message2 = NULL and return TRUE on shutdown.
      
      fil_aio_wait(): Return on shutdown.
      
      logs_empty_and_mark_files_at_shutdown(): Even in very fast shutdown
      (innodb_fast_shutdown=2), allow the background threads to exit, but
      skip the flushing and log checkpointing.
      
      innobase_shutdown_for_mysql(): Always wait for all the threads to exit.
      
      rb:633 approved by Sunny Bains
      6da09385
    • Marko Mäkelä's avatar
      Bug 12323643 - CLEAN UP THE INNODB THREAD SHUTDOWN AND ASSERTIONS (WL#5136) · 3a82a01d
      Marko Mäkelä authored
      Remove most references to thread id in InnoDB. Three references
      remain: the current holder of a mutex, and the current x-lock holder
      of a rw-lock, and some references in UNIV_SYNC_DEBUG checks. This
      allows MySQL to change the thread associated to a client connection.
      
      Tighten the UNIV_SYNC_DEBUG checks, trying to ensure that no InnoDB
      mutex or x-lock is being held when returning control to MySQL. The
      only semaphore that may be held is the btr_search_latch in shared mode.
      
      sync_thread_levels_empty_except_dict(): A wrapper for
      sync_thread_levels_empty_gen(TRUE).
      
      sync_thread_levels_nonempty_trx(): Check that the current thread is
      not holding any InnoDB semaphores, except btr_search_latch if
      trx->has_search_latch.
      
      sync_thread_levels_empty(): Unused function; remove.
      
      trx_t: Remove mysql_thread_id and mysql_process_no.
      
      srv_slot_t: Remove id and handle.
      
      row_search_for_mysql(), srv_conc_enter_innodb(),
      srv_conc_force_enter_innodb(), srv_conc_force_exit_innodb(),
      srv_conc_exit_innodb(), srv_suspend_mysql_thread: Assert
      !sync_thread_levels_nonempty_trx().
      
      rb:634 approved by Sunny Bains
      3a82a01d
  8. 04 Apr, 2011 6 commits
  9. 02 Apr, 2011 1 commit
  10. 31 Mar, 2011 3 commits
    • Gleb Shchepa's avatar
      Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS · 43a1bda6
      Gleb Shchepa authored
      In the string context the MIN() and MAX() functions don't take
      into account the unsignedness of the UNSIGNED BIGINT argument
      column.
      
      I.e.:
              CREATE TABLE t1 (a BIGINT UNSIGNED);
              INSERT INTO t1 VALUES (18446668621106209655);
              SELECT CONCAT(MAX(a)) FROM t1;
      
      returns -75452603341961.
      
      
      mysql-test/r/func_group.result:
        Test case for bug #11766094.
      mysql-test/t/func_group.test:
        Test case for bug #11766094.
      sql/item.cc:
        Bug #11766094 - 59132: MIN() AND MAX() REMOVE UNSIGNEDNESS
        
        The Item_cache_int::val_str() method has been modified to
        take into account the unsigned_flag value when converting
        data to string.
      43a1bda6
    • Mattias Jonsson's avatar
      merge · 27bddead
      Mattias Jonsson authored
      27bddead
    • Mattias Jonsson's avatar
      31034266
  11. 30 Mar, 2011 7 commits
    • Magne Mahre's avatar
      Null merge 5.1->5.5 · 83fe4bab
      Magne Mahre authored
      83fe4bab
    • Magne Mahre's avatar
      Fix-up after commit of Bug#11900714 · 202f2918
      Magne Mahre authored
      The patch fixes a build problem on MacOSX, where
      the compiler complains about unused parameters.
      202f2918
    • Marko Mäkelä's avatar
      fe347bbb
    • Marko Mäkelä's avatar
      Bug#11877216 InnoDB too eager to commit suicide on a busy server · 9a961662
      Marko Mäkelä authored
      sync_array_print_long_waits(): Return the longest waiting thread ID
      and the longest waited-for lock. Only if those remain unchanged
      between calls in srv_error_monitor_thread(), increment
      fatal_cnt. Otherwise, reset fatal_cnt.
      
      Background: There is a built-in watchdog in InnoDB whose purpose is to
      kill the server when some thread is stuck waiting for a mutex or
      rw-lock. Before this fix, the logic was flawed.
      
      The function sync_array_print_long_waits() returns TRUE if it finds a
      lock wait that exceeds 10 minutes (srv_fatal_semaphore_wait_threshold).
      The function srv_error_monitor_thread() will kill the server if this
      happens 10 times in a row (fatal_cnt reaches 10), checked every 30
      seconds. This is wrong, because this situation does not mean that the
      server is hung. If the server is very busy for a little over 15
      minutes, it will be killed.
      
      Consider this example. Thread T1 is waiting for mutex M. Some time
      later, threads T2..Tn start waiting for the same mutex M. If T1 keeps
      waiting for 600 seconds, fatal_cnt will be incremented to 1. So far,
      so good. Now, if M is granted to T1, the server was obviously not
      stuck. But, T2..Tn keeps waiting, and their wait time will be longer
      than 600 seconds. If 5 minutes later, some Tn has still been waiting
      for more than 10 minutes for the mutex M, the server can be killed,
      even though it is not stuck.
      
      rb:622 approved by Jimmy Yang
      9a961662
    • Sergey Glukhov's avatar
      5.1 -> 5.5 merge · 85db4f23
      Sergey Glukhov authored
      85db4f23
    • Sergey Glukhov's avatar
      Bug#11766124 59164: VALGRIND: UNINITIALIZED VALUE IN NUMBER_TO_DATETIME · afc5d19d
      Sergey Glukhov authored
      Valgrind warning happens due to missing NULL value check in
      Item::get_date. The fix is to add this check.
      
      
      mysql-test/r/func_time.result:
        test case
      mysql-test/t/func_time.test:
        test case
      sql/item.cc:
        added check for NULL value
      afc5d19d
    • Sergey Glukhov's avatar
      Bug#11766126 59166: ANOTHER DATETIME VALGRIND UNINITIALIZED WARNING · 0765ef52
      Sergey Glukhov authored
      Valgrind warning happens because null values check happens too late
      in Item_func_month::val_str(after result string calculation).The fix
      is to check null value before result string calculation.
      
      
      mysql-test/r/func_time.result:
        test case
      mysql-test/t/func_time.test:
        test case
      sql/item_timefunc.h:
        check null value before result string calculation.
      0765ef52
  12. 29 Mar, 2011 3 commits
    • Magne Mahre's avatar
      Bug#11933945 REMOVE LGPL LICENSED FILES IN MYSQL 5.5 · 65b3ba15
      Magne Mahre authored
      The LGPL license is used in some legacy code, and to
      adhere to current licensing polity, we remove those
      files that are no longer used, and reorganize the
      remaining LGPL code so it will be GPL licensed from
      now on.
                  
      Note:  This patch only removed LGPL licensed files
             in MySQL 5.5 and later, and is the third of a 
             set of patches to remove LGPL from all trees.
             (See Bug# 11840513 for details) 
      65b3ba15
    • Jon Olav Hauglid's avatar
      Null merge from mysql-5.1 to mysql-5.5 · 435a7ad7
      Jon Olav Hauglid authored
      435a7ad7
    • Jon Olav Hauglid's avatar
      Bug# 11763784 (former 56541) · f526ad3e
      Jon Olav Hauglid authored
      ASSERTION TABLE->DB_STAT FAILED IN
      SQL_BASE.CC::OPEN_TABLE() DURING I_S Q
      
      This assert could be triggered if a statement requiring a name
      lock on a table (e.g. DROP TRIGGER) executed concurrently
      with an I_S query which also used the table.
      
      One connection first started an I_S query that opened a given table.
      Then another connection started a statement requiring a name lock
      on the same table. This statement was blocked since the table was
      in use by the I_S query. When the I_S query resumed and tried to
      open the table again as part of get_all_tables(), it would encounter
      a table instance with an old version number representing the pending
      name lock. Since I_S queries ignore version checks and thus pending
      name locks, it would try to continue. This caused it to encounter
      the assert. The assert checked that the TABLE instance found with a
      different version, was a real, open table. However, since this TABLE
      instance instead represented a pending name lock, the check would
      fail and trigger the assert.
      
      This patch fixes the problem by removing the assert. It is ok for
      TABLE::db_stat to be 0 in this case since the TABLE instance can
      represent a pending name lock.
      
      Test case added to lock_sync.test.
      f526ad3e
  13. 28 Mar, 2011 2 commits