1. 15 Jun, 2017 3 commits
    • Vicențiu Ciorbaru's avatar
      MDEV-12666: CURRENT_ROLE() and DATABASE() does not work in a view · f0ad9340
      Vicențiu Ciorbaru authored
      The problem lies in how CURRENT_ROLE is defined. The
      Item_func_current_role inherits from Item_func_sysconst, which defines
      a safe_charset_converter to be a const_charset_converter.
      
      During view creation, if there is no role previously set, the current_role()
      function returns NULL.
      
      This is captured on item instantiation and the
      const_charset_converter call subsequently returns an Item_null.
      In turn, the function is replaced with Item_null and the view is
      then created with an Item_null instead of Item_func_current_role.
      
      Without this patch, the first SHOW CREATE VIEW from the testcase would
      have a where clause of WHERE role_name = NULL, while the second SHOW
      CREATE VIEW would show a correctly created view.
      
      The same applies for the DATABASE function, as it can change as well.
      
      There is an additional problem with CURRENT_ROLE() when used in a
      prepared statement. During prepared statement creation we used to set
      the string_value of the function to the current role as well as the
      null_value flag. During execution, if CURRENT_ROLE was not null, the
      null_value flag was never set to not-null during fix_fields.
      
      Item_func_current_user however can never be NULL so it did not show this
      problem in a view before. At the same time, the CURRENT_USER() can not
      be changed between prepared statement execution and creation so the
      implementation where the value is stored during fix_fields is
      sufficient.
      
      Note also that DATABASE() function behaves differently during prepared
      statements. See bug 25843 for details or commit
      7e0ad09e
      f0ad9340
    • Vicențiu Ciorbaru's avatar
      MDEV-10463: Granted as a whole to roles, databases are not show in SHOW DATABASES · 34da3be8
      Vicențiu Ciorbaru authored
      The problem lies in not checking role privileges as well during SHOW
      DATABASES command. This problem is also apparent for SHOW CREATE
      DATABASE command.
      
      Other SHOW COMMANDS make use of check_access, which in turn makes use of
      acl_get for both priv_user and priv_role parts, which allows them to
      function correctly.
      34da3be8
    • =Ian Gilfillan's avatar
      Update MariaDB Foundation sponsors · 2579b252
      =Ian Gilfillan authored
      2579b252
  2. 13 Jun, 2017 1 commit
  3. 12 Jun, 2017 3 commits
  4. 09 Jun, 2017 2 commits
    • Marko Mäkelä's avatar
      MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log · 417434f1
      Marko Mäkelä authored
      When a slow shutdown is performed soon after spawning some work for
      background threads that can create or commit transactions, it is possible
      that new transactions are started or committed after the purge has finished.
      This is violating the specification of innodb_fast_shutdown=0, namely that
      the purge must be completed. (None of the history of the recent transactions
      would be purged.)
      
      Also, it is possible that the purge threads would exit in slow shutdown
      while there exist active transactions, such as recovered incomplete
      transactions that are being rolled back. Thus, the slow shutdown could
      fail to purge some undo log that becomes purgeable after the transaction
      commit or rollback.
      
      srv_undo_sources: A flag that indicates if undo log can be generated
      or the persistent, whether by background threads or by user SQL.
      Even when this flag is clear, active transactions that already exist
      in the system may be committed or rolled back.
      
      innodb_shutdown(): Renamed from innobase_shutdown_for_mysql().
      Do not return an error code; the operation never fails.
      Clear the srv_undo_sources flag, and also ensure that the background
      DROP TABLE queue is empty.
      
      srv_purge_should_exit(): Do not allow the purge to exit if
      srv_undo_sources are active or the background DROP TABLE queue is not
      empty, or in slow shutdown, if any active transactions exist
      (and are being rolled back).
      
      srv_purge_coordinator_thread(): Remove some previous workarounds
      for this bug.
      
      innobase_start_or_create_for_mysql(): Set buf_page_cleaner_is_active
      and srv_dict_stats_thread_active directly. Set srv_undo_sources before
      starting the purge subsystem, to prevent immediate shutdown of the purge.
      Create dict_stats_thread and fts_optimize_thread immediately
      after setting srv_undo_sources, so that shutdown can use this flag to
      determine if these subsystems were started.
      
      dict_stats_shutdown(): Shut down dict_stats_thread. Backported from 10.2.
      
      srv_shutdown_table_bg_threads(): Remove (unused).
      417434f1
    • Marko Mäkelä's avatar
      Correct a merge error of MDEV-11626 · a9117c90
      Marko Mäkelä authored
      a9117c90
  5. 08 Jun, 2017 1 commit
  6. 06 Jun, 2017 1 commit
    • Marko Mäkelä's avatar
      Follow-up to MDEV-12042 (test innodb_page_size variants) · d8d39721
      Marko Mäkelä authored
      innodb_page_size_small: A new set of combinations, for
      innodb_page_size up to 16k. In MariaDB 10.0, this does not
      make a difference, but in 10.1 and later, innodb_page_size
      would cover 32k and 64k, for which ROW_FORMAT=COMPRESSED
      is not available.
      
      Enable these combinations in a few InnoDB tests.
      d8d39721
  7. 05 Jun, 2017 1 commit
  8. 01 Jun, 2017 1 commit
  9. 29 May, 2017 2 commits
  10. 26 May, 2017 1 commit
    • Marko Mäkelä's avatar
      MDEV-12052 Shutdown crash presumably due to master thread activity · 449a88e1
      Marko Mäkelä authored
      InnoDB shutdown assumes that once the server has entered
      SRV_SHUTDOWN_FLUSH_PHASE, no change to persistent data is allowed.
      It was possible for the master thread to wake up while shutdown
      is executing in SRV_SHUTDOWN_FLUSH_PHASE or
      even in SRV_SHUTDOWN_LAST_PHASE.
      
      We do not yet know if further crashes at shutdown are possible.
      Also, we do not know if all the observed crashes could be explained
      by the race conditions that we are now fixing.
      
      srv_shutdown_print_master_pending(): Remove a redundant ut_time() call.
      
      srv_shutdown(): Renamed from srv_master_do_shutdown_tasks().
      
      srv_master_thread(): Do not resume after shutdown has been initiated.
      449a88e1
  11. 23 May, 2017 3 commits
  12. 19 May, 2017 6 commits
  13. 18 May, 2017 10 commits
  14. 17 May, 2017 5 commits