summaryrefslogtreecommitdiffstats
path: root/storage/rocksdb/mysql-test/rocksdb/t/skip_validate_tmp_table.test
blob: c4321462dfd22a6083f3d682e13df51e9f173917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--source include/have_rocksdb.inc
--source include/have_debug.inc

--let $_server_id= `SELECT @@server_id`

create table t1 (pk int primary key) engine=rocksdb;

# Create a .frm file without a matching table
--exec cp $MYSQLTEST_VARDIR/mysqld.$_server_id/data/test/t1.frm $MYSQLTEST_VARDIR/mysqld.$_server_id/data/test/t1#sql-test.frm

--source include/restart_mysqld.inc

show tables;

# MariaDB produces a warning:
call mtr.add_suppression('Invalid .old.. table or database name .t1#sql-test.');

# This will append '#sql-test' to the end of new name
set session debug_dbug="+d,gen_sql_table_name";
rename table t1 to t2;
set session debug_dbug= "-d,gen_sql_table_name";

show tables;

# Remove the corresponding .frm files
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.$_server_id/data/test *t1*.frm
--remove_files_wildcard $MYSQLTEST_VARDIR/mysqld.$_server_id/data/test *t2*.frm

# Restart the server with a table registered in RocksDB but does not have a .frm file
--source include/restart_mysqld.inc

show tables;

# try to recreate a table with the same name
create table t2 (pk int primary key) engine=rocksdb;

show tables;

drop table t2;