1. 20 Oct, 2020 4 commits
    • 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
  2. 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
  3. 07 Oct, 2020 2 commits
  4. 05 Oct, 2020 4 commits
  5. 01 Oct, 2020 1 commit
  6. 30 Sep, 2020 3 commits
  7. 29 Sep, 2020 4 commits
  8. 28 Sep, 2020 7 commits
  9. 25 Sep, 2020 1 commit
  10. 24 Sep, 2020 1 commit
  11. 23 Sep, 2020 7 commits
    • Daniel Black's avatar
      3d28d1f3
    • Daniel Black's avatar
      MDEV-23697: perl -w -> perl · 4ddaa571
      Daniel Black authored
      Leave debian/additions/mysqlreport as #!/usr/bin/perl
      
      Acknowledge that `env perl` is a hack, a complete fix
      needs to consider which path perl is at and insert into
      these scripts.
      
      The usefulness of these scripts is questionable.
      4ddaa571
    • Daniel Black's avatar
    • Marko Mäkelä's avatar
      MDEV-22387: Do not violate __attribute__((nonnull)) · 7c5519c1
      Marko Mäkelä authored
      Passing a null pointer to a nonnull argument is not only undefined
      behaviour, but it also grants the compiler the permission to optimize
      away further checks whether the pointer is null. GCC -O2 at least
      starting with version 8 may do that, potentially causing SIGSEGV.
      7c5519c1
    • Marko Mäkelä's avatar
      UBSAN: Fix a bit shift overflow · 70960bd3
      Marko Mäkelä authored
      Shifting a 16-bit type by 16 bits is undefined behaviour.
      The result is at least 32 bits, so let us cast the shift operand
      to a wider type before shifting.
      70960bd3
    • Marko Mäkelä's avatar
      Fix GCC 10.2.0 -Og -fsanitize=undefined -Wmaybe-uninitialized · af40a2b4
      Marko Mäkelä authored
      For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
      to the compilation flags will cause even more warnings to be emitted.
      The warnings do look bogus, but the code can be simplified.
      af40a2b4
    • Marko Mäkelä's avatar
      Fix GCC 10.2.0 -Og -fsanitize=undefined -Wformat-overflow · 0448558a
      Marko Mäkelä authored
      For some reason, adding -fsanitize=undefined (cmake -DWITH_UBSAN=ON)
      to the compilation flags will cause even more warnings to be emitted.
      The warning was a bogus one:
      
      tests/mysql_client_test.c:8632:22: error: '%d' directive writing between
      1 and 11 bytes into a region of size 9 [-Werror=format-overflow=]
       8632 |     sprintf(field, "c%d int", i);
            |                      ^~
      tests/mysql_client_test.c:8632:20: note: directive argument
      in the range [-2147483648, 999]
      
      The warning does not take into account that the lower bound of the
      variable actually is 0. But, we can help the compiler and use an
      unsigned variable.
      0448558a
  12. 22 Sep, 2020 5 commits