1. 04 Sep, 2019 2 commits
  2. 03 Sep, 2019 3 commits
    • Monty's avatar
      Merge branch '10.2' into 10.3 · a071e0e0
      Monty authored
      a071e0e0
    • Alexander Barkov's avatar
      Part2: MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0,... · ef00ac4c
      Alexander Barkov authored
      Part2: MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH
      
      This patch allows the server to open old tables that have
      "bad" generated columns (i.e. indexed virtual generated columns,
      persistent generated columns) that depend on sql_mode,
      for general things like SELECT, INSERT, DROP, etc.
      Warning are issued in such cases.
      
      Only these commands are now disallowed and return an error:
      - CREATE TABLE introducing a "bad" generated column
      - ALTER TABLE introducing a "bad" generated column
      - CREATE INDEX introdicing a "bad" generated column
        (i.e. adding an index on a virtual generated column
         that depends on sql_mode).
      
      Note, these commands are allowed:
      - ALTER TABLE removing a "bad" generate column
      - ALTER TABLE removing an index from a "bad" virtual generated column
      - DROP INDEX removing an index from a "bad" virtual generated column
      but only if the table does not have any "bad" columns as a result.
      ef00ac4c
    • Alexander Barkov's avatar
      MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, false)' in... · dc719597
      Alexander Barkov authored
      MDEV-18156 Assertion `0' failed or `btr_validate_index(index, 0, false)' in row_upd_sec_index_entry or error code 126: Index is corrupted upon DELETE with PAD_CHAR_TO_FULL_LENGTH
      
      This change takes into account a column's GENERATED ALWAYS AS
      expression dependcy on sql_mode's PAD_CHAR_TO_FULL_LENGTH and
      NO_UNSIGNED_SUBTRACTION flags.
      
      Indexed virtual columns as well as persistent generated columns are
      now not allowed to have such dependencies to avoid inconsistent data
      or index files on sql_mode changes.
      So an error is now returned in cases like this:
      
        CREATE OR REPLACE TABLE t1
        (
          a CHAR(5),
          v VARCHAR(5) AS (a) PERSISTENT -- CHAR->VARCHAR or CHAR->TEXT = ERROR
        );
      
      Functions RPAD() and RTRIM() can now remove dependency on
      PAD_CHAR_TO_FULL_LENGTH. So this can be used instead:
      
        CREATE OR REPLACE TABLE t1
        (
          a CHAR(5),
          v VARCHAR(5) AS (RTRIM(a)) PERSISTENT
        );
      
      Note, unlike CHAR->VARCHAR and CHAR->TEXT this still works,
      not RPAD(a) is needed:
      
        CREATE OR REPLACE TABLE t1
        (
          a CHAR(5),
          v CHAR(5) AS (a) PERSISTENT -- CHAR->CHAR is OK
        );
      
      More sql_mode flags may affect values of generated columns.
      They will be addressed separately.
      
      See comments in sql_mode.h for implementation details.
      dc719597
  3. 02 Sep, 2019 2 commits
  4. 01 Sep, 2019 11 commits
    • Monty's avatar
      Updated mtr files to support different compiled in options · 9cba6c5a
      Monty authored
      This allows one to run the test suite even if any of the following
      options are changed:
      - character-set-server
      - collation-server
      - join-cache-level
      - log-basename
      - max-allowed-packet
      - optimizer-switch
      - query-cache-size and query-cache-type
      - skip-name-resolve
      - table-definition-cache
      - table-open-cache
      - Some innodb options
      etc
      
      Changes:
      - Don't print out the value of system variables as one can't depend on
        them to being constants.
      - Don't set global variables to 'default' as the default may not
        be the same as the test was started with if there was an additional
        option file. Instead save original value and reset it at end of test.
      - Test that depends on the latin1 character set should include
        default_charset.inc or set the character set to latin1
      - Test that depends on the original optimizer switch, should include
        default_optimizer_switch.inc
      - Test that depends on the value of a specific system variable should
        set it in the test (like optimizer_use_condition_selectivity)
      - Split subselect3.test into subselect3.test and subselect3.inc to
        make it easier to set and reset system variables.
      - Added .opt files for test that required specfic options that could
        be changed by external configuration files.
      - Fixed result files in rockdsb & tokudb that had not been updated for
        a while.
      9cba6c5a
    • Monty's avatar
      Fixed some compiler warnings · b23b3a5f
      Monty authored
      b23b3a5f
    • Monty's avatar
      embedded client now writes errors to stderr during init_embedded_server · b0916141
      Monty authored
      This was done to be able to get any information why the embedded server
      doesn't start.
      b0916141
    • Monty's avatar
      Remove test that where only applicable for MySQL · d558981e
      Monty authored
      These was part of an incomplete old merge from MySQL 5.6
      d558981e
    • Monty's avatar
      Updated BUILD/SETUP from MariaDB 10.5 · 2d857144
      Monty authored
      2d857144
    • Aleksey Midenkov's avatar
      Compilation fix · 597b070f
      Aleksey Midenkov authored
      Caused by:
      MDEV-18501 Partition pruning doesn't work for historical queries (cleanup)
      597b070f
    • Monty's avatar
      Fixed compiler warning that broke builds · 1bbc593e
      Monty authored
      gcc 7.4.1
      1bbc593e
    • Sergei Golubchik's avatar
      C/C · d5a11a1f
      Sergei Golubchik authored
      d5a11a1f
    • Aleksey Midenkov's avatar
      MDEV-18501 Partition pruning doesn't work for historical queries (fix) · 6a490ca0
      Aleksey Midenkov authored
      Pruning fix for SYSTEM_TIME INTERVAL partitioning.
      
      Allocating one more element in range_int_array for CURRENT partition
      is required for RANGE pruning to work correctly
      (get_partition_id_range_for_endpoint()).
      6a490ca0
    • Aleksey Midenkov's avatar
      MDEV-18501 Partition pruning doesn't work for historical queries (refactoring) · c3f35ea5
      Aleksey Midenkov authored
      SYSTEM_TYPE partitioning: COLUMN properties removed. Partitioning is
      now pure RANGE based on UNIX_TIMESTAMP(row_end).
      
      DECIMAL type is now allowed as RANGE partitioning, we can partition by
      UNIX_TIMESTAMP() (but not for DATETIME which depends on local timezone
      of course).
      c3f35ea5
    • Aleksey Midenkov's avatar
      MDEV-18501 Partition pruning doesn't work for historical queries (cleanup) · a3e49c0d
      Aleksey Midenkov authored
      Cleanup removes useless allocation.
      a3e49c0d
  5. 30 Aug, 2019 8 commits
  6. 29 Aug, 2019 5 commits
    • Marko Mäkelä's avatar
      MDEV-20149 innodb.innodb-system-table-view fails with wrong result · d58437d1
      Marko Mäkelä authored
      The test occasionally fails with different table reference count
      due to purge activity after INSERT operations (MDEV-12288).
      Wait for purge before accessing dict_table_t::n_ref_count.
      d58437d1
    • Marko Mäkelä's avatar
      After-merge fix · d4246e25
      Marko Mäkelä authored
      Merge a part of commit 25af2a18.
      This was forgotten in the
      merge commit e41eb044.
      d4246e25
    • Marko Mäkelä's avatar
      MDEV-20425 Implement Boolean debug build option debug_assert · e50b2bdb
      Marko Mäkelä authored
      Commit 536215e3 in MariaDB Server 10.3.1
      introduced the compiler flag (not cmake option) DBUG_ASSERT_AS_PRINTF
      that converts DBUG_ASSERT in non-debug builds into printouts.
      
      For debug builds, it could be useful to be able to convert DBUG_ASSERT
      into a warning or error printout, to allow execution to continue.
      This would allow debug builds to be used for reproducing hard failures
      that occur with release builds.
      
      my_assert: A Boolean flag (set by default), tied to the new option
      debug_assert that is available on debug builds only.
      When set, DBUG_ASSERT() will invoke assert(), like it did until now.
      When unset, DBUG_ASSERT() will invoke fprintf(stderr, ...)
      with the file name, line number and assertion expression.
      e50b2bdb
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 1a3c3659
      Marko Mäkelä authored
      1a3c3659
    • Marko Mäkelä's avatar
      Clean up innodb.innodb-read-view · 5e9b3419
      Marko Mäkelä authored
      5e9b3419
  7. 28 Aug, 2019 7 commits
    • Marko Mäkelä's avatar
      Remove a bogus comment · 2842ae03
      Marko Mäkelä authored
      Changes of PAGE_MAX_TRX_ID must be redo-logged for correctness.
      That was fixed in the InnoDB Plugin for MySQL 5.1 already.
      2842ae03
    • Marko Mäkelä's avatar
      Merge 10.1 into 10.2 · 5f35e103
      Marko Mäkelä authored
      5f35e103
    • Julius Goryavsky's avatar
      Improved handling of subdirectories in the xtrabackup-v2 SST scripts (similar... · 4ba20e0a
      Julius Goryavsky authored
      Improved handling of subdirectories in the xtrabackup-v2 SST scripts (similar to MDEV-18863) for more predictable test results (related to xtrabackup-v2 SST)
      4ba20e0a
    • Oleksandr Byelkin's avatar
      MDEV-16932: ASAN heap-use-after-free in my_charlen_utf8 /... · 9cd6e7ad
      Oleksandr Byelkin authored
      MDEV-16932: ASAN heap-use-after-free in my_charlen_utf8 / my_well_formed_char_length_utf8 on 2nd execution of SP with ALTER trying to add bad CHECK
      
      Make automatic name generation during execution (not prepare).
      
      Check result of memory allocation operation.
      9cd6e7ad
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · e41eb044
      Marko Mäkelä authored
      e41eb044
    • Eugene Kosov's avatar
      fix clang warnings · d4866c7d
      Eugene Kosov authored
      d4866c7d
    • Marko Mäkelä's avatar
      Implement innodb_evict_tables_on_commit_debug · 947b0b57
      Marko Mäkelä authored
      Some bugs are detected only after a table definition has been evicted
      and then reloaded to the InnoDB data dictionary cache.
      
      For debug builds, introduce the settable Boolean configuration parameter
      innodb_evict_tables_on_commit_debug that can be set to request InnoDB
      to attempt to evict table definitions from the data dictionary cache
      whenever a transaction is committed.
      
      This has been tested on 10.3 and 10.4 with the following:
      
      ./mysql-test-run.pl --mysqld=--loose-innodb-evict-tables-on-commit-debug
      
      You can also use the following:
      
      SET GLOBAL innodb_evict_tables_on_commit_debug=ON;
      SET GLOBAL innodb_evict_tables_on_commit_debug=OFF;
      
      The parameter affects the commit (or rollback or abort) of
      transactions that have modified persistent InnoDB tables.
      947b0b57
  8. 27 Aug, 2019 2 commits
    • Marko Mäkelä's avatar
      MDEV-13626: Add innodb.innodb-read-view · 7aac8358
      Marko Mäkelä authored
      7aac8358
    • Marko Mäkelä's avatar
      MDEV-15326/MDEV-16136 dead code removal · 25af2a18
      Marko Mäkelä authored
      Revert part of fa2a74e0.
      
      trx_reference(): Remove, and merge the relevant part to the only caller
      trx_rw_is_active(). If the statements trx = NULL; were ever executed,
      the function would have dereferenced a NULL pointer and crashed in
      trx_mutex_exit(trx). Hence, those statements must have been unreachable,
      and they can be replaced with debug assertions.
      
      trx_rw_is_active(): Avoid unnecessary acquisition and release of trx->mutex
      when do_ref_count=false.
      
      lock_trx_release_locks(): Do not reset trx->id=0. Had the statement been
      necessary, we would have experienced crashes in trx_reference().
      25af2a18