mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-22 07:31:57 +00:00
Better assignment
This commit is contained in:
parent
d2fcf5aea5
commit
4c77ba664a
@ -36,6 +36,9 @@ IndexDescription::IndexDescription(const IndexDescription & other)
|
||||
|
||||
IndexDescription & IndexDescription::operator=(const IndexDescription & other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
||||
if (other.definition_ast)
|
||||
definition_ast = other.definition_ast->clone();
|
||||
else
|
||||
|
@ -22,6 +22,9 @@ KeyDescription::KeyDescription(const KeyDescription & other)
|
||||
|
||||
KeyDescription & KeyDescription::operator=(const KeyDescription & other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
||||
if (other.definition_ast)
|
||||
definition_ast = other.definition_ast->clone();
|
||||
else
|
||||
|
@ -24,6 +24,9 @@ SelectQueryDescription::SelectQueryDescription(const SelectQueryDescription & ot
|
||||
|
||||
SelectQueryDescription & SelectQueryDescription::SelectQueryDescription::operator=(const SelectQueryDescription & other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
||||
select_table_id = other.select_table_id;
|
||||
if (other.select_query)
|
||||
select_query = other.select_query->clone();
|
||||
|
@ -30,6 +30,9 @@ StorageInMemoryMetadata::StorageInMemoryMetadata(const StorageInMemoryMetadata &
|
||||
|
||||
StorageInMemoryMetadata & StorageInMemoryMetadata::operator=(const StorageInMemoryMetadata & other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
||||
columns = other.columns;
|
||||
secondary_indices = other.secondary_indices;
|
||||
constraints = other.constraints;
|
||||
|
@ -72,6 +72,9 @@ TTLDescription::TTLDescription(const TTLDescription & other)
|
||||
|
||||
TTLDescription & TTLDescription::operator=(const TTLDescription & other)
|
||||
{
|
||||
if (&other == this)
|
||||
return *this;
|
||||
|
||||
mode = other.mode;
|
||||
if (other.expression_ast)
|
||||
expression_ast = other.expression_ast->clone();
|
||||
|
Loading…
Reference in New Issue
Block a user