MonetDB: Aug2024 - merged with dec2023

2024-07-08 Thread Niels Nes via checkin-list
Changeset: ede18d770ce6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ede18d770ce6
Branch: Aug2024
Log Message:

merged with dec2023


diffs (109 lines):

diff --git a/sql/backends/monet5/sql_statistics.c 
b/sql/backends/monet5/sql_statistics.c
--- a/sql/backends/monet5/sql_statistics.c
+++ b/sql/backends/monet5/sql_statistics.c
@@ -128,22 +128,20 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
 
if (tbl && strcmp(t->base.name, tbl))
continue;
-   tfnd = 1;
if (tbl && !isTable(t))
throw(SQL, "sql.analyze", SQLSTATE(42S02) "%s 
'%s' is not persistent", TABLE_TYPE_DESCRIPTION(t->type, t->properties), 
t->base.name);
-   if (!table_privs(m, t, PRIV_SELECT))
-   throw(SQL, "sql.analyze", SQLSTATE(42000) 
"ANALYZE: access denied for %s to table '%s.%s'",
- get_string_global_var(m, 
"current_user"), t->s->base.name, t->base.name);
if (isTable(t) && ol_first_node(t->columns)) {
+   bool allowed = table_privs(m, t, PRIV_SELECT);
+   tfnd |= allowed;
for (node *ncol = ol_first_node((t)->columns); 
ncol; ncol = ncol->next) {
sql_column *c = (sql_column *) 
ncol->data;
 
if (col && strcmp(c->base.name, col))
continue;
+   if (!allowed && !column_privs(m, c, 
PRIV_SELECT))
+   continue;
cfnd = 1;
-   if (!column_privs(m, c, PRIV_SELECT))
-   throw(SQL, "sql.analyze", 
SQLSTATE(42000) "ANALYZE: access denied for %s to column '%s' on table '%s.%s'",
- 
get_string_global_var(m, "current_user"), c->base.name, t->s->base.name, 
t->base.name);
+   tfnd |= cfnd;
}
}
}
@@ -172,8 +170,11 @@ sql_analyze(Client cntxt, MalBlkPtr mb, 
if (tbl && strcmp(b->name, tbl))
continue;
if (isTable(t) && ol_first_node(t->columns)) {
+   bool allowed = table_privs(m, t, PRIV_SELECT);
for (node *ncol = ol_first_node((t)->columns); 
ncol; ncol = ncol->next) {
sql_column *c = (sql_column *) 
ncol->data;
+   if (!allowed && !column_privs(m, c, 
PRIV_SELECT))
+   continue;
BAT *b, *unq;
ptr mn, mx;
 
@@ -285,23 +286,21 @@ sql_statistics(Client cntxt, MalBlkPtr m
 
if (tname && strcmp(t->base.name, tname))
continue;
-   tfnd = 1;
if (tname && !isTable(t))
throw(SQL, "sql.statistics", SQLSTATE(42S02) 
"%s '%s' is not persistent", TABLE_TYPE_DESCRIPTION(t->type, t->properties), 
t->base.name);
-   if (!table_privs(m, t, PRIV_SELECT))
-   throw(SQL, "sql.statistics", SQLSTATE(42000) 
"STATISTICS: access denied for %s to table '%s.%s'",
- get_string_global_var(m, 
"current_user"), t->s->base.name, t->base.name);
if (isTable(t) && ol_first_node(t->columns)) {
+   bool allowed = table_privs(m, t, PRIV_SELECT);
+   tfnd |= allowed;
for (node *ncol = ol_first_node((t)->columns); 
ncol; ncol = ncol->next) {
sql_column *c = (sql_column *) 
ncol->data;
 
if (cname && strcmp(c->base.name, 
cname))
continue;
+   nrows++;
+   if (!allowed && !column_privs(m, c, 
PRIV_SELECT))
+   continue;
cfnd = 1;
-   nrows++;
-   if (!column_privs(m, c, PRIV_SELECT))
-   throw(SQL, "sql.statistics", 
SQLSTATE(42000) "STATISTICS: access denied for %s to column '%s' on table 
'%s.%s'",
- 
get_string_global_var(m, "current_user"), c->base.name, 

MonetDB: Aug2024 - merged with dec2023

2024-06-19 Thread Niels Nes via checkin-list
Changeset: c0e9aa9e45d2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c0e9aa9e45d2
Modified Files:
gdk/gdk_bbp.c
sql/storage/objectset.c
Branch: Aug2024
Log Message:

merged with dec2023


diffs (28 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -2176,7 +2176,7 @@ BBPinit(bool allow_hge_upgrade)
}
}
 
-   if (MT_create_thread(, BBPmanager, NULL, MT_THR_DETACHED, 
"BBPmanager") < 0) {
+   if (!GDKinmemory(0) && MT_create_thread(, BBPmanager, NULL, 
MT_THR_DETACHED, "BBPmanager") < 0) {
TRC_CRITICAL(GDK, "Could not start BBPmanager thread.");
return GDK_FAIL;
}
diff --git a/sql/storage/objectset.c b/sql/storage/objectset.c
--- a/sql/storage/objectset.c
+++ b/sql/storage/objectset.c
@@ -643,9 +643,9 @@ tc_commit_objectversion(sql_trans *tr, s
(void)oldest;
if (!tr->parent)
change->obj->new = 0;
-   ATOMIC_INC(>cat->schema_version);
-   }
-   else {
+   if (!ov->os->temporary)
+   ATOMIC_INC(>cat->schema_version);
+   } else {
os_rollback(ov, tr->store);
}
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - merged with dec2023

2024-06-13 Thread Niels Nes via checkin-list
Changeset: 50a123e080b0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/50a123e080b0
Modified Files:
gdk/gdk.h
gdk/gdk_utils.c
monetdb5/modules/mal/txtsim.c
sql/storage/store.c
Branch: Aug2024
Log Message:

merged with dec2023


diffs (120 lines):

diff --git a/clients/odbc/driver/ODBCError.c b/clients/odbc/driver/ODBCError.c
--- a/clients/odbc/driver/ODBCError.c
+++ b/clients/odbc/driver/ODBCError.c
@@ -373,27 +373,6 @@ appendODBCError(ODBCError **head, ODBCEr
 }
 
 
-#if 0  /* unused */
-/*
- * Prepends a valid ODBCError object 'err' to the front of the list
- * of a valid ODBCError object 'head' and return the new head.
- *
- * Precondition: both head and err must be valid (non NULL)
- * Returns: the new head (which is the same as the prepended 'err').
- */
-void
-prependODBCError(ODBCError **head, ODBCError *err)
-{
-   assert(head);
-   assert(err);
-   assert(err->next == NULL);
-
-   err->next = *head;
-   *head = err;
-}
-#endif
-
-
 /*
  * Frees the ODBCError object including its linked ODBCError objects.
  *
diff --git a/clients/odbc/driver/ODBCError.h b/clients/odbc/driver/ODBCError.h
--- a/clients/odbc/driver/ODBCError.h
+++ b/clients/odbc/driver/ODBCError.h
@@ -110,18 +110,6 @@ int getErrorRecCount(ODBCError *error);
 void appendODBCError(ODBCError **head, ODBCError *err);
 
 
-#if 0  /* unused */
-/*
- * Prepends a valid ODBCError object 'this' to the front of the list
- * of a valid ODBCError object 'head' and return the new head.
- *
- * Precondition: both head and this must be valid (non NULL)
- * Returns: the new head (which is the same as the prepended 'this').
- */
-void prependODBCError(ODBCError **head, ODBCError *err);
-#endif
-
-
 /*
  * Frees the ODBCError object including its linked ODBCError objects.
  *
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -1087,7 +1087,7 @@ bat_iterator_nolock(BAT *b)
 {
/* does not get matched by bat_iterator_end */
if (b) {
-   bool isview = VIEWtparent(b);
+   const bool isview = VIEWtparent(b) != 0;
return (BATiter) {
.b = b,
.h = b->theap,
diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -378,19 +378,7 @@ GDKlog(FILE *lockFile, const char *forma
 
 /*
  * @+ Interrupt handling
- * The current version simply catches signals and prints a warning.
- * It should be extended to cope with the specifics of the interrupt
- * received.
  */
-#if 0  /* these are unused */
-static void
-BATSIGignore(int nr)
-{
-   (void) nr;
-   GDKsyserror("! ERROR signal %d caught by thread %zu\n", nr, (size_t) 
MT_getpid());
-}
-#endif
-
 #ifdef WIN32
 static void
 BATSIGabort(int nr)
diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -247,7 +247,7 @@ levenshtein(int *res, const char *x, con
throw(MAL, "txtsim.levenshtein", "Illegal unicode code point");
 }
 
-/* Levenshtein OP but with column externaly allocated */
+/* Levenshtein OP but with column externally allocated */
 static inline int
 levenshtein2(const char *x, const char *y, const size_t xlen, const size_t 
ylen,
 unsigned int *column, const int insdel_cost,
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -6330,6 +6330,7 @@ sql_trans_alter_null(sql_trans *tr, sql_
 
if ((res = new_column(tr, col, )))
return res;
+   col = dup;
dup->null = isnull;
 
/* disallow concurrent updates on the column if not null is set 
*/
@@ -6340,7 +6341,7 @@ sql_trans_alter_null(sql_trans *tr, sql_
return res;
if ((res = store_reset_sql_functions(tr, col->t->base.id))) /* 
reset sql functions depending on the table */
return res;
-   if (isNew(col) || isnull)
+   if (isNew(col) || isnull) /* new ie can still change, or 
persistent only widen semantics */
store->storage_api.col_not_null(tr, col, !isnull);
}
return res;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org