From 66e1700bedc508e8171ad387ad4f79dafa19f0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 21 Apr 2010 13:27:23 +0300 Subject: [PATCH] dict_create_index_step(): Be strict about DYNAMIC and COMPRESSED tables. Bug #50495 is about REDUNDANT and COMPACT tables, after all. --- mysql-test/suite/innodb_plugin/r/innodb-zip.result | 6 ------ mysql-test/suite/innodb_plugin/t/innodb-zip.test | 9 ++------- storage/innodb_plugin/ChangeLog | 2 +- storage/innodb_plugin/dict/dict0crea.c | 7 +++++-- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/mysql-test/suite/innodb_plugin/r/innodb-zip.result b/mysql-test/suite/innodb_plugin/r/innodb-zip.result index ead5547c1c2..21396d81ba8 100644 --- a/mysql-test/suite/innodb_plugin/r/innodb-zip.result +++ b/mysql-test/suite/innodb_plugin/r/innodb-zip.result @@ -127,12 +127,6 @@ CREATE TABLE t1( c TEXT NOT NULL, d TEXT NOT NULL, PRIMARY KEY (c(767),d(767))) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; -DROP TABLE t1; -SET SESSION innodb_strict_mode = on; -CREATE TABLE t1( -c TEXT NOT NULL, d TEXT NOT NULL, -PRIMARY KEY (c(767),d(767))) -ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; ERROR 42000: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. You have to change some columns to TEXT or BLOBs CREATE TABLE t1( c TEXT NOT NULL, d TEXT NOT NULL, diff --git a/mysql-test/suite/innodb_plugin/t/innodb-zip.test b/mysql-test/suite/innodb_plugin/t/innodb-zip.test index 0abbeb69a4e..4980af437e6 100644 --- a/mysql-test/suite/innodb_plugin/t/innodb-zip.test +++ b/mysql-test/suite/innodb_plugin/t/innodb-zip.test @@ -85,14 +85,9 @@ SELECT table_schema, table_name, row_format FROM information_schema.tables WHERE engine='innodb'; drop table t1,t2; -# The following should not fail in non-strict mode. (Bug #50945) +# The following should fail in non-strict mode too. +# (The fix of Bug #50945 only affects REDUNDANT and COMPACT tables.) SET SESSION innodb_strict_mode = off; -CREATE TABLE t1( - c TEXT NOT NULL, d TEXT NOT NULL, - PRIMARY KEY (c(767),d(767))) -ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=1 CHARSET=ASCII; -DROP TABLE t1; -SET SESSION innodb_strict_mode = on; --error ER_TOO_BIG_ROWSIZE CREATE TABLE t1( c TEXT NOT NULL, d TEXT NOT NULL, diff --git a/storage/innodb_plugin/ChangeLog b/storage/innodb_plugin/ChangeLog index 277601889f8..52deb6d31e2 100644 --- a/storage/innodb_plugin/ChangeLog +++ b/storage/innodb_plugin/ChangeLog @@ -9,7 +9,7 @@ Fix Bug#50495 'Row size too large' for plugin, but works for built-in InnoDB Only check the record size at index creation time when - innodb_strict_mode is set. + innodb_strict_mode is set or when ROW_FORMAT is DYNAMIC or COMPRESSED. 2010-04-20 The InnoDB Team diff --git a/storage/innodb_plugin/dict/dict0crea.c b/storage/innodb_plugin/dict/dict0crea.c index d96cf9a1b26..653bff4bef6 100644 --- a/storage/innodb_plugin/dict/dict0crea.c +++ b/storage/innodb_plugin/dict/dict0crea.c @@ -1105,8 +1105,11 @@ dict_create_index_step( dulint index_id = node->index->id; - err = dict_index_add_to_cache(node->table, node->index, - FIL_NULL, trx_is_strict(trx)); + err = dict_index_add_to_cache( + node->table, node->index, FIL_NULL, + trx_is_strict(trx) + || dict_table_get_format(node->table) + >= DICT_TF_FORMAT_ZIP); node->index = dict_index_get_if_in_cache_low(index_id); ut_a(!node->index == (err != DB_SUCCESS));