dbms: fixed error with views [#METR-18748].

This commit is contained in:
Alexey Milovidov 2015-11-10 23:07:38 +03:00
parent 32614f5206
commit d21307c535
4 changed files with 20 additions and 1 deletions

View File

@ -28,7 +28,6 @@
#include <DB/Interpreters/InterpreterSelectQuery.h>
#include <DB/Interpreters/InterpreterSetQuery.h>
#include <DB/Interpreters/ExpressionAnalyzer.h>
#include <DB/Storages/StorageView.h>
#include <DB/TableFunctions/ITableFunction.h>
#include <DB/TableFunctions/TableFunctionFactory.h>

View File

@ -80,6 +80,8 @@ BlockInputStreams StorageView::read(
const size_t max_block_size,
const unsigned threads)
{
processed_stage = QueryProcessingStage::FetchColumns;
ASTPtr inner_query_clone = getInnerQuery();
ASTSelectQuery & inner_select = static_cast<ASTSelectQuery &>(*inner_query_clone);
const ASTSelectQuery & outer_select = typeid_cast<const ASTSelectQuery &>(*query);

View File

@ -0,0 +1,5 @@
Hello, world!
Hello, world!
Hello, world!
Hello, world!
Hello, world!

View File

@ -0,0 +1,13 @@
DROP TABLE IF EXISTS test.view1;
DROP TABLE IF EXISTS test.view2;
DROP TABLE IF EXISTS test.merge_view;
CREATE VIEW test.view1 AS SELECT number FROM system.numbers LIMIT 10;
CREATE VIEW test.view2 AS SELECT number FROM system.numbers LIMIT 10;
CREATE TABLE test.merge_view (number UInt64) ENGINE = Merge(test, '^view');
SELECT 'Hello, world!' FROM merge_view LIMIT 5;
DROP TABLE test.view1;
DROP TABLE test.view2;
DROP TABLE test.merge_view;