1. 22 Nov, 2018 2 commits
    • Alexander Barkov's avatar
    • Marko Mäkelä's avatar
      MDEV-17793 Crash in purge after instant DROP and emptying the table · 2ebb110c
      Marko Mäkelä authored
      There was a race condition between ALTER TABLE and purge.
      
      If a table turns out to be logically empty when instant ALTER TABLE
      is executing, we will convert the table to the canonical format,
      to avoid overhead during subsequent accesses, and to allow the
      data file to be imported into older versions of MariaDB.
      
      It could happen that at the time the table is logically empty,
      there still exists an undo log record for updating the hidden
      metadata record for an earlier instant ALTER TABLE operation.
      If the table was converted to the canonical format before
      purge processes this undo log record, the undo log record
      could be referring to index fields that no longer exist,
      causing a crash.
      
      To prevent the race condition, we must delete the old undo log records.
      We do this lazily by assigning a new table ID, so that the table lookup
      for the old undo log records will fail.
      
      dict_table_t::reassign_id(): Reassign the table_id to
      effectively lazily delete old undo log records.
      
      innobase_instant_try(): Invoke index->table->reassign_id() before
      index->clear_instant_alter().
      2ebb110c
  2. 21 Nov, 2018 5 commits
  3. 20 Nov, 2018 11 commits
  4. 19 Nov, 2018 8 commits
  5. 18 Nov, 2018 2 commits
    • Marko Mäkelä's avatar
      Fix a compilation error · 7debbd78
      Marko Mäkelä authored
      ib_counter_t::ib_counter_element_t: Avoid sizeof on a std::atomic type,
      because it causes errors on some version of the Microsoft compiler.
      7debbd78
    • 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
  6. 17 Nov, 2018 1 commit
  7. 16 Nov, 2018 11 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
    • Elena Stepanova's avatar
      fe0e65db
    • Monty's avatar
      Max transid was not stored directly after Aria recovery · 37d6d3b6
      Monty authored
      This caused ma_test_recovery.pl to fail
      
      Other things:
      - Fixed bug where "ma_test_recovert.pl --abort-on-error" didn't abort
        on error
      37d6d3b6
    • 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
    • Marko Mäkelä's avatar
      MDEV-17726: A better fix · ab812c10
      Marko Mäkelä authored
      THD::close_temporary_tables(): Revert the change.
      
      ha_innobase::delete_table(): Move the work-around inside
      a debug assertion, and check thd_kill_level() instead of thd_killed(),
      because the latter would not hold for KILL_CONNECTION.
      ab812c10
    • 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