parser/analyzer: Migrate value expression checks.
The new parser and analyzer now pass the full test-suite of frontend/parser.
The new parser and analyzer now pass the full test-suite of frontend/parser.
parser/analyzer: Migrate type and iterator checks.
parser: Add support for analyzing conditional and arithmetic expressions.
Let all parser functions call the respective analyzer. For now, this is only
used to propagate data-type information but it will later ensure a certain
amount of semantical correctness. Note that the new analyzers usually don't
have any context information, so they might accept expressions that are not
right for their later target use case. If that matters, the caller will have
to check again providing the right context.
Let all parser functions call the respective analyzer. For now, this is only
used to propagate data-type information but it will later ensure a certain
amount of semantical correctness. Note that the new analyzers usually don't
have any context information, so they might accept expressions that are not
right for their later target use case. If that matters, the caller will have
to check again providing the right context.
parser: Convert AST op types to data op types when necessary.
parser: Determine the data-type of each node.
For now, we only use this for arithmetic expressions. The field will be
populated by the analyzer.
For now, we only use this for arithmetic expressions. The field will be
populated by the analyzer.
parser: Fixed setup of iterator nodes.
The iterator value was supposed to be an "incomplete operator" node, that is,
one of the operands should be NULL. This is actually the case now and this
also means we don't have to store the operator type separately.
The iterator value was supposed to be an "incomplete operator" node, that is,
one of the operands should be NULL. This is actually the case now and this
also means we don't have to store the operator type separately.
parser/ast: Add some helper defines.
Migrate top-level checks to the new parser/analyzer.
Call the analyzer from sdb_parser_parse().
Call the analyzer from sdb_parser_parse().
parser_test: Make sure that TIMESERIES end times are greater than start times.
parser/grammar: Fix the hostname in a 'FETCH host' node.
Migrate parser from frontend/ to parser/ and to use the AST.
The new parser now returns AST nodes instead of a "compiled" store lookup
operator. The old parser is still in place unmodified and currently still in
use.
The new parser now returns AST nodes instead of a "compiled" store lookup
operator. The old parser is still in place unmodified and currently still in
use.
parser/ast: Introduce a data-structure representing a SysQL AST.
This will be used by the parser in the future.
This will be used by the parser in the future.
frontend/parser: Renamed SDB_PARSE_EXPR to SDB_PARSE_ARITH.
That's a bit more specific ;-)
That's a bit more specific ;-)
build system: Fix VPATH (out-of-tree) builds.
t/cibuild: Ignore missing field initializer warnings for tests.
Old versions of clang and gcc complain about { 0 } initializers even though
they are well defined by C99.
Old versions of clang and gcc complain about { 0 } initializers even though
they are well defined by C99.
query language: Add support for attribute.value access.
analyzer: Improve some error messages.
analyzer: attributes and backends are always iterable, even in filters.
Before, this was not allowed because the execution context for a filter is not
know (generic) and this case was to handled separately.
Before, this was not allowed because the execution context for a filter is not
know (generic) and this case was to handled separately.
store: Added field type VALUE for attribute values.
store: Test get_field() more extensively and fix a small bug.
Use a table-driven test now.
Use a table-driven test now.
Add tests for expression iterators.
store_expr: iterator: Support constant arrays without a stored object.
store_expr: Fix iter_has_next if the first elements are filtered.
data: Let sdb_data_array_get support DATETIME, BINARY, REGEX values.
data: sdb_data_strcmp supports arrays because sdb_data_format supports it.
store: Use iterable expressions for iterators.
Rather than having a separate iterator implementation in store_lookup.
Rather than having a separate iterator implementation in store_lookup.
store: When advancing an iterator don't loop endlessly on filtered objects.
store: Apply iterator expressions to the iterated objects.
store: Advance expression iterators even if array access fails.
Else, we'd have an endless loop as the caller doesn't know about that.
Else, we'd have an endless loop as the caller doesn't know about that.
store: Fixed a memory leak in sdb_store_expr_iter_destroy().
Let iterator operators fill in the left operand of child operators.
This avoids the need for repeating the same operand in two places and better
reflects what's actually going on.
This avoids the need for repeating the same operand in two places and better
reflects what's actually going on.
Let the first operand of ANY/ALL iterators be an expression.
For now, the same restrictions apply as before (iterate child objects or the
backends field). This is in preparation for more generic iterators.
For now, the same restrictions apply as before (iterate child objects or the
backends field). This is in preparation for more generic iterators.
query language: Change iterator syntax to ANY/ALL <iter>.<field> <op> <v>.
That is, make it explicit that iterators access the object name and make it
easier to support other fields as well.
That is, make it explicit that iterators access the object name and make it
easier to support other fields as well.
data: Return the number of bytes that would have been returned.
That is, behave as documented, even if the buffer is NULL or otherwise too
small. Return size_t instead of an integer.
That is, behave as documented, even if the buffer is NULL or otherwise too
small. Return size_t instead of an integer.
data: Let strlen/format handle NULL values correctly.
store: Add support for iterable expressions.
It can be used to iterate through either the list of child nodes or through
arbitrary arrays. An expression is iterable either if it stores / evaluates to
an array or if it's a typed expression evaluated in the context of an object
where the specified type represents child nodes.
It can be used to iterate through either the list of child nodes or through
arbitrary arrays. An expression is iterable either if it stores / evaluates to
an array or if it's a typed expression evaluated in the context of an object
where the specified type represents child nodes.
avltree: Add sdb_avltree_iter_peek_next().
The function returns the next element without advancing the iterator.
The function returns the next element without advancing the iterator.
Allow the left operand of comparison operations to be NULL (initially).
However, when evaluating the expression, the operand has to be set. We'll use
this as a placeholder for inserting values dynamically.
However, when evaluating the expression, the operand has to be set. We'll use
this as a placeholder for inserting values dynamically.
analyzer: Check that all iterators use ary operators.
All iterators are based on a comparison <iter> <op> <expr> and the same
restrictions apply to all of them.
All iterators are based on a comparison <iter> <op> <expr> and the same
restrictions apply to all of them.
frontend/grammar: Fixed format argument used in yyerrorf().
t/integration: Split query.sh into multiple tests.
integration/query.sh: Check that empty commands work fine.
parser_test: Test further error cases and error propagation in the analyzer.
frontend/grammar: Check arithmetic expressions early.
Constant expressions are evaluated early. Thus, creating an expression object
may fail if there's a semantics error. Catch this early and report a (generic)
error to avoid propagating a NULL value.
Constant expressions are evaluated early. Thus, creating an expression object
may fail if there's a semantics error. Catch this early and report a (generic)
error to avoid propagating a NULL value.
sysdbql(7): Document typed expressions.
Add support for the 'NOT IN' operator.
'a NOT IN b' is the same as 'NOT a IN b'.
'a NOT IN b' is the same as 'NOT a IN b'.
parser_test: Test various array expressions.
analyzer: The left operand of IN may be an array as well.
analyzer: Check the data-type of IN operands.
t/: Make it possibly to easily run unit and integration tests separately.
t/coverage.sh: Exclude auto-generated c files.
t/unit/: Create one test binary for each *_test.c file.
That'll allow to run more stuff in parallel or single tests more selectively.
That'll allow to run more stuff in parallel or single tests more selectively.
core/time_test: Converted to "loop" tests.
core/store*_test.c: Converted most tests to "loop" tests.
frontend/parser_test: Convert to "loop" tests.
That'll make sure we'll see the errors of all test cases in one test run.
That'll make sure we'll see the errors of all test cases in one test run.
frontend/query_test.c: Added unit tests for the FETCH commands.
parser_test: Add testcases covering operand type checks.
analyzer: Verify the type of arithmetic operands.
analyzer: Check types of comparison operands.
Merged branch 'master' of git://github.com/sysdb/sysdb.git.
frontend: Fixed a memory leak in an error condition in FETCH.
configure: Make sure that PACKAGE_URL is defined.
autoconf < 2.64 don't support PACKAGE_URL.
Thanks to @faxm0dem for reporting the resulting build error on RHEL6 in #1
autoconf < 2.64 don't support PACKAGE_URL.
Thanks to @faxm0dem for reporting the resulting build error on RHEL6 in #1
Merged branch 'master' of git://git.tokkee.org/sysdb.
Check the return value of write() to satisfy GCC's unused-result checks.
t/valgrind.suppress: Suppress various issues in OpenSSL 1.0.0.
integration/query.sh: Test FETCH with FILTER.
frontend: Fixed hostname in error messages in FETCH.
frontend: Fix a memory leak in an error condition in FETCH.
integration/test_lib.sh: Store the CA serial in $TESTDIR.
frontend: Provide more details in the logs when shutting down a connection.
sysdb: Print the server version after (re)connecting.
frontend: Added the SERVER_VERSION command.
This command sends back the server version.
This command sends back the server version.
proto: Make sdb_proto_marshal_int32 a public function.
sysdbd-store-network(5): Documented the store::network plugin.
version-gen.sh: Added .git suffix to default version again.
Release SysDB 0.7.0.
ReleaseNotes: Set 0.7.0 release date to 2015-02-21.
ReleaseNotes: Added draft for the 0.7.0 release.
store::network: Reconnect after losing the connection to the remote side.
store::network: Added support for SSL configuration options.
ssl utils: During shutdown, destroy mutexes as the last step.
Even ERR_free_strings() may call CRYPTO_lock.
Even ERR_free_strings() may call CRYPTO_lock.
store::network: Use INFO level for an informational message.
ssl: Register OpenSSL thread-ID and locking callbacks.
This is required for multi-threaded applications. Else, they "will crash at
random".
This is required for multi-threaded applications. Else, they "will crash at
random".
SSL utils: Added init() and shutdown() functions for global setup/shutdown.
Use those functions in sysdb and sysdbd instead of calling the OpenSSL
functions directly.
Use those functions in sysdb and sysdbd instead of calling the OpenSSL
functions directly.
valgrind.suppress: Ignore a Memcheck:Cond error in libcrypto.
This happens with the libssl version on Travis.
This happens with the libssl version on Travis.
t/integration/: Added simple SSL tests.
parser_test: Added various tests for STORE commands.
README: Add libssl to prerequisites.
sysdb(1), sysdbd(1): Document client authentication.
sysdb(1), sysdbd(1): Document files used by the tools by default.
sysdb(1): Document SSL related command line options.
sysdbd.conf(5): Document the Listen SSL options.
frontend, client: Properly support IPv6 when handling address strings.
client: Prefix all log messages with "client:".
sysdb: Add -A option to specify a CA certificates file.
Unload all plugins when shutting down sysdbd.
This will destruct all registered user-data objects, thus properly shutting
down all internal plugin state (e.g. connections to other systems).
This will destruct all registered user-data objects, thus properly shutting
down all internal plugin state (e.g. connections to other systems).
collectd::unixsock: Fixed a memory leak happening when unloading the module.
client: Check the remote peer name.
sysdbd-syslog(5): Documented LogLevel configuration option.
plugin: Fixed log message for newly registered config callbacks.