summaryrefslogtreecommitdiff
path: root/storage/oqgraph/oqgraph_judy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/oqgraph/oqgraph_judy.cc')
-rw-r--r--storage/oqgraph/oqgraph_judy.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/storage/oqgraph/oqgraph_judy.cc b/storage/oqgraph/oqgraph_judy.cc
index 020cab57ed2..44c7e28e268 100644
--- a/storage/oqgraph/oqgraph_judy.cc
+++ b/storage/oqgraph/oqgraph_judy.cc
@@ -23,6 +23,28 @@
*/
#include "oqgraph_judy.h"
+
+/*
+ Currently the only active code that can return error is:
+ judy_bitset::reset()/J1U()
+ judy_bitset::setbit()/J1S()
+
+ In most cases errors are either about wrong parameters passed to Judy
+ functions or internal structures corruption. These definitely deserve
+ abnormal process termination instead of exit() as it is done by original
+ JUDYERROR.
+
+ TODO: there's one exception that should be handled properly though: OOM.
+*/
+#include <stdio.h>
+#define JUDYERROR(CallerFile, CallerLine, JudyFunc, JudyErrno, JudyErrID) \
+ { \
+ (void) fprintf(stderr, "File '%s', line %d: %s(), " \
+ "JU_ERRNO_* == %d, ID == %d\n", \
+ CallerFile, CallerLine, \
+ JudyFunc, JudyErrno, JudyErrID); \
+ abort(); \
+ }
#include <Judy.h>
void open_query::judy_bitset::clear()