diff --git a/src/query/v2/metadata.cpp b/src/query/v2/metadata.cpp index 7735edacf..f8a14d4a0 100644 --- a/src/query/v2/metadata.cpp +++ b/src/query/v2/metadata.cpp @@ -72,10 +72,6 @@ constexpr std::string_view GetCodeString(const NotificationCode code) { return "ReplicaPortWarning"sv; case NotificationCode::SET_REPLICA: return "SetReplica"sv; - case NotificationCode::SHOW_SCHEMA: - return "ShowSchema"sv; - case NotificationCode::SHOW_SCHEMAS: - return "ShowSchemas"sv; case NotificationCode::START_STREAM: return "StartStream"sv; case NotificationCode::START_ALL_STREAMS: diff --git a/src/query/v2/metadata.hpp b/src/query/v2/metadata.hpp index 4a5e7b9c9..c5211b1c1 100644 --- a/src/query/v2/metadata.hpp +++ b/src/query/v2/metadata.hpp @@ -44,8 +44,6 @@ enum class NotificationCode : uint8_t { REPLICA_PORT_WARNING, REGISTER_REPLICA, SET_REPLICA, - SHOW_SCHEMA, - SHOW_SCHEMAS, START_STREAM, START_ALL_STREAMS, STOP_STREAM, diff --git a/src/query/v2/plan/operator.cpp b/src/query/v2/plan/operator.cpp index 432a8c7e8..4e3005d75 100644 --- a/src/query/v2/plan/operator.cpp +++ b/src/query/v2/plan/operator.cpp @@ -198,8 +198,10 @@ VertexAccessor &CreateLocalVertexAtomically(const NodeCreationInfo &node_info, F properties.emplace_back(property_id, value); } } - // TODO Remove later on since that will be enforced from grammar side - MG_ASSERT(!node_info.labels.empty(), "There must be at least one label!"); + + if (node_info.labels.empty()) { + throw QueryRuntimeException("Primary label must be defined!"); + } const auto primary_label = node_info.labels[0]; std::vector secondary_labels(node_info.labels.begin() + 1, node_info.labels.end()); auto maybe_new_node = dba.InsertVertexAndValidate(primary_label, secondary_labels, properties);