From 3adfe8d53674da4846f8cdf13244de8f86574c87 Mon Sep 17 00:00:00 2001 From: Michael Kolupaev Date: Tue, 5 Aug 2014 12:57:17 +0400 Subject: [PATCH] Merge --- dbms/src/Storages/StorageReplicatedMergeTree.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dbms/src/Storages/StorageReplicatedMergeTree.cpp b/dbms/src/Storages/StorageReplicatedMergeTree.cpp index 13045302c4e..8ded9c49f96 100644 --- a/dbms/src/Storages/StorageReplicatedMergeTree.cpp +++ b/dbms/src/Storages/StorageReplicatedMergeTree.cpp @@ -1889,8 +1889,9 @@ BlockOutputStreamPtr StorageReplicatedMergeTree::write(ASTPtr query) throw Exception("Table is in read only mode", ErrorCodes::TABLE_IS_READ_ONLY); String insert_id; - if (ASTInsertQuery * insert = typeid_cast(&*query)) - insert_id = insert->insert_id; + if (query) + if (ASTInsertQuery * insert = typeid_cast(&*query)) + insert_id = insert->insert_id; return new ReplicatedMergeTreeBlockOutputStream(*this, insert_id); }