issue_owner_repo listlengths 2 2 | issue_body stringlengths 0 261k ⌀ | issue_title stringlengths 1 925 | issue_comments_url stringlengths 56 81 | issue_comments_count int64 0 2.5k | issue_created_at stringlengths 20 20 | issue_updated_at stringlengths 20 20 | issue_html_url stringlengths 37 62 | issue_github_id int64 387k 2.46B | issue_number int64 1 127k |
|---|---|---|---|---|---|---|---|---|---|
[
"MonetDB",
"MonetDB"
] | Describe the bug
MonetDB compilation failed on my machine due to the following warnings converted to errors.
To Reproduce
Compile with -Wall flag enabled on GCC 10.5.0 and the following warnings will show:
```
In file included from monetdb_config.h:57,
from sql/server/sql_semantic.c:13:
sql/server/sql_semantic.c: In function ‘find_sequence_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:188:2: note: in expansion of macro ‘search_object_on_path’
188 | search_object_on_path(res = find_sql_sequence(sql->session->tr, next, name), DO_NOTHING, ;, SQLSTATE(42000));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_idx_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:198:2: note: in expansion of macro ‘search_object_on_path’
198 | search_object_on_path(res = mvc_bind_idx(sql, next, name), DO_NOTHING, ;, SQLSTATE(42S12));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_type_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:208:2: note: in expansion of macro ‘search_object_on_path’
208 | search_object_on_path(res = schema_bind_type(sql, next, name), DO_NOTHING, ;, SQLSTATE(42S01));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_trigger_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:218:2: note: in expansion of macro ‘search_object_on_path’
218 | search_object_on_path(res = mvc_bind_trigger(sql, next, name), DO_NOTHING, ;, SQLSTATE(3F000));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_variable_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:259:2: note: in expansion of macro ‘search_object_on_path’
259 | search_object_on_path(var_find_on_global, DO_NOTHING, variable_extra, SQLSTATE(42000));
| ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
Expected behavior
The compilation should succeed.
**Software versions**
- Latest compiled source on default branch.
- OS and version: Ubuntu 22.04
- Self-installed and compiled
| MonetDB compilation error on Ubuntu | https://api.github.com/repos/MonetDB/MonetDB/issues/7516/comments | 0 | 2024-05-14T11:01:30Z | 2024-05-14T15:00:13Z | https://github.com/MonetDB/MonetDB/issues/7516 | 2,295,123,211 | 7,516 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB compilation failed on my machine due to the following warnings converted to errors.
**To Reproduce**
Compile with -Wall flag enabled on GCC 10.5.0 and the following warnings will show:
```
In file included from monetdb_config.h:57,
from sql/server/sql_semantic.c:13:
sql/server/sql_semantic.c: In function ‘find_sequence_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:188:2: note: in expansion of macro ‘search_object_on_path’
188 | search_object_on_path(res = find_sql_sequence(sql->session->tr, next, name), DO_NOTHING, ;, SQLSTATE(42000));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_idx_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:198:2: note: in expansion of macro ‘search_object_on_path’
198 | search_object_on_path(res = mvc_bind_idx(sql, next, name), DO_NOTHING, ;, SQLSTATE(42S12));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_type_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:208:2: note: in expansion of macro ‘search_object_on_path’
208 | search_object_on_path(res = schema_bind_type(sql, next, name), DO_NOTHING, ;, SQLSTATE(42S01));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_trigger_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:218:2: note: in expansion of macro ‘search_object_on_path’
218 | search_object_on_path(res = mvc_bind_trigger(sql, next, name), DO_NOTHING, ;, SQLSTATE(3F000));
| ^~~~~~~~~~~~~~~~~~~~~
sql/server/sql_semantic.c: In function ‘find_variable_on_scope’:
sql/server/sql_semantic.c:124:10: error: the address of ‘objstr’ will always evaluate as ‘true’ [-Werror=address]
124 | assert(objstr); \
| ^~~~~~
sql/server/sql_semantic.c:259:2: note: in expansion of macro ‘search_object_on_path’
259 | search_object_on_path(var_find_on_global, DO_NOTHING, variable_extra, SQLSTATE(42000));
| ^~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
**Expected behavior**
The compilation should succeed.
**Software versions**
- Latest compiled source on default branch.
- OS and version: Ubuntu 22.04
- Self-installed and compiled
| MonetDB compilation error on Ubuntu | https://api.github.com/repos/MonetDB/MonetDB/issues/7515/comments | 0 | 2024-05-14T10:58:05Z | 2024-05-14T10:58:32Z | https://github.com/MonetDB/MonetDB/issues/7515 | 2,295,115,682 | 7,515 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Running a query with an nonexistent window function and three parameters raises `ParseException:SQLparser:42000!Query too complex: running out of stack space`. I understand that this isn't a big deal but, in my opinion, this could be related to some MAL Interpreter error and solve other problems.
**To Reproduce**
Run this query
```sql
select
wrong_function(col1, col2, col3) over w
from
(select 0 as col1, 1 as col2, 2 as col3) t window w as (partition by col1)
```
Please notice that this could be achieved even with _wrong_ query, e.g.
```sql
select
wrong_function(col1, col2, wrong_column) over w
from
(select 0 as col1, 1 as col2, 2 as col3) t window w as (partition by col1)
```
**Expected behavior**
MonetDB should respond with `ParseException:SQLparser:42000!SELECT: no such window function 'wrong_function'(tinyint, tinyint, tinyint)`
**Software versions**
- MonetDB version number 11.49.5
- OS and version: Ubuntu 22.04
- Installed from release package
**Issue labeling**
bug
**Additional context**
MonetDB was running inside a container
| Nonexistent window function raises `ParseException:SQLparser:42000!Query too complex: running out of stack space` | https://api.github.com/repos/MonetDB/MonetDB/issues/7514/comments | 1 | 2024-05-10T12:05:08Z | 2024-06-27T13:20:13Z | https://github.com/MonetDB/MonetDB/issues/7514 | 2,289,605,276 | 7,514 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes with the `GETHOST` function.
**To Reproduce**
```sql
SELECT GETHOST('https://me:pw@www.monetdb.org/Doc');
SELECT GETHOST('https://me:pw@www.monetdb.org/Doc');
SELECT GETHOST('https://me:pw@www.monetdb.org/Doc');
```
**Backtrace of the Crash**
```
#0 0x00007f6586d289e5 in ?? () from target:/lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f65874ae017 in GDKfree () from target:/usr/local/lib/libbat.so.28
#2 0x00007f658753eb3b in VALclear () from target:/usr/local/lib/libbat.so.28
#3 0x00007f6588176a2d in resetMalBlk () from target:/usr/local/lib/libmonetdb5.so.35
#4 0x00007f6586255b72 in SQLrun () from target:/usr/local/lib/libmonetdbsql.so.14
#5 0x00007f6586256d7c in SQLengineIntern () from target:/usr/local/lib/libmonetdbsql.so.14
#6 0x00007f658625531a in SQLengine_ () from target:/usr/local/lib/libmonetdbsql.so.14
#7 0x00007f658625591b in SQLengine () from target:/usr/local/lib/libmonetdbsql.so.14
#8 0x00007f6588190826 in runScenario () from target:/usr/local/lib/libmonetdb5.so.35
#9 0x00007f6588191140 in MSscheduleClient () from target:/usr/local/lib/libmonetdb5.so.35
#10 0x00007f6588240922 in doChallenge () from target:/usr/local/lib/libmonetdb5.so.35
#11 0x00007f658753ceed in thread_starter () from target:/usr/local/lib/libbat.so.28
#12 0x00007f6586e8c609 in start_thread () from target:/lib/x86_64-linux-gnu/libpthread.so.0
#13 0x00007f6586db1353 in clone () from target:/lib/x86_64-linux-gnu/libc.so.6
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes with the `GETHOST` function | https://api.github.com/repos/MonetDB/MonetDB/issues/7513/comments | 1 | 2024-05-09T20:28:01Z | 2024-07-09T08:42:32Z | https://github.com/MonetDB/MonetDB/issues/7513 | 2,288,409,310 | 7,513 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes with the `GET_MERGE_TABLE_PARTITION_EXPRESSIONS` function.
**To Reproduce**
```sql
SELECT GET_MERGE_TABLE_PARTITION_EXPRESSIONS('');
SELECT GET_MERGE_TABLE_PARTITION_EXPRESSIONS(0);
```
**Backtrace of the Crash**
```
#0 0x00007f55d352f0b5 in bind_col () from target:/usr/local/lib/libmonetdbsql.so.14
#1 0x00007f55d341e824 in mvc_bind_wrap () from target:/usr/local/lib/libmonetdbsql.so.14
#2 0x00007f55d53511b8 in runMALsequence () from target:/usr/local/lib/libmonetdb5.so.35
#3 0x00007f55d5353c0a in DFLOWworker () from target:/usr/local/lib/libmonetdb5.so.35
#4 0x00007f55d4714eed in thread_starter () from target:/usr/local/lib/libbat.so.28
#5 0x00007f55d4064609 in start_thread () from target:/lib/x86_64-linux-gnu/libpthread.so.0
#6 0x00007f55d3f89353 in clone () from target:/lib/x86_64-linux-gnu/libc.so.6
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes with the `GET_MERGE_TABLE_PARTITION_EXPRESSIONS` function | https://api.github.com/repos/MonetDB/MonetDB/issues/7512/comments | 1 | 2024-05-09T20:26:52Z | 2024-07-09T08:42:30Z | https://github.com/MonetDB/MonetDB/issues/7512 | 2,288,407,694 | 7,512 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes with the `PASSWORD_HASH` function.
**To Reproduce**
```sql
SELECT PASSWORD_HASH('1');
```
**Backtrace of the Crash**
```
#0 0x00007fe06dbab915 in ?? () from target:/lib/x86_64-linux-gnu/libc.so.6
#1 0x00007fe06e24a2e0 in strPut () from target:/usr/local/lib/libbat.so.28
#2 0x00007fe06e2be3e9 in BUNappendmulti () from target:/usr/local/lib/libbat.so.28
#3 0x00007fe06e2bf9af in BUNappend () from target:/usr/local/lib/libbat.so.28
#4 0x00007fe06d0fa8e1 in res_col_create () from target:/usr/local/lib/libmonetdbsql.so.14
#5 0x00007fe06d0351ff in mvc_result_value () from target:/usr/local/lib/libmonetdbsql.so.14
#6 0x00007fe06cfd5a15 in mvc_scalar_value_wrap () from target:/usr/local/lib/libmonetdbsql.so.14
#7 0x00007fe06ef0a1b8 in runMALsequence () from target:/usr/local/lib/libmonetdb5.so.35
#8 0x00007fe06ef0c3b9 in runMAL () from target:/usr/local/lib/libmonetdb5.so.35
#9 0x00007fe06cfe6b67 in SQLrun () from target:/usr/local/lib/libmonetdbsql.so.14
#10 0x00007fe06cfe7d7c in SQLengineIntern () from target:/usr/local/lib/libmonetdbsql.so.14
#11 0x00007fe06cfe631a in SQLengine_ () from target:/usr/local/lib/libmonetdbsql.so.14
#12 0x00007fe06cfe691b in SQLengine () from target:/usr/local/lib/libmonetdbsql.so.14
#13 0x00007fe06ef21826 in runScenario () from target:/usr/local/lib/libmonetdb5.so.35
#14 0x00007fe06ef22140 in MSscheduleClient () from target:/usr/local/lib/libmonetdb5.so.35
#15 0x00007fe06efd1922 in doChallenge () from target:/usr/local/lib/libmonetdb5.so.35
#16 0x00007fe06e2cdeed in thread_starter () from target:/usr/local/lib/libbat.so.28
#17 0x00007fe06dc1d609 in start_thread () from target:/lib/x86_64-linux-gnu/libpthread.so.0
#18 0x00007fe06db42353 in clone () from target:/lib/x86_64-linux-gnu/libc.so.6
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes with the `PASSWORD_HASH` function | https://api.github.com/repos/MonetDB/MonetDB/issues/7511/comments | 0 | 2024-05-09T20:24:55Z | 2024-07-09T08:42:30Z | https://github.com/MonetDB/MonetDB/issues/7511 | 2,288,403,488 | 7,511 |
[
"MonetDB",
"MonetDB"
] | We are using Monetdb as our BI database. Sometimes we experience crash of the database during some query execution. The data is critical and database needs to recover, but there is no way how to recover form the crash. Is there any way we recover from the crashed db without any loss of the data or a very minimal loss(in this case we can rerun the process to insert data again).
There is a way to backup the database as explained here - ([Backup][1]https://www.monetdb.org/documentation-Dec2023/admin-guide/backup-upgrade/hot-backup/
But the backup utility can still loose the data in case of crash before the backup is done.
Please guide on the strategy. | Monetdb recovery from crash and backup | https://api.github.com/repos/MonetDB/MonetDB/issues/7510/comments | 5 | 2024-05-02T06:48:54Z | 2024-05-16T12:16:12Z | https://github.com/MonetDB/MonetDB/issues/7510 | 2,274,751,957 | 7,510 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes at `sql_init_subtype`.
**To Reproduce**
```sql
SELECT LEVENSHTEIN('int', 'X2014-10-25 UTC');
```
**Backtrace of the Crash**
```
#0 0x7fc87dce1233 (sql_init_subtype+0x13)
#1 0x7fc87dd05877 (res_col_create+0x87)
#2 0x7fc87dc58851 (mvc_result_value+0x51)
#3 0x7fc87dc04a6c (mvc_scalar_value_wrap+0x12c)
#4 0x7fc87dfd7a5e (runMALsequence+0x79e)
#5 0x7fc87dfd7ddf (runMALsequence+0xb1f)
#6 0x7fc87dfd7073 (runMAL+0xa3)
#7 0x7fc87dc14ab0 (SQLrun+0x100)
#8 0x7fc87dc15cde (SQLengineIntern+0x4e)
#9 0x7fc87dc13af9 (SQLengine_+0xa09)
#10 0x7fc87dc11fc3 (SQLengine+0x23)
#11 0x7fc87dfed5ff (runScenario+0x4f)
#12 0x7fc87dfedfb6 (MSscheduleClient+0x5d6)
#13 0x7fc87e0a0aab (doChallenge+0xfb)
#14 0x7fc87e832f21 (thread_starter+0x191)
#15 0x7fc87db2a609 (start_thread+0xd9)
#16 0x7fc87da4d353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes at `sql_init_subtype` | https://api.github.com/repos/MonetDB/MonetDB/issues/7509/comments | 2 | 2024-05-01T20:39:25Z | 2024-07-09T08:42:29Z | https://github.com/MonetDB/MonetDB/issues/7509 | 2,274,158,159 | 7,509 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes at `exp_ref`. It can also be reproduced on the latest docker image monetdb/dev-builds:default.
**To Reproduce**
```sql
SELECT FIELD('fieldID99999999999999999999999999999999999999999999999999999999999999999999999');
```
**Backtrace of the Crash**
```
#0 0x7f16e2a04aa2 (exp_ref+0x22)
#1 0x7f16e29e9229 (rel_value_exp2+0x1379)
#2 0x7f16e29e3184 (rel_value_exp+0x84)
#3 0x7f16e29efd29 (rel_select_exp+0x389)
#4 0x7f16e29eb2e7 (rel_subquery+0x2b7)
#5 0x7f16e29eb45e (rel_selects+0xce)
#6 0x7f16e29df421 (rel_semantic+0xa1)
#7 0x7f16e28b4d35 (sql_symbol2relation+0x75)
#8 0x7f16e28cf0bc (SQLparser+0x4cc)
#9 0x7f16e28ce6dd (SQLengine_+0x5ed)
#10 0x7f16e28ccfc3 (SQLengine+0x23)
#11 0x7f16e2ca85ff (runScenario+0x4f)
#12 0x7f16e2ca8fb6 (MSscheduleClient+0x5d6)
#13 0x7f16e2d5baab (doChallenge+0xfb)
#14 0x7f16e34edf21 (thread_starter+0x191)
#15 0x7f16e27e5609 (start_thread+0xd9)
#16 0x7f16e2708353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes at `exp_ref` | https://api.github.com/repos/MonetDB/MonetDB/issues/7508/comments | 0 | 2024-05-01T20:36:58Z | 2024-06-27T13:20:09Z | https://github.com/MonetDB/MonetDB/issues/7508 | 2,274,155,131 | 7,508 |
[
"MonetDB",
"MonetDB"
] | **Screenshots**
- merovingian.log

**Software versions**
- MonetDB Database Server v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04.5 LTS (Focal Fossa)
- Installed from the release package
**Additional context**
- wc -l BBP.dir

- The first ten lines in the file BBP.dir

- The last ten lines in the file BBP.dir
 | BBPextend: ERROR: trying to extend BAT pool beyond the limit (163840000) | https://api.github.com/repos/MonetDB/MonetDB/issues/7507/comments | 3 | 2024-05-01T07:29:05Z | 2024-06-27T13:20:08Z | https://github.com/MonetDB/MonetDB/issues/7507 | 2,273,070,938 | 7,507 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB Dec2023-SP2 crashes at `rel_value_exp2`.
**To Reproduce**
```sql
SELECT FIELD(x, '', '', '', '', '', '', '', '', '', '', '', '', '');
```
**Backtrace of the Crash**
```
#0 0x7fb1f9b6314e (rel_value_exp2+0x129e)
#1 0x7fb1f9b5d184 (rel_value_exp+0x84)
#2 0x7fb1f9b69d29 (rel_select_exp+0x389)
#3 0x7fb1f9b652e7 (rel_subquery+0x2b7)
#4 0x7fb1f9b6545e (rel_selects+0xce)
#5 0x7fb1f9b59421 (rel_semantic+0xa1)
#6 0x7fb1f9a2ed35 (sql_symbol2relation+0x75)
#7 0x7fb1f9a490bc (SQLparser+0x4cc)
#8 0x7fb1f9a486dd (SQLengine_+0x5ed)
#9 0x7fb1f9a46fc3 (SQLengine+0x23)
#10 0x7fb1f9e225ff (runScenario+0x4f)
#11 0x7fb1f9e22fb6 (MSscheduleClient+0x5d6)
#12 0x7fb1f9ed5aab (doChallenge+0xfb)
#13 0x7fb1fa667f21 (thread_starter+0x191)
#14 0x7fb1f995f609 (start_thread+0xd9)
#15 0x7fb1f9882353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023-SP2 (or monetdb/dev-builds:default) | MonetDB Dec2023-SP2 crashes at `rel_value_exp2` | https://api.github.com/repos/MonetDB/MonetDB/issues/7506/comments | 0 | 2024-05-01T07:10:09Z | 2024-06-27T13:20:07Z | https://github.com/MonetDB/MonetDB/issues/7506 | 2,273,051,429 | 7,506 |
[
"MonetDB",
"MonetDB"
] | LOGS:
ERR im_monet[2317943]: #main thread: GDKmmap: ERROR: requesting virtual memory failed; memory requested: 1310720, memory in use: 4174219792, virtual memory in use: 1626303007248
➜ monetdb
ERR im_monet[738170]: #main thread: GDKmmap: ERROR: requesting virtual memory failed; memory requested: 1048576, memory in use: 4869503448, virtual memory in use: 845784005080
➜ monetdb monetdbd get all /opt/monet2/monetdb
property value
hostname im-monetpoc01-sq1
dbfarm /opt/monet2/monetdb
status monetdbd[3299345] 11.45.17 (Sep2022-SP3) is serving this dbfarm
mserver /usr/bin/mserver5
logfile /opt/monet2/monetdb/merovingian.log
pidfile /opt/monet2/monetdb/merovingian.pid
loglevel information
sockdir /tmp
listenaddr 0.0.0.0
port 50000
exittimeout 60
forward proxy
discovery yes
discoveryttl 600
control no
passphrase <unset>
snapshotdir <unset>
snapshotcompression .tar.lz4
mapisock /tmp/.s.monetdb.50000
controlsock /tmp/.s.merovingian.50000
➜ monetdb hostnamectl
Static hostname: im-monetpoc01-sq1
Icon name: computer-server
Chassis: server
Machine ID: f152f98995ca4da9b7a053be4d66c3d4
Boot ID: d2c57a001508435da7d2017e5a3dd590
Operating System: Oracle Linux Server 8.8
CPE OS Name: cpe:/o:oracle:linux:8:8:server
Kernel: Linux 5.4.17-2136.319.1.4.el8uek.x86_64
Architecture: x86-64
| GDKmmap: requested too much virtual memory | https://api.github.com/repos/MonetDB/MonetDB/issues/7505/comments | 2 | 2024-04-30T22:41:19Z | 2024-05-08T11:39:27Z | https://github.com/MonetDB/MonetDB/issues/7505 | 2,272,598,005 | 7,505 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
One thread calling bm_commit (store manager applying the WAL) and making a bat persistent (calling BATmode), and another thread unloading the same bat (BBPmanager calling BBPtrim) at the same time may cause deadlock. BATmode has a reference to the heaps (bat_iterator) when it calls BBPretain, which calls incref, which waits until unloading is finished; and BBPtrim calls BBPfree which calls BATfree which waits until the heap reference count goes down. In other words, two threads waiting for each other.
| possible deadlock when a bat is made persistent when it is also getting unloaded | https://api.github.com/repos/MonetDB/MonetDB/issues/7504/comments | 0 | 2024-04-29T14:41:20Z | 2024-06-27T13:20:06Z | https://github.com/MonetDB/MonetDB/issues/7504 | 2,269,231,495 | 7,504 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Using `UPDATE` statement with `WHEN MATCHED THEN UPDATE` will cause mserver5 to crash with segmentation fault error. This happens only with latest version, v11.49.7, with v11.49.5 everything's good.
**To Reproduce**
1. Create database with this structure
```sql
CREATE TABLE logs (
id int,
activity varchar(255) NOT NULL
);
CREATE TABLE stats (
activity varchar(255) NOT NULL,
absolute_reworks int
);
```
2. Run this query, even with empty tables
```sql
WITH rework_stats AS (
SELECT
activity,
count(*) AS frequency
FROM (
SELECT
activity,
count(*) AS reworks
FROM
logs
GROUP BY
activity
HAVING
count(*) > 1) AS case_reworks
GROUP BY
activity)
MERGE INTO
stats
USING
rework_stats on
rework_stats.activity = stats.activity
WHEN MATCHED THEN UPDATE
SET
absolute_reworks = rework_stats.frequency
```
**Software versions**
- MonetDB version number v11.49.7 (Dec2023-SP2)
- OS and version: Ubuntu 22.04.4
- From docker image using custom container `FROM ubuntu:jammy`
**Issue labeling**
bug
**Additional context**
```
# MonetDB 5 server v11.49.7 (Dec2023-SP2)
# Serving database 'test', using 12 threads
# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers
# Found 15.499 GiB available main-memory of which we use 12.632 GiB
# Copyright (c) 2024 MonetDB Foundation, all rights reserved
# Visit https://www.monetdb.org/ for further information
# MonetDB/SQL module loaded
# Listening for connection requests on mapi:monetdb://0b11043ffe34:50000/
/opt/monetdb/monetdb-start.sh: line 18: 2 Segmentation fault mserver5 --dbpath=/opt/dbfarm/test --set=merovingian_uri=mapi:monetdb://localhost:50000/test --set=mapi_listenaddr=0.0.0.0 -d10 --dbtrace=DEBUG
```
| MonetDB server crashes using `WHEN MATCHED THEN UPDATE` | https://api.github.com/repos/MonetDB/MonetDB/issues/7503/comments | 1 | 2024-04-29T13:40:12Z | 2024-06-27T13:20:05Z | https://github.com/MonetDB/MonetDB/issues/7503 | 2,269,085,142 | 7,503 |
[
"MonetDB",
"MonetDB"
] | LOGS:
185 2024-04-29 00:27:45 ERR im_monet[170697]: #GDKmalloc(2690064384) fails, try to free up space [memory in use=394318426664,virtual memory in use=1334861410856]
186 2024-04-29 00:27:51 ERR im_monet[170697]: #GDKmalloc(3101263872) fails, try to free up space [memory in use=394319013104,virtual memory in use=1337708356848]
2024-04-29 00:28:36 ERR im_monet[170697]: #GDKmalloc(1366956032) fails, try to free up space [memory in use=395876219240,virtual memory in use=1342435866984]
220 2024-04-29 00:28:36 ERR im_monet[170697]: #GDKmalloc(2549714944) fails, try to free up space [memory in use=395876546080,virtual memory in use=1343824180768]
221 2024-04-29 00:28:39 ERR im_monet[170697]: #GDKmalloc(3982016512) fails, try to free up space [memory in use=396128151152,virtual memory in use=1342135330416]
222 2024-04-29 00:28:40 ERR im_monet[170697]: #GDKmalloc(2763450368) fails, try to free up space [memory in use=396488057568,virtual memory in use=1346646352608]
223 2024-04-29 00:28:42 ERR im_monet[170697]: #GDKmalloc(3906095104) fails, try to free up space [memory in use=396759724096,virtual memory in use=1345211396160]
property value
hostname im-monetdb01-ng1.txel.systems
dbfarm /opt/monet2/monetdb
status monetdbd[101569] 1.7 (Jul2017-SP4) is serving this dbfarm
mserver /usr/bin/mserver5
logfile /opt/monet2/monetdb/merovingian.log
pidfile /opt/monet2/monetdb/merovingian.pid
sockdir /tmp
listenaddr 0.0.0.0
port 50000
exittimeout 60
forward proxy
discovery yes
discoveryttl 600
control no
passphrase <unknown>
mapisock /tmp/.s.monetdb.50000
controlsock /tmp/.s.merovingian.50000
sql>SELECT name, value FROM sys.env();
+-----------------------------+-------------------------------------------------------------+
| name | value |
+=============================+=============================================================+
| gdk_dbpath | /opt/monet2/monetdb/im_monet |
| gdk_debug | 0 |
| gdk_vmtrim | no |
| monet_prompt | > |
| monet_daemon | yes |
| mapi_port | 0 |
| mapi_open | false |
| mapi_autosense | false |
| sql_optimizer | default_pipe |
| sql_debug | 0 |
| merovingian_uri | mapi:monetdb://im-monetdb01-ng1.txel.systems:50000/im_monet |
| mapi_usock | /opt/monet2/monetdb/im_monet/.mapi.sock |
| monet_vault_key | /opt/monet2/monetdb/im_monet/.vaultkey |
| gdk_nr_threads | 56 |
| max_clients | 64 |
| gdk_dbname | im_monet |
| gdk_vm_maxsize | 4398046511104 |
| gdk_mem_maxsize | 440492518604 |
| gdk_mmap_minsize_persistent | 262144 |
| gdk_mmap_minsize_transient | 4294967296 |
| gdk_mmap_pagesize | 65536 |
| monet_pid | 303832 |
| monet_version | 11.27.13 |
| monet_release | Jul2017-SP4 |
| monet_mod_path | /usr/lib64/monetdb5 |
| recovery | finished |
+-----------------------------+-------------------------------------------------------------+
26 tuples (4.066ms)

