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

Skip to content

Commit fb15364

Browse files
committed
Merge branch 'devel' of https://github.com/arangodb/arangodb into devel
2 parents 3522d37 + ac7e627 commit fb15364

File tree

20 files changed

+322
-110
lines changed

20 files changed

+322
-110
lines changed

.editorconfig

Lines changed: 0 additions & 38 deletions
This file was deleted.

CHANGELOG

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
devel
22
-----
33

4+
* added experimental AQL functions `JSON_STRINGIFY` and `JSON_PARSE`
5+
6+
* added experimental support for incoming gzip-compressed requests
7+
48
* added HTTP REST APIs for online loglevel adjustments:
59

610
- GET `/_admin/log/level` returns the current loglevel settings
@@ -74,7 +78,14 @@ devel
7478

7579
* all lambdas in ClusterInfo might have been left with dangling references.
7680

77-
v3.0.8 (XXXX-XX-XX)
81+
82+
v3.0.9 (XXXX-XX-XX)
83+
-------------------
84+
85+
* speed up `collection.any()` and skiplist index creation
86+
87+
88+
v3.0.8 (2016-09-14)
7889
-------------------
7990

8091
* fixed issue #2052

Documentation/Books/Manual/Administration/Arangosh/README.mdpp

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ For a list of available methods for the *db* object, type
6767
@END_EXAMPLE_ARANGOSH_OUTPUT
6868
@endDocuBlock shellHelp
6969

70-
you can paste multiple lines into arangosh, given the first line ends with an opening brace:
70+
you can paste multiple lines into arangosh, given the first line ends with an
71+
opening brace:
7172

7273
@startDocuBlockInline shellPaste
7374
@EXAMPLE_ARANGOSH_OUTPUT{shellPaste}
@@ -78,22 +79,27 @@ you can paste multiple lines into arangosh, given the first line ends with an op
7879
@endDocuBlock shellPaste
7980

8081

81-
To load your own JavaScript code into the current JavaScript interpreter context, use the load command:
82+
To load your own JavaScript code into the current JavaScript interpreter context,
83+
use the load command:
8284

8385
require("internal").load("/tmp/test.js") // <- Linux / MacOS
8486
require("internal").load("c:\\tmp\\test.js") // <- Windows
8587

86-
Exiting arangosh can be done using the key combination ```<CTRL> + D``` or by typing ```quit<CR>```
87-
88+
Exiting arangosh can be done using the key combination ```<CTRL> + D``` or by
89+
typing ```quit<CR>```
8890

