1
0
Fork 0

Merge branch 'devel' of github.com:arangodb/arangodb into devel

This commit is contained in:
hkernbach 2016-07-14 15:59:07 +02:00
commit 78e83305bc
14 changed files with 129 additions and 30 deletions

View File

@ -391,4 +391,4 @@ build-books:
make check-docublocks
make book-check-dangling-anchors
echo "${STD_COLOR}Generating redirect index.html${RESET}"; \
@echo '<html><head><meta http-equiv="refresh" content="0; url=Manual/"></head><body></body></html>' > books/index.html
echo '<html><head><meta http-equiv="refresh" content="0; url=Manual/"></head><body></body></html>' > books/index.html

View File

@ -288,10 +288,8 @@ Remove a graph
`graph_module._drop(graphName, dropCollections)`
A graph can be dropped by its name.
This will automatically drop all collections contained in the graph as
long as they are not used within other graphs.
To drop the collections, the optional parameter *drop-collections* can be set to *true*.
This can drop all collections contained in the graph as long as they are not used within other graphs.
To drop the collections only belonging to this graph, the optional parameter *drop-collections* has to be set to *true*.
**Parameters**

View File

@ -42,8 +42,8 @@ key/value object with extra options for the query.
@RESTSTRUCT{fullCount,JSF_post_api_cursor_opts,boolean,optional,}
if set to *true* and the query contains a *LIMIT* clause, then the
result will contain an extra attribute *extra* with a sub-attribute *fullCount*.
This sub-attribute will contain the number of documents in the result before the
result will a sub-attribute *fullCount* in the *extra.stats* sub-attribute.
The *fullCount* sub-attribute will contain the number of documents in the result before the
last LIMIT in the query was applied. It can be used to count the number of documents that
match certain filter criteria, but only return a subset of them, in one go.
It is thus similar to MySQL's *SQL_CALC_FOUND_ROWS* hint. Note that setting the option

View File

@ -343,11 +343,14 @@ int LimitBlock::getOrSkipSome(size_t atLeast, size_t atMost, bool skipping,
if (_engine->_stats.fullCount == -1) {
_engine->_stats.fullCount = 0;
}
_engine->_stats.fullCount += static_cast<int64_t>(_offset);
}
if (_offset > 0) {
ExecutionBlock::_dependencies[0]->skip(_offset);
size_t numActuallySkipped = 0;
ExecutionBlock::_dependencies[0]->skip(_offset, numActuallySkipped);
if (_fullCount) {
_engine->_stats.fullCount += static_cast<int64_t>(numActuallySkipped);
}
}
_state = 1;
_count = 0;

View File

