1. 15 Oct, 2018 7 commits
  2. 14 Oct, 2018 5 commits
  3. 12 Oct, 2018 2 commits
    • Marko Mäkelä's avatar
      row_build_index_entry_low(): Handle dropped columns correctly · 76f09b53
      Marko Mäkelä authored
      row_build_index_entry_low(): Clean up the code, removing
      redundant variables and conditions. For instantly dropped columns,
      generate a dummy value that is NULL, the empty string, or a
      fixed length of NUL bytes, depending on the type of the dropped column.
      
      FIXME: For some reason, during the test gcol.innodb_virtual_debug_purge
      we are returning NULL for indexes on virtual columns, meaning that
      purge on the indexes is being skipped. Does this lead to missed purge,
      or is it merely causing unnecessary memory allocation? Why are we not
      evaluating the virtual column values before calling this function?
      (And why not write all index keys (virtual columns or spatial index MBR)
      directly to the undo log records?)
      76f09b53
    • Marko Mäkelä's avatar
      Relax a too strict assertion · 0ab49a10
      Marko Mäkelä authored
      row_upd_clust_rec_by_insert_inherit_func(): On the update of PRIMARY KEY
      of a record that contained a dropped column whose value was stored
      externally, we will be inserting a dummy NULL or empty string value
      to the field of the dropped column. The externally stored column would
      eventually be dropped when purge removes the delete-marked record for
      the old PRIMARY KEY value.
      0ab49a10
  4. 11 Oct, 2018 7 commits
  5. 10 Oct, 2018 15 commits
    • Marko Mäkelä's avatar
      5912f133
    • Marko Mäkelä's avatar
      Avoid losing precision on 64-bit Windows · d03446c9
      Marko Mäkelä authored
      d03446c9
    • Marko Mäkelä's avatar
      MDEV-15562: Remove dict_table_t::rollback_instant(unsigned n) · f545e3cf
      Marko Mäkelä authored
      On the rollback of changes to SYS_COLUMNS, MDEV-15562 will
      break the assumption that the only instantaneous changes to columns
      are the addition to the end of the column list.
      
      The function dict_table_t::rollback_instant(unsigned n)
      is inherently incompatible with instantly dropping or reordering
      columns.
      
      When a change to SYS_COLUMNS is rolled back, we must simply evict
      the affected table definition, at the end of the rollback. We cannot
      free the table object immediately, because the current transaction
      that is being rolled back may be holding a lock on the table and
      its metadata record.
      
      dict_table_remove_from_cache_low(): Replaced
      by dict_table_remove_from_cache().
      
      dict_table_remove_from_cache(): Add a third parameter keep=false,
      so that the table can be freed by the caller.
      
      trx_lock_t::evicted_tables: List of tables on which trx_t::evict_table()
      was invoked.
      
      trx_t::evict_table(): Evict a table definition during rollback.
      
      trx_commit_in_memory(): Empty the trx->lock.evicted_tables list
      after the locks were released, by freeing the table objects.
      
      row_undo_ins_remove_clust_rec(), row_undo_mod_clust_low():
      Invoke trx_t::evict_table() on the affected table if a change to
      SYS_COLUMNS is being rolled back.
      f545e3cf
    • Marko Mäkelä's avatar
      MDEV-15562: Simplify FOREIGN KEY error handling on DDL · f58a0b3a
      Marko Mäkelä authored
      The error handling for ALTER TABLE…ALGORITHM=COPY as well as
      CREATE TABLE used to commit the CREATE TABLE transaction and then
      issue DROP TABLE in a separate transaction. This is unnecessarily
      breaking atomicity during DDL operations. Let us revise it so
      that the DROP TABLE will be executed within the same transaction,
      which will finally be rolled back.
      
      FIXME: Introduce an undo log record so that the data file would be
      deleted on rollback and no DROP TABLE would be needed at all.
      
      FIXME: Avoid unnecessary access to per-table tablespace during DROP TABLE.
      If the .ibd file is going to be deleted anyway, we should not bother
      to mark the pages free.
      
      dict_create_add_foreigns_to_dictionary(): Do not commit the transaction.
      We want simple rollback in case dict_load_foreigns() would fail.
      
      create_table_info_t::create_table(), row_create_index_for_mysql(),
      row_table_add_foreign_constraints(): Before invoking rollback, drop
      the table. Rollback would invoke trx_t::evict_table(), and after that
      dropping the table would be a no-op.
      
      ha_innobase::create(): Before rollback, drop the table. If the SQL
      layer invoked ha_innobase::delete_table() later, it would be a no-op
      because the rollback would have invoked trx_t::evict_table().
      f58a0b3a
    • Marko Mäkelä's avatar
      MDEV-15562: Add dict_index_t::first_user_field() · cd081734
      Marko Mäkelä authored
      dict_index_t::first_user_field(): Return the first data field in
      a clustered index, that is, the field after the PRIMARY KEY and
      the two system columns DB_TRX_ID, DB_ROLL_PTR.
      
      dtuple_convert_big_rec(): Remove some local variables.
      cd081734
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.4 · 2a955c7a
      Marko Mäkelä authored
      2a955c7a
    • Marko Mäkelä's avatar
      Merge 10.4 into bb-10.4-mdev-15562 · f9807c7c
      Marko Mäkelä authored
      f9807c7c
    • Marko Mäkelä's avatar
      Enable an assertion · 46d768eb
      Marko Mäkelä authored
      46d768eb
    • Marko Mäkelä's avatar
      Fix bogus pointer arithmetics · 2f5ac0a4
      Marko Mäkelä authored
      2f5ac0a4
    • Marko Mäkelä's avatar
      Remove a goto and bogus assertions · d6e501f1
      Marko Mäkelä authored
      d6e501f1
    • Marko Mäkelä's avatar
      Merge 10.2 into 10.3 · 61b32df9
      Marko Mäkelä authored
      61b32df9
    • Marko Mäkelä's avatar
      MDEV-16946 innodb.alter_kill failed in buildbot with wrong result · 00b6c7d8
      Marko Mäkelä authored
      Ensure that no redo log checkpoint occurs in a critical section
      of a recovery test.
      00b6c7d8
    • Marko Mäkelä's avatar
      MDEV-16273 innodb.alter_kill fails Unknown storage engine 'InnoDB' · 2610c26a
      Marko Mäkelä authored
      The test is shutting down InnoDB, corrupting a file, and finally
      restarting InnoDB. Before the shutdown, the test created the table
      and inserted some records. Before MDEV-12288, there would be no access
      to the table after server restart, but after MDEV-12288 purge would
      reset the transaction identifier after the INSERT, and this would
      sometimes happen after the restart.
      
      To make the test deterministic, wait for purge to complete before the
      shutdown.
      2610c26a
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Fix the non-debug build · db2edfaf
      Marko Mäkelä authored
      db2edfaf
  6. 09 Oct, 2018 4 commits
    • Marko Mäkelä's avatar
      Work around a test failure · 9c458f54
      Marko Mäkelä authored
      9c458f54
    • Marko Mäkelä's avatar
    • Marko Mäkelä's avatar
      Adjust a test. · 78e7a16b
      Marko Mäkelä authored
      FIXME: DB_TRX_ID,DB_ROLL_PTR are not reset for the metadata record
      78e7a16b
    • Marko Mäkelä's avatar
      Try to support ADD/DROP/reorder with virtual columns · 6e4c840b
      Marko Mäkelä authored
      FIXME: The virtual column code does not really support any reordering
      of virtual columns. The function check_v_col_in_order() should be
      removed and all the code fixed.
      
      ha_innobase::check_if_supported_inplace_alter(): For now,
      forbid ADD COLUMN of a stored column together with ADD/DROP of
      virtual columns. This works around an assertion failure in
      gcol.innodb_virtual_basic line 541.
      
      dict_table_t::instant_column(): Copy and adjust v_cols[].
      
      dict_table_t::rollback_instant(): Roll back v_cols[].
      
      innobase_build_col_map(): Skip added virtual columns.
      
      prepare_inplace_add_virtual(): Correctly compute num_to_add_vcol.
      Remove some unnecessary code. Note that the call to
      innodb_base_col_setup() should be executed later.
      
      innobase_add_virtual_try(), innobase_drop_virtual_try(): Let
      the caller invoke innodb_update_cols().
      
      ha_innobase::commit_inplace_alter_table(): Add a FIXME comment
      that we should not reload the table when virtual columns are added
      or dropped. Currently, reloading is the only way to add the base
      columns of virtual columns into the InnoDB data dictionary cache.
      
      innobase_instant_try(): If any virtual column is dropped, rewrite
      all virtual column metadata. Use a shortcut only for adding
      virtual columns. This is because innobase_drop_virtual_try()
      assumes that the dropped virtual columns still exist in the cache.
      6e4c840b