Commit a8ec55e4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-13359 Enable ALTER TABLE...ALGORITHM=INPLACE for compressed columns

innobase_rec_reset(): Remove. This function was introduced in the
InnoDB Plugin for MySQL 5.1, which later evolved into MySQL 5.5.
There used to be a bug that ADD UNIQUE INDEX would not always correctly
report the duplicate key value of the secondary index. This function
ensured that instead of reporting total garbage values, InnoDB
would report NULL.

It looks like the function was made unnecessary in MySQL 5.6.6 by
https://github.com/mysql/mysql-server/commit/d143097eb1e02904baed34990db637ff68fe3113

The corresponding test was subsequently adjusted in
https://github.com/mysql/mysql-server/commit/fde80cf49d4b7635d2aef47d8a77681f2df62105

The ALTER TABLE tests were imported to MariaDB as part of MDEV-13625,
and these tests do pass with this change.

The unnecessary function did not do any harm before MDEV-11371 introduced
compressed columns.

One question remains: What if we needed to report a duplicate key value
for a compressed column? The simple answer is that the test
main.column_compression demonstrates that no indexes can be defined
on compressed columns.
parent 8a8cca28
......@@ -727,13 +727,6 @@ ha_innobase::check_if_supported_inplace_alter(
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
/* Disable online ALTER TABLE for compressed columns until
MDEV-13359 - "Online ALTER TABLE will be disabled for compressed columns"
is fixed. */
if (field->compression_method()) {
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
}
ulint n_indexes = UT_LIST_GET_LEN((m_prebuilt->table)->indexes);
......@@ -1032,12 +1025,6 @@ ha_innobase::check_if_supported_inplace_alter(
|| (ha_alter_info->handler_flags
& Alter_inplace_info::ADD_COLUMN));
/* Disable online ALTER TABLE for compressed columns until
MDEV-13359 - "Online ALTER TABLE will be disabled for compressed columns"
is fixed. */
if (cf->compression_method()) {
DBUG_RETURN(HA_ALTER_INPLACE_NOT_SUPPORTED);
}
if (const Field* f = cf->field) {
/* This could be changing an existing column
from NULL to NOT NULL. */
......@@ -1982,21 +1969,6 @@ innobase_row_to_mysql(
}
}
/*************************************************************//**
Resets table->record[0]. */
void
innobase_rec_reset(
/*===============*/
TABLE* table) /*!< in/out: MySQL table */
{
uint n_fields = table->s->fields;
uint i;
for (i = 0; i < n_fields; i++) {
table->field[i]->set_default();
}
}
/*******************************************************************//**
This function checks that index keys are sensible.
@return 0 or error number */
......
......@@ -53,14 +53,6 @@ innobase_row_to_mysql(
const dtuple_t* row) /*!< in: InnoDB row */
MY_ATTRIBUTE((nonnull));
/*************************************************************//**
Resets table->record[0]. */
void
innobase_rec_reset(
/*===============*/
struct TABLE* table) /*!< in/out: MySQL table */
MY_ATTRIBUTE((nonnull));
/** Generate the next autoinc based on a snapshot of the session
auto_increment_increment and auto_increment_offset variables. */
struct ib_sequence_t {
......
......@@ -4867,12 +4867,6 @@ row_merge_build_indexes(
}
}
/* Reset the MySQL row buffer that is used when reporting
duplicate keys.
This is likely reason for a problem described in MDEV-13359. */
innobase_rec_reset(table);
if (global_system_variables.log_warnings > 2) {
sql_print_information("InnoDB: Online DDL : Start reading"
" clustered index of the table"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment