From 5fbc1a1ee58d4f0e8c3dafc9219dcbdac5127068 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Wed, 7 Mar 2018 21:53:21 +0300 Subject: [PATCH] Fixed regression: cannot CREATE SELECT using HTTP interface [#CLICKHOUSE-2] --- dbms/src/Interpreters/InterpreterCreateQuery.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dbms/src/Interpreters/InterpreterCreateQuery.cpp b/dbms/src/Interpreters/InterpreterCreateQuery.cpp index 54187825310..76af9e6c6fc 100644 --- a/dbms/src/Interpreters/InterpreterCreateQuery.cpp +++ b/dbms/src/Interpreters/InterpreterCreateQuery.cpp @@ -557,7 +557,9 @@ BlockIO InterpreterCreateQuery::createTable(ASTCreateQuery & create) insert->table = table_name; insert->select = create.select->clone(); - return InterpreterInsertQuery(insert, context.getSessionContext(), context.getSettingsRef().insert_allow_materialized_columns).execute(); + return InterpreterInsertQuery(insert, + create.is_temporary ? context.getSessionContext() : context, + context.getSettingsRef().insert_allow_materialized_columns).execute(); } return {};