Changeset: 69cf9a438678 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/69cf9a438678 Modified Files: gdk/gdk_system.h sql/storage/store.c sql/test/BugTracker-2024/Tests/All Branch: default Log Message:
Merge with Dec2023 branch. diffs (truncated from 580 to 300 lines): diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c --- a/gdk/gdk_system.c +++ b/gdk/gdk_system.c @@ -280,15 +280,16 @@ dump_threads(void) char buf[1024]; thread_lock(); for (struct mtthread *t = mtthreads; t; t = t->next) { + MT_Lock *lk = t->lockwait; + MT_Sema *sm = t->semawait; + MT_Cond *cn = t->condwait; + struct mtthread *jn = t->joinwait; int pos = snprintf(buf, sizeof(buf), - "%s, tid %zu, waiting for %s, working on %.200s", + "%s, tid %zu, waiting for %s%s, working on %.200s", t->threadname, t->tid, - t->lockwait ? t->lockwait->name : - t->semawait ? t->semawait->name : - t->condwait ? t->condwait->name : - t->joinwait ? t->joinwait->threadname : - "nothing", + lk ? "lock " : sm ? "semaphore " : cn ? "condvar " : jn ? "thread " : "", + lk ? lk->name : sm ? sm->name : cn ? cn->name : jn ? jn->threadname : "nothing", ATOMIC_GET(&t->exited) ? "exiting" : t->working ? t->working : "nothing"); #ifdef LOCK_OWNER diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h --- a/gdk/gdk_system.h +++ b/gdk/gdk_system.h @@ -498,7 +498,6 @@ typedef struct MT_Lock { #define MT_lock_try(l) (pthread_mutex_trylock(&(l)->lock) == 0 && (_DBG_LOCK_LOCKER(l), true)) -#ifdef LOCK_STATS #define MT_lock_set(l) \ do { \ _DBG_LOCK_COUNT_0(l); \ @@ -511,14 +510,6 @@ typedef struct MT_Lock { _DBG_LOCK_LOCKER(l); \ _DBG_LOCK_COUNT_2(l); \ } while (0) -#else -#define MT_lock_set(l) \ - do { \ - pthread_mutex_lock(&(l)->lock); \ - _DBG_LOCK_LOCKER(l); \ - } while (0) -#endif - #define MT_lock_unset(l) \ do { \ _DBG_LOCK_UNLOCKER(l); \ diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -57,10 +57,10 @@ ulng store_oldest(sqlstore *store, sql_trans *tr) { if (tr && tr->ts == (ulng) ATOMIC_GET(&store->oldest)) { - sql_session *s = store->active->h->data; - if (s->tr == tr && store->active->h->next) { - s = store->active->h->next->data; - return s->tr->ts; + sql_trans *otr = store->active->h->data; + if (otr == tr && store->active->h->next) { + otr = store->active->h->next->data; + return otr->ts; } } return (ulng) ATOMIC_GET(&store->oldest); diff --git a/sql/test/BugTracker-2024/Tests/All b/sql/test/BugTracker-2024/Tests/All --- a/sql/test/BugTracker-2024/Tests/All +++ b/sql/test/BugTracker-2024/Tests/All @@ -34,3 +34,20 @@ between-true-and-null-Bug-7465 inner-join-contains-7466 contains-or-7469 conversion-string-to-bte-failed-7470 +groupby-select1-Bug-7472 +SQLunionfunc-Bug-7473 +VLTgenerator_table-Bug-7474 +exp_equal-Bug-7475 +rel2bin_join-Bug-7476 +atom_cmp-Bug-7477 +exp_equal-Bug-7478 +exp_ref-Bug-7479 +get_rel_count-Bug-7480 +mvc_row_result_wrap-Bug-7481 +bin_find_smallest_column-Bug-7482 +rel_setop_get_statistics-Bug-7483 +rel_groupby_cse-Bug-7484 +rel_groupby_cse-Bug-7485 +CMDgen_group-Bug-7486 +sql_init_subtype-Bug-7487 +orderby-max-over-rows-Bug-7488 diff --git a/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test b/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/CMDgen_group-Bug-7486.test @@ -0,0 +1,20 @@ +query I nosort +WITH x AS ( SELECT * FROM generate_series ( 32989 , 8100 ) EXCEPT SELECT * FROM generate_series ( 44 , 3 ) ) SELECT CASE WHEN NULL IN ( 69 ) THEN 41 END FROM x LIMIT 3 +---- +NULL +NULL +NULL + +skipif knownfail +query I nosort +WITH x AS ( SELECT * FROM generate_series ( 32989 , 8100 ) EXCEPT SELECT * FROM generate_series ( 44 , 3 ) ) SELECT CASE WHEN NULL IN ( 69 , MAX ( CASE WHEN 97 THEN 66 END ) OVER ( ) + ( SELECT COUNT ( * ) ) ) THEN 41 END FROM x LIMIT 3 +---- +NULL +NULL +NULL + +skipif knownfail +query I nosort +SELECT ( WITH x AS ( SELECT * FROM generate_series ( 32989 , 8100 ) EXCEPT SELECT * FROM generate_series ( 44 , 3 ) ) SELECT CASE WHEN NULL IN ( 69 , MAX ( CASE WHEN 97 THEN 66 END ) OVER ( ) + ( SELECT COUNT ( * ) ) ) THEN 41 END FROM x ) +---- + diff --git a/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test @@ -0,0 +1,5 @@ +skipif knownfail +query I nosort +SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( WITH x ( x ) AS ( SELECT DISTINCT SUM ( 1 ) ) SELECT ( SELECT ( NULLIF ( 9.000000 , 0 ) ) FROM GENERATE_SERIES ( 1 , x ) ) FROM x ) FROM x ) +---- +1 diff --git a/sql/test/BugTracker-2024/Tests/VLTgenerator_table-Bug-7474.test b/sql/test/BugTracker-2024/Tests/VLTgenerator_table-Bug-7474.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/VLTgenerator_table-Bug-7474.test @@ -0,0 +1,17 @@ +query I nosort +SELECT ( NULLIF ( -1 , 255 ) ) +---- +-1 + +query I nosort +SELECT ( NULLIF ( -1 , 255 ) ) FROM GENERATE_SERIES ( 2 , -1 ) +---- +-1 +-1 +-1 + +skipif knownfail +query I nosort +SELECT ( NULLIF ( -1 , 255 ) ) FROM GENERATE_SERIES ( 2147483647 , -1 ) +---- +-1 diff --git a/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test b/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test @@ -0,0 +1,19 @@ +-- trying first without function "abs ( x )" +statement error TypeException:user.main[12]:'calc.==' undefined in: X_0:bit := calc.==(X_1:str, X_2:bte); +SELECT - 66 x GROUP BY x HAVING ( x IN ( SELECT '' x WHERE ( x = ( x = 1 ) ) UNION SELECT 1 ) ) + +-- changing '' into 1, so a string into int +query I nosort +SELECT - 66 x GROUP BY x HAVING ( x IN ( SELECT 1 x WHERE ( x = ( x = 1 ) ) UNION SELECT 1 ) ) +---- +-66 + +query I nosort +SELECT - 66 x GROUP BY x HAVING ( abs ( x ) IN ( SELECT 1 x WHERE ( x = ( x = 1 ) ) UNION SELECT 1 ) ) +---- +-66 + +skipif knownfail +statement error TypeException:user.main[12]:'calc.==' undefined in: X_0:bit := calc.==(X_1:str, X_2:bte); +SELECT - 66 x GROUP BY x HAVING ( abs ( x ) IN ( SELECT '' x WHERE ( x = ( x = 1 ) ) UNION SELECT 1 ) ) + diff --git a/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test b/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test --- a/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test +++ b/sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test @@ -14,7 +14,6 @@ SELECT (((t1.c0 NOT IN (true)))=((t1.c0 ---- NULL -skipif knownfail query I SELECT * FROM t1 WHERE (((t1.c0 NOT IN (true)))=((t1.c0 BETWEEN true AND NULL))) ---- diff --git a/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test b/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test @@ -0,0 +1,5 @@ +skipif knownfail +query I nosort +SELECT var_samp ( '12' ) OVER ( ORDER BY CAST ( ( CASE WHEN ( 99 ) THEN COUNT ( * ) ELSE CASE WHEN 1 THEN ( FALSE ) END END ) AS BIGINT ) ) +---- + diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test @@ -0,0 +1,31 @@ +query II nosort +WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM x WHERE x +---- +1 +1 + +query II nosort +WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x ) WHERE x +---- +1 +1 + +skipif knownfail +query II nosort +SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM x WHERE x ) y +---- +1 +1 + +query II nosort +SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , x FROM ( x NATURAL JOIN x ) WHERE x ) y +---- +1 +1 + +skipif knownfail +query II nosort +SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x ) WHERE x ) y +---- +1 +1 diff --git a/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test @@ -0,0 +1,10 @@ +skipif knownfail +query T nosort +WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' ) +---- + +skipif knownfail +query T nosort +SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' ) ) +---- + diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test @@ -0,0 +1,32 @@ +query T nosort +WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS +---- +1 +1 + +query T nosort +WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN ( SELECT x FROM x AS ) +---- +1 +1 + +query IRI nosort +WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN ( SELECT min ( x ) OVER ( PARTITION BY x ) AS ) +---- +1 +1.000 +1 +1 +-199419.000 +1 + +skipif knownfail +query T nosort +WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN ( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS ) +---- + +skipif knownfail +query T nosort +SELECT ( WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN ( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS ) ) +---- + diff --git a/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test @@ -0,0 +1,15 @@ +query I nosort +SELECT CASE WHEN ( SELECT 2 WHERE FALSE ) > ANY ( 1 ) THEN 1 END +---- +NULL + +query I nosort +SELECT NULL GROUP BY 1 +---- +NULL + +skipif knownfail _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org