Skip to content

Commit

Permalink
Fix a crash when starting on pre-ColumnFamily-support db.
Browse files Browse the repository at this point in the history
After rocksdb::Open(), check for error first, and only then assign
column family handles.
  • Loading branch information
spetrunia committed Sep 18, 2014
1 parent 7c53e5d commit d12ed04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -756,14 +756,14 @@ static int rocksdb_init_func(void *p)
status= rocksdb::DB::Open(main_opts, rocksdb_db_name, cf_descr,
&cf_handles, &rdb);

cf_manager.init(&cf_names, &cf_handles);

if (!status.ok())
{
std::string err_text= status.ToString();
sql_print_error("RocksDB: Error opening instance: %s", err_text.c_str());
DBUG_RETURN(1);
}
cf_manager.init(&cf_names, &cf_handles);

if (ddl_manager.init(rdb))
DBUG_RETURN(1);
Expand Down

0 comments on commit d12ed04

Please sign in to comment.