@@ -1692,6 +1692,37 @@ int main(int argc, char** argv) {
16921692 CheckGet (db , roptions , "bar" , "fake" );
16931693 }
16941694
1695+ StartPhase ("CF with option" );
1696+ {
1697+ rocksdb_close (db );
1698+ rocksdb_destroy_db (options , dbname , & err );
1699+ CheckNoError (err );
1700+
1701+ rocksdb_options_t * db_options = rocksdb_options_create ();
1702+ rocksdb_options_set_create_if_missing (db_options , 1 );
1703+ db = rocksdb_open (db_options , dbname , & err );
1704+ CheckNoError (err );
1705+
1706+ char * * list_const_cf_names = (char * * )malloc (2 * sizeof (char * ));
1707+ list_const_cf_names [0 ] = "cf_with_options" ;
1708+ list_const_cf_names [1 ] = "cf_with_option" ;
1709+ size_t cflen ;
1710+ const rocksdb_options_t * create_cf_options [2 ] = {db_options , db_options };
1711+ rocksdb_column_family_handle_t * * new_column_family_handle =
1712+ rocksdb_create_column_families_with_options (
1713+ db , 2 , (const char * const * )list_const_cf_names , create_cf_options ,
1714+ & cflen , & err );
1715+ free (list_const_cf_names );
1716+ CheckNoError (err );
1717+ assert (cflen == 2 );
1718+
1719+ rocksdb_column_family_handle_destroy (new_column_family_handle [0 ]);
1720+ rocksdb_column_family_handle_destroy (new_column_family_handle [1 ]);
1721+
1722+ rocksdb_create_column_families_destroy (new_column_family_handle );
1723+ rocksdb_options_destroy (db_options );
1724+ }
1725+
16951726 StartPhase ("columnfamilies" );
16961727 {
16971728 rocksdb_close (db );
@@ -3802,6 +3833,7 @@ int main(int argc, char** argv) {
38023833 cfh1 = list_cfh [0 ];
38033834 cfh2 = list_cfh [1 ];
38043835 rocksdb_create_column_families_destroy (list_cfh );
3836+
38053837 txn = rocksdb_optimistictransaction_begin (otxn_db , woptions , otxn_options ,
38063838 NULL );
38073839 rocksdb_transaction_put_cf (txn , cfh1 , "key_cf1" , 7 , "val_cf1" , 7 , & err );
0 commit comments