8991
!SUBSECTION Escaping
90-
In Arangosh as in AQL escaping is done traditionaly with the backslash character: `\`.
91-
As seen above, this leads to double backslashes when specifying windows paths.
92-
If you want to then execute an AQL command, you need to double the escaping:
9392

94-
db._query('RETURN "c:\\\\tmp\\\\test.js"')
93+
In AQL, escaping is done traditionally with the backslash character: `\`.
94+
As seen above, this leads to double backslashes when specifying Windows paths.
95+
Arangosh requires another level of escaping, also with the backslash character.
96+
It adds up to four backslashes that need to be written in Arangosh for a single
97+
literal backslash (`c:\tmp\test.js`):
98+
99+
db._query('RETURN "c:\\\\tmp\\\\test.js"')
95100

96-
You can use [bind variables](../../../AQL/Invocation/WithArangosh.html) to work around this:
101+
You can use [bind variables](../../../AQL/Invocation/WithArangosh.html) to
102+
mitigate this:
97103

98104
var somepath = "c:\\tmp\\test.js"
99105
db._query(aql`RETURN ${somepath}`)

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ not present, it will be created.
3030
<!-- arangod/Wal/LogfileManager.h -->
3131
@startDocuBlock WalLogfileAllowOversizeEntries
3232

33-
!SUBSECTION Suppress shape information
34-
35-
<!-- arangod/Wal/LogfileManager.h -->
36-
@startDocuBlock WalLogfileSuppressShapeInformation
37-
3833
!SUBSECTION Number of reserve logfiles
3934

4035
<!-- arangod/Wal/LogfileManager.h -->

Documentation/Books/Manual/Administration/Durability.mdpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ logfiles:
5858
@startDocuBlock WalLogfileAllowOversizeEntries
5959

6060

61-
<!-- arangod/Wal/LogfileManager.h -->
62-
@startDocuBlock WalLogfileSuppressShapeInformation
63-
64-
6561
When data gets copied from the write-ahead logfiles into the journals or datafiles
6662
of collections, files will be created on the collection level. How big these files
6763
are is determined by the following global configuration value:

Documentation/DocuBlocks/WalLogfileSuppressShapeInformation.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

Installation/Jenkins/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,5 +520,5 @@ if test -n "${TARGET_DIR}"; then
520520
fi
521521

522522
gzip < ${TARFILE_TMP} > ${dir}/${TARFILE}
523-
${MD5} < ${dir}/${TARFILE} > ${dir}/${TARFILE}.md5
523+
${MD5} < ${dir}/${TARFILE} |sed "s; .*;;" > ${dir}/${TARFILE}.md5
524524
fi

arangod/Aql/FunctionDefinitions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,10 @@ struct FunctionDefiner {
355355
false, true, true});
356356
add({"ZIP", "AQL_ZIP", "l,l", true, true, false, true, true,
357357
&Functions::Zip});
358+
add({"JSON_STRINGIFY", "AQL_JSON_STRINGIFY", ".", true, true, false, true, true,
359+
&Functions::JsonStringify});
360+
add({"JSON_PARSE", "AQL_JSON_PARSE", ".", true, true, false, true, true,
361+
&Functions::JsonParse});
358362
}
359363

360364
void addGeoFunctions() {

arangod/Aql/Functions.cpp

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2375,6 +2375,54 @@ AqlValue Functions::Zip(arangodb::aql::Query* query,
23752375
}
23762376
}
23772377

2378+
/// @brief function JSON_STRINGIFY
2379+
AqlValue Functions::JsonStringify(arangodb::aql::Query* query,
2380+
arangodb::Transaction* trx,
2381+
VPackFunctionParameters const& parameters) {
2382+
ValidateParameters(parameters, "JSON_STRINGIFY", 1, 1);
2383+
2384+
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
2385+
AqlValueMaterializer materializer(trx);
2386+
VPackSlice slice = materializer.slice(value, false);
2387+
2388+
StringBufferLeaser buffer(trx);
2389+
arangodb::basics::VPackStringBufferAdapter adapter(buffer->stringBuffer());
2390+
2391+
VPackDumper dumper(&adapter, trx->transactionContextPtr()->getVPackOptions());
2392+
dumper.dump(slice);
2393+
2394+
return AqlValue(buffer->begin(), buffer->length());
2395+
}
2396+
2397+
/// @brief function JSON_PARSE
2398+
AqlValue Functions::JsonParse(arangodb::aql::Query* query,
2399+
arangodb::Transaction* trx,
2400+
VPackFunctionParameters const& parameters) {
2401+
ValidateParameters(parameters, "JSON_PARSE", 1, 1);
2402+
2403+
AqlValue value = ExtractFunctionParameterValue(trx, parameters, 0);
2404+
AqlValueMaterializer materializer(trx);
2405+
VPackSlice slice = materializer.slice(value, false);
2406+
2407+
if (!slice.isString()) {
2408+
RegisterWarning(query, "JSON_PARSE",
2409+
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH);
2410+
return AqlValue(arangodb::basics::VelocyPackHelper::NullValue());
2411+
}
2412+
2413+
VPackValueLength l;
2414+
char const* p = slice.getString(l);
2415+
2416+
try {
2417+
std::shared_ptr<VPackBuilder> builder = VPackParser::fromJson(p, l);
2418+
return AqlValue(*builder);
2419+
} catch (...) {
2420+
RegisterWarning(query, "JSON_PARSE",
2421+
TRI_ERROR_QUERY_FUNCTION_ARGUMENT_TYPE_MISMATCH);
2422+
return AqlValue(arangodb::basics::VelocyPackHelper::NullValue());
2423+
}
2424+
}
2425+
23782426
/// @brief function PARSE_IDENTIFIER
23792427
AqlValue Functions::ParseIdentifier(
23802428
arangodb::aql::Query* query, arangodb::Transaction* trx,

arangod/Aql/Functions.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ struct Functions {
159159
VPackFunctionParameters const&);
160160
static AqlValue Zip(arangodb::aql::Query*, arangodb::Transaction*,
161161
VPackFunctionParameters const&);
162+
static AqlValue JsonStringify(arangodb::aql::Query*, arangodb::Transaction*,
163+
VPackFunctionParameters const&);
164+
static AqlValue JsonParse(arangodb::aql::Query*, arangodb::Transaction*,
165+
VPackFunctionParameters const&);
162166
static AqlValue ParseIdentifier(arangodb::aql::Query*,
163167
arangodb::Transaction*,
164168
VPackFunctionParameters const&);

0 commit comments

Comments
 (0)
0