Changeset: 84fa4ef91888 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/84fa4ef91888
Modified Files:
cmake/monetdb-toolchain.cmake
gdk/gdk_utils.c
monetdb5/mal/mal_module.c
monetdb5/mal/mal_prelude.c
monetdb5/optimizer/opt_mitosis.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_gencode.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_statement.c
sql/storage/objectset.c
sql/storage/store.c
Branch: default
Log Message:
Merge with Jun2023 branch.
diffs (truncated from 8353 to 300 lines):
diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake
--- a/cmake/monetdb-toolchain.cmake
+++ b/cmake/monetdb-toolchain.cmake
@@ -128,7 +128,6 @@ function(monetdb_default_compiler_option
add_option_if_available("-fstack-protector-all")
add_option_if_available("-Wpacked-bitfield-compat")
add_option_if_available("-Wsync-nand")
- add_option_if_available("-Wjump-misses-init")
add_option_if_available("-Wmissing-include-dirs")
add_option_if_available("-Wlogical-op")
add_option_if_available("-Wduplicated-cond")
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -646,14 +646,26 @@ MT_init(void)
break;
*p = 0;
if (strncmp(buf, "0::", 3) == 0) {
- size_t l;
-
/* cgroup v2 entry */
- l = strconcat_len(pth, sizeof(pth),
- cgr2, buf + 3, "/", NULL);
+ p = stpcpy(pth, cgr2);
+ q = stpcpy(stpcpy(p, buf + 3), "/");
/* hard limit */
- strcpy(pth + l, "memory.max");
+ strcpy(q, "memory.max");
f = fopen(pth, "r");
+ while (f == NULL && q > p) {
+ /* go up the hierarchy until we
+ * find the file or the
+ * hierarchy runs out */
+ *--q = 0; /* zap the slash */
+ q = strrchr(p, '/');
+ if (q == NULL || q == p) {
+ /* position after the slash */
+ q = p + 1;
+ break;
+ }
+ strcpy(++q, "memory.max");
+ f = fopen(pth, "r");
+ }
if (f != NULL) {
if (fscanf(f, "%" SCNu64, &mem) == 1 &&
mem < (uint64_t) _MT_pagesize * _MT_npages) {
_MT_npages = (size_t) (mem /
_MT_pagesize);
@@ -663,7 +675,7 @@ MT_init(void)
fclose(f);
}
/* soft high limit */
- strcpy(pth + l, "memory.high");
+ strcpy(q, "memory.high");
f = fopen(pth, "r");
if (f != NULL) {
if (fscanf(f, "%" SCNu64, &mem) == 1 &&
mem < (uint64_t) _MT_pagesize * _MT_npages) {
@@ -674,7 +686,7 @@ MT_init(void)
fclose(f);
}
/* soft low limit */
- strcpy(pth + l, "memory.low");
+ strcpy(q, "memory.low");
f = fopen(pth, "r");
if (f != NULL) {
if (fscanf(f, "%" SCNu64, &mem) == 1 &&
mem > 0 && mem < (uint64_t) _MT_pagesize * _MT_npages) {
@@ -686,7 +698,7 @@ MT_init(void)
}
/* limit of memory+swap usage
* we use this as maximum virtual memory size */
- strcpy(pth + l, "memory.swap.max");
+ strcpy(q, "memory.swap.max");
f = fopen(pth, "r");
if (f != NULL) {
if (fscanf(f, "%" SCNu64, &mem) == 1
diff --git a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
--- a/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
+++ b/monetdb5/extras/mal_optimizer_template/opt_sql_append.c
@@ -201,6 +201,12 @@ OPTsql_appendImplementation(Client cntxt
q2 = pushArgument(mb, q2, getArg(p, 5));
q2 = pushLng(mb, q2, 0);
q2 = pushArgument(mb, q2, getArg(q1, 0));
+ if (mb->errors) {
+ freeInstruction(q1);
+ freeInstruction(q2);
+ i--;
+ break;
+ }
pushInstruction(mb, q1);
pushInstruction(mb, q2);
diff --git a/monetdb5/mal/mal_builder.c b/monetdb5/mal/mal_builder.c
--- a/monetdb5/mal/mal_builder.c
+++ b/monetdb5/mal/mal_builder.c
@@ -219,6 +219,8 @@ newExitStmt(MalBlkPtr mb, const char *nm
InstrPtr
pushEndInstruction(MalBlkPtr mb)
{
+ if (mb->errors)
+ return NULL;
InstrPtr q = newInstruction(mb, NULL, NULL);
if (q == NULL)
@@ -229,6 +231,8 @@ pushEndInstruction(MalBlkPtr mb)
q->retc = 0;
q->argv[0] = 0;
pushInstruction(mb, q);
+ if (mb->errors)
+ return NULL;
return q;
}
@@ -253,8 +257,8 @@ pushInt(MalBlkPtr mb, InstrPtr q, int va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_int;
cst.val.ival = val;
cst.len = 0;
@@ -285,8 +289,8 @@ pushBte(MalBlkPtr mb, InstrPtr q, bte va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_bte;
cst.val.btval = val;
cst.len = 0;
@@ -317,8 +321,8 @@ pushOid(MalBlkPtr mb, InstrPtr q, oid va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_oid;
cst.val.oval = val;
cst.len = 0;
@@ -334,8 +338,8 @@ pushVoid(MalBlkPtr mb, InstrPtr q)
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_void;
cst.val.oval = oid_nil;
cst.len = 0;
@@ -366,8 +370,8 @@ pushLng(MalBlkPtr mb, InstrPtr q, lng va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_lng;
cst.val.lval = val;
cst.len = 0;
@@ -398,8 +402,8 @@ pushSht(MalBlkPtr mb, InstrPtr q, sht va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_sht;
cst.val.shval = val;
cst.len = 0;
@@ -431,8 +435,8 @@ pushHge(MalBlkPtr mb, InstrPtr q, hge va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_hge;
cst.val.hval = val;
cst.len = 0;
@@ -464,8 +468,8 @@ pushDbl(MalBlkPtr mb, InstrPtr q, dbl va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_dbl;
cst.val.dval = val;
cst.len = 0;
@@ -496,8 +500,8 @@ pushFlt(MalBlkPtr mb, InstrPtr q, flt va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_flt;
cst.val.fval = val;
cst.len = 0;
@@ -530,8 +534,8 @@ pushStr(MalBlkPtr mb, InstrPtr q, const
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
if (VALinit(&cst, TYPE_str, Val) == NULL) {
str msg = createException(MAL, "pushStr",
"Can not
allocate string variable");
@@ -566,8 +570,8 @@ pushBit(MalBlkPtr mb, InstrPtr q, bit va
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_bit;
cst.val.btval = val;
cst.len = 0;
@@ -583,12 +587,12 @@ pushNil(MalBlkPtr mb, InstrPtr q, int tp
int _t;
ValRecord cst;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.len = 0;
if (!isaBatType(tpe) && tpe != TYPE_bat) {
assert(tpe < MAXATOMS); /* in particular, tpe!=TYPE_any */
- if (!tpe) {
+ if (tpe == TYPE_void) {
cst.vtype = TYPE_void;
cst.val.oval = oid_nil;
} else {
@@ -619,29 +623,28 @@ pushNilType(MalBlkPtr mb, InstrPtr q, ch
ValRecord cst;
str msg;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
idx = getAtomIndex(tpe, strlen(tpe), TYPE_any);
if (idx < 0 || idx >= GDKatomcnt || idx >= MAXATOMS) {
- str msg = createException(MAL, "pushNilType",
- "Can not
allocate type variable");
- addMalException(mb, msg);
- freeException(msg);
+ msg = createException(MAL, "pushNilType",
+ "Can not allocate
type variable");
} else {
cst.vtype = TYPE_void;
cst.val.oval = oid_nil;
cst.len = 0;
msg = convertConstant(idx, &cst);
- if (msg != MAL_SUCCEED) {
- addMalException(mb, msg);
- freeException(msg);
- } else {
+ if (msg == MAL_SUCCEED) {
_t = defConstant(mb, idx, &cst);
if (_t >= 0) {
return pushArgument(mb, q, _t);
}
}
}
+ if (msg) {
+ addMalException(mb, msg);
+ freeException(msg);
+ }
return q;
}
@@ -652,8 +655,8 @@ pushType(MalBlkPtr mb, InstrPtr q, int t
ValRecord cst;
str msg;
- if (q == NULL)
- return NULL;
+ if (q == NULL || mb->errors)
+ return q;
cst.vtype = TYPE_void;
cst.val.oval = oid_nil;
cst.len = 0;
@@ -677,8 +680,8 @@ pushZero(MalBlkPtr mb, InstrPtr q, int t
ValRecord cst;
str msg;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]