10000 Fixed BTS-408 (#14518) · arangodb/arangodb@15147c2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 15147c2

Browse files
jsteemannKVS85
andauthored
Fixed BTS-408 (#14518)
* backport of #14513 * added derived files Co-authored-by: Vadim <vadim@arangodb.com>
1 parent 6e1b835 commit 15147c2

File tree

9 files changed

+328
-337
lines changed

9 files changed

+328
-337
lines changed

CHANGELOG

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
v3.8.1 (XXXX-XX-XX)
22
-------------------
33

4+
* Fixed BTS-408: treat positive or negative signed numbers as constants
5+
immediately during AQL query parsing.
6+
Previously, a value of `-1` was parsed initially as `unary minus(value(1))`,
7+
which was not treated in the same way as a constant value `value(-1)`.
8+
The value was later optimized to just `value(-1)`, but this only happened
9+
during constant-folding after parsing. Any operations that referred to the
10+
unfolded values during parsing thus did not treat such values as constants.
11+
412
* Fix startup issues with encryption-at-rest enabled when there were empty (0
513
byte) RocksDB WAL files present. Such empty files caused RocksDB to abort the
614
startup, reporting corruption. However, empty WAL files are possible in case

arangod/Aql/Ast.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ class Ast {
485485
/// isValid is set to false, then the returned value is not to be trued and the
486486
/// the result is equivalent to an AQL `null` value
487487
static AstNode const* resolveConstAttributeAccess(AstNode const*, bool& isValid);
488+
489+
/// @brief optimizes the unary operators + and -
490+
/// the unary plus will be converted into a simple value node if the operand
491+
/// of the operation is a constant number
492+
AstNode* optimizeUnaryOperatorArithmetic(AstNode*);
488493

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

499-
/// @brief optimizes the unary operators + and -
500-
/// the unary plus will be converted into a simple value node if the operand
501-
/// of the operation is a constant number
502-
AstNode* optimizeUnaryOperatorArithmetic(AstNode*);
503-
504504
/// @brief optimizes the unary operator NOT with a non-constant expression
505505
AstNode* optimizeNotExpression(AstNode*);
506506

0 commit comments

Comments
 (0)
0