Commit Graph

577 Commits

Author SHA1 Message Date
Teon Banek
333861e7e9 Generate flags for PlanCompiler via cmake
Summary:
Add join function to functions.cmake

This is a convenience function which will join a list of values by
replacing ';' with the given separator.

cmake: Add fetching compile flags in gcc format

This is a utility function which takes all target compilation flags that
can be passed to gcc or clang.

Generate flags for PlanCompiler via cmake

Cmake will now collect all compiler options and definitions which are
then stored in a generated `query/plan_compiler.hpp`. The generated file
is not tracked by git and is stored inside cmake's build directory. The
file is fast to generate and may change often depending on the build
type.

Additionally, link and include directories are also generated as
absolute paths. In the future, we may want to support relative paths so
that copying/installing the build dir creates runnable binaries.

Add -Wall flag for all build types

Lowercase #pragma once in tests for network_common

It seems 'once' may be case sensitive, since clang outputs a warning for
it that the pragma is unknown.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D107
2017-03-10 18:21:31 +01:00
Teon Banek
9dada557a3 Add coverage option to cmake
Summary:
Coverage is by default set to OFF, but the new option can be used for convenient
toggle when building.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D109
2017-03-10 18:05:15 +01:00
Mislav Bradac
4bcee620bc Change clique to use in64_t
Summary: Fix int -> int64_t in query_stripper

Reviewers: teon.banek, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D108
2017-03-10 13:58:02 +01:00
Mislav Bradac
725ebd1a0e int -> int64_t in in Typed and PropertyValue
Reviewers: buda, mferencevic

Reviewed By: buda, mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D106
2017-03-09 11:44:10 +01:00
Dominik Gleich
09dbe2e722 Include stderr so logger output can be surpressed during tests.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D102
2017-03-09 10:09:58 +01:00
Dominik Gleich
b4d88ddcde Dynamic lib seems to be unloading normally now.
Turning it on again so if something breaks in the future because of it I'll investigate.

Summary:
Merge branch 'dev' into dynamic_lib_add

Merge branch 'dev' into dynamic_lib_add

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D99
2017-03-08 18:47:16 +01:00
Dominik Gleich
ca4ab42973 Supress intentional unused variable warning in for loop.
Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D101
2017-03-08 17:13:48 +01:00
Dominik Gleich
97aa4b92e1 Static bitset with tests created.
Summary:
After manual merge of dev.

Merge branch 'dev' into separate_bitset

Include bitset in template.

Merge branch 'dev' into separate_bitset

Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D97
2017-03-08 17:13:20 +01:00
florijan
971e006d13 Query stripping now uses a parse tree and differentiates between int literals in a range expression (not stripped) and outside of a range (stripped).
Summary: See above

Reviewers: buda, mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D98
2017-03-08 14:19:55 +01:00
Mislav Bradac
00d818c762 Implement expression code generator
Summary: Work in progress, this is not usable yet

Reviewers: florijan

Reviewed By: florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D84
2017-03-08 14:10:16 +01:00
Teon Banek
47ed127086 Generate openCypher parser sources if missing
Summary:
Makes cmake aware that parser source files are generated, so that it can
know how to set the dependencies for the underlying build tool. When the
files do not exist, invoking e.g. `make` will also run antlr to generate
them. Files will be regenerated only if their dependency changed
(Cypher.g4 file in this case).

Reviewers: buda, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D94
2017-03-08 09:31:21 +01:00
Marko Budiselic
b834cdc94a memgraph coverage (lcov setup in progress...)
Summary: first version of coverage (will be polished)

Reviewers: dgleich, mferencevic, florijan, teon.banek

Reviewed By: dgleich

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D76
2017-03-07 18:27:03 +01:00
Dominik Gleich
57740bcf95 Fix bug -db_accessor passed along as &
Summary: Db_accessor is tied to one transaction, and as such each query should work on seperate db_accessor.

Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D96
2017-03-07 15:55:56 +01:00
Dominik Gleich
8e1a897b7a Fix query integration test because of config. Fix hardcoded queries not working because of include bug.
Summary:
#1 Hardcoded query integration test was failling because the .so files couldn't be linked, because of wrong compiled directory path (missing config flag).
#2 Hardcoded query not working in production because typed_value changed so some includes didn't work.

Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D90
2017-03-07 12:37:30 +01:00
Teon Banek
e94969000a Block in-source builds and add clean_all target
Summary:
Add detecting and blocking in-source builds

