Commit Graph

731 Commits

Author SHA1 Message Date
florijan
c89c65a748 Query::Plan::Aggregate - count edge-case fix
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D270
2017-04-13 08:30:34 +02:00
Dominik Gleich
afbec0a26e Test GarbageCollector in skiplist.
Summary: Tests the skiplist GC.

Reviewers: florijan, mferencevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D145
2017-04-12 17:02:29 +02:00
Teon Banek
596b015e99 Correctly check variables inside property maps
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D271
2017-04-12 16:44:16 +02:00
Mislav Bradac
55ef48c78e Add antlr error description to SyntaxException
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D269
2017-04-12 15:51:21 +02:00
Teon Banek
b69c162c9f Add base QueryException class
Summary:
Also, inherit `TypedValueException` from `BasicException` instead of
`StacktraceException`.

This is meant as a basic API change, so that catching query exceptions becomes
simpler. The error message can be obtained from `what` method, inherited from
`BasicException`. In the future, we may extend the `QueryException`. It could
take column/row position in query source, as well as other information. Then
provide (or override `what`) a method to format the error message nicely for
the user.

Reviewers: florijan, buda, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D267
2017-04-12 15:35:51 +02:00
florijan
ea202dc52a Query::Plan::EdgeFilter bugfix
Summary:
Resolved the bug where edge filters with no edge-types dont accept any edge.
Illustrated with the following queries:
CREATE ()-[]->()
MATCH ()-[]->()
	(produces 0 results, expected 1)

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D265
2017-04-12 13:47:27 +02:00
Teon Banek
355b9a9b9a Plan aggregation in WITH and RETURN clauses
Summary:
Generate symbols for aggregation results.
Plan aggregation in WITH clause.
Plan aggregation in RETURN clause.
Extract handling write clauses to a function.

Reviewers: mislav.bradac, florijan

Reviewed By: mislav.bradac, florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D236
2017-04-12 13:22:23 +02:00
Teon Banek
6cb1cdc607 Raise if setting label/property in CREATE on declared node
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D266
2017-04-12 11:11:27 +02:00
Teon Banek
6ed297e1d9 Remove src/query/util.hpp
Summary:
`query/util.hpp` isn't used anywhere, but in `copy_hardcoded_queries.cpp`. That
file may be removed in the future, but for now it is needed.

Reviewers: mislav.bradac, florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D261
2017-04-12 10:20:59 +02:00
Mislav Bradac
36129cdcae Implement simple function conversion
Reviewers: buda

Reviewed By: buda

Subscribers: florijan, teon.banek

Differential Revision: https://phabricator.memgraph.io/D264
2017-04-11 19:14:08 +02:00
florijan
1273cea870 EdgeAccessor::is_cycle added. Query::Plan::Expand fixed
Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D262
2017-04-11 15:52:01 +02:00
florijan
593e4e72b9 Query::Plan::Aggregate
Summary:
- Aggregation LogicalOperation added, with tests.

- Added capabilities to TypedValue (hash, bool-equality)
to support std::unordered_map<TypedValue>.

- Removed some bad code from utils/hashing/fnv and added
a hashing function for collections.

Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: lion, pullbot

Differential Revision: https://phabricator.memgraph.io/D252
2017-04-11 15:12:06 +02:00
Mislav Bradac
dfa6800edd Add aggregation conversion from antlr to ast
Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D260
2017-04-11 14:55:26 +02:00
florijan
7981bd19e0 Query::Plan - const correctness
Summary:
Made all LogicalOperators const correct.
Fixed one LogicalOperator test.
Added explicit return values to Frame and SymbolTable at and [] methods.

Reviewers: teon.banek

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D259
2017-04-11 14:27:56 +02:00
Mislav Bradac
d92caf1163 Check clauses ordering
Reviewers: buda, florijan, teon.banek

Reviewed By: buda, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D257
2017-04-11 12:30:17 +02:00
Teon Banek
804d0b09b9 Move typed_value to query top level and namespace it
Summary:
Upgraded old uses of TypedValue.
Also, implemented operator<< for EdgeAccessor and VertexAccessor.

Reviewers: buda, florijan, mislav.bradac, mferencevic

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D251
2017-04-11 08:50:46 +02:00
Mislav Bradac
b7ee09785b Implement IS NULL and IS NOT NULL
Reviewers: teon.banek, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D254
2017-04-10 16:55:58 +02:00
Dominik Gleich
fd2780155a Refactor GC to use scheduler.
Reviewers: buda, matej.gradicek

Reviewed By: matej.gradicek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D247
2017-04-10 15:57:45 +02:00
Teon Banek
9855621c9e Fix planning CREATE with expanding a created node
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D253
2017-04-10 15:11:23 +02:00
Teon Banek
7d0958b1a4 Add PreVisit method to utils::Visitor
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D242
2017-04-10 15:03:02 +02:00
Dominik Gleich
e8fd479bbc Fix memory leak. Refactor mvcc. Revert commit function to old and introduce new one.
Summary:
Update tests.

Documentation:
https://phabricator.memgraph.io/w/memgraph_implementation/mvcc/

Reviewers: mislav.bradac, florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D227
2017-04-10 12:16:03 +02:00
Teon Banek
64d0163aad Handle QueryRuntimeException in AM-REPL
Reviewers: florijan

Reviewed By: florijan

Differential Revision: https://phabricator.memgraph.io/D250
2017-04-10 09:13:14 +02:00
Dominik Gleich
aca6b8f38b Fix dead code - and accompanying warnings.
Reviewers: mferencevic, matej.gradicek, mislav.bradac

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D248
2017-04-10 09:11:30 +02:00
Mislav Bradac
7a58ec5afb Fix bug in parenthesized expression
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D249
2017-04-07 18:33:07 +02:00
Matej Ferencevic
db740fb9fc Started working on network hang fix.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot, mislav.bradac

