1. 20 Feb, 2019 3 commits
  2. 19 Feb, 2019 20 commits
    • Thirunarayanan Balathandayuthapani's avatar
      MDEV-12026: Implement innodb_checksum_algorithm=full_crc32 · c0f47a4a
      Thirunarayanan Balathandayuthapani authored
      MariaDB data-at-rest encryption (innodb_encrypt_tables)
      had repurposed the same unused data field that was repurposed
      in MySQL 5.7 (and MariaDB 10.2) for the Split Sequence Number (SSN)
      field of SPATIAL INDEX. Because of this, MariaDB was unable to
      support encryption on SPATIAL INDEX pages.
      
      Furthermore, InnoDB page checksums skipped some bytes, and there
      are multiple variations and checksum algorithms. By default,
      InnoDB accepts all variations of all algorithms that ever existed.
      This unnecessarily weakens the page checksums.
      
      We hereby introduce two more innodb_checksum_algorithm variants
      (full_crc32, strict_full_crc32) that are special in a way:
      When either setting is active, newly created data files will
      carry a flag (fil_space_t::full_crc32()) that indicates that
      all pages of the file will use a full CRC-32C checksum over the
      entire page contents (excluding the bytes where the checksum
      is stored, at the very end of the page). Such files will always
      use that checksum, no matter what the parameter
      innodb_checksum_algorithm is assigned to.
      
      For old files, the old checksum algorithms will continue to be
      used. The value strict_full_crc32 will be equivalent to strict_crc32
      and the value full_crc32 will be equivalent to crc32.
      
      ROW_FORMAT=COMPRESSED tables will only use the old format.
      These tables do not support new features, such as larger
      innodb_page_size or instant ADD/DROP COLUMN. They may be
      deprecated in the future. We do not want an unnecessary
      file format change for them.
      
      The new full_crc32() format also cleans up the MariaDB tablespace
      flags. We will reserve flags to store the page_compressed
      compression algorithm, and to store the compressed payload length,
      so that checksum can be computed over the compressed (and
      possibly encrypted) stream and can be validated without
      decrypting or decompressing the page.
      
      In the full_crc32 format, there no longer are separate before-encryption
      and after-encryption checksums for pages. The single checksum is
      computed on the page contents that is written to the file.
      
      We do not make the new algorithm the default for two reasons.
      First, MariaDB 10.4.2 was a beta release, and the default values
      of parameters should not change after beta. Second, we did not
      yet implement the full_crc32 format for page_compressed pages.
      This will be fixed in MDEV-18644.
      
      This is joint work with Marko Mäkelä.
      c0f47a4a
    • Alexander Barkov's avatar
      Fixing compilation problems with this DBUG_ASSERT_AS_PRINTF · 93984ff6
      Alexander Barkov authored
      For example, with this cmake command line:
      
      cmake . -DCMAKE_C_FLAGS="-DDBUG_ASSERT_AS_PRINTF" \
              -DCMAKE_CXX_FLAGS="-DDBUG_ASSERT_AS_PRINTF"
      93984ff6
    • Sergey Vojtovich's avatar
      Fixed build failure · abd3c202
      Sergey Vojtovich authored
      Apparently DBUG_ASSERT() can co-exist with DBUG_OFF when
      -DCMAKE_CXX_FLAGS="-DDBUG_ASSERT_AS_PRINTF".
      
      Removed assertion as it is useless now, since the type is unsigned.
      abd3c202
    • Teemu Ollakka's avatar
      Fixed replaying bugs found with multimaster load · 7ae685d0
      Teemu Ollakka authored
      The replayer did not signal replaying waiters. Added
      mysql_cond_broadcast() after replaying is over.
      
      Assertion on client error failed after replay attempt failed due
      to certification failure. At this point the transaction does not
      go through client state, so the client error cannot be overridden.
      Assign ER_LOCK_DEADLOCK to thd directly instead.
      
      Use timed cond wait when waiting for replayers to finish and
      check if the transaction has been BF aborted during the wait.
      7ae685d0
    • Jan Lindström's avatar
      MDEV-18632: wsrep_is_wsrep_xid: Conditional jump or move depends on uninitialised value · 48554fe2
      Jan Lindström authored
      Transaction XID is not initialized before transaction is started.
      48554fe2
    • Igor Babaev's avatar
      Merge branch '10.4' into bb-10.4-mdev7486 · 2a935329
      Igor Babaev authored
      2a935329
    • mkaruza's avatar
      Fix for galera_3nodes.galera_gtid_2_cluster · ddc98339
      mkaruza authored
      Temporary disable WSREP while executing RESET MASTER. In situation when 2 nodes are both master/slave first stop slave on both and than reset master.
      Enforce stricter causality check with wsrep_sync_wait.
      ddc98339
    • mkaruza's avatar
      Fix for galera_3nodes.galera_garbd · baed6632
      mkaruza authored
      Check for garbd executable on different paths. If not found terminate test.
      baed6632
    • Igor Babaev's avatar
      Merge branch '10.4' into bb-10.4-mdev7486 · 2e73c561
      Igor Babaev authored
      2e73c561
    • Igor Babaev's avatar
      MDEV-7486: Condition pushdown from HAVING into WHERE · 8283d7d2
      Igor Babaev authored
      Optimized the code that removed multiple equalities pushed from HAVING
      into WHERE. Now this removal is postponed until all multiple equalities
      are eliminated in substitute_for_best_equal_field().
      8283d7d2
    • Vicențiu Ciorbaru's avatar
      Implement avg_frequency unsmoothed jacknife estimator · 76442927
      Vicențiu Ciorbaru authored
      When sampling data through ANALYZE TABLE, use the estimator to get a
      better estimation of avg_frequency instead of just using the raw sampled data.
      76442927
    • Vicențiu Ciorbaru's avatar
      Introduce analyze_sample_percentage variable · f0773b78
      Vicențiu Ciorbaru authored
      The variable controls the amount of sampling analyze table performs.
      
      If ANALYZE table with histogram collection is too slow, one can reduce the
      time taken by setting analyze_sample_percentage to a lower value of the
      total number of rows.
      Setting it to 0 will use a formula to compute how many rows to sample:
      
      The number of rows collected is capped to a minimum of 50000 and
      increases logarithmically with a coffecient of 4096. The coffecient is
      chosen so that we expect an error of less than 3% in our estimations
      according to the paper:
      "Random Sampling for Histogram Construction: How much is enough?”
      – Surajit Chaudhuri, Rajeev Motwani, Vivek Narasayya, ACM SIGMOD, 1998.
      
      The drawback of sampling is that avg_frequency number is computed
      imprecisely and will yeild a smaller number than the real one.
      f0773b78
    • Vicențiu Ciorbaru's avatar
      Simplify column data adding method · 47f15ea7
      Vicențiu Ciorbaru authored
      The add method does not need to provide the row order number. It was
      only used to detect if the minimum/maximum value was populated once or not, so
      as to force an update for the first encounter of a value.
      47f15ea7
    • Vladislav Vaintroub's avatar
      MDEV-15693 Stop packaging data directory into ZIPs · 3dc6f041
      Vladislav Vaintroub authored
      Remove CMake INSTALL command for COMPONENT DataFiles.
      
      mysql_install_db.exe will calculate default datadir, so that it can be
      called without any parameters.
      3dc6f041
    • Varun Gupta's avatar
      MDEV-18551: New defaults for eq_range_index_dive_limit · 2e6d8fcc
      Varun Gupta authored
      The value for eq_range_index_dive_limit is increased to 200.
      2e6d8fcc
    • Varun Gupta's avatar
      MDEV-17903: New optimizer defaults: change optimize_join_buffer_size to be ON · d6db6df9
      Varun Gupta authored
      optimize_join_buffer_size is switched ON.
      d6db6df9
    • Galina Shalygina's avatar
      7fe1ca7e
    • Vladislav Vaintroub's avatar
    • Igor Babaev's avatar
      MDEV-7486: Cosmetic changes · 4de3fd4e
      Igor Babaev authored
      - Removed dead code
      - Renamed a function
      - Removed a parameter that not needed.
      - Corrected comments
      4de3fd4e
    • Teemu Ollakka's avatar
      MDEV-18587 Don't reject DDLs if streaming replication is on · 4baab869
      Teemu Ollakka authored
      The check for streaming replication logging format in
      THD::decide_logging_format() did the check also for DDLs running
      in TOI mode. This caused DROP DATABASE to fail if streaming
      replication was enabled.
      
      Added check for THD wsrep execution mode and perform the check
      only if the THD is in local processing mode (i.e. not TOI).
      
      Added galera_sr_create_drop test to verify that CREATE/DROP
      statements pass even if streaming replication is on.
      4baab869
  3. 18 Feb, 2019 17 commits
    • Galina Shalygina's avatar
      MDEV-18636 The test case for bug mdev-16765 crashes the server · 97419304
      Galina Shalygina authored
      in the tree bb-10.4-mdev7486
      
      The crash was caused because of the similar problem as in mdev-16765:
      Item_cond::excl_dep_on_group_fields_for_having_pushdown() was missing.
      97419304
    • Galina Shalygina's avatar
      MDEV-18635 The test case for bug mdev-16727 crashes the server · d25af331
      Galina Shalygina authored
                 in the tree bb-10.4-mdev7486
      
      The crash was caused because after merge of bb-10.4-mdev7486 and
      10.4 branches changes for mdev-16727 were missing.
      d25af331
    • Galina Shalygina's avatar
      MDEV-7468 Fix for crash caused by connect.json_udf test · e4f1094c
      Galina Shalygina authored
      It was allowed to push UDF functions and that caused a crash.
      To fix it it was forbidden to push UDF functions from HAVING into WHERE.
      e4f1094c
    • Marko Mäkelä's avatar
      MDEV-18627: Tighten an assertion added in MDEV-18596 · 75c6fce5
      Marko Mäkelä authored
      innobase_instant_try(): Assert that the column length of fixed-length
      columns is not changing.
      75c6fce5
    • Marko Mäkelä's avatar
      MDEV-18627 Wrong result after instant size change of integer · 2c74799d
      Marko Mäkelä authored
      If we instantly change the size of a fixed-length field
      and treat it as kind-of variable-length, then we will need
      conversions between old column values and new ones.
      
      I tried adding such a conversion to row_build(), but then I
      noticed that more conversions would be needed, because
      old values still appeared in a freshly rebuilt secondary index,
      causing a mismatch when trying to search with the correct
      longer value that was converted in my provisional fix to row_build().
      
      So, we will revert the essential part of
      MDEV-15563: Instant ROW_FORMAT=REDUNDANT column extension
      (commit 22feb179), but not
      remove any tests.
      2c74799d
    • Teemu Ollakka's avatar
      MDEV-18585 Avoid excessive Annotate_rows_log_events in binlog · f0b65102
      Teemu Ollakka authored
      Make sure that the Annotate_rows_log_events is written into
      binlog only for the first fragment of the current statement.
      Also avoid flusing pending rows event when calculating bytes
      generated by the transaction.
      
      Added and recorded a test which verifies that the binlog
      contains only one Annotate_rows_log_event per statement
      with various SR settings. Recrded mysql-wsrep-features#136
      which produced different output with excession log events
      suppressed.
      f0b65102
    • Marko Mäkelä's avatar
      MDEV-18596 Crash in row_mysql_store_col_in_innobase_format() on MODIFY/ADD column · 33fd3998
      Marko Mäkelä authored
      innobase_build_col_map_add(): Do not assume that old_field->pack_length()
      equals to field->pack_length(). Fix submitted by Aleksey Midenkov.
      
      innobase_instant_try(): Assert that the column length of fixed-length
      NOT NULL columns is only changing for ROW_FORMAT=REDUNDANT.
      33fd3998
    • Varun Gupta's avatar
      Minor cleanup in the optimizer trace code. · 9cb55143
      Varun Gupta authored
      More test coverage added for the optimizer trace.
      9cb55143
    • Daniele Sciascia's avatar
      MTR tests for galera sync wait up to · 7d2138d4
      Daniele Sciascia authored
      7d2138d4
    • Sergei Petrunia's avatar
      MDEV-18608: Defaults for 10.4: histogram size should be set · 3f154943
      Sergei Petrunia authored
      Followup: update test results
      3f154943
    • Sergei Petrunia's avatar
      MDEV-18608: Defaults for 10.4: histogram size should be set · 15a77a1a
      Sergei Petrunia authored
      Change the defaults:
      
      -histogram_size=0
      +histogram_size=254
      
      -histogram_type=SINGLE_PREC_HB
      +histogram_type=DOUBLE_PREC_HB
      
      Adjust the testcases:
      - Some have ignorable changes in EXPLAIN outputs and
        more counter increments due to EITS table reads.
      - Testcases that meaningfully depend on the old defaults
        are changed to use the old values.
      15a77a1a
    • Marko Mäkelä's avatar
      MDEV-15564: Fix a memory leak · 19c6a7bb
      Marko Mäkelä authored
      19c6a7bb
    • Marko Mäkelä's avatar
      MDEV-18609 Assertion !is_string || (*af)->charset() == cf->charset failed · a12d0d5a
      Marko Mäkelä authored
      The Create_field::charset can contain garbage for columns
      that the SQL layer does not consider as being string columns.
      InnoDB considers BIT a string column for historical reasons
      (and backward compatibility with old persistent InnoDB metadata),
      and therefore it checked the charset.
      
      The Field::charset() consistently is my_charset_bin for BIT,
      so we can trust that one.
      a12d0d5a
    • Marko Mäkelä's avatar
      Disable unused function · 869ce67f
      Marko Mäkelä authored
      869ce67f
    • Marko Mäkelä's avatar
      MDEV-16188: Remove redundant !this || · 2bd7f329
      Marko Mäkelä authored
      Fix clang warning: 'this' pointer cannot be null in well-defined C++ code;
      pointer may be assumed to always convert to true
      
      The only caller of TABLE::best_range_rowid_filter_for_partial_join()
      already seems to be assuming that s->table != NULL.
      2bd7f329
    • mkaruza's avatar
      MDEV-18588 Segfault during SST on joiner with bin-log, no bin-log-index · 54ffc499
      mkaruza authored
      When node is JOINER and bin-log is enabled but bin-log-index is not set in configuration, we use NULL pointer which causes segfault. 
      Fixed by checking for NULL pointer before using variable.
      54ffc499
    • Galina Shalygina's avatar
      MDEV-7486: Condition pushdown from HAVING into WHERE · 7a77b221
      Galina Shalygina authored
      Condition can be pushed from the HAVING clause into the WHERE clause
      if it depends only on the fields that are used in the GROUP BY list
      or depends on the fields that are equal to grouping fields.
      Aggregate functions can't be pushed down.
      
      How the pushdown is performed on the example:
      
      SELECT t1.a,MAX(t1.b)
      FROM t1
      GROUP BY t1.a
      HAVING (t1.a>2) AND (MAX(c)>12);
      
      =>
      
      SELECT t1.a,MAX(t1.b)
      FROM t1
      WHERE (t1.a>2)
      GROUP BY t1.a
      HAVING (MAX(c)>12);
      
      The implementation scheme:
      
      1. Extract the most restrictive condition cond from the HAVING clause of
         the select that depends only on the fields that are used in the GROUP BY
         list of the select (directly or indirectly through equalities)
      2. Save cond as a condition that can be pushed into the WHERE clause
         of the select
      3. Remove cond from the HAVING clause if it is possible
      
      The optimization is implemented in the function
      st_select_lex::pushdown_from_having_into_where().
      
      New test file having_cond_pushdown.test is created.
      7a77b221