A simple cmake function, which detects if the source and build dir are
one and the same. This unfortunately does not catch the case when the
build dir is inside the source dir, since we actually want to support
that. For example, creating a 'build' directory inside the project
source directory should be allowed.

Add a clean_all custom target in cmake

This target will clean all the files inside the build directory. It
should be used with care!

A new cmake module is created, since invoking cmake -E remove_directory
will delete the directory and we want to keep it. This way, we also
avoid using platform specific shell command, i.e `rm -rf` and we can
make clean_all smarter in the future.

Untrack build/.gitignore from git

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D92
2017-03-07 10:00:47 +01:00
Dominik Gleich
57f1b40d8d Refactor transaction inside db_accessor. Also introduce advance_command.
Summary:
Modification to MVCC - CHECK!

Refactor transaction_read

Add automatic commit/abort functionality to graph_db_accessor.

Fix failing test in graph_db_accessor.

Reviewers: buda, dtomicevic, florijan

Reviewed By: buda, florijan

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D87
2017-03-07 09:42:04 +01:00
Dominik Gleich
91bd7ccfb6 Fix comments in assert.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D93
2017-03-06 18:19:46 +01:00
Matej Ferencevic
58a173c026 Fixed network tests so they can run concurrently.
Reviewers: dgleich

Reviewed By: dgleich

Differential Revision: https://phabricator.memgraph.io/D91
2017-03-06 14:52:25 +01:00
Matej Ferencevic
813a3b9eed Started network refactorization.
Summary:
Moved server and worker from bolt to communication. Started
templatization.

Started removal of Bolt class.

Removed unnecessary files from network.

Converted states to template functions.

Bolt::Session is now a template.

Merge remote-tracking branch 'origin/dev' into mg_refactor_network

Merged bolt_serializer.cpp into hpp.

Removed obsolete include.

Initial version of bolt session unit test.

Uncommented leftover log commands.

Reimplemented io::Socket.

Added client-stress.sh script.

Reviewers: dgleich, buda

Reviewed By: dgleich, buda

Subscribers: pullbot, mferencevic, buda

Differential Revision: https://phabricator.memgraph.io/D64
2017-03-06 13:52:34 +01:00
florijan
38c3c513fa Serialization, record stream refactor in progress. UNSTABLE STATE.
Summary: Bolt record stream refactoring. BOLT STACK IN UNSTABLE STATE. RecordStreamMocker also refactored

Reviewers: buda, dgleich, mferencevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D88
2017-03-03 14:06:40 +01:00
florijan
2aeef25881 Traversal namespace specialization added for real DB primitives
Summary: database/GraphDbAccessor and storage/...Accessor now returns iterators over lazily created Accessors (filtered on visibility). Dependecies and forward declarations reorganized to support new code

Reviewers: buda, teon.banek

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D83
2017-03-03 14:01:01 +01:00
Teon Banek
09cd425daf Set arc.land.onto.default to dev
Summary:
Since all development goes to `dev` branch, this sets the `arc land` to
use `dev` branch as the destination. Typing `arc land` should now behave
the same as `arc land --onto dev`

Note that "arc.land.onto.default" only takes a branch name. The name
will be prepended with remote name, which is `origin` by default. So,
the commit will land by default onto `origin/dev`.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D89
2017-03-03 13:33:45 +01:00
florijan
92aa235a26 traversal/test.hpp contents moved to tests/unit/traversal.cpp
Summary: See above.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot, florijan, buda

Differential Revision: https://phabricator.memgraph.io/D82
2017-03-02 09:22:54 +01:00
Mislav Bradac
1125331649 Add edge and vertex to TypedValue
Summary:
Merge branch 'dev' into mg_full_typed_value

Add Path and Map to TypedValue

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D80
2017-03-01 18:26:56 +01:00
florijan
80c266ce21 Traversal added. Only the core, tests and template specialization is on the way
Summary: See above.

