1. 23 Jan, 2018 2 commits
    • Monty's avatar
      Fix for MDEV-14141 Crash in print_keydup_error() · b3c7cf81
      Monty authored
      May also fix: MDEV-14970 "MariaDB crashed with signal 11 and Aria table"
      
      I am not able to reproduce a crash, however there was no protection in
      print_keydup_error() if the storage engine reported the wrong key number.
      
      This patch adds such a protection and should stop any further crashes
      in this case.
      
      Other things:
      - Added extra protection in Aria to not set errkey to more than number of
        keys. (Don't think this is cause of this crash, but better safe than
        sorry)
      - Extend test_if_equal_repl_errors() to handle different cases of
        ER_DUP_ENTRY. This is just mainly precaution for the future.
      b3c7cf81
    • Oleksandr Byelkin's avatar
      MDEV-7533: COLUMN_JSON() doesn't escape control characters in string values · a4663af0
      Oleksandr Byelkin authored
      escape all charecters less or equal 0x1F (control symbols)
      (shorter sequence are not used to make code simple, long encoding is always legal according to the rfc4627)
      a4663af0
  2. 22 Jan, 2018 2 commits
    • Sergei Golubchik's avatar
      MDEV-13988 connect.drop-open-error fails · ea78c574
      Sergei Golubchik authored
      PCOLRES::Length is the length in characters, not in bytes
      (because it's printed as length in "VARCHAR(N)").
      So convert it into characters using cs->mbmaxlen.
      ea78c574
    • Marko Mäkelä's avatar
      MDEV-12173 "Error: trying to do an operation on a dropped tablespace" · 43160723
      Marko Mäkelä authored
      InnoDB is issuing a 'noise' message that is not a sign of abnormal
      operation. The only issuers of it are the debug function
      lock_rec_block_validate() and the change buffer merge.
      While the error should ideally never occur in transactional locking,
      we happen to know that DISCARD TABLESPACE and TRUNCATE TABLE and
      possibly DROP TABLE are breaking InnoDB table locks.
      
      When it comes to the change buffer merge, the message simply is useless
      noise. We know perfectly well that a tablespace can be dropped while a
      change buffer merge is pending. And the code is prepared to handle that,
      which is demonstrated by the fact that whenever the message was issued,
      InnoDB did not crash.
      
      fil_inc_pending_ops(): Remove the parameter print_err.
      43160723
  3. 18 Jan, 2018 1 commit
  4. 11 Jan, 2018 2 commits
    • Marko Mäkelä's avatar
      Merge 5.5 into 10.0 · 4c147954
      Marko Mäkelä authored
      4c147954
    • Marko Mäkelä's avatar
      MDEV-14916 InnoDB reports warning for "Purge reached the head of the history list" · bdcd7f79
      Marko Mäkelä authored
      The warning was originally added in
      commit c6766305
      (MySQL 4.1.12, 5.0.3) to trace claimed undo log corruption that
      was analyzed in https://lists.mysql.com/mysql/176250
      on November 9, 2004.
      
      Originally, the limit was 20,000 undo log headers or transactions,
      but in commit 9d6d1902
      in MySQL 5.5.11 it was increased to 2,000,000.
      
      The message can be triggered when the progress of purge is prevented
      by a long-running transaction (or just an idle transaction whose
      read view was started a long time ago), by running many transactions
      that UPDATE or DELETE some records, then starting another transaction
      with a read view, and finally by executing more than 2,000,000
      transactions that UPDATE or DELETE records in InnoDB tables. Finally,
      when the oldest long-running transaction is completed, purge would
      run up to the next-oldest transaction, and there would still be more
      than 2,000,000 transactions to purge.
      
      Because the message can be triggered when the database is obviously
      not corrupted, it should be removed. Heavy users of InnoDB should be
      monitoring the "History list length" in SHOW ENGINE INNODB STATUS;
      there is no need to spam the error log.
      bdcd7f79
  5. 10 Jan, 2018 3 commits
  6. 08 Jan, 2018 1 commit
  7. 04 Jan, 2018 1 commit
  8. 03 Jan, 2018 2 commits
  9. 02 Jan, 2018 3 commits
  10. 28 Dec, 2017 1 commit
  11. 27 Dec, 2017 2 commits
  12. 22 Dec, 2017 1 commit
  13. 21 Dec, 2017 2 commits
    • Vicențiu Ciorbaru's avatar
      Follow up to MDEV-12366: FLUSH privileges can break hierarchy of roles · 24efee91
      Vicențiu Ciorbaru authored
      A suggestion to make role propagation simpler from serg@mariadb.org.
      
      Instead of gathering the leaf roles in an array, which for very wide
      graphs could potentially mean a big part of the whole roles schema, keep
      the previous logic. When finally merging a role, set its counter
      to something positive.
      
      This will effectively mean that a role has been merged, thus a random pass
      through roles hash that touches a previously merged role won't cause the problem
      described in MDEV-12366 any more, as propagate_role_grants_action will stop
      attempting to merge from that role.
      24efee91
    • Marko Mäkelä's avatar
      MDEV-12827 Assertion failure when reporting duplicate key error in online table rebuild · 0202e472
      Marko Mäkelä authored
      row_log_table_apply_insert_low(), row_log_table_apply_update():
      When reporting the error_key_num, only count the clustered index
      if it corresponds to a key in the SQL layer.
      
      The assertion failure was probably introduced by the (incomplete)
      MySQL 5.6.28 bug fix
      Bug #21364096 THE BOGUS DUPLICATE KEY ERROR IN ONLINE DDL
      WITH INCORRECT KEY NAME
      which we are improving.
      
      Side note: the fix was incorrectly merged to MySQL 5.7.10;
      incorrect key names will continue to be reported in MySQL 5.7.
      0202e472
  14. 20 Dec, 2017 4 commits
  15. 19 Dec, 2017 3 commits
    • Simon J Mudd's avatar
    • Vicențiu Ciorbaru's avatar
      MDEV-12366: FLUSH PRIVILEGES can break hierarchy of roles · be758322
      Vicențiu Ciorbaru authored
      Whenever we call merge_role_privileges on a role, we make use of
      the role->counter variable to check if all it's children have had their
      privileges merged. Only if all children have had their privileges merged,
      do we update the privileges on parent. This is done to prevent extra work.
      The same idea is employed during flush privileges. You only begin merging
      from "leaf" roles. The recursive calls will merge their parents at some point.
      A problem arises when we try to "re-merge" a parent. Take the following graph:
      
      {noformat}
           A (0)  ----  C (2) ---- D (2)  ---- USER
                       /          /
           B (0)  ----/          /
                                /
           E (0) --------------/
      {noformat}
      
      In parentheses we have the "counter" value right before we start to iterate
      through the roles hash and propagate values. It represents the number of roles
      granted to the current role. The order in which we iterate through the roles
      hash is alphabetical.
      
      * First merge A, which leads to decreasing the counter for C to 1. Since C is
      not 0, we don't proceed with merging into C.
      
      * Second we merge B, which leads to decreasing the counter for C to 0. Now
      we proceed with merging into C. This leads to reducing the counter for D to 1
      as part of C merge process.
      
      * Third as we iterate through the hash, we see that C has counter 0, thus we
      start the merge process *again*. This leads to reducing the counter for
      D to 0! We then attempt to merge D.
      
      * Fourth we start merging E. When E sees D as it's parent (according to the code)
      it attempts to reduce D's counter, which leads to overflow. Now D's counter is
      a very large number, thus E's privileges are not forwarded to D yet.
      
      To correct this behavior we must make sure to only start merging from initial
      leaf nodes.
      be758322
    • Vicențiu Ciorbaru's avatar
      MDEV-13655: Set role does not properly grant privileges. · 2fced9e7
      Vicențiu Ciorbaru authored
      When granting a role to another role, DB privileges get propagated. If
      the grantee had no previous DB privileges, an extra ACL_DB entry is created to
      house those "indirectly received" privileges. If, afterwards, DB
      privileges are granted to the grantee directly, we must make sure to not
      create a duplicate ACL_DB entry.
      2fced9e7
  16. 18 Dec, 2017 3 commits
  17. 16 Dec, 2017 1 commit
  18. 13 Dec, 2017 5 commits
  19. 08 Dec, 2017 1 commit