summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/table_stats.test
blob: 3eb58098372dd1c32193fe21516f815356c83a4f (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
--source include/have_rocksdb.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

# Create the table and insert some keys
CREATE TABLE t1 (i INT, PRIMARY KEY (i) COMMENT 'cf_t1') ENGINE = ROCKSDB;

--disable_query_log
let $max = 1000;
let $i = 1;
while ($i <= $max) {
  let $insert = INSERT INTO t1 VALUES ($i);
  inc $i;
  eval $insert;
}
--enable_query_log

# Verify table has correct rows
SELECT COUNT(*) FROM t1;

# Verify the table stats are returned
--vertical_results
SELECT * FROM INFORMATION_SCHEMA.TABLE_STATISTICS WHERE TABLE_NAME = "t1";
--horizontal_results

#cleanup
DROP TABLE t1;