1. 29 Oct, 2019 4 commits
  2. 28 Oct, 2019 8 commits
  3. 25 Oct, 2019 1 commit
  4. 24 Oct, 2019 2 commits
  5. 23 Oct, 2019 3 commits
    • Marko Mäkelä's avatar
      MDEV-20487 Set innodb_adaptive_hash_index=OFF by default · 88cdfc5c
      Marko Mäkelä authored
      Based on the performance testing that was conducted in MDEV-17492,
      the InnoDB adaptive hash index could only help performance in specific,
      almost-read-only workloads. It could slow down all kinds of workloads
      (especially DROP TABLE, TRUNCATE TABLE, ALTER TABLE, or DROP INDEX
      operations), and it can become corrupted, causing crashes (such as
      MDEV-18815, MDEV-20203) and possibly data corruption. Furthermore,
      the adaptive hash index consumes space from the InnoDB buffer pool,
      which could hurt performance when the working set would almost fit
      in the buffer pool.
      
      Given all this, it is best to disable the adaptive hash index by default.
      88cdfc5c
    • Jan Lindström's avatar
    • Jan Lindström's avatar
      Stabilize tests. · 1036886b
      Jan Lindström authored
      Changes to be committed:
      	modified:   mysql-test/suite/galera_sr/disabled.def
      	modified:   mysql-test/suite/galera_sr/r/GCF-561.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_ddl_master.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_kill_query.result
      	modified:   mysql-test/suite/galera_sr/r/galera_sr_shutdown_slave.result
      	new file:   mysql-test/suite/galera_sr/suite.pm
      	modified:   mysql-test/suite/galera_sr/t/GCF-561.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_ddl_master.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_kill_query.test
      	modified:   mysql-test/suite/galera_sr/t/galera_sr_shutdown_slave.test
      1036886b
  6. 20 Oct, 2019 4 commits
  7. 18 Oct, 2019 2 commits
    • Alexander Barkov's avatar
      MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was... · ec171a94
      Alexander Barkov authored
      MDEV-20844 RBR from binary(16) to inet6 fails with error 171: The event was corrupt, leading to illegal data being read
      
      This patch changes the way how INET6 is packed to the RBR binary log:
      - from fixed length 16 bytes
      - to BINARY(16) compatible variable length style
        with trailing 0x00 byte compression.
      
      This is to make INET6 fully compatible with BINARY(16) in RBR binary logs,
      so RBR replication works in this scenarios:
      
      - Old master BINARY(16) -> New slave INET6
      - New master INET6      -> Old slave BINARY(16)
      
      A new class StringPack was added to share the code between
      Field_string and Field_inet6.
      ec171a94
    • Alexander Barkov's avatar
      MDEV-20856 Bad values in metadata views for partitions on VARBINARY · 9a833dc6
      Alexander Barkov authored
      The old code to print partition values was too complicated:
      - it created new Items for character set conversion purposes.
      - it mixed string conversion and partition error reporting
        in the same code blocks.
      
      Simplifying the code as follows:
      
      - Adding helper methods String::can_be_safely_convert_to() and
        String::append_introducer_and_hex().
      
      - Adding DBUG_EXECUTE_IF("generate_partition_syntax_for_frm",  push_warning...)
        into generate_partition_syntax_for_frm(), to test the PARTITON
        clause written to FRM. Adding test partition_utf8-debug.test for this.
      
      - Removing functions get_cs_converted_part_value_from_string() and
        get_cs_converted_string_value. Changing get_partition_column_description()
        to use Type_handler::partition_field_append_value() instead.
        This makes SHOW CREATE TABLE and SELECT FROM I_S.PARTITIONS
        use the same code path.
      
      - Changing Type_handler::partition_field_append_value() not to
        call convert_charset_partition_constant(), to avoid creating a new Item
        for string conversion pursposes.
        Rewritting the code to use only String methods.
      
      - Removing error reporting code (ER_PARTITION_FUNCTION_IS_NOT_ALLOWED)
        from Type_handler::partition_field_append_value().
        The error is correctly detected and reported on the caller level.
        So error reporting was redundant here.
      
      Also:
      
      - Moving methods Type_handler::partition_field_*() from sql_partition.cc
        to sql_type.cc. This fixes compilation problem with -DPLUGIN_PARTITION=NO,
        earlier introduced by the patch for MDEV-20831.
      9a833dc6
  8. 17 Oct, 2019 1 commit
  9. 16 Oct, 2019 3 commits
  10. 15 Oct, 2019 1 commit
    • Alexander Barkov's avatar
      MDEV-20831 Table partitioned by LIST/RANGE COLUMNS(inet6) can be created, but not inserted into · 22b645ef
      Alexander Barkov authored
      This clause in CREATE TABLE:
      
        PARTITION BY LIST COLUMNS (inet6column)
          (PARTITION p1 VALUES IN ('::'))
      
      was erroneously written to frm file as:
      
        PARTITION BY LIST COLUMNS(inet6column)
          (PARTITION p1 VALUES IN (_binary 0x3A3A))
      
      I.e. the text value '::' was converted to HEX representation
      and prefixed with _binary.
      
      A simple fix could write `_latin1 0x3A3A` instead of `_binary 0x3A3A`,
      but in case of INET6 we don't need neither character set introducers,
      nor HEX encoding, because text representation of INET6 values consist
      of pure ASCII characters.
      
      So this patch changes the above clause to be printed as:
      
        PARTITION BY LIST COLUMNS(inet6column)
          (PARTITION p1 VALUES IN ('::'))
      
      Details:
      
      The old code in check_part_field() was not friendly to pluggable data types.
      Replacing this function to two new virtual methods in Type_handler:
      
        virtual bool partition_field_check(const LEX_CSTRING &field_name,
                                           Item *item_expr) const;
      
        virtual bool partition_field_append_value(String *str,
                                                  Item *item_expr,
                                                  CHARSET_INFO *field_cs,
                                                  partition_value_print_mode_t mode)
                                                  const;
      
      so data type plugins can decide whether they need to use character set
      introducer and/or hex encoding when printing partition values.
      22b645ef
  11. 14 Oct, 2019 11 commits
    • Alexander Barkov's avatar
      MDEV-20822 INET6 crashes in combination with RBR extended metadata · 8ec97814
      Alexander Barkov authored
      The code erroneously assumed that only Field_str descendants can
      store character set information. After adding Field_inet6, it's
      not true anymore.
      
      Also, after adding Field_inet6, storing field->charset() become not correct either:
      - Field_inet6::charset() return &my_charset_latin1,
        because clients see INET6 as VARCHAR(39).
      - Field_inet6::binlog_type_info().m_cs returns &my_charset_bin
        because storage engines see INET6 as BINARY(16).
      
      We need to store &my_charset_bin to the binlog metadata,
      so the slave sees INET6 as BINARY(16), like storage engines do,
      to make the slave treat the replicated data as binary IPv6 address
      representation (rather than text representation).
      
      The correct character set that needs to be stored to the metadata
      is already populated to binlog_type_info_array[i].m_cs. So the
      fixed code version uses this value rather than field->charset().
      8ec97814
    • Alexander Barkov's avatar
      MDEV-20826 Wrong result of MIN(inet6) with GROUP BY · a11694b8
      Alexander Barkov authored
      Type_handler_inet6::is_val_native_ready() was not overriden and
      returned "false" by default, so Item_sum_min_max::update_field()
      erroneously went through the min_max_update_str_field() rather than
      min_max_update_native_field() execution path. As a result '8888::'
      was compared to 'fff::' in string format (rather than INET6 binary format)
      and gave "less" instead of "greater".
      
      Adding the forgotten overriding method returning "true".
      a11694b8
    • Alexey Botchkov's avatar
      MDEV-16620 JSON_ARRAYAGG and JSON_OBJECTAGG. · ba8e5e68
      Alexey Botchkov authored
      Ison_objectagg implemented.
      ba8e5e68
    • Sergei Golubchik's avatar
      MDEV-10014 Add RETURNING to INSERT · b1c2c4ee
      Sergei Golubchik authored
      post-review fixes:
      * test for dependent subqueries
      * test for triggers and routines
      * disallow INSERT...RETURNING in triggers and stored functions
      * don't return anything if INSERT IGNORE ignored an error
      b1c2c4ee
    • Sergei Golubchik's avatar
      bugfix: PS and dependent subqueries · 904dc934
      Sergei Golubchik authored
      when there are nested subqueries, and a field in a subquery is
      resolved as an outer reference to a table few levels up, all subqueries
      the subquery with a reference and all subqueries up to subquery with
      the table must be marked as dependent.
      
      in the text protocol and PS-prepare step it happens in
      Item_field::fix_outer_field in a loop that walks contexts
      using context->outer_context.
      
      in PS-execute step Item_field->cached_table is set and subqueries
      are walked in a PS-only mark_select_range_as_dependent(),
      which inconsistently walks SELECT_LEX'es using select_lex->outer_select().
      
      Fix mark_select_range_as_dependent() to walk contexts, not SELECT_LEX'es,
      to have the same logic both in prepare and execute steps.
      
      This fixes a crash in main.insert_returning in --ps-protocol
      904dc934
    • Rucha Deodhar's avatar
      MDEV-10014 Add RETURNING to INSERT · 837ad9ab
      Rucha Deodhar authored
      Closes #1384
      837ad9ab
    • Sergei Golubchik's avatar
      cleanup st_select_lex_unit::explainable · 57a09a72
      Sergei Golubchik authored
      57a09a72
    • Sergei Golubchik's avatar
      cleanup: formatting · 721a9df7
      Sergei Golubchik authored
      comments, whitespaces
      721a9df7
    • Sergei Golubchik's avatar
      cleanup: reduce code duplication · 828d9ae5
      Sergei Golubchik authored
      828d9ae5
    • Sergei Golubchik's avatar
      cleanup: don't pass wild_num to setup_wild() · a4a025f5
      Sergei Golubchik authored
      because internally setup_wild() adjusts select_lex->with_wild directly
      anyway, so there is no reason to pretend that the number of '*' may be
      anything else but select_lex->with_wild
      
      And don't update select_lex->item_list, because fields can come
      from anywhere and don't necessarily have to be copied into select_lex.
      a4a025f5
    • Sergei Golubchik's avatar
      outer references in subqueries in INSERT · c7320830
      Sergei Golubchik authored
      remove inconsistent limitation
      c7320830