2017-04-01 09:19:00 +00:00
|
|
|
#include <Storages/StorageCloud.h>
|
|
|
|
#include <Databases/DatabaseCloud.h>
|
2016-03-28 11:19:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace DB
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace ErrorCodes
|
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
extern const int LOGICAL_ERROR;
|
2016-03-28 11:19:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-04-04 21:41:16 +00:00
|
|
|
StorageCloud::StorageCloud(
|
2017-04-01 07:20:54 +00:00
|
|
|
DatabasePtr & database_ptr_,
|
|
|
|
const std::string & name_,
|
|
|
|
NamesAndTypesListPtr columns_,
|
|
|
|
const NamesAndTypesList & materialized_columns_,
|
|
|
|
const NamesAndTypesList & alias_columns_,
|
|
|
|
const ColumnDefaults & column_defaults_)
|
|
|
|
: IStorage{materialized_columns_, alias_columns_, column_defaults_},
|
|
|
|
name(name_), columns(columns_), database_ptr(database_ptr_)
|
2016-03-28 11:19:51 +00:00
|
|
|
{
|
2017-04-01 07:20:54 +00:00
|
|
|
DatabasePtr owned_db = database_ptr.lock();
|
|
|
|
if (!owned_db)
|
|
|
|
throw Exception("DatabaseCloud is detached", ErrorCodes::LOGICAL_ERROR);
|
2016-03-28 11:19:51 +00:00
|
|
|
|
2017-04-01 07:20:54 +00:00
|
|
|
DatabaseCloud & db = static_cast<DatabaseCloud &>(*owned_db);
|
2016-04-04 21:41:16 +00:00
|
|
|
}
|
|
|
|
|
2016-03-28 11:19:51 +00:00
|
|
|
}
|