From 624b31602c2e8b70272c637ec05a7c15684b04da Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 15 Aug 2011 01:12:57 +0000 Subject: [PATCH] dbms: development [#CONV-2944]. --- dbms/include/DB/Parsers/ParserSelectQuery.h | 7 ++----- dbms/include/DB/Storages/IStorage.h | 18 ++++++++---------- dbms/include/DB/Storages/StorageLog.h | 4 ++-- .../include/DB/Storages/StorageSystemNumbers.h | 2 +- dbms/src/Storages/StorageLog.cpp | 4 ++-- dbms/src/Storages/StorageSystemNumbers.cpp | 2 +- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/dbms/include/DB/Parsers/ParserSelectQuery.h b/dbms/include/DB/Parsers/ParserSelectQuery.h index 81c51c0f3a8..bd226068b50 100644 --- a/dbms/include/DB/Parsers/ParserSelectQuery.h +++ b/dbms/include/DB/Parsers/ParserSelectQuery.h @@ -1,5 +1,4 @@ -#ifndef DBMS_PARSERS_PARSERSELECTQUERY_H -#define DBMS_PARSERS_PARSERSELECTQUERY_H +#pragma once #include #include @@ -23,7 +22,7 @@ protected: ASTPtr select_expression_list; ParserWhiteSpaceOrComments ws; - ParserString s("SELECT", true); + ParserString s("SELECT", true, true); ParserNotEmptyExpressionList exp_list; ws.ignore(pos, end); @@ -46,5 +45,3 @@ protected: }; } - -#endif diff --git a/dbms/include/DB/Storages/IStorage.h b/dbms/include/DB/Storages/IStorage.h index 146e3927626..0cde2951d45 100644 --- a/dbms/include/DB/Storages/IStorage.h +++ b/dbms/include/DB/Storages/IStorage.h @@ -1,22 +1,20 @@ -#ifndef DBMS_STORAGES_ISTORAGE_H -#define DBMS_STORAGES_ISTORAGE_H - -//#include +#pragma once #include #include #include #include + #include #include +#include + namespace DB { -typedef char ptree; /// временная заглушка, вместо boost::property_tree::ptree -//using boost::property_tree::ptree; using Poco::SharedPtr; /** Хранилище. Отвечает за: @@ -40,7 +38,7 @@ public: */ virtual SharedPtr read( const Names & column_names, - const ptree & query, + ASTPtr query, size_t max_block_size = DEFAULT_BLOCK_SIZE) { throw Exception("Method read() is not supported by storage " + getName()); @@ -51,7 +49,7 @@ public: * Возвращает объект, с помощью которого можно последовательно писать данные. */ virtual SharedPtr write( - const ptree & query) + ASTPtr query) { throw Exception("Method write() is not supported by storage " + getName()); } @@ -59,6 +57,6 @@ public: virtual ~IStorage() {} }; -} +typedef SharedPtr StoragePtr; -#endif +} diff --git a/dbms/include/DB/Storages/StorageLog.h b/dbms/include/DB/Storages/StorageLog.h index 788fd58de27..c589fbb41e3 100644 --- a/dbms/include/DB/Storages/StorageLog.h +++ b/dbms/include/DB/Storages/StorageLog.h @@ -90,11 +90,11 @@ public: SharedPtr read( const Names & column_names, - const ptree & query, + ASTPtr query, size_t max_block_size = DEFAULT_BLOCK_SIZE); SharedPtr write( - const ptree & query); + ASTPtr query); private: const std::string path; diff --git a/dbms/include/DB/Storages/StorageSystemNumbers.h b/dbms/include/DB/Storages/StorageSystemNumbers.h index 906653fff67..38b483897ea 100644 --- a/dbms/include/DB/Storages/StorageSystemNumbers.h +++ b/dbms/include/DB/Storages/StorageSystemNumbers.h @@ -34,7 +34,7 @@ public: SharedPtr read( const Names & column_names, - const ptree & query, + ASTPtr query, size_t max_block_size = DEFAULT_BLOCK_SIZE); }; diff --git a/dbms/src/Storages/StorageLog.cpp b/dbms/src/Storages/StorageLog.cpp index 2555745f396..ed96809e428 100644 --- a/dbms/src/Storages/StorageLog.cpp +++ b/dbms/src/Storages/StorageLog.cpp @@ -94,7 +94,7 @@ StorageLog::StorageLog(const std::string & path_, const std::string & name_, Sha SharedPtr StorageLog::read( const Names & column_names, - const ptree & query, + ASTPtr query, size_t max_block_size) { return new LogBlockInputStream(max_block_size, column_names, *this); @@ -102,7 +102,7 @@ SharedPtr StorageLog::read( SharedPtr StorageLog::write( - const ptree & query) + ASTPtr query) { return new LogBlockOutputStream(*this); } diff --git a/dbms/src/Storages/StorageSystemNumbers.cpp b/dbms/src/Storages/StorageSystemNumbers.cpp index 488d1eb0dfc..52f27b02f93 100644 --- a/dbms/src/Storages/StorageSystemNumbers.cpp +++ b/dbms/src/Storages/StorageSystemNumbers.cpp @@ -40,7 +40,7 @@ Block NumbersBlockInputStream::read() SharedPtr StorageSystemNumbers::read( - const Names & column_names, const ptree & query, size_t max_block_size) + const Names & column_names, ASTPtr query, size_t max_block_size) { if (column_names.size() != 1) throw Exception("Incorrect number of columns.", ErrorCodes::INCORRECT_NUMBER_OF_COLUMNS);