mirror of https://gitee.com/bigwinds/arangodb
merged
This commit is contained in:
parent
4c7d59129d
commit
2b40f8d7fb
|
@ -72,3 +72,4 @@ UnitTests/test_suite
|
|||
.v8-build
|
||||
VC++
|
||||
UnitTests/HttpInterface/logs
|
||||
Makefile.local
|
||||
|
|
|
@ -187,7 +187,8 @@ void RestBaseHandler::generateResult (VariantObject* result) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void RestBaseHandler::generateError (HttpResponse::HttpResponseCode code, int errorCode) {
|
||||
char* message = TRI_get_errno_string(errorCode);
|
||||
char const* message = TRI_errno_string(errorCode);
|
||||
|
||||
if (message) {
|
||||
generateError(code, errorCode, string(message));
|
||||
}
|
||||
|
|
|
@ -318,11 +318,12 @@ void TRI_set_errno_string (int error, char const* msg) {
|
|||
/// @brief return an error message for an error code
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
char* TRI_get_errno_string (const int error) {
|
||||
char const* TRI_errno_string (int error) {
|
||||
TRI_error_t* entry;
|
||||
|
||||
entry = (TRI_error_t*) TRI_LookupByKeyAssociativePointer(&ErrorMessages, (void const*) &error);
|
||||
if (!entry) {
|
||||
|
||||
if (entry == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ void TRI_set_errno_string (int, char const*);
|
|||
/// @brief return an error message for an error code
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
char* TRI_get_errno_string (const int);
|
||||
char const* TRI_errno_string (int);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
|
|
|
@ -152,9 +152,12 @@ TRI_process_info_t TRI_ProcessInfo (TRI_pid_t pid) {
|
|||
n = read(fd, str, 1024);
|
||||
close(fd);
|
||||
|
||||
// size_t is always >= 0, comparison will never be false
|
||||
/*
|
||||
if (n < 0) {
|
||||
return result;
|
||||
}
|
||||
*/
|
||||
|
||||
sscanf(str, "%d %s %c %d %d %d %d %d %u %lu %lu %lu %lu %lu %lu %lu %ld %ld %ld %ld %ld %llu %lu %ld",
|
||||
&st.pid, (char*) &st.comm, &st.state, &st.ppid, &st.pgrp, &st.session, &st.tty_nr, &st.tpgid,
|
||||
|
|
|
@ -396,8 +396,6 @@ void TRI_ClearVectorPointer (TRI_vector_pointer_t* vector) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_ResizeVectorPointer (TRI_vector_pointer_t* vector, size_t n) {
|
||||
assert(n >= 0);
|
||||
|
||||
if (vector->_length == n) {
|
||||
return;
|
||||
}
|
||||
|
@ -456,8 +454,6 @@ void TRI_PushBackVectorPointer (TRI_vector_pointer_t* vector, void* element) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void TRI_InsertVectorPointer (TRI_vector_pointer_t* vector, void* element, size_t n) {
|
||||
assert(n >= 0);
|
||||
|
||||
if (vector->_length >= vector->_capacity) {
|
||||
void* newBuffer;
|
||||
size_t newSize = (size_t) (1 + GROW_FACTOR * vector->_capacity);
|
||||
|
|
|
@ -21,6 +21,7 @@ void TRI_InitialiseErrorMessages (void) {
|
|||
REG_ERROR(ERROR_ILLEGAL_OPTION, "illegal option");
|
||||
REG_ERROR(ERROR_DEAD_PID, "dead process identifier");
|
||||
REG_ERROR(ERROR_NOT_IMPLEMENTED, "not implemented");
|
||||
REG_ERROR(ERROR_BAD_PARAMETER, "bad parameter");
|
||||
REG_ERROR(ERROR_HTTP_BAD_PARAMETER, "bad parameter");
|
||||
REG_ERROR(ERROR_HTTP_NOT_FOUND, "not found");
|
||||
REG_ERROR(ERROR_HTTP_METHOD_NOT_ALLOWED, "method not supported");
|
||||
|
@ -55,6 +56,7 @@ void TRI_InitialiseErrorMessages (void) {
|
|||
REG_ERROR(ERROR_AVOCADO_UNIQUE_CONSTRAINT_VIOLATED, "unique constraint violated");
|
||||
REG_ERROR(ERROR_AVOCADO_GEO_INDEX_VIOLATED, "geo index violated");
|
||||
REG_ERROR(ERROR_AVOCADO_INDEX_NOT_FOUND, "index not found");
|
||||
REG_ERROR(ERROR_AVOCADO_CROSS_COLLECTION_REQUEST, "cross collection request not allowed");
|
||||
REG_ERROR(ERROR_AVOCADO_DATAFILE_FULL, "datafile full");
|
||||
REG_ERROR(ERROR_QUERY_KILLED, "query killed");
|
||||
REG_ERROR(ERROR_QUERY_PARSE, "parse error: %s");
|
||||
|
@ -104,6 +106,7 @@ void TRI_InitialiseErrorMessages (void) {
|
|||
REG_ERROR(SIMPLE_CLIENT_COULD_NOT_CONNECT, "could not connect to server");
|
||||
REG_ERROR(SIMPLE_CLIENT_COULD_NOT_WRITE, "could not write to server");
|
||||
REG_ERROR(SIMPLE_CLIENT_COULD_NOT_READ, "could not read from server");
|
||||
REG_ERROR(ERROR_AVOCADO_INDEX_PQ_INSERT_FAILED, "priority queue insert failure");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -31,6 +31,8 @@ extern "C" {
|
|||
/// Will be raised when a PID without a living process was found.
|
||||
/// - 9: @CODE{not implemented}
|
||||
/// Will be raised when hitting an unimplemented feature.
|
||||
/// - 10: @CODE{bad parameter}
|
||||
/// Will be raised when the parameter does not fulfill the requirements.
|
||||
/// - 400: @CODE{bad parameter}
|
||||
/// Will be raised when the HTTP request does not fulfill the requirements.
|
||||
/// - 404: @CODE{not found}
|
||||
|
@ -109,6 +111,8 @@ extern "C" {
|
|||
/// Will be raised when a illegale coordinate is used.
|
||||
/// - 1212: @CODE{index not found}
|
||||
/// Will be raised when an index with a given identifier is unknown.
|
||||
/// - 1213: @CODE{cross collection request not allowed}
|
||||
/// Will be raised when a cross-collection is requested.
|
||||
/// - 1300: @CODE{datafile full}
|
||||
/// Will be raised when the datafile reaches its limit.
|
||||
/// - 1500: @CODE{query killed}
|
||||
|
@ -225,6 +229,9 @@ extern "C" {
|
|||
/// Will be raised when the client could not write data.
|
||||
/// - 2003: @CODE{could not read from server}
|
||||
/// Will be raised when the client could not read data.
|
||||
/// - 3100: @CODE{priority queue insert failure}
|
||||
/// Will be raised when an attempt to insert a document into a priority queue
|
||||
/// index fails for some reason.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -344,6 +351,16 @@ void TRI_InitialiseErrorMessages (void);
|
|||
|
||||
#define TRI_ERROR_NOT_IMPLEMENTED (9)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 10: ERROR_BAD_PARAMETER
|
||||
///
|
||||
/// bad parameter
|
||||
///
|
||||
/// Will be raised when the parameter does not fulfill the requirements.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_ERROR_BAD_PARAMETER (10)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 400: ERROR_HTTP_BAD_PARAMETER
|
||||
///
|
||||
|
@ -691,6 +708,16 @@ void TRI_InitialiseErrorMessages (void);
|
|||
|
||||
#define TRI_ERROR_AVOCADO_INDEX_NOT_FOUND (1212)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 1213: ERROR_AVOCADO_CROSS_COLLECTION_REQUEST
|
||||
///
|
||||
/// cross collection request not allowed
|
||||
///
|
||||
/// Will be raised when a cross-collection is requested.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_ERROR_AVOCADO_CROSS_COLLECTION_REQUEST (1213)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 1300: ERROR_AVOCADO_DATAFILE_FULL
|
||||
///
|
||||
|
@ -1196,6 +1223,17 @@ void TRI_InitialiseErrorMessages (void);
|
|||
|
||||
#define TRI_SIMPLE_CLIENT_COULD_NOT_READ (2003)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief 3100: ERROR_AVOCADO_INDEX_PQ_INSERT_FAILED
|
||||
///
|
||||
/// priority queue insert failure
|
||||
///
|
||||
/// Will be raised when an attempt to insert a document into a priority queue
|
||||
/// index fails for some reason.
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_ERROR_AVOCADO_INDEX_PQ_INSERT_FAILED (3100)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
|
|
|
@ -1 +1 @@
|
|||
<!-- footer -->
|
||||
<?php include "include/footer.php" ?>
|
|
@ -1 +1 @@
|
|||
<!-- header -->
|
||||
<?php include "include/header.php" ?>
|
||||
|
|
|
@ -66,6 +66,7 @@ include Makefile.files
|
|||
include Makefile.doxygen
|
||||
include Makefile.javascript
|
||||
include Makefile.unittests
|
||||
-include Makefile.local
|
||||
|
||||
if ENABLE_FLEX
|
||||
include Makefile.flex
|
||||
|
|
|
@ -53,15 +53,16 @@ doxygen: Doxygen/avocado.doxy $(DOXYGEN)
|
|||
|
||||
.PHONY: wiki
|
||||
|
||||
wiki: doxygen $(addprefix Doxygen/xml/,$(WIKI))
|
||||
wiki: doxygen $(addsuffix .md,$(addprefix Doxygen/xml/,$(WIKI)))
|
||||
@test -d Doxygen/wiki || mkdir Doxygen/wiki
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/pandoc.sh Doxygen/xml/$$w; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/md2html.sh Doxygen/wiki/$$w; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/pandoc.sh Doxygen/xml/$$w.md; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/md2html.sh Doxygen/wiki/$$w.md; done
|
||||
|
||||
################################################################################
|
||||
## CLEANUP
|
||||
################################################################################
|
||||
|
||||
CLEANUP += $(DOXYGEN) $(addprefix Doxygen/xml/,$(WIKI)) $(addprefix Doxygen/wiki/,$(WIKI))
|
||||
|
||||
|
||||
CLEANUP += \
|
||||
$(DOXYGEN) \
|
||||
$(addsuffix .md,$(addprefix Doxygen/xml/,$(WIKI))) \
|
||||
$(addsuffix .md,$(addprefix Doxygen/wiki/,$(WIKI)))
|
||||
|
|
|
@ -291,51 +291,50 @@ DOXYGEN = \
|
|||
################################################################################
|
||||
|
||||
WIKI = \
|
||||
AQLBasics.md \
|
||||
Actions.md \
|
||||
AvocadoErrors.md \
|
||||
AvocadoScript.md \
|
||||
CommandLine.md \
|
||||
CommandLineAvocado.md \
|
||||
CommandLineLogging.md \
|
||||
CommandLineRandom.md \
|
||||
CommandLineScheduler.md \
|
||||
Compiling.md \
|
||||
DBAdmin.md \
|
||||
DefineAction.md \
|
||||
ExamplesSetup.md \
|
||||
Glossary.md \
|
||||
Graphs.md \
|
||||
Home.md \
|
||||
HttpCollection.md \
|
||||
HttpIndex.md \
|
||||
HttpInterface.md \
|
||||
IndexGeo.md \
|
||||
IndexHash.md \
|
||||
IndexSkiplist.md \
|
||||
IndexUsage.md \
|
||||
Indexes.md \
|
||||
InstallManual.md \
|
||||
Installing.md \
|
||||
JSModuleActions.md \
|
||||
JSModuleConsole.md \
|
||||
JSModuleFs.md \
|
||||
JSModuleGraph.md \
|
||||
JSModuleInternal.md \
|
||||
JSModules.md \
|
||||
JavaScriptFunc.md \
|
||||
JavaScriptFuncIndex.md \
|
||||
Key-Value.md \
|
||||
OTWP.md \
|
||||
Optimizer.md \
|
||||
RefManual.md \
|
||||
RestCursor.md \
|
||||
RestDocument.md \
|
||||
RestEdge.md \
|
||||
RestSystem.md \
|
||||
SimpleQueries.md \
|
||||
UserManualServer.md \
|
||||
UserManualShell.md \
|
||||
UserManualShellStartStop.md \
|
||||
jsUnity.md
|
||||
|
||||
AQLBasics \
|
||||
Actions \
|
||||
AvocadoErrors \
|
||||
AvocadoScript \
|
||||
CommandLine \
|
||||
CommandLineAvocado \
|
||||
CommandLineLogging \
|
||||
CommandLineRandom \
|
||||
CommandLineScheduler \
|
||||
Compiling \
|
||||
DBAdmin \
|
||||
DefineAction \
|
||||
ExamplesSetup \
|
||||
Glossary \
|
||||
Graphs \
|
||||
Home \
|
||||
HttpCollection \
|
||||
HttpIndex \
|
||||
HttpInterface \
|
||||
IndexGeo \
|
||||
IndexHash \
|
||||
IndexSkiplist \
|
||||
IndexUsage \
|
||||
Indexes \
|
||||
InstallManual \
|
||||
Installing \
|
||||
JSModuleActions \
|
||||
JSModuleConsole \
|
||||
JSModuleFs \
|
||||
JSModuleGraph \
|
||||
JSModuleInternal \
|
||||
JSModules \
|
||||
JavaScriptFunc \
|
||||
JavaScriptFuncIndex \
|
||||
Key-Value \
|
||||
OTWP \
|
||||
Optimizer \
|
||||
RefManual \
|
||||
RestCursor \
|
||||
RestDocument \
|
||||
RestEdge \
|
||||
RestSystem \
|
||||
SimpleQueries \
|
||||
UserManualServer \
|
||||
UserManualShell \
|
||||
UserManualShellStartStop \
|
||||
jsUnity
|
||||
|
|
107
Makefile.in
107
Makefile.in
|
@ -542,8 +542,9 @@ BUILT_SOURCES = build.h $(JAVASCRIPT_HEADER) $(FLEX_FILES) \
|
|||
|
||||
################################################################################
|
||||
################################################################################
|
||||
CLEANUP = $(DOXYGEN) $(addprefix Doxygen/xml/,$(WIKI)) $(addprefix \
|
||||
Doxygen/wiki/,$(WIKI)) $(JAVASCRIPT_HEADER) $(am__append_1) \
|
||||
CLEANUP = $(DOXYGEN) $(addsuffix .md,$(addprefix \
|
||||
Doxygen/xml/,$(WIKI))) $(addsuffix .md,$(addprefix \
|
||||
Doxygen/wiki/,$(WIKI))) $(JAVASCRIPT_HEADER) $(am__append_1) \
|
||||
$(am__append_2)
|
||||
noinst_LIBRARIES = libavocado.a
|
||||
nobase_pkgdata_DATA = \
|
||||
|
@ -824,53 +825,53 @@ DOXYGEN = \
|
|||
################################################################################
|
||||
################################################################################
|
||||
WIKI = \
|
||||
AQLBasics.md \
|
||||
Actions.md \
|
||||
AvocadoErrors.md \
|
||||
AvocadoScript.md \
|
||||
CommandLine.md \
|
||||
CommandLineAvocado.md \
|
||||
CommandLineLogging.md \
|
||||
CommandLineRandom.md \
|
||||
CommandLineScheduler.md \
|
||||
Compiling.md \
|
||||
DBAdmin.md \
|
||||
DefineAction.md \
|
||||
ExamplesSetup.md \
|
||||
Glossary.md \
|
||||
Graphs.md \
|
||||
Home.md \
|
||||
HttpCollection.md \
|
||||
HttpIndex.md \
|
||||
HttpInterface.md \
|
||||
IndexGeo.md \
|
||||
IndexHash.md \
|
||||
IndexSkiplist.md \
|
||||
IndexUsage.md \
|
||||
Indexes.md \
|
||||
InstallManual.md \
|
||||
Installing.md \
|
||||
JSModuleActions.md \
|
||||
JSModuleConsole.md \
|
||||
JSModuleFs.md \
|
||||
JSModuleGraph.md \
|
||||
JSModuleInternal.md \
|
||||
JSModules.md \
|
||||
JavaScriptFunc.md \
|
||||
JavaScriptFuncIndex.md \
|
||||
Key-Value.md \
|
||||
OTWP.md \
|
||||
Optimizer.md \
|
||||
RefManual.md \
|
||||
RestCursor.md \
|
||||
RestDocument.md \
|
||||
RestEdge.md \
|
||||
RestSystem.md \
|
||||
SimpleQueries.md \
|
||||
UserManualServer.md \
|
||||
UserManualShell.md \
|
||||
UserManualShellStartStop.md \
|
||||
jsUnity.md
|
||||
AQLBasics \
|
||||
Actions \
|
||||
AvocadoErrors \
|
||||
AvocadoScript \
|
||||
CommandLine \
|
||||
CommandLineAvocado \
|
||||
CommandLineLogging \
|
||||
CommandLineRandom \
|
||||
CommandLineScheduler \
|
||||
Compiling \
|
||||
DBAdmin \
|
||||
DefineAction \
|
||||
ExamplesSetup \
|
||||
Glossary \
|
||||
Graphs \
|
||||
Home \
|
||||
HttpCollection \
|
||||
HttpIndex \
|
||||
HttpInterface \
|
||||
IndexGeo \
|
||||
IndexHash \
|
||||
IndexSkiplist \
|
||||
IndexUsage \
|
||||
Indexes \
|
||||
InstallManual \
|
||||
Installing \
|
||||
JSModuleActions \
|
||||
JSModuleConsole \
|
||||
JSModuleFs \
|
||||
JSModuleGraph \
|
||||
JSModuleInternal \
|
||||
JSModules \
|
||||
JavaScriptFunc \
|
||||
JavaScriptFuncIndex \
|
||||
Key-Value \
|
||||
OTWP \
|
||||
Optimizer \
|
||||
RefManual \
|
||||
RestCursor \
|
||||
RestDocument \
|
||||
RestEdge \
|
||||
RestSystem \
|
||||
SimpleQueries \
|
||||
UserManualServer \
|
||||
UserManualShell \
|
||||
UserManualShellStartStop \
|
||||
jsUnity
|
||||
|
||||
@ENABLE_BOOST_TEST_TRUE@UnitTests_test_suite_LDADD = -L@top_builddir@ -lavocado -lboost_unit_test_framework
|
||||
@ENABLE_BOOST_TEST_TRUE@UnitTests_test_suite_DEPENDENCIES = @top_builddir@/libavocado.a
|
||||
|
@ -2549,10 +2550,10 @@ doxygen: Doxygen/avocado.doxy $(DOXYGEN)
|
|||
|
||||
.PHONY: wiki
|
||||
|
||||
wiki: doxygen $(addprefix Doxygen/xml/,$(WIKI))
|
||||
wiki: doxygen $(addsuffix .md,$(addprefix Doxygen/xml/,$(WIKI)))
|
||||
@test -d Doxygen/wiki || mkdir Doxygen/wiki
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/pandoc.sh Doxygen/xml/$$w; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/md2html.sh Doxygen/wiki/$$w; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/pandoc.sh Doxygen/xml/$$w.md; done
|
||||
@for w in $(WIKI); do @top_srcdir@/Doxygen/Scripts/md2html.sh Doxygen/wiki/$$w.md; done
|
||||
|
||||
.setup-directories:
|
||||
@test -d js || mkdir js
|
||||
|
@ -2581,6 +2582,8 @@ js/server/js-%.h: @srcdir@/js/server/%.js .setup-directories
|
|||
@ENABLE_BOOST_TEST_FALSE@unittests:
|
||||
@ENABLE_BOOST_TEST_FALSE@ @echo "enable unit-testing with 'configure --with-boost-test'"
|
||||
|
||||
-include Makefile.local
|
||||
|
||||
@ENABLE_FLEX_TRUE@JsonParser/%.c: @srcdir@/JsonParser/%.l
|
||||
@ENABLE_FLEX_TRUE@ @top_srcdir@/config/flex-c.sh $(LEX) $@ $<
|
||||
|
||||
|
|
|
@ -579,7 +579,7 @@ bool QLAstQueryAddGeoRestriction (QL_ast_query_t* query,
|
|||
restriction->_arg._radius = restrictionNode->_value._doubleValue;
|
||||
}
|
||||
else {
|
||||
restriction->_arg._numDocuments = restrictionNode->_value._intValue;
|
||||
restriction->_arg._numDocuments = (size_t) restrictionNode->_value._intValue;
|
||||
}
|
||||
|
||||
TRI_InsertKeyAssociativePointer(&query->_geo._restrictions,
|
||||
|
|
|
@ -73,7 +73,7 @@ void QLFormatterPrintBlockStart (QL_formatter_t* formatter, const char* name) {
|
|||
/// @brief Print end of a block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QLFormatterPrintBlockEnd (QL_formatter_t* formatter, const char* name) {
|
||||
void QLFormatterPrintBlockEnd (QL_formatter_t* formatter) {
|
||||
QLFormatterPrintIndentation(formatter);
|
||||
printf("}\n");
|
||||
}
|
||||
|
@ -82,9 +82,9 @@ void QLFormatterPrintBlockEnd (QL_formatter_t* formatter, const char* name) {
|
|||
/// @brief Print an indented int value
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QLFormatterPrintInt (QL_formatter_t* formatter, const char* name, uint64_t value) {
|
||||
void QLFormatterPrintInt (QL_formatter_t* formatter, const char* name, int64_t value) {
|
||||
QLFormatterPrintIndentation(formatter);
|
||||
printf("%s: %lu\n",name,(unsigned long) value);
|
||||
printf("%s: %li\n",name, (long) value);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -132,7 +132,7 @@ void QLFormatterDump (TRI_query_node_t* node, QL_formatter_t* formatter) {
|
|||
next = next->_next;
|
||||
}
|
||||
QLFormatterIndentationDec(formatter);
|
||||
QLFormatterPrintBlockEnd(formatter,"");
|
||||
QLFormatterPrintBlockEnd(formatter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ void QLFormatterDump (TRI_query_node_t* node, QL_formatter_t* formatter) {
|
|||
}
|
||||
|
||||
QLFormatterIndentationDec(formatter);
|
||||
QLFormatterPrintBlockEnd(formatter,"");
|
||||
QLFormatterPrintBlockEnd(formatter);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -80,13 +80,13 @@ void QLFormatterPrintBlockStart (QL_formatter_t*, const char*);
|
|||
/// @brief Print end of a block
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QLFormatterPrintBlockEnd (QL_formatter_t*, const char*);
|
||||
void QLFormatterPrintBlockEnd (QL_formatter_t*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Print an indented int value
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void QLFormatterPrintInt (QL_formatter_t*, const char*, uint64_t);
|
||||
void QLFormatterPrintInt (QL_formatter_t*, const char*, int64_t);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief Print an indented double value
|
||||
|
|
|
@ -570,7 +570,7 @@ HttpResponse* TRI_ExecuteActionVocBase (TRI_vocbase_t* vocbase,
|
|||
if (v8Headers->IsObject()) {
|
||||
v8::Handle<v8::Array> props = v8Headers->GetPropertyNames();
|
||||
|
||||
for (size_t i = 0; i < props->Length(); i++) {
|
||||
for (uint32_t i = 0; i < props->Length(); i++) {
|
||||
v8::Handle<v8::Value> key = props->Get(v8::Integer::New(i));
|
||||
response->setHeader(TRI_ObjectToString(key), TRI_ObjectToString(v8Headers->Get(key)));
|
||||
}
|
||||
|
|
|
@ -279,7 +279,7 @@ static v8::Handle<v8::Object> CreateErrorObject (int errorNumber, string const&
|
|||
|
||||
v8::Handle<v8::Object> errorObject = v8g->ErrorTempl->NewInstance();
|
||||
|
||||
string msg = TRI_last_error() + string(": ") + message;
|
||||
string msg = TRI_errno_string(errorNumber) + string(": ") + message;
|
||||
|
||||
errorObject->Set(v8::String::New("errorNum"), v8::Number::New(errorNumber));
|
||||
errorObject->Set(v8::String::New("errorMessage"), v8::String::New(msg.c_str()));
|
||||
|
@ -1187,11 +1187,11 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief looks up a document
|
||||
///
|
||||
/// @FUN{document(@FA{document-identifier})}
|
||||
/// @FUN{@FA{collection}.document(@FA{document-identifier})}
|
||||
///
|
||||
/// The @FN{document} operator finds a document given it's identifier. It
|
||||
/// returns the document. Undefined is returned if the document identifier is
|
||||
/// not valid.
|
||||
/// The @FN{document} operator finds a document given it's identifier.
|
||||
/// It returns the document. @LIT{undefined} is returned if the
|
||||
/// document identifier is not known.
|
||||
///
|
||||
/// Note that the returned docuement contains two pseudo-attributes, namely
|
||||
/// @LIT{_id} and @LIT{_rev}. The attribute @LIT{_id} contains the document
|
||||
|
@ -1202,7 +1202,7 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
|
|||
/// @verbinclude simple1
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static v8::Handle<v8::Value> JS_DocumentQuery (v8::Arguments const& argv) {
|
||||
static v8::Handle<v8::Value> JS_DocumentVocbaseCol (v8::Arguments const& argv) {
|
||||
v8::HandleScope scope;
|
||||
|
||||
// extract the collection
|
||||
|
@ -1218,7 +1218,9 @@ static v8::Handle<v8::Value> JS_DocumentQuery (v8::Arguments const& argv) {
|
|||
// first and only argument schould be an document idenfifier
|
||||
if (argv.Length() != 1) {
|
||||
ReleaseCollection(collection);
|
||||
return scope.Close(v8::ThrowException(v8::String::New("usage: document_wrapped(<document-identifier>)")));
|
||||
return scope.Close(v8::ThrowException(
|
||||
CreateErrorObject(TRI_ERROR_BAD_PARAMETER,
|
||||
"usage: document(<document-identifier>)")));
|
||||
}
|
||||
|
||||
v8::Handle<v8::Value> arg1 = argv[0];
|
||||
|
@ -1227,12 +1229,16 @@ static v8::Handle<v8::Value> JS_DocumentQuery (v8::Arguments const& argv) {
|
|||
|
||||
if (! IsDocumentId(arg1, cid, did)) {
|
||||
ReleaseCollection(collection);
|
||||
return scope.Close(v8::ThrowException(v8::String::New("<document-idenifier> must be a document identifier")));
|
||||
return scope.Close(v8::ThrowException(
|
||||
CreateErrorObject(TRI_ERROR_BAD_PARAMETER,
|
||||
"<document-idenifier> must be a document identifier")));
|
||||
}
|
||||
|
||||
if (cid != collection->_collection->base._cid) {
|
||||
ReleaseCollection(collection);
|
||||
return scope.Close(v8::ThrowException(v8::String::New("cannot execute cross collection query")));
|
||||
return scope.Close(v8::ThrowException(
|
||||
CreateErrorObject(TRI_ERROR_AVOCADO_CROSS_COLLECTION_REQUEST,
|
||||
"cannot execute cross collection query")));
|
||||
}
|
||||
|
||||
// .............................................................................
|
||||
|
@ -1265,7 +1271,9 @@ static v8::Handle<v8::Value> JS_DocumentQuery (v8::Arguments const& argv) {
|
|||
|
||||
if (document._did == 0) {
|
||||
ReleaseCollection(collection);
|
||||
return scope.Close(v8::ThrowException(v8::String::New("document not found")));
|
||||
return scope.Close(v8::ThrowException(
|
||||
CreateErrorObject(TRI_ERROR_AVOCADO_DOCUMENT_NOT_FOUND,
|
||||
"document not found")));
|
||||
}
|
||||
|
||||
ReleaseCollection(collection);
|
||||
|
@ -5155,7 +5163,7 @@ void TRI_InitV8VocBridge (v8::Handle<v8::Context> context, TRI_vocbase_t* vocbas
|
|||
rt->Set(AllFuncName, v8::FunctionTemplate::New(JS_AllQuery));
|
||||
rt->Set(CountFuncName, v8::FunctionTemplate::New(JS_CountVocbaseCol));
|
||||
rt->Set(DeleteFuncName, v8::FunctionTemplate::New(JS_DeleteVocbaseCol));
|
||||
rt->Set(DocumentFuncName, v8::FunctionTemplate::New(JS_DocumentQuery));
|
||||
rt->Set(DocumentFuncName, v8::FunctionTemplate::New(JS_DocumentVocbaseCol));
|
||||
rt->Set(DropFuncName, v8::FunctionTemplate::New(JS_DropVocbaseCol));
|
||||
rt->Set(DropIndexFuncName, v8::FunctionTemplate::New(JS_DropIndexVocbaseCol));
|
||||
rt->Set(EnsureGeoIndexFuncName, v8::FunctionTemplate::New(JS_EnsureGeoIndexVocbaseCol));
|
||||
|
@ -5194,7 +5202,7 @@ void TRI_InitV8VocBridge (v8::Handle<v8::Context> context, TRI_vocbase_t* vocbas
|
|||
rt->Set(AllFuncName, v8::FunctionTemplate::New(JS_AllQuery));
|
||||
rt->Set(CountFuncName, v8::FunctionTemplate::New(JS_CountVocbaseCol));
|
||||
rt->Set(DeleteFuncName, v8::FunctionTemplate::New(JS_DeleteVocbaseCol));
|
||||
rt->Set(DocumentFuncName, v8::FunctionTemplate::New(JS_DocumentQuery));
|
||||
rt->Set(DocumentFuncName, v8::FunctionTemplate::New(JS_DocumentVocbaseCol));
|
||||
rt->Set(DropFuncName, v8::FunctionTemplate::New(JS_DropVocbaseCol));
|
||||
rt->Set(DropIndexFuncName, v8::FunctionTemplate::New(JS_DropIndexVocbaseCol));
|
||||
rt->Set(EnsureGeoIndexFuncName, v8::FunctionTemplate::New(JS_EnsureGeoIndexVocbaseCol));
|
||||
|
|
|
@ -54,9 +54,9 @@ static bool TransformDataSkipLimit (TRI_rc_result_t* result,
|
|||
return TRI_SliceSelectResult(_result, 0, 0);
|
||||
}
|
||||
|
||||
// positive limit, skip and slice from front
|
||||
// positive limit. skip and slice from front
|
||||
if (limit > 0) {
|
||||
if (_result->_numRows - skip < limit) {
|
||||
if ((int64_t) limit > (int64_t) (_result->_numRows - skip)) {
|
||||
return TRI_SliceSelectResult(_result, skip, _result->_numRows - skip);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ static bool TransformDataSkipLimit (TRI_rc_result_t* result,
|
|||
}
|
||||
|
||||
// negative limit, slice from back
|
||||
if (_result->_numRows - skip < -limit) {
|
||||
if ((int64_t) (_result->_numRows - skip) < (int64_t) (-limit)) {
|
||||
return TRI_SliceSelectResult(_result, 0, _result->_numRows - skip);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ ModuleCache["/internal"].exports.errors = {
|
|||
"ERROR_ILLEGAL_OPTION" : { "code" : 7, "message" : "illegal option" },
|
||||
"ERROR_DEAD_PID" : { "code" : 8, "message" : "dead process identifier" },
|
||||
"ERROR_NOT_IMPLEMENTED" : { "code" : 9, "message" : "not implemented" },
|
||||
"ERROR_BAD_PARAMETER" : { "code" : 10, "message" : "bad parameter" },
|
||||
"ERROR_HTTP_BAD_PARAMETER" : { "code" : 400, "message" : "bad parameter" },
|
||||
"ERROR_HTTP_NOT_FOUND" : { "code" : 404, "message" : "not found" },
|
||||
"ERROR_HTTP_METHOD_NOT_ALLOWED" : { "code" : 405, "message" : "method not supported" },
|
||||
|
@ -49,6 +50,7 @@ ModuleCache["/internal"].exports.errors = {
|
|||
"ERROR_AVOCADO_UNIQUE_CONSTRAINT_VIOLATED" : { "code" : 1210, "message" : "unique constraint violated" },
|
||||
"ERROR_AVOCADO_GEO_INDEX_VIOLATED" : { "code" : 1211, "message" : "geo index violated" },
|
||||
"ERROR_AVOCADO_INDEX_NOT_FOUND" : { "code" : 1212, "message" : "index not found" },
|
||||
"ERROR_AVOCADO_CROSS_COLLECTION_REQUEST" : { "code" : 1213, "message" : "cross collection request not allowed" },
|
||||
"ERROR_AVOCADO_DATAFILE_FULL" : { "code" : 1300, "message" : "datafile full" },
|
||||
"ERROR_QUERY_KILLED" : { "code" : 1500, "message" : "query killed" },
|
||||
"ERROR_QUERY_PARSE" : { "code" : 1501, "message" : "parse error: %s" },
|
||||
|
@ -98,5 +100,6 @@ ModuleCache["/internal"].exports.errors = {
|
|||
"SIMPLE_CLIENT_COULD_NOT_CONNECT" : { "code" : 2001, "message" : "could not connect to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_WRITE" : { "code" : 2002, "message" : "could not write to server" },
|
||||
"SIMPLE_CLIENT_COULD_NOT_READ" : { "code" : 2003, "message" : "could not read from server" },
|
||||
"ERROR_AVOCADO_INDEX_PQ_INSERT_FAILED" : { "code" : 3100, "message" : "priority queue insert failure" },
|
||||
};
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ static string JS_common_bootstrap_errors =
|
|||
" \"ERROR_ILLEGAL_OPTION\" : { \"code\" : 7, \"message\" : \"illegal option\" }, \n"
|
||||
" \"ERROR_DEAD_PID\" : { \"code\" : 8, \"message\" : \"dead process identifier\" }, \n"
|
||||
" \"ERROR_NOT_IMPLEMENTED\" : { \"code\" : 9, \"message\" : \"not implemented\" }, \n"
|
||||
" \"ERROR_BAD_PARAMETER\" : { \"code\" : 10, \"message\" : \"bad parameter\" }, \n"
|
||||
" \"ERROR_HTTP_BAD_PARAMETER\" : { \"code\" : 400, \"message\" : \"bad parameter\" }, \n"
|
||||
" \"ERROR_HTTP_NOT_FOUND\" : { \"code\" : 404, \"message\" : \"not found\" }, \n"
|
||||
" \"ERROR_HTTP_METHOD_NOT_ALLOWED\" : { \"code\" : 405, \"message\" : \"method not supported\" }, \n"
|
||||
|
@ -50,6 +51,7 @@ static string JS_common_bootstrap_errors =
|
|||
" \"ERROR_AVOCADO_UNIQUE_CONSTRAINT_VIOLATED\" : { \"code\" : 1210, \"message\" : \"unique constraint violated\" }, \n"
|
||||
" \"ERROR_AVOCADO_GEO_INDEX_VIOLATED\" : { \"code\" : 1211, \"message\" : \"geo index violated\" }, \n"
|
||||
" \"ERROR_AVOCADO_INDEX_NOT_FOUND\" : { \"code\" : 1212, \"message\" : \"index not found\" }, \n"
|
||||
" \"ERROR_AVOCADO_CROSS_COLLECTION_REQUEST\" : { \"code\" : 1213, \"message\" : \"cross collection request not allowed\" }, \n"
|
||||
" \"ERROR_AVOCADO_DATAFILE_FULL\" : { \"code\" : 1300, \"message\" : \"datafile full\" }, \n"
|
||||
" \"ERROR_QUERY_KILLED\" : { \"code\" : 1500, \"message\" : \"query killed\" }, \n"
|
||||
" \"ERROR_QUERY_PARSE\" : { \"code\" : 1501, \"message\" : \"parse error: %s\" }, \n"
|
||||
|
@ -99,6 +101,7 @@ static string JS_common_bootstrap_errors =
|
|||
" \"SIMPLE_CLIENT_COULD_NOT_CONNECT\" : { \"code\" : 2001, \"message\" : \"could not connect to server\" }, \n"
|
||||
" \"SIMPLE_CLIENT_COULD_NOT_WRITE\" : { \"code\" : 2002, \"message\" : \"could not write to server\" }, \n"
|
||||
" \"SIMPLE_CLIENT_COULD_NOT_READ\" : { \"code\" : 2003, \"message\" : \"could not read from server\" }, \n"
|
||||
" \"ERROR_AVOCADO_INDEX_PQ_INSERT_FAILED\" : { \"code\" : 3100, \"message\" : \"priority queue insert failure\" }, \n"
|
||||
"};\n"
|
||||
"\n"
|
||||
;
|
||||
|
|
Loading…
Reference in New Issue