Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 11 additions & 27 deletions mysql-test/main/global_temporary_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -1002,17 +1002,6 @@ create global temporary table t like t1;
ERROR HY000: Cannot add foreign key constraint for `GLOBAL TEMPORARY TABLE`
drop table t1;
drop table t0;
# MDEV-37667 SIGSEGV on ALTER on locked GTT in low memory env
create global temporary table t (t text);
set max_session_mem_used= 8192;
insert t values (0);
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
lock table t write;
alter table t add z int;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
drop table t;
unlock tables;
# MDEV-37668 SIGSEGV on DROP TABLE GTT under LOCK TABLES and different server_id
create global temporary table t (x int) on commit preserve rows as select 1 'a';
create global temporary table t2 (x int key) on commit preserve rows;
Expand Down Expand Up @@ -1241,22 +1230,6 @@ drop table t;
set pseudo_slave_mode=0;
Warnings:
Warning 1231 Slave applier execution mode not active, statement ineffective.
# MDEV-38480 GTT: Aria gets error HA_ERR_CRASHED_ON_USAGE after TRUNCATE
set autocommit=0;
create global temporary table t (c int) engine=aria;
lock tables t write;
select * from t;
c
set max_session_mem_used=8192;
truncate t;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
unlock tables;
select * from t;
c
truncate t;
drop table t;
set autocommit=1;
# MDEV-38468 GTT: use-after-free after failed BINLOG event in XA mode
create global temporary table t (c int);
xa start 'a';
Expand Down Expand Up @@ -1322,6 +1295,8 @@ set autocommit=1;
create global temporary table t (c int) engine=innodb on commit preserve rows;
set session transaction isolation level serializable;
flush tables t with read lock;
Warnings:
Warning 1809 Table `test`.`t` in system tablespace
insert t values (1);
update t set c=c+1;
# Cleanup
Expand Down Expand Up @@ -1351,3 +1326,12 @@ ERROR HY000: 'mysql.help_topic' is not of type 'BASE TABLE'
drop table mysql.help_topic;
rename table mysql.help_topic1 to mysql.help_topic;
disconnect con1;
# MDEV-40167 - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes
CREATE GLOBAL TEMPORARY TABLE gtt (id INT PRIMARY KEY, body TEXT, FULLTEXT (body))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create FULLTEXT index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt_v (id INT PRIMARY KEY, v VECTOR (4) NOT NULL, VECTOR INDEX (v))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create VECTOR index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt (id INT ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ON COMMIT PRESERVE ROWS;
ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
42 changes: 13 additions & 29 deletions mysql-test/main/global_temporary_table.test
Original file line number Diff line number Diff line change
Expand Up @@ -871,20 +871,6 @@ create global temporary table t like t1;
drop table t1;
drop table t0;

--echo # MDEV-37667 SIGSEGV on ALTER on locked GTT in low memory env
--disable_ps_protocol
create global temporary table t (t text);
set max_session_mem_used= 8192;
--error ER_OPTION_PREVENTS_STATEMENT
insert t values (0);
lock table t write;
--error ER_OPTION_PREVENTS_STATEMENT
alter table t add z int;
set max_session_mem_used= default;
drop table t;
unlock tables;
--enable_ps_protocol

--echo # MDEV-37668 SIGSEGV on DROP TABLE GTT under LOCK TABLES and different server_id
create global temporary table t (x int) on commit preserve rows as select 1 'a';
create global temporary table t2 (x int key) on commit preserve rows;
Expand Down Expand Up @@ -1113,21 +1099,6 @@ commit;
drop table t;
set pseudo_slave_mode=0;

--echo # MDEV-38480 GTT: Aria gets error HA_ERR_CRASHED_ON_USAGE after TRUNCATE
set autocommit=0;
create global temporary table t (c int) engine=aria;
lock tables t write;
select * from t;
set max_session_mem_used=8192;
--error ER_OPTION_PREVENTS_STATEMENT
truncate t;
set max_session_mem_used= default;
unlock tables;
select * from t;
truncate t;
drop table t;
set autocommit=1;

--echo # MDEV-38468 GTT: use-after-free after failed BINLOG event in XA mode
create global temporary table t (c int);
xa start 'a';
Expand Down Expand Up @@ -1234,3 +1205,16 @@ drop table mysql.help_topic;
rename table mysql.help_topic1 to mysql.help_topic;

--disconnect con1

--echo # MDEV-40167 - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes

--error ER_NO_INDEX_ON_TEMPORARY
CREATE GLOBAL TEMPORARY TABLE gtt (id INT PRIMARY KEY, body TEXT, FULLTEXT (body))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;

--error ER_NO_INDEX_ON_TEMPORARY
CREATE GLOBAL TEMPORARY TABLE gtt_v (id INT PRIMARY KEY, v VECTOR (4) NOT NULL, VECTOR INDEX (v))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;

--error ER_UNSUPPORTED_COMPRESSED_TABLE
CREATE GLOBAL TEMPORARY TABLE gtt (id INT ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ON COMMIT PRESERVE ROWS;
46 changes: 11 additions & 35 deletions mysql-test/suite/binlog/r/global_temporary_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -1005,17 +1005,6 @@ create global temporary table t like t1;
ERROR HY000: Cannot add foreign key constraint for `GLOBAL TEMPORARY TABLE`
drop table t1;
drop table t0;
# MDEV-37667 SIGSEGV on ALTER on locked GTT in low memory env
create global temporary table t (t text);
set max_session_mem_used= 8192;
insert t values (0);
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
lock table t write;
alter table t add z int;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
drop table t;
unlock tables;
# MDEV-37668 SIGSEGV on DROP TABLE GTT under LOCK TABLES and different server_id
create global temporary table t (x int) on commit preserve rows as select 1 'a';
create global temporary table t2 (x int key) on commit preserve rows;
Expand Down Expand Up @@ -1244,22 +1233,6 @@ drop table t;
set pseudo_slave_mode=0;
Warnings:
Warning 1231 Slave applier execution mode not active, statement ineffective.
# MDEV-38480 GTT: Aria gets error HA_ERR_CRASHED_ON_USAGE after TRUNCATE
set autocommit=0;
create global temporary table t (c int) engine=aria;
lock tables t write;
select * from t;
c
set max_session_mem_used=8192;
truncate t;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
unlock tables;
select * from t;
c
truncate t;
drop table t;
set autocommit=1;
# MDEV-38468 GTT: use-after-free after failed BINLOG event in XA mode
create global temporary table t (c int);
xa start 'a';
Expand Down Expand Up @@ -1325,6 +1298,8 @@ set autocommit=1;
create global temporary table t (c int) engine=innodb on commit preserve rows;
set session transaction isolation level serializable;
flush tables t with read lock;
Warnings:
Warning 1809 Table `test`.`t` in system tablespace
insert t values (1);
update t set c=c+1;
# Cleanup
Expand Down Expand Up @@ -1354,6 +1329,15 @@ ERROR HY000: 'mysql.help_topic' is not of type 'BASE TABLE'
drop table mysql.help_topic;
rename table mysql.help_topic1 to mysql.help_topic;
disconnect con1;
# MDEV-40167 - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes
CREATE GLOBAL TEMPORARY TABLE gtt (id INT PRIMARY KEY, body TEXT, FULLTEXT (body))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create FULLTEXT index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt_v (id INT PRIMARY KEY, v VECTOR (4) NOT NULL, VECTOR INDEX (v))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create VECTOR index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt (id INT ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ON COMMIT PRESERVE ROWS;
ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
Expand Down Expand Up @@ -1897,10 +1881,6 @@ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t0` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create global temporary table t (t text)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE GLOBAL TEMPORARY TABLE `t` (
`x` int(11) DEFAULT NULL,
`a` int(1) NOT NULL
Expand Down Expand Up @@ -2042,10 +2022,6 @@ master-bin.000001 # Query # # use `test`; create global temporary table t (c int
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create global temporary table t (c int) engine=aria
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create global temporary table t (c int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t` /* generated by server */
Expand Down
38 changes: 11 additions & 27 deletions mysql-test/suite/rpl/r/global_temporary_table.result
Original file line number Diff line number Diff line change
Expand Up @@ -1005,17 +1005,6 @@ create global temporary table t like t1;
ERROR HY000: Cannot add foreign key constraint for `GLOBAL TEMPORARY TABLE`
drop table t1;
drop table t0;
# MDEV-37667 SIGSEGV on ALTER on locked GTT in low memory env
create global temporary table t (t text);
set max_session_mem_used= 8192;
insert t values (0);
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
lock table t write;
alter table t add z int;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
drop table t;
unlock tables;
# MDEV-37668 SIGSEGV on DROP TABLE GTT under LOCK TABLES and different server_id
create global temporary table t (x int) on commit preserve rows as select 1 'a';
create global temporary table t2 (x int key) on commit preserve rows;
Expand Down Expand Up @@ -1244,22 +1233,6 @@ drop table t;
set pseudo_slave_mode=0;
Warnings:
Warning 1231 Slave applier execution mode not active, statement ineffective.
# MDEV-38480 GTT: Aria gets error HA_ERR_CRASHED_ON_USAGE after TRUNCATE
set autocommit=0;
create global temporary table t (c int) engine=aria;
lock tables t write;
select * from t;
c
set max_session_mem_used=8192;
truncate t;
ERROR HY000: The MariaDB server is running with the --max-session-mem-used=8192 option so it cannot execute this statement
set max_session_mem_used= default;
unlock tables;
select * from t;
c
truncate t;
drop table t;
set autocommit=1;
# MDEV-38468 GTT: use-after-free after failed BINLOG event in XA mode
create global temporary table t (c int);
xa start 'a';
Expand Down Expand Up @@ -1325,6 +1298,8 @@ set autocommit=1;
create global temporary table t (c int) engine=innodb on commit preserve rows;
set session transaction isolation level serializable;
flush tables t with read lock;
Warnings:
Warning 1809 Table `test`.`t` in system tablespace
insert t values (1);
update t set c=c+1;
# Cleanup
Expand Down Expand Up @@ -1354,6 +1329,15 @@ ERROR HY000: 'mysql.help_topic' is not of type 'BASE TABLE'
drop table mysql.help_topic;
rename table mysql.help_topic1 to mysql.help_topic;
disconnect con1;
# MDEV-40167 - GTT created with the InnoDB incorrectly accept FULLTEXT/VECTOR indexes
CREATE GLOBAL TEMPORARY TABLE gtt (id INT PRIMARY KEY, body TEXT, FULLTEXT (body))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create FULLTEXT index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt_v (id INT PRIMARY KEY, v VECTOR (4) NOT NULL, VECTOR INDEX (v))
ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
ERROR HY000: Cannot create VECTOR index on temporary InnoDB table
CREATE GLOBAL TEMPORARY TABLE gtt (id INT ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED ON COMMIT PRESERVE ROWS;
ERROR HY000: InnoDB refuses to write tables with ROW_FORMAT=COMPRESSED or KEY_BLOCK_SIZE.
connection slave;
connection master;
set @old_timeout= @@global.lock_wait_timeout;
Expand Down
2 changes: 1 addition & 1 deletion sql/sql_table.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3778,7 +3778,7 @@ mysql_prepare_create_table_finalize(THD *thd, HA_CREATE_INFO *create_info,
my_error(ER_INDEX_CANNOT_HAVE_NULL, MYF(0), "VECTOR");
DBUG_RETURN(TRUE);
}
if (create_info->tmp_table())
if (create_info->tmp_table() || create_info->global_tmp_table())
{
my_error(ER_NO_INDEX_ON_TEMPORARY, MYF(0), "VECTOR",
file->table_type());
Expand Down
Loading
Loading