mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'devel' of github.com:triAGENS/ArangoDB into devel
This commit is contained in:
commit
29b246319d
|
@ -1251,7 +1251,11 @@ typedef struct
|
|||
#include "ev_wrap.h"
|
||||
|
||||
static struct ev_loop default_loop_struct;
|
||||
#ifdef EV_API_STATIC
|
||||
EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
|
||||
#else
|
||||
struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
|
@ -1378,23 +1382,23 @@ array_realloc (int elem, void *base, int *cur, int cnt)
|
|||
return ev_realloc (base, elem * *cur);
|
||||
}
|
||||
|
||||
#define array_init_zero(base,count) \
|
||||
#define array_init_zero(base,count) \
|
||||
memset ((void *)(base), 0, sizeof (*(base)) * (count))
|
||||
|
||||
#define array_needsize(type,base,cur,cnt,init) \
|
||||
if (expect_false ((cnt) > (cur))) \
|
||||
{ \
|
||||
int ecb_unused ocur_ = (cur); \
|
||||
(base) = (type *)array_realloc \
|
||||
(sizeof (type), (base), &(cur), (cnt)); \
|
||||
init ((base) + (ocur_), (cur) - ocur_); \
|
||||
#define array_needsize(type,base,cur,cnt,init) \
|
||||
if (expect_false ((cnt) > (cur))) \
|
||||
{ \
|
||||
int ecb_unused ocur_ = (cur); \
|
||||
(base) = (type *)array_realloc \
|
||||
(sizeof (type), (base), &(cur), (cnt)); \
|
||||
init ((base) + (ocur_), (cur) - ocur_); \
|
||||
}
|
||||
|
||||
#if 0
|
||||
#define array_slim(type,stem) \
|
||||
if (stem ## max < array_roundsize (stem ## cnt >> 2)) \
|
||||
{ \
|
||||
stem ## max = array_roundsize (stem ## cnt >> 1); \
|
||||
#define array_slim(type,stem) \
|
||||
if (stem ## max < array_roundsize (stem ## cnt >> 2)) \
|
||||
{ \
|
||||
stem ## max = array_roundsize (stem ## cnt >> 1); \
|
||||
base = (type *)ev_realloc (base, sizeof (type) * (stem ## max));\
|
||||
fprintf (stderr, "slimmed down " # stem " to %d\n", stem ## max);/*D*/\
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ mrb_obj_value(void *p)
|
|||
}
|
||||
|
||||
static inline mrb_value
|
||||
mrb_false_value()
|
||||
mrb_false_value(void)
|
||||
{
|
||||
mrb_value v;
|
||||
|
||||
|
@ -153,7 +153,7 @@ mrb_false_value()
|
|||
}
|
||||
|
||||
static inline mrb_value
|
||||
mrb_nil_value()
|
||||
mrb_nil_value(void)
|
||||
{
|
||||
mrb_value v;
|
||||
|
||||
|
@ -163,7 +163,7 @@ mrb_nil_value()
|
|||
}
|
||||
|
||||
static inline mrb_value
|
||||
mrb_true_value()
|
||||
mrb_true_value(void)
|
||||
{
|
||||
mrb_value v;
|
||||
|
||||
|
@ -173,7 +173,7 @@ mrb_true_value()
|
|||
}
|
||||
|
||||
static inline mrb_value
|
||||
mrb_undef_value()
|
||||
mrb_undef_value(void)
|
||||
{
|
||||
mrb_value v;
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
typedef struct global_variable {
|
||||
int counter;
|
||||
mrb_value *data;
|
||||
mrb_value (*getter)();
|
||||
void (*setter)();
|
||||
mrb_value (*getter)(void);
|
||||
void (*setter)(void);
|
||||
//void (*marker)();
|
||||
//int block_trace;
|
||||
//struct trace_var *trace;
|
||||
|
|
|
@ -811,8 +811,12 @@ static TRI_aql_node_t* OptimiseBinaryArithmeticOperation (TRI_aql_context_t* con
|
|||
}
|
||||
value = fmod(TRI_GetNumericNodeValueAql(lhs), TRI_GetNumericNodeValueAql(rhs));
|
||||
}
|
||||
else {
|
||||
value = 0.0;
|
||||
}
|
||||
|
||||
node = TRI_CreateNodeValueDoubleAql(context, value);
|
||||
|
||||
if (!node) {
|
||||
TRI_SetErrorContextAql(context, TRI_ERROR_OUT_OF_MEMORY, NULL);
|
||||
return NULL;
|
||||
|
|
|
@ -838,7 +838,6 @@ static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
|
|||
static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
|
||||
#endif
|
||||
|
||||
#define YY_NO_INPUT
|
||||
#ifndef YY_NO_INPUT
|
||||
/* %if-c-only Standard (non-C++) definition */
|
||||
/* %not-for-header */
|
||||
|
@ -1683,7 +1682,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
yyg->yy_n_chars, (size_t) num_to_read );
|
||||
yyg->yy_n_chars, (int) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
|
||||
}
|
||||
|
|
|
@ -62,11 +62,13 @@ using namespace std;
|
|||
/// @brief word break characters
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if 0
|
||||
static char WordBreakCharacters[] = {
|
||||
' ', '\t', '\n', '"', '\\', '\'', '`', '@',
|
||||
'<', '>', '=', ';', '|', '&', '{', '}', '(', ')',
|
||||
'\0'
|
||||
};
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
|
@ -199,6 +201,7 @@ static char* CompletionGenerator (char const* text, int state) {
|
|||
/// @brief attempted completion
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if 0
|
||||
static char** AttemptedCompletion (char const* text, int start, int end) {
|
||||
char** result;
|
||||
|
||||
|
@ -219,6 +222,7 @@ static char** AttemptedCompletion (char const* text, int start, int end) {
|
|||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
|
@ -281,7 +285,7 @@ bool MRLineEditor::open (const bool autoComplete) {
|
|||
|
||||
bool MRLineEditor::isComplete (string const& source, size_t lineno, size_t column) {
|
||||
|
||||
#ifdef TRI_ENABLE_MRUBY
|
||||
#ifdef TRI_ENABLE_MRUBY
|
||||
char const* msg = "syntax error, unexpected $end";
|
||||
char* text = TRI_DuplicateString(source.c_str());
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ MR_state_t;
|
|||
/// @brief opens a new context
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MR_state_t* MR_OpenShell ();
|
||||
MR_state_t* MR_OpenShell (void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief creates a ArangoError
|
||||
|
|
12
README.md
12
README.md
|
@ -48,7 +48,7 @@ The ArangoDB shell will be install as
|
|||
Start the server:
|
||||
|
||||
> mkdir /tmp/vocbase
|
||||
> ./arango /tmp/vocbase
|
||||
> ./arangod /tmp/vocbase
|
||||
2012-03-30T12:54:19Z [11794] INFO ArangoDB (version 0.x.y) is ready for business
|
||||
2012-03-30T12:54:19Z [11794] INFO HTTP client port: 127.0.0.1:8529
|
||||
2012-03-30T12:54:19Z [11794] INFO HTTP admin port: 127.0.0.1:8530
|
||||
|
@ -56,7 +56,7 @@ Start the server:
|
|||
|
||||
Start the shell in another windows:
|
||||
|
||||
> ./avocsh
|
||||
> ./arangosh
|
||||
_
|
||||
__ _ _ __ __ _ _ __ __ _ ___ ___| |__
|
||||
/ _` | '__/ _` | '_ \ / _` |/ _ \/ __| '_ \
|
||||
|
@ -64,19 +64,19 @@ Start the shell in another windows:
|
|||
\__,_|_| \__,_|_| |_|\__, |\___/|___/_| |_|
|
||||
|___/
|
||||
|
||||
Welcome to avocsh 0.3.5. Copyright (c) 2012 triAGENS GmbH.
|
||||
Welcome to arangosh 0.3.5. Copyright (c) 2012 triAGENS GmbH.
|
||||
Using Google V8 3.9.4.0 JavaScript engine.
|
||||
Using READLINE 6.1.
|
||||
|
||||
Connected to Arango DB 127.0.0.1:8529 Version 0.3.5
|
||||
|
||||
avocsh> db._create("examples")
|
||||
arangosh> db._create("examples")
|
||||
[ArangoCollection 106097, "examples]
|
||||
|
||||
avocsh> db.examples.save({ Hallo: "World" });
|
||||
arangosh> db.examples.save({ Hallo: "World" });
|
||||
{"error":false,"_id":"106097/2333739","_rev":2333739}
|
||||
|
||||
avocsh> db.examples.all();
|
||||
arangosh> db.examples.all();
|
||||
[{ _id : "82883/1524675", _rev : 1524675, Hallo : "World" }]
|
||||
|
||||
## Caveat
|
||||
|
|
|
@ -863,7 +863,8 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper, TRI_shape_value_t* dst, T
|
|||
a = (TRI_array_shape_t*) (ptr = TRI_Allocate(shaper->_memoryZone, i, true));
|
||||
|
||||
if (ptr == NULL) {
|
||||
// TODO: FIXME my compiler complains about e being potentially undefined. what to do?
|
||||
e = values + n;
|
||||
|
||||
for (p = values; p < e; ++p) {
|
||||
if (p->_value != NULL) {
|
||||
TRI_Free(shaper->_memoryZone, p->_value);
|
||||
|
|
|
@ -56,6 +56,13 @@ LineEditor::LineEditor (string const& history)
|
|||
rl_initialize();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief destructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
LineEditor::~LineEditor () {
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -89,6 +89,12 @@ class LineEditor {
|
|||
|
||||
LineEditor (std::string const& history);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief destructor
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
virtual ~LineEditor ();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -662,7 +662,8 @@ static bool FillShapeValueArray (TRI_shaper_t* shaper,
|
|||
a = (TRI_array_shape_t*) (ptr = (char*) TRI_Allocate(shaper->_memoryZone, i, true));
|
||||
|
||||
if (ptr == NULL) {
|
||||
// TODO FIXME: my compiler complains about e being potentially undefined. what to do?
|
||||
e = values + n;
|
||||
|
||||
for (p = values; p < e; ++p) {
|
||||
if (p->_value != NULL) {
|
||||
TRI_Free(shaper->_memoryZone, p->_value);
|
||||
|
@ -1340,7 +1341,7 @@ bool TRI_IdentifiersObjectReference (v8::Handle<v8::Value> value, TRI_voc_cid_t&
|
|||
did = 0;
|
||||
|
||||
if (value->IsNumber() || value->IsNumberObject()) {
|
||||
did = TRI_ObjectToDouble(value, error);
|
||||
did = (TRI_voc_did_t) TRI_ObjectToDouble(value, error);
|
||||
return ! error;
|
||||
}
|
||||
|
||||
|
|
|
@ -1352,7 +1352,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
|
|||
|
||||
/* Read in more data. */
|
||||
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
|
||||
yyg->yy_n_chars, (size_t) num_to_read );
|
||||
yyg->yy_n_chars, (int) num_to_read );
|
||||
|
||||
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
|
||||
}
|
||||
|
|
|
@ -977,7 +977,7 @@ static v8::Handle<v8::Value> JS_AllQuery (v8::Arguments const& argv) {
|
|||
}
|
||||
|
||||
// limit
|
||||
for (; ptr < end && (TRI_voc_size_t) count < limit; ++ptr) {
|
||||
for (; ptr < end && count < limit; ++ptr) {
|
||||
if (*ptr) {
|
||||
TRI_doc_mptr_t const* d = (TRI_doc_mptr_t const*) *ptr;
|
||||
|
||||
|
|
|
@ -71,7 +71,7 @@ static TRI_doc_mptr_t CreateJson (TRI_doc_collection_t* collection,
|
|||
|
||||
if (shaped == 0) {
|
||||
collection->base._lastError = TRI_set_errno(TRI_ERROR_ARANGO_SHAPER_FAILED);
|
||||
result._did = 0;
|
||||
memset(&result, 0, sizeof(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ static TRI_doc_mptr_t UpdateJson (TRI_doc_collection_t* collection,
|
|||
|
||||
if (shaped == 0) {
|
||||
collection->base._lastError = TRI_set_errno(TRI_ERROR_ARANGO_SHAPER_FAILED);
|
||||
result._did = 0;
|
||||
memset(&result, 0, sizeof(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -331,7 +331,7 @@ static TRI_doc_mptr_t CreateDocument (TRI_sim_collection_t* sim,
|
|||
sim->base.endWrite(&sim->base);
|
||||
}
|
||||
|
||||
mptr._did = 0;
|
||||
memset(&mptr, 0, sizeof(mptr));
|
||||
return mptr;
|
||||
}
|
||||
|
||||
|
@ -562,7 +562,7 @@ static TRI_doc_mptr_t UpdateDocument (TRI_sim_collection_t* collection,
|
|||
}
|
||||
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_CONFLICT);
|
||||
mptr._did = 0;
|
||||
memset(&mptr, 0, sizeof(mptr));
|
||||
return mptr;
|
||||
}
|
||||
}
|
||||
|
@ -1012,7 +1012,7 @@ static TRI_doc_mptr_t ReadShapedJson (TRI_doc_collection_t* document,
|
|||
header = TRI_LookupByKeyAssociativePointer(&collection->_primaryIndex, &did);
|
||||
|
||||
if (header == NULL || header->_deletion != 0) {
|
||||
result._did = 0;
|
||||
memset(&result, 0, sizeof(result));
|
||||
return result;
|
||||
}
|
||||
else {
|
||||
|
@ -1048,7 +1048,7 @@ static TRI_doc_mptr_t UpdateShapedJson (TRI_doc_collection_t* document,
|
|||
}
|
||||
|
||||
TRI_set_errno(TRI_ERROR_ARANGO_DOCUMENT_NOT_FOUND);
|
||||
mptr._did = 0;
|
||||
memset(&mptr, 0, sizeof(mptr));
|
||||
return mptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ extern size_t PageSize;
|
|||
/// @brief no limit
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define TRI_QRY_NO_LIMIT ((TRI_voc_size_t) UINT32_MAX)
|
||||
#define TRI_QRY_NO_LIMIT ((TRI_voc_size_t) (4294967295U))
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief no skip
|
||||
|
|
|
@ -9,7 +9,7 @@ echo
|
|||
|
||||
OPTIONS="--disable-dependency-tracking --disable-relative"
|
||||
PREFIX="--prefix=/usr --sysconfdir=/etc"
|
||||
RESULTS="arango avocsh avocirb"
|
||||
RESULTS="arangod arangosh arangoimp"
|
||||
|
||||
export CPPFLAGS=""
|
||||
export LDFLAGS=""
|
||||
|
@ -26,20 +26,23 @@ case $TRI_OS_LONG in
|
|||
|
||||
Linux-openSUSE-11.4*)
|
||||
echo "Using configuration for openSuSE 11.4"
|
||||
OPTIONS="$OPTIONS --disable-all-in-one --with-boost-test"
|
||||
OPTIONS="$OPTIONS --disable-all-in-one --with-boost-test --enable-mruby"
|
||||
LDD_INFO="yes"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
Linux-openSUSE-11*)
|
||||
echo "Using configuration for openSuSE 11"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one --enable-mruby"
|
||||
LDD_INFO="yes"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
Linux-Debian-6*)
|
||||
echo "Using configuration for Debian"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one --enable-mruby"
|
||||
LDD_INFO="yes"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
Linux-Debian*)
|
||||
|
@ -56,21 +59,24 @@ case $TRI_OS_LONG in
|
|||
|
||||
Linux-Ubuntu-11.10*)
|
||||
echo "Using configuration for Ubuntu"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one --enable-mruby"
|
||||
LDD_INFO="yes"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
Linux-Ubuntu-*)
|
||||
echo "Using configuration for Ubuntu"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one --enable-mruby"
|
||||
LDD_INFO="yes"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
Darwin*)
|
||||
echo "Using configuration for DARWIN"
|
||||
CPPFLAGS='-isystem /usr/include -isystem /opt/local/include -Wno-deprecated-declarations'
|
||||
LDFLAGS='-L/usr/lib -L/opt/local/lib' # need to use OpenSSL from system
|
||||
OPTIONS="$OPTIONS --enable-all-in-one"
|
||||
OPTIONS="$OPTIONS --enable-all-in-one --enable-mruby"
|
||||
RESULTS="$RESULTS arangoirb"
|
||||
;;
|
||||
|
||||
*)
|
||||
|
|
|
@ -26,7 +26,7 @@ test -f ${OUTPUT} || exit 1
|
|||
#############################################################################
|
||||
|
||||
cat ${OUTPUT} \
|
||||
| sed -e 's:(yy_n_chars), (size_t) num_to_read );:(yy_n_chars), (int) num_to_read );:' \
|
||||
| sed -e 's:yy_n_chars, (size_t) num_to_read );:yy_n_chars, (int) num_to_read );:' \
|
||||
> ${OUTPUT}.tmp
|
||||
|
||||
# give some information
|
||||
|
|
|
@ -8,7 +8,7 @@ echo "########################################################"
|
|||
|
||||
OPTIONS="--disable-dependency-tracking --disable-relative --enable-gcov"
|
||||
PREFIX="--prefix=/usr --sysconfdir=/etc"
|
||||
RESULTS="arango avocsh"
|
||||
RESULTS="arangod arangosh"
|
||||
|
||||
export CPPFLAGS=""
|
||||
export LDFLAGS=""
|
||||
|
|
Loading…
Reference in New Issue