Skip to content

Commit

Permalink
Fixed BTS-408 (#14518)
Browse files Browse the repository at this point in the history
* backport of #14513

* added derived files

Co-authored-by: Vadim <vadim@arangodb.com>
  • Loading branch information
jsteemann and KVS85 committed Jul 28, 2021
1 parent 6e1b835 commit 15147c2
Show file tree
Hide file tree
Showing 9 changed files with 328 additions and 337 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
v3.8.1 (XXXX-XX-XX)
-------------------

* Fixed BTS-408: treat positive or negative signed numbers as constants
immediately during AQL query parsing.
Previously, a value of `-1` was parsed initially as `unary minus(value(1))`,
which was not treated in the same way as a constant value `value(-1)`.
The value was later optimized to just `value(-1)`, but this only happened
during constant-folding after parsing. Any operations that referred to the
unfolded values during parsing thus did not treat such values as constants.

* Fix startup issues with encryption-at-rest enabled when there were empty (0
byte) RocksDB WAL files present. Such empty files caused RocksDB to abort the
startup, reporting corruption. However, empty WAL files are possible in case
Expand Down
10 changes: 5 additions & 5 deletions arangod/Aql/Ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ class Ast {
/// isValid is set to false, then the returned value is not to be trued and the
/// the result is equivalent to an AQL `null` value
static AstNode const* resolveConstAttributeAccess(AstNode const*, bool& isValid);

/// @brief optimizes the unary operators + and -
/// the unary plus will be converted into a simple value node if the operand
/// of the operation is a constant number
AstNode* optimizeUnaryOperatorArithmetic(AstNode*);

private:
/// @brief make condition from example
Expand All @@ -496,11 +501,6 @@ class Ast {
/// @brief create a number node for an arithmetic result, double
AstNode* createArithmeticResultNode(double);

/// @brief optimizes the unary operators + and -
/// the unary plus will be converted into a simple value node if the operand
/// of the operation is a constant number
AstNode* optimizeUnaryOperatorArithmetic(AstNode*);

/// @brief optimizes the unary operator NOT with a non-constant expression
AstNode* optimizeNotExpression(AstNode*);

Expand Down
Loading

0 comments on commit 15147c2

Please sign in to comment.