diff --git a/src/backends/postgresql/locate.cpp b/src/backends/postgresql/locate.cpp index 82d26ed..259f5c7 100644 --- a/src/backends/postgresql/locate.cpp +++ b/src/backends/postgresql/locate.cpp @@ -18,6 +18,7 @@ #include "locate.hpp" #include "dindexer-machinery/recorddata.hpp" #include "pq/connection.hpp" +#include "query_count_limit.hpp" #include "dindexer-machinery/tiger.hpp" #include #include @@ -26,7 +27,7 @@ namespace dindb { namespace { - const int g_max_results = 200; + const int g_max_results = g_query_count_limit; std::vector sets_result_to_vec (pq::ResultSet&& parResult) { using boost::lexical_cast; diff --git a/src/backends/postgresql/navigate.cpp b/src/backends/postgresql/navigate.cpp index 9b23e42..43af1f2 100644 --- a/src/backends/postgresql/navigate.cpp +++ b/src/backends/postgresql/navigate.cpp @@ -18,6 +18,7 @@ #include "navigate.hpp" #include "pq/connection.hpp" #include "helpers/infix_iterator.hpp" +#include "query_count_limit.hpp" #include #include #include @@ -27,7 +28,7 @@ namespace dindb { namespace { - const uint32_t g_files_query_limit = 500; + const uint32_t g_files_query_limit = g_query_count_limit; std::ostream& operator<< (std::ostream& parOut, const std::vector& parCols) { parOut << '"'; diff --git a/src/backends/postgresql/query_count_limit.hpp b/src/backends/postgresql/query_count_limit.hpp new file mode 100644 index 0000000..193fa91 --- /dev/null +++ b/src/backends/postgresql/query_count_limit.hpp @@ -0,0 +1,25 @@ +/* Copyright 2015, 2016, Michele Santullo + * This file is part of "dindexer". + * + * "dindexer" is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * "dindexer" is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with "dindexer". If not, see . + */ + +#ifndef id367C9335A3444BC0846EF4E2A27AB9A9 +#define id367C9335A3444BC0846EF4E2A27AB9A9 + +namespace dindb { + constexpr const uint32_t g_query_count_limit = 500; +}; + +#endif