1. 12 Nov, 2020 1 commit
  2. 11 Nov, 2020 2 commits
    • Marko Mäkelä's avatar
      MDEV-22343 Remove SYS_TABLESPACES and SYS_DATAFILES · 5407117a
      Marko Mäkelä authored
      The InnoDB internal tables SYS_TABLESPACES and SYS_DATAFILES as well as the
      INFORMATION_SCHEMA views INNODB_SYS_TABLESPACES and INNODB_SYS_DATAFILES
      were introduced in MySQL 5.6 for no good reason in
      mysql/mysql-server/commit/e9255a22ef16d612a8076bc0b34002bc5a784627
      when the InnoDB support for the DATA DIRECTORY attribute was introduced.
      
      The file system should be the authoritative source of information on files.
      Storing information about file system paths in the file system (symlinks,
      or even the .isl files that were unfortunately chosen as the solution) is
      sufficient. If information is additionally stored in some hidden tables
      inside the InnoDB system tablespace, everything unnecessarily becomes
      more complicated, because more copies of data mean more opportunity
      for the copies to be out of sync, and because modifying the data in
      the system tablespace in the desired way might not be possible at all
      without modifying the InnoDB source code. So, the copy in the system
      tablespace basically is a redundant, non-authoritative source of
      information.
      
      We will stop creating or accessing the system tables SYS_TABLESPACES
      and SYS_DATAFILES.
      
      We will also remove the view
      INFORMATION_SCHEMA.INNODB_SYS_DATAFILES along with SYS_DATAFILES.
      
      The view
      INFORMATION_SCHEMA.INNODB_SYS_TABLESPACES will be repurposed
      to directly reflect fil_system.space_list. The column
      PAGE_SIZE, which would always contain the value of
      the GLOBAL read-only variable innodb_page_size, is
      removed. The column ZIP_PAGE_SIZE, which would actually
      contain the physical page size of a page, is renamed to
      PAGE_SIZE. Finally, a new column FILENAME is added, as a
      replacement of SYS_DATAFILES.PATH.
      
      This will also
      address MDEV-21801 (files that were created before upgrading
      to MySQL 5.6 or MariaDB 10.0 or later were never registered
      in SYS_TABLESPACES or SYS_DATAFILES) and
      MDEV-21801 (information about the system tablespace is not stored
      in SYS_TABLESPACES or SYS_DATAFILES).
      5407117a
    • Marko Mäkelä's avatar
      MDEV-23497 Make ROW_FORMAT=COMPRESSED read-only by default · 9bc874a5
      Marko Mäkelä authored
      Let us introduce the parameter innodb_read_only_compressed
      that is ON by default, making any ROW_FORMAT=COMPRESSED tables
      read-only.
      
      I developed the ROW_FORMAT=COMPRESSED format based on
      Heikki Tuuri's rough design between 2005 and 2008. It might
      have been a good idea back then, but no proper benchmarks were
      ever run to validate the design or the implementation.
      
      The format has been more or less obsolete for years.
      It limits innodb_page_size to 16384 bytes (the default),
      and instant ALTER TABLE is not supported.
      
      This is the first step towards deprecating and removing
      write support for ROW_FORMAT=COMPRESSED tables.
      9bc874a5
  3. 03 Nov, 2020 10 commits
  4. 02 Nov, 2020 18 commits
  5. 01 Nov, 2020 3 commits
  6. 31 Oct, 2020 3 commits
    • Daniel Black's avatar
      MDEV-23630: mysqldump logically dump system table information · d6ea03fa
      Daniel Black authored
      Add --system={all, users, plugins, udfs, servers, stats, timezones}
      
      This will dump system information from the server in
      a logical form like:
      * CREATE USER
      * GRANT
      * SET DEFAULT ROLE
      * CREATE ROLE
      * CREATE SERVER
      * INSTALL PLUGIN
      * CREATE FUNCTION
      
      "stats" is the innodb statistics tables or EITS and
      these are dumped as INSERT/REPLACE INTO statements
      without recreating the table.
      
      "timezones" is the collection of timezone tables
      which are important to transfer to generate identical
      results on restoration.
      
      Two other options have an effect on the SQL generated by
      --system=all. These are mutually exclusive of each other.
      * --replace
      * --insert-ignore
      
      --replace will include "OR REPLACE" into the logical form
      like:
      * CREATE OR REPLACE USER ...
      * DROP ROLE IF EXISTS (MySQL-8.0+)
      * CREATE OR REPLACE ROLE ...
      * UNINSTALL PLUGIN IF EXISTS (10.4+) ... (before INSTALL PLUGIN)
      * DROP FUNCTION IF EXISTS (MySQL-5.7+)
      * CREATE OR REPLACE [AGGREGATE] FUNCTION
      * CREATE OR REPLACE SERVER
      
      --insert-ignore uses the construct " IF NOT EXISTS" where
      supported in the logical syntax.
      
      'CREATE OR REPLACE USER' includes protection against
      being run as the same user that is importing the mysqldump.
      
      Includes experimental support for dumping mysql-5.7/8.0
      system tables and exporting logical SQL compatible with MySQL.
      
      Updates mysqldump man page, including this information and
      (removing obsolute bug reference)
      
      Reviewed-by: anel@mariadb.org
      d6ea03fa
    • Oleksandr Byelkin's avatar
      Merge branch '10.3' into 10.4 · 80c951ce
      Oleksandr Byelkin authored
      80c951ce
    • Elena Stepanova's avatar
      6d3792a9
  7. 30 Oct, 2020 3 commits
    • Daniel Black's avatar
      MDEV-22974: mysql_native_password make "invalid" valid · 5b779c22
      Daniel Black authored
      Per b9f3f068, mysql_system_tables_data.sql creates
      a mysql_native_password with a salted hash of "invalid" so that `set password`
      will detect a native password can be applied:.
      
      SHOW CREATE USER; diligently uses this value in its output
      generating the SQL:
      
         MariaDB [(none)]> show create user;
      
         +---------------------------------------------------------------------------------------------------+
         | CREATE USER for dan@localhost                                                                     |
         +---------------------------------------------------------------------------------------------------+
         | CREATE USER `dan`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket |
         +---------------------------------------------------------------------------------------------------+
      
      Attempting to execute this before this patch results in:
      
        MariaDB [(none)]>  CREATE USER `dan2`@`localhost` IDENTIFIED VIA mysql_native_password USING 'invalid' OR unix_socket;
        ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
      
      As such, deep the implementation of mysql_native_password we make "invalid" valid (pun intended)
      such that the above create user will succeed. We do this by storing
      "*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE" (credit: Oracle MySQL), that is of an INCORRECT
      length for a scramble.
      
      In native_password_authenticate we check the length of this cached value
      and immediately fail if it is anything other than the scramble length.
      
      native_password_get_salt is only called in the context of set_user_salt, so all setting of native
      passwords to hashed content of 'invalid', quite literally create an invalid password.
      
      So other forms of "invalid" are valid SQL in creating invalid passwords:
      
         MariaDB [(none)]> set password = 'invalid';
         Query OK, 0 rows affected (0.001 sec)
      
         MariaDB [(none)]> alter user dan@localhost IDENTIFIED BY PASSWORD 'invalid';
         Query OK, 0 rows affected (0.000 sec)
      
      closes #1628
      
      Reviewer: serg@mariadb.com
      5b779c22
    • Marko Mäkelä's avatar
      MDEV-24054 Assertion in_LRU_list failed in buf_flush_try_neighbors() · b0ff7916
      Marko Mäkelä authored
      buf_flush_try_neighbors(): Before invoking buf_page_t::ready_for_flush(),
      check that the freshly looked up buf_pool.page_hash entry actually is
      a buffer page and not a buf_pool.watch[] sentinel for purge buffering.
      
      This race condition was introduced in MDEV-15053
      (commit b1ab211d).
      It is rather hard to hit this bug, because
      buf_flush_check_neighbors() already checked the condition.
      The problem exists if buf_pool.watch_set() was invoked for
      a page in the range after the check in buf_flush_check_neighbor()
      had been finished.
      b0ff7916
    • Oleksandr Byelkin's avatar
      Merge branch '10.2' into 10.3 · 794f6651
      Oleksandr Byelkin authored
      794f6651