1. 15 Feb, 2019 3 commits
    • Jan Lindström's avatar
      MDEV-18109: Galera 4: run galera_sr test suite · dcaabf07
      Jan Lindström authored
      Fix some of the galera_sr suite test failures.
      Remove tests that are not going to be run because required
      feature is not supported.
      
      	modified:   mysql-test/suite/galera_sr/disabled.def
      	deleted:    mysql-test/suite/galera_sr/r/GCF-574.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_cc_slave.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_kill_all_norecovery.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_load_data.result
      	deleted:    mysql-test/suite/galera_sr/r/galera_sr_sbr.result
      	modified:   mysql-test/suite/galera_sr/r/mysql-wsrep-features#148.result
      	deleted:    mysql-test/suite/galera_sr/r/mysql-wsrep-features#29.result
      	deleted:    mysql-test/suite/galera_sr/t/GCF-574.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_cc_slave.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.cnf
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_kill_all_norecovery.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_load_data.test
      	deleted:    mysql-test/suite/galera_sr/t/galera_sr_sbr.test
      	modified:   mysql-test/suite/galera_sr/t/mysql-wsrep-features#148.test
      	deleted:    mysql-test/suite/galera_sr/t/mysql-wsrep-features#29.test
      dcaabf07
    • Marko Mäkelä's avatar
      MDEV-15564: Fix bool/ibool type mismatch · e17fc729
      Marko Mäkelä authored
      dtype_is_string_type(), dtype_is_binary_string_type(),
      dtype_is_non_binary_string_type(): Define as inline functions that
      return bool, not ibool.
      e17fc729
    • Marko Mäkelä's avatar
      MDEV-15564: Fix the non-debug build · 10c05d4a
      Marko Mäkelä authored
      10c05d4a
  2. 14 Feb, 2019 11 commits
    • Vladislav Vaintroub's avatar
      MDEV-18549 Failing assertion: opt_no_lock during mariabackup --backup · 282ba973
      Vladislav Vaintroub authored
      The assertion happens under BACKUP STAGE BLOCK_COMMIT, when a DDL on a
      temporary table (#sql-xxx) is found.
      
      Apparently, assumption that all DDLs are blocked under FTWRL does not
      hold for BACKUP STAGE, and temporary tables can still have ALTERs
      
      The fix is to relax the assertion, and only check for opt_no_lock if
      backup is *really* inconsistent, i.e either optimized DDL or CREATE/RENAME
      are done on the tables that were not skipped during backup.
      282ba973
    • Marko Mäkelä's avatar
      MDEV-15564 Avoid table rebuild in ALTER TABLE on collation or charset changes · ea0be9e2
      Marko Mäkelä authored
      Allow ALGORITHM=INSTANT (or avoid touching any data)
      when changing the collation, or in some cases, the character set,
      of a non-indexed CHAR or VARCHAR column. There is no penalty
      for subsequent DDL or DML operations, and compatibility with
      older MariaDB versions will be unaffected.
      
      Character sets may be changed when the old encoding is compatible
      with the new one. For example, changing from ASCII to anything
      ASCII-based, or from 3-byte to 4-byte UTF-8 can sometimes be
      performed instantly.
      
      This is joint work with Eugene Kosov.
      The test cases as well as ALTER_CONVERT_TO, charsets_are_compatible(),
      Type_handler::Charsets_are_compatible() are his work.
      The Field_str::is_equal(), Field_varstring::is_equal() and
      the InnoDB changes were mostly rewritten by me due to conflicts
      with MDEV-15563.
      
      Limitations:
      
      Changes of indexed columns will still require
      ALGORITHM=COPY. We should allow ALGORITHM=NOCOPY and allow
      the indexes to be rebuilt inside the storage engine,
      without copying the entire table.
      
      Instant column size changes (in bytes) are not supported by
      all storage engines.
      
      Instant CHAR column changes are only allowed for InnoDB
      ROW_FORMAT=REDUNDANT. We could allow this for InnoDB
      when the CHAR internally uses a variable-length encoding,
      say, when converting from 3-byte UTF-8 to 4-byte UTF-8.
      
      Instant VARCHAR column changes are allowed for InnoDB
      ROW_FORMAT=REDUNDANT, and for others only if the size
      in bytes does not change from 128..255 bytes to more
      than 256 bytes.
      
      Inside InnoDB, this slightly changes the way how MDEV-15563
      works and fixes the result of the innodb.instant_alter_extend test.
      We change the way how ALTER_COLUMN_EQUAL_PACK_LENGTH_EXT
      is handled. All column extension, type changes and renaming
      now go through a common route, except when ctx->is_instant()
      is in effect, for example, instant ADD or DROP COLUMN has
      been initiated. Only in that case we will go through
      innobase_instant_try() and rewrite all column metadata.
      
      get_type(field, prtype, mtype, len): Convert a SQL data type into
      InnoDB column metadata.
      
      innobase_rename_column_try(): Remove the update of SYS_COLUMNS.
      
      innobase_rename_or_enlarge_column_try(): New function,
      replacing part of innobase_rename_column_try() and all of
      innobase_enlarge_column_try(). Also changes column types.
      
      innobase_rename_or_enlarge_columns_cache(): Also change
      the column type.
      ea0be9e2
    • Sergei Golubchik's avatar
      cleanup: Account_options · e5701d83
      Sergei Golubchik authored
      move account options from LEX to Account_options structure
      namely, mqh and ssl_*
      
      Also, use LEX_CSTRING for ssl_*/x509_* strings and move
      setting of ACL_USER::account_locked where it belongs
      e5701d83
    • Robert Bindar's avatar
      MDEV-13095 Implement User Account locking · 6c8ce999
      Robert Bindar authored
      Add server support for user account locking.
      This patch extends the ALTER/CREATE USER statements for
      denying a user's subsequent login attempts:
        ALTER USER
          user [, user2] ACCOUNT [LOCK | UNLOCK]
        CREATE USER
          user [, user2] ACCOUNT [LOCK | UNLOCK]
      The SHOW CREATE USER statement was updated to display the
      locking state of an user.
      
      Closes #1006
      6c8ce999
    • Sergei Golubchik's avatar
      bugfix: mysql_fix_privilege_tables table_schema=database() · d89cdfc2
      Sergei Golubchik authored
      fix mysql_fix_privilege_tables to look for the `user` table in the
      correct schema when deciding whether to convert it to `global_priv` table
      
      make related tests a bit more verbose
      d89cdfc2
    • Sergei Golubchik's avatar
      cleanup: reformat · 84cbd69c
      Sergei Golubchik authored
      84cbd69c
    • Sergei Golubchik's avatar
      c0745e37
    • Sergei Golubchik's avatar
      cleanup: remove THD::query_start_timeval() · 1d8b5524
      Sergei Golubchik authored
      Too easy to abuse. One tends to use it even when
      microseconds are not needed and will be ignored.
      1d8b5524
    • Jan Lindström's avatar
      Merge pull request #1185 from codership/10.4-wsrep_schema_cleanup · c568e253
      Jan Lindström authored
      Cleanup wsrep_schema and remove all references to wsrep_thd_pool
      c568e253
    • Jan Lindström's avatar
      Merge pull request #1183 from codership/10.4-wsrep_debug · 677a1e7c
      Jan Lindström authored
      WSREP debug log levels support
      677a1e7c
    • Daniele Sciascia's avatar
      Cleanup wsrep_schema and remove all references to wsrep_thd_pool · 047754a7
      Daniele Sciascia authored
      * Removed all references related to wsrep_thd_pool (which was removed)
      
      * Removed unused declarations in wsrep_schema.h
      
      * The following would result invalid reads in
        Wsrep_schema::replay_transaction():
        ```
        frag_table->field[4]->val_str(&buf);
      
        Wsrep_schema_impl::end_index_scan(frag_table);
        Wsrep_schema_impl::finish_stmt(thd);
        ret= wsrep_apply_events(thd, rli, buf.c_ptr_safe(), buf.length());
        ```
      
        because `buf` was accessed after closing the table. The fix is to
        perform storage reads using a different THD.
      
      * In Wsrep_schema::recover_sr_transactions(), cluster_table was opened
        for write, however it is only read here. And frag_table was opened
        for read, wereas write is potentially needed.
        Also, avoid copy caused by String::c_ptr() to zero terminate the c
        string, use c_ptr_quick instead.
      047754a7
  3. 13 Feb, 2019 18 commits
    • Igor Babaev's avatar
      Merge branch '10.4' into bb-10.4-mdev17096 · 7d9f45e0
      Igor Babaev authored
      7d9f45e0
    • Marko Mäkelä's avatar
      MDEV-15563: Fix cmake -DPLUGIN_PERFSCHEMA=NO · a081a998
      Marko Mäkelä authored
      Commit 22feb179 broke the build
      with performance_schema disabled.
      
      dict_col_t::same_charset(): An auxiliary function to
      dict_col_t::same_format(). Determine if two non-binary string
      columns have the same character set.
      a081a998
    • mkaruza's avatar
      WSREP debug log levels support · 3e64e7f2
      mkaruza authored
      Global variable wsrep_debug now can be used to filter wsrep-lib messages based on debug level provided.
      Type of wsrep_debug is now set to be unsigned int, so tests and configuration files changed accordingly.
      3e64e7f2
    • Monty's avatar
      MDEV-13916 Enforce check constraint on JSON type · 0f489494
      Monty authored
      When creating a field of type JSON, it will be automatically
      converted to TEXT with CHECK (json_valid(`a`)), if there wasn't any
      previous check for the column.
      
      Additional things:
      - Added two bug fixes that was found while testing JSON. These bug
        fixes has also been pushed to 10.3 (with a test case), but as they
        where minimal and needed to get this task done and tested, the fixes
        are repeated here.
        - CREATE TABLE ... SELECT drops constraints for columns that
          are both in the create and select part.
        - If one has both a default expression and check constraint for a
          column, one can get the error "Expression for field `a` is refering
          to uninitialized field `a`.
      - Removed some duplicate MYSQL_PLUGIN_IMPORT symbols
      0f489494
    • Igor Babaev's avatar
      MDEV-17096 Pushdown of simple derived tables to storage engines · 62fad4e8
      Igor Babaev authored
      Fixing failures of federated test on 32-bit platforms
      62fad4e8
    • Marko Mäkelä's avatar
      MDEV-15563: Instant ROW_FORMAT=REDUNDANT column extension · 22feb179
      Marko Mäkelä authored
      This was developed by Aleksey Midenkov based on my design.
      
      In the original InnoDB storage format (that was retroactively named
      ROW_FORMAT=REDUNDANT in MySQL 5.0.3), the length of each index field
      is stored explicitly.
      
      Because of this, we can and now will allow instant conversion from
      VARCHAR to CHAR or VARBINARY to BINARY of equal or greater size,
      as well as instant conversion of TINYINT to SMALLINT to MEDIUMINT
      to INT to BIGINT (while not changing between signed and unsigned).
      
      Theoretically, we could allow changing from an unsigned integer to
      a bigger unsigned integer, as well as changing CHAR to VARCHAR, but
      that would require additional metadata and conversions whenever
      reading old records.
      
      Field_str::is_equal(), Field_varstring::is_equal(), Field_num::is_equal():
      Return the new result IS_EQUAL_PACK_LENGTH_EXT if the table advertises
      HA_EXTENDED_TYPES_CONVERSION capability and we are considering the
      above-mentioned conversions.
      
      ALTER_COLUMN_EQUAL_PACK_LENGTH_EXT: A new ALTER TABLE flag, similar
      to ALTER_COLUMN_EQUAL_PACK_LENGTH but requiring conversions when
      reading the data. The Field::is_equal() result IS_EQUAL_PACK_LENGTH_EXT
      will map to this flag.
      
      dtype_get_fixed_size_low(): For BINARY, CHAR and integer columns
      in ROW_FORMAT=REDUNDANT, return 0 (variable length) from now on.
      
      dtype_get_sql_null_size(): Keep returning the current size for
      BINARY, CHAR and integer columns, so that in ROW_FORMAT=REDUNDANT
      it will remain possible to update in place between NULL and NOT NULL
      values.
      
      btr_index_rec_validate(): Relax a CHECK TABLE length check for
      ROW_FORMAT=REDUNDANT tables.
      
      btr_cur_instant_init_low(): No longer trust fixed_len
      for ROW_FORMAT=REDUNDANT tables.
      
      We cannot rely on fixed_len anymore because the record can have shorter
      length from before instant extension. Note that importing such tablespace
      into earlier MariaDB versions produces ER_TABLE_SCHEMA_MISMATCH when
      using a .cfg file.
      22feb179
    • Marko Mäkelä's avatar
      MDEV-15563: Instant VARCHAR extension for ROW_FORMAT=REDUNDANT · 0ae3ea79
      Marko Mäkelä authored
      In the original InnoDB storage format (which was retroactively named
      ROW_FORMAT=REDUNDANT in MySQL 5.0.3), the length of each index field
      is stored explicitly. Thus, we can and from now on will allow arbitrary
      extension of VARBINARY and VARCHAR columns when the table is in
      ROW_FORMAT=REDUNDANT.
      
      ha_innobase::open(): Advertise a new HA_EXTENDED_TYPES_CONVERSION
      capability for ROW_FORMAT=REDUNDANT tables.
      
      Field_varstring::is_equal(): If the HA_EXTENDED_TYPES_CONVERSION
      capability is advertised for the table, return IS_EQUAL_PACK_LENGTH
      for any length extension.
      0ae3ea79
    • Marko Mäkelä's avatar
      MDEV-15563: Allow instant VARCHAR extension from <128 bytes · ad17875c
      Marko Mäkelä authored
      For up to 127 bytes length, InnoDB would use 1 byte for length, and
      that byte would always be less than 128. If the maximum length is
      longer than 255 bytes, InnoDB would use a variable-length encoding
      for the length, using 1 byte for lengths up to 127 bytes, and
      2 bytes for longer lengths.
      
      Thus, 1-byte lengths are always compatible when the maximum size
      changes from less than 128 bytes to anything longer.
      
      Field_varstring::is_equal(): Return IS_EQUAL_PACK_LENGTH also when
      converting from VARCHAR less than 128 bytes to any longer VARCHAR.
      ad17875c
    • Marko Mäkelä's avatar
      MDEV-6111: Adjust a result · 8ef4105a
      Marko Mäkelä authored
      8ef4105a
    • Jan Lindström's avatar
      Merge pull request #1180 from codership/10.4-load-data-splitting · c2c637c5
      Jan Lindström authored
      10.4 make wsrep_load_data_splitting use streaming replication
      c2c637c5
    • Jan Lindström's avatar
      MDEV-18564: Change wsrep_load_data_splitting off by default · 6476126c
      Jan Lindström authored
      Variable wsrep_load_data_splitting is deprecated and should be off
      by default.
      6476126c
    • Vladislav Vaintroub's avatar
      Fix compilation on old gcc · d28dab76
      Vladislav Vaintroub authored
      d28dab76
    • Jan Lindström's avatar
      Merge pull request #1182 from grooverdan/10.4-friendlier-wsrep-message · 91451739
      Jan Lindström authored
      cmake-wsrep: friendly error message about missing wsrep_api.h
      91451739
    • Igor Babaev's avatar
      Merge branch '10.4' into bb-10.4-mdev17096 · 953ca199
      Igor Babaev authored
      953ca199
    • Igor Babaev's avatar
      MDEV-17096 Pushdown of simple derived tables to storage engines · 27c3abde
      Igor Babaev authored
      MDEV-17631 select_handler for a full query pushdown
      
      Added comments and file headers for files introduced in these tasks.
      27c3abde
    • Varun Gupta's avatar
      MDEV-6111 Optimizer Trace · be8709eb
      Varun Gupta authored
      This task involves the implementation for the optimizer trace.
      
      This feature produces a trace for any SELECT/UPDATE/DELETE/,
      which contains information about decisions taken by the optimizer during
      the optimization phase (choice of table access method, various costs,
      transformations, etc). This feature would help to tell why some decisions were
      taken by the optimizer and why some were rejected.
      
      Trace is session-local, controlled by the @@optimizer_trace variable.
      To enable optimizer trace we need to write:
         set @@optimizer_trace variable= 'enabled=on';
      
      To display the trace one can run:
         SELECT trace FROM INFORMATION_SCHEMA.OPTIMIZER_TRACE;
      
      This task also involves:
          MDEV-18489: Limit the memory used by the optimizer trace
          introduces a switch optimizer_trace_max_mem_size which limits
          the memory used by the optimizer trace. This was implemented by
          Sergei Petrunia.
      be8709eb
    • Varun Gupta's avatar
      Extending the API for json_writer by introdcing · 6b979416
      Varun Gupta authored
      classes for Json_writer_object and Json_writer_array.
      These classes will be used for the implementation
      of the optimizer trace.
      6b979416
    • Daniel Black's avatar
      cmake-wsrep: friendly error message about missing wsrep_api.h · 4f5c6536
      Daniel Black authored
      Without this commit the error message is:
      
      $ cmake . -DWITH_WSREP=ON
      -- Running cmake version 3.12.1
      -- MariaDB 10.4.3
      CMake Error at cmake/wsrep.cmake:36 (FILE):
        FILE STRINGS file
        ".../mariadb-server-10.4/wsrep-lib/wsrep-API/v26/wsrep_api.h"
        cannot be read.
      Call Stack (most recent call first):
        CMakeLists.txt:147 (INCLUDE)
      
      Having 'git config cmake.update-submodules yes' nicely updates the
      build without error.
      
      $ cmake . -DWITH_WSREP=ON
      -- Running cmake version 3.12.1
      -- MariaDB 10.4.3
      Submodule path 'wsrep-lib': checked out 'e7d72ae7f6a6995a21d743389426a963429a1fff'
      Submodule path 'wsrep-lib/wsrep-API/v26': checked out '75a5f452f2ba07b0f4a3a9a94825fccc71b27398'
      4f5c6536
  4. 12 Feb, 2019 8 commits