data: Format NULL as NULL and never quote it.
The idea, previously, was to make NULL values easily identifiable in all
messages but the focus really is on the JSON output which supports a real null
value.
The idea, previously, was to make NULL values easily identifiable in all
messages but the focus really is on the JSON output which supports a real null
value.
store: Let NULL values never match a regex.
store: Removed sdb_store_matcher_tostring().
This function was mainly used for debugging and more verbose error messages
upon test failures. Given that we have more fine-grained tests now, keeping
the tostring() methods up-to-date is rather annoying but for little benefit.
Instead, we should have a real pretty-printer or similar at some point.
This function was mainly used for debugging and more verbose error messages
upon test failures. Given that we have more fine-grained tests now, keeping
the tostring() methods up-to-date is rather annoying but for little benefit.
Instead, we should have a real pretty-printer or similar at some point.
frontend/grammar: Unified field and attribute value matchers.
Use generic expressions and the new compare matchers instead.
As a side-effect of this change, not-operators (!=, etc.) no longer match on
NULL values (attribute does not exist). This is intended and should have been
like this in the first place (we've got 'IS NULL' for that purpose). For
example, `attribute['foo'] != 123' did previously match if attribute 'foo' did
not exist but now this is no longer the case.
Use generic expressions and the new compare matchers instead.
As a side-effect of this change, not-operators (!=, etc.) no longer match on
NULL values (attribute does not exist). This is intended and should have been
like this in the first place (we've got 'IS NULL' for that purpose). For
example, `attribute['foo'] != 123' did previously match if attribute 'foo' did
not exist but now this is no longer the case.
store: Let compare matchers fail if any of the operands is NULL.
t/: Let tests use '<expr> IN .backend'.
frontend/grammar: Added support for the IN operator.
This is a matcher checking if a value is included in an array. It's mostly
meant to be used to match backends at the moment.
This is a matcher checking if a value is included in an array. It's mostly
meant to be used to match backends at the moment.
store: Added sdb_store_in_matcher().
This function creates a matcher which matches if the right value evaluates to
an array value and the left value is included in that array.
This function creates a matcher which matches if the right value evaluates to
an array value and the left value is included in that array.
data: Added sdb_data_inarray().
The function determines whether a value is included in an array.
The function determines whether a value is included in an array.
store: Added support for querying the BACKEND field.
… returning an array of strings.
… returning an array of strings.
data: Added support for comparing integer, decimal, and string arrays.
Array comparison works element-by-element, returning how the first non-equal
elements compare to each other.
Added tests for array comparison and concatenation.
Array comparison works element-by-element, returning how the first non-equal
elements compare to each other.
Added tests for array comparison and concatenation.
data_test: Use int64_t instead of int for integer array data.
data: Fixed length of newly allocated array in concat().
data: Added basic support for arrays.
An array may contain elements of one type and it's stored in compact raw form
(as in: not an array of union values but an array of the actual values).
'copy', 'free', and 'concat' operations are currently supported but limited to
integer, decimal, or string element types. ENOTSUP is returned for any other
operations.
An array may contain elements of one type and it's stored in compact raw form
(as in: not an array of union values but an array of the actual values).
'copy', 'free', and 'concat' operations are currently supported but limited to
integer, decimal, or string element types. ENOTSUP is returned for any other
operations.
data_test: Removed unnecessary and possibly misleading checks.
data: Use if-statements rather than switch-statements.
data: Added sdb_data_sizeof().
This function returns the size of the data-type for a given type.
This function returns the size of the data-type for a given type.
store: Clarify behavior of expr_attrvalue if the attribute does not exist.
frontend/grammar: Fixed parsing of 'attribute[<string>]'.
That is, don't accept anything besides the string "attribute". Previously,
<anything>[<string>] was accepted as an attribute value.
That is, don't accept anything besides the string "attribute". Previously,
<anything>[<string>] was accepted as an attribute value.
frontend/grammar: Make IS NULL operators available to any expression.
store: Return NULL if an attribute was not found.
data: Added explicit NULL values.
… and let all expressions involving NULL values to return NULL.
… and let all expressions involving NULL values to return NULL.
data: Let CONCAT return NULL if any of its operands is NULL.
This mimics behavior in SQL and also allows for missing values to be reported
as NULL and propagate that information.
This mimics behavior in SQL and also allows for missing values to be reported
as NULL and propagate that information.
frontend/grammar: Use strings to access attribute value: attribute['name'].
store, frontend: Make IS (NOT) NULL an unary operator on expressions.
This is more flexible and in-line with all other operators being migrated to
expression-based constructs.
This is more flexible and in-line with all other operators being migrated to
expression-based constructs.
parser_test: Added various arithmetic expressions to the expr parser test.
Added tests for sdb_fe_parse_expr() and fixed the implementation.
That is, fixed a typo preventing the parsed expression from being returned and
fixed memory leaks in the matcher and expression parsers.
That is, fixed a typo preventing the parsed expression from being returned and
fixed memory leaks in the matcher and expression parsers.
frontend/parser: Made clear that parser modes are flags.
It doesn't make a difference so far, but will avoid problems in the future.
It doesn't make a difference so far, but will avoid problems in the future.
frontend/grammar: Added a destructor for data objects.
frontend/parser: Don't override fields of unknown types.
frontend: Added sdb_fe_parse_expr().
This function enables a special new parser mode in which it only accepts
simple expressions.
This function enables a special new parser mode in which it only accepts
simple expressions.
frontend: Renamed CONNECTION_EXPR to CONNECTION_MATCHER.
That's more specific.
That's more specific.
store: Added sdb_store_parse_matcher_op().
This function parses the string representation of an operator and returns a
constructor for the respective matcher.
This function parses the string representation of an operator and returns a
constructor for the respective matcher.
data: Don't free memory before using it for the last time.
store: Added not-equal and not-regex matchers.
store: Added support for regex matchers.
A regex matcher matches the string value an expression evaluates to against a
regular expression. Dynamic regular expressions are supported as well through
expressions evaluating to a string which is then dynamically compiled into a
regular expression when executing the matcher.
A regex matcher matches the string value an expression evaluates to against a
regular expression. Dynamic regular expressions are supported as well through
expressions evaluating to a string which is then dynamically compiled into a
regular expression when executing the matcher.
data: Let sdb_data_parse() support inline casts from string to other types.
store: Added child matchers.
A child matcher matches an object's children of a certain type. It applies
another matcher to all children and matches if any of the children matches.
A child matcher matches an object's children of a certain type. It applies
another matcher to all children and matches if any of the children matches.
store: Added matchers comparing two expressions.
This is much more powerful than the old conditional matchers and will replace
those once all code has been migrated to the new compare matchers.
This is much more powerful than the old conditional matchers and will replace
those once all code has been migrated to the new compare matchers.
store: Apply filters when evaluating attribute values or expressions.
frontend/grammar: Added (limited) support for attribute values in expressions.
This is not fully supported yet as expressions may not be used in all places
yet.
This is not fully supported yet as expressions may not be used in all places
yet.
store: Added sdb_store_expr_attrvalue().
This function allows to use attribute values in an expression.
This function allows to use attribute values in an expression.
store: Added sdb_store_get_attr().
store: sdb_store_get_field: Make result parameter optional.
t/cibuild.sh: Use 'make -j10' to run tests in parallel.
integration tests: Split simple_query into query, matching, and filter.
integration tests: Make sure test_lib always knows about the socket file.
frontend/parser: Added support for string concatenation.
frontend/grammary.y: Renamed 'op' to 'cmp'.
That's a better name ;-)
That's a better name ;-)
data: Added sdb_data_parse_op().
This function parses the string representation of an operator.
This function parses the string representation of an operator.
store: Added quaryable field ‘name’.
data: Document that regexes are extended, case-insensitive POSIX regexes.
data: Added support for a "regex" data-type.
This type may be used to store the raw and compiled regex in a datum and use
regexes in all places in which a generic value may be used. It does not
support any arithmetic or concatenation operations.
This type may be used to store the raw and compiled regex in a datum and use
regexes in all places in which a generic value may be used. It does not
support any arithmetic or concatenation operations.
data_test: Fixed name/order of the cmp() and strcmp() tests.
;-)
;-)
data_test: Fixed a typo.
data: Fixed copying of NULL data.
version-gen.sh: Added .git suffix to default version again.
Release SysDB 0.5.0.
ReleaseNotes: Added entry for the 0.5.0 release.
t/valgrind.suppress: Use a pattern for the full name of gcov_exit.
For example, I've seen gcov_exit.part.5.
For example, I've seen gcov_exit.part.5.
sysdbql(7): Fixed an incomplete sentence.
sysdbql(7): Updated documentation for attribute and field access.
frontend/grammar: Use '.' instead of ':' to access queryable object fields.
frontend/grammar: Access attribute values using attributes[<name>].
… instead of attribute.<name>. We'll use <obj>.<field> for all directly
accessible object fields instead.
… instead of attribute.<name>. We'll use <obj>.<field> for all directly
accessible object fields instead.
store_lookup: Compare attribute string values on type mismatch.
Given that we don't support any schema for attribute values, this sounds like
a better option than assuming that those values never match no matter which
comparison operator is used.
Given that we don't support any schema for attribute values, this sounds like
a better option than assuming that those values never match no matter which
comparison operator is used.
data: Added sdb_data_strcmp().
This function compares the string values of two data points.
This function compares the string values of two data points.
data: Use %g format when formatting decimal numbers.
This is much better human-readable and we don't need an exact representation.
In fact, given that a datum's string value is used when comparing attribute
values, the human readable format is much better suited given that chances are
higher that users will enter numbers in the same format (but it's still just a
best guess kind of thing).
This is much better human-readable and we don't need an exact representation.
In fact, given that a datum's string value is used when comparing attribute
values, the human readable format is much better suited given that chances are
higher that users will enter numbers in the same format (but it's still just a
best guess kind of thing).
data: Added sdb_data_isnull().
The function determines if a datum pointer or a string or binary datum is
NULL.
The function determines if a datum pointer or a string or binary datum is
NULL.
data: Format NULL values as "<NULL>".
store_lookup: Fixed lookup by back-end name.
Added an integration test which reproduces the problem -- previously, all
compare operations reported a mismatch.
Added an integration test which reproduces the problem -- previously, all
compare operations reported a mismatch.
data: Ensure a stable ordering in cmp() in case of type-mismatches.
So far, this doesn't make a difference but it's better style anyway.
So far, this doesn't make a difference but it's better style anyway.
store_lookup: Fixed parsing of invalid compare expressions.
Previously, expressions like 'host.foo != 123' would be silently accepted by
the parser.
Added test cases to reproduce and catch the problem.
Previously, expressions like 'host.foo != 123' would be silently accepted by
the parser.
Added test cases to reproduce and catch the problem.
utils dbi: Guard against multiple calls to dbi_shutdown_r().
This should not happen anyway but better be safe than sorry.
This should not happen anyway but better be safe than sorry.
object: Assert that object's are not free'd multiple times.
Else, we'd access free'd memory when trying to do so.
Else, we'd access free'd memory when trying to do so.
frontend/proto.h: Improved documentation of all message types.
frontend, proto: Include object type in FETCH and LOOKUP messages.
The respective commands only support hosts at the moment but this change
prepares the wire-format to support other types as well.
The respective commands only support hosts at the moment but this change
prepares the wire-format to support other types as well.
ReleaseNotes: Fixed date of the 0.2.0 release.
sysdbql(7): Fixed example LIST output.
When querying services/metrics skip hosts without such children.
This takes into account any filters and, thus, might mean that filters have to
be evaluated multiple times: once for determining if there are any children
and then again while serializing the data. This is because filtering happens
during serialization at which point it's too late to skip a host.
This takes into account any filters and, thus, might mean that filters have to
be evaluated multiple times: once for determining if there are any children
and then again while serializing the data. This is because filtering happens
during serialization at which point it's too late to skip a host.
sysdbql(7): Use “SysQL” as the official abbreviation.
This is to avoid that people will call it “SQL”. Thanks to Julian Hein (and
others) for suggesting this.
This is to avoid that people will call it “SQL”. Thanks to Julian Hein (and
others) for suggesting this.
sysdbql(7): Updated documentation for the LIST command.
frontend/grammar: Added support for LISTing services and metrics.
store: Added a helper function to parse object type names.
frontend: Added support for LISTing services and metrics as well.
When listing objects other than hosts, the returned JSON list will include the
respective type listed below each host object.
When listing objects other than hosts, the returned JSON list will include the
respective type listed below each host object.
frontend: Use sdb_proto_get_int() instead of a custom helper.
ReleaseNotes: Fixed a typo.
store: Fixed JSON for serialized time-series.
Each field needs a name, add the name to the "data" field.
Each field needs a name, add the name to the "data" field.
store: Don't wrap JSON serialized LIST replies in a separate object.
Previously, the reply was {"hosts": [<list>]} while now it's just the list.
This way, the response format matches that of other commands which return host
lists.
Previously, the reply was {"hosts": [<list>]} while now it's just the list.
This way, the response format matches that of other commands which return host
lists.
utils strbuf: Exponentially increase the buffer size.
That'll make sure that lots of small writes don't result in lots of memory
reallocations.
That'll make sure that lots of small writes don't result in lots of memory
reallocations.
utils strbuf: Added 'min_size' to be considered when shrinking the buffer.
It's set to the initial size of the buffer (or 64). The idea is that the
initial size should provide an estimate of a reasonable size and shrinking the
buffer below that size causes unecessary churn.
For example, this is important for the frontend's command handlers which
usually need a large buffer size but initial writes to the buffer may be
small.
It's set to the initial size of the buffer (or 64). The idea is that the
initial size should provide an estimate of a reasonable size and shrinking the
buffer below that size causes unecessary churn.
For example, this is important for the frontend's command handlers which
usually need a large buffer size but initial writes to the buffer may be
small.
utils strbuf: Renamed buffer variables from 'strbuf' to 'buf'.
frontend, sysdb: Correctly handle empty queries.
Let the frontend send back a DATA message even on empty queries to make sure
the client sees the expected reply.
Let sysdb handle empty replies correctly and also not print any errors on
empty replies (successful command not returning any data).
Let the frontend send back a DATA message even on empty queries to make sure
the client sees the expected reply.
Let sysdb handle empty replies correctly and also not print any errors on
empty replies (successful command not returning any data).
frontend/proto: Include the log priority in LOG messages.
The priority is encoded as 32 bit integer in network byte order and added as a
separate field before the actual log message.
The 'sysdb' client now handles LOG messages accordingly and prefixes the
message with a string describing the priority.
The priority is encoded as 32 bit integer in network byte order and added as a
separate field before the actual log message.
The 'sysdb' client now handles LOG messages accordingly and prefixes the
message with a string describing the priority.
frontend/proto: Let CONNECTION_DATA not replace CONNECTION_ERROR.
Instead, reserve some space for groups of status/state codes and then use a
new number / block for CONNECTION_DATA.
Instead, reserve some space for groups of status/state codes and then use a
new number / block for CONNECTION_DATA.
frontend, proto: Include the response data type in query replies.
For that purpose, use the newly added CONNECTION_DATA status instead of
CONNECTION_OK for query replies and include the data type as the first field
in the message body. The type is the same as the respective command type.
For that purpose, use the newly added CONNECTION_DATA status instead of
CONNECTION_OK for query replies and include the data type as the first field
in the message body. The type is the same as the respective command type.
strbuf utils: Clarified handling of binary data.
proto: Fixed/clarified authentication handshake options during startup.
The server may request further authentication information from the client
before sending an OK status.
The server may request further authentication information from the client
before sending an OK status.
ReleaseNotes: Added some notes about compatibility.
That is, mention that there are no compatibility guarantees at the moment (pre
1.0 versions).
That is, mention that there are no compatibility guarantees at the moment (pre
1.0 versions).
frontend: Guarantee that no async messages are sent before startup finished.
version-gen.sh: Added .git suffix to default version again.