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(*) ...@@ -194,18 +194,22 @@ count(*)
drop procedure populate_t1; drop procedure populate_t1;
drop procedure populate_t1_small; drop procedure populate_t1_small;
drop procedure populate_t1_small2; drop procedure populate_t1_small2;
drop table t1; drop temporary table t1,t2;
drop table t2;
create temporary table t1 create temporary table t1
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 4; ) 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; set innodb_strict_mode=off;
create temporary table t2 create temporary table t2
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 8; ) engine = innodb key_block_size = 8;
set innodb_strict_mode=default; set innodb_strict_mode=on;
create procedure populate_t1() create procedure populate_t1()
begin begin
declare i int default 1; declare i int default 1;
...@@ -394,9 +398,7 @@ count(*) ...@@ -394,9 +398,7 @@ count(*)
drop procedure populate_t1; drop procedure populate_t1;
drop procedure populate_t1_small; drop procedure populate_t1_small;
drop procedure populate_t1_small2; drop procedure populate_t1_small2;
drop table t1; drop temporary table t1, t2;
drop table t2;
set global innodb_file_per_table = 0;
create temporary table t1 create temporary table t1
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
...@@ -593,6 +595,3 @@ count(*) ...@@ -593,6 +595,3 @@ count(*)
drop procedure populate_t1; drop procedure populate_t1;
drop procedure populate_t1_small; drop procedure populate_t1_small;
drop procedure populate_t1_small2; 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.inc
--source include/have_innodb_zip.inc
--source include/big_test.inc
#################################################################### ####################################################################
# TC to test temp-table DML optimization changes for correctness # # TC to test temp-table DML optimization changes for correctness #
...@@ -22,28 +20,29 @@ create temporary table t2 ...@@ -22,28 +20,29 @@ create temporary table t2
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb; ) engine = innodb;
--source suite/innodb_zip/include/innodb_dml_ops.inc --source suite/innodb/include/dml_ops.inc
drop table t1; drop temporary table t1,t2;
drop table t2;
# #
--disable_warnings --error ER_UNSUPPORT_COMPRESSED_TEMPORARY_TABLE
create temporary table t1 create temporary table t1
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 4; ) 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; set innodb_strict_mode=off;
--disable_warnings
create temporary table t2 create temporary table t2
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb key_block_size = 8; ) engine = innodb key_block_size = 8;
set innodb_strict_mode=default; set innodb_strict_mode=on;
--enable_warnings --enable_warnings
--source suite/innodb_zip/include/innodb_dml_ops.inc --source suite/innodb/include/dml_ops.inc
drop table t1; drop temporary table t1, t2;
drop table t2;
# #
let $file_per_table = `select @@innodb_file_per_table`;
set global innodb_file_per_table = 0;
create temporary table t1 create temporary table t1
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
...@@ -52,9 +51,4 @@ create temporary table t2 ...@@ -52,9 +51,4 @@ create temporary table t2
(keyc int, c1 char(100), c2 char(100), (keyc int, c1 char(100), c2 char(100),
primary key(keyc), index sec_index(c1) primary key(keyc), index sec_index(c1)
) engine = innodb; ) engine = innodb;
--source suite/innodb_zip/include/innodb_dml_ops.inc --source suite/innodb/include/dml_ops.inc
drop table t1;
drop table t2;
eval set global innodb_file_per_table = $file_per_table;
#
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; ...@@ -20,33 +20,27 @@ set i = i + 1;
end while; end while;
end| end|
set global innodb_file_per_table = 1; 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 create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), (i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER)) index cNUMBER_idx(cNUMBER))
engine=innodb row_format=compact engine=innodb row_format=compact
key_block_size=NUMBER; key_block_size=NUMBER;
Warnings: Warnings:
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
create table t2 create table t2
(i int, c1 char(100), c2 char(100), (i int, c1 char(100), c2 char(100),
index c1_idx(c1)) index c1_idx(c1))
engine=innodb row_format=compact engine=innodb row_format=compact
key_block_size=16; key_block_size=16;
Warnings: Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
create temporary table t3 create temporary table t3
(i int, c1 char(100), c2 char(100), (i int, c1 char(100), c2 char(100),
index c1_idx(c1)) index c1_idx(c1))
engine=innodb row_format=compact engine=innodb row_format=compact
key_block_size=16; key_block_size=16;
Warnings: Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope. Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
select count(*) from t1; select count(*) from t1;
count(*) count(*)
0 0
...@@ -69,6 +63,8 @@ select count(*) from t3; ...@@ -69,6 +63,8 @@ select count(*) from t3;
count(*) count(*)
5000 5000
truncate table t1; truncate table t1;
Warnings:
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16 unless ROW_FORMAT=COMPRESSED.
select count(*) from t1; select count(*) from t1;
count(*) count(*)
0 0
...@@ -89,7 +85,12 @@ select count(*) from t3; ...@@ -89,7 +85,12 @@ select count(*) from t3;
count(*) count(*)
7000 7000
truncate table t2; 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; truncate table t3;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1; select count(*) from t1;
count(*) count(*)
2000 2000
...@@ -114,9 +115,6 @@ drop table t2; ...@@ -114,9 +115,6 @@ drop table t2;
drop table t3; drop table t3;
drop procedure populate; drop procedure populate;
drop procedure populate_small; 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 global innodb_file_per_table = 1;
set innodb_strict_mode=OFF; set innodb_strict_mode=OFF;
create procedure populate() create procedure populate()
...@@ -140,9 +138,6 @@ set i = i + 1; ...@@ -140,9 +138,6 @@ set i = i + 1;
end while; end while;
end| end|
set global innodb_file_per_table = 1; 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 create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), (i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER)) index cNUMBER_idx(cNUMBER))
...@@ -158,6 +153,10 @@ create temporary table t3 ...@@ -158,6 +153,10 @@ create temporary table t3
index c1_idx(c1)) index c1_idx(c1))
engine=innodb row_format=compressed engine=innodb row_format=compressed
key_block_size=16; 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; select count(*) from t1;
count(*) count(*)
0 0
...@@ -200,7 +199,12 @@ select count(*) from t3; ...@@ -200,7 +199,12 @@ select count(*) from t3;
count(*) count(*)
7000 7000
truncate table t2; truncate table t2;
# WL#7811/WL#7743/WL#7141 TODO: Remove the warnings!
truncate table t3; 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; select count(*) from t1;
count(*) count(*)
2000 2000
...@@ -225,9 +229,6 @@ drop table t2; ...@@ -225,9 +229,6 @@ drop table t2;
drop table t3; drop table t3;
drop procedure populate; drop procedure populate;
drop procedure populate_small; 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 global innodb_file_per_table = 1;
set innodb_strict_mode=OFF; set innodb_strict_mode=OFF;
create procedure populate() create procedure populate()
...@@ -251,9 +252,6 @@ set i = i + 1; ...@@ -251,9 +252,6 @@ set i = i + 1;
end while; end while;
end| end|
set global innodb_file_per_table = 0; 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 create table tNUMBER
(i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER), (i int, cNUMBER char(NUMBER), cNUMBER char(NUMBER),
index cNUMBER_idx(cNUMBER)) index cNUMBER_idx(cNUMBER))
...@@ -261,7 +259,6 @@ engine=innodb row_format=compact ...@@ -261,7 +259,6 @@ engine=innodb row_format=compact
key_block_size=NUMBER; key_block_size=NUMBER;
Warnings: Warnings:
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. 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. Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
create table t2 create table t2
(i int, c1 char(100), c2 char(100), (i int, c1 char(100), c2 char(100),
...@@ -270,7 +267,6 @@ engine=innodb row_format=compact ...@@ -270,7 +267,6 @@ engine=innodb row_format=compact
key_block_size=16; key_block_size=16;
Warnings: Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. 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: ignoring KEY_BLOCK_SIZE=16.
create temporary table t3 create temporary table t3
(i int, c1 char(100), c2 char(100), (i int, c1 char(100), c2 char(100),
...@@ -278,9 +274,7 @@ index c1_idx(c1)) ...@@ -278,9 +274,7 @@ index c1_idx(c1))
engine=innodb row_format=compact engine=innodb row_format=compact
key_block_size=16; key_block_size=16;
Warnings: Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table. Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
Warning 1478 InnoDB: ignoring KEY_BLOCK_SIZE=16.
select count(*) from t1; select count(*) from t1;
count(*) count(*)
0 0
...@@ -303,6 +297,9 @@ select count(*) from t3; ...@@ -303,6 +297,9 @@ select count(*) from t3;
count(*) count(*)
5000 5000
truncate table t1; 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; select count(*) from t1;
count(*) count(*)
0 0
...@@ -323,7 +320,13 @@ select count(*) from t3; ...@@ -323,7 +320,13 @@ select count(*) from t3;
count(*) count(*)
7000 7000
truncate table t2; 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; truncate table t3;
Warnings:
Warning 1478 InnoDB: KEY_BLOCK_SIZE is ignored for TEMPORARY TABLE.
select count(*) from t1; select count(*) from t1;
count(*) count(*)
2000 2000
...@@ -348,7 +351,4 @@ drop table t2; ...@@ -348,7 +351,4 @@ drop table t2;
drop table t3; drop table t3;
drop procedure populate; drop procedure populate;
drop procedure populate_small; 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 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 @@ ...@@ -22,20 +22,16 @@
let $wl6501_file_per_table = 1; let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compact; let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16; let $wl6501_kbs = 16;
let $wl6501_file_format = 'Antelope';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc --source suite/innodb_zip/include/innodb_wl6501_scale.inc
# Single-Tablespace/Compressed # Single-Tablespace/Compressed
let $wl6501_file_per_table = 1; let $wl6501_file_per_table = 1;
let $wl6501_row_fmt = compressed; let $wl6501_row_fmt = compressed;
let $wl6501_kbs = 16; let $wl6501_kbs = 16;
let $wl6501_file_format = 'Barracuda';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc --source suite/innodb_zip/include/innodb_wl6501_scale.inc
# System-Tablespace/Non-Compressed # System-Tablespace/Non-Compressed
let $wl6501_file_per_table = 0; let $wl6501_file_per_table = 0;
let $wl6501_row_fmt = compact; let $wl6501_row_fmt = compact;
let $wl6501_kbs = 16; let $wl6501_kbs = 16;
let $wl6501_file_format = 'Antelope';
--source suite/innodb_zip/include/innodb_wl6501_scale.inc --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 ...@@ -7438,3 +7438,5 @@ ER_JSON_PATH_ARRAY
eng "JSON path should end with an array identifier in argument %d to function '%s'" eng "JSON path should end with an array identifier in argument %d to function '%s'"
ER_JSON_ONE_OR_ALL ER_JSON_ONE_OR_ALL
eng "Argument 2 to function '%s' must be "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( ...@@ -335,8 +335,7 @@ btr_root_adjust_on_import(
} else { } else {
/* Check that the table flags and the tablespace /* Check that the table flags and the tablespace
flags match. */ flags match. */
ulint flags = dict_tf_to_fsp_flags( ulint flags = dict_tf_to_fsp_flags(table->flags);
table->flags, false);
ulint fsp_flags = fil_space_get_flags(table->space); ulint fsp_flags = fil_space_get_flags(table->space);
err = flags == fsp_flags err = flags == fsp_flags
? DB_SUCCESS : DB_CORRUPTION; ? DB_SUCCESS : DB_CORRUPTION;
......
...@@ -3048,12 +3048,12 @@ btr_cur_optimistic_insert( ...@@ -3048,12 +3048,12 @@ btr_cur_optimistic_insert(
if (*rec) { if (*rec) {
} else if (page_size.is_compressed()) { } else if (page_size.is_compressed()) {
ut_ad(!dict_table_is_temporary(index->table));
/* Reset the IBUF_BITMAP_FREE bits, because /* Reset the IBUF_BITMAP_FREE bits, because
page_cur_tuple_insert() will have attempted page page_cur_tuple_insert() will have attempted page
reorganize before failing. */ reorganize before failing. */
if (leaf if (leaf
&& !dict_index_is_clust(index) && !dict_index_is_clust(index)) {
&& !dict_table_is_temporary(index->table)) {
ibuf_reset_free_bits(block); ibuf_reset_free_bits(block);
} }
...@@ -3649,6 +3649,8 @@ btr_cur_update_in_place( ...@@ -3649,6 +3649,8 @@ btr_cur_update_in_place(
/* Check that enough space is available on the compressed page. */ /* Check that enough space is available on the compressed page. */
if (page_zip) { if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
if (!btr_cur_update_alloc_zip( if (!btr_cur_update_alloc_zip(
page_zip, btr_cur_get_page_cur(cursor), page_zip, btr_cur_get_page_cur(cursor),
index, offsets, rec_offs_size(offsets), index, offsets, rec_offs_size(offsets),
...@@ -3725,9 +3727,9 @@ btr_cur_update_in_place( ...@@ -3725,9 +3727,9 @@ btr_cur_update_in_place(
if (page_zip if (page_zip
&& !(flags & BTR_KEEP_IBUF_BITMAP) && !(flags & BTR_KEEP_IBUF_BITMAP)
&& !dict_index_is_clust(index) && !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(buf_block_get_frame(block))) { && page_is_leaf(buf_block_get_frame(block))) {
/* Update the free bits in the insert buffer. */ /* Update the free bits in the insert buffer. */
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr); ibuf_update_free_bits_zip(block, mtr);
} }
...@@ -3876,6 +3878,8 @@ btr_cur_optimistic_update( ...@@ -3876,6 +3878,8 @@ btr_cur_optimistic_update(
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
if (page_zip) { if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
if (page_zip_rec_needs_ext(new_rec_size, page_is_comp(page), if (page_zip_rec_needs_ext(new_rec_size, page_is_comp(page),
dict_index_get_n_fields(index), dict_index_get_n_fields(index),
dict_table_page_size(index->table))) { dict_table_page_size(index->table))) {
...@@ -3994,12 +3998,12 @@ btr_cur_optimistic_update( ...@@ -3994,12 +3998,12 @@ btr_cur_optimistic_update(
func_exit: func_exit:
if (!(flags & BTR_KEEP_IBUF_BITMAP) if (!(flags & BTR_KEEP_IBUF_BITMAP)
&& !dict_index_is_clust(index) && !dict_index_is_clust(index)) {
&& !dict_table_is_temporary(index->table)) {
/* Update the free bits in the insert buffer. */ /* Update the free bits in the insert buffer. */
if (page_zip) { if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr); 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); ibuf_update_free_bits_low(block, max_ins_size, mtr);
} }
} }
...@@ -4123,6 +4127,7 @@ btr_cur_pessimistic_update( ...@@ -4123,6 +4127,7 @@ btr_cur_pessimistic_update(
#ifdef UNIV_ZIP_DEBUG #ifdef UNIV_ZIP_DEBUG
ut_a(!page_zip || page_zip_validate(page_zip, page, index)); ut_a(!page_zip || page_zip_validate(page_zip, page, index));
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
ut_ad(!page_zip || !dict_table_is_temporary(index->table));
/* The insert buffer tree should never be updated in place. */ /* The insert buffer tree should never be updated in place. */
ut_ad(!dict_index_is_ibuf(index)); ut_ad(!dict_index_is_ibuf(index));
ut_ad(trx_id > 0 ut_ad(trx_id > 0
...@@ -4153,8 +4158,8 @@ btr_cur_pessimistic_update( ...@@ -4153,8 +4158,8 @@ btr_cur_pessimistic_update(
if (page_zip if (page_zip
&& optim_err != DB_ZIP_OVERFLOW && optim_err != DB_ZIP_OVERFLOW
&& !dict_index_is_clust(index) && !dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(page)) { && page_is_leaf(page)) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr); ibuf_update_free_bits_zip(block, mtr);
} }
...@@ -4327,14 +4332,14 @@ btr_cur_pessimistic_update( ...@@ -4327,14 +4332,14 @@ btr_cur_pessimistic_update(
page_cursor->rec, index, *offsets); page_cursor->rec, index, *offsets);
} }
} else if (!dict_index_is_clust(index) } else if (!dict_index_is_clust(index)
&& !dict_table_is_temporary(index->table)
&& page_is_leaf(page)) { && page_is_leaf(page)) {
/* Update the free bits in the insert buffer. /* Update the free bits in the insert buffer.
This is the same block which was skipped by This is the same block which was skipped by
BTR_KEEP_IBUF_BITMAP. */ BTR_KEEP_IBUF_BITMAP. */
if (page_zip) { if (page_zip) {
ut_ad(!dict_table_is_temporary(index->table));
ibuf_update_free_bits_zip(block, mtr); 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, ibuf_update_free_bits_low(block, max_ins_size,
mtr); mtr);
} }
......
...@@ -404,6 +404,7 @@ dict_build_tablespace_for_table( ...@@ -404,6 +404,7 @@ dict_build_tablespace_for_table(
DICT_TF2_FTS_AUX_HEX_NAME);); DICT_TF2_FTS_AUX_HEX_NAME););
if (needs_file_per_table) { if (needs_file_per_table) {
ut_ad(!dict_table_is_temporary(table));
/* This table will need a new tablespace. */ /* This table will need a new tablespace. */
ut_ad(dict_table_get_format(table) <= UNIV_FORMAT_MAX); ut_ad(dict_table_get_format(table) <= UNIV_FORMAT_MAX);
...@@ -424,21 +425,10 @@ dict_build_tablespace_for_table( ...@@ -424,21 +425,10 @@ dict_build_tablespace_for_table(
table->space = static_cast<unsigned int>(space); table->space = static_cast<unsigned int>(space);
/* Determine the tablespace flags. */ /* Determine the tablespace flags. */
bool is_temp = dict_table_is_temporary(table);
bool has_data_dir = DICT_TF_HAS_DATA_DIR(table->flags); bool has_data_dir = DICT_TF_HAS_DATA_DIR(table->flags);
ulint fsp_flags = dict_tf_to_fsp_flags(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);
} else if (has_data_dir) { if (has_data_dir) {
ut_ad(table->data_dir_path); ut_ad(table->data_dir_path);
filepath = fil_make_filepath( filepath = fil_make_filepath(
table->data_dir_path, table->data_dir_path,
...@@ -474,7 +464,6 @@ dict_build_tablespace_for_table( ...@@ -474,7 +464,6 @@ dict_build_tablespace_for_table(
mtr_start(&mtr); mtr_start(&mtr);
mtr.set_named_space(table->space); mtr.set_named_space(table->space);
dict_disable_redo_if_temporary(table, &mtr);
bool ret = fsp_header_init(table->space, bool ret = fsp_header_init(table->space,
FIL_IBD_FILE_INITIAL_SIZE, FIL_IBD_FILE_INITIAL_SIZE,
......
...@@ -1696,25 +1696,17 @@ dict_table_rename_in_cache( ...@@ -1696,25 +1696,17 @@ dict_table_rename_in_cache(
ib::info() << "Delete of " << filepath << " failed."; ib::info() << "Delete of " << filepath << " failed.";
} }
ut_free(filepath); ut_free(filepath);
} else if (dict_table_is_file_per_table(table)) { } else if (dict_table_is_file_per_table(table)) {
if (table->dir_path_of_temp_table != NULL) {
ib::error() << "Trying to rename a TEMPORARY TABLE "
<< old_name
<< " ( " << table->dir_path_of_temp_table
<< " )";
return(DB_ERROR);
}
char* new_path = NULL; char* new_path = NULL;
char* old_path = fil_space_get_first_path(table->space); char* old_path = fil_space_get_first_path(table->space);
ut_ad(!dict_table_is_temporary(table));
if (DICT_TF_HAS_DATA_DIR(table->flags)) { if (DICT_TF_HAS_DATA_DIR(table->flags)) {
new_path = os_file_make_new_pathname( new_path = os_file_make_new_pathname(
old_path, new_name); old_path, new_name);
err = RemoteDatafile::create_link_file( err = RemoteDatafile::create_link_file(
new_name, new_path); new_name, new_path);
...@@ -7254,12 +7246,9 @@ Other bits are the same. ...@@ -7254,12 +7246,9 @@ Other bits are the same.
dict_table_t::flags | 0 | 1 | 1 | 1 dict_table_t::flags | 0 | 1 | 1 | 1
fil_space_t::flags | 0 | 0 | 1 | 1 fil_space_t::flags | 0 | 0 | 1 | 1
@param[in] table_flags dict_table_t::flags @param[in] table_flags dict_table_t::flags
@param[in] is_temp whether the tablespace is temporary
@return tablespace flags (fil_space_t::flags) */ @return tablespace flags (fil_space_t::flags) */
ulint ulint
dict_tf_to_fsp_flags( dict_tf_to_fsp_flags(ulint table_flags)
ulint table_flags,
bool is_temp)
{ {
DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure", DBUG_EXECUTE_IF("dict_tf_to_fsp_flags_failure",
return(ULINT_UNDEFINED);); return(ULINT_UNDEFINED););
...@@ -7276,7 +7265,6 @@ dict_tf_to_fsp_flags( ...@@ -7276,7 +7265,6 @@ dict_tf_to_fsp_flags(
ulint fsp_flags = fsp_flags_init(page_size, ulint fsp_flags = fsp_flags_init(page_size,
has_atomic_blobs, has_atomic_blobs,
has_data_dir, has_data_dir,
is_temp,
0, 0,
0, 0,
0); 0);
......
...@@ -1239,8 +1239,7 @@ dict_check_sys_tables( ...@@ -1239,8 +1239,7 @@ dict_check_sys_tables(
char* filepath = dict_get_first_path(space_id); char* filepath = dict_get_first_path(space_id);
/* Check that the .ibd file exists. */ /* Check that the .ibd file exists. */
bool is_temp = flags2 & DICT_TF2_TEMPORARY; ulint fsp_flags = dict_tf_to_fsp_flags(flags);
ulint fsp_flags = dict_tf_to_fsp_flags(flags, is_temp);
validate = true; /* Encryption */ validate = true; /* Encryption */
dberr_t err = fil_ibd_open( dberr_t err = fil_ibd_open(
...@@ -2513,9 +2512,9 @@ dict_get_and_save_data_dir_path( ...@@ -2513,9 +2512,9 @@ dict_get_and_save_data_dir_path(
dict_table_t* table, dict_table_t* table,
bool dict_mutex_own) bool dict_mutex_own)
{ {
bool is_temp = DICT_TF2_FLAG_IS_SET(table, DICT_TF2_TEMPORARY); ut_ad(!dict_table_is_temporary(table));
if (!is_temp && !table->data_dir_path && table->space) { if (!table->data_dir_path && table->space) {
char* path = fil_space_get_first_path(table->space); char* path = fil_space_get_first_path(table->space);
if (!dict_mutex_own) { if (!dict_mutex_own) {
...@@ -2610,6 +2609,8 @@ dict_load_tablespace( ...@@ -2610,6 +2609,8 @@ dict_load_tablespace(
mem_heap_t* heap, mem_heap_t* heap,
dict_err_ignore_t ignore_err) dict_err_ignore_t ignore_err)
{ {
ut_ad(!dict_table_is_temporary(table));
/* The system tablespace is always available. */ /* The system tablespace is always available. */
if (is_system_tablespace(table->space)) { if (is_system_tablespace(table->space)) {
return; return;
...@@ -2622,12 +2623,6 @@ dict_load_tablespace( ...@@ -2622,12 +2623,6 @@ dict_load_tablespace(
return; return;
} }
if (dict_table_is_temporary(table)) {
/* Do not bother to retry opening temporary tables. */
table->ibd_file_missing = TRUE;
return;
}
char* space_name = table->name.m_name; char* space_name = table->name.m_name;
/* The tablespace may already be open. */ /* The tablespace may already be open. */
...@@ -2662,7 +2657,7 @@ dict_load_tablespace( ...@@ -2662,7 +2657,7 @@ dict_load_tablespace(
/* Try to open the tablespace. We set the 2nd param (fix_dict) to /* Try to open the tablespace. We set the 2nd param (fix_dict) to
false because we do not have an x-lock on dict_operation_lock */ false because we do not have an x-lock on dict_operation_lock */
ulint fsp_flags = dict_tf_to_fsp_flags(table->flags, false); ulint fsp_flags = dict_tf_to_fsp_flags(table->flags);
dberr_t err = fil_ibd_open( dberr_t err = fil_ibd_open(
true, false, FIL_TYPE_TABLESPACE, table->space, true, false, FIL_TYPE_TABLESPACE, table->space,
fsp_flags, space_name, filepath, table); fsp_flags, space_name, filepath, table);
......
This diff is collapsed.
...@@ -550,7 +550,10 @@ Datafile::validate_first_page(lsn_t* flush_lsn, ...@@ -550,7 +550,10 @@ Datafile::validate_first_page(lsn_t* flush_lsn,
free_first_page(); free_first_page();
return(DB_ERROR); 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) { } else if (page_get_page_no(m_first_page) != 0) {
/* First page must be number 0 */ /* First page must be number 0 */
......
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.
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