mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-16 11:22:12 +00:00
Fix previous commit changes
This commit is contained in:
parent
85e448f048
commit
41852d667f
@ -36,9 +36,31 @@ String SettingChange::getValueString() const
|
||||
return convertFieldToString(field_value);
|
||||
}
|
||||
|
||||
void SettingChange::throwIfASTValue() const
|
||||
const Field & SettingChange::getFieldValue() const
|
||||
{
|
||||
if (getASTValue() != nullptr)
|
||||
throwIfASTValueNotConvertedToField();
|
||||
return field_value;
|
||||
}
|
||||
|
||||
Field & SettingChange::getFieldValue()
|
||||
{
|
||||
throwIfASTValueNotConvertedToField();
|
||||
return field_value;
|
||||
}
|
||||
|
||||
void SettingChange::setFieldValue(const Field & field)
|
||||
{
|
||||
field_value = field;
|
||||
}
|
||||
|
||||
void SettingChange::setASTValue(const ASTPtr & ast)
|
||||
{
|
||||
ast_value = ast ? ast->clone() : ast;
|
||||
}
|
||||
|
||||
void SettingChange::throwIfASTValueNotConvertedToField() const
|
||||
{
|
||||
if (getASTValue() != nullptr && field_value == Field{})
|
||||
throw Exception(
|
||||
ErrorCodes::LOGICAL_ERROR,
|
||||
"AST value of the setting must be converted to Field value");
|
||||
|
@ -30,19 +30,19 @@ public:
|
||||
|
||||
friend bool operator !=(const SettingChange & lhs, const SettingChange & rhs) { return !(lhs == rhs); }
|
||||
|
||||
void throwIfASTValue() const;
|
||||
void throwIfASTValueNotConvertedToField() const;
|
||||
|
||||
const String & getName() const { return name; }
|
||||
String & getName() { return name; }
|
||||
|
||||
const Field & getFieldValue() const { throwIfASTValue(); return field_value; }
|
||||
Field & getFieldValue() { throwIfASTValue(); return field_value; }
|
||||
const Field & getFieldValue() const;
|
||||
Field & getFieldValue();
|
||||
|
||||
const ASTPtr & getASTValue() const { return ast_value; }
|
||||
ASTPtr & getASTValue() { return ast_value; }
|
||||
|
||||
void setFieldValue(const Field & field) { field_value = field; }
|
||||
void setASTValue(const ASTPtr & ast) { ast_value = ast->clone(); }
|
||||
void setFieldValue(const Field & field);
|
||||
void setASTValue(const ASTPtr & ast);
|
||||
|
||||
String getValueString() const;
|
||||
};
|
||||
|
@ -616,7 +616,6 @@ static StoragePtr create(const StorageFactory::Arguments & args)
|
||||
const auto & ast_value = assert_cast<const ASTFunction &>(*change.getASTValue());
|
||||
auto value = createDiskFromDiskAST(ast_value, context);
|
||||
change.setFieldValue(value);
|
||||
change.setASTValue(nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user