summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-11-01 20:01:44 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2019-11-01 20:01:44 +0100
commitf566889a79bf34fd2aaa48c34e5205a40a2915fb (patch)
treef101a359e60b68e47b55f8b28d49fb32445e80e0 /storage/rocksdb/mysql-test
parentec40980ddd921a3a765c23cc430c9c219e48ea85 (diff)
parent9c6fec88b10bfe51d87f63e6a6ea474cd18d1952 (diff)
downloadmariadb-git-f566889a79bf34fd2aaa48c34e5205a40a2915fb.tar.gz
Merge branch '10.3' into 10.4
Diffstat (limited to 'storage/rocksdb/mysql-test')
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result25
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test27
2 files changed, 49 insertions, 3 deletions
diff --git a/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result b/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
index ca373112c1c..d95549be4c1 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
@@ -75,7 +75,25 @@ select create_time, update_time into @create_tm, @update_tm
from information_schema.tables
where table_schema=database() and table_name='t1';
# Then, an in-place ALTER TABLE:
+select sleep(2);
+sleep(2) 0
alter table t1 add key (a);
+# create_time will change as .frm file is rewritten:
+select
+create_time=@create_tm,
+update_time
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+create_time=@create_tm 0
+update_time NULL
+# Check TRUNCATE TABLE
+insert into t1 values (10,10);
+select create_time, update_time into @create_tm, @update_tm
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+select sleep(2);
+sleep(2) 0
+truncate table t1;
select
create_time=@create_tm /* should not change */,
update_time
@@ -86,13 +104,18 @@ update_time NULL
#
# Check what is left after server restart
#
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
# Save t1's creation time
create table t2 as
select create_time
from information_schema.tables
where table_schema=database() and table_name='t1';
+select sleep(2);
+sleep(2) 0
select
-create_time=(select create_time from t2) /* should change */,
+create_time=(select create_time from t2) /* should not change */,
update_time
from information_schema.tables
where table_schema=database() and table_name='t1';
diff --git a/storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test b/storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
index 109301a8879..55854710c31 100644
--- a/storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
+++ b/storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
@@ -114,26 +114,49 @@ from information_schema.tables
where table_schema=database() and table_name='t1';
--echo # Then, an in-place ALTER TABLE:
+select sleep(2);
alter table t1 add key (a);
+--echo # create_time will change as .frm file is rewritten:
+select
+ create_time=@create_tm,
+ update_time
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+
+--echo # Check TRUNCATE TABLE
+insert into t1 values (10,10);
+select create_time, update_time into @create_tm, @update_tm
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+
+select sleep(2);
+truncate table t1;
+
select
create_time=@create_tm /* should not change */,
update_time
from information_schema.tables
where table_schema=database() and table_name='t1';
+
--echo #
--echo # Check what is left after server restart
--echo #
-
+drop table t1;
+create table t1 (a int);
+insert into t1 values (1);
--echo # Save t1's creation time
create table t2 as
select create_time
from information_schema.tables
where table_schema=database() and table_name='t1';
+select sleep(2);
+--source include/restart_mysqld.inc
+
select
- create_time=(select create_time from t2) /* should change */,
+ create_time=(select create_time from t2) /* should not change */,
update_time
from information_schema.tables
where table_schema=database() and table_name='t1';