MonetDB: client_interrupts - Reduce the amount of polling: the p...
Changeset: 9e3624ff3f28 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/9e3624ff3f28 Modified Files: monetdb5/modules/mal/tablet.c Branch: client_interrupts Log Message: Reduce the amount of polling: the poor mac couldn't handle it. diffs (39 lines): diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c --- a/monetdb5/modules/mal/tablet.c +++ b/monetdb5/modules/mal/tablet.c @@ -414,7 +414,7 @@ output_file_default(Tablet *as, BAT *ord } for (q = offset + as->nr, p = offset, id = order->hseqbase + offset; p < q; p++, id++) { - if (bstream_getoob(in)) { + if (((p - offset) & 8191) == 8191 && bstream_getoob(in)) { res = -5; break; } @@ -442,7 +442,7 @@ output_file_dense(Tablet *as, stream *fd return -1; } for (i = 0; i < as->nr; i++) { - if (bstream_getoob(in)) { + if ((i & 8191) == 8191 && bstream_getoob(in)) { res = -5; /* "Query aborted" */ break; } @@ -470,7 +470,7 @@ output_file_ordered(Tablet *as, BAT *ord for (q = offset + as->nr, p = offset; p < q; p++, i++) { oid h = order->hseqbase + p; - if (bstream_getoob(in)) { + if (((p - offset) & 8191) == 8191 && bstream_getoob(in)) { res = -5; break; } @@ -1265,7 +1265,7 @@ SQLproducer(void *p) // we may be reading from standard input and may be out of input // warn the consumers - if (task->aborted || bstream_getoob(task->cntxt->fdin)) { + if (task->aborted || ((lineno & 8191) == 0 && bstream_getoob(task->cntxt->fdin))) { tablet_error(task, rowno, lineno, int_nil, "problem reported by client", s); ateof[cur] = true; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merged client_interrupts branch into default.
Changeset: 35dd9dee1374 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/35dd9dee1374 Branch: default Log Message: Merged client_interrupts branch into default. diffs (truncated from 8089 to 300 lines): diff --git a/clients/ChangeLog b/clients/ChangeLog --- a/clients/ChangeLog +++ b/clients/ChangeLog @@ -1,3 +1,12 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Wed Jan 10 2024 Sjoerd Mullender +- Implemented interrupt handling in mclient. When using mclient + interactively, an interrupt (usually control-C) stops whatever the + client is doing. When editing a line, the line is discarded; when + editing a second or later line of a query, the whole query is discarded; + when a query is being executed, the server is asked to stop the query + at its earliest convenience. Stopping a running query can only be + done with an up-to-date server. All of this does not work on Windows. + diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -681,6 +681,7 @@ MapiMsg mapi_ping(Mapi mid) __attribute_ MapiHdl mapi_prepare(Mapi mid, const char *cmd) __attribute__((__nonnull__(1))); MapiMsg mapi_prepare_handle(MapiHdl hdl, const char *cmd) __attribute__((__nonnull__(1))); MapiHdl mapi_query(Mapi mid, const char *cmd) __attribute__((__nonnull__(1))); +MapiMsg mapi_query_abort(MapiHdl hdl, int reason) __attribute__((__nonnull__(1))); MapiMsg mapi_query_done(MapiHdl hdl) __attribute__((__nonnull__(1))); MapiMsg mapi_query_handle(MapiHdl hdl, const char *cmd) __attribute__((__nonnull__(1))); MapiMsg mapi_query_part(MapiHdl hdl, const char *cmd, size_t size) __attribute__((__nonnull__(1))); @@ -797,7 +798,7 @@ BUN SQLload_file(Client cntxt, Tablet *a str TABLETcollect(BAT **bats, Tablet *as); str TABLETcreate_bats(Tablet *as, BUN est); void TABLETdestroy_format(Tablet *as); -int TABLEToutput_file(Tablet *as, BAT *order, stream *s); +int TABLEToutput_file(Tablet *as, BAT *order, stream *s, bstream *in); int TRACEtable(Client cntxt, BAT **r); int TYPE_xml; int UTF8_strlen(const char *restrict s); @@ -1643,6 +1644,7 @@ stream *block_stream(stream *s); stream *bs_stream(stream *s); bstream *bstream_create(stream *rs, size_t chunk_size); void bstream_destroy(bstream *s); +int bstream_getoob(bstream *s); ssize_t bstream_next(bstream *s); ssize_t bstream_read(bstream *s, size_t size); buffer *buffer_create(size_t size); @@ -1682,12 +1684,14 @@ int mnstr_fsetpos(stream *restrict s, fp int mnstr_fsync(stream *s); buffer *mnstr_get_buffer(stream *s); bool mnstr_get_swapbytes(const stream *s); +int mnstr_getoob(const stream *s); int mnstr_init(void); int mnstr_isalive(const stream *s); bool mnstr_isbinary(const stream *s); const char *mnstr_name(const stream *s); const char *mnstr_peek_error(const stream *s); int mnstr_printf(stream *restrict s, _In_z_ _Printf_format_string_ const char *restrict format, ...) __attribute__((__format__(__printf__, 2, 3))); +int mnstr_putoob(const stream *s, char val); ssize_t mnstr_read(stream *restrict s, void *restrict buf, size_t elmsize, size_t cnt); int mnstr_readBte(stream *restrict s, int8_t *restrict val); int mnstr_readBteArray(stream *restrict s, int8_t *restrict val, size_t cnt); diff --git a/clients/mapiclient/ReadlineTools.c b/clients/mapiclient/ReadlineTools.c --- a/clients/mapiclient/ReadlineTools.c +++ b/clients/mapiclient/ReadlineTools.c @@ -35,6 +35,9 @@ #include #endif +#include +#include + static const char *sql_commands[] = { "SELECT", "INSERT", @@ -421,6 +424,30 @@ bailout: return 1; } +static sigjmp_buf readline_jumpbuf; +static volatile sig_atomic_t mayjump; + +void +readline_int_handler(void) +{ + if (mayjump) { + mayjump = false; + siglongjmp(readline_jumpbuf, 1); + } +} + +char * +call_readline(const char *prompt) +{ + char *res; + if (sigsetjmp(readline_jumpbuf, 1) != 0) + return (char *) -1; /* interrupted */ + mayjump = true; + res = readline(prompt); /* normal code path */ + mayjump = false; + return res; +} + void init_readline(Mapi mid, const char *lang, bool save_history) { @@ -501,5 +528,4 @@ save_line(const char *s) append_history(1, _history_file); } - #endif /* HAVE_LIBREADLINE */ diff --git a/clients/mapiclient/ReadlineTools.h b/clients/mapiclient/ReadlineTools.h --- a/clients/mapiclient/ReadlineTools.h +++ b/clients/mapiclient/ReadlineTools.h @@ -22,6 +22,8 @@ void deinit_readline(void); void save_line(const char *s); rl_completion_func_t *suspend_completion(void); void continue_completion(rl_completion_func_t * func); +void readline_int_handler(void); +char *call_readline(const char *prompt); #endif /* HAVE_LIBREADLINE */ #endif /* READLINETOOLS_H_INCLUDED */ diff --git a/clients/mapiclient/mclient.1 b/cl
MonetDB: client_interrupts - Closing branch client_interrupts.
Changeset: e98fbc254d28 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e98fbc254d28 Branch: client_interrupts Log Message: Closing branch client_interrupts. ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Extend tests with cleaup of created tables, a...
Changeset: f22b65bd6b9d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f22b65bd6b9d Modified Files: sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test sql/test/BugTracker-2024/Tests/pkey-check-failed-7425.test Branch: Dec2023 Log Message: Extend tests with cleaup of created tables, added query to show content and added a version when statements are done within a transaction. diffs (112 lines): diff --git a/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test b/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test --- a/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test +++ b/sql/test/BugTracker-2024/Tests/inequality-hash-issue-7426.test @@ -1,3 +1,46 @@ +statement ok +CREATE TABLE t1(c1 INTEGER) + +statement ok +CREATE TABLE t0(c0 BOOL, c1 INTEGER) + +statement ok +INSERT INTO t1 (c1) VALUES (0) + +statement ok +CREATE UNIQUE INDEX i0 ON t0(c1 , c0 ) + +statement ok +INSERT INTO t0 (c0, c1) VALUES (true, 0) + +query III +SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER JOIN t0 ON t0.c0 + +1 +0 +0 + +query I +SELECT (t0.c1) IS NOT NULL FROM t1 INNER JOIN t0 ON t0.c0 + +1 + +query III +SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER JOIN t0 ON t0.c0 WHERE (t0.c1) IS NOT NULL + +1 +0 +0 + +statement ok +DROP TABLE t0 + +statement ok +DROP TABLE t1 + +-- repeat test but within a transaction +statement ok +start transaction statement ok CREATE TABLE t1(c1 INTEGER) @@ -32,3 +75,6 @@ SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER 1 0 0 + +statement ok +rollback diff --git a/sql/test/BugTracker-2024/Tests/pkey-check-failed-7425.test b/sql/test/BugTracker-2024/Tests/pkey-check-failed-7425.test --- a/sql/test/BugTracker-2024/Tests/pkey-check-failed-7425.test +++ b/sql/test/BugTracker-2024/Tests/pkey-check-failed-7425.test @@ -13,5 +13,51 @@ delete from ttt where id=2 statement ok update ttt set id = 3 where id = 3 +query II +select id, k from ttt order by id + +1 +3 +3 +4 +4 +3 +5 +3 + statement ok drop table ttt + +-- repeat test but within a transaction +statement ok +start transaction + +statement ok +create table ttt(id int primary key,k int NOT NULL DEFAULT '0') + +statement ok +insert into ttt values(1,3),(2,3),(3,3),(4,3),(5,3) + +statement ok +update ttt set k=k+1 where id=3 + +statement ok +delete from ttt where id=2 + +statement ok +update ttt set id = 3 where id = 3 + +query II +select id, k from ttt order by id + +1 +3 +3 +4 +4 +3 +5 +3 + +statement ok +rollback ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Add test for issue 7428
Changeset: 780a2100e7e4 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/780a2100e7e4 Added Files: sql/test/BugTracker-2024/Tests/where-between-issue-7428.test Modified Files: sql/test/BugTracker-2024/Tests/All Branch: Dec2023 Log Message: Add test for issue 7428 diffs (65 lines): 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 @@ -1,2 +1,3 @@ inequality-hash-issue-7426 pkey-check-failed-7425 +where-between-issue-7428.test diff --git a/sql/test/BugTracker-2024/Tests/where-between-issue-7428.test b/sql/test/BugTracker-2024/Tests/where-between-issue-7428.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/where-between-issue-7428.test @@ -0,0 +1,53 @@ +statement ok +CREATE TABLE t0(c0 INTEGER, c1 BOOL, PRIMARY KEY(c0)) + +statement ok +CREATE TABLE t1(c0 INTEGER, PRIMARY KEY(c0)) + +statement ok +INSERT INTO t0 (c0) VALUES (0) + +statement ok +INSERT INTO t1 (c0) VALUES (1),(2),(3) + +query I +SELECT t0.c1 FROM t0, t1 + +NULL +NULL +NULL + +query I +SELECT (((true BETWEEN t0.c1 AND t1.c0)) IS NULL) FROM t0, t1 + +1 +1 +1 + +query I +SELECT t0.c1 FROM t0, t1 WHERE (((true BETWEEN t0.c1 AND t1.c0)) IS NULL) + +NULL +NULL +NULL + +query I +SELECT t0.c1 FROM t0, t1 WHERE NOT (((true BETWEEN t0.c1 AND t1.c0)) IS NOT NULL) + +NULL +NULL +NULL + +query I +SELECT t0.c1 FROM t0, t1 WHERE (1 BETWEEN t0.c1 AND t1.c0) IS NULL + +NULL +NULL +NULL + +statement ok +DROP TABLE t0 + +statement ok +DROP TABLE t1 + ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Add test for issue 7429
Changeset: 1366475d0587 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/1366475d0587 Added Files: sql/test/BugTracker-2024/Tests/where-case-null-issue-7429.test Modified Files: sql/test/BugTracker-2024/Tests/All Branch: Dec2023 Log Message: Add test for issue 7429 diffs (64 lines): 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 @@ -1,3 +1,4 @@ inequality-hash-issue-7426 pkey-check-failed-7425 -where-between-issue-7428.test +where-between-issue-7428 +where-case-null-issue-7429 diff --git a/sql/test/BugTracker-2024/Tests/where-case-null-issue-7429.test b/sql/test/BugTracker-2024/Tests/where-case-null-issue-7429.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/where-case-null-issue-7429.test @@ -0,0 +1,50 @@ +statement ok +CREATE TABLE t7429(c0 VARCHAR) + +statement ok +INSERT INTO t7429 (c0) VALUES ('a'),('b') + +query T +SELECT * FROM t7429 + +a +b + +query I +SELECT (((CASE (NULL)/(1) WHEN NULL THEN true END)OR(false)) IS NULL) FROM t7429 + +1 +1 + +query T +SELECT * FROM t7429 WHERE (((CASE (NULL)/(1) WHEN NULL THEN true END)OR(false)) IS NULL) + +a +b + +query II +SELECT (CASE (NULL)/(1) WHEN NULL THEN true END), (CASE (NULL)/(1) WHEN NULL THEN true END)OR(false) + +NULL +NULL + +query I +SELECT (CASE (NULL)/(1) WHEN NULL THEN true END)OR(false) FROM t7429 + +NULL +NULL + +query T +SELECT * FROM t7429 WHERE NULL + + +query T +SELECT * FROM t7429 WHERE (NULL)OR(false) + + +query T +SELECT * FROM t7429 WHERE (CASE (NULL)/(1) WHEN NULL THEN true END)OR(false) + + +statement ok +DROP TABLE t7429 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Add test for issue 7430
Changeset: 751f5d1dc3db for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/751f5d1dc3db Added Files: sql/test/BugTracker-2024/Tests/create-index-query-issue-7430.test Modified Files: sql/test/BugTracker-2024/Tests/All Branch: Dec2023 Log Message: Add test for issue 7430 diffs (74 lines): 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 @@ -2,3 +2,4 @@ inequality-hash-issue-7426 pkey-check-failed-7425 where-between-issue-7428 where-case-null-issue-7429 +create-index-query-issue-7430 diff --git a/sql/test/BugTracker-2024/Tests/create-index-query-issue-7430.test b/sql/test/BugTracker-2024/Tests/create-index-query-issue-7430.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2024/Tests/create-index-query-issue-7430.test @@ -0,0 +1,61 @@ +statement ok +CREATE TABLE t7430(c0 BOOLEAN, c1 VARCHAR) + +statement ok +INSERT INTO t7430 (c0, c1) VALUES (1, 2), (true, 3), (false, 4) + +query IT rowsort +SELECT t7430.c0, t7430.c1 FROM t7430 + +0 +4 +1 +2 +1 +3 + +query IT rowsort +SELECT t7430.c0, t7430.c1 FROM t7430 WHERE ((t7430.c0)AND(((t7430.c1) IS NOT NULL))) + +1 +2 +1 +3 + +query IT rowsort +SELECT c0, c1 FROM t7430 WHERE c0 AND c1 IS NOT NULL + +1 +2 +1 +3 + +-- the next index causes a problem +statement ok +CREATE UNIQUE INDEX i0t7430 ON t7430(c0 , c1) + +query I rowsort +SELECT ((t7430.c0)AND(((t7430.c1) IS NOT NULL))) FROM t7430 + +0 +1 +1 + +query IT rowsort +SELECT t7430.c0, t7430.c1 FROM t7430 WHERE ((t7430.c0)AND(((t7430.c1) IS NOT NULL))) + +1 +2 +1 +3 + +query IT rowsort +SELECT c0, c1 FROM t7430 WHERE c0 AND c1 IS NOT NULL + +1 +2 +1 +3 + +statement ok +DROP TABLE t7430 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Fix crash when parsing invalid interval strin...
Changeset: 1ebbee3f0896 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/1ebbee3f0896 Added Files: sql/test/BugTracker-2023/Tests/parse_interval-crash-7412.test Modified Files: sql/server/sql_datetime.c sql/test/BugTracker-2023/Tests/All Branch: Dec2023 Log Message: Fix crash when parsing invalid interval string. issue 7412. diffs (59 lines): diff --git a/sql/server/sql_datetime.c b/sql/server/sql_datetime.c --- a/sql/server/sql_datetime.c +++ b/sql/server/sql_datetime.c @@ -139,25 +139,29 @@ parse_interval_(mvc *sql, lng sign, cons switch (sk) { case imonth: if (val >= 12) { - snprintf(sql->errstr, ERRSIZE, _("Overflow detected in months (" LLFMT ")\n"), val); + if (sql) + snprintf(sql->errstr, ERRSIZE, _("Overflow detected in months (" LLFMT ")\n"), val); return -1; } break; case ihour: if (val >= 24) { - snprintf(sql->errstr, ERRSIZE, _("Overflow detected in hours (" LLFMT ")\n"), val); + if (sql) + snprintf(sql->errstr, ERRSIZE, _("Overflow detected in hours (" LLFMT ")\n"), val); return -1; } break; case imin: if (val >= 60) { - snprintf(sql->errstr, ERRSIZE, _("Overflow detected in minutes (" LLFMT ")\n"), val); + if (sql) + snprintf(sql->errstr, ERRSIZE, _("Overflow detected in minutes (" LLFMT ")\n"), val); return -1; } break; case isec: if (val >= 6) { - snprintf(sql->errstr, ERRSIZE, _("Overflow detected in seconds (" LLFMT ")\n"), val); + if (sql) + snprintf(sql->errstr, ERRSIZE, _("Overflow detected in seconds (" LLFMT ")\n"), val); return -1; } break; diff --git a/sql/test/BugTracker-2023/Tests/All b/sql/test/BugTracker-2023/Tests/All --- a/sql/test/BugTracker-2023/Tests/All +++ b/sql/test/BugTracker-2023/Tests/All @@ -15,4 +15,5 @@ misc-crashes-7390 greatest-least-multi-arg-7391 union-query-7401 join-on-row_number-over-7403 +parse_interval-crash-7412 between-crash-7413 diff --git a/sql/test/BugTracker-2023/Tests/parse_interval-crash-7412.test b/sql/test/BugTracker-2023/Tests/parse_interval-crash-7412.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2023/Tests/parse_interval-crash-7412.test @@ -0,0 +1,8 @@ +statement error GDK reported error: INETfromString: Error while parsing, unexpected string '::192.168.1.226' +SELECT CAST ( '::192.168.1.226' AS inet ) + +statement error 42000!Wrong format (::192.168.1.226) +SELECT CAST ( '::192.168.1.226' AS INTERVAL HOUR TO SECOND ) + +statement error 42000!Wrong format (::192.168.1.226) +SELECT CAST ( '::192.168.1.226' AS INTERVAL HOUR ( 3 ) TO SECOND ) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Add test for issue 7414. It didn't crash as r...
Changeset: 1d85c154286d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/1d85c154286d Added Files: sql/test/BugTracker-2023/Tests/corr-issue-7414.test Modified Files: sql/test/BugTracker-2023/Tests/All Branch: Dec2023 Log Message: Add test for issue 7414. It didn't crash as reported but returned an error. diffs (50 lines): diff --git a/sql/test/BugTracker-2023/Tests/All b/sql/test/BugTracker-2023/Tests/All --- a/sql/test/BugTracker-2023/Tests/All +++ b/sql/test/BugTracker-2023/Tests/All @@ -17,3 +17,4 @@ union-query-7401 join-on-row_number-over-7403 parse_interval-crash-7412 between-crash-7413 +corr-issue-7414 diff --git a/sql/test/BugTracker-2023/Tests/corr-issue-7414.test b/sql/test/BugTracker-2023/Tests/corr-issue-7414.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2023/Tests/corr-issue-7414.test @@ -0,0 +1,37 @@ +statement ok +CREATE TABLE t7414 ( v1 , v2 ) as ( select i , cast ( i as string ) from generate_series ( 1 , 1000 ) as t ( i ) ) + +query I +SELECT COUNT(*) FROM t7414 + +999 + +statement error 22018!conversion of string to type bit failed. +DELETE FROM t7414 WHERE NULLIF ( v2 , v2 = ( SELECT corr ( v1 , v1 ) OVER ( ROWS 2 PRECEDING ) ) ) + +query I nosort +SELECT corr ( v1 , v1 ) OVER ( ROWS 2 PRECEDING ) FROM t7414 WHERE v1<5 + +NULL +1 +1 +1 + +query T nosort +SELECT NULLIF ( v2 , ( SELECT corr ( v1 , v1 ) OVER ( ROWS 2 PRECEDING ) ) ) FROM t7414 WHERE v1<5 + +1 +2 +3 +4 + +statement ok +DELETE FROM t7414 WHERE NULLIF ( v2 , v2 = ( SELECT corr ( v1 , v1 ) OVER ( ROWS 2 PRECEDING ) ) ) IS NULL + +query I +SELECT COUNT(*) FROM t7414 + +999 + +statement ok +DROP TABLE t7414 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Add test for issue 7415.
Changeset: 697db481ec12 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/697db481ec12 Added Files: sql/test/BugTracker-2023/Tests/insert-delete-insert-crash-7415.test Modified Files: sql/test/BugTracker-2023/Tests/All Branch: Dec2023 Log Message: Add test for issue 7415. gdk/gdk_heap.c:1161: HEAP_malloc: Assertion `trail == 0 || block > trail' failed. See also analysis https://github.com/MonetDB/MonetDB/issues/7415 diffs (68 lines): diff --git a/sql/test/BugTracker-2023/Tests/All b/sql/test/BugTracker-2023/Tests/All --- a/sql/test/BugTracker-2023/Tests/All +++ b/sql/test/BugTracker-2023/Tests/All @@ -18,3 +18,4 @@ join-on-row_number-over-7403 parse_interval-crash-7412 between-crash-7413 corr-issue-7414 +insert-delete-insert-crash-7415 diff --git a/sql/test/BugTracker-2023/Tests/insert-delete-insert-crash-7415.test b/sql/test/BugTracker-2023/Tests/insert-delete-insert-crash-7415.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2023/Tests/insert-delete-insert-crash-7415.test @@ -0,0 +1,55 @@ +statement ok +CREATE TABLE t1 AS SELECT t1.value AS id, CAST( sys.group_concat( CASE WHEN id.value IS NOT NULL THEN 'DB' ELSE '' END , '') AS BLOB) AS name FROM sys.generate_series(0, 1000) AS t1 LEFT JOIN sys.generate_series(0, 1000) AS id ON id.value < t1.value GROUP BY id ORDER BY id + +query I +select count(*) from t1 + +1000 + +statement ok +insert into t1 (select * from t1) + +statement ok +insert into t1 (select * from t1) + +statement ok +insert into t1 (select * from t1) + +statement ok +insert into t1 (select * from t1) + +query I +select count(*) from t1 + +16000 + +query I +select count(*) from t1 WHERE id=1 + +16 + +statement ok +DELETE FROM t1 WHERE id=1 + +--statement error 42S02!SELECT: no such table 'analytics' +--select nth_value(aa, 1) over (partition by bb) from analytics + +query I +select count(*) from t1 + +15984 + +-- the next insert causes a HEAP_malloc: Assertion `trail == 0 || block > trail' failed. in gdk/gdk_heap.c:1161 +statement ok +insert into t1 (select * from t1) + +statement ok +insert into t1 (select * from t1) + +query I +select count(*) from t1 + +56610 + +statement ok +DROP TABLE t1 ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Dec2023 - Fix issue 7416, a crash when calling atom_get...
Changeset: 96a9b8548710 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/96a9b8548710 Added Files: sql/test/BugTracker-2023/Tests/orderby-debug-crash-7416.test Modified Files: sql/server/sql_atom.c sql/test/BugTracker-2023/Tests/All Branch: Dec2023 Log Message: Fix issue 7416, a crash when calling atom_get_int(atom *a) where atom was NULL. diffs (41 lines): diff --git a/sql/server/sql_atom.c b/sql/server/sql_atom.c --- a/sql/server/sql_atom.c +++ b/sql/server/sql_atom.c @@ -113,7 +113,7 @@ atom_get_int(atom *a) lng r = 0; #endif - if (!a->isnull) { + if (a && !a->isnull) { switch (ATOMstorage(a->data.vtype)) { case TYPE_bte: r = a->data.val.btval; diff --git a/sql/test/BugTracker-2023/Tests/All b/sql/test/BugTracker-2023/Tests/All --- a/sql/test/BugTracker-2023/Tests/All +++ b/sql/test/BugTracker-2023/Tests/All @@ -19,3 +19,4 @@ parse_interval-crash-7412 between-crash-7413 corr-issue-7414 insert-delete-insert-crash-7415 +orderby-debug-crash-7416 diff --git a/sql/test/BugTracker-2023/Tests/orderby-debug-crash-7416.test b/sql/test/BugTracker-2023/Tests/orderby-debug-crash-7416.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2023/Tests/orderby-debug-crash-7416.test @@ -0,0 +1,16 @@ +query II +SELECT 0 , 827 ORDER BY 1 + +0 +827 + +query I +SELECT debug + +0 + +statement error 42000!SELECT: the order by column number (0) is not in the number of projections range (2) +SELECT 0 , 827 ORDER BY 0 + +statement error 42000!SELECT: the order by column number (0) is not in the number of projections range (2) +SELECT 0 , 827 ORDER BY debug ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org