root@im-monetdb01-ng1:~|⇒ free -h
total used free shared buff/cache available
Mem: 503G 46G 9.3G 3.9G 448G 451G
Swap: 14G 177M 14G
| 2024-04-29 00:29:44 MSG merovingian[101569]: databasehas crashed after start on 2024-04-28 17:48:46, attempting restart, up min/avg/max: 0s/4h/4d, crash average: 1.00 0.90 0.80 (16018-2105=13913) | https://api.github.com/repos/MonetDB/MonetDB/issues/7502/comments | 1 | 2024-04-29T10:16:48Z | 2024-06-28T09:31:14Z | https://github.com/MonetDB/MonetDB/issues/7502 | 2,268,642,840 | 7,502 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
In certain circumstances it can happen that backup *.tail and *.theap files were present and remained in the BACKUP directory. During a (low level) commit, these files should have been removed as part of the commit process, but they weren't. This does not affect a running server, but it does affect a restart (for whatever reason) of the server.
**To Reproduce**
In order to reproduce this, you probably need to set the VM size to some lower value, create tables with some, but not too much, content, perhaps we need a WAL rotation at this point, then add data to the tables. This latter part needs to be done with memory somewhat tight so that the bats get flushed to disk (including creation of the backup). A subsequent low level commit will then not remove those backup files.
**Software versions**
- Dec2023-SP2
| files remain in backup causing problems at restart | https://api.github.com/repos/MonetDB/MonetDB/issues/7501/comments | 0 | 2024-04-26T07:55:25Z | 2024-06-27T13:20:03Z | https://github.com/MonetDB/MonetDB/issues/7501 | 2,265,185,778 | 7,501 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
The ANALYZE statement currently (Dec2023 release) cannot be used in the body of a procedure or function or trigger.
In sql/server/sql_parser.y the `ANALYZE` statement is not included in definition of `procedure_statement:` or `trigger_procedure_statement:`. It is only included in the `sql:` definition.
Hence the parser does not recognise or allow the ANALYZE statement as part of the procedure_statement or trigger_procedure_statement.
**To ReProduce**
```
CREATE SCHEMA test;
CREATE TABLE test.numbers (num bigint NOT NULL);
ANALYZE test.numbers; -- this works
-- try to use the ANALYZE statement in a procedure:
CREATE PROCEDURE test.update_stats1 () ANALYZE test.numbers;
-- this fails: syntax error, unexpected IDENT, expecting ':' in: "create procedure test.update_stats1 () analyze test"
CREATE PROCEDURE test.update_stats2 () BEGIN ANALYZE test.numbers; END;
-- this fails: syntax error, unexpected IDENT, expecting ':' in: "create procedure test.update_stats2 () begin analyze test"
CREATE PROCEDURE test.update_stats3 () BEGIN ATOMIC ANALYZE test.numbers; END;
-- this fails: syntax error, unexpected IDENT, expecting ':' in: "create procedure test.update_stats3 () begin atomic analyze test"
CREATE PROCEDURE test.refresh_numbers1 (amount bigint)
BEGIN
TRUNCATE TABLE test.numbers;
INSERT INTO test.numbers(num) SELECT value from sys.generate_series(1, amount+1);
ANALYZE test.numbers;
END;
-- this fails: syntax error, unexpected end of file, expecting WHILE in: "create procedure test.refresh_numbers1 (amount bigint)
-- try to use the ANALYZE statement in a function:
CREATE FUNCTION test.update_stats7 () RETURNS int BEGIN ANALYZE test.numbers; RETURN 7; END;
-- this fails: syntax error, unexpected IDENT, expecting ':' in: "create function test.update_stats7 () begin analyze test"
CREATE FUNCTION test.update_stats8 () RETURNS int BEGIN ATOMIC ANALYZE test.numbers; RETURN 8; END;
-- this fails: syntax error, unexpected IDENT, expecting ':' in: "create function test.update_stats8 () begin atomic analyze test"
CREATE FUNCTION test.refresh_numbers2 (amount bigint) RETURNS int
BEGIN
TRUNCATE TABLE test.numbers;
INSERT INTO test.numbers(num) SELECT value from sys.generate_series(1, amount+1);
ANALYZE test.numbers;
RETURN amount;
END;
-- this fails: syntax error, unexpected end of file, expecting WHILE in: "create function test.refresh_numbers2 (amount bigint)
```
**Describe the solution you'd like**
It should be allowed to call `ANALYZE` statement in the body of a procedure or function or trigger.
This is useful after a large data reload to update column data statistics.
**Describe alternatives you've considered**
It appears there are 4 sys."analyze"(...) procedures:
```
procedure sys."analyze"();
procedure sys."analyze"("sname");
procedure sys."analyze"("sname", "tname");
procedure sys."analyze"("sname", "tname", "cname");
```
So any of those could be called instead of the `ANALYZE` statement.
For example:
```
CREATE PROCEDURE test.refresh_numbers1b (amount bigint)
BEGIN
TRUNCATE TABLE test.numbers;
INSERT INTO test.numbers(num) SELECT value from sys.generate_series(1, amount+1);
CALL sys."analyze"('test', 'numbers');
END;
CREATE FUNCTION test.refresh_numbers2b (amount bigint) RETURNS bigint
BEGIN
TRUNCATE TABLE test.numbers;
INSERT INTO test.numbers(num) SELECT value from sys.generate_series(1, amount+1);
CALL sys."analyze"('test', 'numbers');
RETURN amount;
END;
``` | request: ANALYZE statement should be allowed to be used in the body of a procedure or function or trigger. | https://api.github.com/repos/MonetDB/MonetDB/issues/7500/comments | 1 | 2024-04-25T16:50:58Z | 2024-06-27T13:20:02Z | https://github.com/MonetDB/MonetDB/issues/7500 | 2,264,062,917 | 7,500 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
See title
**To Reproduce**
START TRANSACTION;
CREATE SCHEMA test;
SET SCHEMA test;
ROLLBACK;
SET SCHEMA sys; -- should work but gives error and aborts the connection
**Expected behavior**
The ROLLBACK should ideally revert to the schema from before the START TRANSACTION, but I'll settle with the SET SCHEMA sys working.
**Software versions**
- Dec2023-SP2
| create schema + set schema inside a transaction that is rolled back causes the connection to be aborted | https://api.github.com/repos/MonetDB/MonetDB/issues/7499/comments | 1 | 2024-04-25T13:29:11Z | 2024-06-27T13:20:01Z | https://github.com/MonetDB/MonetDB/issues/7499 | 2,263,594,849 | 7,499 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Concurrent clients are trying to lock, swaplock, heaplock when bats are locked. This turned out after sockets were in CLOSE_WAIT state, no client access was allowed anymore due to max nclients (64), and the server did not clean up running mserver5 instances. monetdb status was giving "running".
**To Reproduce**
Hard to reproduce, but good chance it occurs when many concurrent clients run the same set of queries
**Expected behavior**
Running smoothly
**Software versions**
- MonetDB Dec2023 SP1
- Fedora 38
- Installed from release package | Deadlock in BATrange | https://api.github.com/repos/MonetDB/MonetDB/issues/7498/comments | 1 | 2024-04-22T15:31:01Z | 2024-06-27T13:20:00Z | https://github.com/MonetDB/MonetDB/issues/7498 | 2,256,853,132 | 7,498 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
No table and data needed, the query:
```
select * from s where (s1, s2) in ((42,44), (41,45), (43,42));
```
results in a
```
syntax error, unexpected ',', expecting NOT_IN or sqlIN in: "select * from s where (s1, s2) in ((42,44),"
```
However, if the values were SELECTed from a table, the query works.
**To Reproduce**
```
create table l (l1 int, l2 int, l3 int);
create table s (s1 int, s2 int, s3 int);
insert into l values (42, 44, 11), (41, 45, 22), (43, 42, 33);
insert into s values (41, 44, 10), (42, 44, 20), (34, 44, 30), (41, 45, 40), (34, 45, 50), (34, 44, 60), (42, 44, 70), (42, 44, 80);
select * from s where (s1, s2) in ((42,44), (41,45), (43,42));
select * from s where (s1, s2) in (select l1, l2 from l);
```
**Expected behavior**
No syntax error should be given. The two select queries should produce the same results:
```
+------+------+------+
| s1 | s2 | s3 |
+======+======+======+
| 42 | 44 | 20 |
| 41 | 45 | 40 |
| 42 | 44 | 70 |
| 42 | 44 | 80 |
+------+------+------+
```
**Software versions**
- MonetDB version number: Dec2023-SP2
- OS and version: MacOS 14.3.1
- Installed with Homebrew
| Multi-column IN clause with value list produces syntax error | https://api.github.com/repos/MonetDB/MonetDB/issues/7497/comments | 0 | 2024-04-19T08:44:37Z | 2024-06-27T13:20:00Z | https://github.com/MonetDB/MonetDB/issues/7497 | 2,252,432,461 | 7,497 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
When running a query against a specific created view, no resultset is returned.
When compiled with assertions enabled, it reports:
`sql/backends/monet5/rel_bin.c:4355: rel2bin_select: Assertion `sql->session->status == -10' failed`
**To Reproduce**
```
create view columns_7496 as select
s."name" as table_schema,
t."name" as table_name,
c."name" as column_name,
cast(1 + c."number" as int) as ordinal_position,
c."default" as column_default,
cast(sys.ifthenelse(c."null", 'YES', 'NO') as varchar(3)) as is_nullable,
cast(sys."describe_type"(c."type", c."type_digits", c."type_scale") as varchar(1024)) as data_type,
cast(sys.ifthenelse(seq."name" is null, 'NO', 'YES') as varchar(3)) as is_identity,
seq."name" as identity_generation,
seq."start" as identity_start,
seq."increment" as identity_increment,
seq."maxvalue" as identity_maximum,
seq."minvalue" as identity_minimum,
cast(sys.ifthenelse(seq."cycle", 'YES', 'NO') as varchar(3)) as identity_cycle,
cast(sys.ifthenelse(seq."name" is null, 'NO', 'YES') as varchar(3)) as is_generated,
cast(sys.ifthenelse(seq."name" is null, null, c."default") as varchar(1024)) as generation_expression,
cm."remark" as comments
from sys."columns" c
inner join sys."tables" t on c."table_id" = t."id"
inner join sys."schemas" s on t."schema_id" = s."id"
left outer join sys."comments" cm on c."id" = cm."id"
left outer join sys."sequences" seq on ((seq."name"||'"') = substring(c."default", 3 + sys."locate"('"."seq_',c."default",14)))
order by s."name", t."name", c."number";
SELECT "is_generated", length("is_generated") as data_length FROM columns_7496
WHERE "is_generated" IS NOT NULL AND length("is_generated") > 2;
```
**Expected behavior**
Query should produce a result, for this query an empty result.
No assertion error.
**Software versions**
MonetDB 5 server v11.49.7
All platforms | Query on view fails to produce a resultset. Assertion triggered in rel2bin_select. | https://api.github.com/repos/MonetDB/MonetDB/issues/7496/comments | 1 | 2024-04-11T14:02:44Z | 2024-06-27T13:19:59Z | https://github.com/MonetDB/MonetDB/issues/7496 | 2,237,804,589 | 7,496 |
[
"MonetDB",
"MonetDB"
] | Querying a column that has unprocessed modifications involves copying the bat so that the modifications can be applied to the copy. If the column is simultaneously further modified (appended to) by another query, it can happen that the string heap is modified (both extended and its hash table changed) after the size of the heap is recorded and before the data is actually copied. This can result in a copy with a hash table that has entries that point beyond the end of the (copied) string heap, potentially resulting in a crash.
| Crash when simultaneously querying and updating a string column. | https://api.github.com/repos/MonetDB/MonetDB/issues/7495/comments | 0 | 2024-04-08T14:54:13Z | 2024-06-27T13:19:58Z | https://github.com/MonetDB/MonetDB/issues/7495 | 2,231,441,283 | 7,495 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
The system running MonetDB consistently experiences high CPU utilization. Below are the CPU usage statistics that I have captured in a screenshot. Please examine this issue and guide how to resolve it
This system is currently only running MonetDB
**Screenshots**
- The statistics on the Zabbix dashboard

- mpstat


- There are 3 mserver5 processes running on this system

- pidstat (processID = 91809)

- strace (processID = 91809)

- The information of the mserver5 process with ID 91809

