Describe the bug
The CREATE VIEW statement should execute without causing the database to crash. Ideally, the query should gracefully throw an error message.
To Reproduce
DROP TABLE IF EXISTS t0 CASCADE;
DROP TABLE IF EXISTS t1 CASCADE;
CREATE TABLE t0(c0 VARCHAR, c1 INTEGER, PRIMARY KEY(c0));
CREATE VIEW v0(c0) AS SELECT ('a'||t0.c0) FROM t0 GROUP BY (CASE t0.c1 WHEN t0.c1 THEN 'a' END ); -- unexpected end of file
Expected behavior
As mentioned above
Screenshots
backtrace (using gdb):
#1 __pthread_kill_internal (signo=6, threadid=140602744084032) at ./nptl/pthread_kill.c:78
#2 __GI___pthread_kill (threadid=140602744084032, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3 0x00007fe0b1e7e476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4 0x00007fe0b1e647f3 in __GI_abort () at ./stdlib/abort.c:79
#5 0x00007fe0b1e6471b in __assert_fail_base (fmt=0x7fe0b2019130 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
assertion=0x7fe0b1498221 "gbe->type == e_column",
file=0x7fe0b1497af8 "/app/MonetDB/sql/server/rel_select.c", line=1340, function=<optimized out>)
at ./assert/assert.c:92
#6 0x00007fe0b1e75e96 in __GI___assert_fail (assertion=0x7fe0b1498221 "gbe->type == e_column",
file=0x7fe0b1497af8 "/app/MonetDB/sql/server/rel_select.c", line=1340,
function=0x7fe0b149b200 <__PRETTY_FUNCTION__.34> "group_by_pk_project_uk_cond") at ./assert/assert.c:101
#7 0x00007fe0b132d6e0 in group_by_pk_project_uk_cond () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#8 0x00007fe0b132f10c in rel_column_ref () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#9 0x00007fe0b13451df in rel_value_exp2 () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#10 0x00007fe0b1345bb8 in rel_value_exp () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#11 0x00007fe0b13380e4 in rel_binop () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#12 0x00007fe0b1345169 in rel_value_exp2 () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#13 0x00007fe0b1345bb8 in rel_value_exp () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#14 0x00007fe0b1345cea in column_exp () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#15 0x00007fe0b13465cf in rel_column_exp () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#16 0x00007fe0b1347895 in rel_select_exp () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#17 0x00007fe0b13483cc in rel_query () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#18 0x00007fe0b134a0b0 in rel_subquery () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#19 0x00007fe0b134a2aa in rel_selects () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#20 0x00007fe0b134a3c9 in schema_selects () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#21 0x00007fe0b135ed85 in rel_create_view () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#22 0x00007fe0b1366371 in rel_schemas () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#23 0x00007fe0b13262d3 in rel_semantic () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#24 0x00007fe0b1142dff in sql_symbol2relation () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#25 0x00007fe0b1170737 in SQLparser_body () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#26 0x00007fe0b117182b in SQLparser () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#27 0x00007fe0b11719ca in SQLengine_ () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#28 0x00007fe0b1171aa0 in SQLengine () from /usr/local/lib/libmonetdbsql-11.52.0.so.14
#29 0x00007fe0b366a015 in runScenarioBody () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#30 0x00007fe0b366a123 in runScenario () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#31 0x00007fe0b366c165 in MSserveClient () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#32 0x00007fe0b366b970 in MSscheduleClient () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#33 0x00007fe0b376f60b in doChallenge () from /usr/local/lib/libmonetdb5-11.52.0.so.35
#34 0x00007fe0b2918a48 in thread_starter () from /usr/local/lib/libbat-11.52.0.so.28
#35 0x00007fe0b1ed0ac3 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#36 0x00007fe0b1f61a04 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:100
Software versions
Build from source https://www.monetdb.org/documentation-Dec2023/dev-guide/installation-from-source/#summary:
> docker exec -it monetdb-test mserver5 --version
MonetDB 5 server 11.52.0 (hg id: 0fbb4da) (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2023 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 503.5GiB available memory, 128 available cpu cores
Libraries:
Compiled by: @6a1bbdadc0f6 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
Issue labeling
Bug
Additional context
Add any other context about the problem here.
Describe the bug
The
CREATE VIEWstatement should execute without causing the database to crash. Ideally, the query should gracefully throw an error message.To Reproduce
Expected behavior
As mentioned above
Screenshots
backtrace (using gdb):
Software versions
Build from source https://www.monetdb.org/documentation-Dec2023/dev-guide/installation-from-source/#summary:
Issue labeling
Bug
Additional context
Add any other context about the problem here.