8000 Merge branch 'devel' of https://github.com/arangodb/arangodb into has… · jsxtech/arangodb@0ef91ff · GitHub
[go: up one dir, main page]

Skip to content

Commit 0ef91ff

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into hash-index-mmap
2 parents 7666fe9 + 63f0b53 commit 0ef91ff

36 files changed

+345
-145
lines changed

3rdParty/linenoise-ng/include/linenoise.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ void linenoiseHistoryFree(void);
6161
void linenoiseClearScreen(void);
6262
void linenoiseSetMultiLine(int ml);
6363
void linenoisePrintKeyCodes(void);
64-
/* the following is extension to the original linenoise API */
64+
/* the following are extensions to the original linenoise API */
6565
int linenoiseInstallWindowChangeHandler(void);
66-
int linenoiseGotKey(void);
66+
/* returns type of key pressed: 1 = CTRL-C, 2 = CTRL-D, 0 = other */
67+
int linenoiseKeyType(void);
6768

6869
#ifdef __cplusplus
6970
}

3rdParty/linenoise-ng/src/linenoise.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2490,10 +2490,10 @@ static bool isCharacterAlphanumeric(char32_t testChar) {
24902490
#ifndef _WIN32
24912491
static bool gotResize = false;
24922492
#endif
2493-
static int gotKey = 0;
2493+
static int keyType = 0;
24942494

24952495
int InputBuffer::getInputLine(PromptBase& pi) {
2496-
gotKey = 0;
2496+
keyType = 0;
24972497

24982498
// The latest history entry is always our current buffer
24992499
if (len > 0) {
@@ -2537,9 +2537,14 @@ int InputBuffer::getInputLine(PromptBase& pi) {
25372537
if (terminatingKeystroke == -1) {
25382538
c = linenoiseReadChar(); // get a new keystroke
25392539

2540-
if (c != 0 && (c != ctrlChar('C'))) {
2540+
keyType = 0;
2541+
if (c != 0) {
25412542
// set flag that we got some input
2542-
gotKey = 1;
2543+
if (c == ctrlChar('C')) {
2544+
keyType = 1;
2545+
} else if (c == ctrlChar('D')) {
2546+
keyType = 2;
2547+
}
25432548
}
25442549

25452550
#ifndef _WIN32
@@ -3429,6 +3434,6 @@ int linenoiseInstallWindowChangeHandler(void) {
34293434
return 0;
34303435
}
34313436

3432-
int linenoiseGotKey(void) {
3433-
return gotKey;
3437+
int linenoiseKeyType(void) {
3438+
return keyType;
34343439
}

CHANGELOG

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

4+
* change default log output for tools to stdout (instead of stderr)
5+
46
* added option -D to define a configuration file environment key=value
57

68
* Foxx request URL suffix is no longer unescaped
@@ -12,6 +14,8 @@ devel
1214

1315
* module.context.dependencies is now immutable
1416

17+
* process.stdout.isTTY now returns `true` in arangosh and when running arangod with the `--console` flag
18+
1519

1620
v3.1.2 (20XX-XX-XX)
1721
-------------------

Documentation/Books/Manual/Administration/Configuration/GeneralArangod.mdpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,13 @@ with double dashes. Multiple options need to be separated by whitespace. To get
460460
a list of all available V8 options, you can use the value *"--help"* as follows:
461461

462462
```
463-
--javascript.v8-options "--help"
463+
--javascript.v8-options="--help"
464464
```
465465

466466
Another example of specific V8 options being set at startup:
467467

468468
```
469-
--javascript.v8-options "--log"
469+
--javascript.v8-options="--log"
470470
```
471471

472472
Names and features or usable options depend on the version of V8 being used, and

arangod/Aql/Functions.cpp

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3131,8 +3131,7 @@ AqlValue Functions::Push(arangodb::aql::Query* query,
31313131
}
31323132

31333133
if (!list.isArray()) {
3134-
RegisterWarning(query, "PUSH",
3135-
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH);
3134+
RegisterInvalidArgumentWarning(query, "PUSH");
31363135
return AqlValue(arangodb::basics::VelocyPackHelper::NullValue());
31373136
}
31383137

@@ -3219,38 +3218,47 @@ AqlValue Functions::Append(arangodb::aql::Query* query,
32193218

32203219
AqlValueMaterializer materializer(trx);
32213220
VPackSlice l = materializer.slice(list, false);
3221+
3222+
if (l.isNull()) {
3223+
return toAppend.clone();
3224+
}
3225+
3226+
if (!l.isArray()) {
3227+
RegisterInvalidArgumentWarning(query, "APPEND");
3228+
return AqlValue(arangodb::basics::VelocyPackHelper::NullValue());
3229+
}
3230+
3231+
std::unordered_set<VPackSlice> added;
32223232

32233233
TransactionBuilderLeaser builder(trx);
32243234
builder->openArray();
3225-
3226-
if (!list.isNull(true)) {
3227-
if (list.isArray()) {
3228-
for (auto const& it : VPackArrayIterator(l)) {
3235+
3236+
for (auto const& it : VPackArrayIterator(l)) {
3237+
if (unique) {
3238+
if (added.find(it) == added.end()) {
32293239
builder->add(it);
3240+
added.emplace(it);
32303241
}
3242+
} else {
3243+
builder->add(it);
32313244
}
32323245
}
3246+
3247+
AqlValueMaterializer materializer2(trx);
3248+
VPackSlice slice = materializer2.slice(toAppend, false);
32333249

3234-
auto options = trx->transactionContextPtr()->getVPackOptions();
3235-
if (!toAppend.isArray()) {
3236-
if (!unique || !ListContainsElement(options, l, t)) {
3237-
builder->add(t);
3250+
if (!slice.isArray()) {
3251+
if (!unique || added.find(slice) == added.end()) {
3252+
builder->add(slice);
32383253
}
32393254
} else {
3240-
AqlValueMaterializer materializer(trx);
3241-
VPackSlice slice = materializer.slice(toAppend, false);
3242-
if (unique) {
3243-
std::unordered_set<VPackSlice> added;
3244-
added.reserve(static_cast<size_t>(slice.length()));
3245-
for (auto const& it : VPackArrayIterator(slice)) {
3246-
if (added.find(it) == added.end() &&
3247-
!ListContainsElement(options, l, it)) {
3255+
for (auto const& it : VPackArrayIterator(slice)) {
3256+
if (unique) {
3257+
if (added.find(it) == added.end()) {
32483258
builder->add(it);
32493259
added.emplace(it);
32503260
}
3251-
}
3252-
} else {
3253-
for (auto const& it : VPackArrayIterator(slice)) {
3261+
} else {
32543262
builder->add(it);
32553263
}
32563264
}

arangod/RestServer/ConsoleThread.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ start_pretty_print();
155155
MUTEX_LOCKER(mutexLocker, serverConsoleMutex);
156156
serverConsole = &console;
157157
}
158+
159+
bool lastEmpty = false;
158160

159161
while (!isStopping() && !_userAborted.load()) {
160162
if (nrCommands >= gcInterval ||
@@ -167,7 +169,7 @@ start_pretty_print();
167169
}
168170

169171
std::string input;
170-
bool eof;
172+
ShellBase::EofType eof;
171173

172174
isolate->CancelTerminateExecution();
173175

@@ -176,7 +178,7 @@ start_pretty_print();
176178
input = console.prompt("arangod> ", "arangod", eof);
177179
}
178180

179-
if (eof) {
181+
if (eof == ShellBase::EOF_FORCE_ABORT || (eof == ShellBase::EOF_ABORT && lastEmpty)) {
180182
_userAborted.store(true);
181183
}
182184

@@ -185,8 +187,10 @@ start_pretty_print();
185187
}
186188

187189
if (input.empty()) {
190+
lastEmpty = true;
188191
continue;
189192
}
193+
lastEmpty = false;
190194

191195
nrCommands++;
192196
console.addHistory(input);

arangod/V8Server/v8-vocbase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -681,10 +681,10 @@ static void JS_Debug(v8::FunctionCallbackInfo<v8::Value> const& args) {
681681

682682
if (console != nullptr) {
683683
while (true) {
684-
bool eof;
684+
ShellBase::EofType eof;
685685
std::string input = console->prompt("debug> ", "debug", eof);
686686

687-
if (eof) {
687+
if (eof == ShellBase::EOF_FORCE_ABORT) {
688688
break;
689689
}
690690

arangosh/Shell/ConsoleFeature.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ void ConsoleFeature::printWelcomeInfo() {
362362

363363
void ConsoleFeature::printByeBye() {
364364
if (!_quiet) {
365-
printLine("<ctrl-D>");
366365
printLine(TRI_BYE_MESSAGE);
367366
}
368367
}

arangosh/Shell/V8ShellFeature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ int V8ShellFeature::runShell(std::vector<std::string> const& positionals) {
338338
_console->setPromptError(promptError);
339339
auto prompt = _console->buildPrompt(client);
340340

341-
bool eof;
341+
ShellBase::EofType eof = ShellBase::EOF_NONE;
342342
std::string input =
343343
v8LineEditor.prompt(prompt._colored, prompt._plain, eof);
344344

345-
if (eof && lastEmpty) {
345+
if (eof == ShellBase::EOF_FORCE_ABORT || (eof == ShellBase::EOF_ABORT && lastEmpty)) {
346346
break;
347347
}
348348

etc/arangodb3/arango-dfdb.conf.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ queues = false
2727

2828
[log]
2929
level = info
30+
file = -

0 commit comments

Comments
 (0)
0