1create table t1 (a int,
2primary key (a) comment 'cf1') engine=rocksdb;
3create table t2 (a int,
4primary key (a) comment 'cf2') engine=rocksdb;
5create table t3 (a int,
6primary key (a) comment 'z') engine=rocksdb;
7insert into t1 values (1);
8insert into t2 values (2);
9insert into t3 values (2);
10call mtr.add_suppression("Column family 'cf5' not found.");
11SET @@global.rocksdb_update_cf_options = 'cf5={prefix_extractor=capped:28};';
12ERROR 42000: Variable 'rocksdb_update_cf_options' can't be set to the value of 'cf5={prefix_extractor=capped:28}; Unknown CF: cf5'
13select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO ORDER BY VALUE ASC;
14TYPE	NAME	VALUE
15MAX_INDEX_ID	MAX_INDEX_ID	258
16CF_FLAGS	2	cf1 [0]
17CF_FLAGS	3	cf2 [0]
18CF_FLAGS	0	default [0]
19CF_FLAGS	4	z [0]
20CF_FLAGS	1	__system__ [0]
21# restart
22
23Default options for all column families:
24
25select cf_name, option_type, value
26from information_schema.rocksdb_cf_options
27where option_type in ('WRITE_BUFFER_SIZE',
28'TARGET_FILE_SIZE_BASE',
29'MAX_BYTES_FOR_LEVEL_MULTIPLIER')
30order by cf_name, option_type;
31cf_name	option_type	value
32cf1	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
33cf1	TARGET_FILE_SIZE_BASE	1048576
34cf1	WRITE_BUFFER_SIZE	12582912
35cf2	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
36cf2	TARGET_FILE_SIZE_BASE	1048576
37cf2	WRITE_BUFFER_SIZE	12582912
38default	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
39default	TARGET_FILE_SIZE_BASE	1048576
40default	WRITE_BUFFER_SIZE	12582912
41z	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
42z	TARGET_FILE_SIZE_BASE	1048576
43z	WRITE_BUFFER_SIZE	12582912
44__system__	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
45__system__	TARGET_FILE_SIZE_BASE	1048576
46__system__	WRITE_BUFFER_SIZE	12582912
47# restart:--rocksdb_override_cf_options=cf1={write_buffer_size=8m;target_file_size_base=2m};cf2={write_buffer_size=16m;max_bytes_for_level_multiplier=8};z={target_file_size_base=4m};
48
49Individualized options for column families:
50
51select cf_name, option_type, value
52from information_schema.rocksdb_cf_options
53where option_type in ('WRITE_BUFFER_SIZE',
54'TARGET_FILE_SIZE_BASE',
55'MAX_BYTES_FOR_LEVEL_MULTIPLIER')
56order by cf_name, option_type;
57cf_name	option_type	value
58cf1	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
59cf1	TARGET_FILE_SIZE_BASE	2097152
60cf1	WRITE_BUFFER_SIZE	8388608
61cf2	MAX_BYTES_FOR_LEVEL_MULTIPLIER	8.000000
62cf2	TARGET_FILE_SIZE_BASE	1048576
63cf2	WRITE_BUFFER_SIZE	16777216
64default	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
65default	TARGET_FILE_SIZE_BASE	1048576
66default	WRITE_BUFFER_SIZE	12582912
67z	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
68z	TARGET_FILE_SIZE_BASE	4194304
69z	WRITE_BUFFER_SIZE	12582912
70__system__	MAX_BYTES_FOR_LEVEL_MULTIPLIER	10.000000
71__system__	TARGET_FILE_SIZE_BASE	1048576
72__system__	WRITE_BUFFER_SIZE	12582912
73# restart:--rocksdb_no_create_column_family=1 --rocksdb_override_cf_options=cf3={write_buffer_size=8m;target_file_size_base=2m};cf4={write_buffer_size=16m;max_bytes_for_level_multiplier=8};
74include/assert.inc ["Expected cf3 and cf4 to not exist"]
75create table t4 (a int,
76primary key (a) comment 'cf3') engine=rocksdb;
77include/assert.inc ["Expected cf3 to exist"]
78create table t5 (a int,
79primary key (a) comment 'nobodyknows') engine=rocksdb;
80ERROR HY000: Incorrect arguments to CREATE | ALTER - can not find column family for storing index data and creation is not allowed.
81include/assert.inc ["Expected cf4 to NOT exist"]
82call mtr.add_suppression("Column family 'cf6' not found.");
83SET @@global.rocksdb_update_cf_options = 'cf6={prefix_extractor=capped:28};';
84ERROR 42000: Variable 'rocksdb_update_cf_options' can't be set to the value of 'cf6={prefix_extractor=capped:28}; Unknown CF: cf6'
85select * from INFORMATION_SCHEMA.ROCKSDB_GLOBAL_INFO ORDER BY VALUE ASC;
86TYPE	NAME	VALUE
87MAX_INDEX_ID	MAX_INDEX_ID	259
88CF_FLAGS	2	cf1 [0]
89CF_FLAGS	3	cf2 [0]
90CF_FLAGS	5	cf3 [0]
91CF_FLAGS	0	default [0]
92CF_FLAGS	4	z [0]
93CF_FLAGS	1	__system__ [0]
94# restart
95
96drop table t1,t2,t3,t4;
97