1. 23 Oct, 2020 5 commits
    • Sergei Golubchik's avatar
      MDEV-21201 No records produced in information_schema query, depending on projection · e64084d5
      Sergei Golubchik authored
      Reimplement MDEV-14275 Improving memory utilization for information schema
      
      Postpone temp table instantiation until after setup_fields().
      
      Replace all unused (not marked in read_set) columns in an I_S table
      with CHAR(0). This can drastically reduce the footprint of a MEMORY
      table (a TABLE_CATALOG alone is 1538 bytes per row).
      
      This does not change the engine. If the table was decided to be Aria
      (because of, say, blobs) then after optimization it'll stay Aria
      even if all blobs were removed.
      
      Note 1: when transforming table structure, share->blob_fields is
      preserved, otherwise Aria might switch from DYNAMIC to STATIC row format
      and expect a special field for a deleted mark, which create_tmp_tabe
      didn't provide.
      
      Note 2: optimizer was doing handler::info() (to know the number of rows)
      before the temp table is populated. That didn't make much sense. Now
      it's done before the table is even instantiated. Preserve the old
      behavior and report 0 rows.
      
      This reverts e2664ee8 and a8458a23
      e64084d5
    • Sergei Golubchik's avatar
      cleanup: use predefined CMAKE_DL_LIBS · 6cefe7d3
      Sergei Golubchik authored
      instead of, say, MY_SEARCH_LIBS(dlopen dl LIBDL)
      6cefe7d3
    • Sergei Golubchik's avatar
      cleanup: use my_multi_malloc(), etc · 641f81ba
      Sergei Golubchik authored
      641f81ba
    • Alexey Botchkov's avatar
      MDEV-19443 server_audit plugin doesn't log proxy users. · 5a9484b7
      Alexey Botchkov authored
      PROXY_USER event added.
      
      Conflicts:
      	plugin/server_audit/server_audit.c
      5a9484b7
    • Anel Husakovic's avatar
      MDEV-21786 mysqldump will forget sequence definition details on --no-data dump · 81870e49
      Anel Husakovic authored
      - Original patch was contributed by Jani Tolonen <jani.k.tolonen@gmail.com>
      https://github.com/an3l/server/commits/bb-10.3-anel-MDEV-21786-dump-sequence
      which distinguishes data structure (linked list) of sequences from
      tables.
      - Added standard sql output to prevent future changes
      of sequences and disabled locks for sequences.
      - Added test case for `MDEV-20070: mysqldump won't work correct on
      sequences` where table column depends on sequence value.
      - Restore sequence last value in the following way:
        - Find `next_not_cached_value` and use it to `setval()`
        - We just need for logical restore, so don't execute `setval()`
        - `setval()` should be showed also in case of `--no-data` option.
      
      Reviewed-by: daniel@mariadb.org
      81870e49
  2. 22 Oct, 2020 1 commit
  3. 21 Oct, 2020 5 commits
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 620ea816
      Marko Mäkelä authored
      620ea816
    • Dmitry Shulga's avatar
      MDEV-23925: Fixed warnings generated during compilation of mysys_ssl/openssl.c on MacOS · a1b6691f
      Dmitry Shulga authored
      Compiler warnings like one listed below are generated during server build on MacOS:
      In file included from server-10.2-MDEV-23564/mysys_ssl/openssl.c:33:
      In file included from /usr/local/include/openssl/evp.h:16:
      In file included from /usr/local/include/openssl/bio.h:20:
      /usr/local/include/openssl/crypto.h:206:10: warning: 'CRYPTO_cleanup_all_ex_data' macro redefined [-Wmacro-redefined]
                 ^
        /mariadb/server-10.2-MDEV-23564/include/ssl_compat.h:46:9: note: previous definition is here
                ^
      
      In case MariaDB serer is build with -DCMAKE_BUILD_TYPE=Debug it results in
      build error.
      
      The reason of compiler warnings is that header file <ssl_compat.h>
      included before the openssl system header files. File ssl_compat.h
      contains some macros with the same names as SSL API functions declared
      in the openssl system header files. It resulted in duplicate
      symbols that produces compiler warnings.
      
      To fix the issue the header file ssl_compat.h should be included
      after a line where openssl system header is included.
      a1b6691f
    • Daniel Black's avatar
      MDEV-23887: check_linker_flags correct for old cmake compatibility · b4c225ac
      Daniel Black authored
      It was only from CMake-3.14.0 that CMAKE_REQUIRED_LINK_OPTIONS
      was used in CHECK_CXX_SOURCE_COMPILES. Without this, it could be
      the case (as was on OSX) that a flag was never checked in
      CHECK_CXX_SOURCE_COMPILES, the CHECK successfully passed, but
      failed at link time.
      
      As such we use CMAKE_REQUIRED_LIBRARIES to include the flags to check
      as its compatible enough with the cmake versions for non-Windows
      compilers/linkers.
      
      Tested on x86_64 with:
      * 3.11.4
      * 3.17.4
      
      Corrects: 7473e184
      
      In the future:
      * cmake >=3.14.0 can use CMAKE_REQUIRED_LINK_OPTIONS
      * cmake >=3.18.0 can use CHECK_LINKER_FLAG (with policy CMP0057 NEW)
      (e.g: commit c7ac2deff9a2c965887dcc67cbf2a3a7c3e0123d)
      
      CMAKE_REQUIRED_LIBRARIES suggested by serg@mariadb.com
      
      Reviewed-by: anel@mariadb.org
      b4c225ac
    • Marko Mäkelä's avatar
      InnoDB 5.6.50 · 65b7f72b
      Marko Mäkelä authored
      The only applicable InnoDB change to MariaDB that was made
      between MySQL 5.6.49 and MySQL 5.6.50 is MDEV-23999.
      65b7f72b
    • Marko Mäkelä's avatar
      MDEV-23999 Potential stack overflow in InnoDB fulltext search · c7552969
      Marko Mäkelä authored
      fts_query_t::nested_sub_exp: Keep track of nested
      fts_ast_visit_sub_exp() calls.
      
      fts_ast_visit_sub_exp(): Return DB_OUT_OF_MEMORY if the
      maximum recursion depth is exceeded.
      
      This is motivated by a change in MySQL 5.6.50:
      mysql/mysql-server@e2a46b4834a0030e5380d45789772cb6beab6e92
      Bug #29929684 USING MANY NESTED ARGUMENTS WITH BOOLEAN FTS CAN LEAD
      TO TERMINATE SERVER
      c7552969
  4. 20 Oct, 2020 14 commits
    • Marko Mäkelä's avatar
      Revert MDEV-23484 Rollback unnecessarily acquires dict_operation_lock · 0049d5b5
      Marko Mäkelä authored
      In row_undo_ins_remove_clust_rec() and similar places,
      an assertion !node->trx->dict_operation_lock_mode could fail,
      because an online ALTER is not allowed to run at the same time
      while DDL operations on the table are being rolled back.
      
      This race condition would be fixed by always acquiring an InnoDB
      table lock in ha_innobase::prepare_inplace_alter_table() or
      prepare_inplace_alter_table_dict(), or by ensuring that recovered
      transactions are protected by MDL that would block concurrent DDL
      until the rollback has been completed.
      
      This reverts commit 15093639
      and commit 22c4a751.
      0049d5b5
    • Marko Mäkelä's avatar
      MDEV-23996 Race conditions in SHOW ENGINE INNODB MUTEX · 832a6acb
      Marko Mäkelä authored
      The function innodb_show_mutex_status() is the only ultimate caller of
      LatchCounter::iterate() via MutexMonitor::iterate(). Because the call
      is not protected by LatchCounter::m_mutex, any mutex_create() or
      mutex_free() that is invoked concurrently during the execution, bad
      things such as a crash could happen.
      
      The most likely way for this to happen is buffer pool resizing,
      which could cause buf_block_t::mutex (which existed before MDEV-15053)
      to be created or freed. We could also register InnoDB mutexes in
      TrxFactory::init() if trx_pools needs to grow.
      
      The view INFORMATION_SCHEMA.INNODB_MUTEXES is not affected, because it
      only displays information about rw-locks, not mutexes.
      
      This commit intentionally touches also MutexMonitor::iterate()
      and the only code that interfaces with LatchCounter::iterate()
      to make it clearer for future readers that the scattered code
      that is obfuscated by templates belongs together.
      
      This is based on
      mysql/mysql-server@273a93396f49c7e0a8b07b260128d9a990c2b154
      832a6acb
    • Anel Husakovic's avatar
      Update mtr help · d1af93a5
      Anel Husakovic authored
      - Based on patch: d6a983351c5a454bd0cb113852f
      - Update combination example for 10.2 (commit 2a3fe45d added change
      for 10.3+)
      ```
      ==============================================================================
      
      TEST                                      RESULT   TIME (ms) or COMMENT
      --------------------------------------------------------------------------
      
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      rpl.rpl_invoked_features 'innodb,mix'    [ pass ]   1677
      rpl.rpl_invoked_features 'innodb,row'    [ pass ]   3516
      rpl.rpl_invoked_features 'innodb,stmt'   [ pass ]   1609
      --------------------------------------------------------------------------
      ```
      - `gdb` option will be added during the merge
      d1af93a5
    • Anel Husakovic's avatar
      Updated mtr help · 0627c4ae
      Anel Husakovic authored
      - Updated combination example to use `innodb_plugin`
      ```
      $ ./mysql-test/mtr rpl.rpl_invoked_features # no rpl.rpl_invoked_features,mix,xtradb_plugin
      
      worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 16000..16019
      rpl.rpl_invoked_features 'innodb_plugin,mix' [ pass ]    904
      rpl.rpl_invoked_features 'mix,xtradb'    [ pass ]   1707
      rpl.rpl_invoked_features 'innodb_plugin,row' [ pass ]    927
      rpl.rpl_invoked_features 'row,xtradb'    [ pass ]    828
      rpl.rpl_invoked_features 'innodb_plugin,stmt' [ pass ]    855
      rpl.rpl_invoked_features 'stmt,xtradb'   [ pass ]    952
      --------------------------------------------------------------------------
      ```
      - `gdb` option can take optional gdb arguments (good documentation in
      KB)
      0627c4ae
    • Kentoku SHIBA's avatar
      MDEV-20100 MariaDB 13.3.9 Crash "[ERROR] mysqld got signal 11 ;" · 88d22f0e
      Kentoku SHIBA authored
      Some functions on ha_partition call functions on all partitions, but handler->reset() is only called that pruned by m_partitions_to_reset. So Spider didn't clear pointer on unpruned partitions, if the unpruned partitions are used by next query, Spider reference the pointer that is already freed.
      88d22f0e
    • Julius Goryavsky's avatar
      MDEV-21951: mariabackup SST fail if data-directory have lost+found directory · 888010d9
      Julius Goryavsky authored
      To fix this, it is necessary to add an option to exclude the
      database with the name "lost+found" from processing (the database
      name will be checked by the check_if_skip_database_by_path() or
      by the check_if_skip_database() function, and as a result
      "lost+found" will be skipped).
      
      In addition, it is necessary to slightly modify the verification
      logic in the check_if_skip_database() function.
      
      Also added a new test galera_sst_mariabackup_lost_found.test
      888010d9
    • Oleksandr Byelkin's avatar
      MDEV-23327: followup · 692a44b3
      Oleksandr Byelkin authored
      fix an error with locked taböes
      692a44b3
    • Aleksey Midenkov's avatar
      MDEV-23968 CREATE TEMPORARY TABLE .. LIKE (system versioned table) returns... · 9b46d8e5
      Aleksey Midenkov authored
      MDEV-23968 CREATE TEMPORARY TABLE .. LIKE (system versioned table) returns error if unique index is defined in the table
      
      - Remove row_start/row_end from keys in fix_create_like();
      
      - Disable manual adding of implicit row_start/row_end to indexes on
        CREATE TABLE. INVISIBLE_SYSTEM fields are unoperable by user;
      
      - Fix memory leak on allocation of Key_part_spec.
      9b46d8e5
    • Aleksey Midenkov's avatar
      MDEV-23779 Error upon querying the view, that selecting from versioned table with partitions · ddea8f6a
      Aleksey Midenkov authored
      PARTITION clause in SELECT means query is non-versioned (see
      WITH_PARTITION_STORAGE_ENGINE in vers_setup_conds()).
      
      vers_setup_conds() expands such query to SYSTEM_TIME_ALL which is then
      added to VIEW specification. When VIEW is queried both clauses
      PARTITION and FOR SYSTEM_TIME ALL lead to ER_VERS_QUERY_IN_PARTITION
      (same place WITH_PARTITION_STORAGE_ENGINE).
      
      Fix removes FOR SYSTEM_TIME ALL from VIEW by accessing original
      SYSTEM_TIME clause: the one specified in parser. As a side-effect
      EXPLAIN SELECT displays SYSTEM_TIME specified in SELECT which is
      user-friendly.
      ddea8f6a
    • Aleksey Midenkov's avatar
      MDEV-23799 CREATE .. SELECT wrong result on join versioned table · a3c379ea
      Aleksey Midenkov authored
      For join to work correctly versioning condition must be added to table
      on_expr. Without that JOIN_CACHE gets expression (1)
      
        trigcond(xtitle.row_end = TIMESTAMP'2038-01-19 06:14:07.999999') and
        trigcond(xtitle.elementId = x.`id` and xtitle.pkey = 'title')
      
      instead of (2)
      
        trigcond(xtitle.elementId = x.`id` and xtitle.pkey = 'title')
      
      for join_null_complements(). It is NULL-row of xtitle for
      complementing the join and the above comparisons of course FALSE, but
      trigcond (Item_func_trig_cond) makes them TRUE via its trig_var
      property which is bound to some boolean properties of JOIN_TAB.
      
      Expression (2) evaluated to TRUE because its trig_var is bound to
      first_inner_tab->not_null_compl. The expression (1) does not evaluate
      correctly because row_end comparison's trig_var is bound to
      first_inner->found earlier. As a result JOIN_CACHE::check_match()
      skipped the row for join_null_complements().
      
      When we add versioning condition to table's on_expr the optimizer in
      make_join_select() distributes conditions differently. tmp_cond
      inherits on_expr value and in Good case it is full expression
      
      xgender.elementId = x.`id` and xgender.pkey = 'gender' and
      xgender.row_end = TIMESTAMP'2038-01-19 06:14:07.999999'
      
      while in Bad case it is only
      
      xgender.elementId = x.`id` and xgender.pkey = 'gender'.
      
      Later in Good row_end condition is optimized out and we get one
      trigcond in form of (2).
      a3c379ea
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-23072 Diskspace not reused for Blob in data file · 7b7ea331
      Thirunarayanan Balathandayuthapani authored
      - This issue is caused by commit a4948daf.
      Purge doesn't free the externally stored page associated with the
      last record of the root page. In that case, purge thread does empty
      the root page and leads to more orphaned blob page in the tablespace.
      Purge thread should free the blob even for the last record of the
      root page.
      
      Reviewed-by: Marko Mäkelä
      7b7ea331
    • Rucha Deodhar's avatar
      MDEV-23445: LIMIT ROWS EXAMINED throws error in Debug build only · 00bf4882
      Rucha Deodhar authored
      Analysis: When we reach the maximum limit to examine rows killed_state is set
      as ABORT. But this isn't an actual error and we still return TRUE. This
      eventually sets error as UNKNOWN ERROR.
      Fix: Check if need to stop execution by checking the killed state. If we have
      to abort it, return false because this isn't an actual error.
      00bf4882
    • Rucha Deodhar's avatar
      MDEV-5628: Assertion `! is_set()' or `!is_set() || (m_status == DA_OK_BULK && · 9fca6645
      Rucha Deodhar authored
      is_bulk_op())' fails on UPDATE on a partitioned table with subquery
      (MySQL:71630)
      
      Analysis and fix: Error is not checked. So correct error state is not returned.
      Fix: Check for error and return the error state.
      9fca6645
    • Rucha Deodhar's avatar
      MDEV-17729: Assertion `! is_set() || m_can_overwrite_status' failed in · d36cd5f0
      Rucha Deodhar authored
      Diagnostics_area::set_error_status
      
      Analysis: When strict mode is enabled, all warnings are converted to errors
      including those which do not occur because of bad data.
      Fix: Query should not be aborted when we have warning because limit to
      examine rows was reached because it doesn't happen due to bad data.
      So thd->abort_on_warning should be false.
      d36cd5f0
  5. 19 Oct, 2020 4 commits
  6. 17 Oct, 2020 2 commits
    • Anel Husakovic's avatar
      MDEV-16676 Using malloc-lib=jemalloc in MariaDB 10.2 causes non-critical error... · 95bb3cb8
      Anel Husakovic authored
      MDEV-16676 Using malloc-lib=jemalloc in MariaDB 10.2 causes non-critical error about missing mysql_config on startup
      
      - This commit is based on patch 84fe9720a4d2483ff67b6a and suggestion of
      Jean Weisbuch to use `ldconfig -p`
      - Format of ldconfig output:
      "libjemalloc.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libjemalloc.so.1"
      
      ```
      $ ./scripts/mysqld_safe
      201013 13:36:50 mysqld_safe Adding '/usr/lib/x86_64-linux-gnu/libjemalloc.so.1' to LD_PRELOAD for mysqld
      201013 13:36:50 mysqld_safe Logging to '/home/anel/builds/data-10.5/mysqld_safe_anel.err'.
      201013 13:36:50 mysqld_safe Starting mysqld daemon with databases from /home/anel/builds/data-10.5
      ```
      Reviewed by: Daniel Black, Faustin Lammler
      95bb3cb8
    • Marko Mäkelä's avatar
      Clean up some encryption tests · db02c458
      Marko Mäkelä authored
      Instead of pointlessly waiting for a page flush to occur, take
      the matter into our own hands and request an explicit flush.
      Also, test with the minimum necessary amount of data (0 or 1 rows)
      so that both page encryption and decryption will be exercised.
      db02c458
  7. 16 Oct, 2020 1 commit
    • Monty's avatar
      MDEV-23248 Server crashes in mi_extra / ha_partition::loop_extra_alter upon REORGANIZE · 311b7f94
      Monty authored
      This also fixes some issues with
      MDEV-23730 s3.replication_partition 'innodb,mix' segv
      
      The problem was that mysql_change_partitions() closes all handler files
      in case of error, which was not properly reflected in
      fast_alter_partition_table(). This caused handle_alter_part_error() to
      try to close already closed tables, which caused the crash.
      
      Fixed fast_alter_partion_table() to reflect when tables are opened.
      I also fixed that ha_partition::change_partitions() resets m_new_file in
      case of errors.
      Either of the above changes fixes the issue, but both are needed to ensure
      that the code works as expected.
      311b7f94
  8. 15 Oct, 2020 5 commits
    • Sergei Petrunia's avatar
      MDEV-23938: innodb row_search_idx_cond_check handle ICP_ABORTED_BY_USER · 3e807d25
      Sergei Petrunia authored
      - row_search_mvcc() should return DB_INTERRUPTED when it got killed.
      - Add a syncpoint for the ICP check.
      - Add test coverage for killed-during-ICP-check scenario
      
      Backport of MDEV-22761 fixes for ICP from 10.4 commits:
      * a6f95648
      * c03885cd
      
      XtraDB was fixed in deb3b9a1
      
      Reviewer: Daniel Black
      3e807d25
    • Julius Goryavsky's avatar
      MDEV-23659: Update Galera disabled.def file · ebb39bc5
      Julius Goryavsky authored
      This fix removes from the list of disabled tests all
      tests that were fixed by the patch for MDEV-21770.
      ebb39bc5
    • Julius Goryavsky's avatar
      MDEV-21770: `galera_3nodes.galera_ipv6_mariabackup` fails · 31201dcb
      Julius Goryavsky authored
      This patch fixes several flaws in the SST scripts that cause
      failures while running tests that use version 6 IP addresses
      for cluster nodes.
      
      First, if the netcat utility is used for streaming (but not socat),
      then in accordance with its command line syntax, we need to remove
      the square brackets around the IPv6 address. However, for socat,
      the address must contain square brackets, as before.
      
      Secondly, if an IPv6 address is used, then from the joiner side for
      a number of systems (such as Debian) we need to explicitly specify
      the "-6" option, otherwise a listening socket with an IPv6 address
      may not be created.
      
      This patch also contains code improvements in the wsrep_sst_common.
      Changed the code that pars the connection address - fixed the
      shortcomings that sometimes led to incorrect parsing of parameters
      when using shells other than the latest versions of bash.
      
      Also, this patch removes the duplicate code that is intended
      for parsing the connection address and which was located in the
      wsrep_sst_mariabackup file, since all the necessary actions have
      already been done in wsrep_sst_common and there they are done in
      such a way that any shell is supported, not just bash.
      
      The fix does not require separate tests, since all the
      necessary tests are already present in the galera_3nodes suite.
      On the contrary, after this fix, tests using IPv6 addresses can
      be removed from the disabled list (this will be done in a separate
      commit related to MDEV-23659).
      31201dcb
    • Oleksandr Byelkin's avatar
      Fix the constants names · 24c5af67
      Oleksandr Byelkin authored
      24c5af67
    • Daniel Black's avatar
      MDEV-23201: mysql_upgrade order mysql.user for 5.7 cross-upgrade · ff8ffef3
      Daniel Black authored
      As MariaDB tables are expected in a fixed order, the cross upgrade
      previously placed roles, default_role and max_statement_time after
      now unused mysql-5.7 columns.
      
      Test:
      
      $ cp -a /usr/local/mysql-5.7.31/data/ /tmp/m57data
      $ sql/mysqld --no-defaults --skip-networking --datadir=/tmp/m57data  --socket=/tmp/${PWD##*/}.sock   --verbose --lc-messages-dir=$PWD/sql/share
      2020-10-02 11:02:05 140135193212864 [Note] sql/mysqld (mysqld 10.2.34-MariaDB) starting as process 1457667 ...
      2020-10-02 11:02:05 140135193212864 [Note] InnoDB: Mutexes and rw_locks use GCC atomic built
      
      $ client/mysql_upgrade --no-defaults -u root -pbob  -S /tmp/build-mariadb-server-10.2.sock
      MySQL upgrade detected
      Phase 1/7: Checking and upgrading mysql database
      Processing databases
      mysql
      mysql.columns_priv                                 OK
      mysql.db                                           OK
      mysql.engine_cost                                  OK
      mysql.event                                        OK
      mysql.func                                         OK
      mysql.gtid_executed                                OK
      mysql.help_category                                OK
      mysql.help_keyword                                 OK
      mysql.help_relation                                OK
      mysql.help_topic                                   OK
      mysql.innodb_index_stats                           OK
      mysql.innodb_table_stats                           OK
      mysql.ndb_binlog_index                             OK
      mysql.plugin                                       OK
      mysql.proc                                         OK
      mysql.procs_priv                                   OK
      mysql.proxies_priv                                 OK
      mysql.server_cost                                  OK
      mysql.servers                                      OK
      mysql.slave_master_info                            OK
      mysql.slave_relay_log_info                         OK
      mysql.slave_worker_info                            OK
      mysql.tables_priv                                  OK
      mysql.time_zone                                    OK
      mysql.time_zone_leap_second                        OK
      mysql.time_zone_name                               OK
      mysql.time_zone_transition                         OK
      mysql.time_zone_transition_type                    OK
      mysql.user                                         OK
      Upgrading from a version before MariaDB-10.1
      Phase 2/7: Installing used storage engines
      
      Result:
      
      | user  | CREATE TABLE `user` (
        `Host` char(60) COLLATE utf8_bin NOT NULL DEFAULT '',
        `User` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
        `Password` char(41) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL DEFAULT '',
        `Select_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Insert_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Update_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Delete_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Drop_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Reload_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Shutdown_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Process_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `File_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Grant_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `References_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Index_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Alter_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Show_db_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Super_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_tmp_table_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Lock_tables_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Execute_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Repl_slave_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Repl_client_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Show_view_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Alter_routine_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_user_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Event_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Trigger_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `Create_tablespace_priv` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `ssl_type` enum('','ANY','X509','SPECIFIED') CHARACTER SET utf8 NOT NULL DEFAULT '',
        `ssl_cipher` blob NOT NULL,
        `x509_issuer` blob NOT NULL,
        `x509_subject` blob NOT NULL,
        `max_questions` int(11) unsigned NOT NULL DEFAULT 0,
        `max_updates` int(11) unsigned NOT NULL DEFAULT 0,
        `max_connections` int(11) unsigned NOT NULL DEFAULT 0,
        `max_user_connections` int(11) NOT NULL DEFAULT 0,
        `plugin` char(64) CHARACTER SET latin1 NOT NULL DEFAULT '',
        `authentication_string` text COLLATE utf8_bin NOT NULL,
        `password_expired` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `is_role` enum('N','Y') CHARACTER SET utf8 NOT NULL DEFAULT 'N',
        `default_role` char(80) COLLATE utf8_bin NOT NULL DEFAULT '',
        `max_statement_time` decimal(12,6) NOT NULL DEFAULT 0.000000,
        `password_last_changed` timestamp NULL DEFAULT NULL,
        `password_lifetime` smallint(5) unsigned DEFAULT NULL,
        `account_locked` enum('N','Y') COLLATE utf8_bin NOT NULL DEFAULT 'N',
        PRIMARY KEY (`Host`,`User`)
      ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='Users and global privileges' |
      
      MariaDB [(none)]>  CREATE ROLE `aRole`;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> SET ROLE `aRole`;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> FLUSH PRIVILEGES;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> SET ROLE `aRole`;
      Query OK, 0 rows affected (0.00 sec)
      
      MariaDB [(none)]> SELECT `User`, `is_role` FROM `mysql`.`user`;
      +---------------+---------+
      | User          | is_role |
      +---------------+---------+
      | root          | N       |
      | mysql.session | N       |
      | mysql.sys     | N       |
      | dan           | N       |
      | aRole         | Y       |
      +---------------+---------+
      5 rows in set (0.00 sec)
      
      Reviewer: Anel Husakovic
      ff8ffef3
  9. 14 Oct, 2020 3 commits