2017-07-14 19:58:25 +08:00
|
|
|
#include <glog/logging.h>
|
|
|
|
#include "communication/result_stream_faker.hpp"
|
|
|
|
#include "query/exceptions.hpp"
|
Flags cleanup and QueryEngine removal
Summary:
I started with cleaning flags up (removing unused ones, documenting undocumented ones). There were some flags to remove in `QueryEngine`. Seeing how we never use hardcoded queries (AFAIK last Mislav's testing also indicated they aren't faster then interpretation), when removing those unused flags the `QueryEngine` becomes obsolete. That means that a bunch of other stuff becomes obsolete, along with the hardcoded queries. So I removed it all (this has been discussed and approved on the daily).
Some flags that were previously undocumented in `docs/user_technical/installation` are now documented. The following flags are NOT documented and in my opinion should not be displayed when starting `./memgraph --help` (@mferencevic):
```
query_vertex_count_to_expand_existsing (from rule_based_planner.cpp)
query_max_plans (rule_based_planner.cpp)
```
If you think that another organization is needed w.r.t. flag visibility, comment.
@teon.banek: I had to remove some stuff from CMakeLists to make it buildable. Please review what I removed and clean up if necessary if/when this lands. If the needed changes are minor, you can also comment.
Reviewers: buda, mislav.bradac, teon.banek, mferencevic
Reviewed By: buda, mislav.bradac
Subscribers: pullbot, mferencevic, teon.banek
Differential Revision: https://phabricator.memgraph.io/D825
2017-09-22 22:17:09 +08:00
|
|
|
#include "query/interpreter.hpp"
|
2017-07-14 19:58:25 +08:00
|
|
|
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
|
|
|
|
DECLARE_int32(query_execution_time_sec);
|
|
|
|
|
|
|
|
TEST(TransactionTimeout, TransactionTimeout) {
|
|
|
|
FLAGS_query_execution_time_sec = 3;
|
2017-10-30 17:43:25 +08:00
|
|
|
GraphDb db;
|
Flags cleanup and QueryEngine removal
Summary:
I started with cleaning flags up (removing unused ones, documenting undocumented ones). There were some flags to remove in `QueryEngine`. Seeing how we never use hardcoded queries (AFAIK last Mislav's testing also indicated they aren't faster then interpretation), when removing those unused flags the `QueryEngine` becomes obsolete. That means that a bunch of other stuff becomes obsolete, along with the hardcoded queries. So I removed it all (this has been discussed and approved on the daily).
Some flags that were previously undocumented in `docs/user_technical/installation` are now documented. The following flags are NOT documented and in my opinion should not be displayed when starting `./memgraph --help` (@mferencevic):
```
query_vertex_count_to_expand_existsing (from rule_based_planner.cpp)
query_max_plans (rule_based_planner.cpp)
```
If you think that another organization is needed w.r.t. flag visibility, comment.
@teon.banek: I had to remove some stuff from CMakeLists to make it buildable. Please review what I removed and clean up if necessary if/when this lands. If the needed changes are minor, you can also comment.
Reviewers: buda, mislav.bradac, teon.banek, mferencevic
Reviewed By: buda, mislav.bradac
Subscribers: pullbot, mferencevic, teon.banek
Differential Revision: https://phabricator.memgraph.io/D825
2017-09-22 22:17:09 +08:00
|
|
|
query::Interpreter interpreter;
|
2017-07-14 19:58:25 +08:00
|
|
|
{
|
|
|
|
ResultStreamFaker stream;
|
2017-10-30 17:43:25 +08:00
|
|
|
GraphDbAccessor dba(db);
|
|
|
|
interpreter.Interpret("MATCH (n) RETURN n", dba, stream, {}, false);
|
2017-07-14 19:58:25 +08:00
|
|
|
}
|
|
|
|
{
|
|
|
|
ResultStreamFaker stream;
|
2017-10-30 17:43:25 +08:00
|
|
|
GraphDbAccessor dba(db);
|
2017-07-14 19:58:25 +08:00
|
|
|
std::this_thread::sleep_for(std::chrono::seconds(5));
|
2017-10-10 00:09:28 +08:00
|
|
|
ASSERT_THROW(
|
2017-10-30 17:43:25 +08:00
|
|
|
interpreter.Interpret("MATCH (n) RETURN n", dba, stream, {}, false),
|
2017-10-10 00:09:28 +08:00
|
|
|
query::HintedAbortError);
|
2017-07-14 19:58:25 +08:00
|
|
|
}
|
|
|
|
{
|
|
|
|
ResultStreamFaker stream;
|
2017-10-30 17:43:25 +08:00
|
|
|
GraphDbAccessor dba(db);
|
|
|
|
interpreter.Interpret("MATCH (n) RETURN n", dba, stream, {}, false);
|
2017-07-14 19:58:25 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
google::InitGoogleLogging(argv[0]);
|
|
|
|
::testing::InitGoogleTest(&argc, argv);
|
|
|
|
return RUN_ALL_TESTS();
|
|
|
|
}
|