summaryrefslogtreecommitdiff
path: root/storage/xtradb/handler/handler0alter.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-01-03 19:32:47 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2017-01-03 19:32:47 +0200
commit80d5d1452a4a6b7bd1627116f2a5a950003fc3cb (patch)
tree15a86eab06593ce0195a18172aac9d093c5a6651 /storage/xtradb/handler/handler0alter.cc
parent3871477c40efc826805f4c4e35b006c2c233dd26 (diff)
downloadmariadb-git-bb-10.0-mdev-11694.tar.gz
MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICTbb-10.0-mdev-11694
MariaDB Server 10.0.28 and 10.1.19 merged code from Percona XtraDB that introduced support for compressed columns. Much but not all of this code was disabled by placing #ifdef HAVE_PERCONA_COMPRESSED_COLUMNS around it. Among the unused but not disabled code is code to access some new system tables related to compressed columns. The creation of these system tables SYS_ZIP_DICT and SYS_ZIP_DICT_COLS would cause a crash in --innodb-read-only mode when upgrading from an earlier version to 10.0.28 or 10.1.19. Let us remove all the dead code related to compressed columns. Users who already upgraded to 10.0.28 and 10.1.19 will have the two above mentioned empty tables in their InnoDB system tablespace. Subsequent versions of MariaDB Server will completely ignore those tables.
Diffstat (limited to 'storage/xtradb/handler/handler0alter.cc')
-rw-r--r--storage/xtradb/handler/handler0alter.cc62
1 files changed, 2 insertions, 60 deletions
diff --git a/storage/xtradb/handler/handler0alter.cc b/storage/xtradb/handler/handler0alter.cc
index 362ac9c1b89..c5ac48dc4e3 100644
--- a/storage/xtradb/handler/handler0alter.cc
+++ b/storage/xtradb/handler/handler0alter.cc
@@ -1,6 +1,7 @@
/*****************************************************************************
Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved.
+Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
@@ -21,11 +22,6 @@ this program; if not, write to the Free Software Foundation, Inc.,
Smart ALTER TABLE
*******************************************************/
-#ifndef HAVE_PERCONA_COMPRESSED_COLUMNS
-#define COLUMN_FORMAT_TYPE_COMPRESSED 0xBADF00D
-#define ER_COMPRESSION_DICTIONARY_DOES_NOT_EXIST 0xDEADFACE
-#endif
-
#include <my_global.h>
#include <unireg.h>
#include <mysqld_error.h>
@@ -1185,15 +1181,6 @@ innobase_col_to_mysql(
field->reset();
if (field->type() == MYSQL_TYPE_VARCHAR) {
- if (field->column_format() ==
- COLUMN_FORMAT_TYPE_COMPRESSED) {
- /* Skip compressed varchar column when
- reporting an erroneous row
- during index creation or table rebuild. */
- field->set_null();
- break;
- }
-
/* This is a >= 5.0.3 type true VARCHAR. Store the
length of the data to the first byte or the first
two bytes of dest. */
@@ -2492,14 +2479,7 @@ innobase_build_col_map_add(
byte* buf = static_cast<byte*>(mem_heap_alloc(heap, size));
row_mysql_store_col_in_innobase_format(
- dfield, buf, TRUE, field->ptr, size, comp,
-#ifdef HAVE_PERCONA_COMPRESSED_COLUMNS
- field->column_format() == COLUMN_FORMAT_TYPE_COMPRESSED,
- reinterpret_cast<const byte*>(field->zip_dict_data.str),
- field->zip_dict_data.length, prebuilt);
-#else
- 0,0,0, prebuilt);
-#endif
+ dfield, buf, TRUE, field->ptr, size, comp);
}
/** Construct the translation table for reordering, dropping or
@@ -2753,7 +2733,6 @@ prepare_inplace_alter_table_dict(
ulint num_fts_index;
ha_innobase_inplace_ctx*ctx;
uint sql_idx;
- ulint* zip_dict_ids = 0;
DBUG_ENTER("prepare_inplace_alter_table_dict");
@@ -2890,26 +2869,6 @@ prepare_inplace_alter_table_dict(
ulint n_cols;
dtuple_t* add_cols;
- zip_dict_ids = static_cast<ulint*>(
- mem_heap_alloc(ctx->heap,
- altered_table->s->fields * sizeof(ulint)));
-
- /* This is currently required for valgrind because MariaDB does
- not currently support compressed columns. */
- for (size_t field_idx = 0;
- field_idx < altered_table->s->fields;
- ++field_idx) {
- zip_dict_ids[field_idx] = ULINT_UNDEFINED;
- }
-
- const char* err_zip_dict_name = 0;
- if (!innobase_check_zip_dicts(altered_table, zip_dict_ids,
- ctx->trx, &err_zip_dict_name)) {
- my_error(ER_COMPRESSION_DICTIONARY_DOES_NOT_EXIST,
- MYF(0), err_zip_dict_name);
- goto new_clustered_failed;
- }
-
if (innobase_check_foreigns(
ha_alter_info, altered_table, old_table,
user_table, ctx->drop_fk, ctx->num_to_drop_fk)) {
@@ -3016,12 +2975,6 @@ prepare_inplace_alter_table_dict(
}
}
- if (field->column_format() ==
- COLUMN_FORMAT_TYPE_COMPRESSED) {
- field_type |= DATA_COMPRESSED;
- }
-
-
if (dict_col_name_is_reserved(field->field_name)) {
dict_mem_table_free(ctx->new_table);
my_error(ER_WRONG_COLUMN_NAME, MYF(0),
@@ -3279,17 +3232,6 @@ op_ok:
DBUG_ASSERT(error == DB_SUCCESS);
-#ifdef HAVE_PERCONA_COMPRESSED_COLUMNS
- /*
- Adding compression dictionary <-> compressed table column links
- to the SYS_ZIP_DICT_COLS table.
- */
- if (zip_dict_ids != 0) {
- innobase_create_zip_dict_references(altered_table,
- ctx->trx->table_id, zip_dict_ids, ctx->trx);
- }
-#endif
-
/* Commit the data dictionary transaction in order to release
the table locks on the system tables. This means that if
MySQL crashes while creating a new primary key inside