8000 Merge branch 'devel' of github.com:arangodb/arangodb into devel · archerli/arangodb@d0324b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit d0324b8

Browse files
committed
Merge branch 'devel' of github.com:arangodb/arangodb into devel
2 parents 1aafa1b + 82b0a5e commit d0324b8

File tree

219 files changed

+5885
-5114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

219 files changed

+5885
-5114
lines changed

3rdParty/velocypack/src/Slice.cpp

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int64_t Slice::getSmallIntUnchecked() const noexcept {
114114
// translates an integer key into a string, without checks
115115
Slice Slice::translateUnchecked() const {
116116
uint8_t const* result = Options::Defaults.attributeTranslator->translate(getUIntUnchecked());
117-
if (result != nullptr) {
117+
if (VELOCYPACK_LIKELY(result != nullptr)) {
118118
return Slice(result);
119119
}
120120
return Slice();
@@ -384,9 +384,7 @@ int Slice::compareString(StringRef const& value) const {
384384
int res = memcmp(k, value.data(), compareLength);
385385

386386
if (res == 0) {
387-
if (keyLength != length) {
388-
return (keyLength > length) ? 1 : -1;
389-
}
387+
return static_cast<int>(keyLength - length);
390388
}
391389
return res;
392390
}
@@ -400,9 +398,7 @@ int Slice::compareStringUnchecked(StringRef const& value) const noexcept {
400398
int res = memcmp(k, value.data(), compareLength);
401399

402400
if (res == 0) {
403-
if (keyLength != length) {
404-
return (keyLength > length) ? 1 : -1;
405-
}
401+
return static_cast<int>(keyLength - length);
406402
}
407403
return res;
408404
}
@@ -598,49 +594,42 @@ Slice Slice::searchObjectKeyBinary(StringRef const& attribute,
598594
bool const useTranslator = (Options::Defaults.attributeTranslator != nullptr);
599595
VELOCYPACK_ASSERT(n > 0);
600596

601-
ValueLength l = 0;
602-
ValueLength r = n - 1;
603-
ValueLength index = r / 2;
597+
int64_t l = 0;
598+
int64_t r = static_cast<int64_t>(n) - 1;
599+
int64_t index = r / 2;
604600

605-
while (true) {
601+
do {
606602
ValueLength offset = ieBase + index * offsetSize;
607603
Slice key(_start + readIntegerFixed<ValueLength, offsetSize>(_start + offset));
608604

609605
int res;
610606
if (key.isString()) {
611607
res = key.compareStringUnchecked(attribute.data(), attribute.size());
612-
} else if (key.isSmallInt() || key.isUInt()) {
608+
} else {
609+
VELOCYPACK_ASSERT(key.isSmallInt() || key.isUInt());
613610
// translate key
614611
if (VELOCYPACK_UNLIKELY(!useTranslator)) {
615612
// no attribute translator
616613
throw Exception(Exception::NeedAttributeTranslator);
617614
}
618615
res = key.translateUnchecked().compareString(attribute);
619-
} else {
620-
// invalid key
621-
return Slice();
622-
}
623-
624-
if (res == 0) {
625-
// found. now return a Slice pointing at the value
626-
return Slice(key.start() + key.byteSize());
627616
}
628617

629618
if (res > 0) {
630-
if (index == 0) {
631-
return Slice();
632-
}
633619
r = index - 1;
620+
} else if (res == 0) {
621+
// found. now return a Slice pointing at the value
622+
return Slice(key.start() + key.byteSize());
634623
} else {
635624
l = index + 1;
636625
}
637-
if (r < l) {
638-
return Slice();
639-
}
640626

641627
// determine new midpoint
642628
index = l + ((r - l) / 2);
643-
}
629+
} while (r >= l);
630+
631+
// not found
632+
return Slice();
644633
}
645634

646635
// template instanciations for searchObjectKeyBinary

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
devel
22
-----
33

4+
* Fix config directory handling, so we don't trap into UNC path lookups on windows
5+
46
* Prevent spurious log message "Scheduler queue is filled more than 50% in last x s"
57
from occurring when this is not the case. Due to a data race, the message could
68
previously also occur if the queue was empty.

arangod/Aql/Aggregator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
////////////////////////////////////////////////////////////////////////////////
2323

2424
#include "Aggregator.h"
25+
26+
#include "Aql/AqlValue.h"
2527
#include "Basics/VelocyPackHelper.h"
2628
#include "Transaction/Context.h"
2729
#include "Transaction/Helpers.h"

arangod/Aql/Aggregator.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,22 @@
2424
#ifndef ARANGOD_AQL_AGGREGATOR_H
2525
#define ARANGOD_AQL_AGGREGATOR_H 1
2626

27-
#include "Aql/AqlValue.h"
28-
#include "Basics/Common.h"
29-
30-
#include <velocypack/Slice.h>
27+
#include <functional>
28+
#include <memory>
29+
#include <string>
3130

3231
namespace arangodb {
3332
namespace transaction {
3433
class Methods;
3534
}
35+
namespace velocypack {
36+
class Slice;
37+
}
3638

3739
namespace aql {
3840

41+
struct AqlVa 10000 lue;
42+
3943
struct Aggregator {
4044
Aggregator() = delete;
4145
Aggregator(Aggregator const&) = delete;

arangod/Aql/AllRowsFetcher.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
#include "AllRowsFetcher.h"
2424

2525
#include "Aql/AqlItemBlock.h"
26+
#include "Aql/AqlItemMatrix.h"
2627
#include "Aql/DependencyProxy.h"
2728
#include "Aql/InputAqlItemRow.h"
28-
#include "Aql/SortExecutor.h"
2929

3030
using namespace arangodb;
3131
using namespace arangodb::aql;
@@ -131,3 +131,8 @@ ExecutionState AllRowsFetcher::upstreamState() {
131131
}
132132
return ExecutionState::HASMORE;
133133
}
134+
135+
std::pair<ExecutionState, SharedAqlItemBlockPtr> AllRowsFetcher::fetchBlockForPassthrough(size_t) {
136+
TRI_ASSERT(false);
137+
THROW_ARANGO_EXCEPTION(TRI_ERROR_NOT_IMPLEMENTED);
138+
}

arangod/Aql/AllRowsFetcher.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,21 @@
2323
#ifndef ARANGOD_AQL_ALL_ROWS_FETCHER_H
2424
#define ARANGOD_AQL_ALL_ROWS_FETCHER_H
2525

26-
#include "Aql/AqlItemMatrix.h"
27-
#include "Aql/ExecutionState.h"
26+
#include "Aql/types.h"
2827

28+
#include <Basics/Common.h>
2929
#include <Basics/Exceptions.h>
3030

31+
#include <cstddef>
3132
#include <memory>
3233

3334
namespace arangodb {
3435
namespace aql {
3536

3637
class AqlItemBlock;
38+
class AqlItemMatrix;
39+
class SharedAqlItemBlockPtr;
40+
enum class ExecutionState;
3741
template <bool>
3842
class DependencyProxy;
3943

@@ -74,10 +78,7 @@ class AllRowsFetcher {
7478
// AllRowsFetcher cannot pass through. Could be implemented, but currently
7579
// there are no executors that could use this and not better use
7680
// SingleRowFetcher instead.
77-
std::pair<ExecutionState, SharedAqlItemBlockPtr> fetchBlockForPassthrough(size_t) {
78-
TRI_ASSERT(false);
79-
THROW_ARANGO_EXCEPTION(TRI_ERROR_NOT_IMPLEMENTED);
80-
};
81+
std::pair<ExecutionState, SharedAqlItemBlockPtr> fetchBlockForPassthrough(size_t);
8182

8283
/**
8384
* @brief Prefetch the number of rows that will be returned from upstream.

arangod/Aql/AqlFunctionFeature.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
////////////////////////////////////////////////////////////////////////////////
2222

2323
#include "AqlFunctionFeature.h"
24+
2425
#include "Aql/AstNode.h"
26+
#include "Aql/Function.h"
2527
#include "Cluster/ServerState.h"
2628
#include "StorageEngine/EngineSelectorFeature.h"
2729
#include "StorageEngine/StorageEngine.h"

arangod/Aql/AqlFunctionFeature.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#define ARANGOD_AQL_AQL_FUNCTION_FEATURE_H 1
2525

2626
#include "ApplicationFeatures/ApplicationFeature.h"
27-
#include "Aql/AstNode.h"
2827
#include "Aql/Function.h"
2928

3029
namespace arangodb {
@@ -71,7 +70,6 @@ class AqlFunctionFeature final : public application_features::ApplicationFeature
7170
void addGeometryConstructors();
7271
void addDateFunctions();
7372
void addMiscFunctions();
74-
void addStorageEngineFunctions();
7573

7674
/// @brief AQL user-callable function names
7775
std::unordered_map<std::string, Function const> _functionNames;

0 commit comments

Comments
 (0)
0