1. 20 Apr, 2018 7 commits
    • Alexander Barkov's avatar
      Adding more tests for IN/EXIST subqueries for better coverage · c058117c
      Alexander Barkov authored
      Adding tests with IN/EXISTS subqueries in various rarely unexpected places:
      
      - non-SELECT statements
      - SP control
      - cursors
      
      etc.
      c058117c
    • Sergey Vojtovich's avatar
      Fixed compiler warning · 791fb9ea
      Sergey Vojtovich authored
      791fb9ea
    • Alexander Barkov's avatar
      MDEV-15926 MEDIUMINT returns wrong I_S attributes · 9aaf62d0
      Alexander Barkov authored
      Problem:
      
      The logic in store_column_type() with a switch on field type was
      hard to follow. The part for MEDIUMINT (MYSQL_TYPE_INT24) was not correct.
      It erroneously calculated the precision of MEDIUMINT UNSIGNED
      as 7 instead of 8.
      
      A similar hard-to-follow switch doing some type specific calculations
      resided in adjust_max_effective_column_length(). It was also wrong for
      MEDIUMINT (reported as a separate issue in MDEV-15946).
      
      Solution:
      
      1. Introducing a new class Information_schema_numeric_attributes
      2. Adding a new virtual method Field::information_schema_numeric_attributes()
      3. Splitting the logic in store_column_type() into virtual
         implementations of information_schema_numeric_attributes().
      4. In order to avoid adding duplicate code for the integer data types,
         adding a new virtual method Field_int::numeric_precision(),
         which returns the number of digits.
      
      Additional changes:
      
      1. Adding the "const" qualifier to Field::max_display_length()
      
      2. Moving the code from adjust_max_effective_column_length()
        directly to Field::max_display_length().
        There was no any sense to have two implementations:
        - a set of wrong virtual implementations for Field_xxx::max_display_length()
        - additional code in adjust_max_effective_column_length() fixing
          bad results of Field_xxx::max_display_length()
        This change is safe:
        - The code using Field::max_display_length()
          in field.cc, sql_show.cc, sql_type.cc is not affected.
        - The code in rpl_utility.cc is also not affected.
          See a new DBUG_ASSSERT and new comments explaining why.
      
        In the new reduction, Field_xxx::max_display_length() returns
        correct results for all integer types (except MEDIUMINT, see below).
      
        Putting implementations of numeric_precision() and max_display_length()
        near each other in field.h made the logic much clearer and thus
        helped to reveal bad results for Field_medium::max_display_length(),
        which returns 9 instead of 8 for signed MEDIUMINT fields.
        This problem will be addressed separately (MDEV-15946).
      
      Note, this change is also useful for pluggable data types (see MDEV-4912),
      as now a user defined Field_xxx has a way to control what's returned
      in INFORMATION_SCHEMA.COLUMNS.NUMERIC_PRECISION and
      INFORMATION_SCHEMA.COLUMNS.NUMERIC_SCALE by implementing
      a desired behavior in Field_xxx::information_schema_numeric_attributes().
      9aaf62d0
    • Sergey Vojtovich's avatar
      MDEV-15763 - VARCHAR(1) COMPRESSED crashes the server · 38c799c9
      Sergey Vojtovich authored
      Storing 1 byte long string in VARCHAR() COMPRESSED column may trigger
      integer overflow when calculating available space for zlib output.
      38c799c9
    • Sergey Vojtovich's avatar
      MDEV-15762 - VARCHAR(0) COMPRESSED crashes the server · 3dec6c48
      Sergey Vojtovich authored
      Character set safe truncation is done when storing non-empty string in
      VARCHAR(0) COMPRESSED column, so that string becomes empty. The code
      didn't expect empty string after truncation.
      
      Fixed by moving empty string check after truncation.
      3dec6c48
    • Sachin Setiya's avatar
      Buildbot fixes · 43ab88f0
      Sachin Setiya authored
      1 Added typecast
      2 Included have_debug.inc
      43ab88f0
    • Igor Babaev's avatar
      MDEV-15902 Assertion `n < m_size' failed, sql_array.h:64: · 615ad709
      Igor Babaev authored
      Element_type& Bounds_checked_array<Element_type>::operator[]
      (size_t) [with Element_type = Item*; size_t = long unsigned int]
      
      In sql_yacc.yy the semantic actions for the MEDIAN window function
      lacked a call of st_select_lex::prepare_add_window_spec().
      This function saves the head of the thd->lex->order_list into
      lex->save_order_list in order this head to be restored in
      st_select_lex::add_window_spec after the specification of the
      window function has been parsed.
      Without a call of prepare_add_window_spec() when add_window_spec()
      was called the head of an empty list was copied into
      thd->lex->order_list (instead of assumed saved head this list).
      This made the list thd->lex->order_list invalid and potentially
      could cause many different problems.
      
      Corrected the result set in the test case for MDEV-15899 that
      used the MEDIAN window function and could not be correct
      without this fix.
      615ad709
  2. 19 Apr, 2018 5 commits
    • Sachin Setiya's avatar
      MDEV-15167 Server crashes in in bitmap_bits_set upon REPAIR PARTITION... · cd8b8169
      Sachin Setiya authored
      after rebuilding under test_pseudo_invisible
      
      If we are doing alter related to partitioning then simple alter stmt
      like adding column(or any alter stmt) can't be combined with partition
      alter, this will generate a syntax error.
      
      But IF we add
      SET debug_dbug="+d,test_pseudo_invisible";
      or test_completely_invisible
      this will add a column to table  with have an already partitioning related
      alter. This execution of wrong stmt will crash the server on later stages.
      (like on repair partition).
      
      So we will simply return 1 (and ER_INTERNAL_ERROR) if we any of these
      debug_dbug flags turned on.
      cd8b8169
    • Marko Mäkelä's avatar
      Merge 10.2 to 10.3 · d71a8855
      Marko Mäkelä authored
      Temporarily disable main.cte_recursive due to hang in
      an added test related to MDEV-15575.
      d71a8855
    • Sachin Setiya's avatar
      Mdev-10664 Add statuses about optimistic parallel replication stalls · 419385db
      Sachin Setiya authored
      In this commit we are adding three more status variable to SHOW SLAVE
      STATUS.  Slave_DDL_Events and Slave_Non_Transactional_Events.
      
      Slave_DDL_Groups:- This status variable counts the occurrence of DDL
      statements
      
      Slave_Non_Transactional_Groups:- This variable count the occurrence
      of non-transnational event group.
      
      Slave_Transactional_Groups:- This variable count the occurrence
      of transnational event group.
      
      Patch Credit:- Kristian Nielsen
      419385db
    • Sachin Setiya's avatar
      MDEV-12924 No --innodb-numa-interleave in mysqld binaries · 547b00d9
      Sachin Setiya authored
      It changes the cmake WITH_NUMA option to have 3 values
      Auto:- If libnuma present compile with numa (Default value)
      OFF:- Compile without libnuma
      On:- Compile with numa , throw error if libnuma not present
      
      Patch Contributer:- Vesa
      Patch Reviewer:- serg
      547b00d9
    • Sachin Setiya's avatar
      MDEV-15754 Server crashes in fill_record_n_invoke_before_triggers upon ... · dde0ba5a
      Sachin Setiya authored
      insert into table with TIMESTAMP INVISIBLE
      
      Problem:- The segfault occurs because value is null but since timestamp field
      is VISIBLE it expects a value , and it tries to call value->save_in_field(..
      Timestamp field should not be visible this is the problem.
      
      Solution:- While we clone field for record0_field we don't honor the field
      _visibility , this patch changes that.
      dde0ba5a
  3. 18 Apr, 2018 4 commits
  4. 17 Apr, 2018 4 commits
  5. 16 Apr, 2018 14 commits
  6. 15 Apr, 2018 2 commits
    • Marko Mäkelä's avatar
      MDEV-15871 Crash in btr_search_build_page_hash_index() · f0e4f94c
      Marko Mäkelä authored
      When skipping the MDEV-11369 'default row' record, check again
      for an empty page.
      f0e4f94c
    • Marko Mäkelä's avatar
      MDEV-13697 DB_TRX_ID is not always reset · 97e51d24
      Marko Mäkelä authored
      The rollback of the modification of a pre-existing record
      should involve a purge-like operation. Before MDEV-12288
      the only purge-like operation was the removal of a
      delete-marked record.
      
      After MDEV-12288, any rollback of updating an existing record
      must reset the DB_TRX_ID column when it is no longer visible
      in the purge read view.
      
      row_vers_must_preserve_del_marked(): Remove. It is cleaner to
      perform the check directly in row0umod.cc.
      
      row_trx_id_offset(): Auxiliary function to retrieve the byte
      offset of DB_TRX_ID in a clustered index leaf page record.
      
      row_undo_mod_must_purge(): Determine if a record should be purged.
      
      row_undo_mod_clust(): For temporary tables, skip the purge checks.
      When rolling back an update so that the original record was not
      delete-marked, reset DB_TRX_ID if the history is no longer visible.
      97e51d24
  7. 14 Apr, 2018 2 commits
  8. 13 Apr, 2018 2 commits