1--source include/have_rocksdb.inc
2
3let MYSQLD_DATADIR= `SELECT @@datadir`;
4let file= $MYSQL_TMP_DIR/cf_configs.cnf;
5
6# create new column families with no configs in cf_configs.cnf file
7
8create table t1 (a int,
9                primary key (a) comment 'cf1') engine=rocksdb;
10create table t2 (a int,
11                primary key (a) comment 'cf2') engine=rocksdb;
12create table t3 (a int,
13                primary key (a) comment 'z') engine=rocksdb;
14
15insert into t1 values (1);
16insert into t2 values (2);
17insert into t3 values (2);
18
19# restart with new column families in DB
20
21--source include/restart_mysqld.inc
22
23# check column family options in log -- should be all default settings
24
25--echo
26--echo Default options for all column families:
27--echo
28select cf_name, option_type, value
29  from information_schema.rocksdb_cf_options
30  where option_type in ('WRITE_BUFFER_SIZE',
31                        'TARGET_FILE_SIZE_BASE',
32                        'MAX_BYTES_FOR_LEVEL_MULTIPLIER')
33  order by cf_name, option_type;
34# restart with cf configs for cf1 and cf2
35
36--let $restart_parameters=--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};
37--source include/restart_mysqld.inc
38
39# check column family options in log -- should reflect individual settings
40
41--echo
42--echo Individualized options for column families:
43--echo
44select cf_name, option_type, value
45  from information_schema.rocksdb_cf_options
46  where option_type in ('WRITE_BUFFER_SIZE',
47                        'TARGET_FILE_SIZE_BASE',
48                        'MAX_BYTES_FOR_LEVEL_MULTIPLIER')
49  order by cf_name, option_type;
50
51# syntax error in options (no equal sign)
52
53--exec echo "restart:--rocksdb_override_cf_options=cf1" > $_expect_file_name
54--error 1
55--source include/wait_until_connected_again.inc
56
57# invalid cf option config (no curly braces)
58
59--exec echo "restart:--rocksdb_override_cf_options=cf1=write_buffer_size=8m" > $_expect_file_name
60--error 1
61--source include/wait_until_connected_again.inc
62
63# invalid cf option config (cf listed twice)
64
65--exec echo "restart:--rocksdb_override_cf_options=cf1={write_buffer_size=8m};cf1={target_file_size_base=2m}" > $_expect_file_name
66--error 1
67--source include/wait_until_connected_again.inc
68
69# clean up
70
71--source include/restart_mysqld.inc
72
73--echo
74drop table t1,t2,t3;
75
76