1. 23 Sep, 2017 1 commit
    • Marko Mäkelä's avatar
      Add member functions to dictionary objects · f4ac3b78
      Marko Mäkelä authored
      dict_col_t::is_nullable(): Determine if the column can be set NULL.
      
      dict_col_t::is_nullable(): Determine if the column is virtual.
      
      dict_col_t::is_instant(): Determine if the column has been instantly added.
      
      dict_col_t::instant_value(): Get the default value of an instantly-added
      column.
      
      dict_index_t::get_n_nullable(n_prefix): Determine the number of nullable
      index fields in the prefix.
      
      dict_index_t::instant_field_value(): Get the default value of a
      clustered index field of an instantly-added column.
      f4ac3b78
  2. 22 Sep, 2017 14 commits
  3. 21 Sep, 2017 19 commits
    • Marko Mäkelä's avatar
      Skip the 'default row' pseudo-record where needed · 5c9cedaf
      Marko Mäkelä authored
      The 'default row' record (which stores the default values of
      instantly added columns when they were added) must be ignored
      during normal operation.
      
      Because btr_pcur_store_position() can theoretically be invoked
      on the pseudo-record, we must check every caller of
      btr_pcur_restore_position(). Similarly, when positioning the
      cursor to the start of an index with btr_pcur_open_at_index_side(),
      or when moving to the previous record, we must be careful to
      skip the 'default row' record.
      
      rec_is_default_row(): Check whether a leaf page record is the
      'default row' pseudo-record.
      
      row_import_set_sys_max_row_id(): Check for a table that is empty but
      contains the 'default row' record.
      
      IndexPurge::open(), row_merge_read_clustered_index(),
      dict_stats_analyze_index_level(), row_sel_try_search_shortcut(),
      row_sel(), sel_restore_position_for_mysql(), row_search_mvcc():
      Skip the 'default row' pseudo-record.
      
      fts_get_max_doc_id(): Assert that the 'default row' cannot exist
      in the secondary index FTS_DOC_ID_INDEX(FTS_DOC_ID).
      
      page_find_rec_max_not_deleted(): Assert that we are operating
      on a leaf page. Also skip the 'default row' pseudo-record, not
      only delete-marked records.
      
      row_search_get_max_rec(): Assert that page_find_rec_max_not_deleted()
      did not return any delete-marked or 'default row' record.
      5c9cedaf
    • Marko Mäkelä's avatar
      Always set the heap_no before calling rec_get_offsets() · b52423d7
      Marko Mäkelä authored
      With instant ADD COLUMN, rec_get_offsets() must reliably know if it
      is dealing with a user record (not the page infimum/supremum).
      b52423d7
    • Marko Mäkelä's avatar
      Do not use page_cur_search_with_match_bytes() for comparing MIN_REC_FLAG · 45f01898
      Marko Mäkelä authored
      The 'default row' record (which is the only search tuple and the only
      leaf-page record that carries the REC_INFO_MIN_REC_FLAG)  must be searched
      by using the conventional means. Do not slow down the search shortcut by
      taking the MIN_REC_FLAG into account.
      45f01898
    • Marko Mäkelä's avatar
      Debug fixes for old records after instant ADD COLUMN · b8e14a2e
      Marko Mäkelä authored
      rec_offs_validate(): Do not dereference index==NULL.
      
      rec_validate(): Properly handle missing columns.
      b8e14a2e
    • Marko Mäkelä's avatar
      On instant ALTER TABLE, copy the default values to the dictionary cache · 8857d57e
      Marko Mäkelä authored
      dict_table_get_nth_v_col(): Assert that no default value is ever set
      on a virtual column. Virtual columns are not handled by the
      instant ADD COLUMN mechanism.
      
      ha_innobase_inplace_ctx::commit_instant(): Copy the default values
      from instant_table to old_table.
      Take deep copy of the dict_table_t::v_cols[].
      
      instant_add_instant_try(): Copy the default values to instant_table.
      
      dict_index_get_nth_field_def(): Define the function in the .h file.
      
      dict_col_t::def_val.data: Change the data type to const void*
      to reduce the number of type casts.
      8857d57e
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.3-instant-new · a1ff0469
      Marko Mäkelä authored
      a1ff0469
    • Marko Mäkelä's avatar
      Replace dict_table_get_n_sys_cols(table) with DATA_N_SYS_COLS · d4b2dfa9
      Marko Mäkelä authored
      This could have been done as part of MDEV-11487, which removed the
      support for InnoDB internal temporary tables.
      d4b2dfa9
    • Marko Mäkelä's avatar
      Bootstrap SYS_INDEXES as an 'instant ADD COLUMN' table · d198f961
      Marko Mäkelä authored
      The column SYS_INDEXES.MERGE_THRESHOLD was added in MySQL 5.7.
      This makes the system table the very first one where
      instant ADD COLUMN has been used.
      d198f961
    • Marko Mäkelä's avatar
      Remove unnecessary use of rec_get_nth_cfield() and unnecessary copying · a231bcba
      Marko Mäkelä authored
      rec_get_nth_cfield(): Remove the heap parameter.
      Copying the default value of a field into a heap is only
      needed in row_build_low(type=ROW_COPY_DATA).
      
      rec_get_nth_field(): Use the original definition.
      There are very few rec_get_nth_cfield() calls compared to
      rec_get_nth_field().
      a231bcba
    • Marko Mäkelä's avatar
      Remove code duplication in rem0rec.ic · 5af53464
      Marko Mäkelä authored
      Assert that the flags EXTERNAL, DEFAULT, and NULL are mutually exclusive.
      5af53464
    • Marko Mäkelä's avatar
      Remove dict_col_def_t · dce195b1
      Marko Mäkelä authored
      Store dict_col_t::def_val inline, using an anonymous struct.
      
      dict_mem_table_fake_nth_col_default(),
      dict_col_set_added_column_default(): Remove.
      
      dict_mem_fill_column_struct(): Initialize def_val.
      dce195b1
    • Marko Mäkelä's avatar
      Various fixes for ROW_FORMAT=REDUNDANT · bfb3d327
      Marko Mäkelä authored
      rec_get_offsets(): Use the 'leaf' parameter for non-debug purposes.
      Initialize all fields for ROW_FORMAT=REDUNDANT records that precede
      an instant ADD COLUMN.
      
      rec_offs_make_valid(): Add the parameter 'leaf'.
      
      rec_copy_prefix_to_dtuple(): Assert that the tuple is only built
      on the core fields. Instant ADD COLUMN only applies to the
      clustered index, and we should never build a search key that has
      more than the PRIMARY KEY and possibly DB_TRX_ID,DB_ROLL_PTR.
      All these columns are always present.
      
      dict_index_build_data_tuple(): Remove assertions that would be
      duplicated in rec_copy_prefix_to_dtuple().
      
      rec_get_n_nullable(): Get the number of nullable columns.
      
      rec_init_offsets(): Support ROW_FORMAT=REDUNDANT records that
      were written before instant ADD COLUMN.
      
      cmp_rec_rec_with_match(): Implement comparison of MIN_REC_FLAG records.
      bfb3d327
    • Marko Mäkelä's avatar
      MDEV-11369 Rewrite innodb.instant_alter test · 84167947
      Marko Mäkelä authored
      Create each table with a SPATIAL INDEX, because when MySQL 5.7
      (and MariaDB 10.2.2) introduced SPATIAL INDEX for InnoDB tables,
      a table-rebuilding LOCK=NONE would be refused if the table
      contains any SPATIAL INDEX. With instant ADD COLUMN, the operations
      must be allowed, and must report '0 rows affected' for everything
      else except ROW_FORMAT=COMPRESSED tables.
      
      FIXME: When instant ADD COLUMN is enabled, the ALGORITHM=INPLACE
      will have to be changed to LOCK=NONE.
      84167947
    • Marko Mäkelä's avatar
      Merge 10.3 into 10.3-instant · 0729217e
      Marko Mäkelä authored
      0729217e
    • Marko Mäkelä's avatar
      Merge bb-10.2-ext into 10.3 · e3d44f5d
      Marko Mäkelä authored
      e3d44f5d
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · f70865bc
      Marko Mäkelä authored
      f70865bc
    • Marko Mäkelä's avatar
      After-merge fix: Adjust one more result · c7cc3d04
      Marko Mäkelä authored
      c7cc3d04
    • Marko Mäkelä's avatar
      Merge 10.2 into bb-10.2-ext · 916cd784
      Marko Mäkelä authored
      916cd784
    • Marko Mäkelä's avatar
      After-merge fix: Adjust some results. · 72a80242
      Marko Mäkelä authored
      72a80242
  4. 20 Sep, 2017 6 commits