1. 28 Dec, 2016 2 commits
    • Jan Lindström's avatar
      MDEV-11656: 'Data structure corruption' IMPORT TABLESPACE doesn't work for... · 283e9cf4
      Jan Lindström authored
      MDEV-11656: 'Data structure corruption' IMPORT TABLESPACE doesn't work for encrypted InnoDB tables if space_id changed
      
      Problem was that for encryption we use temporary scratch area for
      reading and writing tablespace pages. But if page was not really
      decrypted the correct updated page was not moved to scratch area
      that was then written. This can happen e.g. for page 0 as it is
      newer encrypted even if encryption is enabled and as we write
      the contents of old page 0 to tablespace it contained naturally
      incorrect space_id that is then later noted and error message
      was written. Updated page with correct space_id was lost.
      
      If tablespace is encrypted we use additional
      temporary scratch area where pages are read
      for decrypting readptr == crypt_io_buffer != io_buffer.
      
      Destination for decryption is a buffer pool block
      block->frame == dst == io_buffer that is updated.
      Pages that did not require decryption even when
      tablespace is marked as encrypted are not copied
      instead block->frame is set to src == readptr.
      
      If tablespace was encrypted we copy updated page to
      writeptr != io_buffer. This fixes above bug.
      
      For encryption we again use temporary scratch area
      writeptr != io_buffer == dst
      that is then written to the tablespace
      
      (1) For normal tables src == dst ==  writeptr
      ut_ad(!encrypted && !page_compressed ?
      	src == dst && dst == writeptr + (i * size):1);
      (2) For page compressed tables src == dst == writeptr
      ut_ad(page_compressed && !encrypted ?
      	src == dst && dst == writeptr + (i * size):1);
      (3) For encrypted tables src != dst != writeptr
      ut_ad(encrypted ?
      	src != dst && dst != writeptr + (i * size):1);
      283e9cf4
    • Marko Mäkelä's avatar
      MDEV-9282 Debian: the Lintian complains about "shlib-calls-exit" in ha_innodb.so · d50cf42b
      Marko Mäkelä authored
      Replace all exit() calls in InnoDB with abort() [possibly via ut_a()].
      Calling exit() in a multi-threaded program is problematic also for
      the reason that other threads could see corrupted data structures
      while some data structures are being cleaned up by atexit() handlers
      or similar.
      
      In the long term, all these calls should be replaced with something
      that returns an error all the way up the call stack.
      d50cf42b
  2. 27 Dec, 2016 1 commit
  3. 22 Dec, 2016 3 commits
  4. 21 Dec, 2016 3 commits
  5. 20 Dec, 2016 2 commits
  6. 19 Dec, 2016 2 commits
  7. 15 Dec, 2016 1 commit
  8. 14 Dec, 2016 5 commits
  9. 13 Dec, 2016 1 commit
    • Jan Lindström's avatar
      MDEV-10368: get_latest_version() called too often · 72cc73ce
      Jan Lindström authored
      Reduce the number of calls to encryption_get_key_get_latest_version
      when doing key rotation with two different methods:
      
      (1) We need to fetch key information when tablespace not yet
      have a encryption information, invalid keys are handled now
      differently (see below). There was extra call to detect
      if key_id is not found on key rotation.
      
      (2) If key_id is not found from encryption plugin, do not
      try fetching new key_version for it as it will fail anyway.
      We store return value from encryption_get_key_get_latest_version
      call and if it returns ENCRYPTION_KEY_VERSION_INVALID there
      is no need to call it again.
      72cc73ce
  10. 12 Dec, 2016 3 commits
  11. 11 Dec, 2016 2 commits
  12. 10 Dec, 2016 2 commits
  13. 09 Dec, 2016 2 commits
  14. 08 Dec, 2016 4 commits
    • Sergei Golubchik's avatar
      MDEV-10713: signal 11 error on multi-table update - crash in... · 03dabfa8
      Sergei Golubchik authored
      MDEV-10713: signal 11 error on multi-table update - crash in handler::increment_statistics or in make_select or assertion failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))
      
      Different fix. Don't allow Item_func_sp to be evaluated unless
      all tables are prelocked.
      
      Extend the test case to make sure Item_func_sp::val_str is called
      (the table must have at least one row for that).
      03dabfa8
    • Sergei Golubchik's avatar
      Revert "MDEV-10713: signal 11 error on multi-table update - crash in... · ab65db6d
      Sergei Golubchik authored
      Revert "MDEV-10713: signal 11 error on multi-table update - crash in handler::increment_statistics or in make_select or assertion failure pfs_thread == ((PFS_thread*) pthread_getspecific((THR_PFS)))"
      
      This reverts commit 035a5ac6.
      
      Two minor problems and one regression:
      1. caching the value in str_result. Other Item methods may use it,
         destroying the cache. See, for example, Item::save_in_field, where
         str_result is moved to use a local buffer (this failed main.grant)
      2. Item_func_conv_charset::safe is now set too late, it's initialized
         only in val_str() but checked before that, this failed many tests
         in optimized builds.
      
      to fix 1 - use tmp_result instead of str_result, to fix 2, use
      the else branch in the Item_func_conv_charset constructor to set
      safe purely from charset properties.
      
      But this introduces a regression, constant strings can no longer be
      converted, say, from utf8 to latin1 (because 'safe' will be false).
      This fails few tests too. There is no way to fix it without reverting
      the commit and converting constants, as before, in the constructor.
      ab65db6d
    • Elena Stepanova's avatar
      MDEV-11491 binlog_encryption.rpl_checksum fails sporadically in buildbot · 870d7589
      Elena Stepanova authored
      The race condition happened if mark_xid_done was considerably delayed,
      and an extra Binlog_checkpoint event was written into the binary log
      which was later indicated in an error message. Fixed by ensuring
      that the event is written before the binary log is rotated to the one
      which is used in the output.
      870d7589
    • Elena Stepanova's avatar
      MDEV-11504 binlog_encryption.encrypted_master_switch_to_unencrypted fails sporadically in buildbot · 8e702bce
      Elena Stepanova authored
      The reason is a simple race condition. Initially the test was meant to synchronize with master
      before showing tables, but it turned out that the slave IO thread should fail by this point,
      and synchronization was removed along with a server bugfix. Now added an intermediate sync
      instead, to make sure that slave has replicated events before the point of failure
      8e702bce
  15. 07 Dec, 2016 7 commits