Changeset: f89596aaef8f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f89596aaef8f
Modified Files:
clients/odbc/driver/SQLExecute.c
gdk/gdk_analytic_bounds.c
gdk/gdk_bat.c
gdk/gdk_imprints.c
gdk/gdk_logger.c
gdk/gdk_logger_old.c
gdk/gdk_select.c
sql/storage/bat/bat_logger.c
testing/process.py
Branch: default
Log Message:
Merge with Sep2022 branch.
diffs (truncated from 468 to 300 lines):
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -424,9 +424,6 @@ MNDBExecute(ODBCStmt *stmt)
return SQL_ERROR;
}
- /* internal state correctness checks */
- assert(stmt->State == PREPARED0 || stmt->State == EXECUTED0 ||
stmt->ImplRowDescr->descRec != NULL);
-
assert(stmt->Dbc);
assert(stmt->Dbc->mid);
hdl = stmt->hdl;
diff --git a/gdk/gdk_analytic_bounds.c b/gdk/gdk_analytic_bounds.c
--- a/gdk/gdk_analytic_bounds.c
+++ b/gdk/gdk_analytic_bounds.c
@@ -1161,7 +1161,7 @@ GDKanalyticalrangebounds(BAT *r, BAT *b,
break;
}
default:
- assert(0);
+ MT_UNREACHABLE();
}
if (is_lng_nil(limit) || limit < 0 ||
is_int_nil(int_limit) || int_limit < 0) {
goto invalid_bound;
@@ -1446,7 +1446,7 @@ GDKanalyticalwindowbounds(BAT *r, BAT *b
case 2:
return GDKanalyticalgroupsbounds(r, b, p, l, bound, tp2,
preceding);
default:
- assert(0);
+ MT_UNREACHABLE();
}
GDKerror("42000!unit type %d not supported (this is a bug).\n", unit);
return GDK_FAIL;
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -100,55 +100,51 @@ BATcreatedesc(oid hseq, int tt, bool hea
.batTransient = true,
.batRestricted = BAT_WRITE,
};
- if (heapnames && (bn->theap = GDKmalloc(sizeof(Heap))) == NULL) {
- GDKfree(bn);
- return NULL;
- }
- /*
- * add to BBP
- */
- if (BBPinsert(bn) == 0) {
- GDKfree(bn->theap);
- GDKfree(bn);
- return NULL;
- }
- /*
- * fill in heap names, so HEAPallocs can resort to disk for
- * very large writes.
- */
if (heapnames) {
- assert(bn->theap != NULL);
+ if ((bn->theap = GDKmalloc(sizeof(Heap))) == NULL) {
+ GDKfree(bn);
+ return NULL;
+ }
*bn->theap = (Heap) {
- .parentid = bn->batCacheid,
.farmid = BBPselectfarm(role, bn->ttype, offheap),
.dirty = true,
};
- const char *nme = BBP_physical(bn->batCacheid);
- settailname(bn->theap, nme, tt, width);
-
if (ATOMneedheap(tt)) {
if ((bn->tvheap = GDKmalloc(sizeof(Heap))) == NULL) {
- BBPclear(bn->batCacheid);
- HEAPfree(bn->theap, true);
GDKfree(bn->theap);
GDKfree(bn);
return NULL;
}
*bn->tvheap = (Heap) {
- .parentid = bn->batCacheid,
.farmid = BBPselectfarm(role, bn->ttype,
varheap),
.dirty = true,
};
+ }
+ }
+ /*
+ * add to BBP
+ */
+ if (BBPinsert(bn) == 0) {
+ GDKfree(bn->tvheap);
+ GDKfree(bn->theap);
+ GDKfree(bn);
+ return NULL;
+ }
+ if (bn->theap) {
+ bn->theap->parentid = bn->batCacheid;
+ ATOMIC_INIT(&bn->theap->refs, 1);
+ const char *nme = BBP_physical(bn->batCacheid);
+ settailname(bn->theap, nme, tt, width);
+
+ if (bn->tvheap) {
+ bn->tvheap->parentid = bn->batCacheid;
ATOMIC_INIT(&bn->tvheap->refs, 1);
strconcat_len(bn->tvheap->filename,
sizeof(bn->tvheap->filename),
nme, ".theap", NULL);
}
- ATOMIC_INIT(&bn->theap->refs, 1);
- } else {
- assert(bn->theap == NULL);
}
char name[MT_NAME_LEN];
snprintf(name, sizeof(name), "heaplock%d", bn->batCacheid); /* fits */
diff --git a/gdk/gdk_hash.h b/gdk/gdk_hash.h
--- a/gdk/gdk_hash.h
+++ b/gdk/gdk_hash.h
@@ -211,7 +211,7 @@ HASHgetlink(const Hash *h, BUN i)
#define hash_flt(H,V) hash_int(H,V)
#define hash_dbl(H,V) hash_lng(H,V)
-static inline BUN __attribute__((__const__))
+static inline BUN __attribute__((__pure__))
mix_uuid(const uuid *u)
{
ulng u1, u2;
diff --git a/gdk/gdk_imprints.c b/gdk/gdk_imprints.c
--- a/gdk/gdk_imprints.c
+++ b/gdk/gdk_imprints.c
@@ -124,15 +124,15 @@
#define IMPRINTS_VERSION 2
#define IMPRINTS_HEADER_SIZE 4 /* nr of size_t fields in header */
-#define BINSIZE(B, FUNC, T) \
- do { \
- switch (B) { \
- case 8: FUNC(T,8); break; \
- case 16: FUNC(T,16); break; \
- case 32: FUNC(T,32); break; \
- case 64: FUNC(T,64); break; \
- default: assert(0); break; \
- } \
+#define BINSIZE(B, FUNC, T) \
+ do { \
+ switch (B) { \
+ case 8: FUNC(T,8); break; \
+ case 16: FUNC(T,16); break; \
+ case 32: FUNC(T,32); break; \
+ case 64: FUNC(T,64); break; \
+ default: MT_UNREACHABLE(); break; \
+ } \
} while (0)
@@ -253,7 +253,7 @@ imprints_create(BAT *b, BATiter *bi, voi
break;
default:
/* should never reach here */
- assert(0);
+ MT_UNREACHABLE();
}
*dictcnt = dcnt;
@@ -636,7 +636,7 @@ BATimprints(BAT *b)
break;
default:
/* should never reach here */
- assert(0);
+ MT_UNREACHABLE();
}
imprints_create(b, &bi,
@@ -762,9 +762,7 @@ IMPSgetbin(int tpe, bte bits, const char
break;
}
default:
- assert(0);
- (void) inbins;
- break;
+ MT_UNREACHABLE();
}
return ret;
}
diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -884,7 +884,7 @@ la_apply(logger *lg, logaction *c, int t
ret = la_bat_destroy(lg, c, tid);
break;
default:
- assert(0);
+ MT_UNREACHABLE();
}
return ret;
}
diff --git a/gdk/gdk_logger_old.c b/gdk/gdk_logger_old.c
--- a/gdk/gdk_logger_old.c
+++ b/gdk/gdk_logger_old.c
@@ -936,7 +936,7 @@ la_apply(old_logger *lg, logaction *c)
ret = la_bat_clear(lg, c);
break;
default:
- assert(0);
+ MT_UNREACHABLE();
}
lg->changes += (ret == GDK_SUCCEED);
return ret;
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -421,7 +421,8 @@ quickins(oid *dst, BUN cnt, oid o, BAT *
checkMINMAX(64, TYPE); \
impsmask(ISDENSE,TEST,64); \
break; \
- default: assert(0); break; \
+ default: \
+ MT_UNREACHABLE(); \
} \
} while (false)
@@ -2656,7 +2657,7 @@ rangejoin(BAT *r1, BAT *r2, BAT *l, BAT
default:
ncnt = BUN_NONE;
GDKerror("unsupported type\n");
- assert(0);
+ MT_UNREACHABLE();
}
if (ncnt == BUN_NONE) {
IMPSdecref(imprints, false);
diff --git a/sql/odbc/samples/Tests/All b/sql/odbc/samples/Tests/All
--- a/sql/odbc/samples/Tests/All
+++ b/sql/odbc/samples/Tests/All
@@ -2,4 +2,4 @@
# cf., clients/odbc/samples/Makefile.ag
# and http://dev.monetdb.org/hg/MonetDB/rev/168f15887717
#
-HAVE_ODBC&NOT_WIN32?odbcsample1
+HAVE_ODBC?odbcsample1
diff --git a/sql/odbc/samples/Tests/odbcsample1.SQL.sh
b/sql/odbc/samples/Tests/odbcsample1.SQL.sh
--- a/sql/odbc/samples/Tests/odbcsample1.SQL.sh
+++ b/sql/odbc/samples/Tests/odbcsample1.SQL.sh
@@ -1,19 +1,3 @@
#!/bin/sh
-ODBCINI=$PWD/odbc.ini
-trap "rm $ODBCINI" 0 15
-cat > $ODBCINI <<EOF
-[MonetDB-Test]
-Description = Test MonetDB Data Source
-Driver = $LIBDIR/libMonetODBC.so
-Setup = $LIBDIR/libMonetODBCs.so
-Host = localhost
-Port = $MAPIPORT
-Database = $TSTDB
-User = monetdb
-Password = monetdb
-Debug =
-
-EOF
-export ODBCINI
-eval odbcsample1 MonetDB-Test
+odbcsample1 MonetDB-Test
diff --git a/sql/odbc/tests/Tests/All b/sql/odbc/tests/Tests/All
--- a/sql/odbc/tests/Tests/All
+++ b/sql/odbc/tests/Tests/All
@@ -1,3 +1,4 @@
-HAVE_ODBC&NOT_WIN32?ODBCgetInfo
-HAVE_ODBC&NOT_WIN32?ODBCmetadata
-HAVE_ODBC&NOT_WIN32?ODBCStmtAttr
+HAVE_ODBC?ODBCgetInfo
+HAVE_ODBC?ODBCmetadata
+HAVE_ODBC?ODBCStmtAttr
+HAVE_PYODBC?pyodbc-test
diff --git a/sql/odbc/tests/Tests/ODBCStmtAttr.SQL.sh
b/sql/odbc/tests/Tests/ODBCStmtAttr.SQL.sh
--- a/sql/odbc/tests/Tests/ODBCStmtAttr.SQL.sh
+++ b/sql/odbc/tests/Tests/ODBCStmtAttr.SQL.sh
@@ -1,19 +1,3 @@
#!/bin/sh
-ODBCINI=$PWD/odbc.ini
-trap "rm $ODBCINI" 0 15
-cat > $ODBCINI <<EOF
-[MonetDB-Test]
-Description = Test MonetDB Data Source
-Driver = $LIBDIR/libMonetODBC.so
-Setup = $LIBDIR/libMonetODBCs.so
-Host = localhost
-Port = $MAPIPORT
-Database = $TSTDB
-User = monetdb
-Password = monetdb
-Debug =
-
-EOF
-export ODBCINI
-eval ODBCStmtAttr MonetDB-Test
+ODBCStmtAttr MonetDB-Test
diff --git a/sql/odbc/tests/Tests/ODBCgetInfo.SQL.sh
b/sql/odbc/tests/Tests/ODBCgetInfo.SQL.sh
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]