1
0
Fork 0

Merge branch 'aql2' into mmh

This commit is contained in:
Max Neunhoeffer 2014-09-10 11:16:44 +02:00
commit 7bca4da5dc
3 changed files with 57 additions and 48 deletions

View File

@ -910,6 +910,8 @@ namespace triagens {
virtual ExecutionNode* clone () const {
std::vector<std::vector<RangeInfo>> ranges;
for (size_t i = 0; i < _ranges.size(); i++){
ranges.push_back(std::vector<RangeInfo>());
for (auto x: _ranges.at(i)){
ranges.at(i).push_back(x);
}

View File

@ -124,7 +124,7 @@ int Optimizer::createPlans (ExecutionPlan* plan,
int level;
auto p = _plans.pop_front(level);
if (level == maxRuleLevel) {
if (level >= maxRuleLevel) {
_newPlans.push_back(p, level); // nothing to do, just keep it
}
else { // find next rule

View File

@ -203,8 +203,7 @@ static inline uint64_t TRI_DecModU64(uint64_t i, uint64_t len) {
#endif
#endif
static inline void _backtrace(void)
{
static inline void _backtrace (void) {
#if HAVE_BACKTRACE
void* stack_frames[50];
size_t size, i;
@ -239,13 +238,15 @@ static inline void _backtrace(void)
*offset_end++ = '\0';
int status = 0;
char * demangled_name = abi::__cxa_demangle(mangled_name, 0, 0, &status);
if (demangled_name != nullptr) {
if (status == 0) {
fprintf(stderr, "%s() [%p] %s\n", strings[i], stack_frames[i], demangled_name);
}
else {
fprintf(stderr, "%s\n", strings[i]);
}
free(demangled_name);
TRI_SystemFree(demangled_name);
}
}
else
#endif
@ -253,18 +254,20 @@ static inline void _backtrace(void)
fprintf(stderr, "%s\n", strings[i]);
}
}
else
else {
fprintf(stderr, "[%p]\n", stack_frames[i]);
}
free(strings);
}
if (strings != NULL) {
TRI_SystemFree(strings);
}
#endif
}
#ifdef __cplusplus
#include <string>
#include <sstream>
static inline void _getBacktrace(std::string &btstr)
{
static inline void _getBacktrace (std::string& btstr) {
#if HAVE_BACKTRACE
void* stack_frames[50];
size_t size, i;
@ -300,6 +303,8 @@ static inline void _getBacktrace(std::string &btstr)
*offset_end++ = '\0';
int status = 0;
char * demangled_name = abi::__cxa_demangle(mangled_name, 0, 0, &status);
if (demangled_name != nullptr) {
if (status == 0) {
ss << stack_frames[i];
btstr += strings[i] +
@ -313,10 +318,10 @@ static inline void _getBacktrace(std::string &btstr)
btstr += strings[i] +
std::string("\n");
}
free(demangled_name);
TRI_SystemFree(demangled_name);
}
else
{
}
else {
btstr += strings[i] +
std::string("\n");
}
@ -327,7 +332,9 @@ static inline void _getBacktrace(std::string &btstr)
std::string("\n");
}
}
free(strings);
if (strings != NULL) {
TRI_SystemFree(strings);
}
#endif
}
#endif