@ -284,7 +284,7 @@ size_t ExecutionBlock::skipSome(size_t atLeast, size_t atMost) {
// skip exactly <number> outputs, returns <true> if _done after
// skipping, and <false> otherwise . . .
bool ExecutionBlock::skip(size_t number) {
bool ExecutionBlock::skip(size_t number, size_t& numActuallySkipped) {
DEBUG_BEGIN_BLOCK();
size_t skipped = skipSome(number, number);
size_t nr = skipped;
@ -292,6 +292,7 @@ bool ExecutionBlock::skip(size_t number) {
nr = skipSome(number - skipped, number - skipped);
skipped += nr;
}
numActuallySkipped = skipped;
if (nr == 0) {
return true;
}
@ -345,7 +346,8 @@ int ExecutionBlock::getOrSkipSome(size_t atLeast, size_t atMost, bool skipping,
while (skipped < atLeast) {
if (_buffer.empty()) {
if (skipping) {
_dependencies[0]->skip(atLeast - skipped);
size_t numActuallySkipped = 0;
_dependencies[0]->skip(atLeast - skipped, numActuallySkipped);
skipped = atLeast;
freeCollector();
return TRI_ERROR_NO_ERROR;

View File

@ -156,7 +156,7 @@ class ExecutionBlock {
// skip exactly <number> outputs, returns <true> if _done after
// skipping, and <false> otherwise . . .
bool skip(size_t number);
bool skip(size_t number, size_t& numActuallySkipped);
virtual bool hasMore();

View File

@ -111,7 +111,9 @@ class ExecutionEngine {
AqlItemBlock* getOne() { return _root->getSome(1, 1); }
/// @brief skip
bool skip(size_t number) { return _root->skip(number); }
bool skip(size_t number, size_t& actuallySkipped) {
return _root->skip(number, actuallySkipped);
}
/// @brief hasMore
inline bool hasMore() const { return _root->hasMore(); }

View File

@ -783,7 +783,8 @@ void RestAqlHandler::handleUseQuery(std::string const& operation, Query* query,
try {
bool exhausted;
if (shardId.empty()) {
exhausted = query->engine()->skip(number);
size_t numActuallySkipped = 0;
exhausted = query->engine()->skip(number, numActuallySkipped);
} else {
auto block =
static_cast<BlockWithClients*>(query->engine()->root());

File diff suppressed because one or more lines are too long

View File

@ -2711,4 +2711,4 @@ var cutByResolution = function (str) {
</div>
<div id="workMonitorContent" class="innerContent">
</div></script></head><body><nav class="navbar" style="display: none"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img class="arangodbLogo" src="img/arangodb_logo_big.png"></a><a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a><a class="version"><span>VERSION: </span><span id="currentVersion"></span></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div id="modalPlaceholder"></div><div class="bodyWrapper" style="display: none"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="loadingScreen" class="loadingScreen" style="display: none"><i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw margin-bottom"></i> <span class="sr-only">Loading...</span></div><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div id="offlinePlaceholder" style="display:none"><div class="offline-div"><div class="pure-u"><div class="pure-u-1-4"></div><div class="pure-u-1-2 offline-window"><div class="offline-header"><h3>You have been disconnected from the server</h3></div><div class="offline-body"><p>The connection to the server has been lost. The server may be under heavy load.</p><p>Trying to reconnect in <span id="offlineSeconds">10</span> seconds.</p><p class="animation_state"><span><button class="button-success">Reconnect now</button></span></p></div></div><div class="pure-u-1-4"></div></div></div></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1468420185169"></script><script src="app.js?version=1468420185169"></script></body></html>
</div></script></head><body><nav class="navbar" style="display: none"><div class="primary"><div class="navlogo"><a class="logo big" href="#"><img class="arangodbLogo" src="img/arangodb_logo_big.png"></a><a class="logo small" href="#"><img class="arangodbLogo" src="img/arangodb_logo_small.png"></a><a class="version"><span>VERSION: </span><span id="currentVersion"></span></a></div><div class="statmenu" id="statisticBar"></div><div class="navmenu" id="navigationBar"></div></div></nav><div id="modalPlaceholder"></div><div class="bodyWrapper" style="display: none"><div class="centralRow"><div id="navbar2" class="navbarWrapper secondary"><div class="subnavmenu" id="subNavigationBar"></div></div><div class="resizecontainer contentWrapper"><div id="loadingScreen" class="loadingScreen" style="display: none"><i class="fa fa-circle-o-notch fa-spin fa-3x fa-fw margin-bottom"></i> <span class="sr-only">Loading...</span></div><div id="content" class="centralContent"></div><footer class="footer"><div id="footerBar"></div></footer></div></div></div><div id="progressPlaceholder" style="display:none"></div><div id="spotlightPlaceholder" style="display:none"></div><div id="offlinePlaceholder" style="display:none"><div class="offline-div"><div class="pure-u"><div class="pure-u-1-4"></div><div class="pure-u-1-2 offline-window"><div class="offline-header"><h3>You have been disconnected from the server</h3></div><div class="offline-body"><p>The connection to the server has been lost. The server may be under heavy load.</p><p>Trying to reconnect in <span id="offlineSeconds">10</span> seconds.</p><p class="animation_state"><span><button class="button-success">Reconnect now</button></span></p></div></div><div class="pure-u-1-4"></div></div></div></div><div class="arangoFrame" style=""><div class="outerDiv"><div class="innerDiv"></div></div></div><script src="libs.js?version=1468500265065"></script><script src="app.js?version=1468500265065"></script></body></html>

View File

@ -262,7 +262,12 @@
self.jsonEditor.setReadOnly(true);
self.jsonEditor.getSession().setMode('ace/mode/json');
$.get(this.appUrl(db)).success(function () {
$.ajax({
url: this.appUrl(db),
headers: {
accept: 'text/html,*/*;q=0.9'
}
}).success(function () {
$('.open', this.el).prop('disabled', false);
}.bind(this));

View File

@ -104,6 +104,94 @@ function optimizerFullcountTestSuite () {
assertEqual(2, result.stats.fullCount);
assertEqual(1, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection LIMIT 100 RETURN doc", null, { fullCount: true });
assertEqual(3, result.stats.fullCount);
assertEqual(3, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit2 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection LIMIT 1, 100 RETURN doc", null, { fullCount: true });
assertEqual(3, result.stats.fullCount);
assertEqual(2, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit3 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection LIMIT 2, 100 RETURN doc", null, { fullCount: true });
assertEqual(3, result.stats.fullCount);
assertEqual(1, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit4 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection LIMIT 3, 100 RETURN doc", null, { fullCount: true });
assertEqual(3, result.stats.fullCount);
assertEqual(0, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit5 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection LIMIT 10000, 100 RETURN doc", null, { fullCount: true });
assertEqual(3, result.stats.fullCount);
assertEqual(0, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit6 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection FILTER 'bar' IN doc.values LIMIT 1, 10 RETURN doc", null, { fullCount: true });
assertEqual(2, result.stats.fullCount);
assertEqual(1, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit7 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection FILTER 'bar' IN doc.values LIMIT 10, 10 RETURN doc", null, { fullCount: true });
assertEqual(2, result.stats.fullCount);
assertEqual(0, result.json.length);
},
////////////////////////////////////////////////////////////////////////////////
/// @brief test with fullcount
////////////////////////////////////////////////////////////////////////////////
testHigherLimit8 : function () {
var result = AQL_EXECUTE("FOR doc IN UnitTestsCollection FILTER 'bar' IN doc.values LIMIT 1000, 1 RETURN doc", null, { fullCount: true });
assertEqual(2, result.stats.fullCount);
assertEqual(0, result.json.length);
}
};