Differential Revision: https://phabricator.memgraph.io/D228
2017-04-07 17:09:58 +02:00
Dominik Gleich
2032466e2a New version of scheduler.
Summary: New scheduler declaration.

Reviewers: matej.gradicek, buda

Reviewed By: matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D246
2017-04-07 11:55:10 +02:00
Dominik Gleich
74740dd162 Fix gradiceks mess.
Summary: Fix fix fix.

Reviewers: matej.gradicek

Reviewed By: matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D245
2017-04-07 10:55:40 +02:00
Matej Ferencevic
22dfe61fe1 Added socket write verification to bolt buffer.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D199
2017-04-07 10:06:55 +02:00
Matej Ferencevic
72f7b64c8f Logger in this test somehow breaks code coverage. Argh...
Reviewers: buda, dgleich

Reviewed By: dgleich

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D240
2017-04-07 09:44:12 +02:00
Teon Banek
984c898cfe init: Add optional & required dependency checking
Reviewers: mferencevic, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D238
2017-04-07 09:27:12 +02:00
Dominik Gleich
ebff4687a1 Default should be the compiler for the test.
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D241
2017-04-06 16:12:55 +02:00
Dominik Gleich
e8fe25bc61 Remove move constructor and delete move =
Reviewers: florijan, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D237
2017-04-06 14:38:48 +02:00
Matej Ferencevic
e5c814e022 First version of new bolt decoder and tests.
Summary:
Extracted constants to codes.hpp.

Extracted bolt constants.

Extracted StreamBuffer and fixed data type.

Extracted bolt testdata.

Added bolt buffer and tests.

Added bolt decoder buffer and tests.

Renamed bolt testdata.

Reviewers: dgleich, buda, matej.gradicek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D220
2017-04-06 14:30:19 +02:00
Teon Banek
aa6cae0b16 Plan WITH clause without aggregation
Summary: Generate symbols for WITH clause.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D231
2017-04-06 14:10:28 +02:00
Dominik Gleich
919258d6f6 Fix integration_engine crash.
Summary:
This should fix the integration query engine test. I'm not exactly sure what caused the SEGFAULT to occur, but from my debugging sessions; I would say, as an educated guess that it's closely related to logger. What I believe happens is that logger gets somehow initialized from the dynamic_library when it's opened. And when the library is closed the corresponding logger is freed, but, other parts of memgraph still see that instance of logger and trying to use to emit code makes the whole thing crash. I've removed one include of logger from something which gets included in the hardcoded queries, but I noticed there are some more.

I've changed the dlopen to now open with DEEPBIND, which should cause symbols to be resolved locally and not globally and stop the logger from the dynamic lib to interfer with the one used in the rest of memgraph.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D234
2017-04-06 11:49:12 +02:00
florijan
feee6ed80e Query::Plan::Aggregate API
Reviewers: mislav.bradac, buda, teon.banek

Reviewed By: mislav.bradac, teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D229
2017-04-06 09:38:24 +02:00
Mislav Bradac
f7f44a3e81 Bug fix in interpreter (dynamic wrong cast type)
Reviewers: buda, florijan

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D233
2017-04-05 18:03:09 +02:00
Dominik Gleich
8c7ed8c186 Add edge_types indexes.
Summary: Refactor label_index. Also add edge_type indexes.

Reviewers: mislav.bradac, florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D217
2017-04-05 17:23:12 +02:00
Mislav Bradac
a0049c9691 Convert With clause from antlr to high level ast
Reviewers: teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D230
2017-04-05 16:22:46 +02:00
florijan
4c73a0a71c Query::Plan::Accumulate[Advance] implementation and test
Summary: see above

Reviewers: teon.banek, buda, mislav.bradac

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D226
2017-04-05 15:04:58 +02:00
matej.gradicek
5243ab00c2 Scheduler and tests.
Reviewers: dgleich, buda

Reviewed By: dgleich, buda

Subscribers: pullbot, matej.gradicek

Differential Revision: https://phabricator.memgraph.io/D213
2017-04-05 08:43:43 +00:00
florijan
263749508c Query::Plan - WITH API
Reviewers: teon.banek, buda

Reviewed By: teon.banek

Differential Revision: https://phabricator.memgraph.io/D224
2017-04-05 10:35:28 +02:00
Teon Banek
b33b671505 Plan multiple MATCH clauses and multiple patterns
Reviewers: mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D218
2017-04-05 09:23:03 +02:00
Mislav Bradac
6112454b08 Throw exception on trailing text in query
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D222
2017-04-04 18:48:55 +02:00
Mislav Bradac
13aafa35cf Fix hardcoded query bug
Reviewers: buda

Reviewed By: buda

Differential Revision: https://phabricator.memgraph.io/D223
2017-04-04 18:47:42 +02:00
Mislav Bradac
a58e269176 Fix bugs needed to run qa tests
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D216
2017-04-04 17:28:08 +02:00
florijan
e2949a88ce Storage::EdgeAccessor::set_edge_type removed
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D221
2017-04-04 16:58:30 +02:00
florijan
9eb4428023 Query::Plan::ScanAll accepts optional input (for cartesian)
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D219
2017-04-04 16:58:05 +02:00
florijan
bffc406662 Query::Plan - ExpansionUniquenessFilter
Reviewers: buda, mislav.bradac, teon.banek

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D214
2017-04-04 12:20:01 +02:00
Teon Banek
c09d237e05 Use doxygen style comments for Visitor and Visitable
Summary: Update the documentation to be picked up by doxygen. Additionally, don't use anonymous namespace in header file.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D212
2017-04-03 16:17:54 +02:00