Reviewers: buda, dgleich, mislav.bradac

Reviewed By: buda, dgleich, mislav.bradac

Subscribers: pullbot, mislav.bradac, buda, florijan

Differential Revision: https://phabricator.memgraph.io/D67
2017-03-01 16:45:00 +01:00
Mislav Bradac
ccdffa1d7e Refactor TypedValue to PropertyValue
Summary:
Rename TypedValue to PropertyValue.
Move original TypedValue to query/backend/cpp.
Fix undefined behaviours and memory leaks in PropertyValue.
Add list type to PropertyValue.
Operators and appropriate tests will be revised in following commits.

Fix bugs in TypedValue

Fix bugs in typed value

Reviewers: buda, florijan

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D77
2017-03-01 12:31:47 +01:00
Mislav Bradac
b5274cd139 Reduce number of iterations in fswatcher test
Summary:
Trivial: iterations 10 -> 2. So that unit tests run for less time.
Put flaky warking in test.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D78
2017-03-01 11:24:51 +01:00
Marko Budiselic
082465ff15 For each hardcoded query plan there is a build target -> that will improve Memgraph's testability + update of release script (release/alpha.sh)
Summary: For each hardcoded query plan there is a build target -> that will improve Memgraph's testability + update of release script (release/alpha.sh)

Reviewers: florijan, mislav.bradac, mferencevic, dgleich

Reviewed By: dgleich

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D75
2017-02-28 19:00:59 +01:00
Dominik Gleich
f6529cd4c3 Clique #1 and #2 works.
Summary:
Merge branch 'dev' into clique_1

Started implementing clique.

Merge branch 'dev' into clique_1

Add multilne query reload.

Clique 1# implementation.

Merge branch 'dev' into clique_1

Clique #1 and #2 implemented.

Add delete all query. Remove unique from clique.

Reviewers: florijan, mislav.bradac, buda

Reviewed By: florijan, mislav.bradac, buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D73
2017-02-28 12:51:40 +01:00
Marko Budiselic
7e3eab7596 default relative commit and default reviewers were added
Summary: default relative commit and default reviewers were added

Reviewers: mislav.bradac, mferencevic, florijan, dgleich

Reviewed By: mislav.bradac

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D65
2017-02-27 23:54:33 +01:00
Marko Budiselic
a32b2831e5 copy hardcoded queries
Summary: copy hardcoded queries

Reviewers: dgleich, mislav.bradac, florijan, mferencevic

Reviewed By: dgleich

Subscribers: buda

Differential Revision: https://phabricator.memgraph.io/D74
2017-02-27 18:26:51 +01:00
Dominik Gleich
1946ab6e07 Update template.
Summary: Delete old implementations. Update template

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D72
2017-02-27 14:12:21 +01:00
Dominik Gleich
e74d9123b1 Fix wrong comparision of property.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D71
2017-02-27 14:12:05 +01:00
Dominik Gleich
be0f9d9796 Fix hardcoded queries to accomodate commit not returing boolean.
Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D69
2017-02-24 13:14:40 +01:00
Dominik Gleich
82414b9111 Fix naming of asserts.runtime_assert & assert -> debug_assert
Summary:
Merge branch 'dev' into rename_assert

Fix new files.

Remove cassert.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D66
2017-02-24 11:41:55 +01:00
Dominik Gleich
af23253e7e Implement less than operator.
Summary:
Add test.

Vertex accessor test checks for sortability.

Reviewers: buda, florijan, mislav.bradac

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D62
2017-02-24 10:10:24 +01:00
Mislav Bradac
ca90f813ad Start implementing compiler structures
Summary:
Merge remote-tracking branch 'origin/dev' into mg_compiler_structs

Merge remote-tracking branch 'origin/dev' into mg_compiler_structs

Implement compiler structures and tests

Reviewers: florijan, buda

Reviewed By: buda

Subscribers: pullbot, florijan, buda

Differential Revision: https://phabricator.memgraph.io/D61
2017-02-23 18:12:24 +01:00
Dominik Gleich
c8ef12910d Add Ccache.
Summary:
Adding ccache option improves each additional build time by a big factor.
Example of performance, modification to a header file:
src/io/network/socket.hpp

