mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge InnoDB 5.7 from mysql-5.7.14.
Contains also: MDEV-10549 mysqld: sql/handler.cc:2692: int handler::ha_index_first(uchar*): Assertion `table_share->tmp_table != NO_TMP_TABLE || m_lock_type != 2' failed. (branch bb-10.2-jan) Unlike MySQL, InnoDB still uses THR_LOCK in MariaDB MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) enable tests that were fixed in MDEV-10549 MDEV-10548 Some of the debug sync waits do not work with InnoDB 5.7 (branch bb-10.2-jan) fix main.innodb_mysql_sync - re-enable online alter for partitioned innodb tables
This commit is contained in:
@ -8,7 +8,7 @@ variable_value
|
||||
SELECT variable_value FROM information_schema.global_status
|
||||
WHERE LOWER(variable_name) = 'innodb_buffer_pool_pages_total';
|
||||
variable_value
|
||||
{checked_valid}
|
||||
512
|
||||
# Test 3) Query some information_shema tables that are dependent upon
|
||||
# the page size.
|
||||
SELECT t.name table_name, t.n_cols, t.flag table_flags,
|
||||
@ -20,28 +20,8 @@ WHERE t.table_id = i.table_id
|
||||
AND t.name LIKE 'mysql%'
|
||||
ORDER BY t.name, i.index_id;
|
||||
table_name n_cols table_flags index_name root_page type n_fields merge_threshold
|
||||
mysql/engine_cost 9 33 PRIMARY 3 3 3 50
|
||||
mysql/gtid_executed 6 33 PRIMARY 3 3 2 50
|
||||
mysql/help_category 7 33 PRIMARY 3 3 1 50
|
||||
mysql/help_category 7 33 name 4 2 1 50
|
||||
mysql/help_keyword 5 33 PRIMARY 3 3 1 50
|
||||
mysql/help_keyword 5 33 name 4 2 1 50
|
||||
mysql/help_relation 5 33 PRIMARY 3 3 2 50
|
||||
mysql/help_topic 9 33 PRIMARY 3 3 1 50
|
||||
mysql/help_topic 9 33 name 4 2 1 50
|
||||
mysql/innodb_index_stats 11 33 PRIMARY 3 3 4 50
|
||||
mysql/innodb_table_stats 9 33 PRIMARY 3 3 2 50
|
||||
mysql/plugin 5 33 PRIMARY 3 3 1 50
|
||||
mysql/servers 12 33 PRIMARY 3 3 1 50
|
||||
mysql/server_cost 7 33 PRIMARY 3 3 1 50
|
||||
mysql/slave_master_info 28 33 PRIMARY 3 3 1 50
|
||||
mysql/slave_relay_log_info 12 33 PRIMARY 3 3 1 50
|
||||
mysql/slave_worker_info 16 33 PRIMARY 3 3 2 50
|
||||
mysql/time_zone 5 33 PRIMARY 3 3 1 50
|
||||
mysql/time_zone_leap_second 5 33 PRIMARY 3 3 1 50
|
||||
mysql/time_zone_name 5 33 PRIMARY 3 3 1 50
|
||||
mysql/time_zone_transition 6 33 PRIMARY 3 3 2 50
|
||||
mysql/time_zone_transition_type 8 33 PRIMARY 3 3 2 50
|
||||
CREATE TABLE t1 (a INT KEY, b TEXT) ROW_FORMAT=REDUNDANT ENGINE=innodb;
|
||||
CREATE TABLE t2 (a INT KEY, b TEXT) ROW_FORMAT=COMPACT ENGINE=innodb;
|
||||
CREATE TABLE t3 (a INT KEY, b TEXT) ROW_FORMAT=COMPRESSED ENGINE=innodb;
|
||||
@ -209,35 +189,35 @@ Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=16
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=8
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=4
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=4
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=2
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=1
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
@ -253,35 +233,35 @@ Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=16
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=16
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=8;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=8
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=8
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=4;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=4
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=4
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=2;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=2
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=2
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=1;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
SELECT table_name, row_format, create_options
|
||||
FROM information_schema.tables WHERE table_name = 't1';
|
||||
table_name row_format create_options
|
||||
t1 Compressed row_format=COMPRESSED KEY_BLOCK_SIZE=1
|
||||
t1 Compressed row_format=COMPRESSED key_block_size=1
|
||||
ALTER TABLE t1 KEY_BLOCK_SIZE=0;
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
@ -298,33 +278,37 @@ SHOW VARIABLES LIKE 'innodb_file_per_table';
|
||||
Variable_name Value
|
||||
innodb_file_per_table OFF
|
||||
CREATE TABLE t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
ERROR HY000: Table storage engine for 't4' doesn't have this option
|
||||
Got one of the listed errors
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1031 Table storage engine for 't4' doesn't have this option
|
||||
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
|
||||
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
ERROR HY000: Table storage engine for 't5' doesn't have this option
|
||||
Got one of the listed errors
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_per_table.
|
||||
Error 1031 Table storage engine for 't5' doesn't have this option
|
||||
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
|
||||
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
||||
SET GLOBAL innodb_file_per_table = ON;
|
||||
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 t4 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=8;
|
||||
ERROR HY000: Table storage engine for 't4' doesn't have this option
|
||||
Got one of the listed errors
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1031 Table storage engine for 't4' doesn't have this option
|
||||
Error 1005 Can't create table `test`.`t4` (errno: 140 "Wrong create options")
|
||||
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
||||
CREATE TABLE t5 (id int PRIMARY KEY) ENGINE=innodb KEY_BLOCK_SIZE=16;
|
||||
ERROR HY000: Table storage engine for 't5' doesn't have this option
|
||||
Got one of the listed errors
|
||||
SHOW WARNINGS;
|
||||
Level Code Message
|
||||
Warning 1478 InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Error 1031 Table storage engine for 't5' doesn't have this option
|
||||
Error 1005 Can't create table `test`.`t5` (errno: 140 "Wrong create options")
|
||||
Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
|
||||
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
|
||||
@ -420,10 +404,8 @@ CHECK TABLE t1;
|
||||
Table Op Msg_type Msg_text
|
||||
test.t1 check status OK
|
||||
EXPLAIN SELECT * FROM t1 WHERE b LIKE 'adfd%';
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL range b b 769 NULL 12 100.00 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t1`.`c` AS `c`,`test`.`t1`.`d` AS `d` from `test`.`t1` where (`test`.`t1`.`b` like 'adfd%')
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 ALL b NULL NULL NULL 15 Using where
|
||||
DROP TABLE t1;
|
||||
# Test 8) Test creating a table that could lead to undo log overflow.
|
||||
CREATE TABLE t1(a blob,b blob,c blob,d blob,e blob,f blob,g blob,
|
||||
@ -489,27 +471,27 @@ CREATE INDEX t1st ON t1 (s(767), t(767));
|
||||
SHOW CREATE TABLE t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` blob,
|
||||
`b` blob,
|
||||
`c` blob,
|
||||
`d` blob,
|
||||
`e` blob,
|
||||
`f` blob,
|
||||
`g` blob,
|
||||
`h` blob,
|
||||
`i` blob,
|
||||
`j` blob,
|
||||
`k` blob,
|
||||
`l` blob,
|
||||
`m` blob,
|
||||
`n` blob,
|
||||
`o` blob,
|
||||
`p` blob,
|
||||
`q` blob,
|
||||
`r` blob,
|
||||
`s` blob,
|
||||
`t` blob,
|
||||
`u` blob,
|
||||
`a` blob DEFAULT NULL,
|
||||
`b` blob DEFAULT NULL,
|
||||
`c` blob DEFAULT NULL,
|
||||
`d` blob DEFAULT NULL,
|
||||
`e` blob DEFAULT NULL,
|
||||
`f` blob DEFAULT NULL,
|
||||
`g` blob DEFAULT NULL,
|
||||
`h` blob DEFAULT NULL,
|
||||
`i` blob DEFAULT NULL,
|
||||
`j` blob DEFAULT NULL,
|
||||
`k` blob DEFAULT NULL,
|
||||
`l` blob DEFAULT NULL,
|
||||
`m` blob DEFAULT NULL,
|
||||
`n` blob DEFAULT NULL,
|
||||
`o` blob DEFAULT NULL,
|
||||
`p` blob DEFAULT NULL,
|
||||
`q` blob DEFAULT NULL,
|
||||
`r` blob DEFAULT NULL,
|
||||
`s` blob DEFAULT NULL,
|
||||
`t` blob DEFAULT NULL,
|
||||
`u` blob DEFAULT NULL,
|
||||
KEY `t1a` (`a`(767)),
|
||||
KEY `t1b` (`b`(767)),
|
||||
KEY `t1c` (`c`(767)),
|
||||
@ -620,22 +602,22 @@ CREATE INDEX ndx_p ON t12963823 (p(500));
|
||||
SHOW CREATE TABLE t12963823;
|
||||
Table Create Table
|
||||
t12963823 CREATE TABLE `t12963823` (
|
||||
`a` blob,
|
||||
`b` blob,
|
||||
`c` blob,
|
||||
`d` blob,
|
||||
`e` blob,
|
||||
`f` blob,
|
||||
`g` blob,
|
||||
`h` blob,
|
||||
`i` blob,
|
||||
`j` blob,
|
||||
`k` blob,
|
||||
`l` blob,
|
||||
`m` blob,
|
||||
`n` blob,
|
||||
`o` blob,
|
||||
`p` blob,
|
||||
`a` blob DEFAULT NULL,
|
||||
`b` blob DEFAULT NULL,
|
||||
`c` blob DEFAULT NULL,
|
||||
`d` blob DEFAULT NULL,
|
||||
`e` blob DEFAULT NULL,
|
||||
`f` blob DEFAULT NULL,
|
||||
`g` blob DEFAULT NULL,
|
||||
`h` blob DEFAULT NULL,
|
||||
`i` blob DEFAULT NULL,
|
||||
`j` blob DEFAULT NULL,
|
||||
`k` blob DEFAULT NULL,
|
||||
`l` blob DEFAULT NULL,
|
||||
`m` blob DEFAULT NULL,
|
||||
`n` blob DEFAULT NULL,
|
||||
`o` blob DEFAULT NULL,
|
||||
`p` blob DEFAULT NULL,
|
||||
KEY `ndx_c` (`c`(500)),
|
||||
KEY `ndx_d` (`d`(500)),
|
||||
KEY `ndx_e` (`e`(500)),
|
||||
@ -727,11 +709,9 @@ EXPLAIN
|
||||
SELECT COUNT(*) FROM
|
||||
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
|
||||
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 PRIMARY <derived2> NULL ALL NULL NULL NULL NULL 1537 100.00 NULL
|
||||
2 DERIVED t1 NULL index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 1537 100.00 Using sort_union(idx,PRIMARY); Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select count(0) AS `COUNT(*)` from (/* select#2 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` FORCE INDEX (PRIMARY) FORCE INDEX (`idx`) where ((`test`.`t1`.`a` between 2 and 7) or (`test`.`t1`.`pk` = 1000000))) `t`
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 1537
|
||||
2 DERIVED t1 index_merge PRIMARY,idx idx,PRIMARY 5,4 NULL 1537 Using sort_union(idx,PRIMARY); Using where
|
||||
SELECT COUNT(*) FROM
|
||||
(SELECT * FROM t1 FORCE INDEX (idx,PRIMARY)
|
||||
WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
|
||||
|
@ -320,7 +320,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 5242880
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
@ -666,7 +665,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 2097152
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
@ -1964,7 +1962,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 65536
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
@ -2312,7 +2309,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 65536
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
@ -5113,7 +5109,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 65536
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
@ -6734,7 +6729,6 @@ AND table_name='tab5' AND database_name='test'
|
||||
AND index_name like 'idx%' ;
|
||||
compress_stat 1
|
||||
The size of the tab5.ibd file: 65536
|
||||
# restart
|
||||
# set the flag on (default off)
|
||||
SET GLOBAL innodb_cmp_per_index_enabled=ON;
|
||||
# set the flags
|
||||
|
@ -1,418 +0,0 @@
|
||||
set global innodb_file_per_table = off;
|
||||
# files in MYSQL_DATA_DIR
|
||||
ibtmp1
|
||||
select @@global.innodb_file_per_table;
|
||||
@@global.innodb_file_per_table
|
||||
0
|
||||
create temporary table t1 (i int, f float, c char(100)) engine=innodb;
|
||||
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;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
select * from t1 where i = 98;
|
||||
i f c
|
||||
98 1.3 jaipur
|
||||
select * from t1 where i < 100;
|
||||
i f c
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
explain select * from t1 where f > 1.29999;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 33.33 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`f` > 1.29999)
|
||||
alter table t1 add index sec_index(f);
|
||||
explain select * from t1 where f > 1.29999;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL sec_index NULL NULL NULL 5 60.00 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`f` > 1.29999)
|
||||
select * from t1 where f > 1.29999;
|
||||
i f c
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
explain select * from t1 where i = 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`i` = 100)
|
||||
alter table t1 add unique index pri_index(i);
|
||||
explain select * from t1 where i = 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL const pri_index pri_index 5 const 1 100.00 NULL
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select '100' AS `i`,'1.1' AS `f`,'pune' AS `c` from `test`.`t1` where 1
|
||||
select * from t1 where i = 100;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
delete from t1 where i < 97;
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
insert into t1 values (96, 1.5, 'kolkata');
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 kolkata
|
||||
update t1 set f = 1.44 where c = 'delhi';
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.44 delhi
|
||||
96 1.5 kolkata
|
||||
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;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
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;
|
||||
#files in MYSQL_TMP_DIR
|
||||
set global innodb_file_per_table = 1;
|
||||
select @@global.innodb_file_per_table;
|
||||
@@global.innodb_file_per_table
|
||||
1
|
||||
create temporary table t1
|
||||
(i int, f float, c char(100)) engine = innodb key_block_size = 4;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TEMPORARY TABLE `t1` (
|
||||
`i` int(11) DEFAULT NULL,
|
||||
`f` float DEFAULT NULL,
|
||||
`c` char(100) DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1 KEY_BLOCK_SIZE=4
|
||||
#files in MYSQL_TMP_DIR
|
||||
#sql<temporary>.ibd
|
||||
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;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
select * from t1 where i = 98;
|
||||
i f c
|
||||
98 1.3 jaipur
|
||||
select * from t1 where i < 100;
|
||||
i f c
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
explain select * from t1 where f > 1.29999;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 33.33 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`f` > 1.29999)
|
||||
alter table t1 add index sec_index(f);
|
||||
explain select * from t1 where f > 1.29999;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL sec_index NULL NULL NULL 5 60.00 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`f` > 1.29999)
|
||||
select * from t1 where f > 1.29999;
|
||||
i f c
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
explain select * from t1 where i = 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL ALL NULL NULL NULL NULL 5 20.00 Using where
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select `test`.`t1`.`i` AS `i`,`test`.`t1`.`f` AS `f`,`test`.`t1`.`c` AS `c` from `test`.`t1` where (`test`.`t1`.`i` = 100)
|
||||
alter table t1 add unique index pri_index(i);
|
||||
explain select * from t1 where i = 100;
|
||||
id select_type table partitions type possible_keys key key_len ref rows filtered Extra
|
||||
1 SIMPLE t1 NULL const pri_index pri_index 5 const 1 100.00 NULL
|
||||
Warnings:
|
||||
Note 1003 /* select#1 */ select '100' AS `i`,'1.1' AS `f`,'pune' AS `c` from `test`.`t1` where 1
|
||||
select * from t1 where i = 100;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
delete from t1 where i < 97;
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
insert into t1 values (96, 1.5, 'kolkata');
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 kolkata
|
||||
update t1 set f = 1.44 where c = 'delhi';
|
||||
select * from t1;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.44 delhi
|
||||
96 1.5 kolkata
|
||||
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;
|
||||
i f c
|
||||
100 1.1 pune
|
||||
99 1.2 mumbai
|
||||
98 1.3 jaipur
|
||||
97 1.4 delhi
|
||||
96 1.5 ahmedabad
|
||||
alter table t1 discard tablespace;
|
||||
ERROR HY000: Cannot DISCARD/IMPORT tablespace associated with temporary table
|
||||
drop table t1;
|
||||
set global innodb_file_per_table = off;
|
||||
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 <= 20000) 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(*)
|
||||
20000
|
||||
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 procedure populate_t1;
|
||||
drop table t1;
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
insert into t1 values (1, 'c', 'b');
|
||||
select * from t1;
|
||||
keyc c1 c2
|
||||
1 c b
|
||||
# restart
|
||||
# files in MYSQL_DATA_DIR
|
||||
ibtmp1
|
||||
use test;
|
||||
select * from t1;
|
||||
ERROR 42S02: Table 'test.t1' doesn't exist
|
||||
"testing temp-table creation in --innodb_read_only mode"
|
||||
# restart: --innodb-read-only
|
||||
use test;
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
ERROR HY000: InnoDB is in read only mode.
|
||||
"testing system and temp tablespace name conflict"
|
||||
"restarting server in normal mode"
|
||||
# restart
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create temporary table t1 (keyc int, c1 char(100), c2 char(100)) engine = innodb;
|
||||
drop table t1;
|
||||
# test condition of full-temp-tablespace
|
||||
# restart: --innodb_temp_data_file_path=ibtmp1:12M
|
||||
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 <= 20000) 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();
|
||||
ERROR HY000: The table 't1' is full
|
||||
drop procedure populate_t1;
|
||||
drop table t1;
|
||||
set innodb_strict_mode = off;
|
||||
set global innodb_file_per_table = 0;
|
||||
set global innodb_file_format = 'Antelope';
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning NUMBER InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
|
||||
Warning NUMBER InnoDB: assuming ROW_FORMAT=DYNAMIC.
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
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: ROW_FORMAT=COMPRESSED requires innodb_file_per_table.
|
||||
Warning NUMBER InnoDB: assuming ROW_FORMAT=DYNAMIC.
|
||||
drop table t;
|
||||
set global innodb_file_per_table = 1;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning NUMBER InnoDB: KEY_BLOCK_SIZE requires innodb_file_format > Antelope.
|
||||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER.
|
||||
Warning NUMBER InnoDB: ROW_FORMAT=COMPRESSED requires innodb_file_format > Antelope.
|
||||
Warning NUMBER InnoDB: assuming ROW_FORMAT=DYNAMIC.
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
#files in MYSQL_TMP_DIR
|
||||
drop table t;
|
||||
set innodb_strict_mode = on;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
drop table t;
|
||||
set global innodb_file_format = 'Barracuda';
|
||||
set innodb_strict_mode = off;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed key_block_size = 8;
|
||||
set innodb_strict_mode = default;
|
||||
#files in MYSQL_TMP_DIR
|
||||
#sql<temporary>.ibd
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compressed;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
#files in MYSQL_TMP_DIR
|
||||
#sql<temporary>.ibd
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
#files in MYSQL_TMP_DIR
|
||||
drop table t;
|
||||
set innodb_strict_mode = on;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
drop table t;
|
||||
set innodb_strict_mode = off;
|
||||
#files in MYSQL_TMP_DIR
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = dynamic key_block_size = 4;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
Warning NUMBER InnoDB: ignoring KEY_BLOCK_SIZE=NUMBER unless ROW_FORMAT=COMPRESSED.
|
||||
#files in MYSQL_TMP_DIR
|
||||
#sql<temporary>.ibd
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb row_format = compact;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
#files in MYSQL_TMP_DIR
|
||||
drop table t;
|
||||
create temporary table t (
|
||||
i int)
|
||||
engine = innodb key_block_size = 4;
|
||||
show warnings;
|
||||
Level Code Message
|
||||
#files in MYSQL_TMP_DIR
|
||||
#sql<temporary>.ibd
|
||||
drop table t;
|
||||
"testing temp tablespace non-support for raw device"
|
||||
"testing temp tablespace non-support for raw device"
|
||||
# restart
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
||||
"try starting server with temp-tablespace size < min. threshold"
|
||||
"try starting server with sys-tablespace size < min. threshold"
|
||||
# restart
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
||||
"try starting server with no file specified for temp-tablespace"
|
||||
# restart
|
||||
show tables;
|
||||
Tables_in_test
|
||||
create temporary table t1 (
|
||||
keyc int, c1 char(100), c2 char(100)
|
||||
) engine = innodb;
|
||||
drop table t1;
|
@ -270,9 +270,14 @@ rollback;
|
||||
set n = n - 1;
|
||||
end while;
|
||||
end|
|
||||
connect con1,localhost,root,,;
|
||||
connect con2,localhost,root,,;
|
||||
#---client 1 : dml operation ---"
|
||||
connection con1;
|
||||
#---client 2 : dml operation ---"
|
||||
connection con2;
|
||||
# In connection 1
|
||||
connection con1;
|
||||
SELECT count(*) FROM t1_1;
|
||||
count(*)
|
||||
36
|
||||
@ -550,6 +555,7 @@ c1
|
||||
138
|
||||
140
|
||||
# In connection 2
|
||||
connection con2;
|
||||
SELECT count(*) FROM t1_2;
|
||||
count(*)
|
||||
36
|
||||
@ -827,6 +833,7 @@ c1
|
||||
138
|
||||
140
|
||||
# In connection 1
|
||||
connection con1;
|
||||
set AUTOCOMMIT = 0;
|
||||
ALTER TABLE t1_temp DROP PRIMARY KEY;
|
||||
ALTER TABLE t1_temp ADD PRIMARY KEY (c1);
|
||||
@ -898,17 +905,9 @@ SELECT c1,c2,c3,c4,c5,c6,c7,c9 FROM t4_temp WHERE c1 = 20;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9
|
||||
20 1 a a a a a 100.550
|
||||
update ignore t1_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
update ignore t2_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
update ignore t3_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
update ignore t4_temp set c1 = 20 WHERE c1 = 140 ;
|
||||
Warnings:
|
||||
Warning 1062 Duplicate entry '20' for key 'PRIMARY'
|
||||
SELECT count(*) FROM t1_temp WHERE c1 = 140;
|
||||
count(*)
|
||||
1
|
||||
@ -938,11 +937,19 @@ SELECT c1,c2,c3,c4,c5,c6,c7,c9,c10,c11 FROM t1_temp WHERE c1 < 0;
|
||||
c1 c2 c3 c4 c5 c6 c7 c9 c10 c11
|
||||
-2 -2 a a a a a 100.550 99 test
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
connection con2;
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
# restart: --innodb_undo_tablespaces=0 --innodb_rollback_segments=20 --innodb_undo_logs=20 --innodb_log_files_in_group=4
|
||||
disconnect con2;
|
||||
connection default;
|
||||
connect con1,localhost,root,,;
|
||||
connect con2,localhost,root,,;
|
||||
connection con1;
|
||||
call populate_tables('_1');;
|
||||
connection con2;
|
||||
call populate_tables('_2');;
|
||||
"#connection 1 - verify tables"
|
||||
connection con1;
|
||||
SELECT count(*) FROM t1_1;
|
||||
count(*)
|
||||
36
|
||||
@ -1220,7 +1227,9 @@ c1
|
||||
138
|
||||
140
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
"#connection 2 - verify tables"
|
||||
connection con2;
|
||||
SELECT count(*) FROM t1_2;
|
||||
count(*)
|
||||
36
|
||||
@ -1498,10 +1507,16 @@ c1
|
||||
138
|
||||
140
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
# restart: --innodb_undo_tablespaces=0 --innodb_rollback_segments=30 --innodb_undo_logs=20 --innodb_log_files_in_group=4
|
||||
disconnect con2;
|
||||
connection default;
|
||||
connect con1,localhost,root,,;
|
||||
connect con2,localhost,root,,;
|
||||
connection con1;
|
||||
call populate_tables('_1');;
|
||||
connection con2;
|
||||
call populate_tables('_2');;
|
||||
"#connection 1 - verify tables"
|
||||
connection con1;
|
||||
SELECT count(*) FROM t1_1;
|
||||
count(*)
|
||||
36
|
||||
@ -1779,7 +1794,9 @@ c1
|
||||
138
|
||||
140
|
||||
DROP TABLE t1_1 ,t2_1 ,t3_1,t4_1;
|
||||
disconnect con1;
|
||||
"#connection 2 - verify tables"
|
||||
connection con2;
|
||||
SELECT count(*) FROM t1_2;
|
||||
count(*)
|
||||
36
|
||||
@ -2057,4 +2074,6 @@ c1
|
||||
138
|
||||
140
|
||||
DROP TABLE t1_2 ,t2_2 ,t3_2,t4_2;
|
||||
disconnect con2;
|
||||
connection default;
|
||||
DROP PROCEDURE populate_tables;
|
||||
|
Reference in New Issue
Block a user