1. 15 May, 2018 4 commits
    • Sergei Petrunia's avatar
      Merge pull request #753 from shinnok/10.3-macfixes · a0048378
      Sergei Petrunia authored
      MDEV-15778: 10.3 macOS build fixes
      a0048378
    • Sachin Setiya's avatar
      MDEV-15965 Invisible columns and LOAD DATA don't work well together:... ER_WARN_TOO_FEW_RECORDS · 9ee5406e
      Sachin Setiya authored
      Fix mysql_load iterator to skip invisible fields.
      9ee5406e
    • Alexander Barkov's avatar
      MDEV-16094 Crash when using AS OF with a stored function · 46be3198
      Alexander Barkov authored
      MDEV-16100 FOR SYSTEM_TIME erroneously resolves string user variables as transaction IDs
      
      Problem:
      
      Vers_history_point::resolve_unit() tested item->result_type() before
      item->fix_fields() was called.
      
      - Item_func_get_user_var::result_type() returned REAL_RESULT by default.
        This caused MDEV-16100.
      - Item_func_sp::result_type() crashed on assert.
        This caused MDEV-16094
      
      Changes:
      1. Adding item->fix_fields() into Vers_history_point::resolve_unit()
         before using data type specific properties of the history point
         expression.
      
      2. Adding a new virtual method Type_handler::Vers_history_point_resolve_unit()
      
      3. Implementing type-specific
         Type_handler_xxx::Type_handler::Vers_history_point_resolve_unit()
          in the way to:
          a. resolve temporal and general purpose string types to TIMESTAMP
          b. resolve BIT and general purpose INT types to TRANSACTION
          c. disallow use of non-relevant data type expressions in FOR SYSTEM_TIME
      
          Note, DOUBLE and DECIMAL data types are disallowed intentionally.
          - DOUBLE does not have enough precision to hold huge BIGINT UNSIGNED values
          - DECIMAL rounds on conversion to INT
          Both lack of precision and rounding might potentionally lead to
          very unpredictable results when a wrong transaction ID would be chosen.
          If one really wants dangerous use of DOUBLE and DECIMAL, explicit CAST
          can be used:
      
            FOR SYSTEM_TIME AS OF CAST(double_or_decimal AS UNSIGNED)
      
          QQ: perhaps DECIMAL(N,0) could still be allowed.
      
      4. Adding a new virtual method Item::type_handler_for_system_time(),
         to make HEX hybrids and bit literals work as TRANSACTION rather
         than TIMESTAMP.
      
      5. sql_yacc.yy: replacing the rule temporal_literal to "TIMESTAMP TEXT_STRING".
         Other temporal literals now resolve to TIMESTAMP through the new
         Type_handler methods. No special grammar needed. This removed
         a few shift/resolve conflicts.
         (TIMESTAMP related conflicts in "history_point:" will be removed separately)
      
      6. Removing the "timestamp_only" parameter from
         vers_select_conds_t::resolve_units() and Vers_history_point::resolve_unit().
         It was a hint telling that a table did not have any TRANSACTION-aware
         system time columns, so it's OK to resolve to TIMESTAMP in case of uncertainty.
         In the new reduction it works as follows:
         - the decision between TIMESTAMP and TRANSACTION is first made
           based only on the expression data type only
         - then, in case if the expression resolved to TRANSACTION, the table
           is checked if TRANSACTION-aware columns really exist.
         This way is safer against possible ALTER TABLE statements changing
         ROW START and ROW END columns from "BIGINT UNSIGNED" to "TIMESTAMP(x)"
         or the other way around.
      46be3198
    • Igor Babaev's avatar
      Adjusted test results after mdev-15159. · 1b45ede6
      Igor Babaev authored
      1b45ede6
  2. 14 May, 2018 7 commits
  3. 12 May, 2018 27 commits
  4. 11 May, 2018 2 commits
    • Marko Mäkelä's avatar
    • Sachin Agarwal's avatar
      Bug #23593654 CRASH IN BUF_BLOCK_FROM_AHI WHEN LARGE PAGES AND AHI ARE ENABLED · 0da98472
      Sachin Agarwal authored
      Problem:
      
      Fix for Bug #21348684 (#Rb9581) introduced a conditional debug execute
      'buf_pool_resize_chunk_null', which causes new chunks memory for 2nd
      buffer pool instance is freed.
      
      Buffer pool resize function removes all old chunks entry from
      'buf_chunk_map_reg' and add new chunks entry into it. But when
      'buf_pool_resize_chunk_null' is set true, 2nd buffer pool
      instance's chunk entries are not added into 'buf_chunk_map_reg'.
      When purge thread tries to access that buffer chunk, it leads to
      debug assertion.
      
      Fix:
      
      Added old chunk entries into 'buf_chunk_map_reg' for 2nd buffer pool
      instance when 'buf_pool_resize_chunk_null' debug condition is set to true.
      
      Reviewed by: Jimmy <Jimmy.Yang@oracle.com>
      RB: 18664
      0da98472