1. 08 Jun, 2018 1 commit
    • Alexander Barkov's avatar
      MDEV-11361 Equal condition propagation does not work for DECIMAL and temporal... · 9043dd7a
      Alexander Barkov authored
      MDEV-11361 Equal condition propagation does not work for DECIMAL and temporal dynamic SQL parameters
      MDEV-16426 Optimizer erroneously treats equal constants of different formats as same
      A cleanup for MDEV-14630: fixing a crash in Item_decimal::eq().
      
      Problems:
      - old implementations of Item_decimal::eq() and
        Item_temporal_literal::eq() were not symmetric
        with Item_param::eq(), this caused MDEV-11361.
      
      - old implementations for DECIMAL and temporal data types
        did not take into account that in case when eq() is called
        with binary_cmp==true, {{eq()}} should check not only equality
        of the two values, but also equality if their decimal precision.
        This cuases MDEV-16426.
      
      - Item_decimal::eq() crashes with "item" pointing
        to a non-DECIMAL value. Before MDEV-14630
        non-DECIMAL values were filtered out by the test:
          type() == item->type()
        as literals of different types had different type().
        After MDEV-14630 type() for literals of all data types return CONST_ITEM.
        This caused failures in tests:
          ./mtr engines/iuds.insert_number
          ./mtr --ps --embedded main.explain_slowquerylog
        (revealed by buildbot)
      
      The essence of the fix:
      Making literals and Item_param reuse the same code to avoid
      asymmetries between Item_param::eq(Item_literal) and
      Item_literal::eq(Item_param), now and in the future, and to
      avoid code duplication between Item_literal and Item_param.
      Adding tests for "decimals" for DECIMAL and temporal data types,
      to treat constants of different scale as not equal when "binary_cmp"
      is "true".
      
      Details:
      1. Adding a helper class Item_const to extract constant values from Items easier
      2. Deriving Item_basic_value from Item_const
      3. Joining Type_handler::Item_basic_value_eq() and Item_basic_value_bin_eq()
         into a single method with an extra "binary_cmp" argument
         (it looks simple this way) and renaming the new method to Item_const_eq().
         Modifying its implementations to operate with
         Item_const instead of Item_basic_value.
      4. Adding a new class Type_handler_hex_hybrid,
         to handle hex constants like 0x616263.
      5. Removing Item::VARBIN_ITEM and fixing Item_hex_constant to
         use type_handler_hex_hybrid instead of type_handler_varchar.
         Item_hex_hybrid::type() now returns CONST_ITEM, like all
         other literals do.
      6. Move virtual methods Item::type_handler_for_system_time() and
         Item::cast_to_int_type_handler() from Item to Type_handler.
      7. Removing Item_decimal::eq() and Item_temporal_literal::eq().
         These classes are now handled by the generic Item_basic_value::eq().
      8. Implementing Type_handler_temporal_result::Item_const_eq()
         and Type_handler_decimal_result::Item_const_eq(),
         this fixes MDEV-11361.
      9. Adding tests for "decimals" into
         Type_handler_decimal_result::Item_const_eq() and
         Type_handler_temporal_result::Item_const_eq()
         in case if "binary_cmp" is true.
         This fixes MDEV-16426.
      10. Moving Item_cache out of Item_basic_value.
         They share nothing. It simplifies implementation
         of Item_basic_value::eq(). Deriving Item_cache
         directly from Item.
      
      11. Adding class DbugStringItemTypeValue, which
          used Item::print() internally, and using
          in instead of the old debug printing code.
          This gives nicer output in func_debug.result.
      
      Changes N5 and N6 do not directly relate to the bugs fixed,
      but make the code fully symmetric across all literal types.
      Without a new handler Type_handler_hex_hybrid we'd have
      to keep two code branches (for regular literals and for
      hex hybrid literals).
      9043dd7a
  2. 06 Jun, 2018 2 commits
  3. 05 Jun, 2018 4 commits
  4. 04 Jun, 2018 12 commits
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · b50685af
      Marko Mäkelä authored
      b50685af
    • Marko Mäkelä's avatar
      MDEV-16376 ASAN: heap-use-after-free in gcol.innodb_virtual_debug · 8dc70c86
      Marko Mäkelä authored
      After a failed ADD INDEX, dict_index_remove_from_cache_low()
      could iterate the index fields and dereference a freed virtual
      column object when trying to remove the index from the v_indexes
      of the virtual column.
      
      This regression was caused by a merge of
      MDEV-16119 InnoDB lock->index refers to a freed object.
      
      ha_innobase_inplace_ctx::clear_added_indexes(): Detach the
      indexes of uncommitted indexes from virtual columns, so that
      the iteration in dict_index_remove_from_cache_low() can be avoided.
      
      ha_innobase::prepare_inplace_alter_table(): Ignore uncommitted
      corrupted indexes when rejecting ALTER TABLE. (This minor bug was
      revealed by the extension of the test case.)
      
      dict_index_t::detach_columns(): Detach an index from virtual columns.
      Invoked by both dict_index_remove_from_cache_low() and
      ha_innobase_inplace_ctx::clear_added_indexes().
      
      dict_col_t::detach(const dict_index_t& index): Detach an index from
      a column.
      
      dict_col_t::is_virtual(): Replaces dict_col_is_virtual().
      
      dict_index_t::has_virtual(): Replaces dict_index_has_virtual().
      8dc70c86
    • Sergei Golubchik's avatar
      cleanup: ASSERT_COLUMN_MARKED_FOR_WRITE_OR_COMPUTED · 8760acdd
      Sergei Golubchik authored
      restore its original semantics by allowing only columns
      in the write_set. Generated columns work around the assert
      by temporarily updating the write_set.
      8760acdd
    • Sergei Golubchik's avatar
      cleanup: remove TABLE::vcol_set · 45dee3fc
      Sergei Golubchik authored
      use a read_set instead. a bit in the read_set means "the field
      value is needed" (read or generated, whatever it takes).
      45dee3fc
    • Sergei Golubchik's avatar
      cleanup: copy_data_between_tables() · ac9cc638
      Sergei Golubchik authored
      don't read all columns from the source table, but only
      those that the will be inserted into the target table
      and cannot be generated by the target table.
      
      test case is in the following commits
      ac9cc638
    • Sergei Golubchik's avatar
      bugfix: Item_field::register_field_in_read_map · a0db3d71
      Sergei Golubchik authored
      don't set bits in the vcol_set of the wrong table
      a0db3d71
    • Daniel Black's avatar
      MDEV-15584 Linux use O_TMPFILE · 3edac3f1
      Daniel Black authored
      O_TMPFILE creates a tempfile not attached to a filename.
      
      This is what we want for MY_TEMPORARY.
      
      We preserve a state O_TMPFILE_works, because kernel version or
      filesystem could cause failure.
      
      Closes #662
      3edac3f1
    • Sergei Golubchik's avatar
      mysys: ME_ERROR_LOG_ONLY flag · ced66387
      Sergei Golubchik authored
      ced66387
    • Sergei Golubchik's avatar
      c9061d11
    • Sergei Golubchik's avatar
      mysys: remove dead ME_xxx flags · 37659ef4
      Sergei Golubchik authored
      37659ef4
    • Marko Mäkelä's avatar
      MDEV-13834: Upgrade failure from 10.1 innodb_encrypt_log · 5932a4e7
      Marko Mäkelä authored
      log_crypt_101_read_block(): Mimic MariaDB 10.1, and use the first
      encryption key if the key for the checkpoint cannot be found.
      Redo log encryption key rotation was ultimately disabled
      in MDEV-9422 (MariaDB 10.1.13) due to design issues. So, from
      MariaDB 10.1.13 onwards only one log encryption key should matter.
      
      recv_log_format_0_recover(): Add the parameter 'bool crypt'.
      Indicate when the log cannot be decrypted for upgrade, instead of
      making a possibly false claim that the log requires crash recovery.
      
      init_crypt_key(): Remove extra space from a message.
      5932a4e7
    • Alexander Barkov's avatar
  5. 03 Jun, 2018 7 commits
  6. 02 Jun, 2018 1 commit
  7. 01 Jun, 2018 3 commits
    • Yuqi's avatar
      Make MariaDB CRC32-lib platform independence (#780) · ee5124d7
      Yuqi authored
      Make mariadb crc32 lib platform independent
      
      It looks strange that someone can make use of 2 crc libraries
      (Power64 or AArch64) at the same time.
      
      The patch sets macros 'CRC32_LIBRARY' to make platform independence as an optional crc32 library.
      
      Change-Id: I68bbf73cafb6a12f7fb105ad57d117b114a8c4af
      Signed-off-by: default avatarYuqi Gu <yuqi.gu@arm.com>
      ee5124d7
    • gvtek's avatar
      Better Link Spacing · 40dc1a68
      gvtek authored
      Just spacing out the links on separate linkes, they were running together
      in a block of text and could be a little hard for some people to
      differentiate where one begins and the next ends. Seems silly, but just
      trying to help in the formatting a bit.
      40dc1a68
    • Igor Babaev's avatar
      MDEV-16353 Server crash on query with CTE · b2f86ebd
      Igor Babaev authored
      This bug caused crashes for queries with unreferenced non-recursive
      CTEs specified by unions.It happened because the function
      st_select_lex_unit::prepare() tried to use the value of the field 'derived'
      that could not be set for unferenced CTEs as there was no derived
      table associated with an unreferenced CTE.
      b2f86ebd
  8. 31 May, 2018 2 commits
  9. 30 May, 2018 5 commits
    • Vladislav Vaintroub's avatar
      MDEV-16345 : No upgrade wizard in 10.3 in Windows packages. · 5a61fa98
      Vladislav Vaintroub authored
      Disable /permissive- flag, so MFC  is found, and upgrade_wizard is built.
      
      MFC code is not standard C++, so it doesn not play well with /permissive-
      5a61fa98
    • Marko Mäkelä's avatar
      MDEV-16334 Incorrect ALTER TABLE for changing column option · 682e7b8f
      Marko Mäkelä authored
      commit 2dbeebdb accidentally changed
      ALTER_COLUMN_OPTION and ALTER_COLUMN_STORAGE_TYPE to be separate flags.
      InnoDB and Mroonga are only checking for the latter;
      the example storage engine is checking for the former only.
      
      The impact of this bug should be incorrect operation of Mroonga when
      the column options GROONGA_TYPE, FLAGS are changed.
      
      InnoDB does not define any column options, only table options,
      so the flag ALTER_COLUMN_OPTION should never have been set.
      
      Also, remove the unused flag ALTER_DROP_HISTORICAL.
      682e7b8f
    • Alexander Barkov's avatar
      MDEV-16325 CREATE..SELECT..UNION creates a wrong field type for old varchar · 3ceb4a54
      Alexander Barkov authored
      - Adding Type_handler::traditional_merge_field_type()
      - Removing real_type_to_type(), field_merge_type()
      - Making Type_handler_var_string to merge as VARCHAR
      - Additionally, fixing Field_string::print() to add the "/*old*/"
        comment into the data type for the old VARCHAR.
        This is similar to what MDEV-8267 earlier did for old DECIMAL.
      - Adding tests
      3ceb4a54
    • Marko Mäkelä's avatar
      Remove an unnecessary #include · a31e99a8
      Marko Mäkelä authored
      a31e99a8
    • Marko Mäkelä's avatar
      After-merge fixes · c0f97710
      Marko Mäkelä authored
      Fix type mismatches in the unit test mdev10259().
      
      btr_search_info_get_ref_count(): Do not return early if !table->space.
      We can simply access table->space_id even after the tablespace has
      been discarded.
      
      btr_get_search_latch(): Relax a debug assertion to allow
      !index->table->space.
      c0f97710
  10. 29 May, 2018 3 commits