**Software versions**
- MonetDB version: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04.5 LTS
- Installed from the release package
| MonetDB is utilizing the CPU inefficiently | https://api.github.com/repos/MonetDB/MonetDB/issues/7494/comments | 5 | 2024-03-29T02:38:58Z | 2024-05-02T08:31:14Z | https://github.com/MonetDB/MonetDB/issues/7494 | 2,214,504,406 | 7,494 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
the query result `# table_name` header string contains both the schema name and table name of each result column.
The names are separated by the dot character, so '.'.
However when the schema name contains a dot character, the `# table_name` header string will contain multiple dot characters.
This makes it impossible to extract the correct schema and table names metadata information.
This is a problem for the ODBC and JDBC drivers which need to return separate schema and table name metadata information.
**To Reproduce**
```
CREATE SCHEMA "sch.";
SET SCHEMA "sch.";
SELECT CURRENT_SCHEMA;
CREATE TABLE "sch." . ".tabl" (".col" int) ;
INSERT INTO "sch." . ".tabl" VALUES (63);
SELECT * FROM "sch." . ".tabl" WHERE ".col" IS NOT NULL;
```
This last query returns incorrect resultset schema and table name metadata in ODBC and JDBC.
They return 'sch' as the schema name and '..tabl' as the table name which is incorrect.
In mclient you can inspect this `# table_name` header information by using the `\X` mode before sending the last query:
```
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.49.6 (hg id: 31772b44da50+), 'demo'
Type \q to quit, \? for a list of available commands
auto commit mode: on
sql>\X
sql>SELECT * FROM "sch." . ".tabl" WHERE ".col" IS NOT NULL;
mapi_query_part:57:SELECT * FROM "sch." . ".tabl" WHERE ".col" IS NOT NULL;
fetch next block: start at:948
got next block: length:101
text:&1 5 1 1 1 216 1975 653 195
% sch...tabl # table_name
% .col # name
% int # type
% 2 # length
[ 63 ]
```
You can see line:
`% sch...tabl # table_name`
contains the fully qualified table_name. It is a concatenation of `sch.`, a dot character and `.tabl`, all without the double quotes.
This header line is what is send by the server to the client.
The client libraries have to figure out from the received header line, what the schema name part is and what the table name part is.
In ODBC and JDBC driver this is done by searching for the first dot character. If it is found it splits the string into two substrings, the first is the schema name, the second the table name.
This goes wrong in the case the schema name contains a dot character.
In ODBC and JDBC it will return 'sch' as the schema name and '..tabl' as the table name which is incorrect.
**Expected behavior**
This problem cannot be fixed in the ODBC or JDBC driver code, as it is not possible to correctly decide which of the dot characters in `'sch...tabl'` is the real separator. Is it the first, second or third dot character?
This problem should be fixed in the mapi protocol.
Suggestion: extend the header information with an additional # schema_name line, so:
```
% sch. # schema_name
% .tabl # table_name
```
This makes parsing the header lines for schema and table name possible without problems.
Also it is adaptive for new ODBC and JDBC driver as the client can inform the server to enable sending the `# schema_name` header line dynamically (like is done for the `# typesizes` header info) when the server and mapi supports it.
I also considered to add double quotes to the schema and table name parts when it contains a dot character.
So the `# table_name` header would become:
`% "sch.".".tabl" # table_name
Technically this would allow new versions of the ODBC and JDBC drivers to detect that the string between the double quotes need to be treated specially.
However old ODBC and JDBC drivers would then return wrong information: '"sch' as the schema name and '".".tabl"' as the table name. So I do not recommend this option.
When the mapi header changes also the client libraries (ODBC and JDBC) need to be adapted for this new behavior. Note that the ODBC and JDBC drivers also need to keep supporting older server versions, so be dynamic.
**Software versions**
- MonetDB version number Dec2023
- OS and version: all
| problem in query result # table_name header string when schema name contains a dot character | https://api.github.com/repos/MonetDB/MonetDB/issues/7493/comments | 1 | 2024-03-28T17:27:10Z | 2024-06-27T13:19:57Z | https://github.com/MonetDB/MonetDB/issues/7493 | 2,213,758,654 | 7,493 |
[
"MonetDB",
"MonetDB"
] | I've just added this project grammar to https://mingodad.github.io/parsertl-playground/playground/ an `Yacc/Lex` compatible online editor/tester (select `Monetdb SQL parser (partially working)` from `Examples` then click `Parse` to see a parse tree for the content in `Input source`).
Notice that I've replaced right recursion by left recursion in some rules and there is several conflicts.
And here is an `EBNF` to generate a nice navigable railroad diagram:
```
//
// EBNF to be viewd at
// (IPV6) https://www.bottlecaps.de/rr/ui
// (IPV4) https://rr.red-dove.com/ui
//
// Copy and paste this at one of the urls shown above in the 'Edit Grammar' tab
// then click the 'View Diagram' tab.
//
input::=
sqlstmt
| input sqlstmt
sqlstmt::=
sql SCOLON
| sql ':' named_arg_list_ref SCOLON
| prepare sql SCOLON
| SQL_PLAN sql SCOLON
| SQL_EXPLAIN sql SCOLON
| SQL_TRACE sqlstmt
| exec SCOLON
| dealloc SCOLON
| /*%empty*/
| SCOLON
| LEX_ERROR
prepare::=
PREPARE
| PREP
execute::=
EXECUTE
| EXEC
opt_prepare::=
/*%empty*/
| prepare
deallocate::=
DEALLOCATE
create::=
CREATE
create_or_replace::=
create
| CREATE OR REPLACE
if_exists::=
/*%empty*/
| IF EXISTS
if_not_exists::=
/*%empty*/
| IF NOT_EXISTS
drop::=
DROP
set::=
SET
declare::=
DECLARE
sql::=
schema
| grant
| revoke
| create_statement
| drop_statement
| alter_statement
| declare_statement
| set_statement
| ANALYZE qname opt_column_list opt_sample opt_minmax
| call_procedure_statement
| comment_on_statement
| transaction_statement
| update_statement
| with_query
| select_statement_single_row
| select_no_parens_orderby
opt_minmax::=
/*%empty*/
| MINMAX
declare_statement::=
declare variable_list
| declare table_def
variable_ref_commalist::=
variable_ref
| variable_ref_commalist ',' variable_ref
variable_list::=
variable_ref_commalist data_type
| variable_list ',' variable_ref_commalist data_type
opt_equal::=
'='
| /*%empty*/
set_statement::=
set variable_ref '=' search_condition
| set variable_ref_commalist_parens '=' subquery
| set sqlSESSION AUTHORIZATION opt_equal ident
| set session_schema opt_equal ident
| set session_user opt_equal ident
| set session_role opt_equal ident
| set session_timezone opt_equal LOCAL
| set session_timezone opt_equal literal
schema::=
create SCHEMA if_not_exists schema_name_clause opt_schema_default_char_set opt_path_specification opt_schema_element_list
| drop SCHEMA if_exists qname drop_action
schema_name_clause::=
ident
| AUTHORIZATION authorization_identifier
| ident AUTHORIZATION authorization_identifier
authorization_identifier::=
ident
opt_schema_default_char_set::=
/*%empty*/
| DEFAULT CHARACTER SET ident
opt_schema_element_list::=
/*%empty*/
| schema_element_list
schema_element_list::=
schema_element
| schema_element_list schema_element
schema_element::=
grant
| revoke
| create_statement
| drop_statement
| alter_statement
opt_grantor::=
/*%empty*/
| WITH ADMIN grantor
grantor::=
CURRENT_USER
| CURRENT_ROLE
grant::=
GRANT privileges TO grantee_commalist opt_with_grant opt_from_grantor
| GRANT authid_list TO grantee_commalist opt_with_admin opt_from_grantor
authid_list::=
authid
| authid_list ',' authid
opt_with_grant::=
/*%empty*/
| WITH GRANT OPTION
opt_with_admin::=
/*%empty*/
| WITH ADMIN OPTION
opt_from_grantor::=
/*%empty*/
| FROM grantor
revoke::=
REVOKE opt_grant_for privileges FROM grantee_commalist opt_from_grantor
| REVOKE opt_admin_for authid_list FROM grantee_commalist opt_from_grantor
opt_grant_for::=
/*%empty*/
| GRANT OPTION FOR
opt_admin_for::=
/*%empty*/
| ADMIN OPTION FOR
privileges::=
global_privileges
| object_privileges ON object_name
global_privileges::=
global_privilege
| global_privilege ',' global_privilege
global_privilege::=
COPY FROM
| COPY INTO
object_name::=
TABLE qname
| qname
| routine_designator
object_privileges::=
ALL PRIVILEGES
| ALL
| operation_commalist
operation_commalist::=
operation
| operation_commalist ',' operation
operation::=
INSERT
| sqlDELETE
| TRUNCATE
| UPDATE opt_column_list
| SELECT opt_column_list
| REFERENCES opt_column_list
| execute
grantee_commalist::=
grantee
| grantee_commalist ',' grantee
grantee::=
PUBLIC
| authid
alter_statement::=
ALTER TABLE if_exists qname ADD opt_column add_table_element
| ALTER TABLE if_exists qname ADD TABLE qname opt_as_partition
| ALTER TABLE if_exists qname ALTER alter_table_element
| ALTER TABLE if_exists qname DROP drop_table_element
| ALTER TABLE if_exists qname SET READ ONLY
| ALTER TABLE if_exists qname SET INSERT ONLY
| ALTER TABLE if_exists qname SET READ WRITE
| ALTER TABLE if_exists qname SET TABLE qname opt_as_partition
| ALTER TABLE if_exists qname RENAME TO ident
| ALTER TABLE if_exists qname RENAME opt_column ident TO ident
| ALTER TABLE if_exists qname SET SCHEMA ident
| ALTER USER ident opt_with_encrypted_password user_schema opt_schema_path opt_default_role opt_max_memory opt_max_workers
| ALTER USER ident RENAME TO ident
| ALTER USER SET opt_encrypted PASSWORD string USING OLD PASSWORD string
| ALTER SCHEMA if_exists ident RENAME TO ident
opt_with_encrypted_password::=
WITH opt_encrypted PASSWORD string
| /*%empty*/
user_schema::=
SET SCHEMA ident
| /*%empty*/
opt_schema_path::=
SCHEMA PATH string
| /*%empty*/
alter_table_element::=
opt_column ident SET DEFAULT default_value
| opt_column ident SET sqlNULL
| opt_column ident SET NOT sqlNULL
| opt_column ident DROP DEFAULT
| opt_column ident SET STORAGE string
| opt_column ident SET STORAGE sqlNULL
drop_table_element::=
opt_column ident drop_action
| CONSTRAINT ident drop_action
| TABLE qname drop_action
opt_column::=
COLUMN
| /*%empty*/
create_statement::=
create role_def
| create table_def
| view_def
| type_def
| func_def
| index_def
| seq_def
| trigger_def
seq_def::=
create SEQUENCE qname opt_seq_params
| drop SEQUENCE qname
| ALTER SEQUENCE qname opt_alt_seq_params
opt_seq_params::=
params_list
| /*%empty*/
params_list::=
opt_seq_param
| params_list opt_seq_param
opt_alt_seq_params::=
opt_alt_seq_param
| opt_alt_seq_params opt_alt_seq_param
opt_seq_param::=
AS data_type
| START WITH opt_sign lngval
| opt_seq_common_param
opt_alt_seq_param::=
AS data_type
| RESTART
| RESTART WITH opt_sign lngval
| RESTART WITH subquery
| opt_seq_common_param
opt_seq_common_param::=
INCREMENT BY opt_sign lngval
| MINVALUE opt_sign lngval
| NO MINVALUE
| MAXVALUE opt_sign lngval
| NO MAXVALUE
| CACHE nonzerolng
| CYCLE
| NO CYCLE
index_def::=
create opt_index_type INDEX ident ON qname '(' ident_commalist ')'
opt_index_type::=
UNIQUE
| ORDERED
| IMPRINTS
| /*%empty*/
role_def::=
ROLE ident opt_grantor
| USER ident WITH opt_encrypted PASSWORD string sqlNAME string opt_schema_details_list opt_max_memory opt_max_workers opt_optimizer opt_default_role
opt_max_memory::=
/*%empty*/
| NO MAX_MEMORY
| MAX_MEMORY poslng
opt_max_workers::=
/*%empty*/
| NO MAX_WORKERS
| MAX_WORKERS posint
opt_optimizer::=
/*%empty*/
| OPTIMIZER string
opt_default_role::=
/*%empty*/
| DEFAULT ROLE ident
opt_schema_details_list::=
opt_schema_path
| SCHEMA ident opt_schema_path
opt_encrypted::=
/*%empty*/
| UNENCRYPTED
| ENCRYPTED
table_def::=
TABLE if_not_exists qname table_content_source
| TABLE if_not_exists qname FROM sqlLOADER func_ref
| MERGE TABLE if_not_exists qname table_content_source opt_partition_by
| REPLICA TABLE if_not_exists qname table_content_source
| REMOTE TABLE if_not_exists qname table_content_source ON string with_opt_credentials
| UNLOGGED TABLE if_not_exists qname table_content_source
| opt_temp TABLE if_not_exists qname table_content_source opt_on_commit
partition_type::=
RANGE
| VALUES
partition_expression::=
search_condition
partition_on::=
ON '(' ident ')'
| USING '(' partition_expression ')'
opt_partition_by::=
/*%empty*/
| PARTITION BY partition_type partition_on
partition_list_value::=
search_condition
partition_range_from::=
search_condition
| RANGE MINVALUE
partition_range_to::=
search_condition
| RANGE MAXVALUE
partition_list::=
partition_list_value
| partition_list ',' partition_list_value
opt_with_nulls::=
/*%empty*/
| WITH sqlNULL VALUES
opt_partition_spec::=
sqlIN '(' partition_list ')' opt_with_nulls
| FROM partition_range_from TO partition_range_to opt_with_nulls
| FOR sqlNULL VALUES
opt_as_partition::=
/*%empty*/
| AS PARTITION opt_partition_spec
with_opt_credentials::=
/*%empty*/
| WITH USER string opt_encrypted PASSWORD string
| WITH opt_encrypted PASSWORD string
opt_temp::=
TEMPORARY
| TEMP
| LOCAL TEMPORARY
| LOCAL TEMP
| GLOBAL TEMPORARY
| GLOBAL TEMP
opt_on_commit::=
/*%empty*/
| ON COMMIT sqlDELETE ROWS
| ON COMMIT PRESERVE ROWS
| ON COMMIT DROP
table_content_source::=
'(' table_element_list ')'
| as_subquery_clause
as_subquery_clause::=
opt_column_list AS query_expression_def with_or_without_data
with_or_without_data::=
/*%empty*/
| WITH NO DATA
| WITH DATA
table_element_list::=
table_element
| table_element_list ',' table_element
add_table_element::=
column_def
| table_constraint
table_element::=
add_table_element
| column_options
| like_table
serial_or_bigserial::=
SERIAL
| BIGSERIAL
column_def::=
column data_type opt_column_def_opt_list
| column serial_or_bigserial
opt_column_def_opt_list::=
/*%empty*/
| column_def_opt_list
column_def_opt_list::=
column_option
| column_def_opt_list column_option
column_options::=
ident WITH OPTIONS '(' column_option_list ')'
column_option_list::=
column_option
| column_option_list ',' column_option
column_option::=
default
| column_constraint
| generated_column
default::=
DEFAULT default_value
default_value::=
search_condition
column_constraint::=
opt_constraint_name column_constraint_type
always_or_by_default::=
ALWAYS
| BY DEFAULT
generated_column::=
GENERATED always_or_by_default AS IDENTITY serial_opt_params
| AUTO_INCREMENT
serial_opt_params::=
/*%empty*/
| '(' params_list ')'
table_constraint::=
opt_constraint_name table_constraint_type
opt_constraint_name::=
/*%empty*/
| CONSTRAINT ident
ref_action::=
NO ACTION
| CASCADE
| RESTRICT
| SET sqlNULL
| SET DEFAULT
ref_on_update::=
ON UPDATE ref_action
ref_on_delete::=
ON sqlDELETE ref_action
opt_ref_action::=
/*%empty*/
| ref_on_update
| ref_on_delete
| ref_on_delete ref_on_update
| ref_on_update ref_on_delete
opt_match_type::=
/*%empty*/
| FULL
| PARTIAL
| SIMPLE
opt_match::=
/*%empty*/
| MATCH opt_match_type
column_constraint_type::=
NOT sqlNULL
| sqlNULL
| UNIQUE
| UNIQUE NULLS DISTINCT
| UNIQUE NULLS NOT DISTINCT
| PRIMARY KEY
| REFERENCES qname opt_column_list opt_match opt_ref_action
| domain_constraint_type
table_constraint_type::=
UNIQUE column_commalist_parens
| UNIQUE NULLS DISTINCT column_commalist_parens
| UNIQUE NULLS NOT DISTINCT column_commalist_parens
| PRIMARY KEY column_commalist_parens
| FOREIGN KEY column_commalist_parens REFERENCES qname opt_column_list opt_match opt_ref_action
domain_constraint_type::=
CHECK '(' search_condition ')'
ident_commalist::=
ident
| ident_commalist ',' ident
like_table::=
LIKE qname
view_def::=
create_or_replace VIEW qname opt_column_list AS query_expression_def opt_with_check_option
query_expression_def::=
query_expression
| '(' query_expression_def ')'
query_expression::=
select_no_parens_orderby
| with_query
opt_with_check_option::=
/*%empty*/
| WITH CHECK OPTION
opt_column_list::=
/*%empty*/
| column_commalist_parens
column_commalist_parens::=
'(' ident_commalist ')'
variable_ref_commalist_parens::=
'(' variable_ref_commalist ')'
type_def::=
create TYPE qname EXTERNAL sqlNAME ident
external_function_name::=
ident '.' ident
function_body::=
X_BODY
| string
func_def_type::=
FUNCTION
| PROCEDURE
| AGGREGATE
| AGGREGATE FUNCTION
| FILTER
| FILTER FUNCTION
| WINDOW
| WINDOW FUNCTION
| sqlLOADER
| sqlLOADER FUNCTION
func_def_opt_return::=
RETURNS func_data_type
| /*%empty*/
func_def::=
create_or_replace func_def_type qname '(' opt_paramlist ')' func_def_opt_return EXTERNAL sqlNAME external_function_name
| create_or_replace func_def_type qname '(' opt_paramlist ')' func_def_opt_return routine_body
| create_or_replace func_def_type qname '(' opt_paramlist ')' func_def_opt_return LANGUAGE IDENT function_body
routine_body::=
procedure_statement
| BEGIN procedure_statement_list procedure_statement SCOLON END
| BEGIN ATOMIC procedure_statement_list procedure_statement SCOLON END
procedure_statement_list::=
/*%empty*/
| procedure_statement_list procedure_statement SCOLON
trigger_procedure_statement_list::=
/*%empty*/
| trigger_procedure_statement_list trigger_procedure_statement SCOLON
procedure_statement::=
transaction_statement
| update_statement
| schema
| grant
| revoke
| create_statement
| drop_statement
| alter_statement
| declare_statement
| set_statement
| control_statement
| select_statement_single_row
trigger_procedure_statement::=
transaction_statement
| update_statement
| grant
| revoke
| declare_statement
| set_statement
| control_statement
| select_statement_single_row
control_statement::=
call_procedure_statement
| call_statement
| while_statement
| if_statement
| case_statement
| return_statement
call_statement::=
CALL routine_invocation
call_procedure_statement::=
CALL func_ref
| '{' CALL func_ref '}'
routine_invocation::=
routine_name '(' argument_list ')'
routine_name::=
qname
argument_list::=
/*%empty*/
| search_condition
| argument_list ',' search_condition
return_statement::=
RETURN return_value
return_value::=
query_expression
| search_condition
| TABLE '(' query_expression ')'
case_statement::=
CASE search_condition when_statements case_opt_else_statement END CASE
| CASE when_search_statements case_opt_else_statement END CASE
when_statement::=
WHEN search_condition THEN procedure_statement_list
when_statements::=
when_statement
| when_statements when_statement
when_search_statement::=
WHEN search_condition THEN procedure_statement_list
when_search_statements::=
when_search_statement
| when_search_statements when_search_statement
case_opt_else_statement::=
/*%empty*/
| ELSE procedure_statement_list
if_statement::=
IF search_condition THEN procedure_statement_list elseif_list_opt else_opt END IF
else_opt::=
/*%empty*/
| ELSE procedure_statement_list
elseif_list_opt::=
/*%empty*/
| elseif_list_opt elseif
elseif::=
ELSEIF search_condition THEN procedure_statement_list
while_statement::=
opt_begin_label WHILE search_condition DO procedure_statement_list END WHILE opt_end_label
opt_begin_label::=
/*%empty*/
| ident ':'
opt_end_label::=
/*%empty*/
| ident
table_function_column_list::=
column data_type
| table_function_column_list ',' column data_type
func_data_type::=
TABLE '(' table_function_column_list ')'
| data_type
opt_paramlist::=
paramlist
| '*'
| /*%empty*/
paramlist::=
paramlist ',' ident data_type
| ident data_type
trigger_def::=
create_or_replace TRIGGER qname trigger_action_time trigger_event opt_qname opt_referencing_list triggered_action
opt_qname::=
/*%empty*/
| ON qname
trigger_action_time::=
BEFORE
| AFTER
trigger_event::=
INSERT
| sqlDELETE
| TRUNCATE
| UPDATE
| UPDATE OF ident_commalist
| LOGIN
opt_referencing_list::=
/*%empty*/
| REFERENCING old_or_new_values_alias_list
old_or_new_values_alias_list::=
old_or_new_values_alias
| old_or_new_values_alias_list old_or_new_values_alias
old_or_new_values_alias::=
OLD opt_row opt_as ident
| sqlNEW opt_row opt_as ident
| OLD TABLE opt_as ident
| sqlNEW TABLE opt_as ident
opt_as::=
/*%empty*/
| AS
opt_row::=
/*%empty*/
| ROW
triggered_action::=
opt_for_each opt_when triggered_statement
opt_for_each::=
/*%empty*/
| FOR EACH row_or_statement
row_or_statement::=
ROW
| STATEMENT
opt_when::=
/*%empty*/
| WHEN '(' search_condition ')'
triggered_statement::=
trigger_procedure_statement
| BEGIN ATOMIC trigger_procedure_statement_list END
routine_designator::=
func_def_type qname opt_typelist
drop_statement::=
drop TABLE if_exists qname drop_action
| drop func_def_type if_exists qname opt_typelist drop_action
| drop ALL func_def_type qname drop_action
| drop VIEW if_exists qname drop_action
| drop TYPE qname drop_action
| drop ROLE ident
| drop USER ident
| drop INDEX qname
| drop TRIGGER if_exists qname
opt_typelist::=
/*%empty*/
| '(' typelist ')'
| '(' ')'
typelist::=
data_type
| typelist ',' data_type
drop_action::=
/*%empty*/
| RESTRICT
| CASCADE
update_statement::=
delete_stmt
| truncate_stmt
| insert_stmt
| update_stmt
| merge_stmt
| copyfrom_stmt
| copyto_stmt
transaction_statement::=
transaction_stmt
start_transaction::=
START
| BEGIN
transaction_stmt::=
COMMIT opt_work opt_chain
| SAVEPOINT ident
| RELEASE SAVEPOINT ident
| ROLLBACK opt_work opt_chain opt_to_savepoint
| start_transaction TRANSACTION transaction_mode_list
| SET LOCAL TRANSACTION transaction_mode_list
| SET TRANSACTION transaction_mode_list
transaction_mode_list::=
/*%empty*/
| _transaction_mode_list
_transaction_mode_list::=
transaction_mode
| _transaction_mode_list ',' transaction_mode
transaction_mode::=
READ ONLY
| READ WRITE
| ISOLATION LEVEL iso_level
| DIAGNOSTICS sqlSIZE intval
iso_level::=
READ UNCOMMITTED
| READ COMMITTED
| sqlREPEATABLE READ
| SNAPSHOT
| SERIALIZABLE
opt_work::=
WORK
| /*%empty*/
opt_chain::=
AND CHAIN
| AND NO CHAIN
| /*%empty*/
opt_to_savepoint::=
/*%empty*/
| TO SAVEPOINT ident
opt_on_location::=
/*%empty*/
| ON CLIENT
| ON SERVER
copyfrom_stmt::=
COPY opt_nr INTO qname opt_column_list FROM string_commalist opt_header_list opt_on_location opt_seps opt_escape opt_null_string opt_best_effort opt_fwf_widths
| COPY opt_nr INTO qname opt_column_list FROM STDIN opt_header_list opt_seps opt_escape opt_null_string opt_best_effort
| COPY sqlLOADER INTO qname FROM func_ref
| COPY opt_endianness BINARY INTO qname opt_column_list FROM string_commalist opt_on_location
copyto_stmt::=
COPY query_expression_def INTO string opt_on_location opt_seps opt_null_string
| COPY query_expression_def INTO STDOUT opt_seps opt_null_string
| COPY query_expression_def INTO opt_endianness BINARY string_commalist opt_on_location
opt_fwf_widths::=
/*%empty*/
| FWF '(' fwf_widthlist ')'
fwf_widthlist::=
poslng
| fwf_widthlist ',' poslng
opt_header_list::=
/*%empty*/
| '(' header_list ')'
header_list::=
header
| header_list ',' header
header::=
ident
| ident string
opt_seps::=
/*%empty*/
| opt_using DELIMITERS string
| opt_using DELIMITERS string ',' string
| opt_using DELIMITERS string ',' string ',' string
opt_using::=
/*%empty*/
| USING
opt_nr::=
/*%empty*/
| poslng RECORDS
| OFFSET poslng
| poslng OFFSET poslng RECORDS
| poslng RECORDS OFFSET poslng
opt_null_string::=
/*%empty*/
| sqlNULL opt_as string
opt_escape::=
/*%empty*/
| ESCAPE
| NO ESCAPE
opt_best_effort::=
/*%empty*/
| BEST EFFORT
string_commalist::=
string_commalist_contents
| '(' string_commalist_contents ')'
string_commalist_contents::=
string
| string_commalist_contents ',' string
opt_endianness::=
/*%empty*/
| BIG ENDIAN
| LITTLE ENDIAN
| NATIVE ENDIAN
delete_stmt::=
sqlDELETE FROM qname opt_alias_name opt_where_clause
check_identity::=
/*%empty*/
| CONTINUE IDENTITY
| RESTART IDENTITY
truncate_stmt::=
TRUNCATE TABLE qname check_identity drop_action
| TRUNCATE qname check_identity drop_action
update_stmt::=
UPDATE qname opt_alias_name SET assignment_commalist opt_from_clause opt_where_clause
opt_search_condition::=
/*%empty*/
| AND search_condition
merge_update_or_delete::=
UPDATE SET assignment_commalist
| sqlDELETE
merge_insert::=
INSERT opt_column_list values_or_query_spec
merge_match_clause::=
WHEN MATCHED opt_search_condition THEN merge_update_or_delete
| WHEN NOT MATCHED opt_search_condition THEN merge_insert
merge_when_list::=
merge_match_clause
| merge_when_list merge_match_clause
merge_stmt::=
MERGE INTO qname opt_alias_name USING table_ref ON search_condition merge_when_list
insert_stmt::=
INSERT INTO qname values_or_query_spec
| INSERT INTO qname column_commalist_parens values_or_query_spec
values_or_query_spec::=
/*%empty*/
| DEFAULT VALUES
| query_expression
row_commalist::=
'(' atom_commalist ')'
| row_commalist ',' '(' atom_commalist ')'
atom_commalist::=
insert_atom
| atom_commalist ',' insert_atom
value_commalist::=
value
| value_commalist ',' value
named_value_commalist::=
ident value
| named_value_commalist ',' ident value
null::=
sqlNULL
insert_atom::=
search_condition
| DEFAULT
value::=
search_condition
| select_no_parens
| with_query
opt_distinct::=
/*%empty*/
| ALL
| DISTINCT
assignment_commalist::=
assignment
| assignment_commalist ',' assignment
assignment::=
column '=' insert_atom
| column_commalist_parens '=' subquery
opt_where_clause::=
/*%empty*/
| WHERE search_condition
joined_table::=
'(' joined_table ')'
| table_ref CROSS JOIN table_ref
| table_ref join_type JOIN table_ref join_spec
| table_ref NATURAL join_type JOIN table_ref
| '{' ODBC_OJ_ESCAPE_PREFIX table_ref outer_join_type OUTER JOIN table_ref join_spec '}'
join_type::=
/*%empty*/
| INNER
| outer_join_type opt_outer
opt_outer::=
/*%empty*/
| OUTER
outer_join_type::=
LEFT
| RIGHT
| FULL
join_spec::=
ON search_condition
| USING column_commalist_parens
with_query::=
WITH with_list with_query_expression
with_list::=
with_list ',' with_list_element
| with_list_element
with_list_element::=
ident opt_column_list AS subquery_with_orderby
with_query_expression::=
select_no_parens_orderby
| select_statement_single_row
| delete_stmt
| insert_stmt
| update_stmt
| merge_stmt
simple_select::=
SELECT opt_distinct selection table_exp
select_statement_single_row::=
SELECT opt_distinct selection INTO variable_ref_commalist table_exp
select_no_parens_orderby::=
select_no_parens opt_order_by_clause opt_limit opt_offset opt_sample opt_seed
| select_no_parens opt_order_by_clause opt_offset_rows opt_fetch opt_sample opt_seed
select_no_parens::=
select_no_parens UNION set_distinct opt_corresponding select_no_parens
| select_no_parens OUTER UNION set_distinct opt_corresponding select_no_parens
| select_no_parens EXCEPT set_distinct opt_corresponding select_no_parens
| select_no_parens INTERSECT set_distinct opt_corresponding select_no_parens
| VALUES row_commalist
| '(' select_no_parens ')'
| simple_select
set_distinct::=
/*%empty*/
| ALL
| DISTINCT
opt_corresponding::=
/*%empty*/
| CORRESPONDING
| CORRESPONDING BY '(' column_ref_commalist ')'
selection::=
column_exp_commalist
table_exp::=
opt_from_clause opt_window_clause opt_where_clause opt_group_by_clause opt_having_clause
window_definition::=
ident AS '(' window_specification ')'
window_definition_list::=
window_definition
| window_definition_list ',' window_definition
opt_window_clause::=
/*%empty*/
| WINDOW window_definition_list
opt_from_clause::=
/*%empty*/
| FROM table_ref_commalist
table_ref_commalist::=
table_ref
| table_ref_commalist ',' table_ref
table_ref::=
qname opt_table_name
| string opt_table_name
| func_ref opt_table_name
| LATERAL func_ref opt_table_name
| subquery_with_orderby table_name
| LATERAL subquery table_name
| subquery_with_orderby
| joined_table
table_name::=
AS ident '(' ident_commalist ')'
| AS ident
| ident '(' ident_commalist ')'
| ident
opt_table_name::=
/*%empty*/
| table_name
opt_group_by_clause::=
/*%empty*/
| sqlGROUP BY group_by_list
group_by_list::=
group_by_element
| group_by_list ',' group_by_element
group_by_element::=
search_condition
| ROLLUP '(' ordinary_grouping_set ')'
| CUBE '(' ordinary_grouping_set ')'
| GROUPING SETS '(' grouping_set_list ')'
| '(' ')'
ordinary_grouping_set::=
ordinary_grouping_element
| ordinary_grouping_set ',' ordinary_grouping_element
ordinary_grouping_element::=
'(' column_ref_commalist ')'
| column_ref
column_ref_commalist::=
column_ref
| column_ref_commalist ',' column_ref
grouping_set_list::=
grouping_set_element
| grouping_set_list ',' grouping_set_element
grouping_set_element::=
ordinary_grouping_element
| ROLLUP '(' ordinary_grouping_set ')'
| CUBE '(' ordinary_grouping_set ')'
| GROUPING SETS '(' grouping_set_list ')'
| '(' ')'
opt_having_clause::=
/*%empty*/
| HAVING search_condition
search_condition::=
search_condition OR and_exp
| and_exp
and_exp::=
and_exp AND pred_exp
| pred_exp
opt_order_by_clause::=
/*%empty*/
| ORDER BY sort_specification_list
first_next::=
FIRST
| NEXT
opt_rows::=
/*%empty*/
| rows
rows::=
ROW
| ROWS
opt_limit::=
/*%empty*/
| LIMIT nonzerolng
| LIMIT param
opt_offset::=
/*%empty*/
| OFFSET poslng
| OFFSET param
opt_offset_rows::=
/*%empty*/
| OFFSET poslng opt_rows
| OFFSET param opt_rows
opt_fetch::=
/*%empty*/
| FETCH first_next nonzerolng rows ONLY
| FETCH first_next param rows ONLY
| FETCH first_next rows ONLY
opt_sample::=
/*%empty*/
| SAMPLE poslng
| SAMPLE INTNUM
| SAMPLE param
opt_seed::=
/*%empty*/
| SEED intval
| SEED param
sort_specification_list::=
ordering_spec
| sort_specification_list ',' ordering_spec
ordering_spec::=
search_condition opt_asc_desc opt_nulls_first_last
opt_asc_desc::=
/*%empty*/
| ASC
| DESC
opt_nulls_first_last::=
/*%empty*/
| NULLS LAST
| NULLS FIRST
predicate::=
comparison_predicate
| between_predicate
| like_predicate
| test_for_null
| in_predicate
| existence_test
| filter_exp
| scalar_exp
pred_exp::=
NOT pred_exp
| predicate
any_all_some::=
ANY
| SOME
| ALL
comparison_predicate::=
pred_exp COMPARISON pred_exp
| pred_exp '=' pred_exp
| pred_exp COMPARISON any_all_some '(' value ')'
| pred_exp '=' any_all_some '(' value ')'
| pred_exp IS NOT DISTINCT FROM pred_exp
| pred_exp IS DISTINCT FROM pred_exp
between_predicate::=
pred_exp NOT_BETWEEN opt_bounds pred_exp AND pred_exp
| pred_exp BETWEEN opt_bounds pred_exp AND pred_exp
opt_bounds::=
/*%empty*/
| ASYMMETRIC
| SYMMETRIC
like_predicate::=
pred_exp NOT_LIKE like_exp
| pred_exp NOT_ILIKE like_exp
| pred_exp LIKE like_exp
| pred_exp ILIKE like_exp
like_exp::=
scalar_exp
| scalar_exp ESCAPE string
| scalar_exp '{' ESCAPE string '}'
test_for_null::=
pred_exp IS NOT sqlNULL
| pred_exp IS sqlNULL
in_predicate::=
pred_exp NOT_IN '(' value_commalist ')'
| pred_exp sqlIN '(' value_commalist ')'
| '(' pred_exp_list ')' NOT_IN '(' value_commalist ')'
| '(' pred_exp_list ')' sqlIN '(' value_commalist ')'
pred_exp_list::=
pred_exp
| pred_exp_list ',' pred_exp
existence_test::=
EXISTS subquery
| NOT_EXISTS subquery
filter_arg_list::=
pred_exp
| filter_arg_list ',' pred_exp
filter_args::=
'[' filter_arg_list ']'
filter_exp::=
filter_args qname filter_args
subquery_with_orderby::=
'(' select_no_parens_orderby ')'
| '(' with_query ')'
subquery::=
'(' select_no_parens ')'
| '(' with_query ')'
simple_scalar_exp::=
value_exp
| scalar_exp '+' scalar_exp
| scalar_exp '-' scalar_exp
| scalar_exp '*' scalar_exp
| scalar_exp '/' scalar_exp
| scalar_exp '%' scalar_exp
| scalar_exp '^' scalar_exp
| scalar_exp '&' scalar_exp
| scalar_exp GEOM_OVERLAP scalar_exp
| scalar_exp GEOM_OVERLAP_OR_LEFT scalar_exp
| scalar_exp GEOM_OVERLAP_OR_RIGHT scalar_exp
| scalar_exp GEOM_OVERLAP_OR_BELOW scalar_exp
| scalar_exp GEOM_BELOW scalar_exp
| scalar_exp GEOM_OVERLAP_OR_ABOVE scalar_exp
| scalar_exp GEOM_ABOVE scalar_exp
| scalar_exp GEOM_DIST scalar_exp
| scalar_exp AT scalar_exp
| scalar_exp '|' scalar_exp
| scalar_exp '~' scalar_exp
| scalar_exp GEOM_MBR_EQUAL scalar_exp
| '~' scalar_exp
| scalar_exp LEFT_SHIFT scalar_exp
| scalar_exp RIGHT_SHIFT scalar_exp
| scalar_exp LEFT_SHIFT_ASSIGN scalar_exp
| scalar_exp RIGHT_SHIFT_ASSIGN scalar_exp
| '+' scalar_exp
| '-' scalar_exp
| '(' search_condition ')'
scalar_exp::=
simple_scalar_exp
| subquery
opt_over::=
OVER '(' window_specification ')'
| OVER ident
| /*%empty*/
value_exp::=
atom
| aggr_or_window_ref opt_over
| case_exp
| cast_exp
| column_ref
| session_user
| CURRENT_SCHEMA
| CURRENT_ROLE
| CURRENT_TIMEZONE
| datetime_funcs
| GROUPING '(' column_ref_commalist ')'
| NEXT VALUE FOR qname
| null
| param
| string_funcs
| XML_value_function
| odbc_scalar_func_escape
| map_funcs
| multi_arg_func
map_funcs::=
FIELD '(' search_condition_commalist ')'
param::=
'?'
| ':' ident
window_specification::=
window_ident_clause window_partition_clause window_order_clause window_frame_clause
window_ident_clause::=
/*%empty*/
| ident
search_condition_commalist::=
search_condition
| search_condition_commalist ',' search_condition
window_partition_clause::=
/*%empty*/
| PARTITION BY search_condition_commalist
window_order_clause::=
/*%empty*/
| ORDER BY sort_specification_list
window_frame_clause::=
/*%empty*/
| window_frame_units window_frame_extent window_frame_exclusion
window_frame_units::=
ROWS
| RANGE
| GROUPS
window_frame_extent::=
window_frame_start
| window_frame_between
window_frame_start::=
UNBOUNDED PRECEDING
| search_condition PRECEDING
| CURRENT ROW
window_bound::=
window_frame_start
| window_following_bound
window_frame_between::=
BETWEEN window_bound AND window_bound
window_following_bound::=
UNBOUNDED FOLLOWING
| search_condition FOLLOWING
window_frame_exclusion::=
/*%empty*/
| EXCLUDE CURRENT ROW
| EXCLUDE sqlGROUP
| EXCLUDE TIES
| EXCLUDE NO OTHERS
func_ref::=
qfunc '(' ')'
| qfunc '(' search_condition_commalist ')'
qfunc::=
func_ident
| ident '.' func_ident
func_ident::=
ident
| LEFT
| RIGHT
| INSERT
datetime_funcs::=
EXTRACT '(' extract_datetime_field FROM scalar_exp ')'
| CURRENT_DATE opt_brackets
| CURRENT_TIME opt_brackets
| CURRENT_TIMESTAMP opt_brackets
| LOCALTIME opt_brackets
| LOCALTIMESTAMP opt_brackets
opt_brackets::=
/*%empty*/
| '(' ')'
opt_trim_type::=
/*%empty*/
| LEADING
| TRAILING
| BOTH
opt_trim_characters::=
/*%empty*/
| string
string_funcs::=
SUBSTRING '(' scalar_exp FROM scalar_exp FOR scalar_exp ')'
| SUBSTRING '(' scalar_exp ',' scalar_exp ',' scalar_exp ')'
| SUBSTRING '(' scalar_exp FROM scalar_exp ')'
| SUBSTRING '(' scalar_exp ',' scalar_exp ')'
| POSITION '(' scalar_exp sqlIN scalar_exp ')'
| scalar_exp CONCATSTRING scalar_exp
| SPLIT_PART '(' scalar_exp ',' scalar_exp ',' scalar_exp ')'
| TRIM '(' opt_trim_type opt_trim_characters FROM scalar_exp ')'
| TRIM '(' scalar_exp ',' scalar_exp ')'
| TRIM '(' scalar_exp ')'
column_exp_commalist::=
column_exp
| column_exp_commalist ',' column_exp
column_exp::=
'*'
| ident '.' '*'
| func_ref '.' '*'
| search_condition opt_alias_name
opt_alias_name::=
/*%empty*/
| opt_as ident
atom::=
literal
qrank::=
RANK
| ident '.' RANK
aggr_or_window_ref::=
qrank '(' ')'
| qrank '(' search_condition_commalist ')'
| qrank '(' DISTINCT search_condition_commalist ')'
| qrank '(' ALL search_condition_commalist ')'
| qfunc '(' '*' ')'
| qfunc '(' ident '.' '*' ')'
| qfunc '(' ')'
| qfunc '(' search_condition_commalist ')'
| qfunc '(' DISTINCT search_condition_commalist ')'
| qfunc '(' ALL search_condition_commalist ')'
| XML_aggregate
opt_sign::=
'+'
| '-'
| /*%empty*/
tz::=
WITH TIME ZONE
| WITHOUT TIME ZONE
| /*%empty*/
time_precision::=
'(' intval ')'
| /*%empty*/
timestamp_precision::=
'(' intval ')'
| /*%empty*/
datetime_type::=
sqlDATE
| TIME time_precision tz
| TIMESTAMP timestamp_precision tz
non_second_datetime_field::=
YEAR
| MONTH
| DAY
| HOUR
| MINUTE
datetime_field::=
non_second_datetime_field
| SECOND
extract_datetime_field::=
datetime_field
| CENTURY
| DECADE
| QUARTER
| WEEK
| DOW
| DOY
| EPOCH
start_field::=
non_second_datetime_field time_precision
end_field::=
non_second_datetime_field
| SECOND timestamp_precision
single_datetime_field::=
non_second_datetime_field time_precision
| SECOND timestamp_precision
interval_qualifier::=
start_field TO end_field
| single_datetime_field
interval_type::=
INTERVAL interval_qualifier
session_user::=
USER
| SESSION_USER
| CURRENT_USER
session_timezone::=
TIME ZONE
| CURRENT_TIMEZONE
session_schema::=
SCHEMA
| CURRENT_SCHEMA
session_role::=
ROLE
| CURRENT_ROLE
literal::=
string
| BINARYNUM
| OCTALNUM
| HEXADECIMALNUM
| OIDNUM
| sqlINT
| INTNUM
| APPROXNUM
| sqlDATE string
| odbc_date_escape
| TIME time_precision tz string
| odbc_time_escape
| TIMESTAMP timestamp_precision tz string
| odbc_timestamp_escape
| interval_expression
| odbc_interval_escape
| blob string
| blobstring
| aTYPE string
| sqlBOOL string
| ident_or_uident string
| odbc_guid_escape
| BOOL_FALSE
| BOOL_TRUE
interval_expression::=
INTERVAL opt_sign string interval_qualifier
qname::=
ident
| ident '.' ident
| ident '.' ident '.' ident
column_ref::=
ident
| ident '.' ident
| ident '.' ident '.' ident
variable_ref::=
ident
| ident '.' ident
cast_exp::=
CAST '(' search_condition AS data_type ')'
| CONVERT '(' search_condition ',' data_type ')'
case_exp::=
NULLIF '(' search_condition ',' search_condition ')'
| IFNULL '(' search_condition ',' search_condition ')'
| COALESCE '(' case_search_condition_commalist ')'
| CASE search_condition when_value_list case_opt_else END
| CASE when_search_list case_opt_else END
case_search_condition_commalist::=
search_condition ',' search_condition
| case_search_condition_commalist ',' search_condition
when_value::=
WHEN search_condition THEN search_condition
when_value_list::=
when_value
| when_value_list when_value
when_search::=
WHEN search_condition THEN search_condition
when_search_list::=
when_search
| when_search_list when_search
case_opt_else::=
/*%empty*/
| ELSE search_condition
nonzero::=
intval
nonzerolng::=
lngval
poslng::=
lngval
posint::=
intval
data_type::=
CHARACTER
| varchar
| clob
| CHARACTER '(' nonzero ')'
| varchar '(' nonzero ')'
| clob '(' nonzero ')'
| blob
| blob '(' nonzero ')'
| TINYINT
| SMALLINT
| sqlINTEGER
| BIGINT
| HUGEINT
| sqlDECIMAL
| sqlDECIMAL '(' nonzero ')'
| sqlDECIMAL '(' nonzero ',' posint ')'
| sqlFLOAT
| sqlFLOAT '(' nonzero ')'
| sqlFLOAT '(' intval ',' intval ')'
| sqlDOUBLE
| sqlDOUBLE PRECISION
| sqlREAL
| datetime_type
| interval_type
| aTYPE
| aTYPE '(' nonzero ')'
| sqlBOOL
| ident_or_uident
| ident_or_uident '(' nonzero ')'
| GEOMETRY
| GEOMETRY '(' subgeometry_type ')'
| GEOMETRY '(' subgeometry_type ',' intval ')'
| GEOMETRYA
| GEOMETRYSUBTYPE
subgeometry_type::=
GEOMETRYSUBTYPE
| string
varchar::=
VARCHAR
| CHARACTER VARYING
clob::=
CLOB
| sqlTEXT
| CHARACTER LARGE OBJECT
blob::=
sqlBLOB
| BINARY LARGE OBJECT
column::=
ident
authid::=
restricted_ident
calc_restricted_ident::=
IDENT
| UIDENT opt_uescape
| aTYPE
| RANK
restricted_ident::=
calc_restricted_ident
calc_ident::=
IDENT
| UIDENT opt_uescape
| aTYPE
| RANK
| MARGFUNC
| non_reserved_word
ident::=
calc_ident
non_reserved_word::=
AS
| AUTHORIZATION
| COLUMN
| CYCLE
| sqlDATE
| DEALLOCATE
| DISTINCT
| EXEC
| EXECUTE
| FILTER
| INTERVAL
| LANGUAGE
| LARGE
| MATCH
| NO
| PRECISION
| PREPARE
| RELEASE
| ROW
| START
| TABLE
| TIME
| TIMESTAMP
| UESCAPE
| VALUE
| WITHOUT
| ACTION
| ANALYZE
| ASC
| AUTO_COMMIT
| BIG
| sqlBOOL
| CACHE
| CENTURY
| CLIENT
| COMMENT
| DATA
| DECADE
| DESC
| DIAGNOSTICS
| DOW
| DOY
| ENDIAN
| EPOCH
| SQL_EXPLAIN
| FIRST
| FIELD
| GEOMETRY
| IMPRINTS
| INCREMENT
| KEY
| LAST
| LEVEL
| LITTLE
| LOGIN
| MAX_MEMORY
| MAXVALUE
| MAX_WORKERS
| MINMAX
| MINVALUE
| sqlNAME
| NATIVE
| NULLS
| OBJECT
| OPTIMIZER
| OPTIONS
| PASSWORD
| PATH
| SQL_PLAN
| PREP
| PRIVILEGES
| QUARTER
| REPLACE
| ROLE
| SCHEMA
| SERVER
| sqlSESSION
| sqlSIZE
| STATEMENT
| STORAGE
| TEMP
| TEMPORARY
| sqlTEXT
| SQL_TRACE
| TYPE
| UNLOGGED
| WEEK
| ZONE
| ABSENT
| ACCORDING
| CONTENT
| DOCUMENT
| ELEMENT
| EMPTY
| ID
| LOCATION
| NAMESPACE
| NIL
| PASSING
| REF
| RETURNING
| STRIP
| URI
| WHITESPACE
| ODBC_DATE_ESCAPE_PREFIX
| ODBC_TIME_ESCAPE_PREFIX
| ODBC_TIMESTAMP_ESCAPE_PREFIX
| ODBC_GUID_ESCAPE_PREFIX
| ODBC_FUNC_ESCAPE_PREFIX
| ODBC_OJ_ESCAPE_PREFIX
| DAYNAME
| MONTHNAME
| TIMESTAMPADD
| TIMESTAMPDIFF
| IFNULL
lngval::=
sqlINT
ident_or_uident::=
IDENT
| UIDENT opt_uescape
intval::=
sqlINT
opt_uescape::=
/*%empty*/
| UESCAPE string
ustring::=
USTRING
| USTRING sstring
blobstring::=
XSTRING
| XSTRING sstring
sstring::=
STRING
| STRING sstring
string::=
sstring
| ustring opt_uescape
exec::=
execute exec_ref
dealloc_ref::=
posint
| ALL
dealloc::=
deallocate opt_prepare dealloc_ref
exec_ref::=
posint arg_list_ref
arg_list_ref::=
'(' ')'
| '(' value_commalist ')'
named_arg_list_ref::=
'(' ')'
| '(' named_value_commalist ')'
opt_path_specification::=
/*%empty*/
| path_specification
path_specification::=
PATH schema_name_list
schema_name_list::=
ident_commalist
comment_on_statement::=
COMMENT ON catalog_object IS string
| COMMENT ON catalog_object IS sqlNULL
catalog_object::=
SCHEMA ident
| TABLE qname
| VIEW qname
| COLUMN ident '.' ident
| COLUMN ident '.' ident '.' ident
| INDEX qname
| SEQUENCE qname
| routine_designator
XML_value_expression::=
XML_primary
XML_value_expression_list::=
XML_value_expression
| XML_value_expression_list ',' XML_value_expression
XML_primary::=
scalar_exp
XML_value_function::=
XML_comment
| XML_concatenation
| XML_document
| XML_element
| XML_forest
| XML_parse
| XML_PI
| XML_query
| XML_text
| XML_validate
XML_comment::=
XMLCOMMENT '(' value_exp opt_XML_returning_clause ')'
XML_concatenation::=
XMLCONCAT '(' XML_value_expression_list opt_XML_returning_clause ')'
XML_document::=
XMLDOCUMENT '(' XML_value_expression opt_XML_returning_clause ')'
XML_element::=
XMLELEMENT '(' sqlNAME XML_element_name opt_comma_XML_namespace_declaration_attributes_element_content opt_XML_returning_clause ')'
opt_comma_XML_namespace_declaration_attributes_element_content::=
/*%empty*/
| ',' XML_namespace_declaration
| ',' XML_namespace_declaration ',' XML_attributes
| ',' XML_namespace_declaration ',' XML_attributes ',' XML_element_content_and_option
| ',' XML_namespace_declaration ',' XML_element_content_and_option
| ',' XML_attributes
| ',' XML_attributes ',' XML_element_content_and_option
| ',' XML_element_content_and_option
XML_element_name::=
ident
XML_attributes::=
XMLATTRIBUTES '(' XML_attribute_list ')'
XML_attribute_list::=
XML_attribute
| XML_attribute_list ',' XML_attribute
XML_attribute::=
XML_attribute_value opt_XML_attribute_name
opt_XML_attribute_name::=
/*%empty*/
| AS XML_attribute_name
XML_attribute_value::=
scalar_exp
XML_attribute_name::=
ident
XML_element_content_and_option::=
XML_element_content_list opt_XML_content_option
XML_element_content_list::=
XML_element_content
| XML_element_content_list ',' XML_element_content
XML_element_content::=
scalar_exp
opt_XML_content_option::=
/*%empty*/
| OPTION XML_content_option
XML_content_option::=
sqlNULL ON sqlNULL
| EMPTY ON sqlNULL
| ABSENT ON sqlNULL
| NIL ON sqlNULL
| NIL ON NO CONTENT
XML_forest::=
XMLFOREST '(' opt_XML_namespace_declaration_and_comma forest_element_list opt_XML_content_option opt_XML_returning_clause ')'
opt_XML_namespace_declaration_and_comma::=
/*%empty*/
| XML_namespace_declaration ','
forest_element_list::=
forest_element
| forest_element_list ',' forest_element
forest_element::=
forest_element_value opt_forest_element_name
forest_element_value::=
scalar_exp
opt_forest_element_name::=
/*%empty*/
| AS forest_element_name
forest_element_name::=
ident
XML_parse::=
XMLPARSE '(' document_or_content value_exp XML_whitespace_option ')'
XML_whitespace_option::=
PRESERVE WHITESPACE
| STRIP WHITESPACE
XML_PI::=
XMLPI '(' sqlNAME XML_PI_target opt_comma_string_value_expression opt_XML_returning_clause ')'
XML_PI_target::=
ident
opt_comma_string_value_expression::=
/*%empty*/
| ',' value_exp
XML_query::=
XMLQUERY '(' XQuery_expression opt_XML_query_argument_list opt_XML_returning_clause opt_XML_query_returning_mechanism XML_query_empty_handling_option ')'
XQuery_expression::=
STRING
opt_XML_query_argument_list::=
/*%empty*/
| PASSING XML_query_default_passing_mechanism XML_query_argument_list
XML_query_default_passing_mechanism::=
XML_passing_mechanism
XML_query_argument_list::=
XML_query_argument
| XML_query_argument_list ',' XML_query_argument
XML_query_argument::=
XML_query_context_item
| XML_query_variable
XML_query_context_item::=
value_exp opt_XML_passing_mechanism
XML_query_variable::=
value_exp AS ident opt_XML_passing_mechanism
opt_XML_query_returning_mechanism::=
/*%empty*/
| XML_passing_mechanism
XML_query_empty_handling_option::=
sqlNULL ON EMPTY
| EMPTY ON EMPTY
XML_text::=
XMLTEXT '(' value_exp opt_XML_returning_clause ')'
XML_validate::=
XMLVALIDATE '(' document_or_content_or_sequence XML_value_expression opt_XML_valid_according_to_clause ')'
document_or_content_or_sequence::=
document_or_content
| SEQUENCE
document_or_content::=
DOCUMENT
| CONTENT
opt_XML_returning_clause::=
/*%empty*/
| RETURNING CONTENT
| RETURNING SEQUENCE
XML_namespace_declaration::=
XMLNAMESPACES '(' XML_namespace_declaration_item_list ')'
XML_namespace_declaration_item_list::=
XML_namespace_declaration_item
| XML_namespace_declaration_item_list ',' XML_namespace_declaration_item
XML_namespace_declaration_item::=
XML_regular_namespace_declaration_item
| XML_default_namespace_declaration_item
XML_namespace_prefix::=
ident
XML_namespace_URI::=
scalar_exp
XML_regular_namespace_declaration_item::=
XML_namespace_URI AS XML_namespace_prefix
XML_default_namespace_declaration_item::=
DEFAULT XML_namespace_URI
| NO DEFAULT
opt_XML_passing_mechanism::=
/*%empty*/
| XML_passing_mechanism
XML_passing_mechanism::=
BY REF
| BY VALUE
opt_XML_valid_according_to_clause::=
/*%empty*/
| XML_valid_according_to_clause
XML_valid_according_to_clause::=
ACCORDING TO XMLSCHEMA XML_valid_according_to_what opt_XML_valid_element_clause
XML_valid_according_to_what::=
XML_valid_according_to_URI
| XML_valid_according_to_identifier
XML_valid_according_to_URI::=
URI XML_valid_target_namespace_URI opt_XML_valid_schema_location
| NO NAMESPACE opt_XML_valid_schema_location
XML_valid_target_namespace_URI::=
XML_URI
XML_URI::=
STRING
opt_XML_valid_schema_location::=
/*%empty*/
| LOCATION XML_valid_schema_location_URI
XML_valid_schema_location_URI::=
XML_URI
XML_valid_according_to_identifier::=
ID registered_XML_Schema_name
registered_XML_Schema_name::=
ident
opt_XML_valid_element_clause::=
/*%empty*/
| XML_valid_element_clause
XML_valid_element_clause::=
XML_valid_element_name_specification
| XML_valid_element_namespace_specification opt_XML_valid_element_name_specification
opt_XML_valid_element_name_specification::=
/*%empty*/
| XML_valid_element_name_specification
XML_valid_element_name_specification::=
ELEMENT XML_valid_element_name
XML_valid_element_namespace_specification::=
NO NAMESPACE
| NAMESPACE XML_valid_element_namespace_URI
XML_valid_element_namespace_URI::=
XML_URI
XML_valid_element_name::=
ident
XML_aggregate::=
XMLAGG '(' XML_value_expression opt_order_by_clause opt_XML_returning_clause ')'
odbc_date_escape::=
'{' ODBC_DATE_ESCAPE_PREFIX string '}'
odbc_time_escape::=
'{' ODBC_TIME_ESCAPE_PREFIX string '}'
odbc_timestamp_escape::=
'{' ODBC_TIMESTAMP_ESCAPE_PREFIX string '}'
odbc_guid_escape::=
'{' ODBC_GUID_ESCAPE_PREFIX string '}'
odbc_interval_escape::=
'{' interval_expression '}'
odbc_scalar_func_escape::=
'{' ODBC_FUNC_ESCAPE_PREFIX odbc_scalar_func '}'
odbc_datetime_func::=
HOUR '(' search_condition ')'
| MINUTE '(' search_condition ')'
| SECOND '(' search_condition ')'
| DAYNAME '(' search_condition ')'
| MONTHNAME '(' search_condition ')'
| MONTH '(' search_condition ')'
| YEAR '(' search_condition ')'
| TIMESTAMPADD '(' odbc_tsi_qualifier ',' scalar_exp ',' search_condition ')'
| TIMESTAMPDIFF '(' odbc_tsi_qualifier ',' search_condition ',' search_condition ')'
odbc_scalar_func::=
func_ref
| string_funcs
| datetime_funcs
| odbc_datetime_func
| CONVERT '(' search_condition ',' odbc_data_type ')'
| USER '(' ')'
| CHARACTER '(' search_condition ')'
| TRUNCATE '(' search_condition ',' search_condition ')'
| IFNULL '(' search_condition ',' search_condition ')'
odbc_data_type::=
SQL_BIGINT
| SQL_BINARY
| SQL_BIT
| SQL_CHAR
| SQL_DATE
| SQL_DECIMAL
| SQL_DOUBLE
| SQL_FLOAT
| SQL_GUID
| SQL_HUGEINT
| SQL_INTEGER
| SQL_INTERVAL_YEAR
| SQL_INTERVAL_YEAR_TO_MONTH
| SQL_INTERVAL_MONTH
| SQL_INTERVAL_DAY
| SQL_INTERVAL_DAY_TO_HOUR
| SQL_INTERVAL_DAY_TO_MINUTE
| SQL_INTERVAL_DAY_TO_SECOND
| SQL_INTERVAL_HOUR
| SQL_INTERVAL_HOUR_TO_MINUTE
| SQL_INTERVAL_HOUR_TO_SECOND
| SQL_INTERVAL_MINUTE
| SQL_INTERVAL_MINUTE_TO_SECOND
| SQL_INTERVAL_SECOND
| SQL_LONGVARBINARY
| SQL_LONGVARCHAR
| SQL_NUMERIC
| SQL_REAL
| SQL_SMALLINT
| SQL_TIME
| SQL_TIMESTAMP
| SQL_TINYINT
| SQL_VARBINARY
| SQL_VARCHAR
| SQL_WCHAR
| SQL_WLONGVARCHAR
| SQL_WVARCHAR
odbc_tsi_qualifier::=
SQL_TSI_FRAC_SECOND
| SQL_TSI_SECOND
| SQL_TSI_MINUTE
| SQL_TSI_HOUR
| SQL_TSI_DAY
| SQL_TSI_WEEK
| SQL_TSI_MONTH
| SQL_TSI_QUARTER
| SQL_TSI_YEAR
multi_arg_func::=
MARGFUNC '(' case_search_condition_commalist ')'
//Tokens
BOOL_FALSE ::= "false"
BOOL_TRUE ::= "true"
sqlBOOL ::= "bool"
ALTER ::= "ALTER"
ADD ::= "ADD"
AND ::= "AND"
RANK ::= "RANK"
RANK ::= "DENSE_RANK"
RANK ::= "PERCENT_RANK"
RANK ::= "CUME_DIST"
RANK ::= "ROW_NUMBER"
RANK ::= "NTILE"
RANK ::= "LAG"
RANK ::= "LEAD"
FETCH ::= "FETCH"
RANK ::= "FIRST_VALUE"
RANK ::= "LAST_VALUE"
RANK ::= "NTH_VALUE"
BEST ::= "BEST"
EFFORT ::= "EFFORT"
AS ::= "AS"
ASC ::= "ASC"
AUTHORIZATION ::= "AUTHORIZATION"
BETWEEN ::= "BETWEEN"
SYMMETRIC ::= "SYMMETRIC"
ASYMMETRIC ::= "ASYMMETRIC"
BY ::= "BY"
CAST ::= "CAST"
CONVERT ::= "CONVERT"
CHARACTER ::= "CHARACTER"
CHARACTER ::= "CHAR"
VARYING ::= "VARYING"
VARCHAR ::= "VARCHAR"
BINARY ::= "BINARY"
LARGE ::= "LARGE"
OBJECT ::= "OBJECT"
CLOB ::= "CLOB"
sqlBLOB ::= "BLOB"
sqlTEXT ::= "TEXT"
sqlTEXT ::= "TINYTEXT"
/*CLOB ::= "STRING" */
CHECK ::= "CHECK"
CLIENT ::= "CLIENT"
SERVER ::= "SERVER"
COMMENT ::= "COMMENT"
CONSTRAINT ::= "CONSTRAINT"
CREATE ::= "CREATE"
CROSS ::= "CROSS"
COPY ::= "COPY"
RECORDS ::= "RECORDS"
DELIMITERS ::= "DELIMITERS"
STDIN ::= "STDIN"
STDOUT ::= "STDOUT"
TINYINT ::= "TINYINT"
SMALLINT ::= "SMALLINT"
sqlINTEGER ::= "INTEGER"
sqlINTEGER ::= "INT"
sqlINTEGER ::= "MEDIUMINT"
BIGINT ::= "BIGINT"
//"HUGEINT" HUGEINT
sqlDECIMAL ::= "DEC"
sqlDECIMAL ::= "DECIMAL"
sqlDECIMAL ::= "NUMERIC"
DECLARE ::= "DECLARE"
DEFAULT ::= "DEFAULT"
DESC ::= "DESC"
DISTINCT ::= "DISTINCT"
sqlDOUBLE ::= "DOUBLE"
sqlREAL ::= "REAL"
DROP ::= "DROP"
ESCAPE ::= "ESCAPE"
EXISTS ::= "EXISTS"
UESCAPE ::= "UESCAPE"
EXTRACT ::= "EXTRACT"
sqlFLOAT ::= "FLOAT"
FOR ::= "FOR"
FOREIGN ::= "FOREIGN"
FROM ::= "FROM"
FWF ::= "FWF"
BIG ::= "BIG"
LITTLE ::= "LITTLE"
NATIVE ::= "NATIVE"
ENDIAN ::= "ENDIAN"
REFERENCES ::= "REFERENCES"
MATCH ::= "MATCH"
FULL ::= "FULL"
PARTIAL ::= "PARTIAL"
SIMPLE ::= "SIMPLE"
INSERT ::= "INSERT"
UPDATE ::= "UPDATE"
sqlDELETE ::= "DELETE"
TRUNCATE ::= "TRUNCATE"
MATCHED ::= "MATCHED"
ACTION ::= "ACTION"
CASCADE ::= "CASCADE"
RESTRICT ::= "RESTRICT"
FIRST ::= "FIRST"
GLOBAL ::= "GLOBAL"
sqlGROUP ::= "GROUP"
GROUPING ::= "GROUPING"
ROLLUP ::= "ROLLUP"
CUBE ::= "CUBE"
HAVING ::= "HAVING"
ILIKE ::= "ILIKE"
IMPRINTS ::= "IMPRINTS"
sqlIN ::= "IN"
INNER ::= "INNER"
INTO ::= "INTO"
IS ::= "IS"
JOIN ::= "JOIN"
KEY ::= "KEY"
LATERAL ::= "LATERAL"
LEFT ::= "LEFT"
LIKE ::= "LIKE"
LIMIT ::= "LIMIT"
SAMPLE ::= "SAMPLE"
SEED ::= "SEED"
LAST ::= "LAST"
LOCAL ::= "LOCAL"
NATURAL ::= "NATURAL"
NOT ::= "NOT"
sqlNULL ::= "NULL"
NULLS ::= "NULLS"
OFFSET ::= "OFFSET"
ON ::= "ON"
OPTIONS ::= "OPTIONS"
OPTION ::= "OPTION"
OR ::= "OR"
ORDER ::= "ORDER"
ORDERED ::= "ORDERED"
OUTER ::= "OUTER"
OVER ::= "OVER"
PARTITION ::= "PARTITION"
PATH ::= "PATH"
PRECISION ::= "PRECISION"
PRIMARY ::= "PRIMARY"
USER ::= "USER"
RENAME ::= "RENAME"
UNENCRYPTED ::= "UNENCRYPTED"
ENCRYPTED ::= "ENCRYPTED"
PASSWORD ::= "PASSWORD"
GRANT ::= "GRANT"
REVOKE ::= "REVOKE"
ROLE ::= "ROLE"
ADMIN ::= "ADMIN"
PRIVILEGES ::= "PRIVILEGES"
PUBLIC ::= "PUBLIC"
CURRENT_USER ::= "CURRENT_USER"
CURRENT_ROLE ::= "CURRENT_ROLE"
SESSION_USER ::= "SESSION_USER"
CURRENT_SCHEMA ::= "CURRENT_SCHEMA"
sqlSESSION ::= "SESSION"
MAX_MEMORY ::= "MAX_MEMORY"
MAX_WORKERS ::= "MAX_WORKERS"
OPTIMIZER ::= "OPTIMIZER"
RIGHT ::= "RIGHT"
SCHEMA ::= "SCHEMA"
SELECT ::= "SELECT"
SET ::= "SET"
SETS ::= "SETS"
AUTO_COMMIT ::= "AUTO_COMMIT"
ALL ::= "ALL"
ANY ::= "ANY"
SOME ::= "SOME"
ANY ::= "EVERY"
/*
"SQLCODE" SQLCODE
*/
COLUMN ::= "COLUMN"
TABLE ::= "TABLE"
TEMPORARY ::= "TEMPORARY"
TEMP ::= "TEMP"
REMOTE ::= "REMOTE"
MERGE ::= "MERGE"
REPLICA ::= "REPLICA"
UNLOGGED ::= "UNLOGGED"
TO ::= "TO"
UNION ::= "UNION"
EXCEPT ::= "EXCEPT"
INTERSECT ::= "INTERSECT"
CORRESPONDING ::= "CORRESPONDING"
UNIQUE ::= "UNIQUE"
USING ::= "USING"
VALUES ::= "VALUES"
VIEW ::= "VIEW"
WHERE ::= "WHERE"
WITH ::= "WITH"
WITHOUT ::= "WITHOUT"
DATA ::= "DATA"
sqlDATE ::= "DATE"
TIME ::= "TIME"
TIMESTAMP ::= "TIMESTAMP"
INTERVAL ::= "INTERVAL"
CURRENT_DATE ::= "CURRENT_DATE"
CURRENT_TIME ::= "CURRENT_TIME"
CURRENT_TIMESTAMP ::= "CURRENT_TIMESTAMP"
CURRENT_TIMEZONE ::= "CURRENT_TIMEZONE"
CURRENT_TIMESTAMP ::= "NOW"
LOCALTIME ::= "LOCALTIME"
LOCALTIMESTAMP ::= "LOCALTIMESTAMP"
ZONE ::= "ZONE"
CENTURY ::= "CENTURY"
DECADE ::= "DECADE"
YEAR ::= "YEAR"
QUARTER ::= "QUARTER"
MONTH ::= "MONTH"
WEEK ::= "WEEK"
DOW ::= "DOW"
DOY ::= "DOY"
DAY ::= "DAY"
HOUR ::= "HOUR"
MINUTE ::= "MINUTE"
SECOND ::= "SECOND"
EPOCH ::= "EPOCH"
POSITION ::= "POSITION"
SUBSTRING ::= "SUBSTRING"
SPLIT_PART ::= "SPLIT_PART"
TRIM ::= "TRIM"
LEADING ::= "LEADING"
TRAILING ::= "TRAILING"
BOTH ::= "BOTH"
CASE ::= "CASE"
WHEN ::= "WHEN"
THEN ::= "THEN"
ELSE ::= "ELSE"
END ::= "END"
NULLIF ::= "NULLIF"
COALESCE ::= "COALESCE"
ELSEIF ::= "ELSEIF"
IF ::= "IF"
WHILE ::= "WHILE"
DO ::= "DO"
COMMIT ::= "COMMIT"
ROLLBACK ::= "ROLLBACK"
SAVEPOINT ::= "SAVEPOINT"
RELEASE ::= "RELEASE"
WORK ::= "WORK"
CHAIN ::= "CHAIN"
PRESERVE ::= "PRESERVE"
ROWS ::= "ROWS"
NO ::= "NO"
START ::= "START"
TRANSACTION ::= "TRANSACTION"
READ ::= "READ"
WRITE ::= "WRITE"
ONLY ::= "ONLY"
ISOLATION ::= "ISOLATION"
LEVEL ::= "LEVEL"
UNCOMMITTED ::= "UNCOMMITTED"
COMMITTED ::= "COMMITTED"
sqlREPEATABLE ::= "REPEATABLE"
SNAPSHOT ::= "SNAPSHOT"
SERIALIZABLE ::= "SERIALIZABLE"
DIAGNOSTICS ::= "DIAGNOSTICS"
sqlSIZE ::= "SIZE"
STORAGE ::= "STORAGE"
TYPE ::= "TYPE"
PROCEDURE ::= "PROCEDURE"
FUNCTION ::= "FUNCTION"
sqlLOADER ::= "LOADER"
REPLACE ::= "REPLACE"
FIELD ::= "FIELD"
FILTER ::= "FILTER"
AGGREGATE ::= "AGGREGATE"
RETURNS ::= "RETURNS"
EXTERNAL ::= "EXTERNAL"
sqlNAME ::= "NAME"
RETURN ::= "RETURN"
CALL ::= "CALL"
LANGUAGE ::= "LANGUAGE"
ANALYZE ::= "ANALYZE"
MINMAX ::= "MINMAX"
SQL_EXPLAIN ::= "EXPLAIN"
SQL_PLAN ::= "PLAN"
SQL_TRACE ::= "TRACE"
PREPARE ::= "PREPARE"
PREP ::= "PREP"
EXECUTE ::= "EXECUTE"
EXEC ::= "EXEC"
DEALLOCATE ::= "DEALLOCATE"
INDEX ::= "INDEX"
SEQUENCE ::= "SEQUENCE"
RESTART ::= "RESTART"
INCREMENT ::= "INCREMENT"
MAXVALUE ::= "MAXVALUE"
MINVALUE ::= "MINVALUE"
CYCLE ::= "CYCLE"
CACHE ::= "CACHE"
NEXT ::= "NEXT"
VALUE ::= "VALUE"
GENERATED ::= "GENERATED"
ALWAYS ::= "ALWAYS"
IDENTITY ::= "IDENTITY"
SERIAL ::= "SERIAL"
BIGSERIAL ::= "BIGSERIAL"
AUTO_INCREMENT ::= "AUTO_INCREMENT"
CONTINUE ::= "CONTINUE"
TRIGGER ::= "TRIGGER"
ATOMIC ::= "ATOMIC"
BEGIN ::= "BEGIN"
OF ::= "OF"
BEFORE ::= "BEFORE"
AFTER ::= "AFTER"
ROW ::= "ROW"
STATEMENT ::= "STATEMENT"
sqlNEW ::= "NEW"
OLD ::= "OLD"
EACH ::= "EACH"
REFERENCING ::= "REFERENCING"
RANGE ::= "RANGE"
UNBOUNDED ::= "UNBOUNDED"
PRECEDING ::= "PRECEDING"
FOLLOWING ::= "FOLLOWING"
CURRENT ::= "CURRENT"
EXCLUDE ::= "EXCLUDE"
OTHERS ::= "OTHERS"
TIES ::= "TIES"
GROUPS ::= "GROUPS"
WINDOW ::= "WINDOW"
/* special SQL/XML keywords */
XMLCOMMENT ::= "XMLCOMMENT"
XMLCONCAT ::= "XMLCONCAT"
XMLDOCUMENT ::= "XMLDOCUMENT"
XMLELEMENT ::= "XMLELEMENT"
XMLATTRIBUTES ::= "XMLATTRIBUTES"
XMLFOREST ::= "XMLFOREST"
XMLPARSE ::= "XMLPARSE"
STRIP ::= "STRIP"
WHITESPACE ::= "WHITESPACE"
XMLPI ::= "XMLPI"
XMLQUERY ::= "XMLQUERY"
PASSING ::= "PASSING"
XMLTEXT ::= "XMLTEXT"
NIL ::= "NIL"
REF ::= "REF"
ABSENT ::= "ABSENT"
DOCUMENT ::= "DOCUMENT"
ELEMENT ::= "ELEMENT"
CONTENT ::= "CONTENT"
XMLNAMESPACES ::= "XMLNAMESPACES"
NAMESPACE ::= "NAMESPACE"
XMLVALIDATE ::= "XMLVALIDATE"
RETURNING ::= "RETURNING"
LOCATION ::= "LOCATION"
ID ::= "ID"
ACCORDING ::= "ACCORDING"
XMLSCHEMA ::= "XMLSCHEMA"
URI ::= "URI"
XMLAGG ::= "XMLAGG"
/* keywords for opengis */
GEOMETRY ::= "GEOMETRY"
GEOMETRYSUBTYPE ::= "POINT"
GEOMETRYSUBTYPE ::= "LINESTRING"
GEOMETRYSUBTYPE ::= "POLYGON"
GEOMETRYSUBTYPE ::= "MULTIPOINT"
GEOMETRYSUBTYPE ::= "MULTILINESTRING"
GEOMETRYSUBTYPE ::= "MULTIPOLYGON"
GEOMETRYSUBTYPE ::= "GEOMETRYCOLLECTION"
GEOMETRYSUBTYPE ::= "POINTZ"
GEOMETRYSUBTYPE ::= "LINESTRINGZ"
GEOMETRYSUBTYPE ::= "POLYGONZ"
GEOMETRYSUBTYPE ::= "MULTIPOINTZ"
GEOMETRYSUBTYPE ::= "MULTILINESTRINGZ"
GEOMETRYSUBTYPE ::= "MULTIPOLYGONZ"
GEOMETRYSUBTYPE ::= "GEOMETRYCOLLECTIONZ"
GEOMETRYSUBTYPE ::= "POINTM"
GEOMETRYSUBTYPE ::= "LINESTRINGM"
GEOMETRYSUBTYPE ::= "POLYGONM"
GEOMETRYSUBTYPE ::= "MULTIPOINTM"
GEOMETRYSUBTYPE ::= "MULTILINESTRINGM"
GEOMETRYSUBTYPE ::= "MULTIPOLYGONM"
GEOMETRYSUBTYPE ::= "GEOMETRYCOLLECTIONM"
GEOMETRYSUBTYPE ::= "POINTZM"
GEOMETRYSUBTYPE ::= "LINESTRINGZM"
GEOMETRYSUBTYPE ::= "POLYGONZM"
GEOMETRYSUBTYPE ::= "MULTIPOINTZM"
GEOMETRYSUBTYPE ::= "MULTILINESTRINGZM"
GEOMETRYSUBTYPE ::= "MULTIPOLYGONZM"
GEOMETRYSUBTYPE ::= "GEOMETRYCOLLECTIONZM"
LOGIN ::= "LOGIN"
// odbc keywords
ODBC_DATE_ESCAPE_PREFIX ::= "d"
ODBC_TIME_ESCAPE_PREFIX ::= "t"
ODBC_TIMESTAMP_ESCAPE_PREFIX ::= "ts"
ODBC_GUID_ESCAPE_PREFIX ::= "guid"
ODBC_FUNC_ESCAPE_PREFIX ::= "fn"
ODBC_OJ_ESCAPE_PREFIX ::= "oj"
DAYNAME ::= "DAYNAME"
IFNULL ::= "IFNULL"
MONTHNAME ::= "MONTHNAME"
TIMESTAMPADD ::= "TIMESTAMPADD"
TIMESTAMPDIFF ::= "TIMESTAMPDIFF"
SQL_BIGINT ::= "SQL_BIGINT"
SQL_BINARY ::= "SQL_BINARY"
SQL_BIT ::= "SQL_BIT"
SQL_CHAR ::= "SQL_CHAR"
SQL_DATE ::= "SQL_DATE"
SQL_DECIMAL ::= "SQL_DECIMAL"
SQL_DOUBLE ::= "SQL_DOUBLE"
SQL_FLOAT ::= "SQL_FLOAT"
SQL_GUID ::= "SQL_GUID"
SQL_HUGEINT ::= "SQL_HUGEINT"
SQL_INTEGER ::= "SQL_INTEGER"
SQL_INTERVAL_DAY ::= "SQL_INTERVAL_DAY"
SQL_INTERVAL_DAY_TO_HOUR ::= "SQL_INTERVAL_DAY_TO_HOUR"
SQL_INTERVAL_DAY_TO_MINUTE ::= "SQL_INTERVAL_DAY_TO_MINUTE"
SQL_INTERVAL_DAY_TO_SECOND ::= "SQL_INTERVAL_DAY_TO_SECOND"
SQL_INTERVAL_HOUR ::= "SQL_INTERVAL_HOUR"
SQL_INTERVAL_HOUR_TO_MINUTE ::= "SQL_INTERVAL_HOUR_TO_MINUTE"
SQL_INTERVAL_HOUR_TO_SECOND ::= "SQL_INTERVAL_HOUR_TO_SECOND"
SQL_INTERVAL_MINUTE ::= "SQL_INTERVAL_MINUTE"
SQL_INTERVAL_MINUTE_TO_SECOND ::= "SQL_INTERVAL_MINUTE_TO_SECOND"
SQL_INTERVAL_MONTH ::= "SQL_INTERVAL_MONTH"
SQL_INTERVAL_SECOND ::= "SQL_INTERVAL_SECOND"
SQL_INTERVAL_YEAR ::= "SQL_INTERVAL_YEAR"
SQL_INTERVAL_YEAR_TO_MONTH ::= "SQL_INTERVAL_YEAR_TO_MONTH"
SQL_LONGVARBINARY ::= "SQL_LONGVARBINARY"
SQL_LONGVARCHAR ::= "SQL_LONGVARCHAR"
SQL_NUMERIC ::= "SQL_NUMERIC"
SQL_REAL ::= "SQL_REAL"
SQL_SMALLINT ::= "SQL_SMALLINT"
SQL_TIME ::= "SQL_TIME"
SQL_TIMESTAMP ::= "SQL_TIMESTAMP"
SQL_TINYINT ::= "SQL_TINYINT"
SQL_VARBINARY ::= "SQL_VARBINARY"
SQL_VARCHAR ::= "SQL_VARCHAR"
SQL_WCHAR ::= "SQL_WCHAR"
SQL_WLONGVARCHAR ::= "SQL_WLONGVARCHAR"
SQL_WVARCHAR ::= "SQL_WVARCHAR"
SQL_TSI_FRAC_SECOND ::= "SQL_TSI_FRAC_SECOND"
SQL_TSI_SECOND ::= "SQL_TSI_SECOND"
SQL_TSI_MINUTE ::= "SQL_TSI_MINUTE"
SQL_TSI_HOUR ::= "SQL_TSI_HOUR"
SQL_TSI_DAY ::= "SQL_TSI_DAY"
SQL_TSI_WEEK ::= "SQL_TSI_WEEK"
SQL_TSI_MONTH ::= "SQL_TSI_MONTH"
SQL_TSI_QUARTER ::= "SQL_TSI_QUARTER"
SQL_TSI_YEAR ::= "SQL_TSI_YEAR"
MARGFUNC ::= "LEAST"
MARGFUNC ::= "GREATEST"
AT ::= "@"
COMPARISON ::= "<"|">"|">="|"<="|"<>"
CONCATSTRING ::= "||"
GEOM_ABOVE ::= "|>"
GEOM_BELOW ::= "<=|"
GEOM_DIST ::= "->"
GEOM_MBR_EQUAL ::= "~="
GEOM_OVERLAP ::= "&&"
GEOM_OVERLAP_OR_ABOVE ::= "|&>"
GEOM_OVERLAP_OR_BELOW ::= "&<|"
GEOM_OVERLAP_OR_LEFT ::= "&<"
GEOM_OVERLAP_OR_RIGHT ::= "&>"
LEFT_SHIFT ::= "<<"
LEFT_SHIFT_ASSIGN ::= "<<="
NOT_BETWEEN ::= "NOT BETWEEN"
NOT_EXISTS ::= "NOT EXISTS"
NOT_ILIKE ::= "NOT ILIKE"
NOT_IN ::= "NOT IN"
NOT_LIKE ::= "NOT LIKE"
RIGHT_SHIFT ::= ">>"
RIGHT_SHIFT_ASSIGN ::= ">>="
SCOLON ::= ";"
``` | Grammar railroad diagram | https://api.github.com/repos/MonetDB/MonetDB/issues/7492/comments | 4 | 2024-03-27T14:15:03Z | 2024-06-27T13:19:56Z | https://github.com/MonetDB/MonetDB/issues/7492 | 2,210,925,333 | 7,492 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
When you design a dashboard in a Bi Tool (like Tableau), you don't write the exact query of the viz. You create a model with one or several tables and then you build your viz on this model (which must be at the finest granularity needed in the dashboard).
However, most of the time, the granularity of your viz is different, meaning there is a lot of grouping at distinct level.
**Describe the solution you'd like**
Vertica has a unique way to solve this issue by building projections. To make it simple, projections are stored "synonyms" of the table that is queried, it can contains less columns, being filtered, or aggregated (so less data and faster query) and the engine choose the best fitted projection for any query.
https://www.vertica.com/docs/9.2.x/HTML/Content/Authoring/AdministratorsGuide/Projections/WorkingWithProjections.htm
https://www.vertica.com/docs/9.3.x/HTML/Content/Authoring/SQLReferenceManual/Statements/CREATEPROJECTIONLiveAggregate.htm
Of course, it takes more space disk but it's way better for dashboarding.
**Describe alternatives you've considered**
N/A
**Additional context**
N/A
| Projection (like Vertica) support | https://api.github.com/repos/MonetDB/MonetDB/issues/7491/comments | 12 | 2024-03-27T05:47:41Z | 2024-03-28T20:16:38Z | https://github.com/MonetDB/MonetDB/issues/7491 | 2,209,921,389 | 7,491 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Trivially reusable intermediates are not reused.
**To Reproduce**
```sql
start transaction;
-- a small table
create table t(value int);
insert into t values (0),(2),(1);
explain
SELECT * from t where value=0
UNION ALL
SELECT * from t where value=0;
```
The explain shows two distinct `bind`s for the same column. Which means two distinct selects that are in fact identical. In real queries this can explode.
```
| function user.main():void; |
| X_1:void := querylog.define("explain\nselect * from t where value=0\nunion all\nselect * from t where value=0;":str, "sequential_pipe":str, 22:int); |
| X_4:int := sql.mvc(); |
| C_5:bat[:oid] := sql.tid(X_4:int, "sys":str, "t":str); |
| X_8:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int); |
| C_13:bat[:oid] := algebra.thetaselect(X_8:bat[:int], C_5:bat[:oid], 0:int, "==":str); |
| X_15:bat[:int] := algebra.projection(C_13:bat[:oid], X_8:bat[:int]); |
| X_17:bat[:int] := sql.bind(X_4:int, "sys":str, "t":str, "value":str, 0:int); |
| C_19:bat[:oid] := algebra.thetaselect(X_17:bat[:int], C_5:bat[:oid], 0:int, "==":str); |
| X_20:bat[:int] := algebra.projection(C_19:bat[:oid], X_17:bat[:int]); |
| X_21:bat[:int] := bat.new(nil:int); |
| X_23:bat[:int] := bat.append(X_21:bat[:int], X_15:bat[:int], true:bit); |
| X_25:bat[:int] := bat.append(X_23:bat[:int], X_20:bat[:int], true:bit); |
| X_27:bat[:str] := bat.pack(".%5":str); |
| X_28:bat[:str] := bat.pack("value":str); |
| X_29:bat[:str] := bat.pack("int":str); |
| X_30:bat[:int] := bat.pack(32:int); |
| X_31:bat[:int] := bat.pack(0:int); |
| X_26:int := sql.resultSet(X_27:bat[:str], X_28:bat[:str], X_29:bat[:str], X_30:bat[:int], X_31:bat[:int], X_25:bat[:int]); |
| end user.main; |
```
**Expected behavior**
Only one `bind` to column `value` is made and the associated variable used twice, leading to only one select.
**Software versions**
- MonetDB version number 11.49.6
- OS and version: Fedora 39
- self-installed and compiled
| commonTerms optimizer no longer works | https://api.github.com/repos/MonetDB/MonetDB/issues/7490/comments | 2 | 2024-03-26T16:53:01Z | 2024-06-27T13:19:55Z | https://github.com/MonetDB/MonetDB/issues/7490 | 2,208,790,797 | 7,490 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_equal`.
**To Reproduce**
```sql
SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' ) );
```
**Backtrace of the Crash**
```c
#0 0x7fbdedf3e25f (exp_equal+0x3f)
#1 0x7fbdedf6d116 (rel_set_type+0x3e6)
#2 0x7fbdedf5533f (rel_visitor_topdown+0x27f)
#3 0x7fbdedf556f5 (rel_visitor_topdown+0x635)
#4 0x7fbdedf55696 (rel_visitor_topdown+0x5d6)
#5 0x7fbdedf556f5 (rel_visitor_topdown+0x635)
#6 0x7fbdedf55696 (rel_visitor_topdown+0x5d6)
#7 0x7fbdedf556f5 (rel_visitor_topdown+0x635)
#8 0x7fbdedf63560 (rel_unnest+0x120)
#9 0x7fbdedede465 (sql_processrelation+0x85)
#10 0x7fbdedce6edb (sql_symbol2relation+0x1bb)
#11 0x7fbdedd13a82 (SQLparser+0x802)
#12 0x7fbdedd12a0a (SQLengine_+0xa5a)
#13 0x7fbdedd101fe (SQLengine+0x3e)
#14 0x7fbdee294b2f (runScenario+0x6f)
#15 0x7fbdee295cfe (MSscheduleClient+0xb6e)
#16 0x7fbdee3d96c2 (doChallenge+0x132)
#17 0x7fbdef1f6b38 (thread_starter+0x318)
#18 0x7fbdedc07609 (start_thread+0xd9)
#19 0x7fbdedb2a353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_equal` | https://api.github.com/repos/MonetDB/MonetDB/issues/7489/comments | 1 | 2024-03-17T11:56:41Z | 2024-06-27T13:19:54Z | https://github.com/MonetDB/MonetDB/issues/7489 | 2,190,627,511 | 7,489 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `strCmp`.
**To Reproduce**
```sql
SELECT 0.100000 FROM dependencies ORDER BY max ( 'y' ) OVER ( ROWS BETWEEN 1.100000 PRECEDING AND 8 PRECEDING );
```
**Backtrace of the Crash**
```c
#0 0x7f42471f6ed9 (strCmp+0xd9)
#1 0x7f42475b3431 (GDKanalyticalmax+0xeae1)
#2 0x7f4245edf065 (SQLmax+0x245)
#3 0x7f424634bdad (runMALsequence+0xe8d)
#4 0x7f4246351293 (DFLOWworker+0x4a3)
#5 0x7f42472d3b38 (thread_starter+0x318)
#6 0x7f4245ce4609 (start_thread+0xd9)
#7 0x7f4245c07353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `strCmp` | https://api.github.com/repos/MonetDB/MonetDB/issues/7488/comments | 3 | 2024-03-17T11:53:19Z | 2024-06-27T13:19:53Z | https://github.com/MonetDB/MonetDB/issues/7488 | 2,190,626,007 | 7,488 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `sql_init_subtype`.
**To Reproduce**
```sql
SELECT levenshtein ( 'int' , '2014-10-25 UTC' );
```
**Backtrace of the Crash**
```c
#0 0x7ff2f16795ec (sql_init_subtype+0x3c)
#1 0x7ff2f16b855b (res_col_create+0xdb)
#2 0x7ff2f1582d96 (mvc_result_value+0x66)
#3 0x7ff2f14f2940 (mvc_scalar_value_wrap+0x210)
#4 0x7ff2f1a67dad (runMALsequence+0xe8d)
#5 0x7ff2f1a66ace (runMAL+0xee)
#6 0x7ff2f150d9d2 (SQLrun+0x142)
#7 0x7ff2f150f499 (SQLengineIntern+0xc9)
#8 0x7ff2f150c0d2 (SQLengine_+0x1122)
#9 0x7ff2f15091fe (SQLengine+0x3e)
#10 0x7ff2f1a8db2f (runScenario+0x6f)
#11 0x7ff2f1a8ecfe (MSscheduleClient+0xb6e)
#12 0x7ff2f1bd26c2 (doChallenge+0x132)
#13 0x7ff2f29efb38 (thread_starter+0x318)
#14 0x7ff2f1400609 (start_thread+0xd9)
#15 0x7ff2f1323353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `sql_init_subtype` | https://api.github.com/repos/MonetDB/MonetDB/issues/7487/comments | 2 | 2024-03-17T11:51:42Z | 2024-06-27T13:19:52Z | https://github.com/MonetDB/MonetDB/issues/7487 | 2,190,625,072 | 7,487 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `ALGgroupby`.
**To Reproduce**
```sql
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 );
```
**Backtrace of the Crash**
```c
#0 0x7fc9d896505c (ALGgroupby+0xec)
#1 0x7fc9d87b76e9 (runMALsequence+0x17c9)
#2 0x7fc9d87bc293 (DFLOWworker+0x4a3)
#3 0x7fc9d973eb38 (thread_starter+0x318)
#4 0x7fc9d814f609 (start_thread+0xd9)
#5 0x7fc9d8072353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `ALGgroupby` | https://api.github.com/repos/MonetDB/MonetDB/issues/7486/comments | 0 | 2024-03-17T11:50:43Z | 2024-06-27T13:19:52Z | https://github.com/MonetDB/MonetDB/issues/7486 | 2,190,624,667 | 7,486 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_setalias`.
**To Reproduce**
```sql
SELECT ( WITH x ( x ) AS ( SELECT 1 ) SELECT ( x ) FROM x WHERE ( SELECT x FROM x GROUP BY x + 1 , x ) );
```
**Backtrace of the Crash**
```c
#0 0x7febb81617ab (exp_setalias+0x2b)
#1 0x7febb81cce4c (rel_optimize_projections_+0xb1c)
#2 0x7febb817a33f (rel_visitor_topdown+0x27f)
#3 0x7febb817a6f5 (rel_visitor_topdown+0x635)
#4 0x7febb817a696 (rel_visitor_topdown+0x5d6)
#5 0x7febb817a6f5 (rel_visitor_topdown+0x635)
#6 0x7febb817a6f5 (rel_visitor_topdown+0x635)
#7 0x7febb817a696 (rel_visitor_topdown+0x5d6)
#8 0x7febb817a6f5 (rel_visitor_topdown+0x635)
#9 0x7febb81c6c4b (rel_optimize_projections+0x3b)
#10 0x7febb81a105a (rel_optimizer+0x75a)
#11 0x7febb81034a7 (sql_processrelation+0xc7)
#12 0x7febb7f0bedb (sql_symbol2relation+0x1bb)
#13 0x7febb7f38a82 (SQLparser+0x802)
#14 0x7febb7f37a0a (SQLengine_+0xa5a)
#15 0x7febb7f351fe (SQLengine+0x3e)
#16 0x7febb84b9b2f (runScenario+0x6f)
#17 0x7febb84bacfe (MSscheduleClient+0xb6e)
#18 0x7febb85fe6c2 (doChallenge+0x132)
#19 0x7febb941bb38 (thread_starter+0x318)
#20 0x7febb7e2c609 (start_thread+0xd9)
#21 0x7febb7d4f353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_setalias` | https://api.github.com/repos/MonetDB/MonetDB/issues/7485/comments | 0 | 2024-03-17T11:49:43Z | 2024-06-27T13:19:51Z | https://github.com/MonetDB/MonetDB/issues/7485 | 2,190,624,294 | 7,485 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `rel_optimize_projections_`.
**To Reproduce**
```sql
SELECT ( WITH x AS ( SELECT 1 x UNION SELECT 1 ) SELECT x FROM x WHERE ( SELECT x FROM ( SELECT ( CASE WHEN 1 THEN x END ) x , 1 * x FROM x UNION SELECT x , x ) AS ) );
```
**Backtrace of the Crash**
```c
#0 0x7fa5ab1eee3c (rel_optimize_projections_+0xb0c)
#1 0x7fa5ab19c33f (rel_visitor_topdown+0x27f)
#2 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#3 0x7fa5ab19c696 (rel_visitor_topdown+0x5d6)
#4 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#5 0x7fa5ab19c658 (rel_visitor_topdown+0x598)
#6 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#7 0x7fa5ab19c696 (rel_visitor_topdown+0x5d6)
#8 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#9 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#10 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#11 0x7fa5ab19c696 (rel_visitor_topdown+0x5d6)
#12 0x7fa5ab19c6f5 (rel_visitor_topdown+0x635)
#13 0x7fa5ab1e8c4b (rel_optimize_projections+0x3b)
#14 0x7fa5ab1c305a (rel_optimizer+0x75a)
#15 0x7fa5ab1254a7 (sql_processrelation+0xc7)
#16 0x7fa5aaf2dedb (sql_symbol2relation+0x1bb)
#17 0x7fa5aaf5aa82 (SQLparser+0x802)
#18 0x7fa5aaf59a0a (SQLengine_+0xa5a)
#19 0x7fa5aaf571fe (SQLengine+0x3e)
#20 0x7fa5ab4dbb2f (runScenario+0x6f)
#21 0x7fa5ab4dccfe (MSscheduleClient+0xb6e)
#22 0x7fa5ab6206c2 (doChallenge+0x132)
#23 0x7fa5ac43db38 (thread_starter+0x318)
#24 0x7fa5aae4e609 (start_thread+0xd9)
#25 0x7fa5aad71353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `rel_optimize_projections_` | https://api.github.com/repos/MonetDB/MonetDB/issues/7484/comments | 1 | 2024-03-17T11:47:48Z | 2024-06-27T13:19:50Z | https://github.com/MonetDB/MonetDB/issues/7484 | 2,190,623,550 | 7,484 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `rel_get_statistics_`.
**To Reproduce**
```sql
SELECT NTILE ( 1.000000 ) OVER ( ORDER BY x LIKE x ) FROM ( SELECT 'x' x UNION SELECT 10 x ) v;
```
**Backtrace of the Crash**
```c
#0 0x7fa5dc469972 (rel_get_statistics_+0x1022)
#1 0x7fa5dc43ede7 (rel_visitor_bottomup+0x3e7)
#2 0x7fa5dc43ecd7 (rel_visitor_bottomup+0x2d7)
#3 0x7fa5dc43ecd7 (rel_visitor_bottomup+0x2d7)
#4 0x7fa5dc43ecd7 (rel_visitor_bottomup+0x2d7)
#5 0x7fa5dc4687bf (rel_get_statistics+0x5f)
#6 0x7fa5dc465235 (rel_optimizer+0x935)
#7 0x7fa5dc3c74a7 (sql_processrelation+0xc7)
#8 0x7fa5dc1cfedb (sql_symbol2relation+0x1bb)
#9 0x7fa5dc1fca82 (SQLparser+0x802)
#10 0x7fa5dc1fba0a (SQLengine_+0xa5a)
#11 0x7fa5dc1f91fe (SQLengine+0x3e)
#12 0x7fa5dc77db2f (runScenario+0x6f)
#13 0x7fa5dc77ecfe (MSscheduleClient+0xb6e)
#14 0x7fa5dc8c26c2 (doChallenge+0x132)
#15 0x7fa5dd6dfb38 (thread_starter+0x318)
#16 0x7fa5dc0f0609 (start_thread+0xd9)
#17 0x7fa5dc013353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `rel_get_statistics_` | https://api.github.com/repos/MonetDB/MonetDB/issues/7483/comments | 0 | 2024-03-17T11:32:47Z | 2024-06-27T13:19:49Z | https://github.com/MonetDB/MonetDB/issues/7483 | 2,190,617,683 | 7,483 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `bin_find_smallest_column`.
**To Reproduce**
```sql
SELECT var_samp ( '12' ) OVER ( ORDER BY CAST ( ( CASE WHEN ( 99 ) THEN COUNT ( * ) ELSE CASE WHEN 1 THEN ( FALSE ) END END ) AS BIGINT ) );
```
**Backtrace of the Crash**
```c
#0 0x7fb8fa8b4ebf (bin_find_smallest_column+0x4f)
#1 0x7fb8fa8ad3e2 (exp_bin+0xff2)
#2 0x7fb8fa8bb289 (subrel_bin+0x5d69)
#3 0x7fb8fa8c34c9 (rel2bin_project+0x1f9)
#4 0x7fb8fa8b61dc (subrel_bin+0xcbc)
#5 0x7fb8fa8c34c9 (rel2bin_project+0x1f9)
#6 0x7fb8fa8b61dc (subrel_bin+0xcbc)
#7 0x7fb8fa8c34c9 (rel2bin_project+0x1f9)
#8 0x7fb8fa8b61dc (subrel_bin+0xcbc)
#9 0x7fb8fa8c34c9 (rel2bin_project+0x1f9)
#10 0x7fb8fa8b61dc (subrel_bin+0xcbc)
#11 0x7fb8fa8b53b9 (output_rel_bin+0xb9)
#12 0x7fb8fa901a59 (backend_dumpstmt_body+0x2c9)
#13 0x7fb8fa9016a2 (backend_dumpstmt+0x192)
#14 0x7fb8fa89d184 (SQLparser+0xf04)
#15 0x7fb8fa89ba0a (SQLengine_+0xa5a)
#16 0x7fb8fa8991fe (SQLengine+0x3e)
#17 0x7fb8fae1db2f (runScenario+0x6f)
#18 0x7fb8fae1ecfe (MSscheduleClient+0xb6e)
#19 0x7fb8faf626c2 (doChallenge+0x132)
#20 0x7fb8fbd7fb38 (thread_starter+0x318)
#21 0x7fb8fa790609 (start_thread+0xd9)
#22 0x7fb8fa6b3353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `bin_find_smallest_column` | https://api.github.com/repos/MonetDB/MonetDB/issues/7482/comments | 0 | 2024-03-17T11:26:46Z | 2024-06-27T13:19:49Z | https://github.com/MonetDB/MonetDB/issues/7482 | 2,190,614,694 | 7,482 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `mvc_row_result_wrap`.
**To Reproduce**
```sql
SELECT 50 , CASE WHEN COUNT ( ) OVER ( ) THEN ( 63 ) END;
```
**Backtrace of the Crash**
```c
#0 0x7f232aa70e6c (mvc_row_result_wrap+0x7bc)
#1 0x7f232afe9dad (runMALsequence+0xe8d)
#2 0x7f232afe8ace (runMAL+0xee)
#3 0x7f232aa8f9d2 (SQLrun+0x142)
#4 0x7f232aa91499 (SQLengineIntern+0xc9)
#5 0x7f232aa8e0d2 (SQLengine_+0x1122)
#6 0x7f232aa8b1fe (SQLengine+0x3e)
#7 0x7f232b00fb2f (runScenario+0x6f)
#8 0x7f232b010cfe (MSscheduleClient+0xb6e)
#9 0x7f232b1546c2 (doChallenge+0x132)
#10 0x7f232bf71b38 (thread_starter+0x318)
#11 0x7f232a982609 (start_thread+0xd9)
#12 0x7f232a8a5353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `mvc_row_result_wrap` | https://api.github.com/repos/MonetDB/MonetDB/issues/7481/comments | 0 | 2024-03-17T11:25:24Z | 2024-06-27T13:19:48Z | https://github.com/MonetDB/MonetDB/issues/7481 | 2,190,614,180 | 7,481 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `get_rel_count`.
**To Reproduce**
```sql
SELECT CASE WHEN ( SELECT 2 WHERE FALSE ) > ANY ( 1 ) THEN 1 END GROUP BY 1;
```
**Backtrace of the Crash**
```c
#0 0x7fde17972420 (get_rel_count+0x30)
#1 0x7fde179971e7 (rel_propagate_statistics+0x1327)
#2 0x7fde17969a65 (exp_visitor+0xc45)
#3 0x7fde179685e9 (exps_exp_visitor_bottomup+0xf9)
#4 0x7fde17991ca1 (rel_get_statistics_+0x351)
#5 0x7fde17967de7 (rel_visitor_bottomup+0x3e7)
#6 0x7fde17967c78 (rel_visitor_bottomup+0x278)
#7 0x7fde17967cd7 (rel_visitor_bottomup+0x2d7)
#8 0x7fde179917bf (rel_get_statistics+0x5f)
#9 0x7fde1798e235 (rel_optimizer+0x935)
#10 0x7fde178f04a7 (sql_processrelation+0xc7)
#11 0x7fde176f8edb (sql_symbol2relation+0x1bb)
#12 0x7fde17725a82 (SQLparser+0x802)
#13 0x7fde17724a0a (SQLengine_+0xa5a)
#14 0x7fde177221fe (SQLengine+0x3e)
#15 0x7fde17ca6b2f (runScenario+0x6f)
#16 0x7fde17ca7cfe (MSscheduleClient+0xb6e)
#17 0x7fde17deb6c2 (doChallenge+0x132)
#18 0x7fde18c08b38 (thread_starter+0x318)
#19 0x7fde17619609 (start_thread+0xd9)
#20 0x7fde1753c353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `get_rel_count` | https://api.github.com/repos/MonetDB/MonetDB/issues/7480/comments | 1 | 2024-03-17T11:22:24Z | 2024-06-27T13:19:47Z | https://github.com/MonetDB/MonetDB/issues/7480 | 2,190,612,981 | 7,480 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_ref`.
**To Reproduce**
```sql
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 ) );
```
**Backtrace of the Crash**
```c
#0 0x7f77ba568caf (exp_ref+0x3f)
#1 0x7f77ba5d6324 (exp_rename+0x714)
#2 0x7f77ba5d5ff6 (exp_rename+0x3e6)
#3 0x7f77ba5d579f (rel_push_project_up_+0x138f)
#4 0x7f77ba586de7 (rel_visitor_bottomup+0x3e7)
#5 0x7f77ba586cd7 (rel_visitor_bottomup+0x2d7)
#6 0x7f77ba586c78 (rel_visitor_bottomup+0x278)
#7 0x7f77ba586cd7 (rel_visitor_bottomup+0x2d7)
#8 0x7f77ba5d0d7b (rel_push_project_up+0x3b)
#9 0x7f77ba5ad05a (rel_optimizer+0x75a)
#10 0x7f77ba50f4a7 (sql_processrelation+0xc7)
#11 0x7f77ba317edb (sql_symbol2relation+0x1bb)
#12 0x7f77ba344a82 (SQLparser+0x802)
#13 0x7f77ba343a0a (SQLengine_+0xa5a)
#14 0x7f77ba3411fe (SQLengine+0x3e)
#15 0x7f77ba8c5b2f (runScenario+0x6f)
#16 0x7f77ba8c6cfe (MSscheduleClient+0xb6e)
#17 0x7f77baa0a6c2 (doChallenge+0x132)
#18 0x7f77bb827b38 (thread_starter+0x318)
#19 0x7f77ba238609 (start_thread+0xd9)
#20 0x7f77ba15b353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_ref` | https://api.github.com/repos/MonetDB/MonetDB/issues/7479/comments | 1 | 2024-03-17T11:17:27Z | 2024-06-27T13:19:46Z | https://github.com/MonetDB/MonetDB/issues/7479 | 2,190,611,023 | 7,479 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_equal`.
**To Reproduce**
```sql
SELECT ( WITH x AS ( SELECT NULL ) SELECT 'x' IN ( SELECT * FROM x GROUP BY 'x' ) );
```
**Backtrace of the Crash**
```c
#0 0x7fb34c93c25f (exp_equal+0x3f)
#1 0x7fb34c96b116 (rel_set_type+0x3e6)
#2 0x7fb34c95333f (rel_visitor_topdown+0x27f)
#3 0x7fb34c9536f5 (rel_visitor_topdown+0x635)
#4 0x7fb34c953696 (rel_visitor_topdown+0x5d6)
#5 0x7fb34c9536f5 (rel_visitor_topdown+0x635)
#6 0x7fb34c953696 (rel_visitor_topdown+0x5d6)
#7 0x7fb34c9536f5 (rel_visitor_topdown+0x635)
#8 0x7fb34c961560 (rel_unnest+0x120)
#9 0x7fb34c8dc465 (sql_processrelation+0x85)
#10 0x7fb34c6e4edb (sql_symbol2relation+0x1bb)
#11 0x7fb34c711a82 (SQLparser+0x802)
#12 0x7fb34c710a0a (SQLengine_+0xa5a)
#13 0x7fb34c70e1fe (SQLengine+0x3e)
#14 0x7fb34cc92b2f (runScenario+0x6f)
#15 0x7fb34cc93cfe (MSscheduleClient+0xb6e)
#16 0x7fb34cdd76c2 (doChallenge+0x132)
#17 0x7fb34dbf4b38 (thread_starter+0x318)
#18 0x7fb34c605609 (start_thread+0xd9)
#19 0x7fb34c528353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_equal` | https://api.github.com/repos/MonetDB/MonetDB/issues/7478/comments | 1 | 2024-03-17T11:14:56Z | 2024-06-27T13:19:45Z | https://github.com/MonetDB/MonetDB/issues/7478 | 2,190,609,873 | 7,478 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `atom_cmp`.
**To Reproduce**
```sql
SELECT - 66 x GROUP BY x HAVING ( abs ( x ) IN ( SELECT '' x WHERE ( x = ( x = 1 ) ) UNION SELECT 1 ) );
```
**Backtrace of the Crash**
```c
#0 0x7f28e45cd0bd (atom_cmp+0x2d)
#1 0x7f28e46981a4 (sql_abs_propagate_statistics+0xb4)
#2 0x7f28e468e311 (rel_propagate_statistics+0x451)
#3 0x7f28e4661a65 (exp_visitor+0xc45)
#4 0x7f28e46616e3 (exp_visitor+0x8c3)
#5 0x7f28e46605e9 (exps_exp_visitor_bottomup+0xf9)
#6 0x7f28e4689ca1 (rel_get_statistics_+0x351)
#7 0x7f28e465fde7 (rel_visitor_bottomup+0x3e7)
#8 0x7f28e465fcd7 (rel_visitor_bottomup+0x2d7)
#9 0x7f28e465fc3a (rel_visitor_bottomup+0x23a)
#10 0x7f28e465fcd7 (rel_visitor_bottomup+0x2d7)
#11 0x7f28e46897bf (rel_get_statistics+0x5f)
#12 0x7f28e4686235 (rel_optimizer+0x935)
#13 0x7f28e45e84a7 (sql_processrelation+0xc7)
#14 0x7f28e43f0edb (sql_symbol2relation+0x1bb)
#15 0x7f28e441da82 (SQLparser+0x802)
#16 0x7f28e441ca0a (SQLengine_+0xa5a)
#17 0x7f28e441a1fe (SQLengine+0x3e)
#18 0x7f28e499eb2f (runScenario+0x6f)
#19 0x7f28e499fcfe (MSscheduleClient+0xb6e)
#20 0x7f28e4ae36c2 (doChallenge+0x132)
#21 0x7f28e5900b38 (thread_starter+0x318)
#22 0x7f28e4311609 (start_thread+0xd9)
#23 0x7f28e4234353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `atom_cmp` | https://api.github.com/repos/MonetDB/MonetDB/issues/7477/comments | 1 | 2024-03-17T11:12:12Z | 2024-06-27T13:19:44Z | https://github.com/MonetDB/MonetDB/issues/7477 | 2,190,608,720 | 7,477 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `subrel_bin`.
**To Reproduce**
```sql
SELECT ( WITH x ( x ) AS ( SELECT DISTINCT 1 ) SELECT ( SELECT x FROM x WHERE x = ( SELECT ( CASE WHEN x THEN x END ) WHERE x = ( SELECT x FROM x ) AND x GROUP BY 1 ) ) FROM x );
```
**Backtrace of the Crash**
```c
#0 0x7fe3313089fb (subrel_bin+0x44db)
#1 0x7fe3313124c9 (rel2bin_project+0x1f9)
#2 0x7fe3313051dc (subrel_bin+0xcbc)
#3 0x7fe3313124c9 (rel2bin_project+0x1f9)
#4 0x7fe3313051dc (subrel_bin+0xcbc)
#5 0x7fe331305791 (subrel_bin+0x1271)
#6 0x7fe3313124c9 (rel2bin_project+0x1f9)
#7 0x7fe3313051dc (subrel_bin+0xcbc)
#8 0x7fe331304ff4 (subrel_bin+0xad4)
#9 0x7fe3313124c9 (rel2bin_project+0x1f9)
#10 0x7fe3313051dc (subrel_bin+0xcbc)
#11 0x7fe331305791 (subrel_bin+0x1271)
#12 0x7fe3313124c9 (rel2bin_project+0x1f9)
#13 0x7fe3313051dc (subrel_bin+0xcbc)
#14 0x7fe3313043b9 (output_rel_bin+0xb9)
#15 0x7fe331350a59 (backend_dumpstmt_body+0x2c9)
#16 0x7fe3313506a2 (backend_dumpstmt+0x192)
#17 0x7fe3312ec184 (SQLparser+0xf04)
#18 0x7fe3312eaa0a (SQLengine_+0xa5a)
#19 0x7fe3312e81fe (SQLengine+0x3e)
#20 0x7fe33186cb2f (runScenario+0x6f)
#21 0x7fe33186dcfe (MSscheduleClient+0xb6e)
#22 0x7fe3319b16c2 (doChallenge+0x132)
#23 0x7fe3327ceb38 (thread_starter+0x318)
#24 0x7fe3311df609 (start_thread+0xd9)
#25 0x7fe331102353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `subrel_bin` | https://api.github.com/repos/MonetDB/MonetDB/issues/7476/comments | 0 | 2024-03-17T11:10:51Z | 2024-06-27T13:19:44Z | https://github.com/MonetDB/MonetDB/issues/7476 | 2,190,608,154 | 7,476 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `__nss_database_lookup`.
**To Reproduce**
```sql
SELECT * FROM ( WITH x AS ( SELECT 1 x ) SELECT 1 , ( SELECT x FROM x ) FROM ( x NATURAL JOIN x ) WHERE x ) y;
```
**Backtrace of the Crash**
```c
#0 0x7f18e0e2de12 (__nss_database_lookup+0x20792)
#1 0x7f18e11dd2dd (exp_equal+0xbd)
#2 0x7f18e111c76a (list_distinct+0x11a)
#3 0x7f18e11e655e (check_distinct_exp_names+0x9e)
#4 0x7f18e11b180d (rel_select_exp+0xafd)
#5 0x7f18e11a8820 (rel_subquery+0x5f0)
#6 0x7f18e11a8ae3 (rel_selects+0x233)
#7 0x7f18e1192382 (rel_semantic+0x442)
#8 0x7f18e0f85db3 (sql_symbol2relation+0x93)
#9 0x7f18e0fb2a82 (SQLparser+0x802)
#10 0x7f18e0fb1a0a (SQLengine_+0xa5a)
#11 0x7f18e0faf1fe (SQLengine+0x3e)
#12 0x7f18e1533b2f (runScenario+0x6f)
#13 0x7f18e1534cfe (MSscheduleClient+0xb6e)
#14 0x7f18e16786c2 (doChallenge+0x132)
#15 0x7f18e2495b38 (thread_starter+0x318)
#16 0x7f18e0ea6609 (start_thread+0xd9)
#17 0x7f18e0dc9353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `__nss_database_lookup` | https://api.github.com/repos/MonetDB/MonetDB/issues/7475/comments | 1 | 2024-03-17T11:09:20Z | 2024-06-27T13:19:43Z | https://github.com/MonetDB/MonetDB/issues/7475 | 2,190,607,571 | 7,475 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `VLTgenerator_table_`.
**To Reproduce**
```sql
SELECT ( NULLIF ( -1 , 255 ) ) FROM GENERATE_SERIES ( 2147483647 , -1 );
```
**Backtrace of the Crash**
```c
#0 0x7f8b15f51208 (VLTgenerator_table_+0xa48)
#1 0x7f8b15f50745 (VLTgenerator_table+0x75)
#2 0x7f8b16579dad (runMALsequence+0xe8d)
#3 0x7f8b1657f293 (DFLOWworker+0x4a3)
#4 0x7f8b17501b38 (thread_starter+0x318)
#5 0x7f8b15f12609 (start_thread+0xd9)
#6 0x7f8b15e35353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `VLTgenerator_table_` | https://api.github.com/repos/MonetDB/MonetDB/issues/7474/comments | 0 | 2024-03-17T11:07:00Z | 2024-06-27T13:19:42Z | https://github.com/MonetDB/MonetDB/issues/7474 | 2,190,606,683 | 7,474 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `SQLunionfunc`.
**To Reproduce**
```sql
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 ) ;
```
**Backtrace of the Crash**
```c
#0 0x7f9f5f1d6608 (SQLunionfunc+0x7a8)
#1 0x7f9f5f73fdad (runMALsequence+0xe8d)
#2 0x7f9f5f73eace (runMAL+0xee)
#3 0x7f9f5f1e59d2 (SQLrun+0x142)
#4 0x7f9f5f1e7499 (SQLengineIntern+0xc9)
#5 0x7f9f5f1e40d2 (SQLengine_+0x1122)
#6 0x7f9f5f1e11fe (SQLengine+0x3e)
#7 0x7f9f5f765b2f (runScenario+0x6f)
#8 0x7f9f5f766cfe (MSscheduleClient+0xb6e)
#9 0x7f9f5f8aa6c2 (doChallenge+0x132)
#10 0x7f9f606c7b38 (thread_starter+0x318)
#11 0x7f9f5f0d8609 (start_thread+0xd9)
#12 0x7f9f5effb353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `SQLunionfunc` | https://api.github.com/repos/MonetDB/MonetDB/issues/7473/comments | 1 | 2024-03-17T11:05:50Z | 2024-06-27T13:19:41Z | https://github.com/MonetDB/MonetDB/issues/7473 | 2,190,606,214 | 7,473 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `tail_type`.
**To Reproduce**
```sql
SELECT ( WITH x AS ( SELECT 1 x ) SELECT 1 FROM ( x NATURAL JOIN x ) WHERE x NOT IN ( SELECT CASE WHEN x THEN ( SELECT 1 ) END GROUP BY ( SELECT 1 ) ) );
```
**Backtrace of the Crash**
```c
#0 0x7fb1131cdb37 (tail_type+0x67)
#1 0x7fb1131dc606 (stmt_Nop+0xc26)
#2 0x7fb1131db962 (stmt_unop+0x232)
#3 0x7fb1131a1fc7 (subrel_bin+0x4aa7)
#4 0x7fb1131ab4c9 (rel2bin_project+0x1f9)
#5 0x7fb11319e1dc (subrel_bin+0xcbc)
#6 0x7fb11319e791 (subrel_bin+0x1271)
#7 0x7fb1131ab4c9 (rel2bin_project+0x1f9)
#8 0x7fb11319e1dc (subrel_bin+0xcbc)
#9 0x7fb11319d3b9 (output_rel_bin+0xb9)
#10 0x7fb1131e9a59 (backend_dumpstmt_body+0x2c9)
#11 0x7fb1131e96a2 (backend_dumpstmt+0x192)
#12 0x7fb113185184 (SQLparser+0xf04)
#13 0x7fb113183a0a (SQLengine_+0xa5a)
#14 0x7fb1131811fe (SQLengine+0x3e)
#15 0x7fb113705b2f (runScenario+0x6f)
#16 0x7fb113706cfe (MSscheduleClient+0xb6e)
#17 0x7fb11384a6c2 (doChallenge+0x132)
#18 0x7fb114667b38 (thread_starter+0x318)
#19 0x7fb113078609 (start_thread+0xd9)
#20 0x7fb112f9b353 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023 (or monetdb/dev-builds:default)
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `tail_type` | https://api.github.com/repos/MonetDB/MonetDB/issues/7472/comments | 2 | 2024-03-17T11:04:34Z | 2024-06-27T13:19:41Z | https://github.com/MonetDB/MonetDB/issues/7472 | 2,190,605,532 | 7,472 |
[
"MonetDB",
"MonetDB"
] | sql>select 'a'>1;
+-------+
| %2 |
+=======+
| true |
+-------+
sql>select 1>'a';
conversion of string 'a' to type bte failed. | When the string is on the left, it can run normally. When the string is on the right, it cannot be executed properly. | https://api.github.com/repos/MonetDB/MonetDB/issues/7471/comments | 1 | 2024-03-14T08:48:21Z | 2024-06-27T13:19:40Z | https://github.com/MonetDB/MonetDB/issues/7471 | 2,185,774,710 | 7,471 |
[
"MonetDB",
"MonetDB"
] | sql>select 'a'>1;
+-------+
| %2 |
+=======+
| true |
+-------+
sql>select 1>'a';
conversion of string 'a' to type bte failed. | When the string is on the left, it can run normally. When the string is on the right, it cannot be executed properly. | https://api.github.com/repos/MonetDB/MonetDB/issues/7470/comments | 1 | 2024-03-14T08:42:38Z | 2024-06-27T13:19:39Z | https://github.com/MonetDB/MonetDB/issues/7470 | 2,185,763,143 | 7,470 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The server log (`merovingian.log`) would show: `2024-03-13 12:47:42 MSG merovingian[165]: database 'monetdb' (2297) has crashed with signal SIGABRT (dumped core)`
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 BOOLEAN, c1 VARCHAR);
INSERT INTO t0(c0, c1) VALUES (true, 'a');
INSERT INTO t0(c0, c1) VALUES (true, 'b');
INSERT INTO t0(c0, c1) VALUES (false, 'c');
SELECT t0.c1, t0.c0 FROM t0 WHERE ((CONTAINS(t0.c1, ''))OR(t0.c0)); -- unexpected end of file
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 5447912) (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: @305ec6a4ac34 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when using `CONTAINS` | https://api.github.com/repos/MonetDB/MonetDB/issues/7469/comments | 4 | 2024-03-13T12:59:31Z | 2024-06-27T13:19:38Z | https://github.com/MonetDB/MonetDB/issues/7469 | 2,183,964,870 | 7,469 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It is unexpected that the third query returns an empty result, since the second query returns `true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return the row in the table.
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c1 INTEGER);
INSERT INTO t0 (c1) VALUES (0);
SELECT * FROM t0; -- 0
SELECT (IFNULL(-1460368584, -32678)-(-380279465))<= t0.c1 FROM t0; -- true
SELECT * FROM t0 WHERE (IFNULL(-1460368584, -32678)-(-380279465))<= t0.c1;
-- Expected: 0
-- Actual: empty result
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 9dc1e5d) (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: @5245a54fef58 (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. | Unexpected result when using `IFNULL` with large numbers | https://api.github.com/repos/MonetDB/MonetDB/issues/7468/comments | 1 | 2024-03-08T10:14:38Z | 2024-06-27T13:19:37Z | https://github.com/MonetDB/MonetDB/issues/7468 | 2,175,714,442 | 7,468 |
[
"MonetDB",
"MonetDB"
] | Under the old rules, conversion from temporal WITH TIMEZONE to naïve temporal would render the time the way it looks in UTC. For example, `10:11:12-08:00` (= `18:11:12 UTC`) would become `18:11:12`.
On the default branch, this has been changed to render it the way it looks in the session time zone, so the result might be `20:11:12` if the user is in a +2 time zone.
The issue is that the conversion TIMESTAMPTZ to TIME has not yet been updated.
To reproduce:
```
SET TIME ZONE INTERVAL '01:30' HOUR TO MINUTE;
SELECT CAST(TIMESTAMPTZ '1970-04-17 10:07:41-08:00' AS TIME)
```
On default this still yields `18:07:41` while it should have been `19:37:41`.
| Conversion TIMESTAMPTZ to TIME does not take session TZ into account | https://api.github.com/repos/MonetDB/MonetDB/issues/7467/comments | 1 | 2024-03-04T10:47:33Z | 2024-06-27T13:19:37Z | https://github.com/MonetDB/MonetDB/issues/7467 | 2,166,534,145 | 7,467 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The server log (`merovingian.log`) would show: `2024-02-27 09:53:35 MSG merovingian[159]: database 'monetdb' (2897) has crashed with signal SIGABRT (dumped core)`
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
DROP TABLE t1 CASCADE;
CREATE TABLE t0(c1 INT);
CREATE TABLE t1(c1 VARCHAR(500));
CREATE VIEW v0(c0) AS SELECT (('a')||('b')) FROM t1;
SELECT * FROM t1, t0 INNER JOIN v0 ON t0.c1 WHERE CONTAINS((t1.c1 > 'a'), t0.c1) UNION ALL SELECT * FROM t1, t0 INNER JOIN v0 ON t0.c1 WHERE (NOT CONTAINS((t1.c1 > 'a'), t0.c1)); -- unexpected end of file
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: c9e0977) (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: @618e73c727b6 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when `INNER JOIN` with `CONTAINS` | https://api.github.com/repos/MonetDB/MonetDB/issues/7466/comments | 2 | 2024-02-27T15:49:48Z | 2024-06-27T13:19:36Z | https://github.com/MonetDB/MonetDB/issues/7466 | 2,156,953,128 | 7,466 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test case below. It is unexpected that the third query returns `true`, since the second query returns `null`, which means that the `WHERE` clause in the third query should be evaluated to `null` and thus return an empty result.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
DROP TABLE t1 CASCADE;
CREATE TABLE t1(c0 BOOLEAN);
INSERT INTO t1 (c0) VALUES (true);
SELECT * FROM t1; -- true
SELECT (((t1.c0 NOT IN (true)))=((t1.c0 BETWEEN true AND NULL))) FROM t1; -- null
SELECT * FROM t1 WHERE (((t1.c0 NOT IN (true)))=((t1.c0 BETWEEN true AND NULL)));
-- Expected: Empty set
-- Actual: true
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: c9e0977) (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: @618e73c727b6 (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. | Unexpected result when using `NULL` in `BETWEEN` | https://api.github.com/repos/MonetDB/MonetDB/issues/7465/comments | 1 | 2024-02-27T15:48:54Z | 2024-06-27T13:19:35Z | https://github.com/MonetDB/MonetDB/issues/7465 | 2,156,951,107 | 7,465 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
Hello all,
ADBC is a database connection standard (like ODBC or JDBC) but specifically designed for columnar storage (so database like DuckDB, Clickhouse, MonetDB, Vertica...). This is typically the kind of stuff that can make MonetDB way faster in user experience.
more info in https://arrow.apache.org/blog/2023/01/05/introducing-arrow-adbc/
**Describe the solution you'd like**
Implementation of ADBC for monetdb
**Describe alternatives you've considered**
N/A
**Additional context**
Here the benchmark with DuckDB
https://duckdb.org/2023/08/04/adbc.html

| ADBC connection standard feature | https://api.github.com/repos/MonetDB/MonetDB/issues/7464/comments | 4 | 2024-02-25T10:36:55Z | 2024-06-27T13:19:34Z | https://github.com/MonetDB/MonetDB/issues/7464 | 2,152,701,363 | 7,464 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It is unexpected that the third query returns `1 1`, since there is no `true` in the second query, and thus the third query should return an empty result. Anyway, the predicate cannot to be evaluated to `true` at the same time, and one of the third or the forth query should return an empty result.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
CREATE TABLE t0(c0 INT, c1 INT);
INSERT INTO t0 (c0) VALUES (0);
INSERT INTO t0 (c0, c1) VALUES (1, 1);
SELECT * FROM t0; -- 0 null, 1 1
SELECT (t0.c1)AND(CAST(CONTAINS(0, t0.c0) AS VARCHAR)) FROM t0; -- null, false
SELECT * FROM t0 WHERE ((t0.c1)AND(CAST(CONTAINS(0, t0.c0) AS VARCHAR))); -- 1 1 (unexpected, should be empty)
SELECT * FROM t0 WHERE (NOT ((t0.c1)AND(CAST(CONTAINS(0, t0.c0) AS VARCHAR)))); -- 1 1
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 5f31415) (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: @97de17abeb72 (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. | Unexpected result when using `CONTAINS` and type casting | https://api.github.com/repos/MonetDB/MonetDB/issues/7463/comments | 2 | 2024-02-22T07:48:24Z | 2024-06-27T13:19:33Z | https://github.com/MonetDB/MonetDB/issues/7463 | 2,148,434,453 | 7,463 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The last lines of the server log (`merovingian.log`):
```
2024-02-22 06:50:09 ERR monetdb[1347]: #client9727: exp_bin: CRITICAL: Could not find %3.%3
2024-02-22 06:50:09 ERR monetdb[1347]: #client9727: exp_bin: ERROR: Query: 'select t0.c1, t0.c0 from t0 where (((t0.c1 between -1 and 1))or((t0.c1 between -1 and ('b' in (t0.c1, t0.c0)))));'
2024-02-22 06:50:09 ERR monetdb[1347]: mserver5: /app/MonetDB/sql/backends/monet5/rel_bin.c:1681: exp_bin: Assertion `s' failed.
2024-02-22 06:50:12 MSG merovingian[159]: database 'monetdb' (1347) has crashed with signal SIGABRT (dumped core)
```
**To Reproduce**
To reproduce, execute the mclient using `docker exec -i monetdb-test mclient -E UTF-8 -d monetdb` and copy the following queries:
```sql
DROP TABLE t0 CASCADE;
CREATE TABLE t0(c0 VARCHAR(500), c1 VARCHAR(500));
INSERT INTO t0(c1) VALUES ('a');
SELECT t0.c1, t0.c0 FROM t0 WHERE (((t0.c1 BETWEEN -1 AND 1))OR((t0.c1 BETWEEN -1 AND ('b' IN (t0.c1, t0.c0)))));
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 5f31415) (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: @97de17abeb72 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when using `BETWEEN AND` | https://api.github.com/repos/MonetDB/MonetDB/issues/7462/comments | 2 | 2024-02-22T07:47:18Z | 2024-06-27T13:19:32Z | https://github.com/MonetDB/MonetDB/issues/7462 | 2,148,432,795 | 7,462 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The last lines of the server log (`merovingian.log`):
```
2024-02-20 13:39:53 ERR monetdb[624]: #client9246: GDKstrFromStr: ERROR: not a Unicode code point escape
2024-02-20 13:39:53 ERR monetdb[624]: #client9246: createExceptionInternal: ERROR: MALException:mal.interpreter:GDK reported error: GDKstrFromStr: not a Unicode code point escape
2024-02-20 13:39:53 ERR monetdb[624]: mserver5: /app/MonetDB/sql/backends/monet5/sql_cast.c:137: SQLbatstr_cast: Assertion `digits >= 0' failed.
2024-02-20 13:39:54 MSG merovingian[159]: database 'monetdb' (624) has crashed with signal SIGABRT (dumped core)
```
**To Reproduce**
Sorry for the long query, we haven't implemented a reducer for crashes yet, and it's hard for me to manually reduce it more. Sometimes I'll encounter the error message: `Could not allocate space` from `mclient` when trying to reduce the query, not sure if it's expected.
To reproduce, execute the mclient using `docker exec -i monetdb-test mclient -E UTF-8 -d monetdb` and copy the following queries:
```sql
DROP TABLE IF EXISTS t0 CASCADE;
DROP TABLE IF EXISTS t1 CASCADE;
CREATE TABLE t0(c0 BOOLEAN, c1 BOOLEAN, PRIMARY KEY(c0));
CREATE TABLE t1(c0 INTEGER, c1 INT, PRIMARY KEY(c0));
INSERT INTO t0(c1) VALUES (-2041868105), (true);
INSERT INTO t0(c1, c0) VALUES (-1820721628, -337528041);
INSERT INTO t0(c1) VALUES (true);
INSERT INTO t1(c0) VALUES (true);
SELECT * FROM t1, t0;
SELECT * FROM t1, t0 WHERE (CASE t0.c0 WHEN (t0.c0 IN (((t1.c0)<=(true)))) THEN (((-953136241) IS NOT NULL) NOT BETWEEN (CASE true WHEN '_hf4{r' THEN t0.c0 WHEN '\Uwc0g8g' THEN t1.c1 WHEN false THEN '' ELSE t1.c1 END ) AND 1239880767) ELSE t0.c1 END );
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: d333af8) (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: @6421299871b6 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash by potentially use of bad escape characters | https://api.github.com/repos/MonetDB/MonetDB/issues/7461/comments | 1 | 2024-02-20T13:45:21Z | 2024-06-27T13:19:31Z | https://github.com/MonetDB/MonetDB/issues/7461 | 2,144,420,052 | 7,461 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The server log (`merovingian.log`) would show: `merovingian[159]: database 'monetdb' (2328) has crashed with signal SIGABRT (dumped core)`
**To Reproduce**
Start command: `docker exec -it monetdb-test mclient -E UTF-8 -d monetdb`
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0( c2 BOOLEAN);
CREATE VIEW v0(c0) AS SELECT 1 FROM t0;
INSERT INTO t0(c2) VALUES (true);
SELECT * FROM t0, v0 WHERE CAST((t0.c2 BETWEEN 0 AND v0.c0) AS BOOLEAN); -- unexpected end of file
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: b1a4de2) (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: @dc91f6923a17 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when using `CAST` and `BETWEEN AND` | https://api.github.com/repos/MonetDB/MonetDB/issues/7460/comments | 1 | 2024-02-20T00:57:11Z | 2024-06-27T13:19:30Z | https://github.com/MonetDB/MonetDB/issues/7460 | 2,143,345,745 | 7,460 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It would crash the monetdb server. The server log (`merovingian.log`) would show: `MSG merovingian[159]: database 'monetdb' (2154) has crashed with signal SIGSEGV (dumped core)`
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 INTEGER, c1 VARCHAR(500));
SELECT * FROM t0 ORDER BY CONTAINS(((CASE '1' WHEN t0.c0 THEN '' ELSE t0.c0 END ) NOT BETWEEN 0 AND t0.c0>=t0.c1), t0.c1) DESC; -- unexpected end of file
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: afd0b37) (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: @45139603d730 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when using `CONTAINS` in `ORDER BY` clause | https://api.github.com/repos/MonetDB/MonetDB/issues/7459/comments | 1 | 2024-02-19T14:08:37Z | 2024-06-27T13:19:29Z | https://github.com/MonetDB/MonetDB/issues/7459 | 2,142,459,054 | 7,459 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test case below. It is unexpected that the third query returns no row, since the second query returns `true`, which means that the predicate `t0.c0 >= SIGN(t0.c0)` should be evaluated to `true` and thus return all the rows in the table.
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 INTEGER);
INSERT INTO t0 (c0) VALUES (0);
SELECT * FROM t0; -- 0
SELECT (t0.c0 >= SIGN(t0.c0)) FROM t0; -- true
SELECT * FROM t0 WHERE (t0.c0 >= SIGN(t0.c0));
-- Expected: 0
-- Actual: Empty result
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 67c6941) (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: @581bd6d184aa (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. | Unexpected result when using `SIGN` | https://api.github.com/repos/MonetDB/MonetDB/issues/7458/comments | 1 | 2024-02-19T04:44:32Z | 2024-06-27T13:19:28Z | https://github.com/MonetDB/MonetDB/issues/7458 | 2,141,491,603 | 7,458 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test case below. It is unexpected that the third query returns 1 row, since the second query returns two rows of `true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return all the rows in the table.
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 VARCHAR(500), c1 BOOLEAN);
INSERT INTO t0 (c0, c1) VALUES ('a', false);
INSERT INTO t0 (c0) VALUES ('b');
SELECT * FROM t0; -- a false, b null
SELECT (1 AND 3) FROM t0; -- true, true
SELECT * FROM t0 WHERE (1 AND 3);
-- Expected: a false, b null (2 rows)
-- Actual: a false (1 row)
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: d74d3e6) (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: @48d5e0fbdd97 (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. | Unexpected result when using `AND` with `INTEGER` | https://api.github.com/repos/MonetDB/MonetDB/issues/7457/comments | 1 | 2024-02-18T08:40:54Z | 2024-06-27T13:19:27Z | https://github.com/MonetDB/MonetDB/issues/7457 | 2,140,837,501 | 7,457 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It would crash the monetdb server. The server log (`merovingian.log`) would show: `database 'monetdb' (1364) has crashed with signal SIGSEGV (dumped core)`
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
DROP VIEW IF EXISTS v0 CASCADE;
CREATE TABLE t0(c0 BOOLEAN);
CREATE VIEW v0(c0) AS SELECT 1 FROM t0 HAVING true ORDER BY ((false)OR(false));
SELECT * FROM t0 INNER JOIN v0 ON v0.c0; -- unexpected end of file
```
**Expected behavior**
Should return an error message, or return the correct result.
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 6654ce9) (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: @cb50362562d1 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc
Linking : /usr/bin/ld
```
**Issue labeling**
Bug
**Additional context**
Kindly inform me if you need more information (e.g. error trace, etc.) | Crash when `INNER JOIN` with `VIEW` | https://api.github.com/repos/MonetDB/MonetDB/issues/7456/comments | 3 | 2024-02-12T03:36:34Z | 2024-06-27T13:19:26Z | https://github.com/MonetDB/MonetDB/issues/7456 | 2,129,364,845 | 7,456 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the third query returns 9 rows, since the second query returns 3 true and 6 false, which means that the `WHERE` clause in the third query should be evaluated to 3 true and thus return 3 rows in the table.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
CREATE TABLE t0(c0 VARCHAR, c1 VARCHAR(500));
CREATE VIEW v0(c0) AS SELECT true FROM t0;
INSERT INTO t0 (c0, c1) VALUES ('', 0);
INSERT INTO t0 (c0) VALUES ('a');
INSERT INTO t0 (c0) VALUES ('b');
SELECT * FROM v0, t0; -- 9 rows
SELECT (t0.c0||true BETWEEN v0.c0 AND v0.c0) FROM v0, t0; -- 3 true, 6 false
SELECT * FROM v0, t0 WHERE (t0.c0||true BETWEEN v0.c0 AND v0.c0);
-- Expected: 3 rows
-- Actual: 9 rows
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 2b40c2c) (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: @70bf17df2bbc (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. | Unexpected result when using `BETWEEN` with `BOOLEAN` values | https://api.github.com/repos/MonetDB/MonetDB/issues/7455/comments | 1 | 2024-02-10T01:59:59Z | 2024-06-27T13:19:25Z | https://github.com/MonetDB/MonetDB/issues/7455 | 2,128,045,179 | 7,455 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Recently the MonetDB team announced that it would no longer post on twitter. But the welcome message of the mclient tool still points users to follow monetdb on twitter
**To Reproduce**
Open mclient from the latest release
**Expected behavior**
Any message without a reference to twitter
**Software versions**
- MonetDB version number [Dec2023]
- OS and version: Checked on linux
- Installed from release package
| mclient still shows link to twitter | https://api.github.com/repos/MonetDB/MonetDB/issues/7454/comments | 0 | 2024-02-09T07:38:59Z | 2024-06-27T13:19:24Z | https://github.com/MonetDB/MonetDB/issues/7454 | 2,126,625,736 | 7,454 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
The msqldump cannot be recovered if a partition table has a column option.
**To Reproduce**
Create a basic database instance `dumpdb` and init the sys schema with a merge and partition table using init_db.sql.
Dump using `msqldump -ddumpdb > dumpdb.sql`.
Create another empty basic database instance `recoverdb` and load using `mclient -drecoverdb < dumpdb.sql` fails
**Expected behavior**
Recover is successful
**Screenshots**
init_db.sql:
```
CREATE MERGE TABLE runcat
(id INT NOT NULL
,datapoints INT NOT NULL
,active BOOLEAN NOT NULL
,ra_deg DOUBLE NOT NULL
,dec_deg DOUBLE NOT NULL
)
;
CREATE TABLE "rc_zone_42"
(id INT NOT NULL
,datapoints INT NOT NULL
,active BOOLEAN NOT NULL DEFAULT TRUE
,ra_deg DOUBLE NOT NULL
,dec_deg DOUBLE NOT NULL
)
;
ALTER TABLE runcat ADD TABLE "rc_zone_42";
```
**Software versions**
- MonetDB version Dec2023 branch
- OS and version: F38
- self-installed and compiled
| Cannot recover an msqldump | https://api.github.com/repos/MonetDB/MonetDB/issues/7453/comments | 2 | 2024-02-08T12:11:07Z | 2024-06-27T13:19:23Z | https://github.com/MonetDB/MonetDB/issues/7453 | 2,125,036,064 | 7,453 |
[
"MonetDB",
"MonetDB"
] | The MonetDB official site https://www.monetdb.org/ is not available now, what's wrong with it? | Is MonetDB official site not available? | https://api.github.com/repos/MonetDB/MonetDB/issues/7452/comments | 2 | 2024-02-07T03:05:30Z | 2024-02-07T12:24:56Z | https://github.com/MonetDB/MonetDB/issues/7452 | 2,122,091,631 | 7,452 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the third query return `0 null`, since the second query returns `true, true`, which means that the `WHERE` clause in the third query should be evaluated to `true, true` and thus return two rows in the table. Besides, if change the columns to wildcard (`*`), the query returns two rows as expected.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
DROP TABLE t1 CASCADE;
CREATE TABLE t0(c0 VARCHAR, PRIMARY KEY(c0)); -- PK is needed
CREATE TABLE t1(c1 INTEGER, c2 VARCHAR(500));
INSERT INTO t0 ( c0) VALUES ('a');
INSERT INTO t0 (c0) VALUES (false);
INSERT INTO t1 ( c1) VALUES ( 0);
SELECT t1.c1, t1.c2 FROM t1, t0; -- 0 null, 0 null
SELECT (NOT CAST((true BETWEEN t1.c2 AND t0.c0) AS VARCHAR)) FROM t1, t0; -- true, true
SELECT t1.c1, t1.c2 FROM t1, t0 WHERE (NOT CAST((true BETWEEN t1.c2 AND t0.c0) AS VARCHAR));
-- Expected: 0 null, 0 null (2 rows)
-- Actual: 0 null (1 rows)
-- This query could return expected result
SELECT * FROM t1, t0 WHERE (NOT CAST((true BETWEEN t1.c2 AND t0.c0) AS VARCHAR)); -- 2 rows
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 1a6a23b) (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: @fdb2b8a5a74e (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. | Unexpected result when using `BETWEEN` and `CAST` | https://api.github.com/repos/MonetDB/MonetDB/issues/7451/comments | 1 | 2024-01-31T07:30:54Z | 2024-06-27T13:19:22Z | https://github.com/MonetDB/MonetDB/issues/7451 | 2,109,459,690 | 7,451 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the query return `true`, since there should be no row in `VIEW` with `NULL` as the `WHERE` predicate. If we remove the `GROUP BY` clause for the `VIEW`, the query returns empty result as expected.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
DROP VIEW v0 CASCADE;
CREATE TABLE t0(c0 INT);
INSERT INTO t0 ( c0) VALUES (false);
CREATE VIEW v0(c0) AS SELECT true FROM t0 WHERE NULL GROUP BY t0.c0, true;
SELECT * FROM v0;
-- Expected: Empty
-- Actual: true
-- Or consider this one:
SELECT * FROM v0 WHERE true; -- true (if the true is expected)
SELECT * FROM v0 WHERE true UNION ALL SELECT * FROM v0 WHERE (NOT true); -- empty (unexpected)
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 1a6a23b) (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: @fdb2b8a5a74e (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. | Unexpected result when `CREATE VIEW` with `WHERE NULL` | https://api.github.com/repos/MonetDB/MonetDB/issues/7450/comments | 1 | 2024-01-31T07:30:10Z | 2024-06-27T13:19:21Z | https://github.com/MonetDB/MonetDB/issues/7450 | 2,109,458,692 | 7,450 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
On a column that has a persistent hash, anti-select (and anti-join) resorts to full scan.
**To Reproduce**
Create a column with unique values
```sql
\t clock
set optimizer='sequential_pipe';
create table t as select cast(uuid() as string) as u from generate_series(0,10000000);
analyze sys.t; -- this creates a hash table
```
Test a point select :
```sql
trace select * from t where u = 'a0a3139d-3742-4ae3-a757-ed28386e4f05' limit 1;
```
The point select uses the hash table:
```
+---+
| u |
+===+
+---+
0 tuples
clk: 1.654 ms
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| usec | statement |
+======+=================================================================================================================================================================================+
| 2 | X_1=0@0:void := querylog.define("trace select * from t where u = 'a0a3139d-3742-4ae3-a757-ed28386e4f05' limit 1;":str, "sequential_pipe":str, 22:int); |
| 0 | X_4=0:int := sql.mvc(); |
| 7 | C_5=[10000000]:bat[:oid] := sql.tid(X_4=0:int, "sys":str, "t":str); |
| 7 | X_8=[10000000]:bat[:str] := sql.bind(X_4=0:int, "sys":str, "t":str, "u":str, 0:int); |
| 5 | (X_11=[0]:bat[:oid], X_12=[0]:bat[:str]) := sql.bind(X_4=0:int, "sys":str, "t":str, "u":str, 2:int); |
| 20 | C_80=[0]:bat[:oid] := algebra.thetaselect(X_8=[10000000]:bat[:str], C_5=[10000000]:bat[:oid], "a0a3139d-3742-4ae3-a757-ed28386e4f05":str, "==":str); # hashselect on parent |
| 5 | C_81=[0]:bat[:oid] := algebra.thetaselect(X_12=[0]:bat[:str], nil:bat[:oid], "a0a3139d-3742-4ae3-a757-ed28386e4f05":str, "==":str); # select: trivially empty |
| 0 | C_17=[0]:bat[:oid] := sql.subdelta(C_80=[0]:bat[:oid], C_5=[10000000]:bat[:oid], X_11=[0]:bat[:oid], C_81=[0]:bat[:oid]); |
| 7 | X_19=[0]:bat[:str] := sql.projectdelta(C_17=[0]:bat[:oid], X_8=[10000000]:bat[:str], X_11=[0]:bat[:oid], X_12=[0]:bat[:str]); |
| 3 | C_27=[0]:bat[:oid] := algebra.subslice(X_19=[0]:bat[:str], 0:lng, 0:lng); |
| 5 | X_28=[0]:bat[:str] := algebra.projection(C_27=[0]:bat[:oid], X_19=[0]:bat[:str]); |
| 4 | X_30=[1]:bat[:str] := bat.pack("sys.t":str); |
| 4 | X_31=[1]:bat[:str] := bat.pack("u":str); |
| 4 | X_32=[1]:bat[:str] := bat.pack("clob":str); |
| 3 | X_33=[1]:bat[:int] := bat.pack(0:int); |
| 19 | X_29=1:int := sql.resultSet(X_30=[1]:bat[:str], X_31=[1]:bat[:str], X_32=[1]:bat[:str], X_33=[1]:bat[:int], X_33=[1]:bat[:int], X_28=[0]:bat[:str]); |
+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
16 tuples
clk: 1.723 ms
```
Test a point anti-select:
```sql
trace select * from t where u <> 'a0a3139d-3742-4ae3-a757-ed28386e4f05' limit 1;
```
The point anti-select uses a full scan:
```
+--------------------------------------+
| u |
+======================================+
| 2c383fbe-eece-4021-8a41-c0290424f7c3 |
+--------------------------------------+
1 tuple
clk: 534.385 ms
+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| usec | statement |
+========+=========================================================================================================================================================================================+
| 2 | X_1=0@0:void := querylog.define("trace select * from t where u <> 'a0a3139d-3742-4ae3-a757-ed28386e4f05' limit 1;":str, "sequential_pipe":str, 22:int); |
| 0 | X_4=0:int := sql.mvc(); |
| 5 | C_5=[10000000]:bat[:oid] := sql.tid(X_4=0:int, "sys":str, "t":str); |
| 6 | X_8=[10000000]:bat[:str] := sql.bind(X_4=0:int, "sys":str, "t":str, "u":str, 0:int); |
| 3 | (X_11=[0]:bat[:oid], X_12=[0]:bat[:str]) := sql.bind(X_4=0:int, "sys":str, "t":str, "u":str, 2:int); |
| 532823 | C_80=[10000000]:bat[:oid] := algebra.thetaselect(X_8=[10000000]:bat[:str], C_5=[10000000]:bat[:oid], "a0a3139d-3742-4ae3-a757-ed28386e4f05":str, "!=":str); # select: fullscan anti |
| 15 | C_81=[0]:bat[:oid] := algebra.thetaselect(X_12=[0]:bat[:str], nil:bat[:oid], "a0a3139d-3742-4ae3-a757-ed28386e4f05":str, "!=":str); # select: trivially empty |
| 2 | C_17=[10000000]:bat[:oid] := sql.subdelta(C_80=[10000000]:bat[:oid], C_5=[10000000]:bat[:oid], X_11=[0]:bat[:oid], C_81=[0]:bat[:oid]); |
| 10 | X_19=[10000000]:bat[:str] := sql.projectdelta(C_17=[10000000]:bat[:oid], X_8=[10000000]:bat[:str], X_11=[0]:bat[:oid], X_12=[0]:bat[:str]); |
| 3 | C_27=[1]:bat[:oid] := algebra.subslice(X_19=[10000000]:bat[:str], 0:lng, 0:lng); |
| 6 | X_28=[1]:bat[:str] := algebra.projection(C_27=[1]:bat[:oid], X_19=[10000000]:bat[:str]); |
| 5 | X_30=[1]:bat[:str] := bat.pack("sys.t":str); |
| 4 | X_31=[1]:bat[:str] := bat.pack("u":str); |
| 4 | X_32=[1]:bat[:str] := bat.pack("clob":str); |
| 4 | X_33=[1]:bat[:int] := bat.pack(0:int); |
| 32 | X_29=3:int := sql.resultSet(X_30=[1]:bat[:str], X_31=[1]:bat[:str], X_32=[1]:bat[:str], X_33=[1]:bat[:int], X_33=[1]:bat[:int], X_28=[1]:bat[:str]); |
+--------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
16 tuples
clk: 534.527 ms
```
**Expected behavior**
Use the existing hash.
**Software versions**
- MonetDB version number v11.49.2 (hg id: fc35cd120e)
- OS and version: Fedora 39
- self-installed and compiled
| anti-select uses full scan | https://api.github.com/repos/MonetDB/MonetDB/issues/7449/comments | 3 | 2024-01-26T14:54:03Z | 2024-01-26T17:18:35Z | https://github.com/MonetDB/MonetDB/issues/7449 | 2,102,349,491 | 7,449 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test case below. It is unexpected that the third query returns empty table, since the second query returns `true`, which means that the `WHERE` clause of `AND` `OR` chain in the third query should be evaluated to `true` and thus return the row in the table.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
CREATE TABLE t0(c0 BOOLEAN, c1 VARCHAR);
INSERT INTO t0 (c0, c1) VALUES (true, true);
CREATE INDEX i0 ON t0(c1 , c0 );
SELECT * FROM t0; -- true, true
SELECT (t0.c1=(t0.c0 OR true))AND(t0.c0) FROM t0; -- true
SELECT * FROM t0 WHERE ((t0.c1=(t0.c0 OR true))AND(t0.c0));
-- expected: true, true
-- actual: empty table
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 25da4f1) (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: @08cc21708292 (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. | Unexpected result when using `AND`/`OR` chain | https://api.github.com/repos/MonetDB/MonetDB/issues/7448/comments | 0 | 2024-01-24T15:47:19Z | 2024-06-27T13:19:20Z | https://github.com/MonetDB/MonetDB/issues/7448 | 2,098,560,070 | 7,448 |
[
"MonetDB",
"MonetDB"
] |
**Describe the bug**
Consider the test cases below. It is unexpected that the third query returns empty table, since the second query returns `true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return the in the table after join.
**To Reproduce**
```sql
DROP TABLE t0 CASCADE;
DROP TABLE t1 CASCADE;
CREATE TABLE t0(c0 INTEGER, c1 BOOLEAN, PRIMARY KEY(c0));
CREATE TABLE t1(c1 INTEGER);
INSERT INTO t1 (c1) VALUES (null);
INSERT INTO t0 (c0, c1) VALUES (-1, false);
SELECT t0.c0 FROM t0 INNER JOIN t1 ON (t0.c1 NOT BETWEEN t1.c1 AND t0.c0); -- -1
SELECT (t1.c1>1) IS NULL FROM t0 INNER JOIN t1 ON (t0.c1 NOT BETWEEN t1.c1 AND t0.c0); -- true
SELECT t0.c0 FROM t0 INNER JOIN t1 ON (t0.c1 NOT BETWEEN t1.c1 AND t0.c0) WHERE (t1.c1>1) IS NULL;
-- expected: -1
-- actual: empty table
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
> docker exec monetdb-test mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 25da4f1) (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: @08cc21708292 (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. | Unexpected result when using `BETWEEN` in `INNER JOIN` | https://api.github.com/repos/MonetDB/MonetDB/issues/7447/comments | 0 | 2024-01-24T15:47:05Z | 2024-06-27T13:19:19Z | https://github.com/MonetDB/MonetDB/issues/7447 | 2,098,559,627 | 7,447 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
Hello all. Monet DB is not supported by Grafana, which is a cool dataviz tool (and also opensource). I ask the Grafana teams for such a support and here their answer
`Thanks for opening this issue.
I searched on this and there have been some posts on integrating MonetDB with Grafana but did not find a final answer and the reason is that, MonetDB has not yet provided/created a plugin/Datasource that can be easily integrated with Grafana.
So I see the following 2 possibilities here:
1- Asking MonetDB to provide a plugin/datasource to get easily integrated in the Grafana environment. This might be a feature-request or they might have been working on it but not yet officially released it yet.
2- Create it by yourself and ask for some help and guidance from the Grafana Plugin Development using this [link](https://community.grafana.com/c/plugin-development/30)
I hope this helps.`
**Describe the solution you'd like**
A MonetDB plugin for Grafana
**Describe alternatives you've considered**
None
**Additional context**
The Grafana thread : https://github.com/grafana/grafana/issues/79922
| Grafana Plugin | https://api.github.com/repos/MonetDB/MonetDB/issues/7446/comments | 3 | 2024-01-23T19:50:05Z | 2024-06-28T10:04:24Z | https://github.com/MonetDB/MonetDB/issues/7446 | 2,096,867,026 | 7,446 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
the table cannot be created because the reserved word is incorrectly set


**Software versions**
- MonetDB version number:Jun2023 Feature Release (11.47.3)
- OS and version: Ubuntu 20.06
- self-installed and compiled | [bug] the table cannot be created because the reserved word is incorrectly set | https://api.github.com/repos/MonetDB/MonetDB/issues/7444/comments | 2 | 2024-01-17T11:08:59Z | 2024-06-27T13:19:17Z | https://github.com/MonetDB/MonetDB/issues/7444 | 2,085,956,262 | 7,444 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `merge_table_prune_and_unionize`.
**To Reproduce**
```sql
CREATE MERGE TABLE a (b int, subtable2 varchar(32)) PARTITION BY VALUES ON (b) ;
CREATE MERGE TABLE t1 (c int, d varchar(32)) PARTITION BY RANGE ON (c) ;
CREATE TABLE id (t1907060_1 int, age varchar(32)) ;
ALTER TABLE a ADD TABLE id AS PARTITION IN ('1', '2', '3') ;
ALTER TABLE t1 ADD TABLE a AS PARTITION FROM '0' TO '100' ;
SELECT c, d FROM t1 ;
```
**Backtrace of the Crash**
```c
#0 0x7eff4132d1ff (merge_table_prune_and_unionize+0x2df)
#1 0x7eff4132ee82 (merge_table_prune_and_unionize+0x1f62)
#2 0x7eff4132cdd5 (rel_merge_table_rewrite_+0x6e5)
#3 0x7eff413081ef (rel_visitor_topdown+0x27f)
#4 0x7eff413085a5 (rel_visitor_topdown+0x635)
#5 0x7eff4132bb5b (rel_merge_table_rewrite+0x3b)
#6 0x7eff4132c2da (rel_optimizer+0x75a)
#7 0x7eff4128ff22 (sql_processrelation+0x82)
#8 0x7eff41099e1b (sql_symbol2relation+0x1bb)
#9 0x7eff410c6b84 (SQLparser+0x624)
#10 0x7eff410c5cbc (SQLengine_+0xa5c)
#11 0x7eff410c34fe (SQLengine+0x3e)
#12 0x7eff416412cf (runScenario+0x6f)
#13 0x7eff416424de (MSscheduleClient+0xb6e)
#14 0x7eff41779182 (doChallenge+0x132)
#15 0x7eff424a28a7 (thread_starter+0xc7)
#16 0x7eff40fbd609 (start_thread+0xd9)
#17 0x7eff40ee0133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `merge_table_prune_and_unionize` | https://api.github.com/repos/MonetDB/MonetDB/issues/7443/comments | 0 | 2024-01-17T06:55:28Z | 2024-06-27T13:19:16Z | https://github.com/MonetDB/MonetDB/issues/7443 | 2,085,526,140 | 7,443 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `mat_join2`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v2 , v1 ) as ( select i , cast ( i as string ) from generate_series ( 1 , 1000 ) as t ( i ) );
INSERT INTO v0 ( v1 ) SELECT v0 . v2 FROM v0 , v0 AS sum_f1;
DELETE FROM v0 WHERE ( 10 );
SELECT count ( v1 ) FROM v0 WHERE v2 IN ( SELECT ( row_number ( ) OVER ( ) ) FROM v0 ) ;
```
**Backtrace of the Crash**
```c
#0 0x7f0194e3db82 (mat_join2+0x582)
#1 0x7f0194e31582 (OPTmergetableImplementation+0x36d2)
#2 0x7f0194e557a2 (OPTwrapper+0x2c2)
#3 0x7f0194c1da7f (optimizeMALBlock+0x1cf)
#4 0x7f0194707b63 (SQLoptimizeQuery+0x353)
#5 0x7f01946a163d (SQLparser+0x10dd)
#6 0x7f019469fcbc (SQLengine_+0xa5c)
#7 0x7f019469d4fe (SQLengine+0x3e)
#8 0x7f0194c1b2cf (runScenario+0x6f)
#9 0x7f0194c1c4de (MSscheduleClient+0xb6e)
#10 0x7f0194d53182 (doChallenge+0x132)
#11 0x7f0195a7c8a7 (thread_starter+0xc7)
#12 0x7f0194597609 (start_thread+0xd9)
#13 0x7f01944ba133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `mat_join2` | https://api.github.com/repos/MonetDB/MonetDB/issues/7442/comments | 0 | 2024-01-17T06:54:51Z | 2024-06-27T13:19:15Z | https://github.com/MonetDB/MonetDB/issues/7442 | 2,085,525,408 | 7,442 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `is_column_unique`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 INTEGER );
SELECT 1 IS NOT NULL FROM v0 ORDER BY AVG ( max ( 286 ) ) OVER ( ORDER BY 111 NULLS FIRST ) NULLS LAST ;
SELECT DISTINCT * FROM v0 AS cor0 WHERE ( 2 ) IN ( v1 / - v1 , v1 ) ;
```
**Backtrace of the Crash**
```c
#0 0x7f7ab2d92dae (is_column_unique+0x3e)
#1 0x7f7ab2e7caa0 (bind_col_exp+0x60)
#2 0x7f7ab2e7bfb6 (rel_base_bind_column+0x196)
#3 0x7f7ab2e6c64b (rel_bind_column+0x19b)
#4 0x7f7ab2e1fc7d (rel_column_ref+0xcd)
#5 0x7f7ab2e2633f (rel_value_exp2+0x41f)
#6 0x7f7ab2e1a1fc (rel_value_exp+0xdc)
#7 0x7f7ab2e26c32 (rel_value_exp2+0xd12)
#8 0x7f7ab2e1a1fc (rel_value_exp+0xdc)
#9 0x7f7ab2e1d6a8 (rel_in_value_exp+0x2a8)
#10 0x7f7ab2e21c8e (rel_logical_exp+0x1be)
#11 0x7f7ab2e34203 (rel_select_exp+0x113)
#12 0x7f7ab2e2bc20 (rel_subquery+0x5f0)
#13 0x7f7ab2e2bee3 (rel_selects+0x233)
#14 0x7f7ab2e12d72 (rel_semantic+0x442)
#15 0x7f7ab2c07cf3 (sql_symbol2relation+0x93)
#16 0x7f7ab2c34b84 (SQLparser+0x624)
#17 0x7f7ab2c33cbc (SQLengine_+0xa5c)
#18 0x7f7ab2c314fe (SQLengine+0x3e)
#19 0x7f7ab31af2cf (runScenario+0x6f)
#20 0x7f7ab31b04de (MSscheduleClient+0xb6e)
#21 0x7f7ab32e7182 (doChallenge+0x132)
#22 0x7f7ab40108a7 (thread_starter+0xc7)
#23 0x7f7ab2b2b609 (start_thread+0xd9)
#24 0x7f7ab2a4e133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `is_column_unique` | https://api.github.com/repos/MonetDB/MonetDB/issues/7441/comments | 1 | 2024-01-17T06:54:13Z | 2024-06-27T13:19:14Z | https://github.com/MonetDB/MonetDB/issues/7441 | 2,085,524,722 | 7,441 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `gc_col`.
**To Reproduce**
```sql
CREATE MERGE TABLE t_base (dt_uom int, subtable1 int, a varchar(32), b real) PARTITION BY VALUES ON (a) ;
start transaction ;
ALTER TABLE t_base DROP COLUMN subtable1 ;
ALTER TABLE nexttest DROP COLUMN cc ;
```
**Backtrace of the Crash**
```c
#0 0x7f8ba1bce2de (gc_col+0xae)
#1 0x7f8ba1bcfeb5 (tc_gc_drop_col+0x35)
#2 0x7f8ba1b74e2d (sql_trans_rollback+0x48d)
#3 0x7f8ba1b88e02 (sql_trans_end+0x152)
#4 0x7f8ba1c0142d (mvc_rollback+0x4ad)
#5 0x7f8ba1c00444 (mvc_commit+0x254)
#6 0x7f8ba1a75b8c (SQLtransaction_commit+0x16c)
#7 0x7f8ba1f8829f (runMALsequence+0xf0f)
#8 0x7f8ba1f86f3e (runMAL+0xee)
#9 0x7f8ba1a34bf2 (SQLrun+0x142)
#10 0x7f8ba1a366b9 (SQLengineIntern+0xc9)
#11 0x7f8ba1a33399 (SQLengine_+0x1139)
#12 0x7f8ba1a304fe (SQLengine+0x3e)
#13 0x7f8ba1fae2cf (runScenario+0x6f)
#14 0x7f8ba1faf4de (MSscheduleClient+0xb6e)
#15 0x7f8ba20e6182 (doChallenge+0x132)
#16 0x7f8ba2e0f8a7 (thread_starter+0xc7)
#17 0x7f8ba192a609 (start_thread+0xd9)
#18 0x7f8ba184d133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `gc_col` | https://api.github.com/repos/MonetDB/MonetDB/issues/7440/comments | 1 | 2024-01-17T06:53:28Z | 2024-06-27T13:19:13Z | https://github.com/MonetDB/MonetDB/issues/7440 | 2,085,523,883 | 7,440 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exps_card`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 oid ) ;
DELETE FROM v0 WHERE NOT ( v1 IN ( SELECT MAX ( DISTINCT ( SELECT NULL WHERE v1 AND v1 = 'aggordview1' GROUP BY v1 ) ) FROM v0 ) ) ;
```
**Backtrace of the Crash**
```c
#0 0x7fe1aec45c70 (exps_card+0x50)
#1 0x7fe1aecb9521 (rel_optimize_projections_+0x3c91)
#2 0x7fe1aec671ef (rel_visitor_topdown+0x27f)
#3 0x7fe1aec675a5 (rel_visitor_topdown+0x635)
#4 0x7fe1aec675a5 (rel_visitor_topdown+0x635)
#5 0x7fe1aec67546 (rel_visitor_topdown+0x5d6)
#6 0x7fe1aec675a5 (rel_visitor_topdown+0x635)
#7 0x7fe1aec67546 (rel_visitor_topdown+0x5d6)
#8 0x7fe1aecb01ab (rel_optimize_projections+0x3b)
#9 0x7fe1aec8b2da (rel_optimizer+0x75a)
#10 0x7fe1aebeef22 (sql_processrelation+0x82)
#11 0x7fe1ae9f8e1b (sql_symbol2relation+0x1bb)
#12 0x7fe1aea25b84 (SQLparser+0x624)
#13 0x7fe1aea24cbc (SQLengine_+0xa5c)
#14 0x7fe1aea224fe (SQLengine+0x3e)
#15 0x7fe1aefa02cf (runScenario+0x6f)
#16 0x7fe1aefa14de (MSscheduleClient+0xb6e)
#17 0x7fe1af0d8182 (doChallenge+0x132)
#18 0x7fe1afe018a7 (thread_starter+0xc7)
#19 0x7fe1ae91c609 (start_thread+0xd9)
#20 0x7fe1ae83f133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exps_card` | https://api.github.com/repos/MonetDB/MonetDB/issues/7439/comments | 0 | 2024-01-17T06:52:34Z | 2024-06-27T13:19:11Z | https://github.com/MonetDB/MonetDB/issues/7439 | 2,085,522,836 | 7,439 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exps_bind_column`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v2 INTEGER , v1 INTEGER );
SELECT CAST ( ( ( SELECT NULL v1 WHERE v2 IS NULL OR ( 'www' > ANY ( v1 ) ) ) ) AS BIGINT ) FROM v0 ;
```
**Backtrace of the Crash**
```c
#0 0x7f3a54eb079e (exps_bind_column+0x2ce)
#1 0x7f3a54ead576 (rel_find_exp_and_corresponding_rel_+0x536)
#2 0x7f3a54ead299 (rel_find_exp_and_corresponding_rel_+0x259)
#3 0x7f3a54eac853 (rel_find_exp_and_corresponding_rel+0x53)
#4 0x7f3a54ead617 (rel_find_exp+0x37)
#5 0x7f3a54eb5173 (project_unsafe+0x103)
#6 0x7f3a54f09cb5 (rel_merge_projects_+0xe5)
#7 0x7f3a54ec0c97 (rel_visitor_bottomup+0x3e7)
#8 0x7f3a54f071bb (rel_merge_projects+0x3b)
#9 0x7f3a54ee42da (rel_optimizer+0x75a)
#10 0x7f3a54e47f22 (sql_processrelation+0x82)
#11 0x7f3a54c51e1b (sql_symbol2relation+0x1bb)
#12 0x7f3a54c7eb84 (SQLparser+0x624)
#13 0x7f3a54c7dcbc (SQLengine_+0xa5c)
#14 0x7f3a54c7b4fe (SQLengine+0x3e)
#15 0x7f3a551f92cf (runScenario+0x6f)
#16 0x7f3a551fa4de (MSscheduleClient+0xb6e)
#17 0x7f3a55331182 (doChallenge+0x132)
#18 0x7f3a5605a8a7 (thread_starter+0xc7)
#19 0x7f3a54b75609 (start_thread+0xd9)
#20 0x7f3a54a98133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exps_bind_column` | https://api.github.com/repos/MonetDB/MonetDB/issues/7438/comments | 0 | 2024-01-17T06:51:44Z | 2024-06-27T13:19:10Z | https://github.com/MonetDB/MonetDB/issues/7438 | 2,085,521,786 | 7,438 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_values_set_supertype`.
**To Reproduce**
```sql
CREATE MERGE TABLE testagain (a int, b varchar(32)) PARTITION BY VALUES ON (a) ;
CREATE TABLE sublimits2 (a int, b varchar(32)) ;
ALTER TABLE testagain ADD TABLE sublimits2 AS PARTITION IN (-100 * 2, '-90', '120', addtwo(55), 11.2) ;
```
**Backtrace of the Crash**
```c
#0 0x7fbf9bc5b7e9 (exp_values_set_supertype+0x119)
#1 0x7fbf9bcdd540 (rel_alter_table_add_partition_list+0x210)
#2 0x7fbf9bc40497 (rel_schemas+0x5697)
#3 0x7fbf9bc04df9 (rel_semantic+0x4c9)
#4 0x7fbf9b9f9cf3 (sql_symbol2relation+0x93)
#5 0x7fbf9ba26b84 (SQLparser+0x624)
#6 0x7fbf9ba25cbc (SQLengine_+0xa5c)
#7 0x7fbf9ba234fe (SQLengine+0x3e)
#8 0x7fbf9bfa12cf (runScenario+0x6f)
#9 0x7fbf9bfa24de (MSscheduleClient+0xb6e)
#10 0x7fbf9c0d9182 (doChallenge+0x132)
#11 0x7fbf9ce028a7 (thread_starter+0xc7)
#12 0x7fbf9b91d609 (start_thread+0xd9)
#13 0x7fbf9b840133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_values_set_supertype` | https://api.github.com/repos/MonetDB/MonetDB/issues/7437/comments | 0 | 2024-01-17T06:50:50Z | 2024-06-27T13:19:09Z | https://github.com/MonetDB/MonetDB/issues/7437 | 2,085,520,799 | 7,437 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_ref`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 DOUBLE );
DELETE FROM v0 WHERE ( v1 ) IS NULL OR ( SELECT DENSE_RANK ( ) OVER ( PARTITION BY count ( * ) ORDER BY v1 % 10 ) WHERE 0 BETWEEN v1 AND v1 ) < 4;
```
**Backtrace of the Crash**
```c
#0 0x7f71aba63ccf (exp_ref+0x3f)
#1 0x7f71abaa0211 (rel_unnest_dependent+0x4941)
#2 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#3 0x7f71aba9cc6c (rel_unnest_dependent+0x139c)
#4 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#5 0x7f71aba9cc6c (rel_unnest_dependent+0x139c)
#6 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#7 0x7f71aba9cc6c (rel_unnest_dependent+0x139c)
#8 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#9 0x7f71aba9cc6c (rel_unnest_dependent+0x139c)
#10 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#11 0x7f71aba9d3e7 (rel_unnest_dependent+0x1b17)
#12 0x7f71aba9bcba (rel_unnest_dependent+0x3ea)
#13 0x7f71aba9cc6c (rel_unnest_dependent+0x139c)
#14 0x7f71aba92ab7 (_rel_unnest+0x4d7)
#15 0x7f71aba80c97 (rel_visitor_bottomup+0x3e7)
#16 0x7f71aba80b87 (rel_visitor_bottomup+0x2d7)
#17 0x7f71aba80b87 (rel_visitor_bottomup+0x2d7)
#18 0x7f71aba80b28 (rel_visitor_bottomup+0x278)
#19 0x7f71aba8bb16 (rel_unnest+0xd6)
#20 0x7f71aba07eef (sql_processrelation+0x4f)
#21 0x7f71ab811e1b (sql_symbol2relation+0x1bb)
#22 0x7f71ab83eb84 (SQLparser+0x624)
#23 0x7f71ab83dcbc (SQLengine_+0xa5c)
#24 0x7f71ab83b4fe (SQLengine+0x3e)
#25 0x7f71abdb92cf (runScenario+0x6f)
#26 0x7f71abdba4de (MSscheduleClient+0xb6e)
#27 0x7f71abef1182 (doChallenge+0x132)
#28 0x7f71acc1a8a7 (thread_starter+0xc7)
#29 0x7f71ab735609 (start_thread+0xd9)
#30 0x7f71ab658133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_ref` | https://api.github.com/repos/MonetDB/MonetDB/issues/7436/comments | 0 | 2024-01-17T06:49:55Z | 2024-06-27T13:19:08Z | https://github.com/MonetDB/MonetDB/issues/7436 | 2,085,519,712 | 7,436 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_copy`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 , v2 ) as ( select i , cast ( i as string ) from generate_series ( 1 , 1000 ) as t ( i ) );
DELETE FROM v0 WHERE NOT ( v1 = ( SELECT 3 WHERE v2 = ( SELECT sum ( v2 ) OVER ( ) ) GROUP BY 7 ) ) ;
```
**Backtrace of the Crash**
```c
#0 0x7f2b00d41e4d (exp_copy+0x28d)
#1 0x7f2b00d80106 (push_up_project_exp+0x126)
#2 0x7f2b00d80307 (push_up_project_exp+0x327)
#3 0x7f2b00d80574 (push_up_project_exp+0x594)
#4 0x7f2b00d79ca2 (rel_unnest_dependent+0x13d2)
#5 0x7f2b00d78d0d (rel_unnest_dependent+0x43d)
#6 0x7f2b00d7a0f0 (rel_unnest_dependent+0x1820)
#7 0x7f2b00d7c5b1 (rel_unnest_dependent+0x3ce1)
#8 0x7f2b00d7a0f0 (rel_unnest_dependent+0x1820)
#9 0x7f2b00d78cba (rel_unnest_dependent+0x3ea)
#10 0x7f2b00d79c6c (rel_unnest_dependent+0x139c)
#11 0x7f2b00d78cba (rel_unnest_dependent+0x3ea)
#12 0x7f2b00d7a3e7 (rel_unnest_dependent+0x1b17)
#13 0x7f2b00d78cba (rel_unnest_dependent+0x3ea)
#14 0x7f2b00d79c6c (rel_unnest_dependent+0x139c)
#15 0x7f2b00d6fab7 (_rel_unnest+0x4d7)
#16 0x7f2b00d5dc97 (rel_visitor_bottomup+0x3e7)
#17 0x7f2b00d5db87 (rel_visitor_bottomup+0x2d7)
#18 0x7f2b00d5db87 (rel_visitor_bottomup+0x2d7)
#19 0x7f2b00d5db28 (rel_visitor_bottomup+0x278)
#20 0x7f2b00d68b16 (rel_unnest+0xd6)
#21 0x7f2b00ce4eef (sql_processrelation+0x4f)
#22 0x7f2b00aeee1b (sql_symbol2relation+0x1bb)
#23 0x7f2b00b1bb84 (SQLparser+0x624)
#24 0x7f2b00b1acbc (SQLengine_+0xa5c)
#25 0x7f2b00b184fe (SQLengine+0x3e)
#26 0x7f2b010962cf (runScenario+0x6f)
#27 0x7f2b010974de (MSscheduleClient+0xb6e)
#28 0x7f2b011ce182 (doChallenge+0x132)
#29 0x7f2b01ef78a7 (thread_starter+0xc7)
#30 0x7f2b00a12609 (start_thread+0xd9)
#31 0x7f2b00935133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_copy` | https://api.github.com/repos/MonetDB/MonetDB/issues/7435/comments | 0 | 2024-01-17T06:49:04Z | 2024-06-27T13:19:08Z | https://github.com/MonetDB/MonetDB/issues/7435 | 2,085,518,665 | 7,435 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_bin`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 REAL );
SELECT ( NULL IN ( ( SELECT median ( 1 ) ) , ntile ( '<js>null</js>' ) OVER ( ) ) ) AS new_column FROM v0 ;
```
**Backtrace of the Crash**
```c
#0 0x7f2b90428355 (exp_bin+0x4725)
#1 0x7f2b9043ad66 (rel2bin_project+0x496)
#2 0x7f2b9042da39 (subrel_bin+0xc99)
#3 0x7f2b9042e7e6 (subrel_bin+0x1a46)
#4 0x7f2b9042e42c (subrel_bin+0x168c)
#5 0x7f2b9043aac9 (rel2bin_project+0x1f9)
#6 0x7f2b9042da39 (subrel_bin+0xc99)
#7 0x7f2b9042cc39 (output_rel_bin+0xb9)
#8 0x7f2b90477f1f (backend_dumpstmt_body+0x2cf)
#9 0x7f2b90477b62 (backend_dumpstmt+0x192)
#10 0x7f2b904153ac (SQLparser+0xe4c)
#11 0x7f2b90413cbc (SQLengine_+0xa5c)
#12 0x7f2b904114fe (SQLengine+0x3e)
#13 0x7f2b9098f2cf (runScenario+0x6f)
#14 0x7f2b909904de (MSscheduleClient+0xb6e)
#15 0x7f2b90ac7182 (doChallenge+0x132)
#16 0x7f2b917f08a7 (thread_starter+0xc7)
#17 0x7f2b9030b609 (start_thread+0xd9)
#18 0x7f2b9022e133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_bin` | https://api.github.com/repos/MonetDB/MonetDB/issues/7434/comments | 0 | 2024-01-17T06:48:17Z | 2024-06-27T13:19:07Z | https://github.com/MonetDB/MonetDB/issues/7434 | 2,085,517,771 | 7,434 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `exp_atom`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 VARCHAR ( 217 ) );
UPDATE v0 SET v1 = ( SELECT ( v1 IN ( SELECT COUNT ( * ) WHERE v1 = 1 ) ) AS new_column ) ;
```
**Backtrace of the Crash**
```c
#0 0x7f63fe6362c0 (exp_atom+0x80)
#1 0x7f63fe667f1f (rewrite_fix_count+0x2ef)
#2 0x7f63fe655c97 (rel_visitor_bottomup+0x3e7)
#3 0x7f63fe655b87 (rel_visitor_bottomup+0x2d7)
#4 0x7f63fe655b28 (rel_visitor_bottomup+0x278)
#5 0x7f63fe655b87 (rel_visitor_bottomup+0x2d7)
#6 0x7f63fe655b87 (rel_visitor_bottomup+0x2d7)
#7 0x7f63fe655b28 (rel_visitor_bottomup+0x278)
#8 0x7f63fe660b28 (rel_unnest+0xe8)
#9 0x7f63fe5dceef (sql_processrelation+0x4f)
#10 0x7f63fe3e6e1b (sql_symbol2relation+0x1bb)
#11 0x7f63fe413b84 (SQLparser+0x624)
#12 0x7f63fe412cbc (SQLengine_+0xa5c)
#13 0x7f63fe4104fe (SQLengine+0x3e)
#14 0x7f63fe98e2cf (runScenario+0x6f)
#15 0x7f63fe98f4de (MSscheduleClient+0xb6e)
#16 0x7f63feac6182 (doChallenge+0x132)
#17 0x7f63ff7ef8a7 (thread_starter+0xc7)
#18 0x7f63fe30a609 (start_thread+0xd9)
#19 0x7f63fe22d133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `exp_atom` | https://api.github.com/repos/MonetDB/MonetDB/issues/7433/comments | 0 | 2024-01-17T06:47:09Z | 2024-06-27T13:19:06Z | https://github.com/MonetDB/MonetDB/issues/7433 | 2,085,516,464 | 7,433 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `dameraulevenshtein`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 CHAR ( 100 ) );
INSERT INTO v0 VALUES ( 222 ) , ( 10 ) , ( 3 ) , ( 947 ) , ( 742 ) , ( 1 ) , ( 306 ) , ( 10 ) , ( 510 ) , ( 1.100000 ) , ( 9223372036854775807 ) , ( 333 ) , ( 106 ) , ( 10 ) , ( 10 ) , ( 10 ) , ( 10 ) , ( 10 ) , ( NULL ) , ( 222 ) , ( 10.100000 ) , ( 5 ) , ( 2 ) , ( 1 ) , ( 2 ) , ( 34 ) ;
INSERT INTO v0 ( v1 ) SELECT group_concat ( 'table tn3 row 99' ) FROM v0 , v0 AS tri , v0 AS OMW WHERE 10 LIMIT 4 ;
SELECT levenshtein ( v1 , v1 , 16 , 10 , 561 ) , v1 , v1 FROM v0 ;
```
**Backtrace of the Crash**
```c
#0 0x7f73c9358e84 (dameraulevenshtein+0x474)
#1 0x7f73c934f4e0 (TXTSIMlevenshtein+0xe0)
#2 0x7f73c91e929f (runMALsequence+0xf0f)
#3 0x7f73c91e7f3e (runMAL+0xee)
#4 0x7f73c8c95bf2 (SQLrun+0x142)
#5 0x7f73c8c976b9 (SQLengineIntern+0xc9)
#6 0x7f73c8c94399 (SQLengine_+0x1139)
#7 0x7f73c8c914fe (SQLengine+0x3e)
#8 0x7f73c920f2cf (runScenario+0x6f)
#9 0x7f73c92104de (MSscheduleClient+0xb6e)
#10 0x7f73c9347182 (doChallenge+0x132)
#11 0x7f73ca0708a7 (thread_starter+0xc7)
#12 0x7f73c8b8b609 (start_thread+0xd9)
#13 0x7f73c8aae133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.49.1 (Dec2023)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Dec2023
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Dec2023
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
sleep 10
cat /tmp/test.sql | timeout 5s docker exec -i monetdb_test mclient monetdb # run test case
if docker exec monetdb_test bash -c "grep '[m]server5' /proc/*/cmdline -lR"; then
echo "[INFO] Server normal."
else
echo "[CRASH] Mserver5 process does NOT exist."
fi
```
It can also be reproduced on the docker image `monetdb/dev-builds:default`.
**Issue labeling**
bug | MonetDB server crashes in `dameraulevenshtein` | https://api.github.com/repos/MonetDB/MonetDB/issues/7432/comments | 1 | 2024-01-17T06:45:47Z | 2024-06-27T13:19:05Z | https://github.com/MonetDB/MonetDB/issues/7432 | 2,085,514,570 | 7,432 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Error code found, please confirm ~

**To Reproduce**
Create a setting with minimal input for an external user to demonstrate the buggy behavior.
This includes the relevant part of the database schema description.
Performance trace of the rogue query (using the TRACE command)
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Software versions**
- MonetDB version number [Jun2023 Feature Release (11.47.3)]
- OS and version: Ubuntu 20.04
- Self-installed and compiled | [bug] Error code found, please confirm | https://api.github.com/repos/MonetDB/MonetDB/issues/7431/comments | 1 | 2024-01-16T02:20:59Z | 2024-06-27T13:19:04Z | https://github.com/MonetDB/MonetDB/issues/7431 | 2,082,908,890 | 7,431 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the third query returns empty result, since the second query returns `true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return the row in the table.
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 BOOLEAN, c1 VARCHAR);
INSERT INTO t0 (c0, c1) VALUES (1, 1);
CREATE UNIQUE INDEX i0t0 ON t0(c0 , c1 );
SELECT t0.c0, t0.c1 FROM t0; -- true, 1
SELECT ((t0.c0)AND(((t0.c1) IS NOT NULL))) FROM t0; -- true
SELECT t0.c0, t0.c1 FROM t0 WHERE ((t0.c0)AND(((t0.c1) IS NOT NULL)));
-- Expected: true, 1
-- Actual: empty
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
root@035e0b00c896:/app# mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 3bb73c2) (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: @897761d12f5d (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. | Unexpected result when using `AND` and `IS NOT NULL` | https://api.github.com/repos/MonetDB/MonetDB/issues/7430/comments | 2 | 2024-01-10T15:38:08Z | 2024-06-27T13:19:03Z | https://github.com/MonetDB/MonetDB/issues/7430 | 2,074,639,670 | 7,430 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the second query and the third query return the same result (`a`), since the expression could not be evaluated to `true` or `null` at the same time.
**To Reproduce**
```sql
DROP TABLE IF EXISTS t0 CASCADE;
CREATE TABLE t0(c0 VARCHAR);
INSERT INTO t0 (c0) VALUES ('a');
SELECT * FROM t0; -- a
SELECT * FROM t0 WHERE (((CASE (NULL)/(1) WHEN NULL THEN true END )OR(false)) IS NULL); -- a
SELECT * FROM t0 WHERE (CASE (NULL)/(1) WHEN NULL THEN true END )OR(false); -- a (likely unexpected here)
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
root@035e0b00c896:/app# mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 3bb73c2) (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: @897761d12f5d (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. | Unexpected result when using `CASE WHEN` | https://api.github.com/repos/MonetDB/MonetDB/issues/7429/comments | 1 | 2024-01-10T15:36:46Z | 2024-06-27T13:19:02Z | https://github.com/MonetDB/MonetDB/issues/7429 | 2,074,637,098 | 7,429 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the third query returns one row only, since the second query returns `true, true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return all two rows in the table after join.
**To Reproduce**
```sql
CREATE TABLE t0(c0 INTEGER, c1 BOOL, PRIMARY KEY(c0));
CREATE TABLE t1(c0 INTEGER, PRIMARY KEY(c0));
INSERT INTO t0 (c0) VALUES (0);
INSERT INTO t1 (c0) VALUES (1);
INSERT INTO t1 (c0) VALUES (2);
SELECT t0.c1 FROM t0, t1; -- null, null
SELECT (((true BETWEEN t0.c1 AND t1.c0)) IS NULL) FROM t0, t1; -- true, true
SELECT t0.c1 FROM t0, t1 WHERE (((true BETWEEN t0.c1 AND t1.c0)) IS NULL);
-- Expected: null, null (two rows)
-- Actual: null (one row)
```
**Expected behavior**
As mentioned above
**Screenshots**
N/A
**Software versions**
Build from source:
```
root@035e0b00c896:/app# mserver5 --version --dbname=monetdb
MonetDB 5 server 11.50.0 (hg id: 3bb73c2) (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: @897761d12f5d (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.
| Unexpected result when using BETWEEN operator | https://api.github.com/repos/MonetDB/MonetDB/issues/7428/comments | 1 | 2024-01-10T15:34:52Z | 2024-06-27T13:19:02Z | https://github.com/MonetDB/MonetDB/issues/7428 | 2,074,633,285 | 7,428 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
Hello. Apache Parquet ( https://parquet.apache.org/ ) becomes more and more popular and I think it's like a standard now in the data community, this is no more restricted to Hadoop People. Qlik supports it, Alteryx will support it in the next release, even LibreOffice is working on it, etc, etc.
Why?
-opensource format
-fast
**Describe the solution you'd like**
I would like to bulk load and export with an Apache Parquet file.
**Describe alternatives you've considered**
converting parquet to csv but that doesn't seem smart.
**Additional context**
None | Bulk load (copy) and export with Apache parquet | https://api.github.com/repos/MonetDB/MonetDB/issues/7427/comments | 4 | 2024-01-09T09:45:52Z | 2024-06-27T13:19:01Z | https://github.com/MonetDB/MonetDB/issues/7427 | 2,072,003,212 | 7,427 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Consider the test cases below. It is unexpected that the third query returns empty result, since the second query returns `true`, which means that the `WHERE` clause in the third query should be evaluated to `true` and thus return the row in the table.
**To Reproduce**
```sql
CREATE TABLE t1(c1 INTEGER);
CREATE TABLE t0(c0 BOOL, c1 INTEGER);
INSERT INTO t1 (c1) VALUES (0);
CREATE UNIQUE INDEX i0 ON t0(c1 , c0 );
INSERT INTO t0 (c0, c1) VALUES (true, 0);
SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER JOIN t0 ON t0.c0; -- true 0 0
SELECT (t0.c1) IS NOT NULL FROM t1 INNER JOIN t0 ON t0.c0; -- true
SELECT t0.c0, t0.c1, t1.c1 FROM t1 INNER JOIN t0 ON t0.c0 WHERE (t0.c1) IS NOT NULL;
-- Expected: true 0 0
-- Actual: Empty Result
```
**Expected behavior**
The result of the third query should be same as the first one
**Software versions**
- MonetDB v11.49.1 (Dec2023).
- OS and version: Docker on Ubuntu 22.04
- Installed from latest docker image
**Issue labeling **
Bug
| Unexpected result for INNER JOIN with IS NOT NULL | https://api.github.com/repos/MonetDB/MonetDB/issues/7426/comments | 2 | 2024-01-02T14:09:20Z | 2024-06-27T13:19:00Z | https://github.com/MonetDB/MonetDB/issues/7426 | 2,062,473,940 | 7,426 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
A clear and concise description of what the bug is.
```sql
drop table ttt;
create table ttt(id int primary key,k int NOT NULL DEFAULT '0');
insert into ttt values(1,3),(2,3),(3,3),(4,3),(5,3);
update ttt set k=k+1 where id=3;
delete from ttt where id=2;
update ttt set id = 3 where id = 3;
```
The last statement, execution error, is a false positive?
**Expected behavior**
An error was reported executing the last statement.
**Software versions**
- MonetDB version number [a milestone label]
- OS and version: Ubuntu 20.04
- Self-installed and compiled | The last statement, execution error, is a false positive? | https://api.github.com/repos/MonetDB/MonetDB/issues/7425/comments | 3 | 2023-12-28T03:18:55Z | 2024-06-27T13:18:59Z | https://github.com/MonetDB/MonetDB/issues/7425 | 2,057,941,686 | 7,425 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Select-join (N x 1) resorts to full scan-select instead of creating a hash table. Since this join uses `BATselect()`, I expect the same issue to be related to point selections.
**To Reproduce**
```sql
set optimizer='sequential_pipe';
start transaction;
-- t contains unique strings (scale up the size as desired)
create table t as select cast(uuid() as string) as u from generate_series(0,1000000);
alter table t add unique(u);
analyze sys.t;
-- s contains one value value from t
create table s as select * from t sample 1;
trace select * from t, s where t.u = s.u;
```
The trace shows that a full scan is performed:
```
| 10688 | (X_16=[1]:bat[:oid], X_17=[1]:bat[:oid]) := algebra.join(X_14=[1000000]:bat[:str], X_15=[1]:bat[:str], nil:BAT, nil:BAT, false:bit, nil:lng); # selectjoin; select: fullscan equi |
```
If you scale up the size of the table to a couple of hundred million tuples, this scan costs about 5 seconds, while the join could be answered in tens of milliseconds with a hash on the large table.
Note that the column is marked unique and the table analyzed. Especially in this case I'd expect a hash table. How is uniqueness implemented if not with a hash table? Is it created and then destroyed? That would be a waste.
**Expected behavior**
I'd expect a hash to be created on the large table.
**Software versions**
- MonetDB version number v11.47.18
- OS and version: Fedora 39
- self-installed and compiled
| Performance issue in select-joins | https://api.github.com/repos/MonetDB/MonetDB/issues/7424/comments | 29 | 2023-12-20T15:46:00Z | 2024-06-27T13:18:58Z | https://github.com/MonetDB/MonetDB/issues/7424 | 2,050,831,599 | 7,424 |
[
"MonetDB",
"MonetDB"
] | **Is your feature request related to a problem? Please describe.**
Not a problem for me but I guess developers struggle with a lot of versions... and who use MonetDB on a windows 32 bits today?
**Describe the solution you'd like**
to stop 32 bits editions of MonetDB
**Describe alternatives you've considered**
None
**Additional context**
Windows 11 only comes in 64 bits | Maybe we don't need 32 bits anymore? | https://api.github.com/repos/MonetDB/MonetDB/issues/7423/comments | 2 | 2023-12-19T21:37:00Z | 2024-06-27T13:18:57Z | https://github.com/MonetDB/MonetDB/issues/7423 | 2,049,472,924 | 7,423 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
It seems that something has broken with aggregate functions with variadic arguments (both in numpy and C pdfs).
**To Reproduce**
In version v11.41.11 (hg id: 151fed075b61) the following works:
CREATE OR REPLACE AGGREGATE python_aggregate (*)
RETURNS INTEGER
LANGUAGE PYTHON
{
try:
unique = numpy.unique(aggr_group)
x = numpy.zeros(shape=(unique.size))
for i in range(0, unique.size):
x[i] = numpy.sum(val[aggr_group==unique[i]])
except NameError:
# aggr_group doesn't exist. no groups, aggregate on all data
x = numpy.sum(arg2)
return (x)
};
select python_aggregate(5,2);
and returns --> 2 (sums the second arg).
Generally, MonetDB allows variadic arguments and names them as argN
In version v11.48.0, the same code returns
name 'arg2' is not defined
the same happens also with C udfs.
| Aggregate functions with variadic arguments | https://api.github.com/repos/MonetDB/MonetDB/issues/7422/comments | 2 | 2023-12-08T08:35:37Z | 2024-06-27T13:18:56Z | https://github.com/MonetDB/MonetDB/issues/7422 | 2,032,206,748 | 7,422 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
We used Version 11.45.11 in combination with Spring Hibernate 5.6.10. Because there was no Hibernate Dialect for Monet we used the MYSQL Hibernate dialect. Everything works fine in that version of Monet.
After a version upgrade to 11.47.11 SP3 we got this error.
`could not prepare statement; SQL [select last_insert_id()]`
I guess its not really a bug just more a feature request.
Is there an implementation for a hibernate dialect for monet?
**To Reproduce**
Create a Hibernate Entity with a Integer ID and GenerationType Identity. And save it with a JPA Repository to MonetDB.
Use MYSQL as Hibernate Dialect
**Expected behavior**
Use the DB Engine to handle the ID generation without a sequence.
**Software versions**
Hibernate - 5.6.10
Monet 11.47.11 SP3
**Additional context**
Add any other context about the problem here.
| Hibernate ID generation usage with monetdb | https://api.github.com/repos/MonetDB/MonetDB/issues/7421/comments | 7 | 2023-11-28T08:53:16Z | 2024-06-27T13:18:55Z | https://github.com/MonetDB/MonetDB/issues/7421 | 2,013,948,222 | 7,421 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Large strings seems to be very slow.
**To Reproduce**
I have a table that includes the plaintext of 50K publications from arxiv (50K rows in the table). The size is about 2GBs.
The query
create temp table arxivlower as select lower(text) from arxiv on commit preserve rows;
finishes in 33seconds. The trace follows:
+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| usec | statement |
+==========+=========================================================================================================================================================================+
| 9 | X_1=0@0:void := querylog.define("trace create temp table arxivlower as select lower(text) from arxiv on commit preserve rows;":str, "default_pipe":str, 18:int); |
| 4 | X_4=0:int := sql.mvc(); |
| 94 | X_13=0@0:void := sqlcatalog.create_table("tmp":str, "arxivlower":str, 0x7f9310156ba0:ptr, 1:int); |
| 41 | C_14=[50000]:bat[:oid] := sql.tid(X_4=0:int, "sys":str, "arxiv":str); |
| 375 | X_17=[50000]:bat[:str] := sql.bind(X_4=0:int, "sys":str, "arxiv":str, "text":str, 0:int); |
| 24 | X_24=[50000]:bat[:str] := algebra.projection(C_14=[50000]:bat[:oid], X_17=[50000]:bat[:str]); |
| 32041834 | X_25=[50000]:bat[:str] := batstr.toLower(X_24=[50000]:bat[:str]); # widen offset heap |
| 9 | X_28=50000:lng := aggr.count(X_25=[50000]:bat[:str]); |
| 32068883 | barrier X_90=false:bit := language.dataflow(); |
| 11 | (X_29=0@0:oid, X_30=nil:bat[:oid]) := sql.claim(X_4=0:int, "tmp":str, "lala":str, X_28=50000:lng); |
| 1646239 | X_34=0:int := sql.append(X_4=0:int, "tmp":str, "arxivlower":str, "v":str, X_29=0@0:oid, X_30=nil:bat[:oid], X_25=[50000]:bat[:str]); # copy vheap; widen empty offset hea |
: : p; memcpy offsets :
| 11 | X_36=0@0:void := sql.exportOperation(); |
+----------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
**Expected behavior**
The same query on the same table for example in sqlite finishes in 3 seconds, so it looks like a bug more than a perf issue.
**Software versions**
- MonetDB version number v11.48.0
- OS and version: [e.g. Ubuntu 22.04]
| Performance issue with lower(string) | https://api.github.com/repos/MonetDB/MonetDB/issues/7420/comments | 9 | 2023-11-23T09:13:06Z | 2024-06-27T13:18:55Z | https://github.com/MonetDB/MonetDB/issues/7420 | 2,007,772,628 | 7,420 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
Hello! Today I got an unexpected error while running concurrent transactions in MonetDB. I am not sure if this is a bug. Run the following statements:
**To Reproduce**
```
CREATE TABLE t0 (c0 INT);
T1: START TRANSACTION;
T2: START TRANSACTION;
T1: INSERT INTO t0 VALUES (1);
T2: INSERT INTO t0 VALUES (2);
T1: DELETE FROM t0 WHERE c0 = 1;
T2: DELETE FROM t0 WHERE c0 = 2;
T1: COMMIT;
T2: COMMIT; --COMMIT: transaction is aborted because of concurrency conflicts, will ROLLBACK instead
```
**Expected behavior**
I expect both transactions to succeed.
**Software versions**
- Using the latest commit from default branch.
- OS and version: Ubuntu 22.04
- Self-installed and compiled | Unexpected transaction conflict | https://api.github.com/repos/MonetDB/MonetDB/issues/7419/comments | 6 | 2023-11-17T16:27:33Z | 2024-06-27T13:18:54Z | https://github.com/MonetDB/MonetDB/issues/7419 | 1,999,496,741 | 7,419 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `bind_col_exp`.
**To Reproduce**
```sql
CREATE TABLE v0 ( v1 BIGINT NOT NULL PRIMARY KEY ) ;
SELECT 0 IS NOT NULL FROM v0 ORDER BY AVG ( max ( 331 ) ) OVER ( ORDER BY 634 NULLS FIRST ) NULLS LAST ;
SELECT * FROM v0 ORDER BY v1 ;
```
**Backtrace of the Crash**
```c
#0 0x7fa8aeb62ae3 (bind_col_exp+0xa3)
#1 0x7fa8aeb62500 (rel_base_projection+0x100)
#2 0x7fa8aeb5714e (_rel_projections+0x8ae)
#3 0x7fa8aeb1d725 (rel_table_projections+0x315)
#4 0x7fa8aeb1aaef (rel_select_exp+0x9ff)
#5 0x7fa8aeb11c20 (rel_subquery+0x5f0)
#6 0x7fa8aeb11ee3 (rel_selects+0x233)
#7 0x7fa8aeaf8d72 (rel_semantic+0x442)
#8 0x7fa8ae8edcf3 (sql_symbol2relation+0x93)
#9 0x7fa8ae91ab84 (SQLparser+0x624)
#10 0x7fa8ae919cbc (SQLengine_+0xa5c)
#11 0x7fa8ae9174fe (SQLengine+0x3e)
#12 0x7fa8aee952cf (runScenario+0x6f)
#13 0x7fa8aee964de (MSscheduleClient+0xb6e)
#14 0x7fa8aefcd182 (doChallenge+0x132)
#15 0x7fa8afcf68a7 (thread_starter+0xc7)
#16 0x7fa8ae811609 (start_thread+0xd9)
#17 0x7fa8ae734133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.47.11 (Jun2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Jun2023-SP2
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f # remove the old one
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Jun2023-SP2
# start monetdb in docker
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
# set username and password
sleep 10 # wait the server start
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR"
# check the existence of mserver5 process
cat /tmp/test.sql | docker exec -i monetdb_test mclient monetdb # run test case
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR" || { echo "[CRASH] Mserver5 process does NOT exist."; exit 1; }
# check the existence of mserver5 process
echo "[INFO] Server normal."
```
It can also be reproduced on MonetDB Dec2023_root, self-compiled by `CC=clang-12 CXX=clang++-12 cmake /root/monetdb -DCMAKE_BUILD_TYPE=RelWithDebInfo`.
**Issue labeling**
bug | MonetDB server crashes in `bind_col_exp` | https://api.github.com/repos/MonetDB/MonetDB/issues/7418/comments | 1 | 2023-11-15T16:39:21Z | 2024-06-27T13:18:53Z | https://github.com/MonetDB/MonetDB/issues/7418 | 1,995,142,071 | 7,418 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `trimchars`.
**To Reproduce**
```sql
SELECT TRIM(newurl(1,1,NULL), newurl(1,1,NULL));
```
**Backtrace of the Crash**
```c
#0 0x7fb1d97e0b00 (trimchars+0x230)
#1 0x7fb1d97e041f (str_strip2+0x6f)
#2 0x7fb1d99a24fc (do_batstr_batstr_str+0x176c)
#3 0x7fb1d996a0d8 (STRbatStrip2_bat+0xa8)
#4 0x7fb1d97a629f (runMALsequence+0xf0f)
#5 0x7fb1d97ab933 (DFLOWworker+0x4a3)
#6 0x7fb1da62d8a7 (thread_starter+0xc7)
#7 0x7fb1d9148609 (start_thread+0xd9)
#8 0x7fb1d906b133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.47.11 (Jun2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Jun2023-SP2
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f # remove the old one
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Jun2023-SP2
# start monetdb in docker
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
# set username and password
sleep 10 # wait the server start
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR"
# check the existence of mserver5 process
cat /tmp/test.sql | docker exec -i monetdb_test mclient monetdb # run test case
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR" || { echo "[CRASH] Mserver5 process does NOT exist."; exit 1; }
# check the existence of mserver5 process
echo "[INFO] Server normal."
```
It can also be reproduced on MonetDB Dec2023_root, self-compiled by `CC=clang-12 CXX=clang++-12 cmake /root/monetdb -DCMAKE_BUILD_TYPE=RelWithDebInfo`.
**Issue labeling**
bug | MonetDB server crashes in `trimchars`. | https://api.github.com/repos/MonetDB/MonetDB/issues/7417/comments | 1 | 2023-11-15T16:38:51Z | 2024-06-27T13:18:52Z | https://github.com/MonetDB/MonetDB/issues/7417 | 1,995,141,256 | 7,417 |
[
"MonetDB",
"MonetDB"
] | **Describe the bug**
MonetDB server crashes in `atom_get_int`.
**To Reproduce**
```sql
SELECT 0 , 827 ORDER BY debug ;
```
**Backtrace of the Crash**
```c
#0 0x7f4137cae359 (atom_get_int+0x29)
#1 0x7f4137d0130d (rel_order_by+0x51d)
#2 0x7f4137d0599b (rel_select_exp+0x18ab)
#3 0x7f4137cfbbae (rel_subquery+0x57e)
#4 0x7f4137cfbee3 (rel_selects+0x233)
#5 0x7f4137ce2d72 (rel_semantic+0x442)
#6 0x7f4137ad7cf3 (sql_symbol2relation+0x93)
#7 0x7f4137b04b84 (SQLparser+0x624)
#8 0x7f4137b03cbc (SQLengine_+0xa5c)
#9 0x7f4137b014fe (SQLengine+0x3e)
#10 0x7f413807f2cf (runScenario+0x6f)
#11 0x7f41380804de (MSscheduleClient+0xb6e)
#12 0x7f41381b7182 (doChallenge+0x132)
#13 0x7f4138ee08a7 (thread_starter+0xc7)
#14 0x7f41379fb609 (start_thread+0xd9)
#15 0x7f413791e133 (clone+0x43)
```
**Software versions**
- MonetDB version number: v11.47.11 (Jun2023-SP2)
- OS and version: Ubuntu 20.04
- From docker image monetdb/monetdb:Jun2023-SP2
An example of steps to reproduce in docker container (**write the poc into /tmp/test.sql first**):
```bash
docker container rm monetdb_test -f # remove the old one
docker run -e MDB_DB_ADMIN_PASS=monetdb --name monetdb_test -itd monetdb/monetdb:Jun2023-SP2
# start monetdb in docker
docker exec monetdb_test bash -c 'echo -n -e "user=monetdb\npassword=monetdb\n" > /root/.monetdb'
# set username and password
sleep 10 # wait the server start
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR"
# check the existence of mserver5 process
cat /tmp/test.sql | docker exec -i monetdb_test mclient monetdb # run test case
docker exec monetdb_test bash -c "grep '/usr/bin/[m]server5' /proc/*/cmdline -lR" || { echo "[CRASH] Mserver5 process does NOT exist."; exit 1; }
# check the existence of mserver5 process
echo "[INFO] Server normal."
```
It can also be reproduced on MonetDB Dec2023_root, self-compiled by `CC=clang-12 CXX=clang++-12 cmake /root/monetdb -DCMAKE_BUILD_TYPE=RelWithDebInfo`.
**Issue labeling**
bug | MonetDB server crashes in `atom_get_int` | https://api.github.com/repos/MonetDB/MonetDB/issues/7416/comments | 1 | 2023-11-15T16:37:44Z | 2024-06-27T13:18:51Z | https://github.com/MonetDB/MonetDB/issues/7416 | 1,995,139,430 | 7,416 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.