Commit 7cf97ed4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-11816 Disallow CREATE TEMPORARY TABLE…ROW_FORMAT=COMPRESSED

MySQL 5.7 allows temporary tables to be created in ROW_FORMAT=COMPRESSED.
The usefulness of this is questionable. WL#7899 in MySQL 8.0.0
prevents the creation of such compressed tables, so that all InnoDB
temporary tables will be located inside the predefined
InnoDB temporary tablespace.

Pick up and adjust some tests from MySQL 5.7 and 8.0.

dict_tf_to_fsp_flags(): Remove the parameter is_temp.
fsp_flags_init(): Remove the parameter is_temporary.

row_mysql_drop_temp_tables(): Remove. There cannot be any temporary
tables in InnoDB. (This never removed #sql* tables in the datadir
which were created by DDL.)

dict_table_t::dir_path_of_temp_table: Remove.

create_table_info_t::m_temp_path: Remove.

create_table_info_t::create_options_are_invalid(): Do not allow
ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE for temporary tables.

create_table_info_t::innobase_table_flags(): Do not unnecessarily
prevent CREATE TEMPORARY TABLE with SPATIAL INDEX.
(MySQL 5.7 does allow this.)

fil_space_belongs_in_lru(): The only FIL_TYPE_TEMPORARY tablespace
is never subjected to closing least-recently-used files.
parent 494e4b99
delimiter |;
create procedure populate_t1()
begin
declare i int default 1;
while (i <= 200) do
insert into t1 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
create procedure populate_t1_small()
begin
declare i int default 1;
while (i <= 20) do
insert into t1 values (i, 'c', 'd');
set i = i + 1;
end while;
end|
create procedure populate_t1_small2()
begin
declare i int default 30;
while (i <= 50) do
insert into t1 values (i, 'e', 'f');
set i = i + 1;
end while;
end|
delimiter ;|
#
begin;
select count(*) from t1;
call populate_t1();
select count(*) from t1;
select * from t1 limit 10;
rollback;
select count(*) from t1;
#
begin;
call populate_t1();
select count(*) from t1;
commit;
select count(*) from t1;
#
truncate table t1;
select count(*) from t1;
#
call populate_t1_small();
select count(*) from t1;
rollback;
select count(*) from t1;
truncate table t1;
#
call populate_t1();
select count(*) from t1;
delete from t1 where keyc <= 60;
select count(*) from t1;
call populate_t1_small();
select count(*) from t1;
select * from t1 limit 10;
begin;
call populate_t1_small2();
select count(*) from t1;
select * from t1 where keyc > 30 limit 10;
rollback;
select count(*) from t1;
select * from t1 where keyc > 30 limit 10;
#
update t1 set keyc = keyc + 2000;
select * from t1 limit 10;
rollback;
begin;
update t1 set keyc = keyc + 2000;
select * from t1 limit 10;
rollback;
select * from t1 limit 10;
commit;
select * from t1 limit 10;
#
insert into t2 select * from t1 where keyc < 2101;
select count(*) from t2;
#
drop procedure populate_t1;
drop procedure populate_t1_small;
drop procedure populate_t1_small2;
......@@ -194,18 +194,22 @@ count(*)
drop procedure populate_t1;
drop procedure populate_t1_small;
drop procedure populate_t1_small2;
drop table t1;
drop table t2;
drop temporary table t1,t2;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 4;
ERROR HY000: CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb;
set innodb_strict_mode=off;
create temporary table t2
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 8;
set innodb_strict_mode=default;
set innodb_strict_mode=on;
create procedure populate_t1()
begin
declare i int default 1;
......@@ -394,9 +398,7 @@ count(*)
drop procedure populate_t1;
drop procedure populate_t1_small;
drop procedure populate_t1_small2;
drop table t1;
drop table t2;
set global innodb_file_per_table = 0;
drop temporary table t1, t2;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
......@@ -593,6 +595,3 @@ count(*)
drop procedure populate_t1;
drop procedure populate_t1_small;
drop procedure populate_t1_small2;
drop table t1;
drop table t2;
set global innodb_file_per_table = 1;
This diff is collapsed.
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
i
1
2
3
4
select * from t1 where i = 4;
i
4
drop table t1;
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
i
1
2
3
4
select * from t1 where i = 4;
i
4
drop table t1;
create temporary table t2 (i int) engine = innodb;
insert into t2 values (1), (2), (3), (4);
select * from t2;
i
1
2
3
4
select * from t2 where i = 4;
i
4
drop table t2;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc)) engine = innodb;
create procedure populate_t1()
begin
declare i int default 1;
while (i <= 200) DO
insert into t1 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
set autocommit=0;
select count(*) from t1;
count(*)
0
call populate_t1();
select count(*) from t1;
count(*)
200
select * from t1 limit 10;
keyc c1 c2
1 a b
2 a b
3 a b
4 a b
5 a b
6 a b
7 a b
8 a b
9 a b
10 a b
set autocommit=1;
truncate table t1;
select count(*) from t1;
count(*)
0
drop table t1;
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
i
1
2
3
4
select * from t1 where i = 4;
i
4
drop table t1;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc))
engine = innodb;
begin;
select count(*) from t1;
count(*)
0
call populate_t1();
select count(*) from t1;
count(*)
200
rollback;
select count(*) from t1;
count(*)
0
begin;
call populate_t1();
commit;
select count(*) from t1;
count(*)
200
truncate table t1;
select count(*) from t1;
count(*)
0
drop table t1;
drop procedure populate_t1;
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
explain select * from t1 where t1_i = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using where
alter table t1 add unique index pri_index(t1_i);
explain select * from t1 where t1_i = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const pri_index pri_index 5 const 1
select * from t1 where t1_i = 1;
t1_i t1_f
1 1.1
alter table t1 add unique index sec_index(t1_f);
ERROR 23000: Duplicate entry '2.2' for key 'sec_index'
alter table t1 add index sec_index(t1_f);
explain select * from t1 where t1_f > 2.2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL sec_index NULL NULL NULL 4 Using where
select * from t1 where t1_f > 2.2;
t1_i t1_f
2 2.2
3 2.2
4 4.4
alter table t1 add column (t1_c char(10));
select * from t1;
t1_i t1_f t1_c
1 1.1 NULL
2 2.2 NULL
3 2.2 NULL
4 4.4 NULL
insert into t1 values (5, 5.5, 'krunal');
alter table t1 drop column t1_f;
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`t1_i` int(11) DEFAULT NULL,
`t1_c` char(10) DEFAULT NULL,
UNIQUE KEY `pri_index` (`t1_i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
select * from t1 where t1_f > 2.2;
ERROR 42S22: Unknown column 't1_f' in 'where clause'
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY
drop table t1;
create temporary table t1 (i int, f float) engine = innodb;
insert into t1 values (10, 1.1), (20, 2.2);
select * from t1;
i f
10 1.1
20 2.2
alter table t1 discard tablespace;
ERROR HY000: Cannot DISCARD/IMPORT tablespace associated with temporary table
alter table t1 import tablespace;
ERROR HY000: Cannot DISCARD/IMPORT tablespace associated with temporary table
drop table t1;
create temporary table t1 (i int) engine=innodb;
insert into t1 values (1), (2), (3);
select * from t1;
i
1
2
3
alter table t1 rename t2;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
select * from t2;
i
1
2
3
insert into t2 values (1), (2), (6), (7);
select * from t2;
i
1
2
3
1
2
6
7
drop table t2;
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
SET innodb_strict_mode=OFF;
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compact engine=innodb;
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compressed engine=innodb;
drop table t;
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compact engine=innodb;
ERROR HY000: Index column size too large. The maximum column size is 767 bytes
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
CREATE TEMPORARY TABLE t2 ( i INT ) ENGINE = Innodb;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
COUNT(*)
0
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
COUNT(*)
1
CREATE TEMPORARY table t3 ( i INT ) ENGINE = Innodb;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
COUNT(*)
0
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
COUNT(*)
1
DROP TABLE t1,t2,t3;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
COUNT(*)
0
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
COUNT(*)
0
--source include/have_innodb.inc
--source include/have_innodb_zip.inc
--source include/big_test.inc
####################################################################
# TC to test temp-table DML optimization changes for correctness #
......@@ -22,28 +20,29 @@ create temporary table t2
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb;
--source suite/innodb_zip/include/innodb_dml_ops.inc
drop table t1;
drop table t2;
--source suite/innodb/include/dml_ops.inc
drop temporary table t1,t2;
#
--disable_warnings
--error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 4;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb;
set innodb_strict_mode=off;
--disable_warnings
create temporary table t2
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 8;
set innodb_strict_mode=default;
set innodb_strict_mode=on;
--enable_warnings
--source suite/innodb_zip/include/innodb_dml_ops.inc
drop table t1;
drop table t2;
--source suite/innodb/include/dml_ops.inc
drop temporary table t1, t2;
#
let $file_per_table = `select @@innodb_file_per_table`;
set global innodb_file_per_table = 0;
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
......@@ -52,9 +51,4 @@ create temporary table t2
(keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1)
) engine = innodb;
--source suite/innodb_zip/include/innodb_dml_ops.inc
drop table t1;
drop table t2;
eval set global innodb_file_per_table = $file_per_table;
#
--source suite/innodb/include/dml_ops.inc
This diff is collapsed.
--loose-innodb-sys-datafiles --loose-innodb-sys-tables
#
# WL#6469: Optimizing CREATE/DROP performance for temporary tables
#
--source include/no_valgrind_without_big.inc
--source include/have_innodb.inc
#########################################################################
# #
# Will test following scenarios: #
# 1. Create/Drop of temp-table. (with and w/o explicit pk) #
# 2. Truncate temp-table (result in table drop and recreate). #
# 3. Alter of temp-table. #
# 4. Import/Discard of temp-table (to check blocked action) #
# 5. Renaming of temp-table #
# 6. Creating temp-table with large prefix. #
# 7. Check Temp table info not stored in I_S datafile and tables #
#########################################################################
#-------------------------------------------------------------
#
# 1. Create/Drop of temp-table. (with and w/o explicit pk) #
#
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
select * from t1 where i = 4;
drop table t1;
#
# recreate table wih same name to ensure entries are removed.
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
select * from t1 where i = 4;
drop table t1;
#
create temporary table t2 (i int) engine = innodb;
insert into t2 values (1), (2), (3), (4);
select * from t2;
select * from t2 where i = 4;
drop table t2;
#-------------------------------------------------------------
#
# 2. Truncate temp-table (result in table drop and recreate). #
#
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc)) engine = innodb;
delimiter |;
create procedure populate_t1()
begin
declare i int default 1;
while (i <= 200) DO
insert into t1 values (i, 'a', 'b');
set i = i + 1;
end while;
end|
delimiter ;|
set autocommit=0;
select count(*) from t1;
call populate_t1();
select count(*) from t1;
select * from t1 limit 10;
set autocommit=1;
truncate table t1;
select count(*) from t1;
drop table t1;
#
# recreate table wih same name to ensure entries are removed.
create temporary table t1 (i int) engine = innodb;
insert into t1 values (1), (2), (3), (4);
select * from t1;
select * from t1 where i = 4;
drop table t1;
#
create temporary table t1
(keyc int, c1 char(100), c2 char(100),
primary key(keyc))
engine = innodb;
begin;
select count(*) from t1;
call populate_t1();
select count(*) from t1;
rollback;
select count(*) from t1;
begin;
call populate_t1();
commit;
select count(*) from t1;
truncate table t1;
select count(*) from t1;
drop table t1;
#
drop procedure populate_t1;
#-------------------------------------------------------------
#
# 3. Alter of temp-table.
#
create temporary table t1 (t1_i int, t1_f float) engine = innodb;
insert into t1 values (1, 1.1), (2, 2.2), (3, 2.2), (4, 4.4);
#
explain select * from t1 where t1_i = 1;
alter table t1 add unique index pri_index(t1_i);
explain select * from t1 where t1_i = 1;
select * from t1 where t1_i = 1;
#
--error ER_DUP_ENTRY
alter table t1 add unique index sec_index(t1_f);
alter table t1 add index sec_index(t1_f);
explain select * from t1 where t1_f > 2.2;
select * from t1 where t1_f > 2.2;
#
alter table t1 add column (t1_c char(10));
select * from t1;
insert into t1 values (5, 5.5, 'krunal');
#
alter table t1 drop column t1_f;
show create table t1;
--error ER_BAD_FIELD_ERROR
select * from t1 where t1_f > 2.2;
#
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter table t1 add index sec_index2(t1_c), algorithm=inplace;
#
drop table t1;
#-------------------------------------------------------------
#
# 4. Import/Discard of temp-table (to check blocked action)
#
create temporary table t1 (i int, f float) engine = innodb;
insert into t1 values (10, 1.1), (20, 2.2);
select * from t1;
#
--error ER_CANNOT_DISCARD_TEMPORARY_TABLE
alter table t1 discard tablespace;
--error ER_CANNOT_DISCARD_TEMPORARY_TABLE
alter table t1 import tablespace;
drop table t1;
#-------------------------------------------------------------
#
# 5. Renaming of temp-table #
#
create temporary table t1 (i int) engine=innodb;
insert into t1 values (1), (2), (3);
select * from t1;
#
alter table t1 rename t2;
--error ER_NO_SUCH_TABLE
select * from t1;
select * from t2;
insert into t2 values (1), (2), (6), (7);
select * from t2;
drop table t2;
#-------------------------------------------------------------
#
# 6. Creating temp-table with large prefix. #
#
SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
# This will lead to warnings on innodb_page_size=8k or 4k:
# 8k: Specified key was too long; max key length is 1536 bytes
# 4k: Specified key was too long; max key length is 768 bytes
--disable_warnings
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
#
SET innodb_strict_mode=OFF;
--error ER_INDEX_COLUMN_TOO_LONG
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compact engine=innodb;
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compressed engine=innodb;
drop table t;
#
--error ER_INDEX_COLUMN_TOO_LONG
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = compact engine=innodb;
#
create temporary table t (
a int not null,
b blob not null,
index sk (b(3021))
) row_format = dynamic engine=innodb;
drop table t;
--enable_warnings
#
#-------------------------------------------------------------
#
# 7. Temp table info not stored in I_S
#
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
CREATE TEMPORARY TABLE t2 ( i INT ) ENGINE = Innodb;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
CREATE TEMPORARY table t3 ( i INT ) ENGINE = Innodb;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
DROP TABLE t1,t2,t3;
SELECT COUNT(*) FROM information_schema.INNODB_SYS_DATAFILES WHERE PATH LIKE '%test%t_';
SELECT COUNT(*) FROM information_schema.INNODB_SYS_TABLES WHERE NAME LIKE '%test%t_';
# insert test
insert into t1 values (100, 1.1, 'pune');
insert into t1 values (99, 1.2, 'mumbai');
insert into t1 values (98, 1.3, 'jaipur');
insert into t1 values (97, 1.4, 'delhi');
insert into t1 values (96, 1.5, 'ahmedabad');
select * from t1;
select * from t1 where i = 98;
select * from t1 where i < 100;
#
# add index using alter table table
explain select * from t1 where f > 1.29999;
alter table t1 add index sec_index(f);
explain select * from t1 where f > 1.29999;
select * from t1 where f > 1.29999;
#
explain select * from t1 where i = 100;
alter table t1 add unique index pri_index(i);
explain select * from t1 where i = 100;
select * from t1 where i = 100;
#
# delete test
delete from t1 where i < 97;
select * from t1;
insert into t1 values (96, 1.5, 'kolkata');
select * from t1;
#
# update test
update t1 set f = 1.44 where c = 'delhi';
select * from t1;
#
# truncate table
truncate table t1;
insert into t1 values (100, 1.1, 'pune');
insert into t1 values (99, 1.2, 'mumbai');
insert into t1 values (98, 1.3, 'jaipur');
insert into t1 values (97, 1.4, 'delhi');
insert into t1 values (96, 1.5, 'ahmedabad');
select * from t1;
......@@ -20,33 +20,27 @@ set i = i + 1;
end while;
end|
set global innodb_file_per_table = 1;
set global innodb_file_format = 'Antelope';
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
engine=innodb row_format=compact
key_block_size=NUMBER;
Warnings:
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
create table t2
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
create temporary table t3
(i int, c1 char(100), c2 char(100),
index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1;
count(*)
0
......@@ -69,6 +63,8 @@ select count(*) from t3;
count(*)
5000
truncate table t1;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
select count(*) from t1;
count(*)
0
......@@ -89,7 +85,12 @@ select count(*) from t3;
count(*)
7000
truncate table t2;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
truncate table t3;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1;
count(*)
2000
......@@ -114,9 +115,6 @@ drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF;
create procedure populate()
......@@ -140,9 +138,6 @@ set i = i + 1;
end while;
end|
set global innodb_file_per_table = 1;
set global innodb_file_format = 'Barracuda';
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
......@@ -158,6 +153,10 @@ create temporary table t3
index c1_idx(c1))
engine=innodb row_format=compressed
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
select count(*) from t1;
count(*)
0
......@@ -200,7 +199,12 @@ select count(*) from t3;
count(*)
7000
truncate table t2;
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
truncate table t3;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ROW_FORMAT=COMPRESSED is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: assuming ROW_FORMAT=DYNAMIC.
select count(*) from t1;
count(*)
2000
......@@ -225,9 +229,6 @@ drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
set innodb_strict_mode=OFF;
create procedure populate()
......@@ -251,9 +252,6 @@ set i = i + 1;
end while;
end|
set global innodb_file_per_table = 0;
set global innodb_file_format = 'Antelope';
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER))
......@@ -261,7 +259,6 @@ engine=innodb row_format=compact
key_block_size=NUMBER;
Warnings:
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
create table t2
(i int, c1 char(100), c2 char(100),
......@@ -270,7 +267,6 @@ engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
create temporary table t3
(i int, c1 char(100), c2 char(100),
......@@ -278,9 +274,7 @@ index c1_idx(c1))
engine=innodb row_format=compact
key_block_size=16;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1;
count(*)
0
......@@ -303,6 +297,9 @@ select count(*) from t3;
count(*)
5000
truncate table t1;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
select count(*) from t1;
count(*)
0
......@@ -323,7 +320,13 @@ select count(*) from t3;
count(*)
7000
truncate table t2;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
truncate table t3;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1;
count(*)
2000
......@@ -348,7 +351,4 @@ drop table t2;
drop table t3;
drop procedure populate;
drop procedure populate_small;
set global innodb_file_format = Barracuda;
Warnings:
Warning 131 Using innodb_file_format is deprecated and the parameter may be removed in future releases. See http://dev.mysql.com/doc/refman/5.7/en/innodb-file-format.html
set global innodb_file_per_table = 1;
This diff is collapsed.
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : BUG#<xxxx> <date disabled> <disabler> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################
wl6560 : Very long, timeout
......@@ -22,20 +22,16 @@
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16;
let $wl6501_file_format = 'Antelope';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
# Single-Tablespace/Compressed
let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 16;
let $wl6501_file_format = 'Barracuda';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
# System-Tablespace/Non-Compressed
let $wl6501_file_per_table = 0;
let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16;
let $wl6501_file_format = 'Antelope';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc
This diff is collapsed.
This diff is collapsed.
......@@ -7438,3 +7438,5 @@ ER_JSON_PATH_ARRAY
eng "JSON path should end with an array identifier in argument %d to function '%s'"
ER_JSON_ONE_OR_ALL
eng "Argument 2 to function '%s' must be "one" or "all"."
ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
eng "CREATE TEMPORARY TABLE is not allowed with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE."
......@@ -335,8 +335,7 @@ btr_root_adjust_on_import(
} else {
/* Check that the table flags and the tablespace
flags match. */
ulint flags = dict_tf_to_fsp_flags(
table->flags, false);
ulint flags = dict_tf_to_fsp_flags(table->flags);
ulint fsp_flags = fil_space_get_flags(table->space);
err = flags == fsp_flags
? DB_SUCCESS : DB_CORRUPTION;
......
......@@ -3048,12 +3048,12 @@ btr_cur_optimistic_insert(
if (*rec) {
} else if (page_size.is_compressed()) {
ut_ad(!dict_table_is_temporary(index->table));
/* Reset the IBUF_BITMAP_FREE bits, because
page_cur_tuple_insert() will have attempted page
reorganize before failing. */
if (leaf
&& !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)) {
&& !dict_index_is_clust(index)) {
ibuf_reset_free_bits(block);
}
......@@ -3649,6 +3649,8 @@ btr_cur_update_in_place(
/* Check that enough space is available on the compressed page. */
if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
if (!btr_cur_update_alloc_zip(
page_zip, btr_cur_get_page_cur(cursor),
index, offsets, rec_offs_size(offsets),
......@@ -3725,9 +3727,9 @@ btr_cur_update_in_place(
if (page_zip
&& !(flags & BTR_KEEP_IBUF_BITMAP)
&& !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(buf_block_get_frame(block))) {
/* Update the free bits in the insert buffer. */
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr);
}
......@@ -3876,6 +3878,8 @@ btr_cur_optimistic_update(
#endif /* UNIV_ZIP_DEBUG */
if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
if (page_zip_rec_needs_ext(new_rec_size, page_is_comp(page),
dict_index_get_n_fields(index),
dict_table_page_size(index->table))) {
......@@ -3994,12 +3998,12 @@ btr_cur_optimistic_update(
func_exit:
if (!(flags & BTR_KEEP_IBUF_BITMAP)
&& !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)) {
&& !dict_index_is_clust(index)) {
/* Update the free bits in the insert buffer. */
if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr);
} else {
} else if (!dict_table_is_temporary(index->table)) {
ibuf_update_free_bits_low(block, max_ins_size, mtr);
}
}
......@@ -4123,6 +4127,7 @@ btr_cur_pessimistic_update(
#ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */
ut_ad(!page_zip || !dict_table_is_temporary(index->table));
/* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index));
ut_ad(trx_id > 0
......@@ -4153,8 +4158,8 @@ btr_cur_pessimistic_update(
if (page_zip
&& optim_err != DB_ZIP_OVERFLOW
&& !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(page)) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr);
}
......@@ -4327,14 +4332,14 @@ btr_cur_pessimistic_update(
page_cursor->rec, index, *offsets);
}
} else if (!dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(page)) {
/* Update the free bits in the insert buffer.
This is the same block which was skipped by
BTR_KEEP_IBUF_BITMAP. */
if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr);
} else {
} else if (!dict_table_is_temporary(index->table)) {
ibuf_update_free_bits_low(block, max_ins_size,
mtr);
}
......
......@@ -404,6 +404,7 @@ dict_build_tablespace_for_table(
DICT_TF2_FTS_AUX_HEX_NAME););
if (needs_file_per_table) {
ut_ad(!dict_table_is_temporary(table));
/* This table will need a new tablespace. */
ut_ad(dict_table_get_format(table) <= UNIV_FORMAT_MAX);
......@@ -424,21 +425,10 @@ dict_build_tablespace_for_table(
table->space = static_cast<unsigned int>(space);
/* Determine the tablespace flags. */
bool is_temp = dict_table_is_temporary(table);
bool has_data_dir = DICT_TF_HAS_DATA_DIR(table->flags);
ulint fsp_flags = dict_tf_to_fsp_flags(table->flags,
is_temp);
/* Determine the full filepath */
if (is_temp) {
/* Temporary table filepath contains a full path
and a filename without the extension. */
ut_ad(table->dir_path_of_temp_table);
filepath = fil_make_filepath(
table->dir_path_of_temp_table,
NULL, IBD, false);
ulint fsp_flags = dict_tf_to_fsp_flags(table->flags);
} else if (has_data_dir) {
if (has_data_dir) {
ut_ad(table->data_dir_path);
filepath = fil_make_filepath(
table->data_dir_path,
......@@ -474,7 +464,6 @@ dict_build_tablespace_for_table(
mtr_start(&mtr);
mtr.set_named_space(table->space);
dict_disable_redo_if_temporary(table, &mtr);
bool ret = fsp_header_init(table->space,
FIL_IBD_FILE_INITIAL_SIZE,
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -550,7 +550,10 @@ Datafile::validate_first_page(lsn_t* flush_lsn,
free_first_page();
return(DB_ERROR);
} else if (!fsp_flags_is_valid(m_flags)
|| FSP_FLAGS_GET_TEMPORARY(m_flags)) {
/* Tablespace flags must be valid. */
error_txt = "Tablespace flags are invalid";
} else if (page_get_page_no(m_first_page) != 0) {
/* First page must be number 0 */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5588,7 +5588,6 @@ ha_innobase::prepare_inplace_alter_table(
altered_table,
ha_alter_info->create_info,
NULL,
NULL,
NULL);
info.set_tablespace_type(indexed_table->space != TRX_SYS_SPACE);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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