Changeset: 26986f3ce6ce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/26986f3ce6ce
Modified Files:
        gdk/gdk_private.h
        gdk/gdk_select.c
        sql/backends/monet5/rel_bin.c
        sql/server/sql_parser.y
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 1325 to 300 lines):

diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c
--- a/clients/odbc/winsetup/setup.c
+++ b/clients/odbc/winsetup/setup.c
@@ -297,7 +297,7 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR
                SetDlgItemText(hwndDlg, IDC_EDIT_TIMEZONE, datap->timezone ? 
datap->timezone : "");
                SetDlgItemText(hwndDlg, IDC_EDIT_LOGFILE, datap->logfile ? 
datap->logfile : "");
                // Client Info
-               SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTINFO, datap->clientinfo 
? datap->clientinfo : "off");
+               SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTINFO, datap->clientinfo 
? datap->clientinfo : "on");
                SetDlgItemText(hwndDlg, IDC_EDIT_APPLICNAME, 
datap->applicationname ? datap->applicationname : "");
                SetDlgItemText(hwndDlg, IDC_EDIT_CLIENTREMARK, 
datap->clientremark ? datap->clientremark : "");
                if (datap->request == ODBC_ADD_DSN && datap->dsn && *datap->dsn)
@@ -333,7 +333,7 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR
                        }
                        GetDlgItemText(hwndDlg, IDC_EDIT_CLIENTINFO, buf, 
sizeof(buf));
                        if (strcmp("on", buf) != 0 && strcmp("off", buf) != 0) {
-                               MessageBox(hwndDlg, "Client Info must be set to 
on or off.\nDefault is off.", NULL, MB_ICONERROR);
+                               MessageBox(hwndDlg, "Client Info must be set to 
on or off.\nDefault is on.", NULL, MB_ICONERROR);
                                return TRUE;
                        }
 
@@ -585,7 +585,7 @@ ConfigDSN(HWND parent, WORD request, LPC
        MergeFromProfileString(data.dsn, &data.autocommit, "AutoCommit", "on");
        MergeFromProfileString(data.dsn, &data.timezone, "TimeZone", "");
        MergeFromProfileString(data.dsn, &data.logfile, "LogFile", "");
-       MergeFromProfileString(data.dsn, &data.clientinfo, "ClientInfo", "off");
+       MergeFromProfileString(data.dsn, &data.clientinfo, "ClientInfo", "on");
        MergeFromProfileString(data.dsn, &data.applicationname, "AppName", "");
        MergeFromProfileString(data.dsn, &data.clientremark, "ClientRemark", 
"");
 
diff --git a/clients/odbc/winsetup/winredist/ds16gt.dll 
b/clients/odbc/winsetup/winredist/ds16gt.dll
deleted file mode 100755
index 
ea94cdd0ef7d009441d6b56da7464cb8f2515384..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/ds32gt.dll 
b/clients/odbc/winsetup/winredist/ds32gt.dll
deleted file mode 100755
index 
0cc5f7be21475f4b88dee87edcc50689d812f298..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbc16gt.dll 
b/clients/odbc/winsetup/winredist/odbc16gt.dll
deleted file mode 100755
index 
30ca156b9f363d1b4095ab4bf1c7d8285d51a467..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbc32.dll 
b/clients/odbc/winsetup/winredist/odbc32.dll
deleted file mode 100755
index 
b5c2ac81f64cfe599710e3928d4cf1d39ebfbb6a..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbc32gt.dll 
b/clients/odbc/winsetup/winredist/odbc32gt.dll
deleted file mode 100755
index 
d420ecbb2dd84495100ccb2075d30f24557c18e7..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbccp32.cpl 
b/clients/odbc/winsetup/winredist/odbccp32.cpl
deleted file mode 100755
index 
9160bc01ab105cb0e3e1d1b6146c31c9ecf93b41..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbccp32.dll 
b/clients/odbc/winsetup/winredist/odbccp32.dll
deleted file mode 100755
index 
c75f2deedd5b1d730d80bf5ff672c5b13fe055ce..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbccr32.dll 
b/clients/odbc/winsetup/winredist/odbccr32.dll
deleted file mode 100755
index 
42471b014a009d1023e47f2f028b1d96cec8f338..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbcinst.chm 
b/clients/odbc/winsetup/winredist/odbcinst.chm
deleted file mode 100644
index 
5587f04fc28e3e764118e5c6088e614ddcc222a6..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbcint.dll 
b/clients/odbc/winsetup/winredist/odbcint.dll
deleted file mode 100755
index 
f18360479e3e64b74be5dd452c61e4cd360b7b05..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/clients/odbc/winsetup/winredist/odbctrac.dll 
b/clients/odbc/winsetup/winredist/odbctrac.dll
deleted file mode 100755
index 
b62ab440c550bbd284effc294bfad8cff2258a7d..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001

diff --git a/gdk/gdk_cand.c b/gdk/gdk_cand.c
--- a/gdk/gdk_cand.c
+++ b/gdk/gdk_cand.c
@@ -1293,7 +1293,7 @@ canditer_slice2val(const struct canditer
 }
 
 BAT *
-BATnegcands(BUN nr, BAT *odels)
+BATnegcands2(oid tseq, BUN nr, BAT *odels)
 {
        const char *nme;
        Heap *dels;
@@ -1301,16 +1301,20 @@ BATnegcands(BUN nr, BAT *odels)
        ccand_t *c;
        BAT *bn;
 
-       bn = BATdense(0, 0, nr);
+       bn = BATdense(0, tseq, nr);
        if (bn == NULL)
                return NULL;
        if (BATcount(odels) == 0)
-               return bn;
+               goto doreturn;
 
        lo = SORTfndfirst(odels, &bn->tseqbase);
        hi = SORTfndfirst(odels, &(oid) {bn->tseqbase + BATcount(bn)});
        if (lo == hi)
                return bn;
+       if (lo + nr == hi) {
+               BATsetcount(bn, 0);
+               goto doreturn;
+       }
 
        nme = BBP_physical(bn->batCacheid);
        if ((dels = GDKmalloc(sizeof(Heap))) == NULL){
@@ -1350,10 +1354,7 @@ BATnegcands(BUN nr, BAT *odels)
        assert(bn->tvheap == NULL);
        bn->tvheap = dels;
        BATsetcount(bn, bn->batCount - (hi - lo));
-       TRC_DEBUG(ALGO, "BATnegcands(cands=" ALGOBATFMT ","
-                 "dels=" ALGOBATFMT ")\n",
-                 ALGOBATPAR(bn),
-                 ALGOBATPAR(odels));
+  doreturn:
        TRC_DEBUG(ALGO, "nr=" BUNFMT ", odels=" ALGOBATFMT
                  " -> " ALGOBATFMT "\n",
                  nr, ALGOBATPAR(odels),
@@ -1362,6 +1363,12 @@ BATnegcands(BUN nr, BAT *odels)
 }
 
 BAT *
+BATnegcands(BUN nr, BAT *odels)
+{
+       return BATnegcands2(0, nr, odels);
+}
+
+BAT *
 BATmaskedcands(oid hseq, BUN nr, BAT *masked, bool selected)
 {
        const char *nme;
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -78,6 +78,8 @@ BAT *BATload_intern(bat bid, bool lock)
 gdk_return BATmaterialize(BAT *b, BUN cap)
        __attribute__((__warn_unused_result__))
        __attribute__((__visibility__("hidden")));
+BAT *BATnegcands2(oid hseq, BUN nr, BAT *odels)
+       __attribute__((__visibility__("hidden")));
 gdk_return BATsave_iter(BAT *bd, BATiter *bi, BUN size)
        __attribute__((__visibility__("hidden")));
 void BATsetdims(BAT *b, uint16_t width)
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -545,10 +545,6 @@ NAME##_##TYPE(BATiter *bi, struct candit
        (void) hi;                                                      \
        (void) lval;                                                    \
        (void) hval;                                                    \
-       assert(li == !anti);                                            \
-       assert(hi == !anti);                                            \
-       assert(lval);                                                   \
-       assert(hval);                                                   \
        size_t counter = 0;                                             \
        QryCtx *qry_ctx = MT_thread_get_qry_ctx();                      \
        if (imprints && imprints->imprints.parentid != bi->b->batCacheid) { \
@@ -565,6 +561,104 @@ NAME##_##TYPE(BATiter *bi, struct candit
        } else {                                                        \
                basesrc = src;                                          \
        }                                                               \
+       /* Normalize the variables li, hi, lval, hval, possibly */      \
+       /* changing anti in the process.  This works for all */         \
+       /* (and only) numeric types. */                                 \
+                                                                       \
+       /* Note that the expression x < v is equivalent to x <= */      \
+       /* v' where v' is the next smaller value in the domain */       \
+       /* of v (similarly for x > v).  Also note that for */           \
+       /* floating point numbers there actually is such a */           \
+       /* value.  In fact, there is a function in standard C */        \
+       /* that calculates that value. */                               \
+                                                                       \
+       /* The result is: */                                            \
+       /* li == !anti, hi == !anti, lval == true, hval == true */      \
+       /* This means that all ranges that we check for are */          \
+       /* closed ranges.  If a range is one-sided, we fill in */       \
+       /* the minimum resp. maximum value in the domain so that */     \
+       /* we create a closed range. */                                 \
+       if (anti && li) {                                               \
+               /* -inf < x < vl === -inf < x <= vl-1 */                \
+               if (vl == MINVALUE##TYPE) {                             \
+                       /* -inf < x < MIN || *th <[=] x < +inf */       \
+                       /* degenerates into half range */               \
+                       /* *th <[=] x < +inf */                         \
+                       anti = false;                                   \
+                       vl = vh;                                        \
+                       li = !hi;                                       \
+                       hval = false;                                   \
+                       /* further dealt with below */                  \
+               } else {                                                \
+                       vl = PREVVALUE##TYPE(vl);                       \
+                       li = false;                                     \
+               }                                                       \
+       }                                                               \
+       if (anti && hi) {                                               \
+               /* vl < x < +inf === vl+1 <= x < +inf */                \
+               if (vh == MAXVALUE##TYPE) {                             \
+                       /* -inf < x <[=] *tl || MAX > x > +inf */       \
+                       /* degenerates into half range */               \
+                       /* -inf < x <[=] *tl */                         \
+                       anti = false;                                   \
+                       vh = vl;                                        \
+                       hi = !li;                                       \
+                       lval = false;                                   \
+                       /* further dealt with below */                  \
+               } else {                                                \
+                       vh = NEXTVALUE##TYPE(vh);                       \
+                       hi = false;                                     \
+               }                                                       \
+       }                                                               \
+       if (!anti) {                                                    \
+               if (lval) {                                             \
+                       /* range bounded on left */                     \
+                       if (!li) {                                      \
+                               /* open range on left */                \
+                               if (vl == MAXVALUE##TYPE) {             \
+                                       return 0;                       \
+                               }                                       \
+                               /* vl < x === vl+1 <= x */              \
+                               vl = NEXTVALUE##TYPE(vl);               \
+                               li = true;                              \
+                       }                                               \
+               } else {                                                \
+                       /* -inf, i.e. smallest value */                 \
+                       vl = MINVALUE##TYPE;                            \
+                       li = true;                                      \
+                       lval = true;                                    \
+               }                                                       \
+               if (hval) {                                             \
+                       /* range bounded on right */                    \
+                       if (!hi) {                                      \
+                               /* open range on right */               \
+                               if (vh == MINVALUE##TYPE) {             \
+                                       return 0;                       \
+                               }                                       \
+                               /* x < vh === x <= vh-1 */              \
+                               vh = PREVVALUE##TYPE(vh);               \
+                               hi = true;                              \
+                       }                                               \
+               } else {                                                \
+                       /* +inf, i.e. largest value */                  \
+                       vh = MAXVALUE##TYPE;                            \
+                       hi = true;                                      \
+                       hval = true;                                    \
+               }                                                       \
+               if (vl > vh) {                                          \
+                       return 0;                                       \
+               }                                                       \
+       }                                                               \
+       /* if anti is set, we can now check */                          \
+       /* (x <= vl || x >= vh) && x != nil */                          \
+       /* if anti is not set, we can check just */                     \
+       /* vl <= x && x <= vh */                                        \
+       /* if equi==true, the check is x == vl */                       \
+       /* note that this includes the check for != nil */              \
+       assert(li == !anti);                                            \
+       assert(hi == !anti);                                            \
+       assert(lval);                                                   \
+       assert(hval);                                                   \
        w = canditer_last(ci);                                          \
        if (equi) {                                                     \
                assert(imprints == NULL);                               \
@@ -771,11 +865,35 @@ fullscan_str(BATiter *bi, struct candite
        oid o;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to