From d12ed0477c16293bab3246fcc078d1e0e45da7fa Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Thu, 18 Sep 2014 22:19:54 +0400 Subject: [PATCH] Fix a crash when starting on pre-ColumnFamily-support db. After rocksdb::Open(), check for error first, and only then assign column family handles. --- storage/rocksdb/ha_rocksdb.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index b7e29516084..761d2293d6e 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -756,7 +756,6 @@ 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()) { @@ -764,6 +763,7 @@ static int rocksdb_init_func(void *p) 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);