mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel
This commit is contained in:
commit
b14386c601
|
@ -210,6 +210,11 @@ while [ $# -gt 0 ]; do
|
|||
shift
|
||||
;;
|
||||
|
||||
--noopt)
|
||||
CONFIGURE_OPTIONS="${CONFIGURE_OPTIONS} -DUSE_OPTIMIZE_FOR_ARCHITECTURE=Off"
|
||||
shift
|
||||
;;
|
||||
|
||||
--coverage)
|
||||
TAR_SUFFIX="-coverage"
|
||||
COVERAGE=1
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
using namespace arangodb::aql;
|
||||
|
||||
SortBlock::SortBlock(ExecutionEngine* engine, SortNode const* en)
|
||||
: ExecutionBlock(engine, en), _sortRegisters(), _stable(en->_stable) {
|
||||
: ExecutionBlock(engine, en), _sortRegisters(), _stable(en->_stable), _mustFetchAll(true) {
|
||||
for (auto const& p : en->_elements) {
|
||||
auto it = en->getRegisterPlan()->varInfo.find(p.first->id);
|
||||
TRI_ASSERT(it != en->getRegisterPlan()->varInfo.end());
|
||||
|
@ -42,23 +42,13 @@ SortBlock::SortBlock(ExecutionEngine* engine, SortNode const* en)
|
|||
SortBlock::~SortBlock() {}
|
||||
|
||||
int SortBlock::initializeCursor(AqlItemBlock* items, size_t pos) {
|
||||
DEBUG_BEGIN_BLOCK();
|
||||
DEBUG_BEGIN_BLOCK();
|
||||
int res = ExecutionBlock::initializeCursor(items, pos);
|
||||
if (res != TRI_ERROR_NO_ERROR) {
|
||||
return res;
|
||||
}
|
||||
// suck all blocks into _buffer
|
||||
while (getBlock(DefaultBatchSize(), DefaultBatchSize())) {
|
||||
}
|
||||
|
||||
if (_buffer.empty()) {
|
||||
_done = true;
|
||||
return TRI_ERROR_NO_ERROR;
|
||||
}
|
||||
|
||||
doSorting();
|
||||
|
||||
_done = false;
|
||||
_mustFetchAll = !_done;
|
||||
_pos = 0;
|
||||
|
||||
return TRI_ERROR_NO_ERROR;
|
||||
|
@ -67,6 +57,29 @@ int SortBlock::initializeCursor(AqlItemBlock* items, size_t pos) {
|
|||
DEBUG_END_BLOCK();
|
||||
}
|
||||
|
||||
int SortBlock::getOrSkipSome(size_t atLeast, size_t atMost, bool skipping,
|
||||
AqlItemBlock*& result, size_t& skipped) {
|
||||
DEBUG_BEGIN_BLOCK();
|
||||
|
||||
TRI_ASSERT(result == nullptr && skipped == 0);
|
||||
|
||||
if (_mustFetchAll) {
|
||||
// suck all blocks into _buffer
|
||||
while (getBlock(DefaultBatchSize(), DefaultBatchSize())) {
|
||||
}
|
||||
|
||||
_mustFetchAll = false;
|
||||
if (!_buffer.empty()) {
|
||||
doSorting();
|
||||
}
|
||||
}
|
||||
|
||||
return ExecutionBlock::getOrSkipSome(atLeast, atMost, skipping, result, skipped);
|
||||
|
||||
// cppcheck-suppress style
|
||||
DEBUG_END_BLOCK();
|
||||
}
|
||||
|
||||
void SortBlock::doSorting() {
|
||||
DEBUG_BEGIN_BLOCK();
|
||||
// coords[i][j] is the <j>th row of the <i>th block
|
||||
|
|
|
@ -45,6 +45,8 @@ class SortBlock : public ExecutionBlock {
|
|||
|
||||
int initializeCursor(AqlItemBlock* items, size_t pos) override final;
|
||||
|
||||
int getOrSkipSome(size_t atLeast, size_t atMost, bool skipping, AqlItemBlock*&, size_t& skipped) override final;
|
||||
|
||||
/// @brief dosorting
|
||||
private:
|
||||
void doSorting();
|
||||
|
@ -74,6 +76,8 @@ class SortBlock : public ExecutionBlock {
|
|||
|
||||
/// @brief whether or not the sort should be stable
|
||||
bool _stable;
|
||||
|
||||
bool _mustFetchAll;
|
||||
};
|
||||
|
||||
} // namespace arangodb::aql
|
||||
|
|
|
@ -243,6 +243,7 @@ SlotInfo Slots::nextUnused(TRI_voc_tick_t databaseId, TRI_voc_cid_t collectionId
|
|||
char* mem = _logfile->reserve(alignedSize);
|
||||
|
||||
if (mem == nullptr) {
|
||||
LOG(WARN) << "could not find free WAL slot";
|
||||
return SlotInfo(TRI_ERROR_INTERNAL);
|
||||
}
|
||||
|
||||
|
|
|
@ -236,10 +236,11 @@ let ARANGORESTORE_BIN;
|
|||
let ARANGOSH_BIN;
|
||||
let CONFIG_RELATIVE_DIR;
|
||||
let JS_DIR;
|
||||
let JS_ENTERPRISE_DIR;
|
||||
let LOGS_DIR;
|
||||
let PEM_FILE;
|
||||
let UNITTESTS_DIR;
|
||||
let GDB_OUTPUT;
|
||||
let GDB_OUTPUT="";
|
||||
|
||||
function makeResults (testname) {
|
||||
const startTime = time();
|
||||
|
@ -302,6 +303,7 @@ function makeArgsArangod (options, appDir) {
|
|||
'database.maximal-journal-size': '1048576',
|
||||
'javascript.app-path': appDir,
|
||||
'javascript.startup-directory': JS_DIR,
|
||||
'javascript.module-directory': JS_ENTERPRISE_DIR,
|
||||
'javascript.v8-contexts': '5',
|
||||
'http.trusted-origin': options.httpTrustedOrigin || 'all',
|
||||
'log.level': 'warn',
|
||||
|
@ -321,6 +323,7 @@ function makeArgsArangosh (options) {
|
|||
return {
|
||||
'configuration': 'none',
|
||||
'javascript.startup-directory': JS_DIR,
|
||||
'javascript.module-directory': JS_ENTERPRISE_DIR,
|
||||
'server.username': options.username,
|
||||
'server.password': options.password,
|
||||
'flatCommands': ['--console.colors', 'false', '--quiet']
|
||||
|
@ -4056,6 +4059,7 @@ function unitTest (cases, options) {
|
|||
ARANGOSH_BIN = fs.join(BIN_DIR, 'arangosh');
|
||||
CONFIG_RELATIVE_DIR = fs.join(TOP_DIR, 'etc', 'relative');
|
||||
JS_DIR = fs.join(TOP_DIR, 'js');
|
||||
JS_ENTERPRISE_DIR = fs.join(TOP_DIR, 'enterprise/js');
|
||||
LOGS_DIR = fs.join(TOP_DIR, 'logs');
|
||||
PEM_FILE = fs.join(TOP_DIR, 'UnitTests', 'server.pem');
|
||||
|
||||
|
|
|
@ -1103,8 +1103,16 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
context.level = newLevel;
|
||||
|
||||
var keys;
|
||||
|
||||
try {
|
||||
keys = Object.keys(object);
|
||||
// try to detect an ES6 class. note that this won't work 100% correct
|
||||
if (object.constructor && object.constructor.name !== 'Object') {
|
||||
// probably an object of an ES6 class
|
||||
keys = Object.getOwnPropertyNames(Object.getPrototypeOf(object));
|
||||
} else {
|
||||
// other object
|
||||
keys = Object.keys(object);
|
||||
}
|
||||
} catch (err) {
|
||||
// ES6 proxy objects don't support key enumeration
|
||||
keys = [];
|
||||
|
@ -1113,7 +1121,11 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
for (let i = 0, n = keys.length; i < n; ++i) {
|
||||
var k = keys[i];
|
||||
var val = object[k];
|
||||
|
||||
if (val === object.constructor) {
|
||||
// hide ctor
|
||||
continue;
|
||||
}
|
||||
|
||||
if (useColor) {
|
||||
context.output += colors.COLOR_PUNCTUATION;
|
||||
}
|
||||
|
@ -1239,8 +1251,8 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
|
||||
if (context.level > 0 && !showFunction) {
|
||||
var a = s.split('\n');
|
||||
var f = a[0];
|
||||
|
||||
var f = a[0].replace(/^(.*?\)).*$/, '$1');
|
||||
|
||||
var m = funcRE.exec(f);
|
||||
|
||||
if (m !== null) {
|
||||
|
@ -1251,7 +1263,6 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
}
|
||||
} else {
|
||||
m = func2RE.exec(f);
|
||||
|
||||
if (m !== null) {
|
||||
if (m[1] === undefined) {
|
||||
context.output += 'function ' + '(' + m[2] + ') { ... }';
|
||||
|
@ -1259,8 +1270,12 @@ global.DEFINE_MODULE('internal', (function () {
|
|||
context.output += 'function ' + m[1] + ' (' + m[2] + ') { ... }';
|
||||
}
|
||||
} else {
|
||||
f = f.substr(8, f.length - 10).trim();
|
||||
context.output += '[Function "' + f + '" ...]';
|
||||
if (f.substr(0, 8) === 'function') {
|
||||
f = f.substr(8, f.length - 10).trim();
|
||||
context.output += '[Function "' + f + '" ...]';
|
||||
} else {
|
||||
context.output += f.replace(/^[^(]+/, '') + ' { ... }';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -350,13 +350,11 @@ function GeneralGraphCreationSuite() {
|
|||
},
|
||||
|
||||
testExtendEdgeDefinitions : function () {
|
||||
|
||||
|
||||
//with empty args
|
||||
assertEqual(graph._edgeDefinitions(), []);
|
||||
|
||||
//with args
|
||||
var ed =graph._edgeDefinitions(
|
||||
var ed = graph._edgeDefinitions(
|
||||
graph._relation("relationName", "vertexC1", "vertexC1"),
|
||||
graph._relation("relationName",
|
||||
["vertexC1", "vertexC2"], ["vertexC3", "vertexC4"])
|
||||
|
@ -381,7 +379,6 @@ function GeneralGraphCreationSuite() {
|
|||
to: ["vertexC1"]
|
||||
}
|
||||
]);
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
|
|
@ -3220,7 +3220,6 @@ function optimizerIndexesTestSuite () {
|
|||
});
|
||||
|
||||
assertEqual(-1, nodeTypes.indexOf("IndexNode"), query);
|
||||
assertNotEqual(-1, nodeTypes.indexOf("SortNode"), query);
|
||||
|
||||
var results = AQL_EXECUTE(query);
|
||||
assertEqual([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ], results.json, query);
|
||||
|
|
Loading…
Reference in New Issue