- 22 Sep, 2017 10 commits
-
-
Marko Mäkelä authored
btr_pcur_store_position() and btr_pcur_restore_position() will not save the extra header associated with "instanly added" columns, because the stored and restored prefixes only ever include key columns, which cannot be added instantly.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
For ROW_FORMAT=DYNAMIC and ROW_FORMAT=COMPACT records, we have to identify whether the record contains more columns than when the clustered index tree was originally created. In this case, the number of fields (FIXME: number_of_added_fields-1, not the total number of fields) needs to be written to the record header. rec_comp_status_t: An enum of the status bit values. rec_leaf_format: An enum that replaces the bool parameter of rec_init_offsets_comp_ordinary(). rec_get_converted_size_comp(): Do not support infimum,supremum. They are never supposed to be stored in dtuple_t, as page creation nowadays uses a lower-level method for inserting them. innobase_add_instant_try(): Initialize the dtuple_t::info_bits appropriately to REC_INFO_MIN_REC_FLAG | REC_STATUS_COLUMNS_ADDED so that it can be inserted into a ROW_FORMAT!=REDUNDANT table.
-
Marko Mäkelä authored
row_merge_read_clustered_index(), IndexPurge::open(): Before testing for the 'default row' pseudo-record, advance the cursor from the infimum pseudo-record, and then move back if needed.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
rec_offs_any_flag(): The EXTERNAL and DEFAULT flags are only mutually exclusive for individual fields. A record can contain both EXTERNAL and DEFAULT fields, as long as they are separate fields.
-
Marko Mäkelä authored
sel_restore_position_for_mysql(): Pass the correct index to rec_is_default_row(). (We should really remove btr_cur_t::index and use page_cur_t::index isntead.)
-
Marko Mäkelä authored
This reverts commit d198f961.
-
- 21 Sep, 2017 19 commits
-
-
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.
-
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).
-
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.
-
Marko Mäkelä authored
rec_offs_validate(): Do not dereference index==NULL. rec_validate(): Properly handle missing columns.
-
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.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
This could have been done as part of MDEV-11487, which removed the support for InnoDB internal temporary tables.
-
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.
-
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().
-
Marko Mäkelä authored
Assert that the flags EXTERNAL, DEFAULT, and NULL are mutually exclusive.
-
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.
-
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.
-
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.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
- 20 Sep, 2017 11 commits
-
-
Sergei Golubchik authored
followup for b5ead3a6 libmariadb3 does not replace 10.1's libmariadbclient18 anymore, but it still conflicts with it, both install dialog.so
-
Marko Mäkelä authored
-
Marko Mäkelä authored
This fixes a regression that only affects debug builds, caused by commit 48192f96 which is necessary preparation for MDEV-11369 instant ADD COLUMN. (Although that is a 10.3 task, to ease merges between 10.2 and 10.3, this change that improves debug checks was pushed to 10.2 already.) Unlike btr_pcur_restore_position(), rtr_cur_restore_position() can create a search tuple out of a non-leaf page record. So, we must pass 'bool leaf' parameter to dict_index_build_data_tuple(). dict_index_build_data_tuple(): Add a debug-only parameter 'bool leaf'. rec_copy_prefix_to_dtuple(): Make the parameter debug-only. row_sel_get_clust_rec_for_mysql(): In the debug code for spatial index, remove an unnecessary call to buf_page_get_gen(), and use the already latched block directly.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
-
Marko Mäkelä authored
MDEV-13851 Always check table options in ALTER TABLE…ALGORITHM=INPLACE In the merge of MySQL 5.7.9 to MariaDB 10.2.2, some code was included that prevents ADD SPATIAL INDEX from being executed with ALGORITHM=INPLACE. Also, the constant ADD_SPATIAL_INDEX was introduced as an alias to ADD_INDEX. We will remove that alias now, and properly implement the same ADD SPATIAL INDEX restrictions as MySQL 5.7 does: 1. table-rebuilding operations are not allowed if SPATIAL INDEX survive it 2. ALTER TABLE…ADD SPATIAL INDEX…LOCK=NONE is not allowed ha_innobase::prepare_inplace_alter_table(): If the ALTER TABLE requires actions within InnoDB, enforce the table options (MDEV-13851). In this way, we will keep denying ADD SPATIAL INDEX for tables that use encryption (MDEV-11974), even if ALGORITHM=INPLACE is used.
-
Marko Mäkelä authored
-
Marko Mäkelä authored
This should affect debug builds only. Debug builds will check that the status bits of ROW_FORMAT!=REDUNDANT records match the is_leaf parameter. The only observable change to non-debug should be the addition of the is_leaf parameter to the function rec_copy_prefix_to_dtuple(), and the removal of some calls to update the adaptive hash index (it is only built for the leaf pages). This change should have been made in MySQL 5.0.3, instead of introducing the status flags in the ROW_FORMAT=COMPACT record header.
-
Eugene Kosov authored
* remove dead code * rename method to reduce confusion
-
Vicențiu Ciorbaru authored
-