1. 18 Nov, 2018 1 commit
    • Marko Mäkelä's avatar
      MDEV-17750: Fix the Windows build · 075820ab
      Marko Mäkelä authored
      Remove some redundant declarations of global variables. These declarations
      can refer to undefined type names, because they occur before any #include
      statement for the type definitions. On GNU/Linux, uint and ulong seem to
      be defined in <sys/types.h> due to _DEFAULT_SOURCE and __USE_MISC
      becoming defined in <features.h>.
      075820ab
  2. 17 Nov, 2018 1 commit
  3. 16 Nov, 2018 8 commits
    • Marko Mäkelä's avatar
      MDEV-17750: Remove dict_index_get_sys_col_pos() · f92d223f
      Marko Mäkelä authored
      dict_index_t::db_trx_id(): Return the position of DB_TRX_ID.
      Only valid for the clustered index.
      
      dict_index_t::db_roll_ptr(): Return the position of DB_ROLL_PTR.
      Only valid for the clustered index.
      
      dict_index_get_sys_col_pos(): Remove. This was performing unnecessarily
      complex computations, which only made sense for DB_ROW_ID, which would
      exist either as the first field in the clustered index or as the last
      field in a secondary index (only when a DB_ROW_ID column is materialised).
      
      row_sel_store_row_id_to_prebuilt(): Remove, and replace with simpler code.
      
      row_upd_index_entry_sys_field(): Remove.
      
      btr_cur_log_sys(): Replaces row_upd_write_sys_vals_to_log().
      
      btr_cur_write_sys(): Write DB_TRX_ID,DB_ROLL_PTR to a data tuple.
      f92d223f
    • Marko Mäkelä's avatar
      MDEV-17750: Remove unnecessary rec_get_offsets() in IMPORT TABLESPACE · eea0c3c3
      Marko Mäkelä authored
      row_import_set_sys_max_row_id(): Change the return type to void,
      and access the first column (DB_ROW_ID) directly.
      eea0c3c3
    • Marko Mäkelä's avatar
      MDEV-17750: Avoid some rec_get_offsets() for accessing FTS_DOC_ID · 3773bc59
      Marko Mäkelä authored
      fts_get_max_doc_id(): Remove totally unnecessary call to rec_get_offsets().
      In FTS_DOC_ID_INDEX, the FTS_DOC_ID is always stored in the first 8 bytes
      of the record.
      
      fts_get_doc_id_from_row(): Get the offsets from the caller.
      
      row_ins_foreign_check_on_constraint(): Invoke rec_get_offsets()
      for the call.
      3773bc59
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      MDEV-17721 Corrupted data dictionary after instant ADD COLUMN · 16d43150
      Marko Mäkelä authored
      dict_index_t::reconstruct_fields(): Correctly permute the fields
      of the columns. The code was totally wrong in MDEV-15562.
      It would only work when columns are added last or dropped,
      but not when columns are permuted.
      16d43150
    • Marko Mäkelä's avatar
      MDEV-17735 Assertion failure in row_parse_int() on first ADD/DROP COLUMN · f8501224
      Marko Mäkelä authored
      row_ins_clust_index_entry_low(): Do not attempt to read an AUTO_INCREMENT
      column value from a metadata record, because it does not make any sense.
      Moreover, the field offset would be off by one in case the AUTO_INCREMENT
      column is not part of the PRIMARY KEY, because the MDEV-15562 metadata
      record would contain an extra field at index->first_user_field().
      
      On MariaDB Server 10.3 after MDEV-11369, we would unnecessarily read
      a dummy AUTO_INCREMENT value from the metadata record, but that value
      would always be written as NULL or 0, so there is no problem.
      f8501224
    • Eugene Kosov's avatar
      MDEV-16580 Remove unused monitor counters from InnoDB · 89337d51
      Eugene Kosov authored
      Remove one totally dead monitor.
      89337d51
    • Alexander Barkov's avatar
      A cleanup for "MDEV-17477 Wrong result for TIME('-2001-01-01 10:20:30')" · c75a277a
      Alexander Barkov authored
      modified:   ../sql-common/my_time.c
      
      Moving the logic that mixes warnings of two kinds:
      - those came from truncating garbage before the actual parsing of date/time
      - those came during the actual parsing
      from outside to inside of str_to_datetime_or_date_body().
      This makes the caller code easier and removes some code duplication.
      We'll be adding more parsing functions for time intervals soon,
      so this change helps to avoid more duplicate code in the coming functions.
      c75a277a
  4. 14 Nov, 2018 2 commits
  5. 12 Nov, 2018 2 commits
  6. 09 Nov, 2018 3 commits
  7. 08 Nov, 2018 4 commits
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · c761b434
      Marko Mäkelä authored
      c761b434
    • Marko Mäkelä's avatar
      After-merge fixes to the Oracle compatibility parser · bac2ec3a
      Marko Mäkelä authored
      The following merges changed sql_yacc.yy but not sql_yacc_ora.yy:
      commit 862af4d2
      commit df563e0c
      
      Apply the same fixes to the other parser.
      bac2ec3a
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 2767cb76
      Marko Mäkelä authored
      2767cb76
    • Alexander Barkov's avatar
      MDEV-17563 Different results using table or view when comparing values of time type · 07e4853c
      Alexander Barkov authored
      MDEV-17625 Different warnings when comparing a garbage to DATETIME vs TIME
      
      - Splitting processes of data type conversion (to TIME/DATE,DATETIME)
        and warning generation.
        Warning are now only get collected during conversion (in an "int" variable),
        and are pushed in the very end of conversion (not in parallel).
        Warnings generated by the low level routines str_to_xxx() and number_to_xxx()
        can now be changed at the end, when TIME_FUZZY_DATES is applied,
        from "Invalid value" to "Truncated invalid value".
      
        Now "Illegal value" is issued only when the low level routine returned
        an error and TIME_FUZZY_DATES was not set. Otherwise, if the low level
        routine returned "false" (success), or if NULL was converted to a zero
        datetime by TIME_FUZZY_DATES, then "Truncated illegal value"
        is issued. This gives better warnings.
      
      - Methods Type_handler::Item_get_date() and
        Type_handler::Item_func_hybrid_field_type_get_date() now only
        convert and collect warning information, but do not push warnings.
      
      - Changing the return data type for Type_handler::Item_get_date()
        and Type_handler::Item_func_hybrid_field_type_get_date() from
        "bool" to "void". The conversion result (success vs error) can be
        checked by testing ltime->time_type. MYSQL_TIME_{NONE|ERROR}
        mean mean error, other values mean success.
      
      - Adding new wrapper methods Type_handler::Item_get_date_with_warn() and
        Type_handler::Item_func_hybrid_field_type_get_date_with_warn()
        to do conversion followed by raising warnings, and changing
        the code to call new Type_handler::***_with_warn() methods.
      
      - Adding a helper class Temporal::Status, a wrapper
        for MYSQL_TIME_STATUS with automatic initialization.
      
      - Adding a helper class Temporal::Warn, to collect warnings
        but without actually raising them. Moving a part of ErrConv
        into a separate class ErrBuff, and deriving both Temporal::Warn
        and ErrConv from ErrBuff. The ErrBuff part of Temporal::Warn
        is used to collect textual representation of the input data.
      
      - Adding a helper class Temporal::Warn_push. It's used
        to collect warning information during conversion, and
        automatically pushes warnings to the diagnostics area
        on its destructor time (in case of non-zero warning).
      
      - Moving more code from various functions inside class Temporal.
      
      - Adding more Temporal_hybrid constructors and
        protected Temporal methods make_from_xxx(),
        which convert and only collect warning information, but do not
        actually raise warnings.
      
      - Now the low level functions  str_to_datetime() and str_to_time()
        always set status->warning if the return value is "true" (error).
      
      - Now the low level functions number_to_time() and number_to_datetime()
        set the "*was_cut" argument if the return value is "true" (error).
      
      - Adding a few DBUG_ASSERTs to make sure that str_to_xxx() and
        number_to_xxx() always set warnings on error.
      
      - Adding new warning flags MYSQL_TIME_WARN_EDOM and MYSQL_TIME_WARN_ZERO_DATE
        for the code symmetry. Before this change there was a special
        code path for (rc==true && was_cut==0) which was treated by
        Field_temporal::store_invalid_with_warning as "zero date violation".
        Now was_cut==0 always means that there are no any error/warnings/notes
        to be raised, not matter what rc is.
      
      - Using new Temporal_hybrid constructors in combination with
        Temporal::Warn_push inside str_to_datetime_with_warn(),
        double_to_datetime_with_warn(), int_to_datetime_with_warn(),
        Field::get_date(), Item::get_date_from_string(), and a few other places.
      
      - Removing methods Dec_ptr::to_datetime_with_warn(),
        Year::to_time_with_warn(), my_decimal::to_datetime_with_warn(),
        Dec_ptr::to_datetime_with_warn().
        Fixing Sec6::to_time() and Sec6::to_datetime() to
        convert and only collect warnings, without raising warnings.
        Now warning raising functionality resides in Temporal::Warn_push.
      
      - Adding classes Longlong_hybrid_null and Double_null, to
        return both value and the "IS NULL" flag. Adding methods
        Item::to_double_null(), to_longlong_hybrid_null(),
        Item_func_hybrid_field_type::to_longlong_hybrid_null_op(),
        Item_func_hybrid_field_type::to_double_null_op().
        Removing separate classes VInt and VInt_op, as they
        have been replaced by a single class Longlong_hybrid_null.
      
      - Adding a helper method Temporal::type_name_by_timestamp_type(),
        moving a part of make_truncated_value_warning() into it,
        and reusing in Temporal::Warn::push_conversion_warnings().
      
      - Removing Item::make_zero_date() and
        Item_func_hybrid_field_type::make_zero_mysql_time().
        They provided duplicate functionality.
        Now this code resides in Temporal::make_fuzzy_date().
        The latter is now called for all Item types when data type
        conversion (to DATE/TIME/DATETIME) is involved, including
        Item_field and Item_direct_view_ref.
        This fixes MDEV-17563: Item_direct_view_ref now correctly converts
        NULL to a zero date when TIME_FUZZY_DATES says so.
      07e4853c
  8. 07 Nov, 2018 12 commits
  9. 06 Nov, 2018 7 commits