diff --git a/src/Parsers/ASTPartition.cpp b/src/Parsers/ASTPartition.cpp index 22eecd37565..d08f9ae1ca5 100644 --- a/src/Parsers/ASTPartition.cpp +++ b/src/Parsers/ASTPartition.cpp @@ -36,8 +36,9 @@ String ASTPartition::getID(char delim) const { if (value) return "Partition"; - else - return "Partition_ID" + (delim + id->getID()); + + std::string id_string = id ? id->getID() : ""; + return "Partition_ID" + (delim + id_string); } ASTPtr ASTPartition::clone() const