Changeset: 0276fdf8d1f2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/0276fdf8d1f2 Modified Files: monetdb5/modules/mal/manifold.c Branch: default Log Message:
merged with Dec2025 diffs (159 lines): diff --git a/ChangeLog.Dec2025 b/ChangeLog.Dec2025 --- a/ChangeLog.Dec2025 +++ b/ChangeLog.Dec2025 @@ -1,3 +1,10 @@ # ChangeLog file for devel # This file is updated with Maddlog +* Wed Mar 4 2026 Joeri van Ruth <[email protected]> +- Suppress error messages in merovingian.log when incoming connections + are closed by the client before any I/O takes place. + Service health monitoring tools tend to do this periodically to check + if MonetDB is still up. + + diff --git a/monetdb5/modules/mal/manifold.c b/monetdb5/modules/mal/manifold.c --- a/monetdb5/modules/mal/manifold.c +++ b/monetdb5/modules/mal/manifold.c @@ -71,7 +71,7 @@ typedef struct { if (ATOMextern(mut->args[0].b->ttype)) { \ for (;;) { \ void *v = NULL; \ - msg = (*(MALfcn##N##ptr mut->pci->fcn))(mut->cntxt, &v, __VA_ARGS__); \ + msg = (*(MALfcn##N##ptr mfcn))(mut->cntxt, &v, __VA_ARGS__); \ if (msg) \ goto bunins_failed; \ if (bunfastapp(mut->args[0].b, v) != GDK_SUCCEED) { \ @@ -104,7 +104,7 @@ typedef struct { void *v = mut->args[0].first; \ size_t w = mut->args[0].b->twidth; \ for (;;) { \ - msg = (*(MALfcn##N mut->pci->fcn))(mut->cntxt, v, __VA_ARGS__); \ + msg = (*(MALfcn##N mfcn))(mut->cntxt, v, __VA_ARGS__); \ if (msg) \ goto bunins_failed; \ if (++oo == olimit) \ @@ -136,7 +136,7 @@ typedef struct { // Only the last error message is returned, the value of // an erroneous call depends on the operator itself. static str -MANIFOLDjob(MULTItask *mut) +MANIFOLDjob(MULTItask *mut, MALfcn mfcn) { int i; char **args; @@ -391,10 +391,7 @@ MANIFOLDevaluate(Client cntxt, MalBlkPtr } */ - MALfcn ofcn = mut.pci->fcn; - mut.pci->fcn = fcn; - msg = MANIFOLDjob(&mut); - mut.pci->fcn = ofcn; + msg = MANIFOLDjob(&mut, fcn); wrapup: // restore the argument types diff --git a/sql/backends/monet5/generator/generator.c b/sql/backends/monet5/generator/generator.c --- a/sql/backends/monet5/generator/generator.c +++ b/sql/backends/monet5/generator/generator.c @@ -1199,9 +1199,14 @@ VLTgenerator_thetasubselect(Client cntxt } \ v = (TPE*) Tloc(bn,0); \ for(; cnt-- > 0; o++){ \ - val = f + ((TPE) (ol == NULL ? o : ol[o])) * s; \ - if ( (s > 0 && (val < f || val >= l)) || (s < 0 && (val <= l || val > f))) \ - continue; \ + oid oi = ol == NULL ? o : ol[o]; \ + if (is_oid_nil(oi)) { \ + val = TPE##_nil; \ + } else { \ + val = f + ((TPE) (ol == NULL ? o : ol[o])) * s; \ + if ( (s > 0 && (val < f || val >= l)) || (s < 0 && (val <= l || val > f))) \ + continue; \ + } \ *v++ = val; \ c++; \ } \ @@ -1246,7 +1251,7 @@ VLTgenerator_projection(Client cntxt, Ma cnt = BATcount(b); if ( b->ttype == TYPE_void) { o = b->tseqbase; - if (is_oid_nil(o)) { + if (is_oid_nil(o)) { tpe = getArgType(mb,p,1); BAT *bn = BATconstant(b->hseqbase, tpe, ATOMnilptr(tpe), cnt, TRANSIENT); BBPunfix(b->batCacheid); diff --git a/sql/test/BugTracker-2026/Tests/7832-strcmp-NULL-crash.test b/sql/test/BugTracker-2026/Tests/7832-strcmp-NULL-crash.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2026/Tests/7832-strcmp-NULL-crash.test @@ -0,0 +1,39 @@ +statement error 42000!SELECT: subquery must return only one column +SELECT ( 1 , 2 , 3 ) = ( 1 , 2 , 3 ) + +statement error 42000!SELECT: subquery must return only one column +SELECT ( 1 , 2 , 3 ) < ( 1 , 2 , 3 ) + +statement error 42000!SELECT: subquery must return only one column +SELECT NOT ( ( 1 , 2 , 3 ) = ( 1 , 2 , 3 ) ) + +statement error 42000!Cannot match a tuple to a single value +SELECT ( 1 , 2 , 3 ) IN ( ( 1 ) , ( 2 ) , ( 3 ) ) + +statement error 42000!Subquery has too few columns +SELECT ( 1 , 2 , 3 ) IN ( SELECT 1 UNION SELECT 2 UNION SELECT 3 ) + +statement error 42000!SELECT: subquery must return only one column +SELECT NOT ( ( 1 , 2 , 3 ) = ( 1 , 2 , 3 ) ) + +statement error 42000!SELECT: subquery must return only one column +SELECT ( SELECT 1 AS x , 2 AS x , 3 AS x ) = ( SELECT 1 AS x , 2 AS x , 3 AS x ) + +statement error 42000!SELECT: subquery must return only one column +SELECT ( 1 , 0 , 3 ) = ( 1 , 2 , 3 ) + +statement error 42000!SELECT: subquery must return only one column +SELECT ( 1 , 0 , 3 ) != ( 1 , 2 , 3 ) + +query I rowsort +SELECT rank ( ) OVER ( PARTITION BY 'x' , 1 , 1 , 'x' ) AS x UNION SELECT 0 AS x UNION SELECT 3 AS x +---- +0 +1 +3 + +query I nosort +SELECT COUNT ( * ) = 0 AS x FROM ( SELECT rank ( ) OVER ( PARTITION BY 'x' , 1 , 1 , 'x' ) AS x UNION SELECT 0 AS x UNION SELECT 3 AS x ) WHERE FALSE = 893 AND x = 12 +---- +1 + diff --git a/sql/test/BugTracker-2026/Tests/All b/sql/test/BugTracker-2026/Tests/All --- a/sql/test/BugTracker-2026/Tests/All +++ b/sql/test/BugTracker-2026/Tests/All @@ -35,4 +35,5 @@ KNOWNFAIL?7801-assertion-failure 7818-out-of-bounds-analytics 7820-mergeors-reset-list 7826-crash-in-optimizer +KNOWNFAIL?7832-strcmp-NULL-crash.test 7836-use-after-free diff --git a/tools/merovingian/daemon/client.c b/tools/merovingian/daemon/client.c --- a/tools/merovingian/daemon/client.c +++ b/tools/merovingian/daemon/client.c @@ -142,7 +142,15 @@ handleClient(void *data) #endif MONETDB5_PASSWDHASH ); - mnstr_flush(fout, MNSTR_FLUSH_DATA); + if (mnstr_flush(fout, MNSTR_FLUSH_DATA) != 0) { + /* We succesfully accepted a connection but writing to it failed + * immediately. This is likely to be a TCP-based health check that + * closed the connection as soon as it was accepted. */ + close_stream(fout); + close_stream(fdin); + self->dead = true; + return NO_ERR; + } /* get response */ buf[0] = '\0'; _______________________________________________ checkin-list mailing list -- [email protected] To unsubscribe send an email to [email protected]
