mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
29 lines
553 B
C++
29 lines
553 B
C++
#include <Databases/LoadingStrictnessLevel.h>
|
|
#include <cassert>
|
|
|
|
namespace DB
|
|
{
|
|
|
|
LoadingStrictnessLevel getLoadingStrictnessLevel(bool attach, bool force_attach, bool force_restore)
|
|
{
|
|
if (force_restore)
|
|
{
|
|
assert(attach);
|
|
assert(force_attach);
|
|
return LoadingStrictnessLevel::FORCE_RESTORE;
|
|
}
|
|
|
|
if (force_attach)
|
|
{
|
|
assert(attach);
|
|
return LoadingStrictnessLevel::FORCE_ATTACH;
|
|
}
|
|
|
|
if (attach)
|
|
return LoadingStrictnessLevel::ATTACH;
|
|
|
|
return LoadingStrictnessLevel::CREATE;
|
|
}
|
|
|
|
}
|