without ccache:
	real    0m26.950s
	user    1m18.636s
	sys     0m6.160s
with ccache:
	real    0m10.644s
	user    0m30.616s
	sys     0m4.548s

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D63
2017-02-23 16:53:04 +01:00
Dominik Gleich
8220808f56 Created test case input for Dressipi.
Summary:
Add vertex stream operator. Implement #0, #1 query.

Support first batch of queries for testDB. Improve record stream handler. Query engine now supports multiline queries patterns in file comments.

Second and third batch of tests complete. Add functionality to print_record_stream.

Include 4th batch.

Crete a shared function for properties output.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D60
2017-02-23 15:07:36 +01:00
Marko Budiselic
ede318c2dd Memgraph gmock support has been added
Summary: Memgraph gmock support has been added

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: buda

Differential Revision: https://phabricator.memgraph.io/D59
2017-02-22 16:38:23 +01:00
Marko Budiselic
d1842571d6 Cpp17 support has been added
Summary: Cpp17 support has been added

Reviewers: mferencevic, dgleich, mislav.bradac, florijan

Reviewed By: mislav.bradac

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D57
2017-02-22 14:28:37 +01:00
Mislav Bradac
7a647dffca Add overloads for Code and cast enums explicitly
Summary:
Cast pack::Code enum to byte and size_t where neccessary. g++ is
confused by some of implicit casts when function has different
valid overloads. There is still problem in states/init.cpp but that file
will disappear after bolt is refactored. Next step towards safe code is
to make Code and Rule enum class.

Reviewers: buda, mferencevic

Reviewed By: buda

Subscribers: pullbot, mferencevic, buda

Differential Revision: https://phabricator.memgraph.io/D58
2017-02-22 12:42:22 +01:00
Dominik Gleich
d72383c0af Implement record stream mocker.
Summary:
Begin record stream mocker implementation.

Record stream mocker alongside tests created.

Test Plan: Run record_stream_mocker in tests.

Reviewers: mislav.bradac, florijan, buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D54
2017-02-21 15:50:10 +01:00
Marko Budiselic
30f4e9d47a Futex test execution time was too long
Summary: Futex test execution time was too long

Test Plan: manual

Reviewers: dgleich

Reviewed By: dgleich

Subscribers: pullbot, dgleich, buda

Differential Revision: https://phabricator.memgraph.io/D56
2017-02-21 15:47:15 +01:00
Dominik Gleich
e0f399ac42 Fix manual query engine config and paths.
Test Plan: In progress.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D55
2017-02-21 15:41:44 +01:00
Dominik Gleich
40aa500a88 Improve complexity of union_find, better explain complexity.
Summary:
Old union find implementation was not true about it's complexity.
Take a look at http://www.brpreiss.com/books/opus4/html/page411.html#theoremsetsi.

Test Plan: Run union_find in tests.

Reviewers: mislav.bradac, buda

Reviewed By: mislav.bradac

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D51
2017-02-20 18:57:37 +01:00
Marko Budiselic
2cee2cf480 youcompleteme config has been added to the repo
Summary: youcompleteme config has been added to the repo

Test Plan: manual

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D53
2017-02-20 14:17:41 +01:00
Marko Budiselic
4583d8bde3 antlropencypher + youcompleteme update
Summary: antlropencypher + youcompleteme update

Test Plan: manual

Reviewers: mislav.bradac

Reviewed By: mislav.bradac

Subscribers: pullbot, mislav.bradac, buda

Differential Revision: https://phabricator.memgraph.io/D52
2017-02-20 14:06:25 +01:00
florijan
68f57fa47d CMakeLists cleanup w.r.t. Antlr linking. Removed the unused typed_value_store.cpp
Summary: See above.

Test Plan: Building tested.

Reviewers: buda

Reviewed By: buda

Subscribers: pullbot, buda

Differential Revision: https://phabricator.memgraph.io/D50
2017-02-20 09:43:58 +01:00
Marko Budiselic
fb90394499 A better configuration of cmake & clion 2017-02-20 01:25:57 +01:00