1. 26 Nov, 2014 3 commits
    • Jan Lindström's avatar
      Better comments part 2 with proof and simplified implementation. · e15a83c0
      Jan Lindström authored
      Thanks to Daniel Black.
      e15a83c0
    • Jan Lindström's avatar
      MDEV-7214: Test failure in main.partition_innodb · 43054872
      Jan Lindström authored
      Problem is on test it tried to verify that no files were left
      on test database.
      
      Fix: There's no need to list other file types, it can only 
      list *.par files
      43054872
    • Kristian Nielsen's avatar
      MDEV-6582: DEBUG_SYNC does not reset mysys_var->current_mutex, causes... · 06d0d090
      Kristian Nielsen authored
      MDEV-6582: DEBUG_SYNC does not reset mysys_var->current_mutex, causes assertion "Trying to unlock mutex that wasn't locked"
      
      The bug was in DEBUG_SYNC. When waiting, debug_sync_execute() temporarily sets
      thd->mysys_var->current_mutex to a new value while waiting. However, if the
      old value of current_mutex was NULL, it was not restored, current_mutex
      remained set to the temporary value (debug_sync_global.ds_mutex).
      
      This made possible the following race: Thread T1 goes to KILL thread T2. In
      THD::awake(), T1 loads T2->mysys_var->current_mutex, it is set to ds_mutex, T1
      locks this mutex.
      
      Now T2 runs, it does ENTER_COND, it sets T2->mysys_var->current_mutex to
      LOCK_wait_commit (for example).
      
      Then T1 resumes, it reloads mysys_var->current_mutex, now it is set to
      LOCK_wait_commit, T1 unlocks this mutex instead of the ds_mutex that it locked
      previously.
      
      This causes safe_mutex to assert with the message: "Trying to unlock mutex
      LOCK_wait_commit that wasn't locked".
      
      The fix is to ensure that DEBUG_SYNC also will restore
      mysys_var->current_mutex in the case where the original value was NULL.
      
      06d0d090
  2. 25 Nov, 2014 5 commits
    • Kristian Nielsen's avatar
      MDEV-7179: rpl.rpl_gtid_crash failed in buildbot with Warning: database page corruption or a failed · e79b7ca9
      Kristian Nielsen authored
      I saw two test failures in rpl.rpl_gtid_crash where we get this in the error
      log:
      
      141123 12:47:54 [Note] InnoDB: Restoring possible half-written data pages 
      141123 12:47:54 [Note] InnoDB: from the doublewrite buffer...
      InnoDB: Warning: database page corruption or a failed
      InnoDB: file read of space 6 page 3.
      InnoDB: Trying to recover it from the doublewrite buffer.
      141123 12:47:54 [Note] InnoDB: Recovered the page from the doublewrite buffer.
      
      This test case deliberately crashes the server, and if this crash happens
      right in the middle of writing a buffer pool page to disk, it is not
      unexpected that we can get a half-written page. The page is recovered
      correctly from the doublewrite buffer.
      
      So this patch adds a suppression for this warning in the error log for this
      test case.
      e79b7ca9
    • Kristian Nielsen's avatar
      MDEV-6903: gtid_slave_pos is incorrect after master crash · b7968590
      Kristian Nielsen authored
      When a master slave restarts, it logs a special restart format description
      event in its binlog. When the slave sees this event, it knows it needs to roll
      back any active partial transaction, in case the master crashed previously in
      the middle of writing such transaction to its binlog.
      
      However, there was a bug where this rollback did not reset rgi->pending_gtid.
      This caused the @@gtid_slave_pos to be updated incorrectly with the GTID of
      the partial transaction that was rolled back.
      
      Fix this by always clearing rgi->pending_gtid in cleanup_context(), hopefully
      preventing similar bugs from turning up in other special cases where a
      transaction is rolled back during replication.
      
      Thanks to Pavel Ivanov for tracking down the issue and providing a test case.
      b7968590
    • Jan Lindström's avatar
      MDEV-7046: MySQL#74480 - Failing assertion: os_file_status(newpath, &exists, &type) · f3bdf9d7
      Jan Lindström authored
      after Operating system error number 36 in a file operation.
      
      Analysis: os_file_get_status did not handle error ENAMETOOLONG
      correctly.
      
      Fix: Add correct handling for error ENAMETOOLONG. Note that on InnoDB
      case the error is not passed all the way up to server. That would
      be bigger rewamp.
      f3bdf9d7
    • Jan Lindström's avatar
      Better comments and add a test case. · b62c4c65
      Jan Lindström authored
      b62c4c65
    • Jan Lindström's avatar
      Better comments and add a test case. · e5802c38
      Jan Lindström authored
      e5802c38
  3. 24 Nov, 2014 4 commits
  4. 23 Nov, 2014 1 commit
  5. 21 Nov, 2014 5 commits
  6. 20 Nov, 2014 11 commits
  7. 19 Nov, 2014 9 commits
    • Sergei Golubchik's avatar
      Fix YaSSL on windows · ed2cc2a8
      Sergei Golubchik authored
      This came with the upgrade from yassl 2.3.0 to 2.3.4 -
      ssl tests started to hang on Windows. Comparing and removing changes
      I've got to this:
      
       void input_buffer::set_current(uint i) 
       {
      -    if (i)
      -        check(i - 1, size_); 
      -    current_ = i; 
      +    if (error_ == 0 && i && check(i - 1, size_) == 0)
      +        current_ = i;
      +    else
      +        error_ = -1;
       }
      
      in 2.3.0 i==0 was only used to avoid the check, in 2.3.4 it's an error.
      but there are places in the code that do set_current(0) and others that
      do, like, { before=get_current(); ...; set_current(before); } - and the
      initial value of current_ is 0.
      
      So, I suspect that set_current(0) should not be an error, but it should
      only skip the check().
      ed2cc2a8
    • Jan Lindström's avatar
      MDEV-7084: innodb index stats inadequate using constant · 8bc5eabe
      Jan Lindström authored
      innodb_stats_sample_pages
      
      Analysis: If you set the number of analyzed pages 
      to very low number compared to actual pages on 
      that table/index it randomly pics those pages 
      (default 8 pages), this leads to fact that query 
      after analyze table returns different results. If 
      the index tree is small, smaller than 10 * 
      n_sample_pages + total_external_size, then the 
      estimate is ok. For bigger index trees it is 
      common that we do not see any borders between 
      key values in the few pages we pick. But still 
      there may be n_sample_pages different key values, 
      or even more. And it just tries to 
      approximate to n_sample_pages (8).
      
      Fix: (1) Introduced new dynamic configuration variable
      innodb_stats_sample_traditional  that retains
      the current design. Default false.
      
      (2) If traditional sample is not used we use
      n_sample_pages = max(min(srv_stats_sample_pages,
                               index->stat_index_size),
                           log2(index->stat_index_size)*
                                srv_stats_sample_pages);
      
      (3) Introduced new dynamic configuration variable
      stat_modified_counter (default = 0) if set
      sets lower bound for row updates when statistics is re-estimated.
      
      If user has provided upper bound for how many rows needs to be updated
      before we calculate new statistics we use minimum of provided value
      and 1/16 of table every 16th round. If no upper bound is provided
      (srv_stats_modified_counter = 0, default) then calculate new statistics
      if 1 / 16 of table has been modified
      since the last time a statistics batch was run.
      We calculate statistics at most every 16th round, since we may have
      a counter table which is very small and updated very often.
      @param t table
      @return true if the table has changed too much and stats need to be
      recalculated
      */
      #define DICT_TABLE_CHANGED_TOO_MUCH(t) \
      	((ib_int64_t) (t)->stat_modified_counter > (srv_stats_modified_counter ? \
      	ut_min(srv_stats_modified_counter, (16 + (t)->stat_n_rows / 16)) : \
      		16 + (t)->stat_n_rows / 16))
      8bc5eabe
    • Sergei Golubchik's avatar
      MDEV-6975 Implement TLS protocol · d851d5e7
      Sergei Golubchik authored
      followup:
      * explicitly disable SSLv2 and SSLv3, keep other protocols enabled
      * fix a compiler warning
      * rename the test and combinations to avoid confusion
      
      vio/viossl.c:
        fix a compiler warning
      d851d5e7
    • Sergei Golubchik's avatar
      5.5 merge · 3495801e
      Sergei Golubchik authored
      3495801e
    • Sergey Petrunya's avatar
      MDEV-7118: Anemometer stop working after upgrade to from... · 00475d40
      Sergey Petrunya authored
      When the optimizer considers an option to use Loose Scan, it should 
      still consider UNIQUE keys (Previously, MDEV-4120 disabled loose scan
      for all kinds of unique indexes. That was wrong)
      
      However, we should not use Loose Scan when trying to satisfy 
       "SELECT DISTINCT col1, col2, .. colN"
      when using an index defined as UNIQU(col1, col2, ... colN).
      00475d40
    • Kristian Nielsen's avatar
      MDEV-7026: Race in InnoDB/XtraDB mutex implementation can stall or hang the server. · 6ea41f1e
      Kristian Nielsen authored
      The bug was that full memory barrier was missing in the code that ensures that
      a waiter on an InnoDB mutex will not go to sleep unless it is guaranteed to be
      woken up again by another thread currently holding the mutex. This made
      possible a race where a thread could get stuck waiting for a mutex that is in
      fact no longer locked. If that thread was also holding other critical locks,
      this could stall the entire server. There is an error monitor thread than can
      break the stall, it runs about once per second. But if the error monitor
      thread itself got stuck or was not running, then the entire server could hang
      infinitely.
      
      This was introduced on i386/amd64 platforms in 5.5.40 and 10.0.13 by an
      incorrect patch that tried to fix the similar problem for PowerPC.
      
      This commit reverts the incorrect PowerPC patch, and instead implements a fix
      for PowerPC that does not change i386/amd64 behaviour, making PowerPC work
      similarly to i386/amd64.
      6ea41f1e
    • Elena Stepanova's avatar
      MDEV-7074 multi_source.simple test fails in buildbot · 416f267a
      Elena Stepanova authored
      The problem is that the binlog position is updated before 
      Executed_log_entries and Slave_SQL_State. So, it's possible to hit 
      the moment when MASTER_POS_WAIT (and hence sync_with_master) already 
      returned success, but Slave_SQL_State and Executed_log_entries were not 
      modified yet. 
      Fixing it by adding a wait on the expected Executed_log_entries value.
      416f267a
    • Alexander Barkov's avatar
    • Alexander Barkov's avatar
      MDEV-6978 Bad results with join comparing case insensitive VARCHAR/ENUM/SET · 55dd89e9
      Alexander Barkov authored
      expression to a _bin ENUM column
      55dd89e9
  8. 18 Nov, 2014 2 commits