MonetDB: sw_ew_c_sorting - fix lowercase kappa from greek
Changeset: 1e581db9ea19 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/1e581db9ea19 Modified Files: monetdb5/modules/atoms/Tests/startswith_join.test monetdb5/modules/kernel/Tests/batstr_asciify.test Branch: sw_ew_c_sorting Log Message: fix lowercase kappa from greek diffs (58 lines): diff --git a/monetdb5/modules/atoms/Tests/startswith_join.test b/monetdb5/modules/atoms/Tests/startswith_join.test --- a/monetdb5/modules/atoms/Tests/startswith_join.test +++ b/monetdb5/modules/atoms/Tests/startswith_join.test @@ -48,10 +48,10 @@ statement ok INSERT INTO foo VALUES ('Καλή'),('Frühlingsrauschen'),('Das grüne Monokel'),('Καλή Χρονιά'),('Olá, bom dia'),('Risør'),('Wenn der Ölhahn versiegt'),('Punch-Out!! WITH LYRICS'),('Super Mario Bros. 3 WITH LYRICS'),('Δεν καταλαβαίνω'),('Adeus, boa tarde') statement ok -INSERT INTO bar VALUES ('Δεν'),('Frühling'),(NULL),('Καλή'),('kαλή'),(NULL),('Olá'),('Das grüne'),('Punch-Out!!'),('Adeus'),('früh') +INSERT INTO bar VALUES ('Δεν'),('Frühling'),(NULL),('Καλή'),('καλή'),(NULL),('oLÁ'),('Das grüne'),('Punch-Out!!'),('Adeus'),('früh') query TT rowsort -SELECT * FROM foo,bar WHERE [foo.f] startswith [bar.b] +SELECT * FROM foo,bar WHERE [foo.f] startswith [bar.b, false] Adeus, boa tarde Adeus @@ -59,8 +59,6 @@ Das grüne Monokel Das grüne Frühlingsrauschen Frühling -Olá, bom dia -Olá Punch-Out!! WITH LYRICS Punch-Out!! Δεν καταλαβαίνω @@ -82,15 +80,19 @@ Frühling Frühlingsrauschen früh Olá, bom dia -Olá +oLÁ Punch-Out!! WITH LYRICS Punch-Out!! Δεν καταλαβαίνω Δεν Καλή Καλή +Καλή +καλή Καλή Χρονιά Καλή +Καλή Χρονιά +καλή statement ok drop table foo diff --git a/monetdb5/modules/kernel/Tests/batstr_asciify.test b/monetdb5/modules/kernel/Tests/batstr_asciify.test --- a/monetdb5/modules/kernel/Tests/batstr_asciify.test +++ b/monetdb5/modules/kernel/Tests/batstr_asciify.test @@ -28,7 +28,7 @@ Muller skipif system=Linux query T nosort -SELECT asciify(x) FROM bar +SELECT asciify(x) FROM foo Ol'a Mundo! Jo~ao ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: literal_features - factor out code and check multiple u...
Changeset: 43a0834f3796 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/43a0834f3796 Modified Files: sql/server/rel_select.c Branch: literal_features Log Message: factor out code and check multiple unique keys diffs (115 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -1226,6 +1226,59 @@ sql_rel* find_union(visitor *v, sql_rel return rel; } +static inline +bool group_by_pk_project_uk_cond(mvc* sql, sql_rel* inner, sql_exp* exp,const char* sname, const char* tname) { + sql_table* t = find_table_or_view_on_scope(sql, NULL, sname, tname, "SELECT", false); + bool allow = false; + if (t) { + sql_idx* pki = NULL; + list *ukil = sa_list(sql->sa); + + for (node * n = ol_first_node(t->idxs); n; n = n->next) { + sql_idx *i = n->data; + switch (i->key->type) { + case pkey: + pki = i; + continue; + case ukey: + case unndkey: + list_append(ukil, i); + continue; + default: + continue; + } + } + if (pki && pki->columns->cnt == 1 && ((list*) inner->r)->cnt == 1) { + /* for now only check simple case where primary key and group by expression is a single column*/ + sql_exp* gbe = ((list*) inner->r)->h->data; + assert(gbe->type == e_column); + sql_column* pkc = ((sql_kc *)pki->columns->h->data)->c; + if (strcmp(gbe->alias.name, pkc->base.name) == 0) { + node *n; + for (n = ukil->h; n; n = n->next){ + sql_idx* uki = n->data; + if (uki->columns->cnt == 1) { + /* for now only check simple case where unique key is a single column*/ + sql_column* ukc = ((sql_kc *)uki->columns->h->data)->c; + if (strcmp(exp->alias.name, ukc->base.name) == 0) + allow = true; + } + } + } + } + + /* sufficiency condition: abort if relation contains union subrelation +* because it may break functional dependency between pk and uk */ + visitor v = {.sql=sql}; + rel_visitor_topdown(&v, inner, &find_union); + if (v.data) + allow = false; + } + + return allow; + +} + static sql_exp * rel_column_ref(sql_query *query, sql_rel **rel, symbol *column_r, int f) { @@ -1422,48 +1475,9 @@ rel_column_ref(sql_query *query, sql_rel } if (!exp) { if (inner && !is_sql_aggr(f) && is_groupby(inner->op) && inner->l && (exp = rel_bind_column3(sql, inner->l, sname, tname, cname, f))) { - sql_table* t = find_table_or_view_on_scope(sql, NULL, sname, tname, "SELECT", false); - bool check_pk_with_uk = false; - if (t) { - sql_idx* pki = NULL; - sql_idx* uki = NULL; - for (node * n = ol_first_node(t->idxs); n; n = n->next) { - sql_idx *i = n->data; - - switch (i->key->type) { - case pkey: - pki = i; - continue; - case ukey: - case unndkey: - uki = i; - continue; - default: - continue; - } - } - - if (uki && pki) { - if (pki->columns->cnt == 1 && uki->columns->cnt == 1 && ((list*) inner->r)->cnt == 1) { - sql_column* pkc = ((sql_kc *)pki->columns->h->data)->c; - sql
MonetDB: literal_features - merge with default
Changeset: 40841b1e3dd9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/40841b1e3dd9 Branch: literal_features Log Message: merge with default diffs (truncated from 2024 to 300 lines): diff --git a/gdk/gdk_heap.c b/gdk/gdk_heap.c --- a/gdk/gdk_heap.c +++ b/gdk/gdk_heap.c @@ -217,6 +217,7 @@ HEAPalloc(Heap *h, size_t nitems, size_t return GDK_FAIL; } GDKfree(nme); + TRC_DEBUG(HEAP, "%s %zu %p (mmap)\n", h->filename, size, h->base); } h->newstorage = h->storage; return GDK_SUCCEED; diff --git a/geom/monetdb5/geom_atoms.c b/geom/monetdb5/geom_atoms.c --- a/geom/monetdb5/geom_atoms.c +++ b/geom/monetdb5/geom_atoms.c @@ -272,8 +272,8 @@ wkbFROMSTR_withSRID(const char *geomWKT, { GEOSGeom geosGeometry = NULL; /* The geometry object that is parsed from the src string. */ GEOSWKTReader *WKT_reader; - const char *polyhedralSurface = "POLYHEDRALSURFACE"; - const char *multiPolygon = "MULTIPOLYGON"; + static const char polyhedralSurface[] = "POLYHEDRALSURFACE"; + static const char multiPolygon[] = "MULTIPOLYGON"; char *geomWKT_new = NULL; size_t parsedCharacters = 0; diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c --- a/monetdb5/modules/atoms/str.c +++ b/monetdb5/modules/atoms/str.c @@ -111,7 +111,7 @@ */ /* These tables were generated from the Unicode 13.0.0 spec. */ -const struct UTF8_lower_upper { +static const struct UTF8_lower_upper { const unsigned int from, to; } UTF8_toUpper[] = { /* code points with non-null uppercase conversion */ {0x0061, 0x0041,}, diff --git a/monetdb5/modules/mal/Tests/qgram.maltest b/monetdb5/modules/mal/Tests/qgram.maltest --- a/monetdb5/modules/mal/Tests/qgram.maltest +++ b/monetdb5/modules/mal/Tests/qgram.maltest @@ -36,27 +36,27 @@ query IT rowsort io.print(b) 0 -##h@ +##hä 1 -#h@l +#häl 10 -r@@$ +rłð$ 11 -@@$$ +łð$$ 2 -h@ll +häll 3 -@ll@ +ällö 4 -ll@ +llö 5 -l@ w +lö w 6 -@ w@ +ö wø 7 - w@r + wør 8 -w@r@ +wørł 9 -@r@@ +ørłð diff --git a/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.test b/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.test --- a/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.test +++ b/sql/backends/monet5/UDF/pyapi3/Tests/pyloader3_05.test @@ -54,9 +54,6 @@ 33 33.00 42 42.00 -@ -@ -@ hello hello hello @@ -64,6 +61,9 @@ hello hello hello hello +Ö +Ö +Ö statement ok DROP TABLE pyloader05table diff --git a/sql/benchmarks/tpcds/Tests/one.test.in b/sql/benchmarks/tpcds/Tests/one.test.in --- a/sql/benchmarks/tpcds/Tests/one.test.in +++ b/sql/benchmarks/tpcds/Tests/one.test.in @@ -4616,7 +4616,7 @@ with customer_total_return as ,c_last_review_date,ctr_total_return limit 100 -1300 values hashing to 4b80e4995150e5b42229a363bb57dd07 +1300 values hashing to 46f76e63ac60a7b540f258c4ad0fbfdb query TI rowsort -- query 31 diff --git a/sql/test/BugDay_2005-10-06_2.9.3/Tests/accents_in_strings.SF-926709.test b/sql/test/BugDay_2005-10-06_2.9.3/Tests/accents_in_strings.SF-926709.test --- a/sql/test/BugDay_2005-10-06_2.9.3/Tests/accents_in_strings.SF-926709.test +++ b/sql/test/BugDay_2005-10-06_2.9.3/Tests/accents_in_strings.SF-926709.test @@ -14,7 +14,7 @@ query IT rowsort SELECT * FROM bugtest 1 -Andr@ +André 1 test diff --git a/sql/test/BugTracker-2009/Tests/utf8_bug.SF-2822855.test b/sql/test/BugTracker-2009/Tests/utf8_bug.SF-2822855.test --- a/sql/test/BugTracker-2009/Tests/utf8_bug.SF-2822855.test +++ b/sql/test/BugTracker-2009/Tests/utf8_bug.SF-2822855.test @@ -19,15 +19,15 @@ select a, length(a) AS len from utf8len 0 1 -@ +€ 1 -@ +€ 1 query T rowsort select 'Liever €uro' as "Liever euro" -Liever @uro +Liever €uro statement ok drop table utf8len diff --git a/sql/test/BugTracker-2014/Tests/BOM-in-string.Bug-3641.test b/sql/test/BugTracker-2014/Tests/BOM-in-string.Bug-3641.test --- a/sql/test/BugTracker-2014/Tests/BOM-in-string.Bug-3641.test +++ b/sql/test/BugTracker-2014/Tests/BOM-in-string.Bug-3641.test @@ -6,5 +6,5 @@ select ' ' query T rowsort select ' ' - @ + diff --git a/sql/test/BugTracker-2015/Tests/import-non-ascii.Bug-3864.test b/sql/test/BugTracker-2015/Tests/import-non-ascii.Bug-3864.test --- a/sql/test/BugTracker-2015/Tests/import-non-ascii.Bug-3864.test +++ b/sql/test/BugTracker-2015/Tests/import-non-ascii.Bug-3864.test @@ -16,9 +16,9 @@ query IT rowsort select * from varcharsize5 1 -@ +不要让早把 1 -@ +不要让早把 statement ok rollback diff --git a/sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.test b/sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.test --- a/sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.test +++ b/sql/test/BugTracker-2017/Tests/splitpart.Bug-6194.test @@ -1,5 +1,5 @@ query T rowsort select splitpart('100-ača' , '-', 2) -a@a +ača diff --git a
MonetDB: literal_features - do less work
Changeset: c4ed4853fb79 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/c4ed4853fb79 Modified Files: sql/server/rel_select.c Branch: literal_features Log Message: do less work diffs (34 lines): diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c --- a/sql/server/rel_select.c +++ b/sql/server/rel_select.c @@ -1260,19 +1260,23 @@ bool group_by_pk_project_uk_cond(mvc* sq if (uki->columns->cnt == 1) { /* for now only check simple case where unique key is a single column*/ sql_column* ukc = ((sql_kc *)uki->columns->h->data)->c; - if (strcmp(exp->alias.name, ukc->base.name) == 0) + if (strcmp(exp->alias.name, ukc->base.name) == 0) { allow = true; + break; + } } } } } - /* sufficiency condition: abort if relation contains union subrelation -* because it may break functional dependency between pk and uk */ - visitor v = {.sql=sql}; - rel_visitor_topdown(&v, inner, &find_union); - if (v.data) - allow = false; + if (allow) { + /* sufficiency condition: abort if relation contains union subrelation + * because it may break functional dependency between pk and uk */ + visitor v = {.sql=sql}; + rel_visitor_topdown(&v, inner, &find_union); + if (v.data) + allow = false; + } } return allow; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Fixed regression leaving unused bats around.
Changeset: 5b88be14db38 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/5b88be14db38 Modified Files: gdk/ChangeLog.Dec2023 gdk/gdk_logger.c Branch: Dec2023 Log Message: Fixed regression leaving unused bats around. diffs (72 lines): diff --git a/gdk/ChangeLog.Dec2023 b/gdk/ChangeLog.Dec2023 --- a/gdk/ChangeLog.Dec2023 +++ b/gdk/ChangeLog.Dec2023 @@ -1,3 +1,10 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Fri Mar 1 2024 Sjoerd Mullender +- Fixed a regression where bats weren't always cleaned up when they + weren't needed anymore. In particular, after a DELETE FROM table query + without a WHERE clause (which deletes all rows from the table), the + bats for the table get replaced by new ones, and the old, now unused, + bats weren't removed from the database. + diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -1222,6 +1222,8 @@ log_read_transaction(logger *lg, uint32_ bool ok = true; ATOMIC_BASE_TYPE dbg = ATOMIC_GET(&GDKdebug); + (void) maxupdated; /* only used inside assert() */ + if (!lg->flushing) ATOMIC_AND(&GDKdebug, ~CHECKMASK); @@ -1249,16 +1251,40 @@ log_read_transaction(logger *lg, uint32_ if (updated && BAThash(lg->catalog_id) == GDK_SUCCEED) { BATiter cni = bat_iterator(lg->catalog_id); BUN p; + BUN posnew = BUN_NONE; + BUN posold = BUN_NONE; MT_rwlock_rdlock(&cni.b->thashlock); HASHloop_int(cni, cni.b->thash, p, &l.id) { - (void)maxupdated; - assert(p < maxupdated); - updated[p / 32] |= 1U << (p % 32); - /* there should only be one hit */ - break; + lng lid = *(lng *) Tloc(lg->catalog_lid, p); + if (lid == lng_nil || lid > tr->tid) + posnew = p; + else if (lid == tr->tid) + posold = p; } MT_rwlock_rdunlock(&cni.b->thashlock); bat_iterator_end(&cni); + /* Normally at this point, posnew is the +* location of the bat that this +* transaction is working on, and posold +* is the location of the previous +* version of the bat. If LOG_CREATE, +* both are relevant, since the latter +* is the new bat, and the former is the +* to-be-destroyed bat. For +* LOG_DESTROY, only posnew should be +* relevant, but for the other types, if +* the table is destroyed later in the +* same transaction, we need posold, and +* else (the normal case) we need +* posnew. */ + if (posnew != BUN_NONE) { + assert(posnew < maxupdated); + updated[posnew / 32] |= 1U << (posnew % 32); + } + if ((l.flag == LOG_CREATE || posnew == BUN_NONE) && posold != BUN_NONE) { + assert(posold < maxupdated); + updated[posold / 32] |= 1U << (posold % 32); + } } break; default: ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Layout.
Changeset: ab46b6d60749 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/ab46b6d60749 Modified Files: gdk/gdk_logger.c Branch: Dec2023 Log Message: Layout. diffs (25 lines): diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -2652,8 +2652,7 @@ log_flush(logger *lg, ulng ts) TRC_CRITICAL(GDK, "log_id filename is too large\n"); return GDK_FAIL; } - if ((filename = -GDKfilepath(BBPselectfarm(PERSISTENT, 0, offheap), lg->dir, LOGFILE, id)) == NULL) { + if ((filename = GDKfilepath(BBPselectfarm(PERSISTENT, 0, offheap), lg->dir, LOGFILE, id)) == NULL) { GDKfree(updated); return GDK_FAIL; } @@ -3395,8 +3394,9 @@ log_add_bat(logger *lg, BAT *b, log_id i bid = b->batCacheid; TRC_DEBUG(WAL, "create %d\n", id); assert(log_find(lg->catalog_bid, lg->dcatalog, bid) == BUN_NONE); - if (BUNappend(lg->catalog_bid, &bid, true) != GDK_SUCCEED || BUNappend(lg->catalog_id, &id, true) != GDK_SUCCEED - || BUNappend(lg->catalog_cnt, &cnt, false) != GDK_SUCCEED || + if (BUNappend(lg->catalog_bid, &bid, true) != GDK_SUCCEED || + BUNappend(lg->catalog_id, &id, true) != GDK_SUCCEED || + BUNappend(lg->catalog_cnt, &cnt, false) != GDK_SUCCEED || BUNappend(lg->catalog_lid, &lid, false) != GDK_SUCCEED) return GDK_FAIL; if (lg->current) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merge with Dec2023 branch.
Changeset: 0ca2fb7cf7c6 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0ca2fb7cf7c6 Modified Files: gdk/gdk_logger.c sql/test/BugTracker-2023/Tests/misc-crashes-7390.test Branch: default Log Message: Merge with Dec2023 branch. diffs (234 lines): diff --git a/gdk/ChangeLog.Dec2023 b/gdk/ChangeLog.Dec2023 --- a/gdk/ChangeLog.Dec2023 +++ b/gdk/ChangeLog.Dec2023 @@ -1,3 +1,10 @@ # ChangeLog file for GDK # This file is updated with Maddlog +* Fri Mar 1 2024 Sjoerd Mullender +- Fixed a regression where bats weren't always cleaned up when they + weren't needed anymore. In particular, after a DELETE FROM table query + without a WHERE clause (which deletes all rows from the table), the + bats for the table get replaced by new ones, and the old, now unused, + bats weren't removed from the database. + diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -1224,6 +1224,8 @@ log_read_transaction(logger *lg, uint32_ bool ok = true; ATOMIC_BASE_TYPE dbg = ATOMIC_GET(&GDKdebug); + (void) maxupdated; /* only used inside assert() */ + if (!lg->flushing) ATOMIC_AND(&GDKdebug, ~CHECKMASK); @@ -1251,16 +1253,40 @@ log_read_transaction(logger *lg, uint32_ if (updated && BAThash(lg->catalog_id) == GDK_SUCCEED) { BATiter cni = bat_iterator(lg->catalog_id); BUN p; + BUN posnew = BUN_NONE; + BUN posold = BUN_NONE; MT_rwlock_rdlock(&cni.b->thashlock); HASHloop_int(cni, cni.b->thash, p, &l.id) { - (void)maxupdated; - assert(p < maxupdated); - updated[p / 32] |= 1U << (p % 32); - /* there should only be one hit */ - break; + lng lid = *(lng *) Tloc(lg->catalog_lid, p); + if (lid == lng_nil || lid > tr->tid) + posnew = p; + else if (lid == tr->tid) + posold = p; } MT_rwlock_rdunlock(&cni.b->thashlock); bat_iterator_end(&cni); + /* Normally at this point, posnew is the +* location of the bat that this +* transaction is working on, and posold +* is the location of the previous +* version of the bat. If LOG_CREATE, +* both are relevant, since the latter +* is the new bat, and the former is the +* to-be-destroyed bat. For +* LOG_DESTROY, only posnew should be +* relevant, but for the other types, if +* the table is destroyed later in the +* same transaction, we need posold, and +* else (the normal case) we need +* posnew. */ + if (posnew != BUN_NONE) { + assert(posnew < maxupdated); + updated[posnew / 32] |= 1U << (posnew % 32); + } + if ((l.flag == LOG_CREATE || posnew == BUN_NONE) && posold != BUN_NONE) { + assert(posold < maxupdated); + updated[posold / 32] |= 1U << (posold % 32); + } } break; default: @@ -2643,8 +2669,7 @@ log_flush(logger *lg, ulng ts) TRC_CRITICAL(GDK, "log_id filename is too large\n"); return GDK_FAIL; } - if ((filename = -GDKfilepath(BBPselectfarm(PERSISTENT, 0, offheap), lg->dir, LOGFILE, id)) == NULL) { + if ((filename = GDKfilepath(BBPselectfarm(PERSISTENT, 0, offheap), lg->dir, LOGFILE, id)) == NULL) { GDKfree(updated); return GDK_FAIL; } @@ -3386,8 +3411,9 @@ log_add_bat(logger *lg, BAT *b, log_id i bid = b->batCacheid; TRC_DEBUG(WAL, "create %d\n", id); assert(log_find(lg->catalog_bid, lg->dcatalog, bid) == BUN_NONE); - if (BUNappend(