summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/r
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2019-11-05 16:15:20 +0100
committerMarko Mäkelä <marko.makela@mariadb.com>2019-11-07 08:52:30 +0100
commit3ad37ed0eb343cd173b103974aded5783958a88e (patch)
treef4ff854553d26a9e7d57791e7d671d4349a58d2d /storage/rocksdb/mysql-test/rocksdb/r
parent46f2f24ec43e9c1fa2d994afd615f58736c00d65 (diff)
parent0339cbe2f628f8a122ba7ea3a75fc99fa1dc4c96 (diff)
downloadmariadb-git-3ad37ed0eb343cd173b103974aded5783958a88e.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'storage/rocksdb/mysql-test/rocksdb/r')
-rw-r--r--storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result76
1 files changed, 76 insertions, 0 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 457a4822301..139d323bb1a 100644
--- a/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
+++ b/storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
@@ -57,4 +57,80 @@ where table_schema=database() and table_name='t1';
create_time=@create_tm 1
timestampdiff(second, @update_tm, update_time) > 2 1
check_time NULL
+#
+# Check how create_time survives ALTER TABLE.
+# First, an ALTER TABLE that re-creates the table:
+alter table t1 add b int;
+select
+create_time<>@create_tm /* should change */,
+create_time IS NOT NULL,
+update_time IS NULL
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+create_time<>@create_tm 1
+create_time IS NOT NULL 1
+update_time IS NULL 1
+insert into t1 values (5,5);
+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
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+create_time=@create_tm 1
+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
+# restart
+select
+create_time=(select create_time from t2) /* should not change */,
+update_time
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+create_time=(select create_time from t2) 1
+update_time NULL
+drop table t1, t2;
+#
+# Check how it works for partitioned tables
+#
+create table t1 (pk int primary key) partition by hash(pk) partitions 2;
+insert into t1 values (1);
+select create_time IS NOT NULL , update_time IS NOT NULL
+from information_schema.tables
+where table_schema=database() and table_name='t1';
+create_time IS NOT NULL 1
+update_time IS NOT NULL 1
drop table t1;