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"
] | Date: 2019-06-11 12:56:38 +0200
From: @swingbit
To: SQL devs <<bugs-sql>>
Version: 11.33.3 (Apr2019)
CC: @njnes
Last updated: 2019-09-02 16:05:28 +0200
## Comment 27041
Date: 2019-06-11 12:56:38 +0200
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Build Identifier:
CREATE TABLE x (
"id" INTEGER,
"attribute" CHARACTER LARGE OBJECT,
"value" CHARACTER LARGE OBJECT
);
INSERT INTO x VALUES (1, 'version', '3.15.0');
INSERT INTO x VALUES (1, 'executiontime', '100848');
INSERT INTO x VALUES (2, 'version', '3.15.0');
INSERT INTO x VALUES (2, 'executiontime', '54340');
INSERT INTO x VALUES (3, 'version', '3.15.0');
INSERT INTO x VALUES (3, 'executiontime', '96715');
CREATE VIEW executiontimes as select * from x where attribute = 'executiontime';
select id
from executiontimes
where cast(value as bigint) > 80000;
This returns:
conversion of string '3.15.0' to type lng failed.
Which means the where clause has been applied to table "x", not to view "executiontimes"
Note that:
- Both the following clauses give the expected (empty) result, meaning the issue is only with cast()
where value like '%.%';
where substring(value,1,1) = '3';
- This happens with any form of sub-select (in-line/view/with)
PS. If possible, I would really appreciate the fix to be back-ported to Aug2018 (also affected)
Reproducible: Always
### Actual Results:
conversion of string '3.15.0' to type lng failed.
### Expected Results:
+------+
| id |
+======+
| 1 |
| 3 |
+------+
2 tuples
MonetDB 5 server 11.33.3 (Apr2019) (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 3.8GiB available memory, 2 available cpu cores
Libraries:
libpcre: 8.32 2012-11-30
openssl: OpenSSL 1.0.2k-fips 26 Jan 2017
libxml2: 2.9.1
Compiled by: mockbuild@ (x86_64-redhat-linux-gnu)
Compilation: gcc -std=gnu99 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -Wno-format-truncation
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -Wl,-Bsymbolic-functions
## Comment 27042
Date: 2019-06-11 14:10:59 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [5ad88b364ee5](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5ad88b364ee5) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5ad88b364ee5](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5ad88b364ee5)
Changeset description:
Added test for bug #6712.
## Comment 27044
Date: 2019-06-11 14:37:21 +0200
From: @njnes
well the query gets merged (as we do not support physical views). Somehow we optimized (pushed the select with numbers) before the match on strings (that could be simply fixed, but is a performance issue not really correctness..)
## Comment 27045
Date: 2019-06-11 14:38:13 +0200
From: @sjoerdmullender
I think your analysis is flawed. The problem you're facing is not that the subquery is being ignored, it is instead that the conversion and selection on the value column is done before the selection on the attribute column. Just having a view doesn't mean that the view is actually executed first.
Your query is equivalent to
select id
from x
where attribute = 'executiontime' and cast(value as bigint) > 80000;
The two conditions are reversed because the SQL engine probably thinks that might be more efficient.
## Comment 27046
Date: 2019-06-11 14:46:43 +0200
From: @swingbit
Sjoerd, I don't think the query you wrote is equivalent to mine. You perform both selections on the same relations. I don't.
I think it is wrong to think about it in terms of execution order.
The query I wrote *logically* defines the content of relation "executiontimes". When I select anything from it, I expect to select from that content, no matter the execution order that the engine decides.
## Comment 27047
Date: 2019-06-11 15:00:15 +0200
From: @swingbit
For reference, PostgreSQL gives for example the expected result. Not because it chooses a different execution order, but because this is the only correct one.
## Comment 27048
Date: 2019-06-11 15:22:59 +0200
From: @swingbit
If we look at it without a view, the following is equivalent to my first query:
select executiontimes.id
from (select * from x where attribute = 'executiontime') as executiontimes
where cast(executiontimes.value as bigint) > 80000;
Expression "cast(executiontimes.value as bigint)" depends on relation executiontimes. It cannot be evaluated before executiontimes is evaluated.
Flattening everything to a bunch of selections on the same relation is wrong, in my opinion.
## Comment 27053
Date: 2019-06-11 19:40:06 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [47300227a174](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=47300227a174) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=47300227a174](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=47300227a174)
Changeset description:
fixes for bug #6712
## Comment 27054
Date: 2019-06-11 19:56:27 +0200
From: @njnes
when possible we now push the candidate list into the batcalc.convert
routine.
## Comment 27059
Date: 2019-06-12 16:02:26 +0200
From: @swingbit
I'm sorry to insist, but I think the fix solves my initial example, not the real issue.
Here another example that fails.
CREATE TABLE x (n INTEGER);
INSERT INTO x VALUES (-2);
INSERT INTO x VALUES (-1);
INSERT INTO x VALUES (0);
INSERT INTO x VALUES (1);
INSERT INTO x VALUES (2);
select nonzero.n
from (select n from x where n <> 0) as nonzero
where 1/nonzero.n = 1;
Gives:
division by zero.
This is not correct. The semantics of the query is not respected. I'm explicitly using relation nonzero which is by definition not containing zeros. This query should not attempt that division.
I completely understand that the implementation flattens the two selections on the same base table. I also understand that this approach produces the correct result in most cases. But not in all cases. This is one.
| Where clause with cast ignores sub-select | https://api.github.com/repos/MonetDB/MonetDB/issues/6712/comments | 0 | 2020-11-30T16:34:39Z | 2024-06-27T13:06:11Z | https://github.com/MonetDB/MonetDB/issues/6712 | 753,626,076 | 6,712 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-06-10 05:21:42 +0200
From: Peter Prib <<peter.prib>>
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.33.3 (Apr2019)
CC: @mlkersten
Last updated: 2020-03-15 09:57:51 +0100
## Comment 27039
Date: 2019-06-10 05:21:42 +0200
From: Peter Prib <<peter.prib>>
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Build Identifier:
On executing exec on prepare server crashes with message
main thread:!ERROR:MALException:mal.eval:WARNING: could not open file 'C:\Users\peter\1560120921115'
Can't see the file in the directory mentioned
Reproducible: Always
### Steps to Reproduce:
1. prepare insert
2. exec with parameters
This is done in some complex node.js code
Have tested simple node.js prepare/exec with SQL that works.
## Comment 27126
Date: 2019-07-11 12:58:26 +0200
From: @sjoerdmullender
The only way I see in the code how this message could be generated is when you start mserver5.exe with that file name as argument, or if you are executing mserver5.exe in the folder C:\Users\peter with the argument 1560120921115.
(This is not the default location when you start the server from the menu.)
I see no link at all with PREPARE/EXEC in the code (which would explain why you couldn't reproduce it in simpler code).
Note, the message occurs exactly once in the code base. The function producing that message is called in three different places, and in two of them (inside the same function), the argument is mangled so that this particular argument is not possible, so that only leaves the third location, which is when mserver5.exe gets called with command line arguments.
## Comment 27133
Date: 2019-07-12 00:58:55 +0200
From: Peter Prib <<peter.prib>>
On crashing could it by chance be reporting a previous expected failure in start up process. That is, the catastrophic failure has been trapped but incorrectly reported.
## Comment 27138
Date: 2019-07-15 10:46:21 +0200
From: @sjoerdmullender
What do you mean with "crashing"? Do you mean the query returns an error, or do you mean the server actually stops?
## Comment 27139
Date: 2019-07-15 11:18:26 +0200
From: Peter Prib <<peter.prib>>
When i say "server crashes" = server is no longer running i.e. the command window indicates the process is no longer running.
The message is shown on the command window which was used to start the server
## Comment 27184
Date: 2019-07-28 15:26:40 +0200
From: @mlkersten
evalFile() does not differentiate between Linux/Windows.
It might choke on absolute path name provided in locate_file()
Otherwise, it concerns access mode settings
## Comment 27594
Date: 2020-03-15 09:57:51 +0100
From: @mlkersten
Close bug report pending more specific information.
| Server crashes with last message ERROR:MALException:mal.eval:WARNING: could not open file | https://api.github.com/repos/MonetDB/MonetDB/issues/6711/comments | 0 | 2020-11-30T16:34:36Z | 2024-06-28T13:10:12Z | https://github.com/MonetDB/MonetDB/issues/6711 | 753,626,030 | 6,711 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-06-07 15:38:40 +0200
From: @yzchang
To: GDK devs <<bugs-common>>
Version: 11.33.3 (Apr2019)
CC: @PedroTadim, @swingbit
Last updated: 2019-11-28 10:01:13 +0100
## Comment 27038
Date: 2019-06-07 15:38:40 +0200
From: @yzchang
When tools such as numactl (and probably cgroups as well) are used to limit the hardware resources (e.g. cpu, mem) available to MonetDB, MonetDB is not aware of these limitations. As a result of this, MonetDB would think that it has more cpu/mem to use than what it will actually gets.
We should extend MonetDB to not only check the resources of the whole system, but also the limitations which might have been set.
| MonetDB unaware of resource limitations | https://api.github.com/repos/MonetDB/MonetDB/issues/6710/comments | 6 | 2020-11-30T16:34:33Z | 2024-06-27T13:06:08Z | https://github.com/MonetDB/MonetDB/issues/6710 | 753,625,997 | 6,710 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-06-06 22:39:58 +0200
From: Simon AUBERT <<simon.aubert>>
To: SQL devs <<bugs-sql>>
Version: 11.33.3 (Apr2019)
CC: @yzchang
Last updated: 2019-06-11 11:26:08 +0200
## Comment 27028
Date: 2019-06-06 22:39:58 +0200
From: Simon AUBERT <<simon.aubert>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0
Build Identifier:
When I use an identifier ( the " characted), the behaviour is quite strange : I cannot query the column without the quotes, even if I respect the case. It's like that if I don't put the identifiers, Monetdb translates it to lower case!
Reproducible: Always
### Steps to Reproduce:
1.sql>Create table formation.TestIdentifier ("ColumnTestIdentifier" Varchar(14),"ColumnTestIdentifierID" INTEGER);
operation successful
2.sql>Select * from formation.TestIdentifier;
+----------------------+------------------------+
| ColumnTestIdentifier | ColumnTestIdentifierID |
+======================+========================+
+----------------------+------------------------+
0 tuples
3.sql>select * from sys.columns order by Id Desc limit 2;
+-------+--------------+---------+------+------+-------+------+-------+------+
| id | name | type | type | type | table | defa | null | numb |>
: : : : _dig : _sca : _id : ult : : er :>
: : : : its : le : : : : :>
+=======+==============+=========+======+======+=======+======+=======+======+
| 12817 | ColumnTestId | int | 32 | 0 | 12818 | null | true | 1 |
: : entifierID : : : : : : : :
| 12816 | ColumnTestId | varchar | 14 | 0 | 12818 | null | true | 0 |
: : entifier : : : : : : : :
+-------+--------------+---------+------+------+-------+------+-------+------+
2 tuples !1 column dropped!
4.sql>select ColumnTestIdentifier from from formation.TestIdentifier;
syntax error, unexpected FROM in: "select columntestidentifier from from"
### Actual Results:
Syntax error
### Expected Results:
the colmun exist...
I think that MonetDB should check if the column exists, see it existes and then not translate it in lower case, which has no sense.
## Comment 27029
Date: 2019-06-06 23:25:49 +0200
From: @yzchang
Hai, the syntax error was caused by a typo in your query "from from".
Concerning the quotes, afaik, MonetDB follows SQL standard, i.e. by default table/column/etc names are case-insensitive. Without the quote, the names are converted to lower cases.
If you want to preserve the capital letters in your names, you must put them between quotes, but then, you'll also have to use quotes when querying them.
## Comment 27030
Date: 2019-06-06 23:28:49 +0200
From: Simon AUBERT <<simon.aubert>>
Hi, my bad, bad copy paste.
However, the problem really exists :
sql>select ColumnTestIdentifier from formation.TestIdentifier;
SELECT: identifier 'columntestidentifier' unknown
## Comment 27037
Date: 2019-06-07 10:41:42 +0200
From: @yzchang
Hai, the error message is expected. You need to surround the column name with quotes: select "ColumnTestIdentifier" from formation.TestIdentifier;
for the reason as explained in my previous message.
| Bad management of identifiers and upper case/lower case | https://api.github.com/repos/MonetDB/MonetDB/issues/6709/comments | 0 | 2020-11-30T16:34:30Z | 2024-06-28T13:10:11Z | https://github.com/MonetDB/MonetDB/issues/6709 | 753,625,956 | 6,709 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-05-27 15:18:41 +0200
From: Fabio <<palmaresk8>>
To: Documentation maintainers <<bugs-docs>>
Version: unspecified
CC: martin.van.dinther, @yzchang
Duplicates: #6705
Last updated: 2019-07-17 12:54:47 +0200
## Comment 27016
Date: 2019-05-27 15:18:41 +0200
From: Fabio <<palmaresk8>>
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Build Identifier:
Several new features described in the Apr 2019 (11.33.3) version release notes are not explained in the database manual (https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverview), like merge statement, renaming of SQL schemas, tables and columns with ALTER statements etc.
Reproducible: Always
## Comment 27017
Date: 2019-05-27 15:22:33 +0200
From: @yzchang
Already reported in 6705
*** This bug has been marked as a duplicate of bug #6705 ***
## Comment 27142
Date: 2019-07-17 12:54:47 +0200
From: Martin van Dinther <<martin.van.dinther>>
FYI: The documentation has been updated.
| MonetDB SQL Syntax Overview does not reflect changes described in the Apr 2019 (11.33.3) release notes | https://api.github.com/repos/MonetDB/MonetDB/issues/6708/comments | 0 | 2020-11-30T16:34:26Z | 2024-06-28T13:10:11Z | https://github.com/MonetDB/MonetDB/issues/6708 | 753,625,910 | 6,708 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-05-27 08:23:34 +0200
From: Peter Prib <<peter.prib>>
To: SQL devs <<bugs-sql>>
Version: 11.33.3 (Apr2019)
CC: @kutsurak, @njnes, @PedroTadim
Last updated: 2019-06-13 01:31:07 +0200
## Comment 27011
Date: 2019-05-27 08:23:34 +0200
From: Peter Prib <<peter.prib>>
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Build Identifier:
Not sure why when in transaction mode one is forced to roll back UOW when sustain duplicate on insert. Actually not sure why one cannot decide rather than being forced. Old coding technique was to try insert and if failed then issue update or visa versa. Not sure why one is not allowed to decide on an error if to proceed or not.
Reproducible: Always
### Steps to Reproduce:
1.insert
2.update
### Actual Results:
client13:!ERROR:SQLException:assert:M0M29!INSERT INTO: PRIMARY KEY constraint 'share_daily_history.pk1' violated
3.client13:!ERROR:SQLException:sql.execute:25005!Current transaction is aborted (please ROLLBACK)
### Expected Results:
First insert fails due to duplicate key
As insert failed issue an update
Normal SQL coding practice since last century. Avoids need to do select and has major performance advantages. Obviously implementation of upsert would be better or merge if didn't have bug. Although the expected behavior should be the coder determines whether to rollback or commit. Not clear if this behavior extends to other types of errors.
## Comment 27024
Date: 2019-06-04 21:19:42 +0200
From: @PedroTadim
Hello Peter, for this situation you could try to use the Savepoints feature from SQL. Thy are allow to rollback into a previous defined intermediate point within the transaction.
https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverviewSAVEPOINT
## Comment 27025
Date: 2019-06-05 00:16:31 +0200
From: Peter Prib <<peter.prib>>
Not sure how this would fix the behavior unless you are saying the product isn't consistent in how it handles SQL failure within transaction mode. Makes no sense. If correct then there should be an easy fix to the bug.
## Comment 27055
Date: 2019-06-11 20:01:45 +0200
From: @njnes
errors indeed force a rollback and that is likely to stay.
## Comment 27056
Date: 2019-06-12 00:57:21 +0200
From: Peter Prib <<peter.prib>>
Are you saying that you aren't going to align with standard practice by all main RDBMSs? Plus not allow normal practice before advent of merge command.
Suggest you are stopping freedom of choice by the programmer to decide whether there is a need to rollback or commit. Part of the point for rollback/commit. As the issuing of the rollback command is forced it seems a redundant/pointless step.
## Comment 27057
Date: 2019-06-12 13:10:32 +0200
From: @kutsurak
Hi Peter,
MonetDB uses Optimistic Concurrency Control
(https://en.wikipedia.org/wiki/Optimistic_concurrency_control). The reason is
that MonetDB is optimized for large analytical workloads (think read only
queries that involve tables with billions of rows). This unfortunately means that concurrent writes (inserts/updates/deletions) in the same table are rejected by the transaction manager. While freedom of choice by the user is an important concern for RDBMS developers, two even more important concerns are data integrity (you don't want to lose your data) and performance (you want your queries to finish before the heat death of the universe). Optimistic Concurrency Control is a compromise that allows MonetDB to be really good at a particular workload profile, at the expense of inconvenience in other types of workloads. This is the reason why this is unlikely to change.
If you do not want to issue the rollback commands manually you could use
autocommit mode and it will rollback failed transactions automatically. Usually programmers want some more control in order to perform some kind of cleanup before the transaction is rolled back.
I hope this helps clear things up.
## Comment 27062
Date: 2019-06-13 01:31:07 +0200
From: Peter Prib <<peter.prib>>
Must admit your reasoning doesn't align with my knowledge of other DBMS. All main stream DBMS's offer optimistic locking on the reasoning it enables a higher performance option. These DBMS's can handle massive works loads. One is given the choice of locking levels to suit work load profile and data profile. For example, if the data quality is high and immutable events then there is no locking required.
Don't see why it can't be readily enabled as it should be an extensions of save points. One could readily be given the choice and choose if the performance differential becomes significant. I suggest there is more work in rolling back the entire unit of work and reapplying the corrected unit of work. One of annoyances about the use of optimistic locking with leads to data quality issues if not programmed correctly.
| Transaction mode forces roll back if error | https://api.github.com/repos/MonetDB/MonetDB/issues/6707/comments | 0 | 2020-11-30T16:34:22Z | 2024-06-28T13:10:10Z | https://github.com/MonetDB/MonetDB/issues/6707 | 753,625,869 | 6,707 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-05-25 08:30:17 +0200
From: Peter Prib <<peter.prib>>
To: SQL devs <<bugs-sql>>
Version: 11.33.3 (Apr2019)
CC: @PedroTadim
Last updated: 2019-09-02 16:05:27 +0200
## Comment 27006
Date: 2019-05-25 08:30:17 +0200
From: Peter Prib <<peter.prib>>
User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36
Build Identifier:
Cannot prepare merge statement
Reproducible: Always
### Steps to Reproduce:
1.prepare
merge into test.share_daily_history
as target
USING select * from (
values('BHP',? ,? ,? ,? ,? ,?)) as (id,timeid,c1,c2,c3,c4,volume) as source
on source.id=target.id and source.timeid=target.timeid
when not matched then
insert (id,timeid,c1,c2,c3,c4,volume) values(source.id,source.timeid,source.c1,source.c2,source.c3,source.c4,source.volume)
2.
3.
### Actual Results:
syntax error, unexpected MERGE in: "prepare
merge"
### Expected Results:
statement prepared for execution
Using merge as no upsert. Trying to use merge in node.js with parameters which is generating prepare. Prepare should work on merge statement.
## Comment 27007
Date: 2019-05-25 10:00:30 +0200
From: @PedroTadim
Hello Peter, I'm confused about your description. On the title you say the bug is from the Aug2018 version, but in the version description is Apr2019. The merge statements were added in the Apr2019 version, so you can't use them in the Aug2018 version. I just tried a prepared merge statement in the Apr2019 version and I didn't get any error.
## Comment 27008
Date: 2019-05-25 10:13:10 +0200
From: Peter Prib <<peter.prib>>
My apologies thought I was running latest version. Must admit just copied and pasted description without checking dates. Will download latest and try again.
## Comment 27009
Date: 2019-05-25 14:16:43 +0200
From: Peter Prib <<peter.prib>>
Upgraded and prepare works for merge but not with parameters
sql>merge into test.share_daily_history as target
more>USING (
more>select * from (values('BHP',1,1 ,1 ,1 ,1 ,1)) as a(id,timeid,c1,c2,c3,c4,volume)
more>) as source
more>on source.id=target.id and source.timeid=target.timeid
more>when not matched then
more>insert (id,timeid,c1,c2,c3,c4,volume) values(source.id,source.timeid,source.c1,source.c2,source.c3,source.c4,source.volume)
more>;;
0 affected rows
sql>prepare
more>merge into test.share_daily_history as target
more>USING (
more>select * from (values('BHP',1,1 ,1 ,1 ,1 ,1)) as a(id,timeid,c1,c2,c3,c4,volume)
more>) as source
more>on source.id=target.id and source.timeid=target.timeid
more>when not matched then
more>insert (id,timeid,c1,c2,c3,c4,volume) values(source.id,source.timeid,source.c1,source.c2,source.c3,source.c4,source.volume)
more>;;
execute prepared statement using: EXEC 7(...)
+------+--------+-------+--------+-------+--------+
| type | digits | scale | schema | table | column |
+======+========+=======+========+=======+========+
+------+--------+-------+--------+-------+--------+
0 tuples
sql>prepare
more>merge into test.share_daily_history as target
more>USING (
more>select * from (values('BHP',?,? ,? ,? ,? ,?)) as a(id,timeid,c1,c2,c3,c4,volume)
more>) as source
more>on source.id=target.id and source.timeid=target.timeid
more>when not matched then
more>insert (id,timeid,c1,c2,c3,c4,volume) values(source.id,source.timeid,source.c1,source.c2,source.c3,source.c4,source.volume)
more>;
42000!
sql>
## Comment 27010
Date: 2019-05-25 16:50:16 +0200
From: @PedroTadim
Thanks for your feedback Peter, I just reproduced the bug in our development branch. The problem is the compiler fails to infer the types of the prepared statement parameters to perform the merge statement's join. I will look into it next Monday.
## Comment 27012
Date: 2019-05-27 10:53:20 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [ea82b864645d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ea82b864645d) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ea82b864645d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ea82b864645d)
Changeset description:
Throw a more detailed error message for bug #6706.
## Comment 27013
Date: 2019-05-27 11:13:50 +0200
From: @PedroTadim
I checked further the causes of the error message, and I found out the types of the prepared statement parameters could not be inferred. This happens because they are used inside a sub-query, which are later used to generate the merge statement's inner join. Because the types are not known, the inner join cannot be generated and the error is thrown.
We could fix this by hinting the types of the parameters at the beginning of the query, much alike PostgreSQL does. However this will be a feature request.
## Comment 27014
Date: 2019-05-27 12:16:33 +0200
From: Peter Prib <<peter.prib>>
Problem point makes sense. Wonder how other DBMS managed to handle. May have written into stored proc which would give data typing definition to parameter as could be determined from other statements.
Would it be possible to have such parameters have a default of string so they could be cast or requires cast so they could be inferred?
Could one accept typing as given on exec and then fails if typing mismatch at execution of SQL. Suspect this not easy as would require agility .
Problem clear as the following fails with typing issue.
prepare select * from (values(?)) as a(id);
## Comment 27015
Date: 2019-05-27 12:33:13 +0200
From: Peter Prib <<peter.prib>>
Have seen the other way to overcome the issue. Defer the actual prepare until the execute statement which then presents the parameters thus know the data typing. This would give more flexibility as casting could be done if inconsistencies in data types.
## Comment 27019
Date: 2019-06-04 09:50:30 +0200
From: @sjoerdmullender
Can somebody please change the bug summary? The version number is *not* a good summary of the bug.
## Comment 27021
Date: 2019-06-04 11:00:43 +0200
From: Peter Prib <<peter.prib>>
Fixed title
Note, have found out that if I cast parameter it handles typing issue. May be worthwhile mentioning in documentation.
## Comment 27058
Date: 2019-06-12 15:40:02 +0200
From: @PedroTadim
We have looked back at this bug, and we can fix the type resolution for the parameters inside the compiler for situations alike this one. However the fix will take some time to get done.
## Comment 27069
Date: 2019-06-14 17:07:14 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [04ee0b5b1658](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04ee0b5b1658) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=04ee0b5b1658](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=04ee0b5b1658)
Changeset description:
Improvements for bug #6706. When resolving the type of an expression on rel_set_type_param, find it's underlying column/atom reference is a parameter without a type, set it.
This implied to change the prototype of the rel_check_type function to pass optionally the relation of the expression.
Also when calling a SQL exec, we should check if the number of arguments correspond to the number of arguments of the underlying prepared statement.
## Comment 27071
Date: 2019-06-17 17:54:23 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [84a23e24786f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=84a23e24786f) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=84a23e24786f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=84a23e24786f)
Changeset description:
Further improvements for Bug #6706. When the column expression is an alias, search for the referencing column.
| prepare doesn't recognize merge statement | https://api.github.com/repos/MonetDB/MonetDB/issues/6706/comments | 0 | 2020-11-30T16:34:19Z | 2024-06-27T13:06:04Z | https://github.com/MonetDB/MonetDB/issues/6706 | 753,625,821 | 6,706 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-05-20 14:43:07 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.33.3 (Apr2019)
CC: martin.van.dinther, palmaresk8, @PedroTadim, @yzchang
Last updated: 2019-07-17 12:52:01 +0200
## Comment 27005
Date: 2019-05-20 14:43:07 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1.1 Safari/605.1.15
Build Identifier:
Documentation of some new features in the Apr2019 release is missing, e.g.:
- schema/table/column rename
- merge statement
- extended windowing functions
- updatable merge table
For the last three features, there is already some information in the blog posts, but the SQL Reference Manual [1] and its subpages should be extended to include all new features.
Thanks,
Jennie
[1] https://www.monetdb.org/Documentation/SQLreference
Reproducible: Always
## Comment 27018
Date: 2019-05-27 15:22:33 +0200
From: @yzchang
*** Bug #6708 has been marked as a duplicate of this bug. ***
## Comment 27065
Date: 2019-06-13 15:24:07 +0200
From: @PedroTadim
group by with expressions is also missing
## Comment 27068
Date: 2019-06-13 18:41:08 +0200
From: Martin van Dinther <<martin.van.dinther>>
Updated https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverview
with:
- Added ALTER SCHEMA ... RENAME TO ... syntax
- Added ALTER TABLE ... SET SCHEMA ... syntax
- Added ALTER TABLE ... RENAME TO ... syntax
- Added ALTER TABLE ... RENAME COLUMN ... TO ... syntax
- Updated ALTER TABLE ALTER COLUMN by removing limitation that column name cannot be changed
- Added [ IF EXISTS ] option to syntax of all ALTER TABLE commands
- Added MERGE INTO statement
MERGE INTO target [ [AS] ident ]
USING source
ON search_condition
WHEN merge_action
[ WHEN merge_action ]
merge_action:
MATCHED THEN { UPDATE SET assignment_list | DELETE }
| NOT MATCHED THEN INSERT [ column_list ] [ { DEFAULT VALUES | VALUES row_values } ]
excluded: [ AND search_condition ] as it is not supported
- Added WITH ... MERGE
- Added [ WITH <i>cte_alias</i> AS <b><i>SELECT_query</i></b> [, <i>cte_alias</i> AS <b><i>SELECT_query</i></b> , ...] ]
to INSERT, UPDATE and DELETE commands.
- Added optional [SEED <integer>] to SELECT ... FROM ... [ SAMPLE <expr> [SEED <integer>] ]
- Added optional "[ ON { CLIENT | SERVER } ]" to commands:
COPY INTO tbl FROM file ...
COPY BINARY INTO tbl FROM file ...
COPY query INTO file ...
- Extended COPY INTO tbl FROM file ... with missing: [ FWF '(' pos [ ',' pos [ ... ] ] ')' ]
- Extended COPY BINARY INTO tbl FROM file ... with missing: [ '(' column_name [ ',' column_name [ ... ] ] ')' ] and missing: [ NO CONSTRAINT ]
- Added version numbers to release names of Aug2018, Mar2018, Jul2017, Dec2016, Jun2016
- Added: or <code>--set embedded_py=2</code> or <code>--set embedded_py=3</code>
Also updated webpages:
- https://www.monetdb.org/Documentation/SQLreference/Alter
- https://www.monetdb.org/Documentation/SQLreference/Updates
- https://www.monetdb.org/Documentation/Manuals/SQLreference/CopyInto
- https://www.monetdb.org/Documentation/SQLcatalog/Functions%2C%20arguments%2C%20types (added new "system" column for sys.functions)
## Comment 27123
Date: 2019-07-10 16:50:23 +0200
From: Martin van Dinther <<martin.van.dinther>>
Updated https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverview
with
- For SELECT add example of a SELECT using window functions.
- For SELECT add example of a SELECT using (values (data tuple), (data tuple)).
- For SELECT add href to window functions blog and SQL wiki page on Window_functions.
- Added optional WINDOW_clause in SELECT commands.
- Added optional CORRESPONDING_clause in SELECT commands.
- Extended CREATE MERGE TABLE with optional PARTITION BY clause.
- Extended ALTER TABLE ADD TABLE with optional AS PARTITION clause.
- Added ALTER TABLE SET TABLE AS PARTITION command.
- Added info on possibility that merge tables can be updatable as of release Apr2109 and included href to https://www.monetdb.org/blog/updatable-merge-tables
- Improved ALTER TABLE ADD CONSTRAINT syntax.
- Added missing DROP ALL LOADER command.
- Extended START TRANSACTION command with optional READ ONLY / WRITE and optional ISOLATION LEVEL ... syntax
- Extended COMMIT and ROLLBACK commands with optional keyword WORK
Added page https://www.monetdb.org/Documentation/SQLcatalog/TableDataPartitioning
- Added new Table Data Partitioning web page to SQL System Catalog
with definitions of sys.table_partitions, sys.range_partitions, sys.value_partitions
- Add hrefs from https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverview to this new page
Extended https://www.monetdb.org/Documentation/SQLcatalog/ColumnStorage
- Updated sys.storagemodelinput, sys.storagemodel and sys.tablestoragemodel.
- Added new system views: sys.schemastorage and sys.tablestorage.
On https://www.monetdb.org/Documentation/SQLreference/TableExpressions
- Improved joined_table definition: join_type spec can be empty (according to sql_parser.y) so made it optional.
- Added [ with_clause ] to select_query.
- Added [ WINDOW window_definition_list ] clause to select_query.
- Added [ CORRESPONDING [ BY '(' column_ref_commalist ')' ] ] clause to select_query.
- Added [ SEED integer ] to select_query SAMPLE clause.
On https://www.monetdb.org/Documentation/Manuals/SQLreference/WindowFunctions
- Extended with new window functions, syntax and hrefs.
- Added some insert commands to the example ranktest.
| Documentation missing Apr2019 new features | https://api.github.com/repos/MonetDB/MonetDB/issues/6705/comments | 0 | 2020-11-30T16:34:16Z | 2024-06-27T13:06:03Z | https://github.com/MonetDB/MonetDB/issues/6705 | 753,625,788 | 6,705 |
[
"MonetDB",
"MonetDB"
] | # Deleted Bugzilla Bug
Date: 2020-11-30T16:22:43Z
This bug was created during the import from Bugzilla.
GitHub Issues Tracker allows to assign consecutive
ids only. So this dummy issue was created in place of
a deleted Bugzilla Bug.
Please ignore this report.
| Deleted Bugzilla Bug | https://api.github.com/repos/MonetDB/MonetDB/issues/6704/comments | 0 | 2020-11-30T16:34:13Z | 2020-11-30T16:34:15Z | https://github.com/MonetDB/MonetDB/issues/6704 | 753,625,757 | 6,704 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-26 13:50:53 +0200
From: @swingbit
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
CC: @njnes
Last updated: 2019-09-02 16:05:28 +0200
## Comment 26975
Date: 2019-04-26 13:50:53 +0200
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Build Identifier:
The script in attachment contains a partial DB schema and a query. No data.
It makes MonetDB (Aug2018-SP2) crash.
According to gdb the SQL optimizer calls function flatten_dep in an endless loop, eventually crashing:
...
...
32663 0x00007f7311917ff6 in flatten_dep (nrefs=0x7f72e4334170, refs=0x7f72e4331660, nr=0, deps=0x7f72e4334150 "", n=5) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6361
32664 0x00007f7311917ff6 in flatten_dep (nrefs=0x7f72e4334170, refs=0x7f72e4331660, nr=3, deps=0x7f72e4334150 "", n=5) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6361
32665 0x00007f7311917ff6 in flatten_dep (nrefs=0x7f72e4334170, refs=0x7f72e4331660, nr=0, deps=0x7f72e4334150 "", n=5) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6361
32666 0x00007f7311917ff6 in flatten_dep (nrefs=0x7f72e4334170, refs=0x7f72e4331660, nr=3, deps=0x7f72e4334150 "", n=5) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6361
32667 0x00007f7311917ff6 in flatten_dep (nrefs=0x7f72e4334170, refs=0x7f72e4331660, nr=0, deps=0x7f72e4334150 "", n=5) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6361
32668 0x00007f731191812a in flatten_dep_graph (sql=0x7f72e4006bb0, deps=0x7f72e4334150 "", refs=0x7f72e4331660) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6377
32669 0x00007f7311918290 in rel_dependencies (sql=0x7f72e4006bb0, refs=0x7f72e4331660) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6395
32670 0x00007f7311918cc7 in rel_dce (sql=0x7f72e4006bb0, rel=0x7f72e41f47a0) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:6661
32671 0x00007f7311924b61 in optimize_rel (sql=0x7f72e4006bb0, rel=0x7f72e41f47a0, g_changes=0x7f72ed09c890, level=0, value_based_opt=1) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:9372
32672 0x00007f7311924df4 in optimize (sql=0x7f72e4006bb0, rel=0x7f72e41f47a0, value_based_opt=1) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:9445
32673 0x00007f7311924e6b in rel_optimizer (sql=0x7f72e4006bb0, rel=0x7f72e41f47a0, value_based_opt=1) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/server/rel_optimizer.c:9453
32674 0x00007f73117eee0c in sql_symbol2relation (c=0x7f72e4006bb0, sym=0x7f72e4390df0) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/backends/monet5/sql.c:122
32675 0x00007f731180fe56 in SQLparser (c=0x7f73121d7368) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/sql/backends/monet5/sql_scenario.c:1202
32676 0x00007f7320d6a7a8 in runPhase (c=0x7f73121d7368, phase=1) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/mal/mal_scenario.c:510
32677 0x00007f7320d6a8b1 in runScenarioBody (c=0x7f73121d7368, once=0) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/mal/mal_scenario.c:532
32678 0x00007f7320d6ab7f in runScenario (c=0x7f73121d7368, once=0) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/mal/mal_scenario.c:569
32679 0x00007f7320d6c950 in MSserveClient (dummy=0x7f73121d7368) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/mal/mal_session.c:519
32680 0x00007f7320d6c412 in MSscheduleClient (command=0x7f72e4009170 '\333' <repeats 160 times>, "\300", challenge=0x7f72ed09cd2b "9ITGaphTOc", fin=0x7f72e400b2a0, fout=0x7f72e8002e50, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/mal/mal_session.c:397
32681 0x00007f7320e0ec00 in doChallenge (data=0x7f72e8000b30) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/monetdb5/modules/mal/mal_mapi.c:279
32682 0x00007f7320bcaa54 in thread_starter (arg=0x2626100) at /home/roberto/MonetDBServer/MonetDB.Spinque_Aug2018/src/gdk/gdk_system.c:492
32683 0x00007f731fdcb58e in start_thread () from /lib64/libpthread.so.0
32684 0x00007f731fcf8683 in clone () from /lib64/libc.so.6
Reproducible: Always
$ mserver5 --version
MonetDB 5 server v11.31.14 (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 15.5GiB available memory, 8 available cpu cores
Libraries:
libpcre: 8.43 2019-02-23 (compiled with 8.43)
openssl: OpenSSL 1.1.1b FIPS 26 Feb 2019 (compiled with OpenSSL 1.1.1b FIPS 26 Feb 2019)
libxml2: 2.9.8 (compiled with 2.9.8)
Compiled by: roberto@photon.hq.spinque.com (x86_64-pc-linux-gnu)
Compilation: gcc -g3 -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wundef -Wformat=2 -Wformat-overflow=1 -Wno-format-truncation -Wno-format-nonliteral -Wno-cast-function-type -Winit-self -Winvalid-pch -Wmissing-declarations -Wmissing-format-attribute -Wmissing-prototypes -Wold-style-definition -Wpacked -Wunknown-pragmas -Wvariadic-macros -fstack-protector-all -Wstack-protector -Wpacked-bitfield-compat -Wsync-nand -Wjump-misses-init -Wmissing-include-dirs -Wlogical-op -Wduplicated-cond -Wduplicated-branches -Wrestrict -Wnested-externs -Wno-char-subscripts -Wunreachable-code
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
## Comment 26976
Date: 2019-04-26 13:53:00 +0200
From: @swingbit
Created attachment 617
SQL script to execute on empty DB
> Attached file: [bug6703.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6703_bug6703.sql_617) (application/sql, 7527 bytes)
> Description: SQL script to execute on empty DB
## Comment 26977
Date: 2019-05-01 12:45:57 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [c6c91400555f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c6c91400555f) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c6c91400555f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c6c91400555f)
Changeset description:
fixed bug #6703, ie only order the dependent referenced subqueries once
## Comment 26978
Date: 2019-05-01 12:50:21 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [f90ce3b09681](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f90ce3b09681) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f90ce3b09681](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f90ce3b09681)
Changeset description:
add test for bug #6703
## Comment 26979
Date: 2019-05-01 12:51:57 +0200
From: @njnes
fixed in the april branch. Dependent subqueries are order only once now.
| SQL optimizer enters loop and goes into stack overflow | https://api.github.com/repos/MonetDB/MonetDB/issues/6703/comments | 0 | 2020-11-30T16:34:09Z | 2024-06-27T13:06:02Z | https://github.com/MonetDB/MonetDB/issues/6703 | 753,625,705 | 6,703 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-26 13:16:48 +0200
From: Antoine.Carme
To: SQL devs <<bugs-sql>>
Version: -- development
CC: alexo15
Last updated: 2020-02-15 22:09:01 +0100
## Comment 26973
Date: 2019-04-26 13:16:48 +0200
From: Antoine.Carme
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier:
Hi,
I am working on a project translating mahien learning models in SQL. This project works well on the most used databases including MonteDB, of course.
https://github.com/antoinecarme/keras2sql
This issue here is to mention the absence of recursive CTE support in Monetdb (documented here : https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverview). I also found no issue in the bug tracker for this.
Recursive CTEs are useful to translate recurrent neural networks into SQL.
Some succesful usage of recursive CTEs is available here :
https://github.com/antoinecarme/keras2sql/issues/2
For a lot of databases, it is OK. Hive/Impala and MonetDB are missing.
I know this is not a very standard usage, but it does the job in a very elegant way (one unique SQL select statement for the whole neural network, tested).
Some code for postgresql :
https://github.com/antoinecarme/keras2sql/blob/master/demo/KerasClassifier_SimpleRNN/iris/pgsql/demo3_keras_KerasClassifier_SimpleRNN_pgsql.sql
The same for SQLite :
https://github.com/antoinecarme/keras2sql/blob/master/demo/KerasClassifier_SimpleRNN/iris/sqlite/demo3_keras_KerasClassifier_SimpleRNN_sqlite.sql
etc ...
Do you have plans to add this feature ?
Thanks in advance
Antoine
Reproducible: Always
## Comment 26974
Date: 2019-04-26 13:20:42 +0200
From: Antoine.Carme
Pleas read "translating machine learning models in SQL."
## Comment 26996
Date: 2019-05-04 08:51:00 +0200
From: Alex Ossipov <<alexo15>>
This is the same requirement as described in the bug #3347.
## Comment 26997
Date: 2019-05-04 11:47:09 +0200
From: Antoine.Carme
Alex,
Thanks a lot for your comment.
Bug #3347 was originally about a "CREATE FUNCTION" clause.
What I need is a "WITH RECURSIVE" clause that you describe properly in the bug #3347, comment 3.
IMHO, these two features are to be kept separate as they require different fixes (at least at the SQL syntactic level).
Cheers,
## Comment 27553
Date: 2020-02-15 22:09:01 +0100
From: Alex Ossipov <<alexo15>>
Antoine, I absolutely agree with your point and eager to see this implemented in upcoming releases so I dared raise importance of this feature
| Recursive CTE support (WITH Clause) | https://api.github.com/repos/MonetDB/MonetDB/issues/6702/comments | 0 | 2020-11-30T16:34:06Z | 2024-06-28T13:39:49Z | https://github.com/MonetDB/MonetDB/issues/6702 | 753,625,657 | 6,702 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-18 19:01:29 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <<bugs-sql>>
Version: -- development
CC: @njnes
Last updated: 2019-09-02 16:05:27 +0200
## Comment 26965
Date: 2019-04-18 19:01:29 +0200
From: Martin van Dinther <<martin.van.dinther>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier:
Note: this issue applies to version Apr2019 (compiled on 18 april)
When changing the schema name of a table, the id of the row in sys._tables is changed (possibly by adding a new row and removing the original row).
However any referencing rows from sys._columns.table_id, sys.keys.table_id, sys.objects, sys.idxs, sys.dependencies (and possibly more) to the old sys.tables.id are not changed/removed. They become orphaned rows which is not allowed/correct. Referential integrity of system tables is violated.
Reproducible: Always
### Steps to Reproduce:
-- First check that no invalid FK references exist in the db. All next queries should return zero rows:
SELECT * FROM sys.columns WHERE table_id NOT IN (SELECT id FROM sys.tables);
SELECT * FROM sys._columns WHERE table_id NOT IN (SELECT id FROM sys._tables);
SELECT * FROM sys.keys WHERE table_id NOT IN (SELECT id FROM sys.tables);
SELECT * FROM sys.objects WHERE id NOT IN (SELECT id FROM sys.ids);
SELECT * FROM sys.idxs WHERE table_id NOT IN (SELECT id FROM sys.tables);
SELECT * FROM sys.dependencies WHERE id NOT IN (SELECT id FROM sys.ids);
SELECT * FROM sys.dependencies WHERE depend_id NOT IN (SELECT id FROM sys.ids);
-- create a table with a serial column (which implicitly createa a primary key constraint and index and a sequence)
create table sys.test2 (col1 serial);
select * from tables where name = 'test2'
-- 1 row: test2 (id = 9046)
select * from keys where table_id in (select id from tables where name = 'test2')
-- 1 row: test2_col1_pkey
select * from objects where id in (select id from keys where table_id in (select id from tables where name = 'test2'))
-- 1 row: col1
ALTER TABLE sys.test2 SET SCHEMA profiler;
select * from tables where name = 'test2'
-- 1 row: test2. NOTE that the id has changed from 9046 into 9048
select * from keys where table_id in (select id from tables where name = 'test2')
-- 1 row: test2_col1_pkey
select * from objects where id in (select id from keys where table_id in (select id from tables where name = 'test2'))
-- 2 rows! which are also identical: col1
ALTER TABLE profiler.test2 SET SCHEMA json;
select * from tables where name = 'test2'
-- 1 row: test2. NOTE that the id has changed from 9048 into 9050
select * from keys where table_id in (select id from tables where name = 'test2')
-- 1 row: test2_col1_pkey
select * from objects where id in (select id from keys where table_id in (select id from tables where name = 'test2'))
-- 3 rows! which are also identical: col1
ALTER TABLE json.test2 SET SCHEMA sys;
select * from tables where name = 'test2'
-- 1 row: test2. NOTE that the id has changed from 9050 into 9052
select * from keys where table_id in (select id from tables where name = 'test2')
-- 1 row: test2_col1_pkey
select * from objects where id in (select id from keys where table_id in (select id from tables where name = 'test2'))
-- 4 rows! which are also identical: col1
-- Now repeat the invalid FK references exist in the db. All next queries should return zero rows:
SELECT * FROM sys.columns WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 3 invalid rows
SELECT * FROM sys._columns WHERE table_id NOT IN (SELECT id FROM sys._tables);
-- lists 3 invalid rows
SELECT * FROM sys.keys WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 3 invalid rows
SELECT * FROM sys.objects WHERE id NOT IN (SELECT id FROM sys.ids);
-- lists 3 invalid rows
SELECT * FROM sys.idxs WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 3 invalid rows
SELECT * FROM sys.dependencies WHERE id NOT IN (SELECT id FROM sys.ids);
SELECT * FROM sys.dependencies WHERE depend_id NOT IN (SELECT id FROM sys.ids);
drop table sys.test2;
-- Now repeat the invalid FK references exist in the db. All next queries should return zero rows:
SELECT * FROM sys.columns WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 4 invalid rows
SELECT * FROM sys._columns WHERE table_id NOT IN (SELECT id FROM sys._tables);
-- lists 4 invalid rows
SELECT * FROM sys.keys WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 4 invalid rows
SELECT * FROM sys.objects WHERE id NOT IN (SELECT id FROM sys.ids);
-- lists 4 invalid rows
SELECT * FROM sys.idxs WHERE table_id NOT IN (SELECT id FROM sys.tables);
-- lists 4 invalid rows
SELECT * FROM sys.dependencies WHERE id NOT IN (SELECT id FROM sys.ids);
SELECT * FROM sys.dependencies WHERE depend_id NOT IN (SELECT id FROM sys.ids);
-- now try to recreate the dropped table
create table sys.test2 (col1 serial);
-- it produces Error: CONSTRAINT PRIMARY KEY: key test2_col1_pkey already exists SQLState: 42000
### Actual Results:
Orphaned rows found in many sys.* tables which violate referential integrity.
Recreating of the table after dropping it first, fails.
### Expected Results:
No orphaned rows (invalid FKs) should be created after executing
ALTER TABLE qname SET SCHEMA ident;
After dropping the table, it should be possible to create the table again without the constraint error.
FYI: You can list the invalid rows by executing the queries in
sql/test/sys-schema/Tests/check_ForeignKey_referential_integrity.sql
## Comment 26966
Date: 2019-04-18 19:32:43 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [f02c941f4e25](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f02c941f4e25) made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f02c941f4e25](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f02c941f4e25)
Changeset description:
Add test and desired output for bug #6701
## Comment 26971
Date: 2019-04-25 17:04:56 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [a903388a5459](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a903388a5459) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a903388a5459](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a903388a5459)
Changeset description:
Fixes for bug #6701. Instead of recreating the table, we add the schema change in the transaction level and apply it before any schema changes.
The case of a table changing it's schema twice during the transaction is not handled properly yet, but anyway it's a rare case.
| When changing the schema name of a table, referencing rows from sys.columns, sys.keys and more tables are not removed | https://api.github.com/repos/MonetDB/MonetDB/issues/6701/comments | 0 | 2020-11-30T16:34:01Z | 2024-06-27T13:06:00Z | https://github.com/MonetDB/MonetDB/issues/6701 | 753,625,605 | 6,701 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-18 18:58:25 +0200
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @njnes
Last updated: 2019-11-28 10:00:02 +0100
## Comment 26963
Date: 2019-04-18 18:58:25 +0200
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36
Build Identifier:
3 bugs that occur when executing a subselect which is ‘joined’ to the outer query. It is possible these are all symptoms of the same underlying bug.
Setup
To Illustrate the issues, we will be using the following two tables
create table "testTable1" (
"A" varchar(255),
"B" varchar(255)
);
insert into "testTable1" values ('Cat1', 'Cat1');
insert into "testTable1" values ('Cat2', 'Cat2');
insert into "testTable1" values ('Cat3', 'Cat1');
create table "testTable2" (
"A" varchar (255),
"B" double
);
insert into "testTable2" values ('Cat1', 2);
insert into "testTable2" values ('Cat2', 3);
insert into "testTable2" values ('Cat2', 4);
insert into "testTable2" values (null, null);
Bug #1: wrong results in subselect count
Q1:
select "A", "B", (
select count(1)
from "testTable1" "inner"
where ("inner"."B" = "outer"."A")
) from "testTable1" "outer"
A B L40
-----------------
Cat1 Cat1 2
Cat2 Cat2 1
Cat3 Cat1 1
The last row is wrong: because there are no records whose value of “B” is ‘Cat3’ I was expecting:
A B L40
----------------
Cat1 Cat1 2
Cat2 Cat2 1
Cat3 Cat1 0
Bug #2: records disappearing from outer select
Q2:
select "A", "B", (
select count(1)
from "testTable1" "inner"
where ("inner"."B" = "outer"."A") and ("outer"."A" is not null)
) from "testTable1" "outer"
Because none of the cells are null, this is equivalent to Q1 above.
Yet, a record disappears from the output, now containing just 2 records:
A B L40
-----------------
Cat1 Cat1 2
Cat2 Cat2 1
whereas it should be the same as the expected results for Q1.
Bug #3: No records in the output if the condition in the subselect is false.
Q3:
select "A", "B", (
select sum("B")
from "testTable2" "inner"
where (
"inner"."A" = "outer"."A" or
("inner"."A" is null and "outer"."A" is null)
)
) from "testTable2" "outer"
Returns
A B L7
---------------------------
Cat1 2 2
Cat2 3 7
<null> <null> <null>
Cat2 4 7
Which is the correct result, however by changing the where condition however, it is possible to make records disappear from the output. For example:
Q4
select "A", "B", (
select sum("B")
from "testTable2" "inner"
where (
"inner"."A" = "outer"."A" or
("inner"."A" is null and "outer"."A" is null)
) and ("A" = 'Cat7')
) from "testTable2" "outer"
Here the subquery has no records matching its constraints. I expect all 4 records in the outer query to appear. But it returns just one record:
A B L7
------------------------------
<null> <null> <null>
And
Q5
select "A", "B", (
select sum("B")
from "testTable2" "inner"
where (
"inner"."A" = "outer"."A" or
("inner"."A" is null and "outer"."A" is null)
) and (true = false)
) from "testTable2" "outer"
Returns no records
A B L7
---------------------
In both cases (Q4 and Q5) I was expecting
A B L7
----------------------------------
Cat1 2 <null>
Cat2 3 <null>
Cat2 4 <null>
<null> <null> <null>
Note that in all these cases other vendors (e.g. PostgreSQL) provide the expected results.
Reproducible: Always
### Steps to Reproduce:
1. Create tables testTable1 and testTable2 as in description
2. Execute Queries Q1 - Q5
Q1:
select "A", "B", (
select count(1)
from "testTable1" "inner"
where ("inner"."B" = "outer"."A")
) from "testTable1" "outer"
Q2:
select "A", "B", (
select count(1)
from "testTable1" "inner"
where ("inner"."B" = "outer"."A") and ("outer"."A" is not null)
) from "testTable1" "outer"
Q4:
select "A", "B", (
select sum("B")
from "testTable2" "inner"
where (
"inner"."A" = "outer"."A" or
("inner"."A" is null and "outer"."A" is null)
) and ("A" = 'Cat7')
) from "testTable2" "outer"
Q5
select "A", "B", (
select sum("B")
from "testTable2" "inner"
where (
"inner"."A" = "outer"."A" or
("inner"."A" is null and "outer"."A" is null)
) and (true = false)
) from "testTable2" "outer"
### Actual Results:
Q1:
A B L40
-----------------
Cat1 Cat1 2
Cat2 Cat2 1
Cat3 Cat1 1
Q2:
A B L40
-----------------
Cat1 Cat1 2
Cat2 Cat2 1
Q4:
A B L7
------------------------------
<null> <null> <null>
Q5:
A B L7
---------------------
### Expected Results:
Q1:
A B L40
----------------
Cat1 Cat1 2
Cat2 Cat2 1
Cat3 Cat1 0
Q2:
A B L40
----------------
Cat1 Cat1 2
Cat2 Cat2 1
Cat3 Cat1 0
Q4 and Q5:
A B L7
----------------------------------
Cat1 2 <null>
Cat2 3 <null>
Cat2 4 <null>
<null> <null> <null>
I will attach a pdf with a document. Happy to share the google drive version of the document with anyone interested so we can use comments and annotations (I just need the email of the people interested)
## Comment 26964
Date: 2019-04-18 18:59:12 +0200
From: Manuel <<manuel>>
Created attachment 616
The document describing the issue
> Attached file: [Monetdb Bugs in Subselect statements..pdf](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6700_Monetdb_Bugs_in_Subselect_statements..pdf_616) (application/pdf, 94432 bytes)
> Description: The document describing the issue
## Comment 26968
Date: 2019-04-24 08:47:31 +0200
From: Manuel <<manuel>>
any thoughts ? Thanks in advance!
## Comment 26969
Date: 2019-04-24 09:51:03 +0200
From: @sjoerdmullender
There is an effort underway to improve subquery support. This is being done in the subquery branch. Once this has improved enough, this branch will be merged into the default branch, ready for the next (after the April 2019 release) feature release.
In that branch, most of the problems you describe have been fixed. The two queries that don't work according to your description are the two that use count(1). If you were to replace those with count(*), the queries give the correct result (in the subquery branch).
## Comment 26970
Date: 2019-04-24 09:51:19 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [0f31cba8de23](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f31cba8de23) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0f31cba8de23](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0f31cba8de23)
Changeset description:
Add test for bug #6700.
## Comment 26972
Date: 2019-04-26 11:39:29 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [b25399891430](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b25399891430) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b25399891430](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b25399891430)
Changeset description:
fixed bug #6700 (is handle count(1) with outer ref like count(*))
approved output
## Comment 26980
Date: 2019-05-01 12:54:51 +0200
From: @njnes
fixed in default. subquery handling has been reimplemented
| Monetdb Bugs in Subselect statements: | https://api.github.com/repos/MonetDB/MonetDB/issues/6700/comments | 0 | 2020-11-30T16:33:57Z | 2024-06-27T13:05:59Z | https://github.com/MonetDB/MonetDB/issues/6700 | 753,625,546 | 6,700 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-17 23:10:52 +0200
From: Simon AUBERT <<simon.aubert>>
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
Last updated: 2019-04-18 10:34:02 +0200
## Comment 26960
Date: 2019-04-17 23:10:52 +0200
From: Simon AUBERT <<simon.aubert>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
Hello,
I use mclient to bulk load some files on monetdb. I can specify in the command line the user, the server, the file, etc... but not my password. My use case it to use schedule task, during the night, without someone writing the password.
Reproducible: Always
## Comment 26961
Date: 2019-04-18 10:34:02 +0200
From: @sjoerdmullender
You can use the ~/.monetdb file for this, or use a different file and have the DOTMONETDBFILE environment variable point to this file.
In the file, you can specify the name of the database, the user, and the password.
The content of the file should be something like (all lines are optional):
user=monetdb
password=xyzzy
language=sql
database=plugh
See https://www.monetdb.org/Documentation/mclient-man-page
The reason for not allowing the password on the command line is security: other users can see the arguments of your programs, so that would reveal the password.
I hope this will solve your issue.
| Specify password on mclient for command line | https://api.github.com/repos/MonetDB/MonetDB/issues/6699/comments | 0 | 2020-11-30T16:33:53Z | 2024-06-28T13:39:48Z | https://github.com/MonetDB/MonetDB/issues/6699 | 753,625,497 | 6,699 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-16 21:29:36 +0200
From: Anton Kravchenko <<kravchenko.anton86>>
To: SQL devs <<bugs-sql>>
Version: -- development
CC: martin.van.dinther
Last updated: 2019-05-09 16:28:04 +0200
## Comment 26957
Date: 2019-04-16 21:29:36 +0200
From: Anton Kravchenko <<kravchenko.anton86>>
ALTER TABLE table_name SET SCHEMA new_schema;
## Comment 27004
Date: 2019-05-09 16:28:04 +0200
From: Martin van Dinther <<martin.van.dinther>>
We added possibility in Apr2019 release to change the schema of a table via:
ALTER TABLE [ IF EXISTS ] qname SET SCHEMA ident;
For example:
CREATE TABLE sys.test1 (col1 int);
SELECT * FROM sys.test1;
ALTER TABLE sys.test1 SET SCHEMA profiler;
SELECT * FROM profiler.test1;
ALTER TABLE profiler.test1 SET SCHEMA json;
SELECT * FROM json.test1;
ALTER TABLE IF EXISTS json.test1 SET SCHEMA sys;
SELECT * FROM sys.test1;
DROP TABLE sys.test1;
| Move a table between schemas | https://api.github.com/repos/MonetDB/MonetDB/issues/6698/comments | 0 | 2020-11-30T16:33:50Z | 2024-06-27T13:05:57Z | https://github.com/MonetDB/MonetDB/issues/6698 | 753,625,465 | 6,698 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-16 13:56:51 +0200
From: @yzchang
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.13 (Aug2018-SP2)
CC: @mlkersten, @yzchang
Last updated: 2020-11-13 18:48:19 +0100
## Comment 26954
Date: 2019-04-16 13:56:51 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Safari/605.1.15
Build Identifier:
The attached query has 40+ conditions in its CASE statement. Its EXPLAIN output shows that from the 13th ifthenelse, the duplicate ">" operations are not eliminated.
Reproducible: Always
### Steps to Reproduce:
1. run the attached query to get the EXPLAIN output
## Comment 26955
Date: 2019-04-16 13:58:44 +0200
From: @yzchang
Created attachment 615
query with 40+ CASE conditions
> Attached file: [task.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6697_task.sql_615) (text/plain, 7645 bytes)
> Description: query with 40+ CASE conditions
## Comment 26956
Date: 2019-04-16 14:06:59 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [e98be92db6cd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e98be92db6cd) made by Ying Zhang <y.zhang@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e98be92db6cd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e98be92db6cd)
Changeset description:
Added test for Bug #6697
Stable output will be added later, because it's too long to be manually approved.
## Comment 27185
Date: 2019-07-28 20:50:54 +0200
From: @mlkersten
The latest version of the commonterms optimizer finds them.
## Comment 28269
Date: 2020-11-13 18:48:19 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [a7375b1dec39](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7375b1dec39) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a7375b1dec39](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a7375b1dec39)
Changeset description:
Use traces instead of explain statements for duplicates-not-eliminated-long-CASE-stmt.Bug-6697 test
| Duplicate expressions not eliminated with long CASE statement | https://api.github.com/repos/MonetDB/MonetDB/issues/6697/comments | 0 | 2020-11-30T16:33:46Z | 2024-06-27T13:05:56Z | https://github.com/MonetDB/MonetDB/issues/6697 | 753,625,413 | 6,697 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-13 22:58:28 +0200
From: @mlkersten
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.13 (Aug2018-SP2)
Last updated: 2019-04-30 12:36:03 +0200
## Comment 26951
Date: 2019-04-13 22:58:28 +0200
From: @mlkersten
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier:
Recognize the BAT type coercion to simplify re-execution of MAL explain plans.
flag it as error if incompatible with definition
function user.s4_1():void;
X_111:bat[:lng] := bat.new(nil:lng);
(X_115:bat[:lng], X_116:bat[:oid], X_117:bat[:oid]) := algebra.sort(X_111:bat[:lng], false:bit, false:bit, false:bit);
end user.s4_1;
Reproducible: Always
## Comment 26952
Date: 2019-04-14 08:30:37 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [537dd6e93167](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=537dd6e93167) made by Martin Kersten <mk@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=537dd6e93167](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=537dd6e93167)
Changeset description:
Add test case for bug #6696
## Comment 26953
Date: 2019-04-14 22:30:57 +0200
From: @mlkersten
Issue solved by extending the MAL parser
| Re-use of MAL explain plans with complex type coercions | https://api.github.com/repos/MonetDB/MonetDB/issues/6696/comments | 0 | 2020-11-30T16:33:43Z | 2024-06-27T13:05:55Z | https://github.com/MonetDB/MonetDB/issues/6696 | 753,625,390 | 6,696 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-04-13 21:59:35 +0200
From: @mlkersten
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.13 (Aug2018-SP2)
CC: castro8583bennett
Last updated: 2019-11-28 10:00:06 +0100
## Comment 26949
Date: 2019-04-13 21:59:35 +0200
From: @mlkersten
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier:
missing bulk operators for
X_341:bat[:timestamp] := mal.manifold("mtime":str,"timestamp_add_msec_interval":str, X_313:bat[:timestamp], -28800000:lng);
X_2717:bat[:str] := mal.manifold("mtime":str, "timestamp_to_str":str, X_2715:bat[:timestamp], "%W":str);
The code also illustrates missing common expressions.
Added to BugTracker-2019
Reproducible: Always
## Comment 26950
Date: 2019-04-13 22:01:12 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [c8750b195d3e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8750b195d3e) made by Martin Kersten <mk@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c8750b195d3e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c8750b195d3e)
Changeset description:
Test case for bug #6695
## Comment 27020
Date: 2019-06-04 10:37:22 +0200
From: @sjoerdmullender
Test is missing.
## Comment 27022
Date: 2019-06-04 12:00:51 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [0386cc50dd03](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0386cc50dd03) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0386cc50dd03](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0386cc50dd03)
Changeset description:
Implemented bulk versions of mtime.timestamp_{add,sub}_msec_interval.
This fixes bug #6695.
## Comment 27141
Date: 2019-07-16 04:12:59 +0200
From: Castro B <<castro8583bennett>>
Thank you monet so your basically saying that if ill do that it will work?
Castro B,
https://sparpedia.at
| timestamp transformation | https://api.github.com/repos/MonetDB/MonetDB/issues/6695/comments | 0 | 2020-11-30T16:33:41Z | 2024-06-27T13:05:54Z | https://github.com/MonetDB/MonetDB/issues/6695 | 753,625,359 | 6,695 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-28 09:22:16 +0100
From: Ferenc Sipos <<ferenc.sipos>>
To: clients devs <<bugs-clients>>
Version: 11.31.13 (Aug2018-SP2)
CC: ferenc.sipos
Duplicates: #6678
Last updated: 2019-04-03 20:37:50 +0200
## Comment 26945
Date: 2019-03-28 09:22:16 +0100
From: Ferenc Sipos <<ferenc.sipos>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
Build Identifier:
When I try to insert record with null date, Monet ODBC throws syntax error exception. According to the documentation (https://docs.microsoft.com/en-us/dotnet/api/system.data.odbc.odbcparameter.isnullable?view=netframework-4.7.2) I tried the following code snippet:
parameter.IsNullable = true;
parameter.Value = DBNull.Value;
Unfortunately it doesn't work. As a workaround I tried a fake datetime instead of null value:
parameter.Value = DateTime.MinValue;
and it works.
Reproducible: Always
### Steps to Reproduce:
1. Create a table that contains date field.
2. Create a parametrized INSERT query and add null value parameter for the date field.
3. Execute the query.
### Actual Results:
ODBC throws syntax error exception:
ERROR [42000] [MonetDB][ODBC Driver 11.31.13]syntax error, unexpected IDENT, expecting ')' or ',' in: "execute 9
### Expected Results:
ODBC inserts the record which contains null value.
MonetDB 5 server v11.31.13 "Aug2018-SP2" (64-bit)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 15.7GiB available memory, 4 available cpu cores
Libraries:
libpcre: 8.41 2017-07-05
openssl: OpenSSL 1.1.0g 2 Nov 2017
libxml2: 2.9.8
Compiled by: monet@LAB03 (x86_64-pc-winnt)
Compilation: cl -GF -W3 -WX -MD -nologo -Ox -Zi -Oi
Linking : cl -GF -W3 -WX -MD -nologo -Ox -Zi -Oi
## Comment 26946
Date: 2019-04-03 20:37:50 +0200
From: @sjoerdmullender
*** This bug has been marked as a duplicate of bug #6678 ***
| parametrized insert with null date causes syntax error | https://api.github.com/repos/MonetDB/MonetDB/issues/6694/comments | 0 | 2020-11-30T16:33:37Z | 2024-06-28T13:10:09Z | https://github.com/MonetDB/MonetDB/issues/6694 | 753,625,320 | 6,694 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-20 17:42:32 +0100
From: Wouter <<wouter>>
To: clients devs <<bugs-clients>>
Version: 11.31.13 (Aug2018-SP2)
CC: martin.van.dinther, @PedroTadim
Last updated: 2019-09-26 17:19:39 +0200
## Comment 26936
Date: 2019-03-20 17:42:32 +0100
From: Wouter <<wouter>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
We've been using the JDBC driver for years, but only recently we noticed a very nasty concurrency issue (the bug probably has been there all these years). We managed to reproduce it on various servers by just repeating the same test (sequentially, no parallelism). Some machines hang after a few attempts, some hang only after 1000's of attempts. It is not clear when a machine fails quickly, and when not.
The attached script triggers the issue eventually. The script intermittently does short and long queries (insert with blob of 9000 characters).
Tested with monetdb-jdbc-2.28.
Reproducible: Sometimes
### Steps to Reproduce:
1. run script
2. wait until it stops
### Actual Results:
it stops without completing, the jdbcclient is always at the same point:
main:
[1] java.net.SocketInputStream.socketRead0 (native method)
[2] java.net.SocketInputStream.socketRead (SocketInputStream.java:116)
[3] java.net.SocketInputStream.read (SocketInputStream.java:170)
[4] java.net.SocketInputStream.read (SocketInputStream.java:141)
[5] java.io.BufferedInputStream.fill (BufferedInputStream.java:246)
[6] java.io.BufferedInputStream.read1 (BufferedInputStream.java:286)
[7] java.io.BufferedInputStream.read (BufferedInputStream.java:345)
[8] nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream._read (null)
[9] nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.readBlock (null)
[10] nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.read (null)
[11] sun.nio.cs.StreamDecoder.readBytes (StreamDecoder.java:284)
[12] sun.nio.cs.StreamDecoder.implRead (StreamDecoder.java:326)
[13] sun.nio.cs.StreamDecoder.read (StreamDecoder.java:178)
[14] java.io.InputStreamReader.read (InputStreamReader.java:184)
[15] java.io.BufferedReader.fill (BufferedReader.java:161)
[16] java.io.BufferedReader.readLine (BufferedReader.java:324)
[17] java.io.BufferedReader.readLine (BufferedReader.java:389)
[18] nl.cwi.monetdb.mcl.io.BufferedMCLReader.readLine (null)
[19] nl.cwi.monetdb.mcl.io.BufferedMCLReader.waitForPrompt (null)
[20] nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery (null)
[21] nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.processQuery (null)
[22] nl.cwi.monetdb.jdbc.MonetStatement.internalExecute (null)
[23] nl.cwi.monetdb.jdbc.MonetStatement.execute (null)
[24] nl.cwi.monetdb.client.JdbcClient.executeQuery (null)
[25] nl.cwi.monetdb.client.JdbcClient.processInteractive (null)
[26] nl.cwi.monetdb.client.JdbcClient.main (null)
### Expected Results:
It should complete the 100.000 runs without hanging.
The script intermittently does short and long queries (insert with blob of 9000 characters). This makes it probably related to the SendThread, which is started when a query is longer than 8190 bytes.
Note: severity is set to critical, as "the software hangs".
## Comment 26937
Date: 2019-03-20 17:43:31 +0100
From: Wouter <<wouter>>
Created attachment 614
script to let jdbcclient hang (eventually)
> Attached file: [jdbc_bug_script.txt](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6693_jdbc_bug_script.txt_614) (text/plain, 745 bytes)
> Description: script to let jdbcclient hang (eventually)
## Comment 26938
Date: 2019-03-20 17:46:22 +0100
From: Wouter <<wouter>>
The attached script has been distilled from a java program. In the java program, we do an actual "conn.commit();" instead of running the "COMMIT;" SQL query. In that java program it always hangs at the following location:
19 daemon prio=5 os_prio=0 tid=0x00007f0c144d7000 nid=0x1e runnable [0x00007f0bd41c6000]
java.lang.Thread.State: RUNNABLE
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
- locked <0x000000064793f030> (a java.io.BufferedInputStream)
at nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream._read(Unknown Source)
at nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.readBlock(Unknown Source)
at nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.read(Unknown Source)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
- locked <0x000000064794f0e0> (a java.io.InputStreamReader)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
- locked <0x000000064794f0e0> (a java.io.InputStreamReader)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at nl.cwi.monetdb.mcl.io.BufferedMCLReader.readLine(Unknown Source)
at nl.cwi.monetdb.mcl.io.BufferedMCLReader.waitForPrompt(Unknown Source)
- locked <0x000000064794f0a8> (a nl.cwi.monetdb.mcl.io.BufferedMCLReader)
at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery(Unknown Source)
- locked <0x000000064793ed98> (a nl.cwi.monetdb.mcl.net.MapiSocket)
at nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.processQuery(Unknown Source)
at nl.cwi.monetdb.jdbc.MonetConnection.sendTransactionCommand(Unknown Source)
at nl.cwi.monetdb.jdbc.MonetConnection.commit(Unknown Source)
## Comment 26939
Date: 2019-03-20 17:48:28 +0100
From: Wouter <<wouter>>
My analysis of the issue: the client seems to be waiting for new data from the server, while the server thinks it's already done.
My guess it that it has to do with the code in MonetConnection.java around line 2704, but I also suspect there is something wrong in BufferedMCLWriter.writeLine. It sets a state in the reader (.setLineType(null)), while the two threads (reader and writer) don't really synchronize.
## Comment 27167
Date: 2019-07-24 17:28:52 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset 368078840ddf, made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=368078840ddf
Changeset description:
Adding jdbc test for bugs 6517 and 6693 (hanging JDBC-driver problem)
## Comment 27169
Date: 2019-07-25 16:08:39 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset 637899bda602, made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=637899bda602
Changeset description:
Removed SendThread class and its usage from MonetConnection.
It appeared the usage of a SendThread object (per connection) resulted sometimes to a non-responding/hanging JDBC connection, see bugs 6571 and 6693.
Tests with large query scripts and large results returned show that the SendThread class is not needed in the JDBC driver to function properly.
Also submitter of bug #6693 verified that the removal of SendThread resolved the hanging JDBC-driver problem without any side effects.
## Comment 27327
Date: 2019-09-26 17:19:39 +0200
From: Martin van Dinther <<martin.van.dinther>>
This is fixed in the new: monetdb-jdbc-2.29.jre7.jar release.
It is downloadable from https://www.monetdb.org/downloads/Java/
| mix of long and short queries make JDBC-driver hang | https://api.github.com/repos/MonetDB/MonetDB/issues/6693/comments | 0 | 2020-11-30T16:33:33Z | 2024-06-27T13:05:52Z | https://github.com/MonetDB/MonetDB/issues/6693 | 753,625,267 | 6,693 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-18 10:46:51 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
Last updated: 2019-03-18 10:46:51 +0100
## Comment 26924
Date: 2019-03-18 10:46:51 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
Say we want to import values from a csv file into a subset of the columns of some table. The user can use undocumented syntax involving column lists to specify where to import what.
However the syntax is a bit verbose and could be improved with some better default behaviour and/or better error handling. Plus there should be an entry in the documentation that specifies how this work because it is a very useful feature to exhibit.
Reproducible: Always
### Steps to Reproduce:
1.create table foo (k int auto_increment, i int, s string);
2.copy into foo (i, s) from '/home/aris/Sources/monetdb/sql/test/bugs/Tests/test.csv' delimiters ',', '\n', '''';
3.
### Actual Results:
Failed to import table 'foo', Column value 2 missing
### Expected Results:
2 affected rows --success!
--Use the same column list as specified for the table as a default for the column list associated to the csv file.
--or
Missing mandatory column list associated to csv file.
--or some better message than this
Please also update documentation.
| import with COPY INTO and missing column list for csv file has an unclear error message. | https://api.github.com/repos/MonetDB/MonetDB/issues/6692/comments | 1 | 2020-11-30T16:33:30Z | 2024-06-28T13:10:09Z | https://github.com/MonetDB/MonetDB/issues/6692 | 753,625,221 | 6,692 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-14 18:42:22 +0100
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @mlkersten, @PedroTadim
Last updated: 2019-09-12 13:14:58 +0200
## Comment 26922
Date: 2019-03-14 18:42:22 +0100
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.121 Safari/537.36
Build Identifier:
Using the tables
CREATE TABLE "sys"."test_join_left_table" (
"a" VARCHAR(255),
"b" VARCHAR(255),
"l_c" VARCHAR(255)
);
INSERT INTO "sys"."test_join_left_table" VALUES ('a1', 'b1', 'c1');
INSERT INTO "sys"."test_join_left_table" VALUES ('a2', 'b2', 'c2');
INSERT INTO "sys"."test_join_left_table" VALUES ('a3', 'b3', 'c3');
INSERT INTO "sys"."test_join_left_table" VALUES ('a4', 'b4', NULL);
CREATE TABLE "sys"."test_join_right_table" (
"r_c" VARCHAR(255),
"d" VARCHAR(255)
);
INSERT INTO "sys"."test_join_right_table" VALUES ('c1', 'd1');
INSERT INTO "sys"."test_join_right_table" VALUES ('c2', 'd2');
INSERT INTO "sys"."test_join_right_table" VALUES ('c5', 'd3');
INSERT INTO "sys"."test_join_right_table" VALUES (NULL, 'd4');
The query:
with "tj" as
(
select
'Left, Right' as "c5_supersource" ,
"tc"."L_C" as "cb_l_c" ,
"tc"."A" as "c8_a" ,
"tc"."B" as "c9_b" ,
"tc"."_visokio_row_id_" as "c6__visokio_row_id_",
"td"."D" as "ca_d" ,
"td"."_visokio_row_id_" as "c7__visokio_row_id__2"
from
(
select
"t4"."A" ,
"t4"."B" ,
"t4"."L_C",
"t4"."_visokio_row_id_"
from
"test_join_left_table" as "t4"
)
as "tc"
join
(
select
"t3"."R_C",
"t3"."D" ,
"t3"."_visokio_row_id_"
from
"test_join_right_table" as "t3"
)
as "td"
on
(
"tc"."L_C" = "td"."R_C"
or
(
"tc"."L_C" is null
and "td"."R_C" is null
)
)
order by
"c6__visokio_row_id_" asc,
"c7__visokio_row_id__2" asc
)
select
"c5_supersource" as "ce_supersource",
"cb_l_c" as "cf_l_c" ,
"c8_a" as "cg_a" ,
"c9_b" as "ch_b" ,
"ca_d" as "ci_d"
from
"tj"
causes Monetdb to crash with "Error in optimizer garbageCollector"
Reproducible: Always
### Steps to Reproduce:
1. Import the table, and execute the query
### Actual Results:
crash
## Comment 26923
Date: 2019-03-15 09:21:42 +0100
From: @mlkersten
This does not produce a problem on Linux and development branch.
Instead, it reports:
SELECT: no such column 't4.A'
| Crash when using order by in Table Expression | https://api.github.com/repos/MonetDB/MonetDB/issues/6691/comments | 0 | 2020-11-30T16:33:26Z | 2024-06-27T13:05:49Z | https://github.com/MonetDB/MonetDB/issues/6691 | 753,625,171 | 6,691 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-08 17:42:48 +0100
From: jpastuszek
To: clients devs <<bugs-clients>>
Version: 11.31.13 (Aug2018-SP2)
Last updated: 2019-04-30 12:36:04 +0200
## Comment 26917
Date: 2019-03-08 17:42:48 +0100
From: jpastuszek
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:66.0) Gecko/20100101 Firefox/66.0
Build Identifier:
ODBC SQLGetData call for empty string returns SQL_NO_DATA instead of empty string (buffer of "\0" or "\0\0" (UTF-16)) and SQL_SUCCESS result.
Reproducible: Always
### Steps to Reproduce:
1. Query "SELECT ''" and fetch
2. Call SQLGetData for column 1 and type SQL_C_CHAR
### Actual Results:
Returned result is SQL_NO_DATA
### Expected Results:
Returned result is SQL_SUCCESS and buffer is filled with one NULL byte (two NULL bytes for WCHAR case).
https://github.com/MonetDB/MonetDB/blob/c1904ad32054585575e6e28028ae608435282cc6/clients/odbc/driver/ODBCConvert.cL1285
Probably the check `if (irdrec->already_returned >= datalen) {` will be true for first call of SQLGetData on empty string as both values will be 0. SQL_NO_DATA is returned immediately and `copyString` will not be called in this case.
My client works correctly with SQL Server. Documentation (https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetdata-function?view=sql-server-2017) says "Returns SQL_NO_DATA if it has already returned all of the data for the column." which would suggest that SQL_NO_DATA should not be returned for the first time the SQLGetData is called.
## Comment 26918
Date: 2019-03-08 18:30:01 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [13337bea12f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=13337bea12f3) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=13337bea12f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=13337bea12f3)
Changeset description:
First time fetching data for a column, return it, even if zero length.
Fix for bug #6690.
## Comment 26919
Date: 2019-03-08 18:31:19 +0100
From: @sjoerdmullender
You completely nailed the problem. Fix was therefore easy.
| Unable to fetch empty string with ODBC driver | https://api.github.com/repos/MonetDB/MonetDB/issues/6690/comments | 0 | 2020-11-30T16:33:22Z | 2024-06-27T13:05:48Z | https://github.com/MonetDB/MonetDB/issues/6690 | 753,625,120 | 6,690 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-03-01 07:07:04 +0100
From: Akhilesh <<akhilesh.visouriya>>
To: SQL devs <<bugs-sql>>
Version: 11.27.13 (Jul2017-SP4)
CC: @aris-koning, arshad.super, martin.van.dinther, @njnes
Last updated: 2019-11-28 10:00:05 +0100
## Comment 26913
Date: 2019-03-01 07:07:04 +0100
From: Akhilesh <<akhilesh.visouriya>>
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36
Build Identifier:
We are trying to improve performance of a particular pattern of queries that is going against a 100 million row, 50 column Monet table (all columns defined as int datatype).
We are hosting the table on a server that has 132 cores and close to 1 TB of memory and data sitting on a high speed SSD.
The pattern of queries as follows –
Select (column 2), (column 3), (column4) from table X where column 1 IN (x,y,z,…………..100k ids) ;
where column 1 is the primary key for the table.
Above query takes an hour and half to complete. So we attempted various optimization approaches – we partitioned the table, ran order index on primary key but were not able to bring it to less than 40 mins.
We did notice that this particular query pattern with large list of members in IN clause is not using more than 1 core when executing. Other query patterns are using multiple cores.
Any suggestions on what we can possibly tune or look into?
Thanks
Reproducible: Always
### Steps to Reproduce:
1.We should have table of around 100 million rows and 50-100 columns(all columns defined as int datatype).
2.SQL queries with a large list of members in IN clause as per below example
Select (column 2), (column 3), (column4) from table X where column 1 IN (x,y,z,…………..100k ids) ;
### Actual Results:
Select (column 2), (column 3), (column4) from table X where column 1 IN (x,y,z,…………..100k ids) ;
query takes an hour and half to complete.
So we attempted various optimization approaches – we partitioned the table, ran order index on primary key but were not able to bring it to less than 40 mins.
We are noticing that particular query pattern with large list of members in IN clause is not using more than 1 core when executing. Other query patterns are using multiple cores.
## Comment 26916
Date: 2019-03-04 08:06:34 +0100
From: Arshad <<arshad.super>>
Hello,
I want to add few more details to what Akhilesh has provided. This is also seen by me on both "Jul2017-SP4" and "Aug2018-SP2".
Incidentally, The SQL is pretty much the same. That is Select with IN Clause with 150,000 IDS. Tried out with both sequential_pipe and default_pipe on both "Jul2017-SP4" and "Aug2018-SP2", and for both performance is same. Please do note that default_pipe on Aug2018-SP2 the performance does increase by mere 10 seconds not much.
Any hints/workaround for this kind of case. 150 Id's is for one of our smaller tables. The standard tables the size is pretty huge and it takes hours to complete. I have provided a 5000 Id's example in "reproducer" section, which takes greater than 2 mins. We tried debugging to see where it is getting slowed down and that info is provided below. We unfortunately cannot wait this long for results and would like your views/workaround on this.
Thanks,
Arshad
Debugging/System Details below
==============================
The SQL is very similar like below which is already given:
Select (column 2), (column 3), (column4) from table X where column 1 IN (x,y,z,…………..100k ids) ;
Tracing the SQL execution, what was seen was maximum time was taken in candscan_int(). The real wait is done under macro scan_sel(candscan, o = *candlist++, w = (BUN) ((*(oid *) Tloc(s,q?(q - 1):0)) + 1)). I am not sure if this is tree/BUN build up or build up/processing both.
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007f69c3952200 in candscan_int at gdk_select.c:850
breakpoint already hit 74100 times
c
2 breakpoint keep y 0x00007f69b2b2aa90 in exp_bin at rel_bin.c:345
breakpoint already hit 74631 times
c
3 breakpoint keep y 0x00007f69c396a9e0 in BATselect at gdk_select.c:1186
breakpoint already hit 74113 times
c
(gdb)
(gdb) Breakpoint 1, candscan_int (b=b@entry=0x7f699ed8b880, s=s@entry=0x7f699e8ece70, bn=bn@entry=0x7f699f0c31d0, tl=tl@entry=0x7f691d2ee818, th=th@entry=0x7f691d2ee818, equi=equi@entry=1, anti=anti@entry=0, r=r@entry=0, q=q@entry=82831, cnt=cnt@entry=0, off=off@entry=0, dst=dst@entry=0x7f691d32cde0, candlist=candlist@entry=0x7f691d4bbe00, maximum=maximum@entry=82831, use_imprints=use_imprints@entry=0, hval=<optimized out>, lval=<optimized out>, hi=<optimized out>, li=<optimized out>) at gdk_select.c:850
850 scan_sel(candscan, o = *candlist++, w = (BUN) ((*(oid *) Tloc(s,q?(q - 1):0)) + 1))
What was observed was that rel_bin() is first executed. Once that is finished candscan_int()->scan_sel() is called. The below top snapshot is taken when scan_sel() is running. This takes up 99% of the CPU.
top - 05:09:31 up 314 days, 6:26, 7 users, load average: 2.84, 2.86, 2.56
Threads: 7 total, 1 running, 6 sleeping, 0 stopped, 0 zombie
%Cpu(s): 2.4 us, 1.0 sy, 0.0 ni, 96.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 10562755+total, 982952 free, 56946828+used, 48582438+buff/cache
KiB Swap: 33554428 total, 9442496 free, 24111932 used. 48075398+avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
436748 monetad+ 20 0 26.939g 0.026t 0.026t R 99.3 2.6 1:06.53 mserver5
436482 monetad+ 20 0 26.939g 0.026t 0.026t S 0.3 2.6 0:00.07 mserver5
436463 monetad+ 20 0 26.939g 0.026t 0.026t S 0.0 2.6 0:00.06 mserver5
<snip>
My Server/system details:
=========================
$ mserver5 --version
MonetDB 5 server v11.31.13 "Aug2018-SP2" (64-bit)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2019 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 1007.3GiB available memory, 128 available cpu cores
Libraries:
libpcre: 8.32 2012-11-30 (compiled with 8.32)
openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2k-fips 26 Jan 2017)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: monetadmin@lnx1490.ch3.prod.i.com (x86_64-pc-linux-gnu)
Compilation: gcc -std=gnu99 -g -O2
Linking : /bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
Reproducible: Always
====================
### Steps to Reproduce:
/* Running SQL with 150K IN ids is very slow. Here query.sql has just 5000 IDS and it takes more than two minutes */
1.mclient -is -d DB -u USR < query.sql
### Actual Results:
password:
+------+
| L3 |
+======+
| 7408 |
+------+
1 tuple (133.6s)
### Expected Results:
It should be much quicker than 2 minutes.
## Comment 26931
Date: 2019-03-19 09:13:34 +0100
From: @aris-koning
Hi Arshad,
This is fixed in the current default branch. The current situation is that for every value in the in-value-list a separate select query is executed and merged into a result holder. The new implementation uses join mechanics which is much faster.
Kind regards,
Aris
## Comment 26940
Date: 2019-03-21 09:40:41 +0100
From: Arshad <<arshad.super>>
Hi Aris,
Thanks for the fix!!
Anytime soon new source tar ball will be released (SP3)? I currently do not have a hg setup with me, I always prefer a stable tar ball source release. So it will take some time before I could verify this. If you could please provide the bug ID against which the code went in, I can hand pick and patch the SP2 and test out.
Thanks
Arshad
## Comment 26941
Date: 2019-03-21 15:52:47 +0100
From: Martin van Dinther <<martin.van.dinther>>
As a workaround (till the fix has been released) for the query
Select c2, c3, c4 from X
where c1 IN (1,2,3,4,5,6,7,8,9,10);
you could try to use following query construct:
Select c2, c3, c4 from X
join (values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10)) as invalues(inval) on c1 = inval;
This will do a join instead of the IN (...).
If this workaround does not improve your query performance you could also use a (temporary) table to store the values to match and next join with that table:
create local temporary table invalues(inval int primary key) on commit preserve rows;
insert into invalues values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
select * from invalues;
Next you can do:
Select c2, c3, c4 from X
join invalues on c1 = inval;
## Comment 26943
Date: 2019-03-22 14:51:36 +0100
From: @sjoerdmullender
(In reply to Arshad from comment 3)
> Hi Aris,
>
> Thanks for the fix!!
>
> Anytime soon new source tar ball will be released (SP3)? I currently do not
> have a hg setup with me, I always prefer a stable tar ball source release.
> So it will take some time before I could verify this. If you could please
> provide the bug ID against which the code went in, I can hand pick and patch
> the SP2 and test out.
>
> Thanks
> Arshad
As Aris said, this is the the default branch. The plans are to release from the Apr2019 branch this coming April. Some as yet undetermined time after that we will start working on releasing from what is currently the default branch. So I'm afraid it's still quite some time until this change gets packaged in a release.
| Trying to improve the performance of SQL queries with a large list of members in IN clause. | https://api.github.com/repos/MonetDB/MonetDB/issues/6689/comments | 0 | 2020-11-30T16:33:18Z | 2024-06-27T13:05:47Z | https://github.com/MonetDB/MonetDB/issues/6689 | 753,625,067 | 6,689 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-28 11:29:12 +0100
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2019-11-28 10:00:02 +0100
## Comment 26910
Date: 2019-02-28 11:29:12 +0100
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.119 Safari/537.36
Build Identifier:
Possibly related to 6686,
With a table created as follows
CREATE TABLE "sys"."unitTestDontDelete" (
"A" VARCHAR(255),
"B" BIGINT,
"C" DOUBLE,
"D" TIMESTAMP
);
INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000');
The query (Q1)
with "cp_t" as
(
select
"cn_t"."A",
"cn_t"."B",
"cn_t"."C",
"cn_t"."D"
from
"unitTestDontDelete" as "cn_t"
where
(
"B" is null
or "B" <> 8
)
)
select
(
select
coalesce(sum("B"), 0)
from
"cp_t" as "cr_t"
where
(
"cr_t"."C" >=
(
select
coalesce(MEDIAN("B"),0)
from
"cp_t" as "cq_t"
where
(
"cq_t"."A" = "cp_t"."A"
or
(
"cq_t"."A" is null
and "cp_t"."A" is null
)
)
)
or
(
"cr_t"."C" is null
and
(
select
coalesce(MEDIAN("B"),0)
from
"cp_t" as "cq_t"
where
(
"cq_t"."A" = "cp_t"."A"
or
(
"cq_t"."A" is null
and "cp_t"."A" is null
)
)
)
is null
)
)
)
as "co_f1"
from
"cp_t"
returns
co_f1
-------
0
0
1
2
3
4
5
6
7
The (equivalent) query
with "cp_t" as
(
select
"cn_t"."A",
"cn_t"."B",
"cn_t"."C",
"cn_t"."D"
from
"unitTestDontDelete" as "cn_t"
where
(
"B" is null
or "B" <> 8
)
)
select
(
select
coalesce(sum("B"), 0)
from
"cp_t" as "cr_t"
where
(
"cr_t"."C" >=
(
select
coalesce(MEDIAN("B"),0)
from
"cp_t" as "cq_t"
where
(
"cq_t"."A" = "cp_t"."A"
or
(
"cq_t"."A" is null
and "cp_t"."A" is null
)
)
)
)
)
as "co_f1"
from
"cp_t"
returns the expected result set
co_f1
-------
28
27
25
27
25
27
25
27
25
Reproducible: Always
### Steps to Reproduce:
1. Import table
2. execute queries as in details
### Actual Results:
co_f1
-------
0
1
2
3
4
5
6
7
0
### Expected Results:
co_f1
-------
27
25
27
25
27
25
27
25
## Comment 26944
Date: 2019-03-22 15:18:04 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [44c07fecb32e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=44c07fecb32e) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=44c07fecb32e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=44c07fecb32e)
Changeset description:
Added test for bug #6688.
## Comment 26981
Date: 2019-05-01 12:56:41 +0200
From: @njnes
fixed in default. Subquery handling has been reimplemented
| Bug in subselect (or condition) | https://api.github.com/repos/MonetDB/MonetDB/issues/6688/comments | 0 | 2020-11-30T16:33:15Z | 2024-06-27T13:05:46Z | https://github.com/MonetDB/MonetDB/issues/6688 | 753,625,026 | 6,688 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-26 14:17:00 +0100
From: Simon AUBERT <<simon.aubert>>
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
CC: @mlkersten, @njnes
Last updated: 2020-06-03 16:58:52 +0200
## Comment 26904
Date: 2019-02-26 14:17:00 +0100
From: Simon AUBERT <<simon.aubert>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
I created a table with a CTAS statement. I analyze the statistics and set the primary key
I try a “count distinct” type query (on all the table, no filters) on the PK Field. It is pretty slow, with a high sollicitation of my hard drive.
Reproducible: Always
### Steps to Reproduce:
1. Create a table and populate it. Mine was something like 200 millions rows.
2. Analyze the statistics, set the Primary key on a field
3.just try a count distinct query on all the table on the PK field.
### Actual Results:
High sollicitation of my hard drive and several minutes before having the result
### Expected Results:
Something like a very quick result : not only it's the PK, but the statistics are compute...
If I do a distinct operation on the PK, I expect at least the result to be as fast as the count... and it's not the case at all.
And if it's in already in the statistics, I expect it to be immediate.
here the explain :
sql>explain select count(distinct salesorderdetailid) from formation.salesorderdetails;
+-----------------------------------------------------------------------------+
| mal |
+=============================================================================+
| function user.s10_1():void; |
| X_1:void := querylog.define("explain select count(distinct salesorderde |
: tailid) from formation.salesorderdetails;":str, "default_pipe":str, 14:int) :
: ; :
| barrier X_133:bit := language.dataflow(); |
| X_4:int := sql.mvc(); |
| C_70:bat[:oid] := sql.tid(X_4:int, "formation":str, "salesorderdetails" |
: :str, 0:int, 4:int); :
| X_77:bat[:int] := sql.bind(X_4:int, "formation":str, "salesorderdetails |
: ":str, "salesorderdetailid":str, 0:int, 0:int, 4:int); :
| X_90:bat[:int] := algebra.projection(C_70:bat[:oid], X_77:bat[:int]); |
| (X_97:bat[:oid], C_98:bat[:oid], X_99:bat[:lng]) := group.groupdone(X_9 |
: 0:bat[:int]); :
| X_100:bat[:int] := algebra.projection(C_98:bat[:oid], X_90:bat[:int]); |
| C_72:bat[:oid] := sql.tid(X_4:int, "formation":str, "salesorderdetails" |
: :str, 1:int, 4:int); :
| X_78:bat[:int] := sql.bind(X_4:int, "formation":str, "salesorderdetails |
: ":str, "salesorderdetailid":str, 0:int, 1:int, 4:int); :
| X_91:bat[:int] := algebra.projection(C_72:bat[:oid], X_78:bat[:int]); |
| (X_101:bat[:oid], C_102:bat[:oid], X_103:bat[:lng]) := group.groupdone( |
: X_91:bat[:int]); :
| X_104:bat[:int] := algebra.projection(C_102:bat[:oid], X_91:bat[:int]); |
| C_74:bat[:oid] := sql.tid(X_4:int, "formation":str, "salesorderdetails" |
: :str, 2:int, 4:int); :
| X_79:bat[:int] := sql.bind(X_4:int, "formation":str, "salesorderdetails |
: ":str, "salesorderdetailid":str, 0:int, 2:int, 4:int); :
| X_92:bat[:int] := algebra.projection(C_74:bat[:oid], X_79:bat[:int]); |
| (X_105:bat[:oid], C_106:bat[:oid], X_107:bat[:lng]) := group.groupdone( |
: X_92:bat[:int]); :
| X_108:bat[:int] := algebra.projection(C_106:bat[:oid], X_92:bat[:int]); |
| C_76:bat[:oid] := sql.tid(X_4:int, "formation":str, "salesorderdetails" |
: :str, 3:int, 4:int); :
| X_80:bat[:int] := sql.bind(X_4:int, "formation":str, "salesorderdetails |
: ":str, "salesorderdetailid":str, 0:int, 3:int, 4:int); :
| X_93:bat[:int] := algebra.projection(C_76:bat[:oid], X_80:bat[:int]); |
| (X_109:bat[:oid], C_110:bat[:oid], X_111:bat[:lng]) := group.groupdone( |
: X_93:bat[:int]); :
| X_112:bat[:int] := algebra.projection(C_110:bat[:oid], X_93:bat[:int]); |
| X_127:bat[:int] := mat.packIncrement(X_100:bat[:int], 4:int); |
| X_129:bat[:int] := mat.packIncrement(X_127:bat[:int], X_104:bat[:int]); |
| X_130:bat[:int] := mat.packIncrement(X_129:bat[:int], X_108:bat[:int]); |
| X_17:bat[:int] := mat.packIncrement(X_130:bat[:int], X_112:bat[:int]); |
| (X_18:bat[:oid], C_19:bat[:oid], X_113:bat[:lng]) := group.groupdone(X_ |
: 17:bat[:int]); :
| X_21:bat[:int] := algebra.projection(C_19:bat[:oid], X_17:bat[:int]); |
| X_22:lng := aggr.count(X_21:bat[:int], true:bit); |
| language.pass(X_90:bat[:int]); |
| language.pass(X_91:bat[:int]); |
| language.pass(X_92:bat[:int]); |
| language.pass(X_93:bat[:int]); |
| language.pass(X_17:bat[:int]); |
| exit X_133:bit; |
| sql.resultSet("formation.L3":str, "L3":str, "bigint":str, 64:int, 0:int |
: , 7:int, X_22:lng); :
| end user.s10_1; |
| inline actions= 0 time=1 usec |
| remap actions= 0 time=2 usec |
| costmodel actions= 1 time=1 usec |
| coercion actions= 0 time=160 usec |
| evaluate actions= 0 time=14 usec |
| emptybind actions= 1 time=57 usec |
| pushselect actions= 0 time=4 usec |
| aliases actions= 1 time=5 usec |
| mitosis actions=1 time=2237 usec |
| mergetable actions= 2 time=845 usec |
| deadcode actions=11 time=13 usec |
| aliases actions= 0 time=0 usec |
| constants actions= 3 time=174 usec |
| commonTerms actions= 5 time=26 usec |
| projectionpath actions= 0 time=14 usec |
| deadcode actions= 5 time=6 usec |
| reorder actions= 1 time=86 usec |
| matpack actions= 1 time=636 usec |
| dataflow actions= 1 time=37 usec |
| multiplex actions= 0 time=1 usec |
| profiler actions=1 time=1 usec |
| candidates actions=1 time=0 usec |
| deadcode actions= 0 time=32 usec |
| wlc actions= 0 time=2 usec |
| garbagecollector actions= 1 time=112 usec |
| total actions=28 time=6334 usec |
+-----------------------------------------------------------------------------+
## Comment 26985
Date: 2019-05-01 13:14:51 +0200
From: @njnes
statistics are hints to the optimizer not pre-computed results. The problem here is that the distinct is in efficiently computed because of a multi partition approach.
## Comment 26988
Date: 2019-05-01 21:58:44 +0200
From: Simon AUBERT <<simon.aubert>>
Hello Niels.
Do you mean that Monetdb has a multi-partition approach? Because I didn't use partitions at all here.
## Comment 27023
Date: 2019-06-04 12:25:14 +0200
From: @sjoerdmullender
MonetDB parallelizes query plans all by itself. You can see this happened in your query by the fact that there are a number of calls to mat.packIncrement.
The query requires a call be made to group.groupdone on the entire column. Often it is faster to do that in parallel first on parts of the input column and then doing it again on the combination of the results of those parallel calls. But this is not efficient if the input column has few duplicate values. In that case, the combined group.groupdone works over (almost) the entire input column, so in effect doing all the work again. If there are many duplicates, doing it twice is more efficient, since the final group.groupdone only works over a small column, namely all unique values in each of the partitions, and the partitions are done in parallel.
So, the problem is that sometimes MonetDB should partition the input, and sometimes not. And here we chose wrong.
## Comment 27031
Date: 2019-06-06 23:42:26 +0200
From: Simon AUBERT <<simon.aubert>>
Hello Sjoerd,
I'm not sure but shouldn't the decision take into consideration statistics (or pk..)?
Best regards,
Simon
## Comment 27181
Date: 2019-07-27 23:01:09 +0200
From: @mlkersten
The underlying routine is the MAL mitosis optimizer. It only looks at the largest table without concerns how it is being used. It would require quite a bit of symbolic reasoning over the complete algebraic plan to avoid such a split beyond a trivial case like this.
One could say that calling for a COUNT DISTINCT on a PK seems like a misunderstanding of the PK concept.
I propose to drop this from further consideration.
## Comment 27187
Date: 2019-07-29 07:13:50 +0200
From: Simon AUBERT <<simon.aubert>>
Hello Martin,
"One could say that calling for a COUNT DISTINCT on a PK seems like a misunderstanding of the PK concept."
Probably. However I cannot control every query sent to the database while the database is used with self-service BI Tools such as Tableau or Spotfire. The end user don't have the information it's a PK and doesn't even know SQL. I expect a database being sufficiently robust/smart to take that into account. Especially when the query itself isn't wrong.
## Comment 27188
Date: 2019-07-29 07:17:32 +0200
From: Simon AUBERT <<simon.aubert>>
Moreover, it would be also deadly slow without the PK..
## Comment 27595
Date: 2020-03-15 11:05:32 +0100
From: @mlkersten
The current code base avoids the copying of the columns.
This removes the overhead and returns within 4 ms.
Extra (complex) optimizations for this pattern will marginally
improve the run time at the cost of more optimization steps.
create table cds(i integer primary key);
insert into cds select * from generate_series(0,1000000, 1);
sql>select count(distinct i) from cds;
+---------+
| %1 |
+=========+
| 1000000 |
+---------+
1 tuple
sql:0.000 opt:1.493 run:1.024 clk:4.042 ms
sql>explain select count(distinct i) from cds;
+-------------------------------------------------------------------------------------------------------+
| mal |
+=======================================================================================================+
| function user.s26_0():void; |
| X_1:void := querylog.define("select count(distinct i) from cds;":str, "default_pipe":str, 9:int); |
| barrier X_93:bit := language.dataflow(); |
| X_4:int := sql.mvc(); |
| C_62:bat[:oid] := sql.tid(X_4:int, "sys":str, "cds":str, 0:int, 4:int); |
| X_79:lng := aggr.count(C_62:bat[:oid], true:bit); |
| C_64:bat[:oid] := sql.tid(X_4:int, "sys":str, "cds":str, 1:int, 4:int); |
| X_80:lng := aggr.count(C_64:bat[:oid], true:bit); |
| C_66:bat[:oid] := sql.tid(X_4:int, "sys":str, "cds":str, 2:int, 4:int); |
| X_81:lng := aggr.count(C_66:bat[:oid], true:bit); |
| C_68:bat[:oid] := sql.tid(X_4:int, "sys":str, "cds":str, 3:int, 4:int); |
| X_82:lng := aggr.count(C_68:bat[:oid], true:bit); |
| X_78:bat[:lng] := mat.pack(X_79:lng, X_80:lng, X_81:lng, X_82:lng); |
| X_83:bat[:lng] := algebra.selectNotNil(X_78:bat[:lng]); |
| X_12:lng := aggr.sum(X_83:bat[:lng]); |
| exit X_93:bit; |
| sql.resultSet(".%1":str, "%1":str, "bigint":str, 64:int, 0:int, 7:int, X_12:lng); |
| end user.s26_0; |
+-------------------------------------------------------------------------------------------------------+
46 tuples
sql:0.000 opt:0.000 run:0.000 clk:3.775 ms
## Comment 27646
Date: 2020-04-01 14:45:56 +0200
From: Simon AUBERT <<simon.aubert>>
Hello,
I see the status is updated at "RESOLVED NEXTRELEASE". Thanks a lot. :)
@Martin Kersten : thanks for the explanations and the comments.
| Count distinct very slow and use too much the hard drive | https://api.github.com/repos/MonetDB/MonetDB/issues/6687/comments | 0 | 2020-11-30T16:33:11Z | 2024-06-27T13:05:45Z | https://github.com/MonetDB/MonetDB/issues/6687 | 753,624,980 | 6,687 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-22 12:33:33 +0100
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2019-11-28 10:00:04 +0100
## Comment 26903
Date: 2019-02-22 12:33:33 +0100
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Build Identifier:
With a table created as follows:
CREATE TABLE "sys"."unitTestDontDelete" (
"A" VARCHAR(255),
"B" BIGINT,
"C" DOUBLE,
"D" TIMESTAMP
);
INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000');
The query:
with "c3_t" as
(
select
"c1_t"."A",
"c1_t"."B",
"c1_t"."C",
"c1_t"."D"
from
"unitTestDontDelete" as "c1_t"
)
select
"c3_t"."C",
(
select
count(*)
from
"c3_t" as "c4_t"
where
"c4_t"."C" >= coalesce("c3_t"."C", 0.0) + 1
)
as "c2_f1"
from
"c3_t"
returns
C c2_f1
---------------------------------
<null> 8
0.5 8
1.5 7
2.5 6
3.5 5
4.5 4
5.5 3
6.5 2
7.5 1
8.5 1
where I was expecting
C c2_f1
---------------------------------
<null> 8
0.5 8
1.5 7
2.5 6
3.5 5
4.5 4
5.5 3
6.5 2
7.5 1
8.5 0
as there are no values for the "C" column >= 9.5
Reproducible: Always
### Steps to Reproduce:
1.Import table
2. execute query as per details
3.
### Actual Results:
C c2_f1
---------------------------------
<null> 8
0.5 8
1.5 7
2.5 6
3.5 5
4.5 4
5.5 3
6.5 2
7.5 1
8.5 1
### Expected Results:
C c2_f1
---------------------------------
<null> 8
0.5 8
1.5 7
2.5 6
3.5 5
4.5 4
5.5 3
6.5 2
7.5 1
8.5 0
## Comment 26905
Date: 2019-02-26 15:06:19 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [095b4ca1f4fb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=095b4ca1f4fb) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=095b4ca1f4fb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=095b4ca1f4fb)
Changeset description:
Added test for Bug #6686.
## Comment 26982
Date: 2019-05-01 12:57:55 +0200
From: @njnes
fixed in default, where the subquery implementation is renewed
| Bug in subselect (count function) | https://api.github.com/repos/MonetDB/MonetDB/issues/6686/comments | 0 | 2020-11-30T16:33:07Z | 2024-06-27T13:05:44Z | https://github.com/MonetDB/MonetDB/issues/6686 | 753,624,934 | 6,686 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-22 10:00:07 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
CC: @PedroTadim
Last updated: 2019-04-30 12:36:00 +0200
## Comment 26902
Date: 2019-02-22 10:00:07 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
There is no clear specification that allows or disallows views to be added to a merge table. This can lead to weird behaviour. See the reproduction steps.
Reproducible: Always
### Steps to Reproduce:
1.create table foo (val int);
2.insert into foo values (1), (2), (3);
3.create view foo_view as select * from foo;
4.create merge table foo_merge_table (val int);
5.alter table foo_merge_table add table foo_view;
6.select * from foo_merge_table;
### Actual Results:
operation successful
3 affected rows
operation successful
operation successful
operation successful
+-----+
| val |
+=====+
+-----+
0 tuples
### Expected Results:
Either everything finishes succesfully and the final query returns all results in the view
or
an error message after submitting the alter table statement.
I am not sure what other merge table implementations handle alter table add view attempts.
## Comment 26907
Date: 2019-02-27 11:28:21 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [ab619c893147](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ab619c893147) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ab619c893147](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ab619c893147)
Changeset description:
Cannot add a view into a merge/remote/replica table. This fixes bug #6685.
## Comment 26908
Date: 2019-02-27 11:30:02 +0100
From: @PedroTadim
We don't allow views to be added into merge/remote/replica tables.
## Comment 26909
Date: 2019-02-27 11:53:01 +0100
From: @aris-koning
Changeset looks good to me.
| adding a view to a merge table gives unexpected behaviour | https://api.github.com/repos/MonetDB/MonetDB/issues/6685/comments | 0 | 2020-11-30T16:33:04Z | 2024-06-27T13:05:43Z | https://github.com/MonetDB/MonetDB/issues/6685 | 753,624,879 | 6,685 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-20 16:51:44 +0100
From: @PedroTadim
To: SQL devs <<bugs-sql>>
Version: -- development
Last updated: 2020-06-10 13:46:04 +0200
## Comment 26898
Date: 2019-02-20 16:51:44 +0100
From: @PedroTadim
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Build Identifier:
Inserting into a replica table crashes the server, just that.
Reproducible: Always
### Steps to Reproduce:
1.create replica table t1 (a int);
2. insert into t1 values (1);
### Actual Results:
A SIGSEGV.
### Expected Results:
An error in the upper case.
Back-trace:
Thread 18 "mserver5" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ec60df in append_col (tr=0x250f650, c=0x7fffac035200, i=0x7fffac06c360, tpe=5) at bat_storage.c:838
838 obat = timestamp_delta(oc->data, tr->stime);
Missing separate debuginfos, use: dnf debuginfo-install libnghttp2-1.34.0-1.fc29.x86_64
(gdb) bt
0 0x00007ffff7ec60df in append_col (tr=0x250f650, c=0x7fffac035200, i=0x7fffac06c360, tpe=5) at bat_storage.c:838
1 0x00007ffff7d01c0a in mvc_append_wrap (cntxt=0x7fffe8c99378, mb=0x7fffac056a30, stk=0x7fffac06bc60, pci=0x7fffac06ada0) at sql.c:1298
2 0x00007ffff78f465a in runMALsequence (cntxt=0x7fffe8c99378, mb=0x7fffac056a30, startpc=1, stoppc=0, stk=0x7fffac06bc60, env=0x0, pcicaller=0x0) at mal_interpreter.c:623
3 0x00007ffff78f3165 in runMAL (cntxt=0x7fffe8c99378, mb=0x7fffac056a30, mbcaller=0x0, env=0x0) at mal_interpreter.c:327
4 0x00007ffff7d1ece2 in SQLrun (c=0x7fffe8c99378, be=0x7fffac0079e0, m=0x7fffac00fb90) at sql_execute.c:374
5 0x00007ffff7d20688 in SQLengineIntern (c=0x7fffe8c99378, be=0x7fffac0079e0) at sql_execute.c:784
6 0x00007ffff7d1cea3 in SQLengine (c=0x7fffe8c99378) at sql_scenario.c:1324
7 0x00007ffff791d380 in runPhase (c=0x7fffe8c99378, phase=4) at mal_scenario.c:510
8 0x00007ffff791d520 in runScenarioBody (c=0x7fffe8c99378, once=0) at mal_scenario.c:538
9 0x00007ffff791d75a in runScenario (c=0x7fffe8c99378, once=0) at mal_scenario.c:569
10 0x00007ffff791f4e9 in MSserveClient (dummy=0x7fffe8c99378) at mal_session.c:520
11 0x00007ffff791efab in MSscheduleClient (command=0x7fffac000b30 "\020w", challenge=0x7fffda25fccb "Ur3Mfydhe4b", fin=0x7fffac006550, fout=0x7fffdc002d60, protocol=PROTOCOL_9, blocksize=8190) at mal_session.c:398
12 0x00007ffff79ce46b in doChallenge (data=0x8c87f0) at mal_mapi.c:270
13 0x00007ffff7673bb4 in THRstarter (a=0x7fffdc004e50) at gdk_utils.c:1465
14 0x00007ffff76ecd47 in thread_starter (arg=0x2714e40) at gdk_system.c:546
15 0x00007ffff688a58e in start_thread (arg=<optimized out>) at pthread_create.c:486
16 0x00007ffff67b96a3 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
## Comment 26901
Date: 2019-02-20 16:52:37 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [4f140644347c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f140644347c) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4f140644347c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4f140644347c)
Changeset description:
Added tests for bugs 6683 and 6684.
Also bug #6424 requires the netcdf module.
## Comment 26906
Date: 2019-02-27 09:37:44 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [a540ef19db1b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a540ef19db1b) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a540ef19db1b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a540ef19db1b)
Changeset description:
Disable any insert/update/delete statements on replica tables. This fixes bug #6684.
## Comment 27814
Date: 2020-06-10 13:46:04 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [272d6813c95d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=272d6813c95d) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=272d6813c95d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=272d6813c95d)
Changeset description:
Fix for bug #6684. e_cmp expressions are always bound to the boolean type
| Inserting into a replica table crashes the server | https://api.github.com/repos/MonetDB/MonetDB/issues/6684/comments | 0 | 2020-11-30T16:33:01Z | 2024-06-27T13:05:42Z | https://github.com/MonetDB/MonetDB/issues/6684 | 753,624,840 | 6,684 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-18 18:38:35 +0100
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2019-11-28 10:00:06 +0100
## Comment 26893
Date: 2019-02-18 18:38:35 +0100
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36
Build Identifier:
With a table created as follows:
CREATE TABLE "sys"."unitTestDontDelete" (
"A" VARCHAR(255),
"B" BIGINT,
"C" DOUBLE,
"D" TIMESTAMP
);
INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000');
The query
with "c3_t" as
(
select
"c1_t"."A",
"c1_t"."B",
"c1_t"."C",
"c1_t"."D"
from
"unitTestDontDelete" as "c1_t"
)
select
(
select
sum("B")
from
"c3_t" as "c4_t"
where
(
("c4_t"."C" >= (coalesce("c3_t"."C", 0.0) + cast('0x1.0p0' as double precision)))
)
)
as "c2_f1"
from
"c3_t"
returns 10 records, which is correct, however the query (clearly equivalent to the first)
with "c3_t" as
(
select
"c1_t"."A",
"c1_t"."B",
"c1_t"."C",
"c1_t"."D"
from
"unitTestDontDelete" as "c1_t"
)
select
(
select
sum("B")
from
"c3_t" as "c4_t"
where
(
("c4_t"."C" >= (coalesce("c3_t"."C", 0.0) + cast('0x1.0p0' as double precision)))
or
( 1 = 0 )
)
)
as "c2_f1"
from
"c3_t"
returns just 9 records. This bug occurs even if the second or condition is not trivial.
Reproducible: Always
### Steps to Reproduce:
1. Import table as in Details
2. Execute the two queries as in details
### Actual Results:
Just 9 records
### Expected Results:
8 records
## Comment 26894
Date: 2019-02-18 18:45:58 +0100
From: Manuel <<manuel>>
I meant
### Expected Results:
10 records
## Comment 26900
Date: 2019-02-20 16:52:36 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [4f140644347c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4f140644347c) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4f140644347c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4f140644347c)
Changeset description:
Added tests for bugs 6683 and 6684.
Also bug #6424 requires the netcdf module.
## Comment 26983
Date: 2019-05-01 12:58:35 +0200
From: @njnes
fixed in default, where the subquery implementation is renewed
| Bug in subselect | https://api.github.com/repos/MonetDB/MonetDB/issues/6683/comments | 0 | 2020-11-30T16:32:58Z | 2024-06-27T13:05:41Z | https://github.com/MonetDB/MonetDB/issues/6683 | 753,624,791 | 6,683 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-18 15:54:26 +0100
From: @swingbit
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.13 (Aug2018-SP2)
CC: @mlkersten
Last updated: 2020-03-15 09:52:34 +0100
## Comment 26887
Date: 2019-02-18 15:54:26 +0100
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.96 Safari/537.36
Build Identifier:
On the one hand, the codebase and the documentation encourage to write custom code in separate modules, which makes much sense to me.
On the other hand, modularity seems to be explicitly discouraged, probably by early designs that became legacy.
I will make one example:
I'm maintaining a set of extra functionalities on strings, like tokenization, similarity, etc.
If I were a MonetDB developer, these functionalities would mainly be spread over str.c and batstr.c. Because I'm not, I'm maintaining these extensions under monetdb5/extras/myfancystringmodule.
In my code I need to use many basic string functions / macros like:
UTF8_strlen(), UTF8_strpos(), UTF8_GETCHAR(), UTF8_PUTCHAR(), etc.
These are defined statically inside str.c and batstr.c. It's like saying: whatever code concerns strings should be in str.c and batstr.c. Which makes sense if your code is not meant to be extended by external developers, but is a pain otherwise.
Currently, because I value modularity and do want to keep our extensions in a separate module, I have to resort to copying the code I need into my modules, which is bad for many reasons.
Long story short: please put macros and exports in .h files.
Reproducible: Always
## Comment 26889
Date: 2019-02-18 16:51:25 +0100
From: @sjoerdmullender
Are you familiar with the repository [1]? Useful for extending MonetDB. No need for in-tree extensions.
Having said that, it is indeed a good idea to make available macros and functions that might be useful for extension writers.
[1] https://dev.monetdb.org/hg/MonetDB-extend/
## Comment 26891
Date: 2019-02-18 17:46:23 +0100
From: @swingbit
I haven't used the MonetDB-extend repository yet, but I plan to.
I will still need the mentioned changes in the core modules of course.
## Comment 27590
Date: 2020-03-15 09:28:17 +0100
From: @mlkersten
No further information obtained. Changes foreseen in the string handling will address some of the issues mentioned.
## Comment 27592
Date: 2020-03-15 09:52:34 +0100
From: @swingbit
I wasn't aware that more information was needed from me, I thought the issue was clear.
| Feature request: make code more extension-friendly | https://api.github.com/repos/MonetDB/MonetDB/issues/6682/comments | 3 | 2020-11-30T16:32:54Z | 2024-06-28T10:25:29Z | https://github.com/MonetDB/MonetDB/issues/6682 | 753,624,748 | 6,682 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-02-01 14:11:56 +0100
From: @yzchang
To: GDK devs <<bugs-common>>
Version: -- development
CC: @yzchang
Last updated: 2019-02-01 14:39:44 +0100
## Comment 26866
Date: 2019-02-01 14:11:56 +0100
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.3 Safari/605.1.15
Build Identifier:
Compiling MonetDB on a Mac OS 10.13.6 failed due to:
/Users/jennie/monet/Apr2019/gdk/gdk_bbp.c:326:27: error: result of comparison of
constant 32 with expression of type 'role_t' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
assert(role >= 0 && role < 32);
~~~~ ^ ~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE...
Reproducible: Always
## Comment 26868
Date: 2019-02-01 14:21:26 +0100
From: @yzchang
FYI, I commented out the condition "role < 32" so that the compilation can continue, then I get:
/Users/jennie/monet/Apr2019/gdk/gdk_bat.c:77:27: error: result of comparison of
constant 32 with expression of type 'role_t' is always true
[-Werror,-Wtautological-constant-out-of-range-compare]
assert(role >= 0 && role < 32);
~~~~ ^ ~~
/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE...
^
/Users/jennie/monet/Apr2019/gdk/gdk_bat.c:184:30: error: result of comparison of
constant 32 with expression of type 'role_t' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
ERRORcheck(role < 0 || role >= 32, "COLnew:role error\n", NULL);
~~~~ ^ ~~
/Users/jennie/monet/Apr2019/gdk/gdk_private.h:359:7: note: expanded from macro
'ERRORcheck'
if (tst) { \
^~~
/Users/jennie/monet/Apr2019/gdk/gdk_bat.c:256:30: error: result of comparison of
constant 32 with expression of type 'role_t' is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
ERRORcheck(role < 0 || role >= 32, "BATattach: role error\n", NULL);
~~~~ ^ ~~
/Users/jennie/monet/Apr2019/gdk/gdk_private.h:359:7: note: expanded from macro
'ERRORcheck'
if (tst) { \
^~~
3 errors generated.
## Comment 26871
Date: 2019-02-01 14:39:44 +0100
From: @sjoerdmullender
Changeset [6af9a4a262e3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6af9a4a262e3)
| Compilation error in gdk_bbp.c in Apr2019 branch | https://api.github.com/repos/MonetDB/MonetDB/issues/6681/comments | 0 | 2020-11-30T16:32:50Z | 2024-06-27T13:05:39Z | https://github.com/MonetDB/MonetDB/issues/6681 | 753,624,707 | 6,681 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-25 12:06:41 +0100
From: Henrique <<hvehrenfried>>
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
Last updated: 2019-04-30 12:36:04 +0200
## Comment 26851
Date: 2019-01-25 12:06:41 +0100
From: Henrique <<hvehrenfried>>
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 OPR/58.0.3135.47
Build Identifier:
At C3SL, we use a tool called HOTMapper (github.com/c3sl/hotmapper) to map open data and insert this mapped data into a MonetDB database. The problem is that if we install the MonetDB and enable the systemctl our script does not work, instead a error (Cannot open file 'XXXXXX': No such file or directory) appears. On the other hand, if we do not enable systemctl and manage our farm ourself, our script works.
Reproducible: Always
### Steps to Reproduce:
1.Install MonetDB and enable systemctl
2.Try to insert a CSV file into the database using the COPY command
3.
### Actual Results:
Cannot open file 'XXXXXX': No such file or directory
### Expected Results:
I expected the data from the CSVB being imported to the database
Another way to reproduce the error is following the tutorial from the script we use (available at: github.com/c3sl/hotmapper).
The COPY we command we were using is:
COPY OFFSET 2 INTO localoferta_ens_superior("cod_local_oferta", "cod_ies", "cod_municipio", "nome_municipio", "cod_uf", "sigla_uf", "sede", "cod_curso_polo", "cod_curso", "nucleo_educacao_a_distancia", "universidade_aberta_do_brasil", "reitoria", "polo_de_apoio_presencial", "unidade_academica", "ano_censo") FROM '/home/henrique/hotmapper/open_data/DM_LOCAL_OFERTA_2012.CSV'("cod_local_oferta", "cod_ies", "cod_municipio", "nome_municipio", "cod_uf", "sigla_uf", "sede", "cod_curso_polo", "cod_curso", "nucleo_educacao_a_distancia", "universidade_aberta_do_brasil", "reitoria", "polo_de_apoio_presencial", "unidade_academica", "ano_censo") USING DELIMITERS '|', '\n', '"' NULL AS ''
## Comment 26852
Date: 2019-01-25 14:20:47 +0100
From: @sjoerdmullender
Could it be a permission problem?
When you run MonetDB under control of systemd (systemctl), it runs as user "monetdb" and group "monetdb". If that user has no access to the file you're trying to read, the COPY INTO will fail.
Permissions can obviously be the read/write/execute permission bits, but also SELinux, if you're using that.
## Comment 26854
Date: 2019-01-28 11:09:07 +0100
From: Henrique <<hvehrenfried>>
Thank you for your reply. Well, I tried some scenarios with no success:
Distro used: Linux Mint 19.1 Tessa, so I guess I do not use SELinux
1) I tried change the permission (to 777) of the file
2) I tried change the permission (to 777) of all folders and files from my user
3) I tried change the ownership of the file to the user monetdb (the file's permission was 777)
4) I tried change the ownership of the file to the user monetdb (the file's permission was 777 and all folders of my home, including it, was 777)
And the same error occured: Cannot open file 'xxxx/yyyy/zzzz.csv': No such file or directory
Do you have any other sugestions to try to make it work with systemctl?
## Comment 26855
Date: 2019-01-28 19:12:13 +0100
From: @sjoerdmullender
The only other thing I can think of right off the top of my head is: is the file accessible from outside MonetDB? Can you read the file if you copy-paste the name from the SQL query to a shell command line? Something like:
more /home/henrique/hotmapper/open_data/DM_LOCAL_OFERTA_2012.CSV
## Comment 26856
Date: 2019-01-29 10:55:19 +0100
From: Henrique <<hvehrenfried>>
Again, thanks for your reply. I just tested two scenarios based on your last comment.
In the first one, I run:
more /home/henrique/hotmapper/open_data/DM_LOCAL_OFERTA_2012.CSV
as the user henrique, and it worked.
Then, in the second scenario, I created a standart user, and logged in with this new account. Then I run the same command:
more /home/henrique/hotmapper/open_data/DM_LOCAL_OFERTA_2012.CSV
And I succesfully openned the file with this other user.
Do you have any other idea about how to deal with this problem?
## Comment 26857
Date: 2019-01-29 12:12:07 +0100
From: Henrique <<hvehrenfried>>
Additionally, I collected the log (/var/log/monetdb/merovingian.log) from MonetDB when I run the command:
2019-01-29 08:49:43 MSG discovery[1808]: listening for UDP messages on localhost:50000
2019-01-29 08:49:43 MSG control[1808]: accepting connections on UNIX domain socket /tmp/.s.merovingian.50000
2019-01-29 09:03:44 MSG merovingian[1808]: starting database 'demo', up min/avg/max: 1m/2h/19h, crash average: 0.00 0.00 0.00 (7-7=0)
2019-01-29 09:03:45 MSG demo[2540]: arguments: /usr/bin/mserver5 --dbpath=/var/monetdb5/dbfarm/demo --set merovingian_uri=mapi:monetdb://vm:50000/demo --set mapi_open=false --set mapi_port=0 --set mapi_usock=/var/monetdb5/dbfarm/demo/.mapi.sock --set monet_vault_key=/var/monetdb5/dbfarm/demo/.vaultkey --set gdk_nr_threads=3 --set max_clients=64 --set sql_optimizer=default_pipe --set monet_daemon=yes
2019-01-29 09:03:45 MSG demo[2540]: !ERROR: GDKmove: cannot rename /var/monetdb5/dbfarm/demo/bat/BBP.dir to /var/monetdb5/dbfarm/demo/bat/BACKUP/BBP.dir
2019-01-29 09:03:45 MSG demo[2540]: !OS: Permission denied
2019-01-29 09:03:45 ERR demo[2540]: !FATAL: BBPinit: cannot properly prepare process bat/BACKUP. Please check whether your disk is full or write-protected
2019-01-29 09:03:49 MSG merovingian[1808]: database 'demo' (2540) has exited with exit status 1
2019-01-29 09:03:49 ERR control[1808]: !monetdbd: an internal error has occurred 'database 'demo' appears to shut itself down after starting, check monetdbd's logfile (/var/log/monetdb/merovingian.log) for possible hints'
2019-01-29 09:03:54 ERR merovingian[1808]: client error: database 'demo' appears to shut itself down after starting, check monetdbd's logfile (/var/log/monetdb/merovingian.log) for possible hints
## Comment 26863
Date: 2019-01-31 10:22:17 +0100
From: @sjoerdmullender
The merovingian log indicates that you have permission problems with the database itself. Fix those first.
## Comment 26865
Date: 2019-02-01 11:35:46 +0100
From: Henrique <<hvehrenfried>>
I fixed the problem with the database's permission, but it did not solve the problem.
I collected an example:
So, if I want to add, using mclient, a CSV into the database with the systemctl enabled, that what happens:
(env) henrique@vm:~/hotmapper$ mclient -d demo
user(henrique):monetdb
password:
Welcome to mclient, the MonetDB/SQL interactive terminal (Aug2018-SP2)
Database: MonetDB v11.31.13 (Aug2018-SP2), 'mapi:monetdb://vm:50000/demo'
Type \q to quit, \? for a list of available commands
auto commit mode: on
sql>COPY OFFSET 2 INTO localoferta_ens_superior("cod_local_oferta", "cod_ies", "cod_municipio", "nome_municipio", "cod_uf", "sigla_uf", "sede", "cod_curso_polo", "cod_curso", "nucleo_educacao_a_distancia", "universidade_aberta_do_brasil", "reitoria", "polo_de_apoio_presencial", "unidade_academica", "ano_censo") FROM '/home/henrique/2012.csv'("cod_local_oferta", "cod_ies", "cod_municipio", "nome_municipio", "cod_uf", "sigla_uf", "sede", "cod_curso_polo", "cod_curso", "nucleo_educacao_a_distancia", "universidade_aberta_do_brasil", "reitoria", "polo_de_apoio_presencial", "unidade_academica", "ano_censo") USING DELIMITERS '|', '\n', '"' NULL AS ''
more>;
Cannot open file '/home/henrique/2012.csv': No such file or directory
The file is accessible, as the ls and more commands show:
henrique@vm:~/hotmapper$ ls -l /home/henrique/2012.csv
-rwxrwxrwx 1 monetdb monetdb 9988799 jan 28 07:52 /home/henrique/2012.csv
henrique@vm:~/hotmapper$ more /home/henrique/2012.csv
CO_LOCAL_OFERTA_IES|CO_IES|CO_MUNICIPIO_LOCAL_OFERTA|NO_MUNICIPIO_LOCAL_OFERTA|CO_UF_LOCAL_OFERTA|SGL_UF_LOCAL_OFERTA|IN_SEDE|CO_CURSO_POLO|CO_CURSO|IN_LOCAL_OFERTA_NEAD
|IN_LOCAL_OFERTA_UAB|IN_LOCAL_OFERTA_REITORIA|IN_LOCAL_OFERTA_POLO|IN_LOCAL_OFERTA_UNID_ACADEMICA|ANO_CENSO
194|29|2311306|QUIXADA|23|CE|0|10382|1151448|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|10413|1151457|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|10444|1151646|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|11060|1151669|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|11091|1151671|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|11122|1151677|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|11153|1151706|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0|11184|1152477|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0||2208|0|0|0|0|1|2012
194|29|2311306|QUIXADA|23|CE|0||2213|0|0|0|0|1|2012
Now the log (/var/log/monetdb/merovingian.log) only prints something when I connect to the database using mclient. The log shows:
2019-02-01 08:15:33 MSG merovingian[2627]: proxying client (local) for database 'demo' to mapi:monetdb:///var/monetdb5/dbfarm/demo/.mapi.sock?database=demo
2019-02-01 08:15:33 MSG merovingian[2627]: target connection is on local UNIX domain socket, passing on filedescriptor instead of proxying
Do you have any idea why I cannot use this command COPY if I am using MonetDB with the systemctl enabled?
## Comment 26867
Date: 2019-02-01 14:19:36 +0100
From: @sjoerdmullender
I probably should have tried this earlier, but now that I have, I can say that I can reproduce the problem. It is in fact a permissions problem, even though the server report a different error. Though I can't find a message in the system log, I think it has to do with SELinux. When the server is started using systemctl, it runs in a different and more restrictive context. Usually programs restricted in this way are not allowed to access users' home directories (for good reason).
The solution is to not have the server read the file but have the client do it.
Both the mclient man [1] page and [2] have an example of how to do it.
In your case, something like this:
mclient -d demo -s "COPY OFFSET 2 INTO localoferta_ens_superior(\"cod_local_oferta\", \"cod_ies\", \"cod_municipio\", \"nome_municipio\", \"cod_uf\", \"sigla_uf\", \"sede\", \"cod_curso_polo\", \"cod_curso\", \"nucleo_educacao_a_distancia\", \"universidade_aberta_do_brasil\", \"reitoria\", \"polo_de_apoio_presencial\", \"unidade_academica\", \"ano_censo\") FROM STDIN(\"cod_local_oferta\", \"cod_ies\", \"cod_municipio\", \"nome_municipio\", \"cod_uf\", \"sigla_uf\", \"sede\", \"cod_curso_polo\", \"cod_curso\", \"nucleo_educacao_a_distancia\", \"universidade_aberta_do_brasil\", \"reitoria\", \"polo_de_apoio_presencial\", \"unidade_academica\", \"ano_censo\") USING DELIMITERS '|', '\\n', '\"' NULL AS ''" - < /home/henrique/2012.csv
Unfortunately, because of shell syntax, all " characters have to be quoted using \.
[1] https://www.monetdb.org/Documentation/mclient-man-page
[2] https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBulkData
## Comment 26869
Date: 2019-02-01 14:38:13 +0100
From: @sjoerdmullender
Changeset [6af9a4a262e3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6af9a4a262e3)
## Comment 26870
Date: 2019-02-01 14:39:05 +0100
From: @sjoerdmullender
Sorry, changed the wrong bug.
## Comment 26872
Date: 2019-02-04 11:41:45 +0100
From: Henrique <<hvehrenfried>>
Thank you for your response. Indeed, the command you suggested works. But this COPY command is executed inside a python script we created, using the pymonetdb. So I guess it will not work there.
About the SELinux and AppArmor, I have disabled them when I ran the lastest tests, so I guess the problem is not caused by them.
So to make it working with our python script, I changed some settings from the monetdbd.service:
[Unit]
Deion=MonetDB database server daemon
Documentation=man:monetdbd https://www.monetdb.org/Documentation/monetdbd-man-page
After=network.target
[Service]
Type=forking
User=root
Group=root
ExecStart=/usr/bin/monetdbd start /var/monetdb5/dbfarm
ExecStop=/usr/bin/monetdbd stop /var/monetdb5/dbfarm
Restart=on-failure
PIDFile=/var/run/monetdb/merovingian.pid
PrivateDevices=no
ProtectSystem=full
ProtectHome=false
[Install]
WantedBy=multi-user.target
What I changed was: User, Group and ProtectHome
It seems to work, what do you think?
## Comment 26884
Date: 2019-02-18 11:58:39 +0100
From: Henrique <<hvehrenfried>>
Do you think the solution I found of changing the monetdb.service file, specially the "Protect Home", a valid solution worth of be published by your team?
## Comment 26885
Date: 2019-02-18 14:42:55 +0100
From: @sjoerdmullender
In the next release (tentative schedule: April 2019), the COPY INTO command will have an option "ON CLIENT" which means the file is to be read by the client application. This is implemented for the C library, but could also be done by the Python library.
I think that is a better solution than running mserver5 as user root (I personally would never do that).
## Comment 26886
Date: 2019-02-18 15:48:48 +0100
From: Henrique <<hvehrenfried>>
I agree with you that using the root is not ideal. I just tested that if you only change the "ProtectHome" attribute from "True" to "False" it will work. Maybe this can be implemented for the next release.
## Comment 26888
Date: 2019-02-18 16:42:00 +0100
From: @sjoerdmullender
What about ProtectHome=read-only ?
## Comment 26890
Date: 2019-02-18 17:39:22 +0100
From: Henrique <<hvehrenfried>>
I tested with the "read-only" attribute and it seems to work. I can read the file and insert into the database. Maybe this is the fix.
## Comment 26892
Date: 2019-02-18 18:11:27 +0100
From: @sjoerdmullender
I'll probably do this in the next release then.
I don't really want to enable writing to users' home directories, but reading them might be ok. The users still need to open up their homes to all others for this to work, so that should be ok.
## Comment 26895
Date: 2019-02-19 09:51:21 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [57557e3fe6e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=57557e3fe6e0) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=57557e3fe6e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=57557e3fe6e0)
Changeset description:
Allow reading of users' home directories when running under systemd.
This should fix bug #6680.
## Comment 26896
Date: 2019-02-19 12:39:35 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [6b83b51c2f30](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b83b51c2f30) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6b83b51c2f30](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6b83b51c2f30)
Changeset description:
Add a tunable parameter, mserver5_can_read_home, to allow reading home dirs.
This is the second part of the fix for bug #6680.
## Comment 26897
Date: 2019-02-19 12:47:02 +0100
From: @sjoerdmullender
Changing the ProtectHome parameter was one part of the fix to allow mserver5 under the control of systmd to read files in users' home directories. If SELinux is enabled, another part is also needed. I have implemented that using a Boolean parameter that can be manipulated using the setsebool program:
setsebool -P mserver5_can_read_home=true
I hope these changes together are enough to consider this bug fixed.
| Copy cannot open CSV file if systemctl enabled | https://api.github.com/repos/MonetDB/MonetDB/issues/6680/comments | 0 | 2020-11-30T16:32:46Z | 2024-06-27T13:05:38Z | https://github.com/MonetDB/MonetDB/issues/6680 | 753,624,656 | 6,680 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-17 09:54:57 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
CC: @hannesmuehleisen, @mlkersten
Last updated: 2019-07-27 23:02:51 +0200
## Comment 26798
Date: 2019-01-17 09:54:57 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
Build Identifier:
MonetDB's DBI implementation for the R language, MonetDB.R can only handle large imports, i.e. a call dbWriteTable(...), if the csvdump flag is set to true otherwise it seems to succumb to some sort overflow/overload situation: R seems to report about a SIGPIPE signal.
By default this flag is set to false. Consequently using the default settings for dbWriteTable causes imports to fail immediately on even generated medium sized (~10000 rows) 10-column-wide tables (at least on my machine).
When csvdump=TRUE the imports, including the big ones, work like a charm.
I am using the following relevant R packages:
DBI 1.0.0
MonetDB.R 1.0.1
MonetDBLite 0.6.1
Reproducible: Always
### Steps to Reproduce:
library(MonetDB.R);options(monetdb.debug.query=TRUE)
library(DBI)
conn <- dbConnect(MonetDB.R(), host="localhost", dbname="testdb", user="monetdb", password="monetdb")
foo <- data.frame(replicate(10,sample(0:10,1000000,rep=TRUE)))
dbWriteTable(conn, "foo", foo, csvdump=FALSE, overwrite=TRUE)
### Actual Results:
...
...
...
Error in writeBin(header, con, 2, endian = "little") :
ignoring SIGPIPE signal
Calls: dbWriteTable ... doTryCatch -> .mapiRequest -> .mapiWrite -> writeBin
II: Interrupted query execution.
QQ: 'ROLLBACK'
II: Interrupted query execution.
Execution halted
Warning message:
In writeBin(reqr, con, endian = "little") : problem writing to connection
### Expected Results:
Should just work (albeit being slow) or
it should produce a better error message or
csvdump=TRUE should become the default flag.
Since this seems to be a performance related bug. The actual threshold for the size of the dataset that produces the error occur, can vary.
By the way, this is actually more of a "clients" type of bug. However there is no subsection for R related bugs. There should be an entry for R there.
## Comment 26799
Date: 2019-01-17 10:01:55 +0100
From: @aris-koning
To add some more context:
When csvdump=TRUE this results into a "COPY INTO ... FROM <some-temporary-csv-file>" statement where R itself creates the <some-temporary-csv-file>.
When csvdump=FALSE this results into a (big) INSERT INTO statement.
## Comment 26845
Date: 2019-01-23 13:32:33 +0100
From: @hannesmuehleisen
This seems to work for me (on OSX). Please use the MonetDBLite package instead of the very deprecated MonetDB.R package. MonetDBLite also contains the MAPI client.
In general, it is not required to attach the MonetDBLite package anyway. Suggest to start like this:
library(DBI)
options(monetdb.debug.query=TRUE)
conn <- dbConnect(MonetDBLite::MonetDB.R(), host="localhost", dbname="demo", user="monetdb", password="monetdb")
| MonetDB.R cannot handle large INSERT INTO statements | https://api.github.com/repos/MonetDB/MonetDB/issues/6679/comments | 0 | 2020-11-30T16:32:43Z | 2024-06-28T13:10:08Z | https://github.com/MonetDB/MonetDB/issues/6679 | 753,624,604 | 6,679 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-15 17:35:56 +0100
From: jpastuszek
To: clients devs <<bugs-clients>>
Version: 11.31.11 (Aug2018-SP1)
CC: ferenc.sipos
Last updated: 2019-04-30 12:36:03 +0200
## Comment 26794
Date: 2019-01-15 17:35:56 +0100
From: jpastuszek
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
When working with parametrized queries if I bind NULL to any parameter apart from the first one the generated statement is missing separating comma and SQLExecute fails with "syntax error, unexpected sqlNULL, expecting ')' or ','".
Reproducible: Always
### Steps to Reproduce:
1. Create prepared statement with more than one "?"
2. Bind NULL value for parameter that is not the first one with SQLBindParameter (NULL ParameterValuePtr and SQL_NULL_DATA *StrLen_or_IndPtr)
3. Call SQLExecute
### Actual Results:
"syntax error" with missing separator before NULL value:
SQLPrepare: "INSERT INTO source_syslog.http_access_today (logentry_id, record_type) VALUES (?, ?)"
SQLBindParameter 0x7ff044f02d60 1 1 SQL_C_CHAR SQL_VARCHAR 0 0 0x0 0 0x108ea2208
SQLBindParameter 0x7ff044f02d60 2 1 SQL_C_CHAR SQL_VARCHAR 13 0 0x108e284a0 0 0x108ea2210
SQLExecute 0x7f84a0609940 execute 7 ('bax-176849470'NULL)
addStmtError 0x7f84a0609940 42000 syntax error, unexpected sqlNULL, expecting ')' or ',' in: "execute 7 ('bax-176849470'null" 0
### Expected Results:
Success. Something like this:
SQLExecute 0x7ff044f02d60
SQLExecute 0x7ff044f02d60 execute 7 ('bax-176849470',NULL)
ODBCInitResult: querytype Q_UPDATE, rowcount 1
The problem looks to be in ODBCConvert.c where ODBCStore will handle NULL case before writing out separator:
https://github.com/MonetDB/MonetDB/blob/541b47c75f931e8749f69e6d02d056898a31eea9/clients/odbc/driver/ODBCConvert.cL2947
https://github.com/MonetDB/MonetDB/blob/master/clients/odbc/driver/ODBCConvert.cL3191
This way we can use NULL as long as it is the first parameter (no need for separator) but the driver generates wrong statements for any following NULL parameter.
## Comment 26795
Date: 2019-01-16 10:04:37 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [1b7efcbc9f7b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b7efcbc9f7b) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1b7efcbc9f7b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1b7efcbc9f7b)
Changeset description:
Always add separator before adding value.
This should fix bug #6678.
## Comment 26796
Date: 2019-01-16 10:05:34 +0100
From: @sjoerdmullender
I'm pretty confident that this fixes the bug, so I'm closing it.
Feel free to reopen if the fix doesn't work.
## Comment 26947
Date: 2019-04-03 20:37:50 +0200
From: @sjoerdmullender
*** Bug #6694 has been marked as a duplicate of this bug. ***
| Binding NULL parameter to parametrized query results in syntax error on execution | https://api.github.com/repos/MonetDB/MonetDB/issues/6678/comments | 0 | 2020-11-30T16:32:39Z | 2024-06-27T13:05:36Z | https://github.com/MonetDB/MonetDB/issues/6678 | 753,624,557 | 6,678 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-15 13:48:51 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.13 (Aug2018-SP2)
CC: @mlkersten, @njnes
Last updated: 2019-07-27 22:51:35 +0200
## Comment 26793
Date: 2019-01-15 13:48:51 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
Build Identifier:
Many (dynamically typed) language specific ORM frameworks when connecting to a database table, have to perform an initial query to create (something like) a runtime class representing the table's schema.
For instance in R when using DBI, MonetDB.R, dbplyr libraries to connect to table foo in MonetDB, the following code
conn <- dbConnect(MonetDB.R(), host="localhost", dbname="testdb", user="monetdb", password="monetdb")
foo <- tbl(conn, "foo")
foo %>% filter(bar %like% '%baz%') %>% collect()
will first perform a dummy query whose result set will be empty in order to get the necessary meta-data:
select * from foo where 0 = 1;
Afterwards it constructs and submits the actual query:
select * from foo where bar like '%baz%';
The problem is that MonetDB produces plans that are oblivious to the fact that the predicate is an anti-tautology and performs a (full) scan to check the data against the predicate. Which obviously takes an unnecessarily long time to finish on a large table.
Since it is a MAL optimizer that is responsible to evaluate constant expressions, I propose to implement an additional optimizer further in the pipeline that checks for static (anti-)tautologies in the plan and consecutively shortcuts the relevant parts of the script by immediately returning empty results where appropriate.
This is the second time that we at MonetDB Solutions have hit this problem.
Reproducible: Always
### Steps to Reproduce:
1.set optimizer = 'sequential_pipe';
2.explain select bar from foo where 0 = 1;
### Actual Results:
X_6:int := sql.mvc();
...MAL statements...
C_7:bat[:oid] := sql.tid(X_6:int, "sys":str, "foo":str);
X_10:bat[:str] := sql.bind(X_6:int, "sys":str, "foo":str, "bar":str, 0:int);
X_19:bat[:str] := algebra.projection(C_7:bat[:oid], X_10:bat[:str]);
X_46:bat[:bit] := algebra.project(X_19:bat[:str], true:bit);
C_47:bat[:oid] := algebra.thetaselect(X_46:bat[:bit], false:bit, "==":str);
...more MAL statements...
### Expected Results:
X_6:int := sql.mvc();
...MAL statements...
C_7:bat[:oid] := sql.tid(X_6:int, "sys":str, "foo":str);
X_10:bat[:str] := sql.bind(X_6:int, "sys":str, "foo":str, "bar":str, 0:int);
X_47:bat[:oid] := bat.new(nil:str);
...more MAL statements...
## Comment 26846
Date: 2019-01-23 13:36:31 +0100
From: @njnes
probably easier to implement a function select( cand, bool) which returns cand or empty cand. And use this in the rel2bin_select lines 2804/5
## Comment 26850
Date: 2019-01-25 09:40:46 +0100
From: @aris-koning
I think it sounds good.
## Comment 27180
Date: 2019-07-27 22:51:35 +0200
From: @mlkersten
Constant evaluation is limited to scalar expressions and does not take part at
the SQL optimizer layer (except for trivial cases).
Expanding them to expressions over constant BATs is a major effort.
Furthermore, if the where clause produces an empty candidate list, then
the subsequent projections are cheap anyway.
I would not consider this worth looking into.
We might consider "SELECT * FROM R LIMIT 0" as a better alternative.
(unfortunately LIMIT now requires a positive number)
| MonetDB should optimize queries of the form select * from foo where FALSE, select * from foo where 0 = 1, etc. | https://api.github.com/repos/MonetDB/MonetDB/issues/6677/comments | 0 | 2020-11-30T16:32:37Z | 2024-06-28T13:10:07Z | https://github.com/MonetDB/MonetDB/issues/6677 | 753,624,522 | 6,677 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-10 18:32:58 +0100
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
Last updated: 2019-04-30 12:36:01 +0200
## Comment 26788
Date: 2019-01-10 18:32:58 +0100
From: Martin van Dinther <<martin.van.dinther>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:64.0) Gecko/20100101 Firefox/64.0
Build Identifier:
The system table sys._tables contains character string data in column "query" whose length (2811) is larger than the allowed max length specification of 2048.
The "query" column in tables sys._tables and tmp._tables needs to be created with a much larger maximum size, for instance 65535, such that large view definitions can be created and stored.
Please do not change the data type to clob. It should remain a varchar.
Reproducible: Always
### Steps to Reproduce:
\d sys._tables
\d tmp._tables
select length(query), t.* from sys._tables t where length(query) > 2048;
select length(query), t.* from sys._tables t order by length(query) desc limit 3;
select * from columns where name = 'query' and table_id in (select id from tables where system and query is null);
### Actual Results:
sql>\d sys._tables
CREATE TABLE "sys"."_tables" (
"id" INTEGER,
"name" VARCHAR(1024),
"schema_id" INTEGER,
"query" VARCHAR(2048),
"type" SMALLINT,
"system" BOOLEAN,
"commit_action" SMALLINT,
"access" SMALLINT
);
sql>\d tmp._tables
CREATE TABLE "tmp"."_tables" (
"id" INTEGER,
"name" VARCHAR(1024),
"schema_id" INTEGER,
"query" VARCHAR(2048),
"type" SMALLINT,
"system" BOOLEAN,
"commit_action" SMALLINT,
"access" SMALLINT
);
sql>select length(query), t.* from _tables t where length(query) > 2048;
+------+------+------+------+-----------------------------------------------------------------------------------------------------+------+-------+------+------+
| L2 | id | name | sche | query | type | syste | comm | acce |
: : : : ma_i : : : m : it_a : ss :
: : : : d : : : : ctio : :
: : : : : : : : n : :
+======+======+======+======+=====================================================================================================+======+=======+======+======+
| 2811 | 6853 | ids | 2000 | create view sys.ids (id, name, schema_id, table_id, table_name, obj_type, sys_table) as | 1 | true | 0 | 0 |
: : : : : select id, name, cast(null as int) as schema_id, cast(null as int) as table_id, cast(null as varcha : : : : :
: : : : : r(124)) as table_name, 'author' as obj_type, 'sys.auths' as sys_table from sys.auths union all : : : : :
: : : : : select id, name, cast(null as int) as schema_id, cast(null as int) as table_id, cast(null as varcha : : : : :
: : : : : r(124)) as table_name, 'schema', 'sys.schemas' from sys.schemas union all : : : : :
: : : : : select id, name, schema_id, id as table_id, name as table_name, case when type = 1 then 'view' else : : : : :
: : : : : 'table' end, 'sys._tables' from sys._tables union all : : : : :
: : : : : select id, name, schema_id, id as table_id, name as table_name, case when type = 1 then 'view' else : : : : :
: : : : : 'table' end, 'tmp._tables' from tmp._tables union all : : : : :
: : : : : select c.id, c.name, t.schema_id, c.table_id, t.name as table_name, 'column', 'sys._columns' from s : : : : :
: : : : : ys._columns c join sys._tables t on c.table_id = t.id union all : : : : :
: : : : : select c.id, c.name, t.schema_id, c.table_id, t.name as table_name, 'column', 'tmp._columns' from t : : : : :
: : : : : mp._columns c join tmp._tables t on c.table_id = t.id union all : : : : :
: : : : : select k.id, k.name, t.schema_id, k.table_id, t.name as table_name, 'key', 'sys.keys' from sys.keys : : : : :
: : : : : k join sys._tables t on k.table_id = t.id union all : : : : :
: : : : : select k.id, k.name, t.schema_id, k.table_id, t.name as table_name, 'key', 'tmp.keys' from tmp.keys : : : : :
: : : : : k join tmp._tables t on k.table_id = t.id union all : : : : :
: : : : : select i.id, i.name, t.schema_id, i.table_id, t.name as table_name, 'index', 'sys.idxs' from sys.id : : : : :
: : : : : xs i join sys._tables t on i.table_id = t.id union all : : : : :
: : : : : select i.id, i.name, t.schema_id, i.table_id, t.name as table_name, 'index', 'tmp.idxs' from tmp.id : : : : :
: : : : : xs i join tmp._tables t on i.table_id = t.id union all : : : : :
: : : : : select g.id, g.name, t.schema_id, g.table_id, t.name as table_name, 'trigger', 'sys.triggers' from : : : : :
: : : : : sys.triggers g join sys._tables t on g.table_id = t.id union all : : : : :
: : : : : select g.id, g.name, t.schema_id, g.table_id, t.name as table_name, 'trigger', 'tmp.triggers' from : : : : :
: : : : : tmp.triggers g join tmp._tables t on g.table_id = t.id union all : : : : :
: : : : : select id, name, schema_id, cast(null as int) as table_id, cast(null as varchar(124)) as table_name : : : : :
: : : : : , case when type = 2 then 'procedure' else 'function' end, 'sys.functions' from sys.functions union : : : : :
: : : : : all : : : : :
: : : : : select a.id, a.name, f.schema_id, cast(null as int) as table_id, cast(null as varchar(124)) as ta...> : : : :
+------+------+------+------+-----------------------------------------------------------------------------------------------------+------+-------+------+------+
1 tuple !1 field truncated!
sql>select * from columns where name = 'query' and table_id in (select id from tables where system and query is null);
+------+-------+---------+-------------+------------+----------+---------+-------+--------+---------+
| id | name | type | type_digits | type_scale | table_id | default | null | number | storage |
+======+=======+=========+=============+============+==========+=========+=======+========+=========+
| 2071 | query | varchar | 2048 | 0 | 2067 | null | true | 3 | null |
| 2119 | query | varchar | 2048 | 0 | 2115 | null | true | 3 | null |
+------+-------+---------+-------------+------------+----------+---------+-------+--------+---------+
2 tuples
### Expected Results:
The "query" column in tables sys._tables and tmp._tables needs to be created with a much larger maximum size, for instance 65535.
## Comment 26789
Date: 2019-01-10 19:08:42 +0100
From: Martin van Dinther <<martin.van.dinther>>
Addendum: It is not required to change the tmp._tables.query column max length as it will never be populated with data (create temporary views is not supported), so it can not exceed the current maximum length of 2048.
## Comment 26801
Date: 2019-01-17 12:36:07 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [759bcf8796d8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=759bcf8796d8) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=759bcf8796d8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=759bcf8796d8)
Changeset description:
Increase maximum length of query column in sys._tables to 1 MiB.
This fixes bug #6676.
## Comment 26802
Date: 2019-01-17 12:36:53 +0100
From: @sjoerdmullender
I increased the size to 1 MiB. 64 KiB still seems a bit small.
## Comment 26803
Date: 2019-01-17 12:39:07 +0100
From: @sjoerdmullender
(In reply to Martin van Dinther from comment 1)
> Addendum: It is not required to change the tmp._tables.query column max
> length as it will never be populated with data (create temporary views is
> not supported), so it can not exceed the current maximum length of 2048.
It may not be necessary to increase the size for tmp._tables.query, but I did anyway. It's easier since the two are created with the same lines of code.
| Max data length of 2048 for column sys._tables.query is too small for the actual data (2811 for view sys.ids) | https://api.github.com/repos/MonetDB/MonetDB/issues/6676/comments | 0 | 2020-11-30T16:32:33Z | 2024-06-27T13:05:34Z | https://github.com/MonetDB/MonetDB/issues/6676 | 753,624,488 | 6,676 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-10 17:01:17 +0100
From: Arshad <<arshad.super>>
To: THE_N4R4NT <<renalkoclok>>
Version: 11.31.11 (Aug2018-SP1)
CC: castro8583bennett, gsmswadhin, hknief, renalkoclok
Last updated: 2020-06-03 09:04:34 +0200
## Comment 26786
Date: 2019-01-10 17:01:17 +0100
From: Arshad <<arshad.super>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Build Identifier:
Hello,
We are observing this, that executing query when table is freshly created the performance is good. The table is around 700 columns.
$ mclient -p 500 -d Database -u Username -is < SQL.sql
password:
+-------+
| L3 |
+=======+
| 30000 |
+-------+
1 tuple (36.3s)
However, over time the performance degrades and drops gradually to where
its over 10 times slower.
$ mclient -p 500 -d Database -u Username -is < SQL.sql
password:
+-------+
| L3 |
+=======+
| 30000 |
+-------+
1 tuple (428.9s)
To me this looks similar to the one reported under
https://www.monetdb.org/pipermail/users-list/2019-January/010380.html
The input SQL is pretty large about 5MB in size. It is not possible to post it here. However the SQL is very similar in type to below.
select sum(distinct id) from test3 where (((id > 0) OR (id > 1)) AND (id > 3) ... );
Comparing both run; with slower run this was seen in logs that there were
large number of write() syscall and open(),unlink() of *.thash. This was not
seen on case where the query is executing fast.
Slow Run Stats
==============
$ cat slow.out | grep write | wc -l
407444
$ cat slow.out | grep thash | wc -l
6141
$ cat slow.out | grep thash
<snip>
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/66/47/1664721.thash.new") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/66/47/1664721.thash") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/66/47/1664721.thash.new") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/66/47/1664721.thash") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/66/47/1664721.thash.new") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/65/77/1657734.thash") = -1 ENOENT (No such file or directory)
8102 04:35:11 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/65/77/1657734.thash.new") = -1 ENOENT (No such file or directory)
8395 04:35:12 open("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash", O_RDWR|O_CLOEXEC) = 6
8395 04:35:12 rename("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash.new", "/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash") = -1 ENOENT (No such file or directory)
8395 04:35:12 open("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash", O_RDONLY|O_CLOEXEC) = 68
8415 04:35:12 open("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash", O_RDWR|O_CLOEXEC) = 6
8415 04:35:12 rename("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash.new", "/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash") = -1 ENOENT (No such file or directory)
8415 04:35:12 open("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/04/06/54/4065463.thash", O_RDONLY|O_CLOEXEC) = 68
8395 04:35:12 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/67/62/1676257.thash") = -1 ENOENT (No such file or directory)
8395 04:35:12 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/67/62/1676257.thash.new") = -1 ENOENT (No such file or directory)
8395 04:35:12 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/67/62/1676257.thash") = -1 ENOENT (No such file or directory)
8395 04:35:12 unlink("/monet_data01/DBFARM_TSVR_P_A/DB_TSVR_P_A/bat/01/67/62/1676257.thash.new") = -1 ENOENT (No such file or directory)
<snip>
Fast Run Stats
==============
Logs when query is fast only two writes are seen (for output) and not reference to opening of "*.thash" files.
$ cat fast.out | grep thash | wc -l
0
$ cat fast.out | grep write | wc -l
2
It looked to me that every time BATcheckhash() returns 1 the query runs fast.
gdk_hash.c:BAThash()
if (BATcheckhash(b)) {
return GDK_SUCCEED; <<<< On fast run; BATcheckhash() return 1.
}
Recreating the table brings the performance of query back. But it slowly and gradually degrades to a point where its 10X degraded.
What could have lead to this degrade.Is it the hash index ? What are the scenarios where file *.thash is accessed?
Please also let me know if any further information is required.
Thanks
Arshad
Reproducible: Always
### Steps to Reproduce:
/* Repeated executing degrades performace */
1.mclient -p 500 -d Database -u Username -is < SQL.sql
### Actual Results:
$ mclient -p 500 -d Database -u Username -is < SQL.sql
password:
+-------+
| L3 |
+=======+
| 30000 |
+-------+
1 tuple (428.9s)
### Expected Results:
$ mclient -p 500 -d Database -u Username -is < SQL.sql
password:
+-------+
| L3 |
+=======+
| 30000 |
+-------+
1 tuple (36.3s)
## Comment 26787
Date: 2019-01-10 17:03:24 +0100
From: Arshad <<arshad.super>>
System Information
==================
$ ./mserver5 --version
MonetDB 5 server v11.31.11 "Aug2018-SP1" (64-bit, 128-bit integers)
$ cat config.log | grep GDK
GDK_VERSION='17:3:0'
$ uname -a
Linux hostname 3.10.0-693.el7.x86_64 1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
You have mail in /var/spool/mail/monetadmin
s
$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
## Comment 26790
Date: 2019-01-12 05:05:37 +0100
From: Herman Knief <<hknief>>
Here's some additional observations on this puzzling issue:
The slow table is "cmdb", the normal table is "cmdb2". Both have the same number of rows according to "SELECT count(*)" (73553310). However, sys.statistics shows something a bit different:
sql>SELECT x.name, count(*) AS columns_with, z.count FROM sys.tables AS x, sys.columns AS y, sys.statistics AS z WHERE x.id = y.table_id AND y.id = z.column_id GROUP BY x.name, z.count;
+-------+--------------+----------+
| name | columns_with | count |
+=======+==============+==========+
| cmdb | 8 | 73553310 |
| cmdb | 145 | 73553311 |
| cmdb2 | 153 | 73553310 |
+-------+--------------+----------+
3 tuples
sql>
For the slow table, "cmdb", there are 145/153 columns that have an extra "row". This row count mismatch causes it to skip parallelization optimizations in "monetdb5/optimizer/opt_mitosis.c", line 212.
A few related questions:
1) In the columnar model, is is valid for conceptual tuples to exist which don't have values for each column like this? (This seems strange as now there's a difference between an explicit NULL and "not existing"). How might this situation have happened? (Only transactional full-row inserts were applied to this DB). Can this be repaired?
2) Is the conditional in "monetdb5/optimizer/opt_mitosis.c", line 212 sufficiently robust? I may be misunderstanding the full context of this line, but it seems like we could still benefit from splitting/parallelization when r < rowcnt, no?
Thanks,
-Jeremy Norris
## Comment 26800
Date: 2019-01-17 12:30:34 +0100
From: Arshad <<arshad.super>>
Hi,
Few extra debugging info I could gather using querylog.
id = 354250; is where its taking more than 400 seconds. Around 415 seconds approx
id = 63721; is where is is taking less than a minute. Around 35 seconds approx.
The MAL count is same (44). However, the optimize count is different. Could you please explain what this count means here? Does higher optimize count means more optimization hits?
| id | defined | pipe | plan | mal | optimize | start | stop | arguments |tuples | run |
|354250@0|2019-01-17 12:|sequential_pipe|user.s2_12|44 |126 |2019-01-17 12:0|2019-01-17 12:0|user.s2_12()|1 |2470 | [<<SLOW>>]
|63721@0 |2019-01-17 11:|sequential_pipe|user.s2_3 |44 |153 |2019-01-17 11:0|2019-01-17 11:0|user.s2_3() |1 |2322 | [<<FAST>>]
Any other info required we would be happy to provide. We are really trying to home into root-cause of this as recreating table although a workaround, is not feasible in long run.
Thanks
Arshad
## Comment 26804
Date: 2019-01-17 13:02:39 +0100
From: @sjoerdmullender
(In reply to Arshad from comment 3)
> Hi,
>
> Few extra debugging info I could gather using querylog.
>
> id = 354250; is where its taking more than 400 seconds. Around 415 seconds
> approx
> id = 63721; is where is is taking less than a minute. Around 35 seconds
> approx.
>
> The MAL count is same (44). However, the optimize count is different. Could
> you please explain what this count means here? Does higher optimize count
> means more optimization hits?
>
> | id | defined | pipe | plan | mal | optimize | start
> | stop | arguments |tuples | run |
> |354250@0|2019-01-17 12:|sequential_pipe|user.s2_12|44 |126
> |2019-01-17 12:0|2019-01-17 12:0|user.s2_12()|1 |2470 | [<<SLOW>>]
> |63721@0 |2019-01-17 11:|sequential_pipe|user.s2_3 |44 |153
> |2019-01-17 11:0|2019-01-17 11:0|user.s2_3() |1 |2322 | [<<FAST>>]
>
> Any other info required we would be happy to provide. We are really trying
> to home into root-cause of this as recreating table although a workaround,
> is not feasible in long run.
>
> Thanks
> Arshad
If I'm not mistaken, the "mal" column is the number of MAL instructions in the (optimized) query plan. The "optimize" column is the time it took (in microseconds) to optimize the plan. So it's not so strange that those values vary and that the "mal" column does not.
The "run" column is (I believe) the time it took to run the query. They are not very different for the fast and slow queries.
## Comment 26805
Date: 2019-01-17 13:03:00 +0100
From: @sjoerdmullender
You say that whenever the code
if (BATcheckhash(b)) {
return GDK_SUCCEED;
}
is executed, the query is fast. This is code to check whether there is a valid hash index which is then used by whatever code calls BAThash. If the check fails, there is no hash index, so one is created. This is probably what makes it slow.
The question is then, why is there no hash index? From the trace extract you quote, it looks like the hash index is destroyed for some reason. I currently don't have an idea why that would be (apart from obvious ones like the underlying BAT is being changed which I assume is not the case).
It might be interesting to see where in the code the HASHdestroy is being called. This might give a clue as to why it is being destroyed.
## Comment 26812
Date: 2019-01-20 08:39:20 +0100
From: Arshad <<arshad.super>>
Hi Sjoerd,
Could a call to BATclear() take long time to finish and slow things down? Here is the summary, and it looks like it is to me. Could you please comment on this. Is there anything else you want me to submit.
Tracing HASHdestroy(), I put breakpoints to every path HASHdestory() is called. It is clear that Batclear() is called more time when the performance is degraded. However, after table recreate and then running the SQL the Batclear() is just called once.
It looks like call chain BUNinplace()->BATdelete()->BATclear() takes considerable time every time it is called and is causing the slowness and performance degrade.
This is taking time and is called more times when run is slow:
==============================================================
breakpoint keep y 0x00007f31b1ff8a53 in BATclear at gdk_bat.c:505
breakpoint already hit 13 times <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Breakpoint Info when run is slow:
=================================
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007f31b1fc293c in BATappend at gdk_batop.c:649
2 breakpoint keep y 0x00007f31b1fc4108 in BATappend at gdk_batop.c:737
3 breakpoint keep y 0x00007f31b1fc4060 in BATappend at gdk_batop.c:447
4 breakpoint keep y 0x00007f31b1fc24b5 in BATappend at gdk_batop.c:618
5 breakpoint keep y 0x00007f31b1ff47e7 in BUNdelete at gdk_bat.c:1124
6 breakpoint keep y 0x00007f31b1ff77e4 in BUNinplace at gdk_bat.c:1163
breakpoint already hit 13 times
continue
7 breakpoint keep y 0x00007f31b1ff8a53 in BATclear at gdk_bat.c:505
breakpoint already hit 13 times
continue
8 breakpoint keep y 0x00007f31b1ff77ec in BUNinplace at gdk_bat.c:1164
breakpoint already hit 13 times
continue
9 breakpoint keep y 0x00007f31b1ff44d8 in BATextend at gdk_bat.c:474
breakpoint already hit 1529 times
continue
10 breakpoint keep y 0x00007f31b1ffbd43 in BATundo at gdk_delta.c:104
11 breakpoint keep y 0x00007f31b1fcf400 in BATmaterialize at gdk_align.c:235
12 breakpoint keep y 0x00007f31b1fcfcb4 in VIEWdestroy at gdk_align.c:490
breakpoint already hit 122 times
continue
13 breakpoint keep y 0x00007f31b1ff33b3 in BATdelete at gdk_storage.c:870
breakpoint already hit 11234 times
continue
(gdb)
Please Notice, BATclear() being called only once when run is fast:
==================================================================
breakpoint keep y 0x00007f3503469a53 in BATclear at gdk_bat.c:505
breakpoint already hit 1 time <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Breakpoint Info when run is fast:
=================================
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007f350343393c in BATappend at gdk_batop.c:649
2 breakpoint keep y 0x00007f3503435108 in BATappend at gdk_batop.c:737
3 breakpoint keep y 0x00007f3503435060 in BATappend at gdk_batop.c:447
4 breakpoint keep y 0x00007f35034334b5 in BATappend at gdk_batop.c:618
5 breakpoint keep y 0x00007f35034657e7 in BUNdelete at gdk_bat.c:1124
6 breakpoint keep y 0x00007f35034687e4 in BUNinplace at gdk_bat.c:1163
breakpoint already hit 1 time
continue
7 breakpoint keep y 0x00007f3503469a53 in BATclear at gdk_bat.c:505
breakpoint already hit 1 time
continue
8 breakpoint keep y 0x00007f35034687ec in BUNinplace at gdk_bat.c:1164
breakpoint already hit 1 time
continue
9 breakpoint keep y 0x00007f35034654d8 in BATextend at gdk_bat.c:474
breakpoint already hit 102 times
continue
10 breakpoint keep y 0x00007f350346cd43 in BATundo at gdk_delta.c:104
11 breakpoint keep y 0x00007f3503440400 in BATmaterialize at gdk_align.c:235
12 breakpoint keep y 0x00007f3503440cb4 in VIEWdestroy at gdk_align.c:490
breakpoint already hit 9810 times
continue
13 breakpoint keep y 0x00007f35034643b3 in BATdelete at gdk_storage.c:870
breakpoint already hit 21671 times
continue
(gdb)
Thanks
Arshad
## Comment 26848
Date: 2019-01-24 12:11:34 +0100
From: Arshad <<arshad.super>>
Hi Sjoerd,
Here is more debugging info. As noted on slow run the writes call are very high. Since the breakpoints were hit many time once such back-trace for write IO is provided below. Since the SQL is just select (read only) what could have caused the write to bump up this high? Loggger ?. Also seen is the high number of stat and brk() calls. What could have caused it to degrade over time?
BAThash as usual Slow runs hits BAThash considerably large number of times versus the good run.
Is there anything else as log you want to be provided ?
Result bad performance
======================
(gdb) info breakpoints
Num Type Disp Enb Address What
1 catchpoint keep y syscall "write"
catchpoint already hit 1128210 times
continue
2 catchpoint keep y syscall "read"
3 catchpoint keep y syscall "stat"
catchpoint already hit 184 times
continue
4 catchpoint keep y syscall "brk"
catchpoint already hit 280 times
continue
5 catchpoint keep y syscall "mmap"
catchpoint already hit 3238 times
continue
6 catchpoint keep y syscall "munmap"
catchpoint already hit 3717 times
continue
(gdb)
Slow runs hits BAThash considerably large number of times versus the good run.
Slow run BAThash
================
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007f3503439a00 in BAThash at gdk_hash.c:322
breakpoint already hit 7723 times <<<<<<<
bt
continue
(gdb)
Result good performance
=======================
(gdb) info break
Num Type Disp Enb Address What
1 catchpoint keep y syscall "write"
catchpoint already hit 63463 times
continue
2 catchpoint keep y syscall "read"
3 catchpoint keep y syscall "stat"
catchpoint already hit 8 times
continue
4 catchpoint keep y syscall "brk"
catchpoint already hit 16 times
continue
5 catchpoint keep y syscall "mmap"
catchpoint already hit 2870 times
continue
6 catchpoint keep y syscall "munmap"
catchpoint already hit 6316 times
continue
(gdb)
Good run BAThash
================
(gdb) info break
Num Type Disp Enb Address What
1 breakpoint keep y 0x00007f1dc36a3b30 in BAThash at gdk_hash.c:332
breakpoint already hit 3 times <<<<<<<
(gdb)
Write back trace
================
(gdb) bt
0 0x00007f1dc0f3085d in write () from /lib64/libc.so.6
1 0x00007f1dc0ebcfb3 in _IO_new_file_write () from /lib64/libc.so.6
2 0x00007f1dc0ebe41c in __GI__IO_do_write () from /lib64/libc.so.6
3 0x00007f1dc0ebd651 in __GI__IO_file_xsputn () from /lib64/libc.so.6
4 0x00007f1dc0e8f69d in vfprintf () from /lib64/libc.so.6
5 0x00007f1dc0e98827 in fprintf () from /lib64/libc.so.6
6 0x00007f1dc36ab06c in new_bbpentry (fp=fp@entry=0x7f1c400c4710, i=i@entry=596, prefix=prefix@entry=0x7f1dc372c0bf "") at gdk_bbp.c:1628
7 0x00007f1dc36ab5c4 in BBPdir_subcommit (cnt=cnt@entry=615963, subcommit=subcommit@entry=0x7f1c4016c6b0) at gdk_bbp.c:1728
8 0x00007f1dc36b8665 in BBPdir (subcommit=0x7f1c4016c6b0, cnt=-1013662880) at gdk_bbp.c:1786
9 BBPsync (cnt=cnt@entry=615963, subcommit=subcommit@entry=0x7f1c4016c6b0) at gdk_bbp.c:3348
10 0x00007f1dc36a6053 in TMsubcommit_list (subcommit=subcommit@entry=0x7f1c4016c6b0, cnt=cnt@entry=615963) at gdk_tm.c:205
11 0x00007f1dc36d945e in bm_subcommit (lg=lg@entry=0x10098450, list_bid=<optimized out>, list_nme=0x1d815c0, catalog_bid=0x338fcb0,
catalog_nme=0x1d815c0, dcatalog=0x157cdc0, extra=extra@entry=0x7f1c40045fc0, debug=0) at gdk_logger.c:1371
12 0x00007f1dc36d9dae in bm_commit (lg=lg@entry=0x10098450) at gdk_logger.c:2784
13 0x00007f1dc36da0e8 in logger_commit (lg=0x10098450) at gdk_logger.c:1202
14 logger_exit (lg=lg@entry=0x10098450) at gdk_logger.c:2065
15 0x00007f1dc36dc0a9 in logger_restart (lg=0x10098450) at gdk_logger.c:2122
16 0x00007f1dade32f3a in bl_restart () at bat_logger.c:249
17 0x00007f1dade2778b in store_manager () at store.c:1864
18 0x00007f1daddc4845 in mvc_logmanager () at sql_mvc.c:189
19 0x00007f1dc1211e25 in start_thread () from /lib64/libpthread.so.0
20 0x00007f1dc0f3f34d in clone () from /lib64/libc.so.6
(gdb)
## Comment 26862
Date: 2019-01-30 14:34:24 +0100
From: Arshad <<arshad.super>>
Hi,
Any update and/or more pointers where we could look further on this ?
Thanks
Arshad
## Comment 26920
Date: 2019-03-12 08:26:13 +0100
From: Swadhin <<gsmswadhin>>
Hi Devs,
We are on latest mserver version "v11.31.13 (Aug2018-SP2)" running on CentOS 7.4 server.
I am not sure if this is the exactly the same case, I found it while searching for existing bug.
We are also observing the same pattern where the query degrades overtime until it is recreated.
Please do let me know what all more info is required. I will submit them.
@Arshad: Did you find the solution/workaround for this? Could you please share.?
Regards,
Swadhin
## Comment 26921
Date: 2019-03-12 09:00:26 +0100
From: Arshad <<arshad.super>>
Hi Swadhin,
Other than Recreating table manually, which you have already mentioned. I have not found any other method that brings the performance back. I will let the Monetdb Dev team to pitch in on this.
I have raised the importance of the defect.
Thanks
Arshad
## Comment 27121
Date: 2019-07-10 15:35:22 +0200
From: Castro B <<castro8583bennett>>
But it slowly and gradually degrades to a point where its 10X degraded
SO what should we do?
Castro B,
https://voucher.co.id
| Executing SQL query repeatedly, degrades performance | https://api.github.com/repos/MonetDB/MonetDB/issues/6675/comments | 0 | 2020-11-30T16:32:29Z | 2024-06-28T13:10:07Z | https://github.com/MonetDB/MonetDB/issues/6675 | 753,624,434 | 6,675 |
[
"MonetDB",
"MonetDB"
] | Date: 2019-01-06 14:47:26 +0100
From: Paul <<paul>>
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.11 (Aug2018-SP1)
CC: @kutsurak
Last updated: 2019-04-30 12:36:04 +0200
## Comment 26779
Date: 2019-01-06 14:47:26 +0100
From: Paul <<paul>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0
Build Identifier:
When an R UDF is defined with an output using a date type field as an output argument of an embedded R UDF the field fails with a message "Failed to convert column 0"
Reproducible: Always
### Steps to Reproduce:
1.Create a table with dates
```
CREATE TABLE testTableDates (d DATE);
INSERT INTO testTableDates(d) VALUES ('2019-01-01'),('2019-01-02'),('2019-01-03');
```
2. Create a simple loopback R based UDF
```
CREATE FUNCTION testDateLoopback(din DATE) RETURNS TABLE (dout DATE) LANGUAGE R {
data.frame(dout=din)
}
```
3. Call loopback the UDF
SELECT * FROM testDateLoopback( (SELECT * FROM testTableDates) )
### Actual Results:
"Failed to convert column 0"
### Expected Results:
'2019-01-01'
'2019-01-02'
'2019-01-03'
Dug into the code base and found that there is a TODO for this but cannot find any ticket raised for it:
bat_to_sexp: Works sufficiently due to bat type being an integer although R sees the date as an integer.
sexp_to_bat: Looks at the UDF arg type and fails to convert as no TYPE_Date defined
I have created an initial fix for this ready for review but cannot find any details about how to access the repository in order to push these changes and contribute to the project. Please advise on how to proceed.
## Comment 26780
Date: 2019-01-07 17:29:09 +0100
From: @kutsurak
Hello Paul,
The official MonetDB mercurial repository is hosted at
https://dev.monetdb.org/hg/MonetDB/
You can prepare a patch (preferably with the command hg export) and add it as an attachment to this issue so that someone can review it. If you need more information let us know.
Best regards,
Panos.
## Comment 26784
Date: 2019-01-09 13:28:52 +0100
From: Paul <<paul>>
Created attachment 613
initial patch for review
> Attached file: [b6674_Rapi](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6674_b6674_Rapi_613) (text/plain, 7317 bytes)
> Description: initial patch for review
## Comment 26785
Date: 2019-01-09 13:29:15 +0100
From: Paul <<paul>>
Thanks Panos,
I've attached an initial patch for review. I've fixed the date output and also the representation within R.
I was tempted to refactor some code in mtime as I noticed it defines a date_isnil but other types are in the format id_{type}_nil. I've created an alias define in this patch. Can we refactor mtime or is there a particular reason for this inconsistent naming?
Also, I'd like to add some tests for the changes but not sure how best to write them in the bat format.
Is there a quick way to generate the following in bat format?
//Proves class is Date rather than Numeric
CREATE FUNCTION getClassName(din DATE) RETURNS TABLE (dout TEXT) LANGUAGE R {
data.frame(dout=class(din))
}
SELECT * FROM getClassName( (SELECT * FROM T001) )
//Prove that conversion is correctly offsetting for epoch
CREATE FUNCTION passthroughConversionCheck(din DATE) RETURNS TABLE (dout DATE) LANGUAGE R {
data.frame(dout=as.Date(as.double(din), origin="1970-1-1") )
}
SELECT * FROM passthroughConversionCheck( (SELECT * FROM T001) )
## Comment 26791
Date: 2019-01-14 16:00:16 +0100
From: @kutsurak
Hi Paul,
Thanks for the patch. Part of our team is in the middle of moving to a new building so this might take some time to process.
About your question with respect to mtime, revisiting this code has been one of our TODO items for some time now, but as far as I know there has been a number of related issues that we would like to visit at the same time. I will check and get back to you as soon as I can.
Thank you again,
Panos.
## Comment 26792
Date: 2019-01-14 16:15:53 +0100
From: Paul <<paul>>
Thanks for the update Panos, good luck with the move.
Useful to know that about mtime, I figured as much given the almost "here be dragons" style comments and the well documented history of time in there, fun read!
That reminds me I was doing further testing and can't quite get my head around one of the results.
A date defined as null returns as null with a direct query, but when it involves a call to an R UDF it returns as nil. I thought I had used the int null check rather than dbl null check but switching those makes no difference difference. When you have a moment I'd love to get your thoughts on where that comes from - I wasn't aware nil was a valid value to store.
## Comment 26873
Date: 2019-02-04 15:37:33 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [fe2012cbd8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fe2012cbd8dc) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fe2012cbd8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fe2012cbd8dc)
Changeset description:
Applied patch from bug #6674.
## Comment 26874
Date: 2019-02-04 17:35:49 +0100
From: @sjoerdmullender
(In reply to Paul from comment 3)
> I was tempted to refactor some code in mtime as I noticed it defines a
> date_isnil but other types are in the format id_{type}_nil. I've created an
> alias define in this patch. Can we refactor mtime or is there a particular
> reason for this inconsistent naming?
Historical reasons.
I've now changed the macros to is_date_nil etc.
## Comment 26932
Date: 2019-03-19 09:29:10 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [ee38b509dbe9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ee38b509dbe9) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ee38b509dbe9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ee38b509dbe9)
Changeset description:
Added test for bug #6674.
## Comment 26933
Date: 2019-03-19 09:30:18 +0100
From: @sjoerdmullender
Patch applied, test added. Closing.
| R UDF with Date type fails to convert RAPI | https://api.github.com/repos/MonetDB/MonetDB/issues/6674/comments | 0 | 2020-11-30T16:32:26Z | 2024-06-27T13:05:31Z | https://github.com/MonetDB/MonetDB/issues/6674 | 753,624,389 | 6,674 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-25 12:33:35 +0100
From: @swingbit
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @mlkersten, @njnes
Last updated: 2019-01-31 12:29:38 +0100
## Comment 26755
Date: 2018-12-25 12:33:35 +0100
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Build Identifier:
-- example data
CREATE TABLE attrs(subject STRING, attribute STRING, value STRING);
INSERT INTO attrs VALUES ('_:house/903965','address','Zuiderkruis 602');
INSERT INTO attrs VALUES ('_:house/903965','city','Veenendaal');
INSERT INTO attrs VALUES ('_:house/903965','postocode','3902 XT');
INSERT INTO attrs VALUES ('_:house/903965','description','Dit verzorgde 4-KAMERAPPARTEMENT is gelegen op ...');
INSERT INTO attrs VALUES ('_:house/903965','type','koop');
INSERT INTO attrs VALUES ('_:house/903965','bouw','bestaan');
INSERT INTO attrs VALUES ('_:city/Veenendaal','name','Veenendaal');
INSERT INTO attrs VALUES ('_:city/Veenendaal','country','Nederland');
-- Python version of count aggregate
CREATE OR REPLACE AGGREGATE pycount(val STRING)
RETURNS INTEGER
LANGUAGE PYTHON {
unique = numpy.unique(aggr_group)
x = numpy.zeros(shape=(unique.size))
for i in range(0, unique.size):
x[i] = val[aggr_group==unique[i]].size
return(x)
};
-- show groups as received from Python aggregate
CREATE OR REPLACE AGGREGATE showgroups(val STRING)
RETURNS STRING
LANGUAGE PYTHON {
return(aggr_group)
};
-- 2-column grouping, SQL count
SELECT subject, attribute, count(a.value) as value
FROM attrs as a
GROUP by subject, attribute;
-- correct output
+-------------------+-------------+-------+
| subject | attribute | value |
+===================+=============+=======+
| _:house/903965 | address | 1 |
| _:house/903965 | city | 1 |
| _:house/903965 | postocode | 1 |
| _:house/903965 | description | 1 |
| _:house/903965 | type | 1 |
| _:house/903965 | bouw | 1 |
| _:city/Veenendaal | name | 1 |
| _:city/Veenendaal | country | 1 |
+-------------------+-------------+-------+
8 tuples
-- 2-column grouping, Python count
SELECT subject, attribute, pycount(a.value) as value
FROM attrs as a
GROUP by subject, attribute;
-- wrong output (also notice that it says 8 tuples, but there are only 7)
+-------------------+-------------+-------+
| subject | attribute | value |
+===================+=============+=======+
| _:house/903965 | address | 1 |
| _:house/903965 | city | 1 |
| _:house/903965 | postocode | 1 |
| _:house/903965 | description | 1 |
| _:house/903965 | type | 1 |
| _:house/903965 | bouw | 2 |
| _:city/Veenendaal | name | 1 |
+-------------------+-------------+-------+
8 tuples
-- 2-column grouping, show groups as received from Python aggregate
SELECT subject, attribute, showgroups(a.value) as value
FROM attrs as a
GROUP by subject, attribute;
-- groups passed to the aggregate seem wrong
+-------------------+-------------+-----------------+
| subject | attribute | value |
+===================+=============+=================+
| _:house/903965 | address | 140128595850888 |
| _:house/903965 | city | 140128598351136 |
| _:house/903965 | postocode | 140128598349456 |
| _:house/903965 | description | 140128598409128 |
| _:house/903965 | type | 140128598350464 |
| _:house/903965 | bouw | 140128598350560 |
| _:city/Veenendaal | name | 140128598351136 |
| _:city/Veenendaal | country | 140128598351088 |
+-------------------+-------------+-----------------+
8 tuples
Reproducible: Always
## Comment 26756
Date: 2018-12-25 12:43:06 +0100
From: @swingbit
Interesting: the same example seems to work correctly on a different machine, same MonetDB version.
Where it fails, it keeps failing on a newly created database.
## Comment 26757
Date: 2018-12-26 11:51:11 +0100
From: @swingbit
UPDATE: It does fail on both the instances I've tried. Only, every time I restart mserver5 results are different. Most of the times wrong, sometimes correct. It seems unpredictable.
## Comment 26758
Date: 2018-12-26 12:31:48 +0100
From: @mlkersten
Report what the compiler produces as MAL code?
Make sure the Python code is correct and internally gets the proper data/and returns
## Comment 26759
Date: 2018-12-26 13:15:43 +0100
From: @mlkersten
Is there any concurrent workload? including concurrent use of a Python UDF?
## Comment 26760
Date: 2018-12-26 13:38:19 +0100
From: @swingbit
Created attachment 612
Trace of the failing pycount aggregate
> Attached file: [bug-6673.trace](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6673_bug-6673.trace_612) (text/plain, 9301 bytes)
> Description: Trace of the failing pycount aggregate
## Comment 26761
Date: 2018-12-26 13:41:53 +0100
From: @swingbit
Hi Martin,
I attached the trace of the failing pycount() aggregate.
There is no activity on the database other than the failing query.
I doubt that the problem is in the grouping itself, because the normal count() works fine.
I also doubt that the issue is in the Python aggregate function itself, it seems correct to me. Also, the aggregate "showgroups" (see first post) shows that the groups passed to the function are wrong.
It seems to me that the error must be inside the pyapi.subeval_aggr() code.
## Comment 26842
Date: 2019-01-23 10:50:20 +0100
From: @njnes
I'm unable to repeat the problem on the latest code base (both Aug2018, Apr2019 and default)
## Comment 26864
Date: 2019-01-31 12:29:38 +0100
From: @swingbit
I cannot reproduce it either, on Aug2018.
That's good news, I guess :)
| Multi-column grouping broken for Python aggregates | https://api.github.com/repos/MonetDB/MonetDB/issues/6673/comments | 0 | 2020-11-30T16:32:21Z | 2024-06-27T13:05:30Z | https://github.com/MonetDB/MonetDB/issues/6673 | 753,624,328 | 6,673 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-20 14:59:03 +0100
From: jpastuszek
To: clients devs <<bugs-clients>>
Version: 11.31.11 (Aug2018-SP1)
Last updated: 2019-01-14 17:29:07 +0100
## Comment 26740
Date: 2018-12-20 14:59:03 +0100
From: jpastuszek
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
I have a problem with ODBC driver while querying for long STRING (WCHAR and similar).
I am using an ODBC wrapper that will call SQLGetData with 512 bytes long buffer expecting SQL_SUCCESS_WITH_INFO if data was truncated to fit in that buffer.
Unfortunately the call returns SQL_SUCCESS even if the queried string is longer than the buffer provided and the StrLen_or_Ind value points outside of that buffer (depending on actual length of the string multiplied by 2 (UTF-16)).
This makes it impossible to retrieve the full string as additional calls to SQLGetData for same column will return SQL_NO_DATA.
The query I use for testing is:
SELECT 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec magna ligula, sollicitudin nec ultricies sit amet, luctus id est. Nunc cursus pellentesque blandit. Nullam dolor nulla, cursus cursus mattis id, scelerisque eu nisl. Vivamus ornare metus nullam.';
The string is 257 chars long. After the call I get this information from debugging I put around the call:
SQLGetData: col: 1 type: SQL_C_WCHAR start_pos: 0 buf_len: 512
result: SQL_SUCCESS indicator: 514
From ODBCDEBUG=odbc.log
ODBCInitResult: querytype Q_TABLE, rowcount 1
SQLNumResultCols 0x7fbd24402b20
SQLDescribeCol 0x7fbd24402b20 1 0x7ffee227f1cc 512 0x7ffee227f3cc 0x7ffee227f3ce 0x7ffee227f3d0 0x7ffee227f3d8 0x7ffee227f3da
SQLFreeStmt 0x7fbd24402b20 SQL_RESET_PARAMS
SQLFetch 0x7fbd24402b20
SQLGetData 0x7fbd24402b20 1 SQL_C_WCHAR 0x10e423000 512 0x7ffee2283408
Writing 514 bytes to 0x10e423000
SQLFreeHandle Stmt 0x7fbd24402b20
SQLDisconnect 0x7fbd24600c30
Now the buffer contains some 510 (?) (+ NULL) bytes of the string and the wrapper crashes trying to access StrLen_or_Ind byte (514) of the buffer.
I have investigated further in the MonetDB ODBC driver and found what the issue could be.
The driver will do the following in ODBCFetch (called from SQLGetData):
1. For actual SQL_WCHAR and requested SQL_WCHAR column type case it will allocate temporary buffer big enough to hold the whole string. [https://github.com/MonetDB/MonetDB/blob/c8b0e2cbfef5d360b17c48cf7214b939784232ab/clients/odbc/driver/ODBCConvert.cL1248]
2. Next it will call copyString to copy data to the temporary buffer.
Note that this will never fail and won't trigger errfunc "String data, right-truncated" "01004" error case as the buffer will be always big enough. [https://github.com/MonetDB/MonetDB/blob/c8b0e2cbfef5d360b17c48cf7214b939784232ab/clients/odbc/driver/ODBCConvert.cL1279]
3. It will copy UTF-16 expanded bytes to target buffer with ODBCutf82wchar function.
This function will copy up to 510 (?) bytes of the output UTF-16 data + NULL to the buffer provided to SQLGetData and then continue on counting bytes that it would produce if buffer was longer.
The total bytes it WOULD produce is then written to the StrLen_or_IndPtr explaining why it is larger than the buffer length.
4. Log message "Writing 514 bytes to 0x10e423000" is written and SQL_SUCCESS is returned
Assuming my understanding is correct it is not possible to retrieve more than buffer length of data for UTF-16 encoded columns as the code responsible for returning SQL_SUCCESS_WITH_INFO on truncation will never trigger as it will always have big enough buffer to store UTF-8 encoded original string - it won't even work with UTF-16 encoded data at this point.
Also note that debug message "Writing 514 bytes to 0x10e423000" in this case is misleading as it reports byte of the would-be output of ODBCutf82wchar function and not actual bytes written to provided output buffer (so no out of boundary write actually occurs).
Is there a workaround for this issue?
Since my client uses UTF-8 encoded strings (Rust) going UTF-8 -> UTF-16 in the driver so then I can go UTF-16 -> UTF-8 in my client code is a waste; the returned column description indicates SQL_EXT_WCHAR type for this column so that is what I try to get WCHAR - is there a way to get UTF-8 string instead and avoid all conversion and the issue described here?
Reproducible: Always
### Steps to Reproduce:
1. Run "SELECT 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec magna ligula, sollicitudin nec ultricies sit amet, luctus id est. Nunc cursus pellentesque blandit. Nullam dolor nulla, cursus cursus mattis id, scelerisque eu nisl. Vivamus ornare metus nullam.';"
2. Provide 512 bytes long buffer to SQLGetData for column 1
### Actual Results:
StrLen_or_IndPtr value set to 514 and SQL_SUCCESS_WITH_INFO returned allowing further call to obtain remaining of the string.
### Expected Results:
StrLen_or_IndPtr value set to 511 (?) and SQL_SUCCESS returned.
Decode the string to UTF-16 and use copyString on that decoded data to copy it to output buffer. Preserve the buffer between calls to allow fetching it in parts.
## Comment 26743
Date: 2018-12-21 10:26:42 +0100
From: jpastuszek
Sorry I messed up the results section...
### Actual Results:
StrLen_or_IndPtr value set to 514 and SQL_SUCCESS returned. Follow up call for same column returns SQL_NO_DATA.
### Expected Results:
StrLen_or_IndPtr value set to 511 (?) and SQL_SUCCESS_WITH_INFO returned allowing further call to obtain remaining of the string.
## Comment 26745
Date: 2018-12-21 14:54:21 +0100
From: jpastuszek
Looks like the best option is to send SQL_C_CHAR requested type and let MonetDB driver to provide data as is.
Unfortunately there is a bug with this as well.
If I read this correctly:
"On each call, SQLGetData returns the next part of the data. It is up to the application to reassemble the parts, taking care to remove the null-termination character from intermediate parts of character data." [https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgetdata-function?view=sql-server-2017]
the driver should append null after each part (last byte of the buffer needs to be null for intermediate parts) and clients should skip that null byte when reassembling the full buffer. MonetDB driver is not setting last byte of intermediate buffers causing last character of intermediate parts to be lost. The copyString macro does not ensure this property - it only appends null to the last part.
Luckily I could workaround this by checking if the last byte is actually null but this should be fixed as well.
Please let me know if you need a separate bug report for this issue and I will crate one.
## Comment 26746
Date: 2018-12-21 16:54:58 +0100
From: @sjoerdmullender
It is extremely unlikely that I will be able to look at this bug before the year is out. But I am interested in fixing it.
## Comment 26771
Date: 2019-01-02 15:02:18 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [0b23137c480b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0b23137c480b) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0b23137c480b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0b23137c480b)
Changeset description:
Fixes for retrieving data in chunks with SQLGetData.
Also, make sure returned strings are NULL-terminated, truncating them
when needed.
This (hopefully) fixes bug #6672.
## Comment 26772
Date: 2019-01-03 12:44:10 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [8b7be856bafe](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b7be856bafe) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8b7be856bafe](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8b7be856bafe)
Changeset description:
Return SQL_SUCCESS_WITH_INFO and SQLSTATE 01004 when SQLGetData truncates.
More fixing for bug #6672.
## Comment 26773
Date: 2019-01-03 17:03:07 +0100
From: @sjoerdmullender
A number of bugs in SQLGetData have been fixed, among them the two mentioned here. (One more bug that was fixed was handling of binary data.)
| SQLGetData with SQL_C_WCHAR string truncation and invalid StrLen_or_Ind value | https://api.github.com/repos/MonetDB/MonetDB/issues/6672/comments | 0 | 2020-11-30T16:32:18Z | 2024-06-27T13:05:29Z | https://github.com/MonetDB/MonetDB/issues/6672 | 753,624,281 | 6,672 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-20 13:27:15 +0100
From: @joerivanruth
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes
Last updated: 2019-04-30 12:36:00 +0200
## Comment 26738
Date: 2018-12-20 13:27:15 +0100
From: @joerivanruth
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:65.0) Gecko/20100101 Firefox/65.0
Build Identifier:
In the reproducer shell script attached below we have a FUNCTION histo which accesses a MERGE TABLE containing a part that is a REMOTE TABLE.
If the part is not remote (second last line of the script), it returns the correct result, a single value which happens to be NULL.
If the part is remote (last line of the script), we get an error: Function 'calc.int' not defined.
Reproducible: Always
### Steps to Reproduce:
Run the attached demo.sh with pre.sql, master.sql, slave.sql and post.sql present. This script kills ALL running mserver5's and starts its own mservers on ports 5501 and 5502.
### Actual Results:
Function 'calc.int' not defined
### Expected Results:
+------+
| L2 |
+======+
| null |
+------+
## Comment 26739
Date: 2018-12-20 13:29:59 +0100
From: @joerivanruth
Created attachment 611
Tar file containing demo.sh, pre.sql, master.sql, slave.sql and post.sql
> Attached file: [q07.tar.gz](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6671_q07.tar.gz_611) (application/x-gzip, 746 bytes)
> Description: Tar file containing demo.sh, pre.sql, master.sql, slave.sql and post.sql
## Comment 26879
Date: 2019-02-06 14:48:03 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [73905a09f51b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=73905a09f51b) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=73905a09f51b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=73905a09f51b)
Changeset description:
fixes for bug #6671
## Comment 26880
Date: 2019-02-06 14:48:42 +0100
From: @njnes
handle table results from a remote query (which are single values)
| Error when running user function on merge table with remote part | https://api.github.com/repos/MonetDB/MonetDB/issues/6671/comments | 0 | 2020-11-30T16:32:15Z | 2024-06-27T13:05:28Z | https://github.com/MonetDB/MonetDB/issues/6671 | 753,624,252 | 6,671 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-17 21:07:04 +0100
From: Fabio <<palmaresk8>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @PedroTadim
Last updated: 2019-06-13 15:25:42 +0200
## Comment 26731
Date: 2018-12-17 21:07:04 +0100
From: Fabio <<palmaresk8>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Build Identifier:
UPDATE statement in MonetDB does not allow table alias (like in "UPDATE myschema.mytable AS t ...") nor three level naming (see below). This is a useful feature when we want to update a table with information from another table, and they are not in "sys" schema.
Reproducible: Always
### Steps to Reproduce:
1. Query using table alias:
UPDATE myschema.table_a AS t1
SET x = 1
WHERE EXISTS (SELECT True FROM otherschema.table_b AS t2 WHERE t1.id = t2.id)
2. Query using three level naming convention:
UPDATE myschema.table_a
SET x = 1
WHERE EXISTS (SELECT True FROM otherschema.table_b WHERE myschema.table_a.id = otherschema.table_b.id)
### Actual Results:
None of these queries are executed.
### Expected Results:
Table with update variable
## Comment 26732
Date: 2018-12-18 00:36:49 +0100
From: @PedroTadim
The alias feature in update/delete statements will be available in the next feature release.
As for three level naming, I will start working on it soon, and will be available in the feature release after the next one.
## Comment 27066
Date: 2019-06-13 15:25:42 +0200
From: @PedroTadim
Table alias in UPDATE statements added in Apr2019 release. 3 level naming is a duplicate of bug #2526.
| Add table alias in UPDATE statements | https://api.github.com/repos/MonetDB/MonetDB/issues/6670/comments | 0 | 2020-11-30T16:32:11Z | 2024-06-27T13:05:28Z | https://github.com/MonetDB/MonetDB/issues/6670 | 753,624,215 | 6,670 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-15 09:41:53 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes, @sstalin
Last updated: 2019-04-30 12:36:04 +0200
## Comment 26730
Date: 2018-12-15 09:41:53 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
When copying from stdin the user seems to be obliged to provide the number of records to be inserted. Which could be fine because I can imagine that it is otherwise hard to know when the last record is seen when reading from stdin. However this isn't immediately clear from the documentation and error message.
Reproducible: Always
### Steps to Reproduce:
1.create table if not exists foo (bar int, baz varchar(10));
2.copy into foo from stdin delimiters ',', '\n', '''';
3.5,'aa5aa'
4.0,'aa0aa'
5.
### Actual Results:
Failed to import table 'foo', Column value 1 missing
### Expected Results:
Failed to import table 'foo', nr of records have to be specified when copying from standard input.
If it is warranted that COPY INTO fails in this case, please also update the documentation to make that point clear.
## Comment 26733
Date: 2018-12-19 11:02:20 +0100
From: @njnes
empty line used to also mark the end, that seems gone. Probably better
to adapt the documentation.
## Comment 26742
Date: 2018-12-21 10:03:14 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [d5b35d896228](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d5b35d896228) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d5b35d896228](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d5b35d896228)
Changeset description:
COPY INTO ... FROM STDIN stops at empty line if no RECORDS count specified.
This fixes bug #6669.
Note that this change does not affect COPY INTO from an actual file,
nor does it affect COPY INTO FROM STDIN when a count of the number of
records to be ingested is specified.
## Comment 26744
Date: 2018-12-21 10:39:08 +0100
From: @aris-koning
Changeset looks fine to me, if the documentation is updated accordingly I would consider this issue fixed.
## Comment 26775
Date: 2019-01-04 10:00:13 +0100
From: @sjoerdmullender
(In reply to aris from comment 3)
> Changeset looks fine to me, if the documentation is updated accordingly I
> would consider this issue fixed.
Some text has been added to [1].
[1] https://www.monetdb.org/Documentation/Manuals/SQLreference/CopyInto
## Comment 26778
Date: 2019-01-04 14:58:35 +0100
From: @aris-koning
Looks very clear to me. I vote for marking the report as fixed and closing it.
## Comment 26875
Date: 2019-02-05 13:04:59 +0100
From: @sstalin
This issue is still reproducible on MacOs Mojave.
## Comment 26876
Date: 2019-02-05 16:09:47 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [a08ab79eedf3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a08ab79eedf3) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a08ab79eedf3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a08ab79eedf3)
Changeset description:
Fix for bug #6669.
Also added test.
## Comment 26877
Date: 2019-02-05 16:10:25 +0100
From: @sjoerdmullender
Fixed properly this time.
| COPY [xxx RECORDS] INTO foo FROM STDIN ... doesn't work without specifying nr of to be copied records | https://api.github.com/repos/MonetDB/MonetDB/issues/6669/comments | 0 | 2020-11-30T16:32:08Z | 2024-06-27T13:05:27Z | https://github.com/MonetDB/MonetDB/issues/6669 | 753,624,172 | 6,669 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-14 16:05:38 +0100
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes
Last updated: 2019-01-17 13:49:03 +0100
## Comment 26729
Date: 2018-12-14 16:05:38 +0100
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
It would be nice if the sample keyword works in subqueries. For instance when you want to insert random data into a table with sql.
Reproducible: Always
### Steps to Reproduce:
1.create table foo(val int);
2.create table bar(val int);
3.insert into bar (select * from generate_series(0,100)); --works (of course)
4.insert into foo (select * from bar sample 10); --error
### Actual Results:
Step the 4. gives an error:
syntax error, unexpected SAMPLE, expecting UNION or EXCEPT or INTERSECT or ')' in: "insert into foo (select * from foo sample"
### Expected Results:
That table foo contains 10 values randomly picked from table bar.
## Comment 26734
Date: 2018-12-19 11:10:37 +0100
From: @njnes
subqueries with order by, limit and sample work without the brackets.
## Comment 26806
Date: 2019-01-17 13:49:03 +0100
From: @aris-koning
This also doesn't work per commit hash [4c2f4c5c4584](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4c2f4c5c4584) (somewhere on current default)
create view foo_view as (select * from foo limit 1);
CREATE VIEW: LIMIT not supported
(It returns this error whether there are brackets or not.
| The SAMPLE key word doesn't work in a subquery. | https://api.github.com/repos/MonetDB/MonetDB/issues/6668/comments | 0 | 2020-11-30T16:32:05Z | 2024-06-27T13:05:26Z | https://github.com/MonetDB/MonetDB/issues/6668 | 753,624,124 | 6,668 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-11 03:32:46 +0100
From: dgotwisn
To: buildtools devs <<bugs-buildtools>>
Version: 11.31.11 (Aug2018-SP1)
CC: jatev, jeninypa, renalkoclok
Last updated: 2020-11-26 16:35:26 +0100
## Comment 26717
Date: 2018-12-11 03:32:46 +0100
From: dgotwisn
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
Not sure exactly where to file this, or if it's a bug, but I can't recover after getting into this state.
The problem I have is how to recover from it.
At the point of failure, when I try and simply do the tutorial, running a \d command in mclient gives me nothing, even after creating the tables (I have the same problem with our tables). Running \D, gives the following:
START TRANSACTION;
SET SCHEMA "voc";
MAPI = (voc) /tmp/.s.monetdb.50000
QUERY = WITH comments AS (SELECT * FROM sys.comments), function_types AS (SELECT * FROM sys.function_types), function_languages AS (SELECT * FROM sys.function_languages) SELECT sch.name, seq.name, rem.remark FROM sys.schemas sch, sys.sequences seq LEFT OUTER JOIN comments rem ON seq.id = rem.id WHERE sch.id = seq.schema_id ORDER BY sch.name, seq.name
ERROR = !SELECT: no such table 'function_types'
CODE = 42S02
This was after creating the table "test" from the tutorial.
This also cause problems with our code where we can't do a "like" in a select, as it indicates a bad function.
Also, another symptom is that the following statement (the schema and code to generate is, unfortunately, company proprietary):
SELECT table_name, file_year, file_month, file_day, file_hour FROM truecallTables WHERE is_merge=false AND ( file_year>2018 OR (file_year=2018 AND file_month>12) OR (file_year=2018 AND file_month=12 AND file_day>10) OR (file_year=2018 AND file_month=12 AND file_day=10 AND file_hour>=22 )) AND table_name LIKE 'main_%' ORDER BY table_name;
gives the follwoing error response (in mclient):
SELECT: no such FILTER function 'like'
Reproducible: Always
### Steps to Reproduce:
We had created about 100 (empty) tables per hour and bound the hourly set into merge tables (ie, 25 merge tables, each with 4 tables per hour; and created about 20 hours of tables. We also have 2 additional tables - config which has one record, and another one which we use to manage all the hourly tables.
Then, using mclient, I did \>/tmp/foo.txt
\d
\>
Edit the file in VI to change all lines to be drop table statements.
Then in mclient, run \</tmp/foo.txt
This ran for a VERY long time, and then we started getting Linux system errors, being out of file descriptors, and some errors where we were dropping merge tables when things were still associated with them (not sure which caused this). *** NOTE: THIS IS A PROBLEM, but isn't where my issue is, my issue is in recovering from this ***
Killed the mclient when this started occurring, closed out everything else in my terminal windows. Error still occurs (ls command even gives the too many open files error).
After error went away (IT guys managed to do something non-MonetDB related).
Then, kill -9 mserver5, as the system is still messed up.
Start up monetdb normal way, mclient gives above errors.
Remove ALL RPMs related to MonetDB. With no RPMs installed, do a find on the entire machine: find / -print | grep -i monet, and remove ALL files related to them. Only thing that I know is left is the password and group files have monetdb entries. Nothing is left in /var, /usr, /etc, /tmp, /home, etc.
Reinstalling MonetDB RPMS (either 11.31.7 or 11.31.11) and recreating the tables still cause the problem. Here is the sequence of how I initialize MonetDB (as ROOT)
1. monetdb -p 50000 stop nTC
2. monetdb -p 50000 destroy -f nTC
3. monetdbd stop /var/lib/truecall/nTC
4. rm -rf /var/lib/truecall/nTC
Then:
5. monetdbd create /var/lib/truecall/nTC
6. monetdbd start /var/lib/truecall/nTC
7. monetdb -p 50000 create nTC
8. monetdb -p 50000 release nTC
9. mclient -u monetdb -p 50000 -d nTC
create table test("id" integer, "data" VARCHAR(30));
### Actual Results:
\d shows empty
\D yields
START TRANSACTION;
MAPI = (monetdb) /tmp/.s.monetdb.50000
QUERY = SELECT ui.name, ui.fullname, password_hash(ui.name), s.name FROM sys.db_user_info ui, sys.schemas s WHERE ui.default_schema = s.id AND ui.name <> 'monetdb' ORDER BY ui.name
ERROR = !SELECT: no such unary operator 'password_hash(varchar)'
CODE = 42000
\D test
Yields same as \D
### Expected Results:
\d should list a table sys.test
\D should list the table definition for sys.test
select * from sys.tables yields the following:
+------+--------------+------+------------------------------------------------------------------------------------------+------+-------+------+------+------+
| id | name | sche | query | type | syste | comm | acce | temp |
: : : ma_i : : : m : it_a : ss : orar :
: : : d : : : : ctio : : y :
: : : : : : : n : : :
+======+==============+======+==========================================================================================+======+=======+======+======+======+
| 2001 | schemas | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2007 | types | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2016 | functions | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2027 | args | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2036 | sequences | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2046 | dependencies | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2050 | _tables | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2059 | _columns | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2070 | keys | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2077 | idxs | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2082 | triggers | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2093 | objects | 2000 | null | 10 | true | 0 | 0 | 0 |
| 2098 | _tables | 2097 | null | 10 | true | 2 | 0 | 0 |
| 2107 | _columns | 2097 | null | 10 | true | 2 | 0 | 0 |
| 2118 | keys | 2097 | null | 10 | true | 2 | 0 | 0 |
| 2125 | idxs | 2097 | null | 10 | true | 2 | 0 | 0 |
| 2130 | triggers | 2097 | null | 10 | true | 2 | 0 | 0 |
| 2141 | objects | 2097 | null | 10 | true | 2 | 0 | 0 |
| 5529 | tables | 2000 | SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" + 10 /* s | 11 | true | 0 | 0 | 0 |
: : : : ystem table/view */ ELSE (CASE WHEN "commit_action" = 0 THEN "type" /* table/view */ ELS : : : : : :
: : : : E "type" + 20 /* global temp table */ END) END AS SMALLINT) AS "type", "system", "commit : : : : : :
: : : : _action", "access", CASE WHEN (NOT "system" AND "commit_action" > 0) THEN 1 ELSE 0 END A : : : : : :
: : : : S "temporary" FROM "sys"."_tables" WHERE "type" <> 2 UNION ALL SELECT "id", "name", "sch : : : : : :
: : : : ema_id", "query", CAST("type" + 30 /* local temp table */ AS SMALLINT) AS "type", "syste : : : : : :
: : : : m", "commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables"; : : : : : :
| 5539 | columns | 2000 | SELECT * FROM (SELECT p.* FROM "sys"."_columns" AS p UNION ALL SELECT t.* FROM "tmp"."_c | 11 | true | 0 | 0 | 0 |
: : : : olumns" AS t) AS columns; : : : : : :
| 5555 | comments | 2000 | null | 10 | true | 0 | 0 | 0 |
| 5560 | db_user_info | 2000 | null | 10 | true | 0 | 0 | 0 |
| 5566 | users | 2000 | SELECT u."name" AS "name", ui."fullname", ui."default_schema" FROM db_users() AS u LEFT | 11 | true | 0 | 0 | 0 |
: : : : JOIN "sys"."db_user_info" AS ui ON u."name" = ui."name" ; : : : : : :
| 5570 | user_role | 2000 | null | 10 | true | 0 | 0 | 0 |
| 5573 | auths | 2000 | null | 10 | true | 0 | 0 | 0 |
| 5577 | privileges | 2000 | null | 10 | true | 0 | 0 | 0 |
| 6672 | test | 2000 | null | 0 | false | 0 | 0 | 0 |
+------+--------------+------+------------------------------------------------------------------------------------------+------+-------+------+------+------+
27 tuples
## Comment 28294
Date: 2020-11-26 16:35:26 +0100
From: MindySprague <<jeninypa>>
Most of the programs after reinstalling still use your memory. They are a type of junk. This type of program built by https://topaussiereviews.com/ may contain some sort of bugs du et which they are not able to reinstall properly.
| Uninstalling MonetDB RPMs and Reinstalling after corruption occurs leaves the system unusable | https://api.github.com/repos/MonetDB/MonetDB/issues/6667/comments | 0 | 2020-11-30T16:32:01Z | 2024-06-28T13:10:06Z | https://github.com/MonetDB/MonetDB/issues/6667 | 753,624,069 | 6,667 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-06 18:35:16 +0100
From: Anton Kravchenko <<kravchenko.anton86>>
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2019-01-14 17:29:06 +0100
## Comment 26715
Date: 2018-12-06 18:35:16 +0100
From: Anton Kravchenko <<kravchenko.anton86>>
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.80 Safari/537.36
Build Identifier:
After dropping ordered indexes "COPY INTO from .. LOCKED" doubles input data
Reproducible: Always
### Steps to Reproduce:
1.create table t1(v1 int);
2.create ordered index "t1_v1" on "sys"."t1"("v1");
3.drop index "t1_v1";
4.copy into t1 from '/apath/t1.txt' LOCKED;
5.select count(*) from t1;
### Actual Results:
doubled counts
### Expected Results:
original counts
## Comment 26716
Date: 2018-12-07 10:56:35 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [6ff72f0982f1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6ff72f0982f1) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6ff72f0982f1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6ff72f0982f1)
Changeset description:
Added test for bug #6666.
## Comment 26726
Date: 2018-12-12 16:42:41 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [5855d4ced37b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5855d4ced37b) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5855d4ced37b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5855d4ced37b)
Changeset description:
Fix for bug #6666.
Because rel2bin_insert goes down a level if the UPD_COMP flag is set,
we need to copy the UPD_LOCKED flag down to that level.
| COPY INTO from .. LOCKED doubles input data | https://api.github.com/repos/MonetDB/MonetDB/issues/6666/comments | 0 | 2020-11-30T16:31:57Z | 2024-06-27T13:05:24Z | https://github.com/MonetDB/MonetDB/issues/6666 | 753,624,033 | 6,666 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-12-06 13:46:06 +0100
From: @swingbit
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @PedroTadim
Last updated: 2019-01-14 17:29:14 +0100
## Comment 26711
Date: 2018-12-06 13:46:06 +0100
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Build Identifier:
From https://www.monetdb.org/Documentation/Manuals/SQLreference/SerialTypes I see that sequence parameters are defined as "non-zero" values.
seq_params:
[ AS datatype ]
[ START WITH nonzero-bigint ]
[ INCREMENT BY nonzerol-bigint ]
That raises a few questions for me:
1) Why cannot the start value be 0? In fact, it can (so this is just a documentation issue):
sql>create sequence myseq as integer start with 0 increment by 1;
operation successful
2) Why cannot START WITH be negative? This cannot indeed be done, but I see no reason for it:
sql>create sequence myseq as integer start with -1 increment by 1;
syntax error, unexpected '-', expecting sqlINT in: "create sequence myseq as integer start with -"
Notice that the error reports "sqlINT" as expected. As far as I can tell, sqlINT includes negative integers.
3) Same as above, but for INCREMENT BY. That should also be allowed to be negative, but it isn't:
sql>create sequence myseq as integer start with 1 increment by -1;
syntax error, unexpected '-', expecting sqlINT in: "create sequence myseq as integer start with 1 increment by -"
Again, the error is misleading.
Reproducible: Always
## Comment 26712
Date: 2018-12-06 13:47:09 +0100
From: @swingbit
The above applies of course also for the syntax: GENERATED ALWAYS AS IDENTITY [ '(' seq_params ')' ]
## Comment 26713
Date: 2018-12-06 14:27:25 +0100
From: @PedroTadim
I just checked the SQL standard, and indeed negative values for sequences are allowed, as well increments. I'm working to add this feature.
## Comment 26714
Date: 2018-12-06 16:46:23 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [b2e362c68b8b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b2e362c68b8b) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b2e362c68b8b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b2e362c68b8b)
Changeset description:
Added test and fixes for bug #6665, by allowing sql sequences with negative values.
## Comment 26721
Date: 2018-12-11 14:56:39 +0100
From: @sjoerdmullender
I have updated the text on the references web page and the help text that you get in mclient using \help.
Pedro already fixed the parser, so I think we can now close this bug report.
| Creation of serial types does not accept negative numbers | https://api.github.com/repos/MonetDB/MonetDB/issues/6665/comments | 0 | 2020-11-30T16:31:55Z | 2024-06-27T13:05:23Z | https://github.com/MonetDB/MonetDB/issues/6665 | 753,624,005 | 6,665 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-29 17:11:12 +0100
From: Trung Le <<tle211212>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @PedroTadim
Last updated: 2019-01-14 17:29:14 +0100
## Comment 26702
Date: 2018-11-29 17:11:12 +0100
From: Trung Le <<tle211212>>
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36
Build Identifier:
When I execute a query with my 200GB Monetdb instance, mserver5 crashes. The stack trace is provided below.
Hardware: Dell R740. 32 CPU core, 768 GB Ram.
OS: Centos 7.5, running Oracle UEK R5 kernel 4.14.35-1818.4.7.el7uek.x86_64
dmesg output:
[1050368.792302] mserver5[248164]: segfault at 7fc59a1f1fd0 ip 00007fc677869a6f sp 00007fc59a1f1fc0 error 6 in lib_sql.so[7fc677827000+181000]
[1050375.992003] mserver5[248247]: segfault at 7fd6e55ebfd0 ip 00007fd7a6964a6f sp 00007fd6e55ebfc0 error 6 in lib_sql.so[7fd7a6922000+181000]
Stack trace:
0 0x00007f46a3f05a6f in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e74c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:355
1 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e78c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
2 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e7cc0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
3 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e80c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
4 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e84c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
5 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e88c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
6 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e8cc0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
7 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dc5e90c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
....
9312 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42df77c1c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9313 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42dffead20, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9314 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d0666360, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9315 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d0b279c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9316 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d16bcdf0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9317 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d1c2f020, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9318 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d286bb60, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9319 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d2f011c0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9320 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=0x7f42d33d95e0, left=left@entry=0x7f42cc9e7230, right=right@entry=0x7f42cc9e7d60,
grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9321 0x00007f46a3f060a0 in exp_bin (be=be@entry=0x7f45cc005d10, e=e@entry=0x7f42d397c640, left=left@entry=0x7f42cc9e7230,
right=right@entry=0x7f42cc9e7d60, grp=grp@entry=0x0, ext=ext@entry=0x0, cnt=cnt@entry=0x0, sel=sel@entry=0x0) at rel_bin.c:489
9322 0x00007f46a3f0b30f in rel2bin_project (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f42dc39a610, refs=refs@entry=0x7f42cafae660,
topn=topn@entry=0x0) at rel_bin.c:2574
9323 0x00007f46a3f02f31 in subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42dc39a610, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5163
9324 0x00007f46a3f03d2d in rel2bin_select (refs=0x7f42cafae660, rel=0x7f42caf819e0, be=0x7f45cc005d10) at rel_bin.c:2698
9325 subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42caf819e0, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5167
9326 0x00007f46a3f0b241 in rel2bin_project (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f42caf84d40, refs=refs@entry=0x7f42cafae660,
topn=topn@entry=0x0) at rel_bin.c:2562
9327 0x00007f46a3f02f31 in subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42caf84d40, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5163
9328 0x00007f46a3f0b9ee in rel2bin_groupby (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f42caf883c0, refs=refs@entry=0x7f42cafae660)
at rel_bin.c:2779
9329 0x00007f46a3f03ffe in subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42caf883c0, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5171
9330 0x00007f46a3f02dd8 in rel2bin_union (refs=0x7f42cafae660, rel=0x7f42caf8ae40, be=0x7f45cc005d10) at rel_bin.c:2251
---Type <return> to continue, or q <return> to quit---
9331 subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42caf8ae40, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5151
9332 0x00007f46a3f0b9ee in rel2bin_groupby (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f42dc3606a0, refs=refs@entry=0x7f42cafae660)
at rel_bin.c:2779
9333 0x00007f46a3f03ffe in subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42dc3606a0, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5171
9334 0x00007f46a3f02dd8 in rel2bin_union (refs=0x7f42cafae660, rel=0x7f42dc363150, be=0x7f45cc005d10) at rel_bin.c:2251
9335 subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f42dc363150, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5151
9336 0x00007f46a3f0b9ee in rel2bin_groupby (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f4313626e30, refs=refs@entry=0x7f42cafae660)
at rel_bin.c:2779
9337 0x00007f46a3f03ffe in subrel_bin (be=be@entry=0x7f45cc005d10, rel=0x7f4313626e30, refs=refs@entry=0x7f42cafae660) at rel_bin.c:5171
9338 0x00007f46a3f0b241 in rel2bin_project (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f4313627760, refs=refs@entry=0x7f42cafae660,
topn=topn@entry=0x0) at rel_bin.c:2562
9339 0x00007f46a3f02f31 in subrel_bin (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f4313627760, refs=0x7f42cafae660) at rel_bin.c:5163
9340 0x00007f46a3f059da in _subrel_bin (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f4313627760, refs=<optimized out>) at rel_bin.c:5226
9341 0x00007f46a3f0c795 in output_rel_bin (be=be@entry=0x7f45cc005d10, rel=rel@entry=0x7f4313627760) at rel_bin.c:5249
9342 0x00007f46a3f1a904 in sql_relation2stmt (r=0x7f4313627760, be=0x7f45cc005d10) at sql_gencode.c:606
9343 backend_dumpstmt (be=be@entry=0x7f45cc005d10, mb=0x7f45cc09d010, r=r@entry=0x7f4313627760, top=top@entry=1, add_end=add_end@entry=0,
query=query@entry=0x7f42cafb5fa0 "select salecode,productname,suppliercode,supplier,careercode,career,groupcode,\"group\",typecode,type,\n sum(tongtondauky) as tongtondauky,\n sum(trigiatondauky) as trigiatondauky,\n sum(tongtoncuoiky) as "...) at sql_gencode.c:646
9344 0x00007f46a3ef60cc in SQLparser (c=0x7f46a44986b0) at sql_scenario.c:1226
9345 0x00007f46aa5d5438 in runPhase (phase=1, c=0x7f46a44986b0) at mal_scenario.c:510
9346 runScenarioBody (c=c@entry=0x7f46a44986b0, once=once@entry=0) at mal_scenario.c:532
9347 0x00007f46aa5d5c7d in runScenario (c=c@entry=0x7f46a44986b0, once=once@entry=0) at mal_scenario.c:569
9348 0x00007f46aa5d613f in MSserveClient (dummy=dummy@entry=0x7f46a44986b0) at mal_session.c:519
9349 0x00007f46aa5d672a in MSscheduleClient (command=command@entry=0x7f45cc086490 "(", challenge=challenge@entry=0x7f45b42f1d70 "OoQitpvNg",
fin=0x7f45cc005c50, fout=fout@entry=0x7f45940120a0, protocol=protocol@entry=PROTOCOL_9, blocksize=blocksize@entry=8190,
compute_column_widths=compute_column_widths@entry=0) at mal_session.c:397
9350 0x00007f46aa642d5e in doChallenge (data=<optimized out>) at mal_mapi.c:279
9351 0x00007f46aa2d3eae in thread_starter (arg=<optimized out>) at gdk_system.c:480
9352 0x00007f46a7ceee25 in start_thread () from /lib64/libpthread.so.0
9353 0x00007f46a7a18bad in clone () from /lib64/libc.so.6
Reproducible: Always
### Steps to Reproduce:
This happens everytime I run this specific query. To reproduce it, I may have to provide the DB but its size is huge (200GB). Please try taking a look at the stack trace first. Should it is not helpful enough, I will provide the DB.
### Actual Results:
mserver5 crashes
### Expected Results:
mserver5 should not crash
## Comment 26703
Date: 2018-11-29 17:13:01 +0100
From: Trung Le <<tle211212>>
Full dmesg:
[1050035.113791] mserver5[246888]: segfault at 7f45b40f2fd0 ip 00007f46a3f05a6f sp 00007f45b40f2fc0 error 6 in lib_sql.so[7f46a3ec3000+181000]
[1050103.074217] mserver5[247009]: segfault at 7f26221f1fd0 ip 00007f26fb553a6f sp 00007f26221f1fc0 error 6 in lib_sql.so[7f26fb511000+181000]
[1050116.174902] mserver5[247093]: segfault at 7f4bb57ecfd0 ip 00007f4c7abd2a6f sp 00007f4bb57ecfc0 error 6 in lib_sql.so[7f4c7ab90000+181000]
[1050123.348258] mserver5[247167]: segfault at 7f399a1f1fd0 ip 00007f3a7360ba6f sp 00007f399a1f1fc0 error 6 in lib_sql.so[7f3a735c9000+181000]
[1050130.365147] mserver5[247248]: segfault at 7ffb443e2fd0 ip 00007ffbe1720a6f sp 00007ffb443e2fc0 error 6 in lib_sql.so[7ffbe16de000+181000]
[1050137.756239] mserver5[247338]: segfault at 7fc89abf6fd0 ip 00007fc987f95a6f sp 00007fc89abf6fc0 error 6 in lib_sql.so[7fc987f53000+181000]
[1050147.386239] mserver5[247414]: segfault at 7fb4c3bfefd0 ip 00007fb5c914aa6f sp 00007fb4c3bfefc0 error 6 in lib_sql.so[7fb5c9108000+181000]
[1050171.903320] mserver5[247499]: segfault at 7f4f783e2fd0 ip 00007f50156b2a6f sp 00007f4f783e2fc0 error 6 in lib_sql.so[7f5015670000+181000]
[1050183.945027] mserver5[247598]: segfault at 7f99ccbe6fd0 ip 00007f9a79f6aa6f sp 00007f99ccbe6fc0 error 6 in lib_sql.so[7f9a79f28000+181000]
[1050196.931510] mserver5[247677]: segfault at 7f050cbe6fd0 ip 00007f05b9f4ea6f sp 00007f050cbe6fc0 error 6 in lib_sql.so[7f05b9f0c000+181000]
[1050207.543134] mserver5[247760]: segfault at 7f53fcfe8fd0 ip 00007f54b23e6a6f sp 00007f53fcfe8fc0 error 6 in lib_sql.so[7f54b23a4000+181000]
[1050220.163175] mserver5[247849]: segfault at 7f3765beefd0 ip 00007f3832f21a6f sp 00007f3765beefc0 error 6 in lib_sql.so[7f3832edf000+181000]
[1050276.853480] mserver5[247967]: segfault at 7f4c01ff0fd0 ip 00007f4cd738ba6f sp 00007f4c01ff0fc0 error 6 in lib_sql.so[7f4cd7349000+181000]
[1050368.792302] mserver5[248164]: segfault at 7fc59a1f1fd0 ip 00007fc677869a6f sp 00007fc59a1f1fc0 error 6 in lib_sql.so[7fc677827000+181000]
[1050375.992003] mserver5[248247]: segfault at 7fd6e55ebfd0 ip 00007fd7a6964a6f sp 00007fd6e55ebfc0 error 6 in lib_sql.so[7fd7a6922000+181000]
## Comment 26704
Date: 2018-11-29 17:55:18 +0100
From: @PedroTadim
Hello Trung Le,
Can you tell the version of MonetDB you are using? Also can you send us the crashing query along with definition of the tables it uses?
Best regards,
Pedro
## Comment 26706
Date: 2018-11-30 06:51:45 +0100
From: Trung Le <<tle211212>>
Hi Pedro, thanks for your support. I figured out that a long IN (...) list was the root cause. mserver5 would crash if I passed a 10000 item list. But if I reduce the list to 5000 items, mserver5 runs normally. I think the bug can be closed.
## Comment 26727
Date: 2018-12-13 09:42:34 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [bdfc23a47d73](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bdfc23a47d73) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bdfc23a47d73](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bdfc23a47d73)
Changeset description:
Check for stack space.
This should mitigate bug #6664 by giving an error instead of a crash.
## Comment 26728
Date: 2018-12-13 09:43:30 +0100
From: @sjoerdmullender
I added a check that should prevent the crash. Instead it should give an error when the recursion becomes too deep.
Can you test?
## Comment 26776
Date: 2019-01-04 10:01:09 +0100
From: @sjoerdmullender
Assuming fixed.
| mserver5 crash: infinite recursive happens at rel_bin.c:489 | https://api.github.com/repos/MonetDB/MonetDB/issues/6664/comments | 0 | 2020-11-30T16:31:51Z | 2024-06-27T13:05:22Z | https://github.com/MonetDB/MonetDB/issues/6664 | 753,623,963 | 6,664 |
[
"MonetDB",
"MonetDB"
] | # Deleted Bugzilla Bug
Date: 2020-11-30T16:22:43Z
This bug was created during the import from Bugzilla.
GitHub Issues Tracker allows to assign consecutive
ids only. So this dummy issue was created in place of
a deleted Bugzilla Bug.
Please ignore this report.
| Deleted Bugzilla Bug | https://api.github.com/repos/MonetDB/MonetDB/issues/6663/comments | 0 | 2020-11-30T16:31:49Z | 2020-11-30T16:31:50Z | https://github.com/MonetDB/MonetDB/issues/6663 | 753,623,933 | 6,663 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-23 08:58:01 +0100
From: Arshad <<arshad.super>>
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.31.11 (Aug2018-SP1)
Last updated: 2019-01-16 11:17:09 +0100
## Comment 26696
Date: 2018-11-23 08:58:01 +0100
From: Arshad <<arshad.super>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
Hello Monetdb Devs!,
We are planning to move from monetdb version 'v11.27.13 "Jul2017-SP4" (64-bit)' to latest 'v11.31.11 "Aug2018-SP1" (64-bit, 128-bit integers)'. Although this should be straight forward. The obstruction we are facing is that our script is relying on "ROLLBACK" exception string to figure out if conflicts had happened. If yes, they would retry the operation after waiting / sleeping for some seconds. Something in the lines of (https://www.monetdb.org/bugzilla/show_bug.cgi?id=6592).
However with the version of monetdb-11.31.11, the exception 'ROLLBACK' string was not seen to on the prompt. This was resulting in script not being able to determin if there is a "concurrency conflicts" at all.
We debuged and found out that the exception was correctly propagated, it seems that the flush on buffer was not happening. After forcing a flush of an exception buffer message, _only_ for rollback we are observing the string is appearing on the prompt. The below changes once ran against our simple test case spits out "Rollback" exception string on prompt as expected.
<output snip>
1 affected row
1 affected row
1 affected row
1 affected row
1 affected row
COMMIT: transaction is aborted because of concurrency conflicts, will ROLLBACK instead
DROP TABLE: no such table 'test2'
operation successful
<snip>
Could you please adivce why could the "ROLLBACK" excetion not show on prompt and if this fix is on the correct direction.
Attached repo.tar as reproducer.
Thanks
Arshad
/*
* The code. We would most definitely bullet-proof the
* needle to trap the exact excetipon, for now this works
* for our POC
*/
--- monetdb5/mal/mal_session_ori.c 2018-11-21 06:01:51.412446566 -0500
+++ monetdb5/mal/mal_session.c 2018-11-19 12:03:16.715752671 -0500
@@ -680,6 +680,7 @@
/* don't print exception decoration, just the message */
char *n = NULL;
char *o = msg;
+ char *needle = "ROLLBACK";
while ((n = strchr(o, '\n')) != NULL) {
if (*o == '!')
@@ -691,6 +692,8 @@
if (*o == '!')
o++;
mnstr_printf(c->fdout, "!%s\n", o);
+ if (strstr(o, needle))
+ mnstr_flush(c->fdout);
}
freeException(msg);
}
System Details
==============
/root/monet1131/bin/mserver5 --version
MonetDB 5 server v11.31.11 "Aug2018-SP1" (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 1.8GiB available memory, 1 available cpu core
Libraries:
libpcre: 8.32 2012-11-30 (compiled with 8.32)
openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2k-fips 26 Jan 2017)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: root@hildzl121277-v1.ad.harman.com (x86_64-pc-linux-gnu)
Compilation: gcc -std=gnu99 -g -O2
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
uname -a
Linux 3.10.0-862.9.1.el7_lustre.x86_64 1 SMP Mon Aug 27 17:48:12 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
cat config.log | grep -v define | grep VERSION
GDK_VERSION='17:3:0'
MAPI_VERSION='11:0:1'
MONETDB5_VERSION='25:3:0'
PACKAGE_VERSION='11.31.11'
STREAM_VERSION='12:1:1'
VERSION='11.31.11'
Reproducible: Always
### Steps to Reproduce:
1. tar -xvf repo.tar Extract reporducer
2. bash ./test.sh Run the test
3.
### Actual Results:
Exception string of ROLLBACK not seen.
### Expected Results:
Exception string of ROLLBACK should be shown.
<output snip>
1 affected row
1 affected row
1 affected row
1 affected row
1 affected row
COMMIT: transaction is aborted because of concurrency conflicts, will ROLLBACK instead
DROP TABLE: no such table 'test2'
operation successful
<snip>
## Comment 26697
Date: 2018-11-23 10:29:39 +0100
From: Arshad <<arshad.super>>
Created attachment 610
Reproducer script
> Attached file: [repo.tar](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6662_repo.tar_610) (application/octet-stream, 972800 bytes)
> Description: Reproducer script
## Comment 26698
Date: 2018-11-27 17:38:46 +0100
From: Arshad <<arshad.super>>
Hi,
Any update on this bug?
Thanks
## Comment 26718
Date: 2018-12-11 11:38:01 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [a53f4d178d47](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a53f4d178d47) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a53f4d178d47](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a53f4d178d47)
Changeset description:
When closing a stream, first flush.
This fixes bug #6662.
## Comment 26722
Date: 2018-12-12 03:58:19 +0100
From: Arshad <<arshad.super>>
Thanks Sjoerd!
I will try out the fix against our script and will update.
## Comment 26797
Date: 2019-01-16 11:17:09 +0100
From: Arshad <<arshad.super>>
Verified with Aug2018-SP2.
Thanks!
| Concurrency Conflicts Exception string "!transaction is aborted because of concurrency conflicts, will ROLLBACK instead" not shown on prompt. | https://api.github.com/repos/MonetDB/MonetDB/issues/6662/comments | 0 | 2020-11-30T16:31:46Z | 2024-06-27T13:05:20Z | https://github.com/MonetDB/MonetDB/issues/6662 | 753,623,898 | 6,662 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-19 15:59:19 +0100
From: Jayanth Jain <<jayanth037>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: lazumis, @mlkersten, shawpolakcrax12
Last updated: 2020-10-10 12:13:09 +0200
## Comment 26683
Date: 2018-11-19 15:59:19 +0100
From: Jayanth Jain <<jayanth037>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Build Identifier:
We observed an unusual behavior in MonetDB. We found that when SQL optimizer flag is set to no_mitosis_pipe, range queries perform much better than when the SQL optimizer is set to default-pipe.
We tested it with 2 million random values and we got a result of 25ms for default_pipe compared to 1ms in no_mitosis_pipe.
We would expect that the default_pipe should be faster than the other pipeline, as it executed the query in parallel.
However, you can see that the opposite is true and the difference is quite significant.
We have attached a zip file which contains a python script issue.py, which creates a table of type varchar and adds two million random strings.
Then, it executes the same range queries for both default-pipe and no_mitosis_pipe.
Further, it generates default-Res and nomitosis-Res files which stores the result of default_pipe and no_mitosis_pipe respectively.
We also noticed that as the number of duplicates increase, the execution time of default-pipe further increases. We tested it with 2 million records with only 110 unique values and got a result of 200ms for default-pipe compared to 1.5ms in no_mitosis_pipe.
This issue can also be tested by changing the arguments inputFile to 2000000dup and queryFile to QueryDup in issue.py python script.
The setup of monetDB is as follows:
MonetDB version: 11.32
Ubuntu version: 16.04
Installed from: self-installed and compiled
Script: issue.py (present in monetDBIssue.zip)
To test for unique values: Use 2000000sort as table data and QueryUnique as query file (present in monetDBIssue.zip)
To test for duplicate values: Use 2000000dup as table data and QueryDup as query file(present in monetDBIssue.zip)
Reproducible: Always
### Steps to Reproduce:
1.Unzip the monetDBIssue.zip file
2.Execute the issue.py file inside monetDBIssue directory
3.grep for sql time from nomitosis-Res and default-Res file
default-Res execution time is more than nomitosis-Res file
### Actual Results:
The execution time of range queries in default_pipe is greater than no_mitosis_pipe.
### Expected Results:
The execution time of range queries in no_mitosis_pipe should be greater than default_pipe.
## Comment 26684
Date: 2018-11-19 16:04:54 +0100
From: Jayanth Jain <<jayanth037>>
Created attachment 608
The zip file to reproduce the issue
> Attached file: [monetDBIssue.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6661_monetDBIssue.zip_608) (application/zip, 6691 bytes)
> Description: The zip file to reproduce the issue
## Comment 26685
Date: 2018-11-19 16:06:29 +0100
From: Jayanth Jain <<jayanth037>>
Created attachment 609
The zip file to reproduce the issue
> Attached file: [monetDBIssue.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6661_monetDBIssue.zip_609) (application/zip, 6691 bytes)
> Description: The zip file to reproduce the issue
## Comment 26686
Date: 2018-11-19 16:32:30 +0100
From: @sjoerdmullender
1. What is encchar1? I see in file createTable that you try to create a table enctest with a column of type encchar1.
2. Did you accidentally attach the same file (monetDBIssue.zip) twice instead of attaching it once and some other file with the data 2000000sort and 2000000dup?
## Comment 26687
Date: 2018-11-19 16:37:59 +0100
From: Jayanth Jain <<jayanth037>>
(In reply to Sjoerd Mullender from comment 3)
> 1. What is encchar1? I see in file createTable that you try to create a
> table enctest with a column of type encchar1.
>
> 2. Did you accidentally attach the same file (monetDBIssue.zip) twice
> instead of attaching it once and some other file with the data 2000000sort
> and 2000000dup?
I tried to attach the data 2000000sort and 2000000dup. But it is bigger than 1000Kb. Please could you let me know how can I attach that file.
## Comment 26688
Date: 2018-11-19 17:14:42 +0100
From: @sjoerdmullender
(In reply to Jayanth Jain from comment 4)
> I tried to attach the data 2000000sort and 2000000dup. But it is bigger than
> 1000Kb. Please could you let me know how can I attach that file.
You can't. The database behind bugzilla (mariadb, I'm afraid) would not be happy.
Can you put it somewhere where I can download it from?
## Comment 26689
Date: 2018-11-19 17:19:20 +0100
From: Jayanth Jain <<jayanth037>>
(In reply to Sjoerd Mullender from comment 5)
> (In reply to Jayanth Jain from comment 4)
> > I tried to attach the data 2000000sort and 2000000dup. But it is bigger than
> > 1000Kb. Please could you let me know how can I attach that file.
>
> You can't. The database behind bugzilla (mariadb, I'm afraid) would not be
> happy.
>
> Can you put it somewhere where I can download it from?
Ok. Thanks for the response. You can donwload the files from the following link
https://drive.google.com/drive/folders/1ZZM6buxYCHMtATINn7J_trtYdF43rI5R?usp=sharing . You can remove the enctest table. By mistake I have added it.
## Comment 26693
Date: 2018-11-21 13:14:34 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [56bbe74324f4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=56bbe74324f4) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=56bbe74324f4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=56bbe74324f4)
Changeset description:
Two small fixes to fix bug #6661.
- Reduce time spent in micro sleep waiting for a BAT to become available.
- Do not unload a BAT which has views on it.
## Comment 26694
Date: 2018-11-21 13:28:57 +0100
From: @sjoerdmullender
I've made a couple of changes to improve the speed of the queries when run with the default pipeline. It's still not as fast as the no_mitosis_pipe, but it's certainly better.
The biggest problem was that we were too eager to unload BATs from memory when they weren't being used. The problem was, the BAT wasn't used for a very short time (basically the time between two instructions), so it was loaded again right away. By being less eager, we now don't unload the BAT nearly as often in the default case which improved the speed considerably.
The other change was to poll more frequently when waiting for a BAT to be unloaded before loading it again (something you don't want to have to do at all, but isn't easy to avoid completely).
With or without these changes, running the query with the no_mitosis_pipe takes about 0.4 ms.
Without the changes, the query takes about 20 ms with the default_pipe.
With the changes, the time went down to 5 ms.
## Comment 26695
Date: 2018-11-21 18:41:22 +0100
From: Jayanth Jain <<jayanth037>>
(In reply to Sjoerd Mullender from comment 5)
> (In reply to Jayanth Jain from comment 4)
> > I tried to attach the data 2000000sort and 2000000dup. But it is bigger than
> > 1000Kb. Please could you let me know how can I attach that file.
>
> You can't. The database behind bugzilla (mariadb, I'm afraid) would not be
> happy.
>
> Can you put it somewhere where I can download it from?
Ok. Thanks for the response. You can donwload the files from the following link
https://drive.google.com/drive/folders/1ZZM6buxYCHMtATINn7J_trtYdF43rI5R?usp=sharing . You can remove the enctest table. By mistake I have added it.(In reply to Sjoerd Mullender from comment 8)
> I've made a couple of changes to improve the speed of the queries when run
> with the default pipeline. It's still not as fast as the no_mitosis_pipe,
> but it's certainly better.
> The biggest problem was that we were too eager to unload BATs from memory
> when they weren't being used. The problem was, the BAT wasn't used for a
> very short time (basically the time between two instructions), so it was
> loaded again right away. By being less eager, we now don't unload the BAT
> nearly as often in the default case which improved the speed considerably.
> The other change was to poll more frequently when waiting for a BAT to be
> unloaded before loading it again (something you don't want to have to do at
> all, but isn't easy to avoid completely).
>
> With or without these changes, running the query with the no_mitosis_pipe
> takes about 0.4 ms.
> Without the changes, the query takes about 20 ms with the default_pipe.
> With the changes, the time went down to 5 ms.
Thank you for your response and for the fix. The fix mitigates the problem but doesn't fully solve the issue. Please let me know if you are planning to reduce the execution time of defaul_pipe further and bring it close to no_mitosis_pipe.
## Comment 26925
Date: 2019-03-18 23:43:47 +0100
From: @mlkersten
Perhaps we can improve the speed by simply ignoring mitosis when any of the columns used is sorted or the first operation involves a range select.
Instead we could perform mitosis on the next largest table.
The ratio is that most tables are either first range selected or become the target of a join.
## Comment 28160
Date: 2020-10-10 12:13:09 +0200
From: TobyCampos <<lazumis>>
Bug catching from https://essaywriter.org/school-homework-help is the most difficult wok to do I life. You will not be able to look at the bug by just seeing the code. YOu firs have to dry your program then you would be able to catch the bug. Bugs are the most irritating thing of the code.
| Unusual behaviour when no_mitosis_pipe flag is set | https://api.github.com/repos/MonetDB/MonetDB/issues/6661/comments | 0 | 2020-11-30T16:31:42Z | 2024-06-28T13:10:05Z | https://github.com/MonetDB/MonetDB/issues/6661 | 753,623,842 | 6,661 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-09 19:20:38 +0100
From: Till W <<till.wollenberg>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
CC: @njnes, till.wollenberg
Last updated: 2019-01-14 17:29:06 +0100
## Comment 26676
Date: 2018-11-09 19:20:38 +0100
From: Till W <<till.wollenberg>>
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
While trying to GRANT the sysadmin role to a (formerly) unprivileged user I noticed that if I execute the GRANT statement more than once I get unexpected results:
Step 1: before having the ROLE GRANTed
(as user monetdb)
sql>select * from user_role;
+----------+---------+
| login_id | role_id |
+==========+=========+
+----------+---------+
0 tuples
(as the unprivileged user)
sql>set role sysadmin;
SQLException:sql.update_var:42000!Role (sysadmin) missing
Outcome: doesn't work which is expected
Step 2: GRANing the role
(as user monetdb)
sql> grant sysadmin to mydummyuser;
operation successful
sql>select * from user_role;
+----------+---------+
| login_id | role_id |
+==========+=========+
| 7227 | 2 |
+----------+---------+
1 tuple
(as the unprivileged user)
sql>set role sysadmin;
operation successful
Outcome: does work which is expected
Step 3 GRANTing the role again:
(as user monetdb)
sql> grant sysadmin to mydummyuser;
operation successful
sql>select * from user_role;
+----------+---------+
| login_id | role_id |
+==========+=========+
| 7227 | 2 |
| 7227 | 2 |
+----------+---------+
2 tuples
(as the unprivileged user)
sql>set role sysadmin;
SQLException:sql.update_var:42000!Role (sysadmin) missing
Outcome: does not work which is not expected plus sys.user_role has redundant entries
Also, revoking the role does not work in this state either:
(as user monetdb)
sql>revoke sysadmin from vuser;
operation successful
sql>select * from user_role;
+----------+---------+
| login_id | role_id |
+==========+=========+
| 7227 | 2 |
| 7227 | 2 |
+----------+---------+
2 tuples
Outcome: revoking the role is no longer possible, which is not expected.
I ended up executing 'delete from user_role where login_id=7227;' and re-grating the role to mydummyuser as a workaround.
Reproducible: Always
## Comment 26680
Date: 2018-11-15 17:49:55 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [ef7a07ab3143](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ef7a07ab3143) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ef7a07ab3143](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ef7a07ab3143)
Changeset description:
Added test and fixes for bug #6660 (i.e check if user has a role before granting it). The same happens for revoking. A role is revoked only when the user has it.
| GRANTing a ROLE is not idempotent | https://api.github.com/repos/MonetDB/MonetDB/issues/6660/comments | 0 | 2020-11-30T16:31:39Z | 2024-06-27T13:05:18Z | https://github.com/MonetDB/MonetDB/issues/6660 | 753,623,812 | 6,660 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-06 22:17:07 +0100
From: dgotwisn
To: Merovingian devs <<bugs-merovingian>>
Version: 11.31.11 (Aug2018-SP1)
CC: @kutsurak
Last updated: 2018-11-07 22:34:19 +0100
## Comment 26667
Date: 2018-11-06 22:17:07 +0100
From: dgotwisn
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
Running a sequence of monetdbd and monetdb commands similar to the demo leaves processes around if you don't connect with a client. This then causes a port in use error when trying to restart. Connecting a client (mclient, even without a valid password) is sufficient to prevent the problem from occurring.
Reproducible: Always
### Steps to Reproduce:
1. rm -rf testMonetDB cleanup from last run
2. monetdbd create testMonetDB
3. monetdbd set port=50001 testMonetDB
4. monetdbd start testMonetDB
5. monetdb -p 50001 create unittest
6. monetdb -p 50001 release unittest
The above mimics the tutorial
running "mclient -p 50001 -u monetdb unittest" will eliminate the problem
7. monetdb -p 50001 stop unittest
8. monetdb -p 50001 destroy -f unittest
9. monetdbd stop testMonetDB
10. rm -rf testMonetDB Note that MonetDB should be shut down, putting a delay between 9 and 10 makes no difference
At this point, running "ps auxww | grep testMonetDB | grep -v grep" shows a process: "monetdbd start testMonetDB". If mclient was run when I indicated, this process won't be here at this point.
### Actual Results:
The monetdbd instance is still running. Then rerunning the test will yield an address already in use error when reexecuting, on step 4, above.
The error when executing the first cycle (as described above) fils on step 7, with the following message: "stopping database 'unittest'... FAILED\nstop: database is not running: unittest
### Expected Results:
Clean startup and shutdown, even when rerunning the test multiple times.
## Comment 26673
Date: 2018-11-07 11:56:31 +0100
From: @kutsurak
Hi,
I have a few questions, because I tried and I could not reproduce the issue you are describing:
Do you run this sequence in a script?
Does it work if you issue each command individually on a shell?
(Note that it worked for me in both cases)
What GNU/Linux distribution do you use?
How did you install MonetDB, i.e. did you compile it yourself or did you use pre-compiled binaries?
Thanks,
Panos.
## Comment 26675
Date: 2018-11-07 22:34:19 +0100
From: dgotwisn
Reworking the code to not terminate after getting the FAILED message (step 7) appears to cause the problem to go away on all subsequent runs. Marking the bug as RESOLVED, as it is most likely a coding error on my part.
| Starting and stopping MonetDb without connecting leaves processes around | https://api.github.com/repos/MonetDB/MonetDB/issues/6659/comments | 0 | 2020-11-30T16:31:36Z | 2024-06-28T13:10:05Z | https://github.com/MonetDB/MonetDB/issues/6659 | 753,623,772 | 6,659 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-06 16:00:15 +0100
From: leehartoxford
To: clients devs <<bugs-clients>>
Version: 11.25.15 (Dec2016-SP3)
CC: @PedroTadim
Last updated: 2018-12-11 12:36:46 +0100
## Comment 26665
Date: 2018-11-06 16:00:15 +0100
From: leehartoxford
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36
Build Identifier:
After running a query using quantile with a column containing null, mclient will crash with no message. Re-using mclient succeeds, but performing the same query kills mclient again in the same way.
Reproducible: Always
### Steps to Reproduce:
1. Log in to mclient, e.g. mclient myDB
2. create table test (good integer, bad integer);
3. insert into test (good, bad) values (1, null);
4. Just to check:
select * from test;
5. This works as expected:
select sys.quantile(good, 0.9) from test;
6. This works as expected:
select sys.quantile(bad, 0.9) from test where bad is not null;
7. This breaks, severely and unexpectedly:
select sys.quantile(bad, 0.9) from test;
### Actual Results:
See that the mclient is now unresponsive. Similarly, performing this across the wire results in a broken pipe.
### Expected Results:
Perhaps an error message about the column containing nulls.
1. MonetDB version number
MonetDB Database Server Toolkit v1.1 (Dec2016-SP3)
2. Operating system platform
Ubuntu 16.04.5 LTS
3. Installed from release package or self-installed and compiled
Installed using APT
[...]
5. Any references to the documentation that is obscure to you
https://www.monetdb.org/Documentation/SQLreference/StatisticFunctions
## Comment 26668
Date: 2018-11-07 10:34:50 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [f366f7e5632d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f366f7e5632d) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f366f7e5632d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f366f7e5632d)
Changeset description:
Added test and fix for bug #6658 (i.e. check for null quantile value).
## Comment 26670
Date: 2018-11-07 11:11:56 +0100
From: @PedroTadim
My fix was for a crash related from yours. I see that you are using an old version of MonetDB. The issue does not happen on Aug2018-SP1.
## Comment 26719
Date: 2018-12-11 12:36:46 +0100
From: @sjoerdmullender
This bug was fixed in the Jul2017 (11.27.1) release.
| crash if mclient attempts query where quantile column contains null | https://api.github.com/repos/MonetDB/MonetDB/issues/6658/comments | 0 | 2020-11-30T16:31:33Z | 2024-06-27T13:05:16Z | https://github.com/MonetDB/MonetDB/issues/6658 | 753,623,735 | 6,658 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-06 15:00:07 +0100
From: @PedroTadim
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
Last updated: 2019-06-11 14:31:33 +0200
## Comment 26662
Date: 2018-11-06 15:00:07 +0100
From: @PedroTadim
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Build Identifier:
Restarting a sequence with a non atomic sub-query leads to the generation of an unknown MAL function call.
Reproducible: Always
### Steps to Reproduce:
1. create sequence "testme" as integer start with 1;
2. alter sequence "testme" restart with (select 1 union select 2);
### Actual Results:
An error message in the MAL layer:
'sqlcatalog.alter_seq' undefined in: sqlcatalog.alter_seq(X_17:str, X_19:str, X_21:ptr, X_16:bat[:lng]);
### Expected Results:
An error message unrelated to MAL.
I already fixed this bug, I'm just mentioning it here.
## Comment 26664
Date: 2018-11-06 15:16:55 +0100
From: @PedroTadim
For complete details, see https://dev.monetdb.org/hg/MonetDB/rev/6d4152a6de27
## Comment 27043
Date: 2019-06-11 14:31:33 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [ac68d2a866de](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ac68d2a866de) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ac68d2a866de](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ac68d2a866de)
Changeset description:
fixes for bug #6657
| Restart sequence with a non atomic sub-query cardinality gives wrong error message | https://api.github.com/repos/MonetDB/MonetDB/issues/6657/comments | 0 | 2020-11-30T16:31:30Z | 2024-06-27T13:05:15Z | https://github.com/MonetDB/MonetDB/issues/6657 | 753,623,691 | 6,657 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-05 12:14:17 +0100
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @mlkersten
Last updated: 2020-03-15 11:14:04 +0100
## Comment 26661
Date: 2018-11-05 12:14:17 +0100
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Build Identifier:
Executing this query yield different (wrong results) from time to time.
Query:
select
"t2gp"."c2gk_split_0" ,
"t2gp"."c2gl_measures",
"t2gp"."c2gm__shadow_measures"
from
(
select
"t2go"."c2gf_split_0" as "c2gk_split_0" ,
"t2gn"."c2gj_measures" as "c2gl_measures",
"t2go"."c2gg__shadow_measures" as "c2gm__shadow_measures"
from
(
select
"t2gh"."A" as "c2gi_split_0",
count(*) as "c2gj_measures"
from
(
select
"t2gd"."A",
"t2gd"."B",
"t2gd"."C",
"t2gd"."D"
from
"sys"."unitTestDontDelete" as "t2gd"
where
(
"B" < 7
and "A" = 'Cat1'
)
)
as "t2gh"
group by
"t2gh"."A"
)
as "t2gn"
right outer join
(
select
"t2ge"."A" as "c2gf_split_0",
count(*) as "c2gg__shadow_measures"
from
(
select
"t2gd"."A",
"t2gd"."B",
"t2gd"."C",
"t2gd"."D"
from
"sys"."unitTestDontDelete" as "t2gd"
where
"B" < 7
)
as "t2ge"
group by
"t2ge"."A"
)
as "t2go"
on
(
"t2gn"."c2gi_split_0" = "t2go"."c2gf_split_0"
or
(
"t2gn"."c2gi_split_0" is null
and "t2go"."c2gf_split_0" is null
)
)
order by
"c2gm__shadow_measures" desc,
"c2gk_split_0" asc limit 100
)
as "t2gp"
order by
"c2gk_split_0" asc,
"c2gm__shadow_measures" desc
On the table
CREATE TABLE "sys"."unitTestDontDelete" (
"A" VARCHAR(255),
"B" BIGINT,
"C" DOUBLE,
"D" TIMESTAMP
);
INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL);
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000');
INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000');
Running the query multiple times sometimes I get
c2gk_split_0 c2gl_measures c2gm__shadow_measures
----------------------------------------------------
Cat1 4 4
Cat2 <null> 3
which is expected, but sometimes I get
c2gk_split_0 c2gl_measures c2gm__shadow_measures
----------------------------------------------------
Cat2 <null> 3
Cat2 4 3
Which is wrong.
Reproducible: Sometimes
### Steps to Reproduce:
1. Import table in description
2. Execute the query in description
3. Query result is not deterministic, and sometimes wrong.
### Actual Results:
c2gk_split_0 c2gl_measures c2gm__shadow_measures
----------------------------------------------------
Cat2 <null> 3
Cat2 4 3
### Expected Results:
c2gk_split_0 c2gl_measures c2gm__shadow_measures
----------------------------------------------------
Cat1 4 4
Cat2 <null> 3
## Comment 26720
Date: 2018-12-11 12:47:58 +0100
From: @sjoerdmullender
I have so far not been able to reproduce the problem.
Which version of MonetDB are you using (mserver5 --version)?
Full output please.
## Comment 26723
Date: 2018-12-12 11:51:12 +0100
From: Manuel <<manuel>>
Hi Sjoerd,
The output of mserver5 --version is
MonetDB 5 server v11.29.7 "Mar2018-SP1" (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 7.3GiB available memory, 2 available cpu cores
Libraries:
libpcre: 8.38 2015-11-23 (compiled with 8.38)
openssl: OpenSSL 1.0.2g 1 Mar 2016 (compiled with OpenSSL 1.0.2g-fips 1 Mar 2016)
libxml2: 2.9.3 (compiled with 2.9.3)
Compiled by: pbuilder@dev.monetdb.org (x86_64-pc-linux-gnu)
Compilation: gcc -O3 -fomit-frame-pointer -pipe -g -D_FORTIFY_SOURCE=2
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
## Comment 26724
Date: 2018-12-12 14:18:24 +0100
From: @sjoerdmullender
I cannot reproduce the problem, also not with the version you're using.
## Comment 26725
Date: 2018-12-12 14:48:04 +0100
From: Manuel <<manuel>>
Weird, I can see it quite often (So often that I had to re-arrange my query strategy to use a left outer join, where the issue seems to not be present). Sometimes I have to execute another query before it starts happening again. Also I am usually running queries via a jdbc client (although that should not do any difference).
## Comment 27597
Date: 2020-03-15 11:14:04 +0100
From: @mlkersten
Close bug due to age (2018) of the error report. Awaiting new information.
| Outer join non deterministic results | https://api.github.com/repos/MonetDB/MonetDB/issues/6656/comments | 0 | 2020-11-30T16:31:26Z | 2024-06-28T13:10:04Z | https://github.com/MonetDB/MonetDB/issues/6656 | 753,623,655 | 6,656 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-11-01 15:25:48 +0100
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <<bugs-sql>>
Version: 11.31.11 (Aug2018-SP1)
Last updated: 2018-11-01 15:42:16 +0100
## Comment 26659
Date: 2018-11-01 15:25:48 +0100
From: Martin van Dinther <<martin.van.dinther>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0
Build Identifier:
Currently it is allowed to create multiple unique constraints on the same column (or column combination) of tables when the column (or column combination) already contains a unique or pkey constraint.
Those duplicate unique constraints are not useful.
Also each unique constraint creates an additional persistent storage structure (of oids) which also needs to be updated each time a row is added, updated or removed form the table.
Therefore duplicate unique constraints shouldn't be allowed to be created (via CREATE TABLE ...) or added (via ALTER TABLE ... ADD CONSTRAINT ... UNIQUE | PRIMARY KEY).
Idem for duplicate unique indexes (although they currently do not create persistent storage structures). They also shouldn't be allowed to be created (via CREATE UNIQUE INDEX ...) when the column or column combination already has a pkey or unique constraint.
Reproducible: Always
### Steps to Reproduce:
create table mkey6655 (id int not null primary key, nm varchar(99) not null);
insert into mkey6655 values (1, 'one');
insert into mkey6655 values (2, 'two');
insert into mkey6655 values (3, 'free');
select * from mkey6655;
alter table mkey6655 add constraint mkey_pk2 primary key (id);
-- Will report: Error: CONSTRAINT PRIMARY KEY: a table can have only one PRIMARY KEY
alter table mkey6655 add constraint uc_id_1 unique (id);
-- is accepted although there is already a unique primary key defined on this column, so it should be rejected
alter table mkey6655 add constraint uc_id_2 unique (id);
-- is accepted although there is already a unique constraint defined on this column, so it should be rejected
alter table mkey6655 add constraint uc_id_3 unique (id);
-- is accepted although there is already a unique constraint defined on this column, so it should be rejected
alter table mkey6655 add constraint uc_id_nm_1 unique (id, nm);
alter table mkey6655 add constraint uc_id_nm_2 unique (id, nm);
-- is accepted although there is already a unique constraint defined on this column-list, so it should be rejected
alter table mkey6655 add constraint uc_id_nm_3 unique (id, nm);
-- is accepted although there is already a unique constraint defined on this column-list, so it should be rejected
select * from storage('sys', 'mkey6655');
-- strangely the count and columnsize of mkey6655_id_pkey is 0 !!
insert into mkey6655 values (4, 'four');
select * from storage('sys', 'mkey6655');
-- strangely the count and columnsize of uc_id_1, uc_id_2 and uc_id_3 are *not* updated !!
delete from mkey6655 where id = 2;
delete from mkey6655 where id = 3;
select * from storage('sys', 'mkey6655');
-- strangely the count and columnsize of uc_id_1, uc_id_2 and uc_id_3 are *not* updated !!
drop table mkey6655;
select * from storage('sys', 'mkey6655');
### Actual Results:
The creations of constraints uc_id_1, uc_id_2, uc_id_3, uc_id_nm_2 and uc_id_nm_3 are allowed, creating duplicate storage structures.
### Expected Results:
The creations of constraints uc_id_1, uc_id_2, uc_id_3, uc_id_nm_2 and uc_id_nm_3 should result in an error "column id already has a unique constraint defined" or "column id, nm already have a unique constraint defined".
## Comment 26660
Date: 2018-11-01 15:42:16 +0100
From: Martin van Dinther <<martin.van.dinther>>
Extend test also with:
create unique index mkey6655_uix_1 on mkey6655 (id);
-- is accepted although there is already a unique primary key defined on this column, so it should be rejected
create unique index mkey6655_uix_2 on mkey6655 (id);
-- is accepted although there is already a unique constraint defined on this column, so it should be rejected
create unique index mkey6655_uix_3 on mkey6655 (id);
-- is accepted although there is already a unique constraint defined on this column, so it should be rejected
create unique index mkey6655_uix_4 on mkey6655 (id, nm);
create unique index mkey6655_uix_5 on mkey6655 (id, nm);
-- is accepted although there is already a unique constraint defined on this column-list, so it should be rejected
create unique index mkey6655_uix_6 on mkey6655 (id, nm);
-- is accepted although there is already a unique constraint defined on this column-list, so it should be rejected
create unique index mkey6655_uix_7 on mkey6655 (nm, id);
create unique index mkey6655_uix_8 on mkey6655 (nm, id);
-- is accepted although there is already a unique index defined on this column-list, so it should be rejected
create unique index mkey6655_uix_9 on mkey6655 (nm, id);
-- is accepted although there is already a unique index defined on this column-list, so it should be rejected
select * from storage('sys', 'mkey6655');
-- apparently the unique indexes also report storage columns !!
| Disallow creating duplicate unique constraints and associated storage on columns which already have a unique or pkey constraint defined | https://api.github.com/repos/MonetDB/MonetDB/issues/6655/comments | 0 | 2020-11-30T16:31:23Z | 2024-06-28T13:10:03Z | https://github.com/MonetDB/MonetDB/issues/6655 | 753,623,603 | 6,655 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-22 22:10:22 +0200
From: @mlkersten
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2019-01-14 17:29:07 +0100
## Comment 26649
Date: 2018-10-22 22:10:22 +0200
From: @mlkersten
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:62.0) Gecko/20100101 Firefox/62.0
Build Identifier:
The example below produces unexpected results depending on where the "true" occurs in the predicate. In particular, the second one produces the wrong result.
Reproducible: Always
### Actual Results:
create table stmp(i integer); insert into stmp values(0), (1),(2);
select * from stmp S where S.i = 0;
select * from stmp S where true and S.i = 0;
select * from stmp S where S.i = 0 and true;
## Comment 26654
Date: 2018-10-24 17:38:02 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [225aedd6a7e7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=225aedd6a7e7) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=225aedd6a7e7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=225aedd6a7e7)
Changeset description:
Added test for bug #6654.
## Comment 26655
Date: 2018-10-25 11:13:33 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [92dfdd0da34a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=92dfdd0da34a) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=92dfdd0da34a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=92dfdd0da34a)
Changeset description:
Fix for bug #6654 (i.e. don't stop predicate optimization early)
| Incorrect handling of 'TRUE' in compound select | https://api.github.com/repos/MonetDB/MonetDB/issues/6654/comments | 0 | 2020-11-30T16:31:20Z | 2024-06-27T13:05:12Z | https://github.com/MonetDB/MonetDB/issues/6654 | 753,623,556 | 6,654 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-22 17:25:05 +0200
From: @kutsurak
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
Last updated: 2019-01-14 17:29:06 +0100
## Comment 26647
Date: 2018-10-22 17:25:05 +0200
From: @kutsurak
The statement:
CREATE TABLE tbl ("" INT);
succeeds, but the SQL standard does not allow this since identifiers cannot be empty. The column definition comes down to a <delimited identifier> nonterminal in the grammar, which at minimum is four (4) double quotes in a row:
<delimited identifier> ::=
<double quote> <delimited identifier body> <double quote>
<delimited identifier body> ::=
<delimited identifier part>...
<delimited identifier part> ::=
<nondoublequote character>
| <doublequote symbol>
<doublequote symbol> ::=
""!! two consecutive double quote characters
Note that the statement
CREATE TABLE "" (i int);
works as well, where it probably should not for the same reason as above.
## Comment 26648
Date: 2018-10-22 17:42:30 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [86984307106e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=86984307106e) made by Panagiotis Koutsourakis <kutsurak@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=86984307106e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=86984307106e)
Changeset description:
Add test for bug #6653
## Comment 26653
Date: 2018-10-24 17:07:14 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [6f22c3a68031](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f22c3a68031) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f22c3a68031](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f22c3a68031)
Changeset description:
Fixes for bug #6653 (i.e. disallow any empty identifier).
| CREATE TABLE accepts empty table/column name | https://api.github.com/repos/MonetDB/MonetDB/issues/6653/comments | 0 | 2020-11-30T16:31:16Z | 2024-06-27T13:05:11Z | https://github.com/MonetDB/MonetDB/issues/6653 | 753,623,511 | 6,653 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-12 08:10:13 +0200
From: Arshad <<arshad.super>>
To: GDK devs <<bugs-common>>
Version: 11.27.13 (Jul2017-SP4)
CC: @PedroTadim, @yzchang
Last updated: 2019-12-05 15:37:25 +0100
## Comment 26639
Date: 2018-10-12 08:10:13 +0200
From: Arshad <<arshad.super>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Build Identifier:
We are observing a segfault while running our customized script. It looks like the segfault is triggered while calling free(). This script broadly inserts, copy and drops tables in parallel. This script is non-trivial and so it’s rather hard to detail it functionality. We could not yet home in on the series of steps that is leading to this segfault. Therefore the report does not have details of queries that failed, the set of data and/or schema. That we are working on actively to get it. What we could point out that the script spawns multiple mclients in the range of around 200. Concurrency is high. We do have the core, but the core is around 20Gigs so we are attaching the important parts in the report. merovingian.log is attached. Also, We know that the version is little dated, but this is happening on our production box which we are tied up and cannot be upgraded easily. Any pointers on what could be causing this would be helpful.
Thanks
Details follows:
The crash which was seen in dmesg/messages is :
[Thu Sep 27 02:54:47 2018] mserver5[452458]: segfault at 20 ip 00007fc8dcb6ec1d sp 00007fc50c89e930 error 4 in lib_sql.so[7fc8dca6f000+15e000]
Version:
$ /monet_binaries/MonetDB-11.27.13_PY/bin/mserver5 --version
MonetDB 5 server v11.27.13 "Jul2017-SP4" (64-bit)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 1007.3GiB available memory, 128 available cpu cores
Libraries:
libpcre: 8.32 2012-11-30 (compiled with 8.32)
openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2k-fips 26 Jan 2017)
libxml2: 2.9.1 (compiled with 2.9.1)
Compiled by: localhost (x86_64-pc-linux-gnu)
Compilation: gcc -g -O2
Linking : /usr/bin/ld -m elf_x86_64
$
$ uname -a
Linux 3.10.0-693.el7.x86_64 1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$
$ cat config.log | grep -i GDK
config.status:1589: creating gdk/Makefile
config.status:1589: creating gdk/monetdb-gdk.pc
GDK_VERSION='15:6:0'
HAVE_GDK_FALSE=''
HAVE_GDK_TRUE=''
$
(gdb) bt
0 0x00007fd68342b1f7 in raise () from /lib64/libc.so.6
1 0x00007fd68342c8e8 in abort () from /lib64/libc.so.6
2 0x00007fd68346af47 in __libc_message () from /lib64/libc.so.6
3 0x00007fd683472619 in _int_free () from /lib64/libc.so.6
4 0x00007fd685c6ae13 in GDKfree (s=<optimized out>) at gdk_utils.c:1701
5 0x00007fd685c683e2 in HEAPfree (h=0x24d58360, remove=remove@entry=0) at gdk_heap.c:578
6 0x00007fd685c82da6 in BATclear (b=b@entry=0x24d581e0, force=force@entry=1) at gdk_bat.c:527
7 0x00007fd66bf84369 in clear_delta (tr=0x7fd3f0001560, bat=0x7fd596bb1ce0) at bat_storage.c:1702
8 0x00007fd66bf7913c in sql_trans_clear_table (tr=0x7fd3f0001560, t=0x7fd43f60bad0) at store.c:4563
9 0x00007fd66bf1c58f in mvc_clear_table (m=<optimized out>, t=<optimized out>) at sql_mvc.c:1173
10 0x00007fd66beaff01 in mvc_clear_table_wrap (cntxt=0x7fd66c8ce650, mb=<optimized out>, stk=0x7fd59709c2e0, pci=<optimized out>) at sql.c:1219
11 0x00007fd685f61878 in runMALsequence (cntxt=cntxt@entry=0x7fd66c8ce650, mb=mb@entry=0x7fd597253790, startpc=startpc@entry=1, stoppc=stoppc@entry=0, stk=stk@entry=0x7fd59709c2e0,
env=env@entry=0x0, pcicaller=pcicaller@entry=0x0) at mal_interpreter.c:645
12 0x00007fd685f62ebf in runMAL (cntxt=cntxt@entry=0x7fd66c8ce650, mb=mb@entry=0x7fd597253790, mbcaller=mbcaller@entry=0x0, env=env@entry=0x0) at mal_interpreter.c:354
13 0x00007fd66bec0027 in SQLrun (c=0x7fd66c8ce650, be=0x7fd597254630, m=0x7fd5950f1090) at sql_execute.c:352
14 0x00007fd66bec0fbe in SQLengineIntern (c=0x7fd66c8ce650, be=0x7fd597254630) at sql_execute.c:744
15 0x00007fd685f7767d in runPhase (phase=4, c=0x7fd66c8ce650) at mal_scenario.c:506
16 runScenarioBody (c=c@entry=0x7fd66c8ce650) at mal_scenario.c:548
17 0x00007fd685f77d4d in runScenario (c=c@entry=0x7fd66c8ce650) at mal_scenario.c:568
18 0x00007fd685f78220 in MSserveClient (dummy=dummy@entry=0x7fd66c8ce650) at mal_session.c:473
19 0x00007fd685f78796 in MSscheduleClient (command=command@entry=0x7fd595147120 "", challenge=challenge@entry=0x7fd65ea20d80 "EhTjyP6VTI", fin=0x7fd597097b50,
fout=fout@entry=0x7fd65000d230, protocol=protocol@entry=PROTOCOL_9, blocksize=blocksize@entry=8190, compute_column_widths=compute_column_widths@entry=0) at mal_session.c:364
20 0x00007fd685fd9bf6 in doChallenge (data=<optimized out>) at mal_mapi.c:273
21 0x00007fd685c8645f in thread_starter (arg=<optimized out>) at gdk_system.c:485
22 0x00007fd6837c0e25 in start_thread () from /lib64/libpthread.so.0
23 0x00007fd6834ee34d in clone () from /lib64/libc.so.6
(gdb)
(gdb) frame 4
4 0x00007fd685c6ae13 in GDKfree (s=<optimized out>) at gdk_utils.c:1701
1701 gdk_utils.c: No such file or directory.
(gdb) info local
asize = 140555287789688
(gdb) frame 3
3 0x00007fd683472619 in _int_free () from /lib64/libc.so.6
(gdb) frame 5
5 0x00007fd685c683e2 in HEAPfree (h=0x24d58360, remove=remove@entry=0) at gdk_heap.c:578
578 gdk_heap.c: No such file or directory.
(gdb) print h
$1 = (Heap *) 0x24d58360
(gdb) print *h
$2 = {free = 8192, size = 10240, base = 0x7fd470de6270 "", filename = 0x0, copied = 0, hashash = 0, forcemap = 0, cleanhash = 0, storage = STORE_MEM, newstorage = STORE_MEM,
dirty = 1 '\001', farmid = 1 '\001', parentid = 17873}
(gdb) print remove
$3 = 0
(gdb) frame 6
6 0x00007fd685c82da6 in BATclear (b=b@entry=0x24d581e0, force=force@entry=1) at gdk_bat.c:527
527 gdk_bat.c: No such file or directory.
(gdb) print b
$4 = (BAT *) 0x24d581e0
(gdb) print *b
$5 = {batCacheid = 17873, hseqbase = 0, T = {id = 0x7fd685cdb7fd "t", width = 1, type = 11 '\v', shift = 0 '\000', varsized = 1, key = 1, unique = 0, dense = 0, nonil = 1, nil = 0,
sorted = 1, revsorted = 1, nokey = {0, 0}, nosorted = 0, norevsorted = 0, nodense = 0, seq = 0, heap = {free = 0, size = 256, base = 0x24d583e0 "",
filename = 0x24d58330 "04/27/42721.tail", copied = 0, hashash = 0, forcemap = 0, cleanhash = 0, storage = STORE_MEM, newstorage = STORE_MEM, dirty = 0 '\000', farmid = 1 '\001',
parentid = 0}, vheap = 0x24d58360, hash = 0x0, imprints = 0x0, orderidx = 0x0, props = 0x0}, S = {tid = 140559352608897, copiedtodisk = 0, dirty = 1, dirtyflushed = 0,
descdirty = 1, restricted = 1, persistence = 1, role = 1, unused = 0, sharecnt = 0, inserted = 0, count = 0, capacity = 256}}
(gdb) frame 7
7 0x00007fd66bf84369 in clear_delta (tr=0x7fd3f0001560, bat=0x7fd596bb1ce0) at bat_storage.c:1702
1702 bat_storage.c: No such file or directory.
(gdb) print *tr
$6 = {name = 0x0, stime = 27681, wstime = 27692, rtime = 0, wtime = 27692, schema_number = 9781, schema_updates = 0, status = 0, dropped = 0x0, schemas = {sa = 0x7fd3f00015f0,
destroy = 0x7fd66bf73550 <schema_destroy>, set = 0x7fd3f0145af0, dset = 0x0, nelm = 0x0}, sa = 0x7fd3f00015f0, parent = 0x24e61db0, stk = 0}
(gdb) print *bat
$7 = {name = 0x7fd597253de0 "DM_POS_TSV_STG_P6_IT_DSJ_COMBE_44682_col_name", bid = 0, ibase = 0, ibid = 17873, uibid = 14283, uvbid = 17873, cnt = 0, ucnt = 0, cached = 0x0,
wtime = 20535, next = 0x0}
(gdb) frame 8
8 0x00007fd66bf7913c in sql_trans_clear_table (tr=0x7fd3f0001560, t=0x7fd43f60bad0) at store.c:4563
4563 store.c: No such file or directory.
(gdb) print *tr
$8 = {name = 0x0, stime = 27681, wstime = 27692, rtime = 0, wtime = 27692, schema_number = 9781, schema_updates = 0, status = 0, dropped = 0x0, schemas = {sa = 0x7fd3f00015f0,
destroy = 0x7fd66bf73550 <schema_destroy>, set = 0x7fd3f0145af0, dset = 0x0, nelm = 0x0}, sa = 0x7fd3f00015f0, parent = 0x24e61db0, stk = 0}
(gdb) print *t
$9 = {base = {wtime = 27692, rtime = 0, allocated = 1, flag = 0, refcnt = 1, id = 15066384, name = 0x7fd43f60bc10 "IT_DSJ_COMBE_44682"}, type = 0, access = 0, system = 0 '\000',
persistence = SQL_PERSIST, commit_action = CA_COMMIT, query = 0x0, sz = 1024, pkey = 0x0, columns = {sa = 0x7fd3f00015f0, destroy = 0x7fd66bf74580 <column_destroy>,
set = 0x7fd43f60bcd0, dset = 0x0, nelm = 0x0}, idxs = {sa = 0x7fd3f00015f0, destroy = 0x7fd66bf74a60 <idx_destroy>, set = 0x0, dset = 0x0, nelm = 0x0}, keys = {sa = 0x7fd3f00015f0,
destroy = 0x7fd66bf73470 <key_destroy>, set = 0x0, dset = 0x0, nelm = 0x0}, triggers = {sa = 0x7fd3f00015f0, destroy = 0x7fd66bf73250 <trigger_destroy>, set = 0x0, dset = 0x0,
nelm = 0x0}, members = {sa = 0x7fd3f00015f0, destroy = 0x0, set = 0x0, dset = 0x0, nelm = 0x0}, drop_action = 0, cleared = 1, data = 0x7fd59709dd10, s = 0x7fd3f014cf80, p = 0x0,
po = 0x7fd35c5dad60}
(gdb)
(gdb) bt full
0 0x00007fd68342b1f7 in raise () from /lib64/libc.so.6
No symbol table info available.
1 0x00007fd68342c8e8 in abort () from /lib64/libc.so.6
No symbol table info available.
2 0x00007fd68346af47 in __libc_message () from /lib64/libc.so.6
No symbol table info available.
3 0x00007fd683472619 in _int_free () from /lib64/libc.so.6
No symbol table info available.
4 0x00007fd685c6ae13 in GDKfree (s=<optimized out>) at gdk_utils.c:1701
asize = 140555287789688
5 0x00007fd685c683e2 in HEAPfree (h=0x24d58360, remove=remove@entry=0) at gdk_heap.c:578
No locals.
6 0x00007fd685c82da6 in BATclear (b=b@entry=0x24d581e0, force=force@entry=1) at gdk_bat.c:527
th = {free = 8192, size = 10240, base = 0x7fd596ff0870 "", filename = 0x0, copied = 0, hashash = 0, forcemap = 0, cleanhash = 0, storage = STORE_MEM, newstorage = STORE_MEM,
dirty = 1 '\001', farmid = 1 '\001', parentid = 17873}
p = <optimized out>
q = <optimized out>
7 0x00007fd66bf84369 in clear_delta (tr=0x7fd3f0001560, bat=0x7fd596bb1ce0) at bat_storage.c:1702
b = 0x24d581e0
sz = 0
8 0x00007fd66bf7913c in sql_trans_clear_table (tr=0x7fd3f0001560, t=0x7fd43f60bad0) at store.c:4563
n = 0x7fd43f60bde0
c = <optimized out>
sz = 0
9 0x00007fd66bf1c58f in mvc_clear_table (m=<optimized out>, t=<optimized out>) at sql_mvc.c:1173
No locals.
10 0x00007fd66beaff01 in mvc_clear_table_wrap (cntxt=0x7fd66c8ce650, mb=<optimized out>, stk=0x7fd59709c2e0, pci=<optimized out>) at sql.c:1219
s = <optimized out>
t = <optimized out>
m = 0x7fd5950f1090
msg = 0x0
res = 0x7fd59709c3c8
sname = 0x7fd597241970 "DM_POS_TSV_STG_P6"
tname = 0x7fd5970f7fb0 "IT_DSJ_COMBE_44682"
11 0x00007fd685f61878 in runMALsequence (cntxt=cntxt@entry=0x7fd66c8ce650, mb=mb@entry=0x7fd597253790, startpc=startpc@entry=1, stoppc=stoppc@entry=0, stk=stk@entry=0x7fd59709c2e0,
env=env@entry=0x0, pcicaller=pcicaller@entry=0x0) at mal_interpreter.c:645
lhs = <optimized out>
rhs = <optimized out>
v = <optimized out>
i = <optimized out>
k = <optimized out>
pci = 0x7fd59602c300
exceptionVar = -1
ret = 0x0
localGDKerrbuf = <optimized out>
---Type <return> to continue, or q <return> to quit---
backups = {{val = {ival = 0, oval = 0, shval = 0, btval = 0 '\000', fval = 0, pval = 0x0, bval = 0, sval = 0x0, dval = 0, lval = 0}, len = 0, vtype = 10}, {val = {
ival = 1587677551, oval = 140558687406447, shval = 2415, btval = 111 'o', fval = 5.83799278e+18, pval = 0x7fd65ea2096f, bval = 1587677551, sval = 0x7fd65ea2096f "",
dval = 6.9445218672064124e-310, lval = 140558687406447}, len = 0, vtype = 0}, {val = {ival = 1587677568, oval = 140558687406464, shval = 2432, btval = -128 '\200',
fval = 5.83800212e+18, pval = 0x7fd65ea20980, bval = 1587677568, sval = 0x7fd65ea20980 "(", dval = 6.9445218672072523e-310, lval = 140558687406464}, len = 23, vtype = 0}, {
val = {ival = 124, oval = 21474836604, shval = 124, btval = 124 '|', fval = 1.7376101e-43, pval = 0x50000007c, bval = 124,
sval = 0x50000007c <Address 0x50000007c out of bounds>, dval = 1.0609979016090502e-313, lval = 21474836604}, len = -2046687092, vtype = 32726}, {val = {ival = -1759246064,
oval = 6830688528, shval = 2320, btval = 16 '\020', fval = -5.30026965e-25, pval = 0x197240910, bval = -1759246064, sval = 0x197240910 <Address 0x197240910 out of bounds>,
dval = 3.3748085391267137e-314, lval = 6830688528}, len = -1811939296, vtype = 32725}, {val = {ival = 40, oval = 40, shval = 40, btval = 40 '(', fval = 5.60519386e-44,
pval = 0x28, bval = 40, sval = 0x28 <Address 0x28 out of bounds>, dval = 1.9762625833649862e-322, lval = 40}, len = -1803404656, vtype = 32725}, {val = {ival = -1759168624,
oval = 140555340560272, shval = 14224, btval = -112 '\220', fval = -5.33845052e-25, pval = 0x7fd597253790, bval = -1759168624, sval = 0x7fd597253790 "",
dval = 6.9443565110347142e-310, lval = 140555340560272}, len = -1760967968, vtype = 32725}, {val = {ival = 0, oval = 0, shval = 0, btval = 0 '\000', fval = 0, pval = 0x0,
bval = 0, sval = 0x0, dval = 0, lval = 0}, len = -2092474100, vtype = 32726}, {val = {ival = -1759168624, oval = 140555340560272, shval = 14224, btval = -112 '\220',
fval = -5.33845052e-25, pval = 0x7fd597253790, bval = -1759168624, sval = 0x7fd597253790 "", dval = 6.9443565110347142e-310, lval = 140555340560272}, len = 40, vtype = 0}, {
val = {ival = 19, oval = 19, shval = 19, btval = 19 '\023', fval = 2.66246708e-44, pval = 0x13, bval = 19, sval = 0x13 <Address 0x13 out of bounds>,
dval = 9.3872472709836843e-323, lval = 19}, len = -2050577967, vtype = 32726}, {val = {ival = 40, oval = 40, shval = 40, btval = 40 '(', fval = 5.60519386e-44, pval = 0x28,
bval = 40, sval = 0x28 <Address 0x28 out of bounds>, dval = 1.9762625833649862e-322, lval = 40}, len = -1803404656, vtype = 32725}, {val = {ival = 19, oval = 19, shval = 19,
btval = 19 '\023', fval = 2.66246708e-44, pval = 0x13, bval = 19, sval = 0x13 <Address 0x13 out of bounds>, dval = 9.3872472709836843e-323, lval = 19}, len = -2050577582,
vtype = 32726}, {val = {ival = 1821173328, oval = 140558920902224, shval = -6576, btval = 80 'P', fval = 1.36269788e+27, pval = 0x7fd66c8ce650, bval = 1821173328,
sval = 0x7fd66c8ce650 "\002", dval = 6.9445334034305989e-310, lval = 140558920902224}, len = -2050563608, vtype = 32726}, {val = {ival = 7, oval = 7, shval = 7,
btval = 7 '\a', fval = 9.80908925e-45, pval = 0x7, bval = 7, sval = 0x7 <Address 0x7 out of bounds>, dval = 3.4584595208887258e-323, lval = 7}, len = -2050462369,
vtype = 32726}, {val = {ival = 1587677728, oval = 140558687406624, shval = 2592, btval = 32 ' ', fval = 5.83809008e+18, pval = 0x7fd65ea20a20, bval = 1587677728,
sval = 0x7fd65ea20a20 "\220\020\017\225\325\177", dval = 6.9445218672151574e-310, lval = 140558687406624}, len = 65, vtype = 0}, {val = {ival = -1794174832,
oval = 140555305554064, shval = 4240, btval = -112 '\220', fval = -2.88916855e-26, pval = 0x7fd5950f1090, bval = -1794174832, sval = 0x7fd5950f1090 "",
dval = 6.9443547814982378e-310, lval = 140555305554064}, len = -1760967688, vtype = 32725}}
backup = <optimized out>
garbages = {-1, -1, -1, -1, 0 <repeats 12 times>}
garbage = <optimized out>
stkpc = 3
runtimeProfile = {ticks = 25460520816}
runtimeProfileFunction = {ticks = 25460520814}
lastcheck = 25460520814
startedProfileQueue = <optimized out>
12 0x00007fd685f62ebf in runMAL (cntxt=cntxt@entry=0x7fd66c8ce650, mb=mb@entry=0x7fd597253790, mbcaller=mbcaller@entry=0x0, env=env@entry=0x0) at mal_interpreter.c:354
stk = 0x7fd59709c2e0
i = <optimized out>
lhs = <optimized out>
rhs = <optimized out>
ret = <optimized out>
13 0x00007fd66bec0027 in SQLrun (c=0x7fd66c8ce650, be=0x7fd597254630, m=0x7fd5950f1090) at sql_execute.c:352
msg = 0x0
mc = <optimized out>
i = <optimized out>
retc = <optimized out>
val = <optimized out>
mb = 0x7fd597253790
---Type <return> to continue, or q <return> to quit---
p = <optimized out>
j = <optimized out>
m = 0x7fd5950f1090
be = 0x7fd597254630
c = 0x7fd66c8ce650
mb = <optimized out>
14 0x00007fd66bec0fbe in SQLengineIntern (c=0x7fd66c8ce650, be=0x7fd597254630) at sql_execute.c:744
msg = 0x0
oldglb = 0x7fd5951582a0
oldlang = 83 'S'
m = 0x7fd5950f1090
15 0x00007fd685f7767d in runPhase (phase=4, c=0x7fd66c8ce650) at mal_scenario.c:506
msg = 0x0
16 runScenarioBody (c=c@entry=0x7fd66c8ce650) at mal_scenario.c:548
msg = <optimized out>
start = 25460520703
17 0x00007fd685f77d4d in runScenario (c=c@entry=0x7fd66c8ce650) at mal_scenario.c:568
msg = 0x0
18 0x00007fd685f78220 in MSserveClient (dummy=dummy@entry=0x7fd66c8ce650) at mal_session.c:473
mb = <optimized out>
c = 0x7fd66c8ce650
msg = <optimized out>
19 0x00007fd685f78796 in MSscheduleClient (command=command@entry=0x7fd595147120 "", challenge=challenge@entry=0x7fd65ea20d80 "EhTjyP6VTI", fin=0x7fd597097b50,
fout=fout@entry=0x7fd65000d230, protocol=protocol@entry=PROTOCOL_9, blocksize=blocksize@entry=8190, compute_column_widths=compute_column_widths@entry=0) at mal_session.c:364
user = <optimized out>
algo = 0x7fd595147137 "RIPEMD160"
passwd = 0x7fd595147141 "fb5fcc727f92211136ef4eec0c79ea11320cba58"
lang = 0x7fd59514716a "sql"
database = <optimized out>
s = <optimized out>
dbname = <optimized out>
c = 0x7fd66c8ce650
20 0x00007fd685fd9bf6 in doChallenge (data=<optimized out>) at mal_mapi.c:273
buf = 0x7fd595147120 ""
challenge = "EhTjyP6VTI\000", <incomplete sequence \326>
algos = <optimized out>
fdin = 0x7fd650015a50
fdout = 0x7fd65000d230
bs = <optimized out>
len = <optimized out>
protocol = PROTOCOL_9
buflen = 8190
compute_column_widths = 0
21 0x00007fd685c8645f in thread_starter (arg=<optimized out>) at gdk_system.c:485
p = <optimized out>
---Type <return> to continue, or q <return> to quit---
tid = 140558687409920
22 0x00007fd6837c0e25 in start_thread () from /lib64/libpthread.so.0
No symbol table info available.
23 0x00007fd6834ee34d in clone () from /lib64/libc.so.6
No symbol table info available.
(gdb)
$ cat merovingian.log.27sept | grep ERR
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:20 ERR control[85934]: !monetdbd: an internal error has occurred 'could not receive initial byte: Connection reset by peer'
2018-09-27 03:28:22 ERR merovingian[85934]: client error: cannot connect: Connection refused
2018-09-27 03:28:22 ERR merovingian[85934]: client error: cannot connect: Connection refused
2018-09-27 03:28:22 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
2018-09-27 03:28:22 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
2018-09-27 03:28:22 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
2018-09-27 03:28:23 ERR control[85934]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused'
2018-09-27 03:28:27 ERR merovingian[85934]: client error: cannot connect: Connection refused
2018-09-27 03:28:27 ERR merovingian[85934]: client error: cannot connect: Connection refused
2018-09-27 03:28:27 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
2018-09-27 03:28:32 ERR merovingian[85934]: client error: cannot connect: Connection refused
2018-09-27 03:28:32 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
2018-09-27 03:28:37 ERR merovingian[85934]: client error: could not receive initial byte: Connection reset by peer
$
Reproducible: Always
### Steps to Reproduce:
1. Observed every-time when we run our customized scripts which does non-trivial inserts, copy and drop tables. (I know this is not useful now. However, we are working on finding the exact steps that reproduces the same core)
## Comment 26641
Date: 2018-10-12 11:41:37 +0200
From: Arshad <<arshad.super>>
I thought, I add this info. Although the fix for this bug is gone under Dec2016-SP1 and we are not calling vacuum specifically anywhere we still went ahead and tried the reproducer from https://www.monetdb.org/bugzilla/show_bug.cgi?id=4048. The test case passed.
## Comment 26642
Date: 2018-10-12 11:58:51 +0200
From: @yzchang
Hello Arshad,
Jul2017-SP4 is no longer supported. Can you please try if the same problem happens in the latest release Aug2018? Thank you.
Regards,
Jennie
## Comment 27444
Date: 2019-12-05 15:37:25 +0100
From: @PedroTadim
We had an issue related to this with a customer this past Summer, which got fixed. I'm going to close it for now.
| mserver5 segfault in lib_sql.so ([Thu Sep 27 02:54:47 2018] mserver5[452458]: segfault at 20 ip 00007fc8dcb6ec1d sp 00007fc50c89e930 error 4 in lib_sql.so[7fc8dca6f000+15e000]) | https://api.github.com/repos/MonetDB/MonetDB/issues/6652/comments | 0 | 2020-11-30T16:31:12Z | 2024-06-27T13:05:10Z | https://github.com/MonetDB/MonetDB/issues/6652 | 753,623,466 | 6,652 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-11 20:20:16 +0200
From: Joseph Dsilva <<joedsilva>>
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
CC: joedsilva, martin.van.dinther, @PedroTadim
Last updated: 2019-01-14 17:29:12 +0100
## Comment 26638
Date: 2018-10-11 20:20:16 +0200
From: Joseph Dsilva <<joedsilva>>
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.170 Safari/537.36
Build Identifier:
A SQL Query with multiple columns in the IN clause, such as
... WHERE (c1, c2) IN ( SELECT c1, c2 FROM ... )
produces incorrect results (see reproducibility for sample test case)
Reproducible: Always
### Steps to Reproduce:
1. Create a test table
CREATE TABLE T1
(
C1 INTEGER,
C2 INTEGER,
C3 INTEGER
);
2. Insert some records
INSERT INTO T1
VALUES (1, 2, 3)
,(1, 2, 4)
,(2, 2, 5)
,(1, 3, 6)
;
3. Let us see which c1, c2 combination has more than one entry (results are correct)
SELECT C1, C2, COUNT(*)
FROM T1
GROUP BY C1, C2
HAVING COUNT(*) > 1
;
+------+------+------+
| c1 | c2 | L4 |
+======+======+======+
| 1 | 2 | 2 |
+------+------+------+
1 tuple
4. Let us find all records from T1 such that C1, C2 has multiple entries for a given value combination. (correct result)
SELECT T1.C1, T1.C2, T1.C3
FROM T1,
(
SELECT C1, C2
FROM T1
GROUP BY C1, C2
HAVING COUNT(*) > 1
) X
WHERE T1.C1 = X.C1 AND T1.C2 = X.C2
;
+------+------+------+
| c1 | c2 | c3 |
+======+======+======+
| 1 | 2 | 3 |
| 1 | 2 | 4 |
+------+------+------+
5. Let us write the same logic in (4) as a subquery. (results incorrect, the last row should not be there).
SELECT C1, C2, C3
FROM T1
WHERE (C1, C2) IN
(
SELECT C1, C2
FROM T1
GROUP BY C1, C2
HAVING COUNT(*) > 1
)
;
+------+------+------+
| c1 | c2 | c3 |
+======+======+======+
| 1 | 2 | 3 |
| 1 | 2 | 4 |
| 1 | 3 | 6 |
+------+------+------+
3 tuples
### Actual Results:
Please see Reproducibility.
### Expected Results:
Please see Reproducibility.
Please see Reproducibility.
$ ./mserver5 --version
MonetDB 5 server v11.31.7 "Aug2018" (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 11.7GiB available memory, 8 available cpu cores
Libraries:
libpcre: 8.38 2015-11-23 (compiled with 8.38)
openssl: OpenSSL 1.0.2g 1 Mar 2016 (compiled with OpenSSL 1.0.2g 1 Mar 2016)
libxml2: 2.9.3 (compiled with 2.9.3)
Compiled by: jdsilv2@cerberus (x86_64-pc-linux-gnu)
Compilation: gcc -O3 -fomit-frame-pointer -pipe -D_FORTIFY_SOURCE=2
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
## Comment 26640
Date: 2018-10-12 11:24:55 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [7352568e47e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7352568e47e0) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7352568e47e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7352568e47e0)
Changeset description:
Added test for bug #6651.
## Comment 26678
Date: 2018-11-14 16:19:42 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [e8917e90a56c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e8917e90a56c) made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e8917e90a56c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e8917e90a56c)
Changeset description:
Found another multi-column IN query variant which produces wrong output:
SELECT C1, C2, C3
FROM T1
WHERE (C2, C1) IN
(
SELECT C2, C1
FROM T1
GROUP BY C1, C2
HAVING COUNT(*) > 1
);
Added it to the test script for bug #6651.
## Comment 26679
Date: 2018-11-14 16:22:27 +0100
From: Martin van Dinther <<martin.van.dinther>>
Update importance to High-critical
## Comment 26681
Date: 2018-11-15 19:11:36 +0100
From: Martin van Dinther <<martin.van.dinther>>
Some more queries to analyse the problem and find some workaround (see query 8):
-- 7. Same query as 5 but using qualified column names in subquery.
-- (produces incorrect results, same as 5)
SELECT C1, C2, C3
FROM T1
WHERE (C1, C2) IN
(
SELECT T1.C1, T1.C2
FROM T1
GROUP BY T1.C1, T1.C2
HAVING COUNT(*) > 1
);
-- 8. Same query as 5 but using alias for table and qualified column names
-- in subquery. (produces correct result, so can be used as a workaround)
SELECT C1, C2, C3
FROM T1
WHERE (C1, C2) IN
(
SELECT T.C1, T.C2
FROM T1 AS T
GROUP BY T.C1, T.C2
HAVING COUNT(*) > 1
);
-- 9. Query using NOT IN instead of IN (and change COUNT(*) = 1)
-- (produces correct result in this use case data)
SELECT C1, C2, C3
FROM T1
WHERE (C1, C2) NOT IN
(
SELECT C1, C2
FROM T1
GROUP BY C1, C2
HAVING COUNT(*) = 1
);
From queries 7 and 8 we can see it has to do with a name scoping problem.
Query 8 shows how you can workaround it in the meantime (till there is a software patch released).
## Comment 26690
Date: 2018-11-20 10:44:46 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [e9be2776cf1d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e9be2776cf1d) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e9be2776cf1d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e9be2776cf1d)
Changeset description:
Fix for bug #6651. Label expressions for in's right relation, so the rel_optimizer doesn't get confused.
Also added defensive line for uninitialized variable.
| Multi-column IN clause for subquery produces wrong results | https://api.github.com/repos/MonetDB/MonetDB/issues/6651/comments | 0 | 2020-11-30T16:31:08Z | 2024-06-27T13:05:09Z | https://github.com/MonetDB/MonetDB/issues/6651 | 753,623,413 | 6,651 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-10 16:35:27 +0200
From: raunak
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
CC: @PedroTadim
Last updated: 2019-01-14 17:29:11 +0100
## Comment 26635
Date: 2018-10-10 16:35:27 +0200
From: raunak
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6
Build Identifier:
Prepared statement fails to compile user defined function with parameters and hangs mclient
Reproducible: Always
### Steps to Reproduce:
1. mclient -u monetdb -d testdb
2. sql>CREATE FUNCTION get_user(name_param text)
more>RETURNS TABLE (name text, "fullName" text, default_schema text)
more>RETURN TABLE(select * from users where name = name_param);
3. prepare select * from get_user(?);
### Actual Results:
software hangs, no response
### Expected Results:
should compile and return:
execute prepared statement using: EXEC Id(...)
clk:x.xxx ms
+------+--------+-------+--------+-------+----------------+
| type | digits | scale | schema | table | column |
+======+========+=======+========+=======+================+
| clob | 0 | 0 | | L2 | name |
| clob | 0 | 0 | | L2 | fullName |
| clob | 0 | 0 | | L2 | default_schema |
+------+--------+-------+--------+-------+----------------+
3 tuples
clk:x.xxx ms
## Comment 26636
Date: 2018-10-11 14:22:40 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [a4254c9306da](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a4254c9306da) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a4254c9306da](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a4254c9306da)
Changeset description:
Added test for bug #6650
## Comment 26682
Date: 2018-11-16 13:51:55 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [8e00b5197736](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8e00b5197736) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8e00b5197736](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8e00b5197736)
Changeset description:
Fix for bug #6650. After compiling a table returning function, set missing parameter types in m_prepare emode.
Also added missing SQL error codes.
| PREPARE SQL statement fails to compile user defined functions with parameter/s | https://api.github.com/repos/MonetDB/MonetDB/issues/6650/comments | 0 | 2020-11-30T16:31:05Z | 2024-06-27T13:05:07Z | https://github.com/MonetDB/MonetDB/issues/6650 | 753,623,371 | 6,650 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-08 14:19:57 +0200
From: @PedroTadim
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
Last updated: 2018-10-17 10:07:10 +0200
## Comment 26632
Date: 2018-10-08 14:19:57 +0200
From: @PedroTadim
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Build Identifier:
Performing a projection with a selection in a table that was updated previously in a transaction gives wrongs results.
Reproducible: Always
### Steps to Reproduce:
1. CREATE TABLE updating (a INT);
2. INSERT INTO updating VALUES (1), (2);
3. START TRANSACTION;
4. UPDATE updating SET a = 3 WHERE a = 2;
5. SELECT a FROM updating WHERE a = 3;
### Actual Results:
2
### Expected Results:
3
If the table creation and the inserts are performed inside the transaction, the expected result is obtained. The same happens if only the updated value "2" was inserted beforehand.
## Comment 26633
Date: 2018-10-08 14:22:41 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [0c647922bc86](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c647922bc86) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0c647922bc86](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0c647922bc86)
Changeset description:
Added test and output for bug #6649.
## Comment 26634
Date: 2018-10-08 16:11:16 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [633eafe2042a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=633eafe2042a) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=633eafe2042a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=633eafe2042a)
Changeset description:
Fix a thinko in sql.projectdelta.
This fixes bug #6649.
| Projection inside within transaction gives wrong results | https://api.github.com/repos/MonetDB/MonetDB/issues/6649/comments | 0 | 2020-11-30T16:31:01Z | 2024-06-27T13:05:06Z | https://github.com/MonetDB/MonetDB/issues/6649 | 753,623,311 | 6,649 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-08 11:45:24 +0200
From: @sjoerdmullender
To: GDK devs <<bugs-common>>
Version: 11.31.7 (Aug2018)
Last updated: 2018-10-17 10:07:10 +0200
## Comment 26630
Date: 2018-10-08 11:45:24 +0200
From: @sjoerdmullender
The "key" property may be set incorrectly (true when it should be false) in the result of BATconvert. This can happen if converting from one type to another where multiple values in the domain of the source type can map to the same value in the destination type.
## Comment 26631
Date: 2018-10-08 12:20:22 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [3039e5ecc347](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3039e5ecc347) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3039e5ecc347](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3039e5ecc347)
Changeset description:
Fix setting of key property in convert.
This fixes bug #6648.
| key property potentially wrong after type conversion | https://api.github.com/repos/MonetDB/MonetDB/issues/6648/comments | 0 | 2020-11-30T16:30:58Z | 2024-06-27T13:05:05Z | https://github.com/MonetDB/MonetDB/issues/6648 | 753,623,271 | 6,648 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-10-02 14:59:19 +0200
From: Fabio <<palmaresk8>>
To: buildtools devs <<bugs-buildtools>>
Version: 11.31.7 (Aug2018)
Last updated: 2019-04-30 12:36:00 +0200
## Comment 26628
Date: 2018-10-02 14:59:19 +0200
From: Fabio <<palmaresk8>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Build Identifier:
It would be nice if the compiled version of MonetDB on Windows add support to Python 3 UDFs, as Python 2.7 will retire in 2020.
Reproducible: Always
### Actual Results:
MonetDB doesn't support Python 3 UDFs on Windows
## Comment 26967
Date: 2019-04-19 13:16:18 +0200
From: @sjoerdmullender
This will be in the next release.
| Add suport to Python 3 on Windows | https://api.github.com/repos/MonetDB/MonetDB/issues/6647/comments | 0 | 2020-11-30T16:30:54Z | 2024-06-27T13:05:04Z | https://github.com/MonetDB/MonetDB/issues/6647 | 753,623,233 | 6,647 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-20 11:46:27 +0200
From: @swingbit
To: clients devs <<bugs-clients>>
Version: 11.29.7 (Mar2018-SP1)
CC: martin.van.dinther
Last updated: 2018-10-17 10:07:09 +0200
## Comment 26619
Date: 2018-09-20 11:46:27 +0200
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36
Build Identifier:
The example in monetdb-java/example/SQLcopyinto.java returns 0, while it is expected to return 100.
My guess is that, because the COPY INTO statement does not specify the number of records, an additional flush (via out.writeLine("")) is needed at the end.
It does return 100 this way.
Reproducible: Always
### Steps to Reproduce:
1. run monetdb-java/example/SQLcopyinto.java
2.
3.
### Expected Results:
100
## Comment 26620
Date: 2018-09-20 17:41:25 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [8ecb3e0a4555](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ecb3e0a4555) made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8ecb3e0a4555](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8ecb3e0a4555)
Changeset description:
Extending JDBC tests with SQLcopyinto test
SQLcopyinto example program has been improved such that the example program now works as expected
This test shows bug #6646 is now fixed.
## Comment 26621
Date: 2018-09-20 18:28:38 +0200
From: Martin van Dinther <<martin.van.dinther>>
I have corrected and improved the SQLcopyinto.java program
In order to prove its working in nightly tests I migrated the program from
monetdb-java/example/SQLcopyinto.java
to
monetdb-java/tests/SQLcopyinto.java
such that its available for the MonetDB jdbc tests located in
MonetDB/sql/jdbc/tests/Tests/
I also also adapted the href link on webpage
https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/LoadingBulkData
| Example SQLcopyinto.java does not work | https://api.github.com/repos/MonetDB/MonetDB/issues/6646/comments | 0 | 2020-11-30T16:30:51Z | 2024-06-27T13:05:03Z | https://github.com/MonetDB/MonetDB/issues/6646 | 753,623,190 | 6,646 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-20 11:37:56 +0200
From: daniel.zvinca
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
CC: daniel.zvinca, @njnes
Last updated: 2019-01-14 17:29:10 +0100
## Comment 26618
Date: 2018-09-20 11:37:56 +0200
From: daniel.zvinca
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Build Identifier:
functions like uuid() or rand() suppose to return different results for every invocation. it seems the optimizer evaluates the function just once and use the result for subsequent calls. They might be just a few standard functions with this undesirable behavior, but issue becomes more serious for udf added functions (capi, Python, R)
Reproducible: Always
### Steps to Reproduce:
1.CREATE TABLE test (x integer);
2.INSERT INTO test VALUES (0), (1);
3.SELECT uuid(), uuid() from test;
### Actual Results:
4883689d-5143-3244-aa05-9403a1e7607b, 4883689d-5143-3244-aa05-9403a1e7607b
4883689d-5143-3244-aa05-9403a1e7607b, 4883689d-5143-3244-aa05-9403a1e7607b
### Expected Results:
I agree that most of the functions were meant to be reduced to constant. A flag like "not_constant" can exclude a handful of functions from being replaced by their first constant evaluation. I expected varres=true settled in functions table for name=uuid to provide the desired result. It did not.
They might be only a few functions as standard that require review, but with udf extensions (C, Python, R), the list can grow very fast. Imagine functions that are passing as parameter a pointer to certain struct that changes with every iteration. Pointer stays the same, but contents can change and the function results also.
The only workaround I could think of was:
1.
CREATE FUNCTION MY_UUID(fake int)
RETURNS UUID
BEGIN
return uuid();
END;
2.
select my_uuid(x), my_uuid(x+1) from test; -- different params
or
2.
CREATE SEQUENCE "my_fake_seq" as integer CYCLE;
select my_uuid(NEXT VALUE FOR "my_fake_seq"), my_uuid(NEXT VALUE FOR "my_fake_seq") from test;
3.
results (different as expected)
| e3e6e4d9-47e3-b78f-c6f8-9845812025e4 | 50bcaa05-fe50-f6bb-20fa-8f9e9e49357f |
| cbf7c4a2-f1db-200b-2530-906731962d97 | 17bed98c-228f-05e7-2542-abc2b7ad7882 |
rand() behaves even more unexpected. Try below.
SELECT rand(), rand() from test;
SELECT rand(1000), rand(1000) from test;
## Comment 26735
Date: 2018-12-19 14:21:44 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [23e1231ada99](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=23e1231ada99) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=23e1231ada99](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=23e1231ada99)
Changeset description:
fixes for bug #6645, ie make sure we call uuid per row (do not reduce
the number of calls using any of the common expression optimizers)
## Comment 26736
Date: 2018-12-19 14:23:31 +0100
From: @njnes
Fixed, ie uuid and any other argumentless function will be treaded as non constant.
The weirdness of the rand isn't the same. The rand() works and the
rand(seed) also, but pseudo random number generators which get initialized
again and again will return the same result.
## Comment 26737
Date: 2018-12-20 05:20:07 +0100
From: daniel.zvinca
I still consider that a mechanism that would identify constant functions would be the right design. A function defined as constant will be calculated once if it has no parameters or of its parameters are all constant. That would cover all cases.
As for the rand(), maybe initializing pseudo random number generators only once when db is connected would solve the issue? Not sure if this makes sense, I can check a bit some sources to see if that would be a viable solution. You need to agree that is quite unusual to find utility in a function that suppose to return random numbers, but in fact it does not. Just a thought.
| optimizer treats all the functions with no or constant parameters as constant | https://api.github.com/repos/MonetDB/MonetDB/issues/6645/comments | 0 | 2020-11-30T16:30:47Z | 2024-06-27T13:05:02Z | https://github.com/MonetDB/MonetDB/issues/6645 | 753,623,149 | 6,645 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-14 14:10:29 +0200
From: @aris-koning
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-10-03 11:28:22 +0200
## Comment 26617
Date: 2018-09-14 14:10:29 +0200
From: @aris-koning
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Build Identifier:
A custom sql function wrapper for calc.div_noerror consistently produces output which is off by either a factor 1000 or 10 depending on arguments.
Reproducible: Always
### Steps to Reproduce:
1.Define the following sql function:
create function div_noerror(l decimal, r decimal) returns decimal
external name calc.div_noerror;
2.Executing the following queries gives wrong output.
select div_noerror(6,2); -- returns 0.003
select div_noerror(6.0,2); -- returns 0.3
select div_noerror(6,2.0); -- returns 0.003
select div_noerror(6,2.0); -- returns 0.003
select div_noerror(6.0,2.0); -- returns 0.3
select div_noerror(6.0,2.0); -- returns 0.3
etc.
### Actual Results:
see reproduction steps.
### Expected Results:
always the value 3 (of type decimal).
One of our MonetDB Solutions customers reported this issue via a JIRA ticket (SUPPORT-186).
## Comment 26629
Date: 2018-10-03 11:28:22 +0200
From: @sjoerdmullender
The problem is in the very first line: calc.div_error does not accept decimal arguments. It only works on tinyint, smallint, integer, bigint, hugeint, real, double.
The problem with a decimal is that it is represented in three values: the scale, pecision, and scaled value.
The architecture of MonetDB doesn't help in signalling such errors (in an ideal world, the CREATE FUNCTION would have failed--this is not possible in MonetDB).
| div_noerror seems to be off by some power of 10 | https://api.github.com/repos/MonetDB/MonetDB/issues/6644/comments | 0 | 2020-11-30T16:30:44Z | 2024-06-28T13:10:02Z | https://github.com/MonetDB/MonetDB/issues/6644 | 753,623,115 | 6,644 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-13 18:54:31 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
Last updated: 2019-01-14 17:29:13 +0100
## Comment 26616
Date: 2018-09-13 18:54:31 +0200
From: Martin van Dinther <<martin.van.dinther>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:62.0) Gecko/20100101 Firefox/62.0
Build Identifier:
When creating a global temporary table with a fully qualified name such as json.table6643 the command is accepted but the table is not created in the designated schema. Instead it is ignored and silently created in the tmp schema.
This is confusing for the user.
For global temp tables it is desirable to be placed in a specific schema, as it can be shared with other users. Also it prevents name clashes with local temp tables of other users.
Reproducible: Always
### Steps to Reproduce:
CREATE LOCAL TEMP TABLE json.table6643a (id int NOT NULL PRIMARY KEY, name VARCHAR(99) NOT NULL) ON COMMIT PRESERVE ROWS;
-- fails with error: CREATE TABLE: local temporary tables should be stored in the 'tmp' schema
CREATE GLOBAL TEMP TABLE json.table6643b (id int NOT NULL PRIMARY KEY, name VARCHAR(99) NOT NULL) ON COMMIT PRESERVE ROWS;
-- this is accepted without an error
SELECT * FROM json.table6643b;
-- this fails with error: SELECT: no such table 'table6643b
SELECT * FROM sys.table6643b;
-- this fails with error: SELECT: no such table 'table6643b
SELECT * FROM table6643b;
-- this succeeds
SELECT * FROM tmp.table6643b;
-- this succeeds
### Expected Results:
When a fully qualified name is given for a create global temporary table, the schema name should be honered, not silently changed into tmp.
Note that global temp tables are stored in system table sys._tables, and not in tmp._tables!
Local temp tables are created in tmp schema only and are recorded in system table tmp._tables.
## Comment 26709
Date: 2018-12-03 17:02:26 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [3fd88283c3b4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3fd88283c3b4) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3fd88283c3b4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3fd88283c3b4)
Changeset description:
Fix for bug #6643 (i.e. allow creation of global temporary tables ony on 'tmp' schema).
Please keep order of BugTracker tests by number.
| schema name qualifier in create global temporary table json.table6643 ... is not honered | https://api.github.com/repos/MonetDB/MonetDB/issues/6643/comments | 0 | 2020-11-30T16:30:40Z | 2024-06-27T13:05:00Z | https://github.com/MonetDB/MonetDB/issues/6643 | 753,623,075 | 6,643 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-09 11:51:37 +0200
From: @mlkersten
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2018-10-17 10:07:09 +0200
## Comment 26612
Date: 2018-09-09 11:51:37 +0200
From: @mlkersten
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:61.0) Gecko/20100101 Firefox/61.0
Build Identifier:
The following sequence leads to a server hang
sql>create table tmp(t timestamp);
operation successful
sql>insert into tmp values(now());
1 affected row
sql>insert into tmp values(null);
1 affected row
sql>insert into tmp values(now());
1 affected row
sql>select * from tmp;
+----------------------------+
| t |
+============================+
| 2018-09-09 09:47:40.000000 |
| null |
| 2018-09-09 09:47:48.000000 |
+----------------------------+
3 tuples
sql>select * from tmp where not t;
Reproducible: Always
### Actual Results:
The server hangs and should be killed
## Comment 26613
Date: 2018-09-09 18:01:17 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [bcf2a90ac1a2](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bcf2a90ac1a2) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bcf2a90ac1a2](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bcf2a90ac1a2)
Changeset description:
Add check.
This fixes bug #6642.
| Hanging query | https://api.github.com/repos/MonetDB/MonetDB/issues/6642/comments | 0 | 2020-11-30T16:30:37Z | 2024-06-27T13:04:59Z | https://github.com/MonetDB/MonetDB/issues/6642 | 753,623,037 | 6,642 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-08 08:52:24 +0200
From: @sjoerdmullender
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
Last updated: 2018-10-17 10:07:10 +0200
## Comment 26610
Date: 2018-09-08 08:52:24 +0200
From: @sjoerdmullender
Created attachment 607
Plam from which the excerpt was taken (produced from within gdb)
There is a pretty serious race condition that sometimes gets triggered by the storagemodel test.
The problem is in the plan for the storagemdelinit function in 75_storagemdel.sql. Here is a relevant excerpt from the plan:
X_628=<tmp_1247>[278]:bat[:lng] := sql.bind(X_586=0:int, "sys":str, "storagemodelinput":str, "distinct":str, 1:int);
X_631=<tmp_1247>[278]:bat[:lng] := sql.delta(X_627=<sql_empty_lng_bat>[0]:bat[:lng], X_629=<sql_empty_oid_bat>[0]:bat[:oid], X_630=<sql_empty_lng_bat>[0]:bat[:lng], X_628=<tmp_1247>[278]:bat[:lng]);
X_683=<tmp_556>[98]:bat[:lng] := algebra.projectionpath(C_676=<tmp_1454>[98]:bat[:oid], C_590=<tmp_1456>[278]:bat[:oid], X_631=<tmp_1247> 278]:bat[:lng]);
[...]
algebra.projection(C_590=<tmp_1456>[278]:bat[:oid], X_631=<tmp_1247>[278]:bat[:lng]);
[...]
sql.update(X_586=0:int, "sys":str, "storagemodelinput":str, "distinct":str, C_690=<tmp_557>[98]:bat[:oid], X_682=<tmp_1445>[98]:bat[:lng]);
[...]
language.pass(X_631=<tmp_1247>[278]:bat[:lng]);
The problem is as follows. The first blurb creates a new BAT, here tmp_1247, which holds the values for the "distinct" column of the sys.storagemodelinput table after it was filled in by the call to sys.storage() in the storagemodelinit() function. All values are equal at this point (i.e. sorted and revsorted).
Some time later, this BAT is used in a call to algebra.projection(). (Actually, when running it, I normally see a call to algebra.projectionpath in which it is the last (third) argument. This is relevant because of the sorted flag.)
And here is the race: just a few lines further, there is a call to sql.update of that same column. Since the only other instructions between the projection(path) and the update are other projections and an unrelated aggr.count() call, the projection may happen simultaneous with the update. When this happens (and it does happen sometimes!) the projection produces a BAT that it thinks is sorted (because the inputs were sorted when the projection started) but the second input is changed while running and so the output isn't in fact sorted.
I guess the language.pass call should be moved to in front of the call to sql.update, but where does that happen? (I haven't yet looked.)
> Attached file: [m](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6641_m_607) (text/plain, 70602 bytes)
> Description: Plam from which the excerpt was taken (produced from within gdb)
## Comment 26611
Date: 2018-09-08 09:28:40 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [2b9a71c4600e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b9a71c4600e) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2b9a71c4600e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2b9a71c4600e)
Changeset description:
Force a dataflow breakpoint before sql update instructions.
This fixes bug #6641.
| race condition in SQL UDF with update | https://api.github.com/repos/MonetDB/MonetDB/issues/6641/comments | 0 | 2020-11-30T16:30:34Z | 2024-06-27T13:04:58Z | https://github.com/MonetDB/MonetDB/issues/6641 | 753,622,985 | 6,641 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-09-04 21:44:49 +0200
From: cedric
To: SQL devs <<bugs-sql>>
Version: 11.31.7 (Aug2018)
Last updated: 2018-10-17 10:07:09 +0200
## Comment 26609
Date: 2018-09-04 21:44:49 +0200
From: cedric
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36
Build Identifier:
Hi,
This is my first bug report here so if I am doing anything wrong please let me know. It's possible this is not a bug, but the behavior is unexpected and I have not been able to find any documentation or existing bug reports that might explain it.
In mclient, I get the following behavior:
sql>select timestamp_to_str('2008-03-31 00:00:00', '%Y-%m-%d %H:%M:%S');
+---------------------+
| L2 |
+=====================+
| 2008-03-31 01:00:00 |
+---------------------+
sql>select timestamp_to_str('2008-01-31 00:00:00', '%Y-%m-%d %H:%M:%S');
+---------------------+
| L2 |
+=====================+
| 2008-01-31 00:00:00 |
+---------------------+
Why does the hour get shifted by 1 for March 31, but not January 31? Is there a timezone conversion going on? I am running Ubuntu 18.04 with the following timezone settings:
$ date
Tue Sep 4 15:31:23 EDT 2018
$ date +"%Z %z"
EDT -0400
$ cat /etc/timezone
America/New_York
mclient shows the correct timezone offset:
sql>SELECT NOW;
+----------------------------------+
| L2 |
+==================================+
| 2018-09-04 15:35:46.000000-04:00 |
+----------------------------------+
I tried explicitly setting the timezone in the query:
sql>select timestamp_to_str('2008-03-31 00:00:00-04:00', '%Y-%m-%d %H:%M:%S %z');
+---------------------------+
| L2 |
+===========================+
| 2008-03-31 05:00:00 -0400 |
+---------------------------+
I am also confused by this result.
1. I specified an offset of -4 and the result shows -4, but the time was adjusted
2. The time was adjusted by +5. I'm not sure where this number came from.
I tried setting the timezone as per the documentation:
sql>SET TIME ZONE INTERVAL '-04:00' HOUR TO MINUTE;
operation successful
But I still encountered the same behavior:
sql>select timestamp_to_str('2008-03-31 00:00:00-04:00', '%Y-%m-%d %H:%M:%S %z');
+---------------------------+
| L2 |
+===========================+
| 2008-03-31 05:00:00 -0400 |
+---------------------------+
Let me know if there is any other information I can provide or some documentation I may have overlooked.
Thanks,
Cedric
Reproducible: Always
### Steps to Reproduce:
1. Fresh install of monetdb
2. Open mclient
3. Run: select timestamp_to_str('2008-03-31 00:00:00', '%Y-%m-%d %H:%M:%S');
### Actual Results:
+---------------------+
| L2 |
+=====================+
| 2008-03-31 01:00:00 |
+---------------------+
### Expected Results:
+---------------------+
| L2 |
+=====================+
| 2008-03-31 00:00:00 |
+---------------------+
$ mserver5 --version
MonetDB 5 server v11.31.7 "Aug2018" (64-bit, 128-bit integers)
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 7.7GiB available memory, 4 available cpu cores
Libraries:
libpcre: 8.39 2016-06-14 (compiled with 8.39)
openssl: OpenSSL 1.1.0g 2 Nov 2017 (compiled with OpenSSL 1.1.0g 2 Nov 2017)
Compiled by: xxx@xxx (x86_64-pc-linux-gnu)
Compilation: gcc -g -O2
Linking : /usr/bin/x86_64-linux-gnu-ld -m elf_x86_64 -Wl,-Bsymbolic-functions
$ date
Tue Sep 4 15:31:23 EDT 2018
$ date +"%Z %z"
EDT -0400
$ cat /etc/timezone
America/New_York
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
## Comment 26614
Date: 2018-09-10 14:02:03 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [1b0865a8ae45](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1b0865a8ae45) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1b0865a8ae45](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1b0865a8ae45)
Changeset description:
Let mktime figure out DST.
This fixes bug #6640.
## Comment 26615
Date: 2018-09-10 14:34:49 +0200
From: @sjoerdmullender
Thanks for the bug report. As you can see, I fixed the problem.
The difference between the two timestamps was that one was using DST (31 March) and one wasn't (31 January).
| timestamp_to_str returning incorrectly adjusted results | https://api.github.com/repos/MonetDB/MonetDB/issues/6640/comments | 7 | 2020-11-30T16:30:30Z | 2024-06-27T13:04:57Z | https://github.com/MonetDB/MonetDB/issues/6640 | 753,622,946 | 6,640 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-23 15:54:34 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: dspea, essaytrophy, mauvetreeofficial, serinalevis9, syzek, yadavtheddie007
Last updated: 2020-05-24 09:58:00 +0200
## Comment 26602
Date: 2018-08-23 15:54:34 +0200
From: Martin van Dinther <<martin.van.dinther>>
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0
Build Identifier:
COMMENT ON TABLE abc IS NULL;
invalidly sets the remark column to null where remark column is defined as NOT NULLable.
Expected that this command should delete the comment record from the sys.comments table.
Reproducible: Always
### Steps to Reproduce:
select id, remark from comments;
-- shows 0 rows, initially there are no comments set
create table abc (nr int);
comment on table abc is 'abc_rem';
select id, remark from comments;
-- shows 1 row as expected
comment on table abc is null;
select id, remark from comments;
-- shows 1 row but with remark column being null. this is not expected and not allowed as the remark column is defined as NOT NULL
-- show that the comment column id and remark are both set to NOT NULL
select number, name, type, type_digits, "null" from _columns where table_id in (select id from _tables where name = 'comments' and system);
-- \dt comments
comment on table abc is '';
select id, remark from comments;
-- shows 0 rows, the row is now deleted as expected
comment on table abc is null;
select id, remark from comments;
-- shows 1 row! So it is created again but with remark column being null
drop table abc;
select id, remark from comments;
-- shows 0 rows, the row is deleted as expected (implicitly deleted by the drop table statement)
### Expected Results:
It should not be possible to set a non nullable column value to null.
COMMENT ON TABLE abc IS NULL; should remove the record from the sys.comments table, similar as COMMENT ON TABLE abc IS ''; command.
## Comment 26603
Date: 2018-08-23 16:10:21 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [ff7d5cb5122a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff7d5cb5122a) made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ff7d5cb5122a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ff7d5cb5122a)
Changeset description:
Add test and desired output for bug #6639
## Comment 26604
Date: 2018-08-23 19:03:30 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [887e8dc60816](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=887e8dc60816) made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=887e8dc60816](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=887e8dc60816)
Changeset description:
Adding checks for violations of NOT NULLable columns containing NULL (as can happen in sys.comments.remark, see bug #6639)
Also add dedicated sql file to check data integrity on geom table "sys"."spatial_ref_sys"
Also add dedicated sql file to check data integrity on bam schema tables
## Comment 26605
Date: 2018-08-27 13:27:29 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [cc317847d696](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc317847d696) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cc317847d696](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cc317847d696)
Changeset description:
Don't add a NULL to the sys.comments column.
This fixes bug #6639.
| COMMENT ON TABLE abc IS NULL invalidly sets the remark column to null where remark column is defined as NOT NULLable | https://api.github.com/repos/MonetDB/MonetDB/issues/6639/comments | 0 | 2020-11-30T16:30:27Z | 2024-06-27T13:04:56Z | https://github.com/MonetDB/MonetDB/issues/6639 | 753,622,907 | 6,639 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-09 16:50:43 +0200
From: @drstmane
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-08-31 13:23:13 +0200
## Comment 26595
Date: 2018-08-09 16:50:43 +0200
From: @drstmane
mkey.bulk_rotate_xor_hash(),
respectively MKEYrotate() or GDK_ROTATE() in monetdb5/modules/mal/mkey.c,
does/do not avoid generating/returning NIL (i.e., a 64-bit integer value with only the highest/left-most/most-significant bit set).
Consequently, there are (valid, i.e., non-NIL/NULL) value constellations for which, e.g., a multi-column join fails, as (a sequence of) mkey.bulk_rotate_xor_hash() returns a NIL to MAL, which the subsequent algebra.join() does not match, resulting in a false-negative, and thus a wrong join result.
For examples see the test for this bug report.
(Indeed, the code in monetdb5/modules/mal/mkey.c says
"
/* TODO: nil handling. however; we do not want to lose time in bulk_rotate_xor_hash with that */
"
...)
## Comment 26596
Date: 2018-08-09 16:57:48 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [7eb1f93159c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7eb1f93159c8) made by Stefan Manegold <Stefan.Manegold@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7eb1f93159c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7eb1f93159c8)
Changeset description:
added test for bug #6638
"(sequences of) mkey.bulk_rotate_xor_hash() can generate NIL from non-NIL making multi-col joins return wrong results"
## Comment 26597
Date: 2018-08-09 17:32:02 +0200
From: @drstmane
While preventing mkey.bulk_rotate_xor_hash() from returning NIL would be fix the problem
(at the expense of either checking whether the return value is NIL and then modifying it or, say, always 0-ing out the highest bit, i.e., effectively creating 63-bit instead of 64-bit hash values),
an alternative options would be to make the subsequent join match also on NILs by calling algebra.join() with argument nil_matches:bit==true (rather than false) --- I'm not sure, though, whether the result of mkey.bulk_rotate_xor_hash() is also consumed by other operations than algebra.join() (e.g, algebra.select()?) ...
## Comment 26598
Date: 2018-08-09 18:00:21 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [c995f2b40b4c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c995f2b40b4c) made by Stefan Manegold <Stefan.Manegold@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c995f2b40b4c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c995f2b40b4c)
Changeset description:
extended test for bug #6638:
multi-column constraint (unique, primary key) checking is also affected;
here, the result of mkey.bulk_rotate_xor_hash() is consumed by algebra.thetaselect(),
hence, also this one would need to be made to match on NILs
(in fact, the C code has this feature; IMHO not triggerable by simple
MAL command argument as with algebra.join() ...)
## Comment 26601
Date: 2018-08-14 16:22:09 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [2804f1ca791d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2804f1ca791d) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2804f1ca791d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2804f1ca791d)
Changeset description:
In certain cases, have join and select compare NULL as ordinary value.
This fixes bug #6638.
| (sequences of) mkey.bulk_rotate_xor_hash() can generate NIL from non-NIL making multi-col joins return wrong results | https://api.github.com/repos/MonetDB/MonetDB/issues/6638/comments | 0 | 2020-11-30T16:30:24Z | 2024-06-27T13:04:55Z | https://github.com/MonetDB/MonetDB/issues/6638 | 753,622,863 | 6,638 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-02 14:44:45 +0200
From: @yzchang
To: clients devs <<bugs-clients>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-08-31 13:23:17 +0200
## Comment 26585
Date: 2018-08-02 14:44:45 +0200
From: @yzchang
After START TRANSACTION, executing an arbitrary query which returns an error, and then executing a '\d' command will trigger the following code (dump.c:2535):
if (mapi_error(mid)) {
mapi_explain(mid, stderr);
exit(2);
}
So, mclient just exits.
E.g. try the following:
sql>start transaction; seledaf;
auto commit mode: off
syntax error, unexpected IDENT in: "seledaf"
sql>\d
## Comment 26592
Date: 2018-08-08 11:03:54 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [1ae81b91cb04](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1ae81b91cb04) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1ae81b91cb04](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1ae81b91cb04)
Changeset description:
Do not exit from a library function; not even a very local one.
Do some proper error handling when getting the clause to retrieve
comments.
This fixes bug #6637.
| Within a transaction, \d after an error causes mclient to exit | https://api.github.com/repos/MonetDB/MonetDB/issues/6637/comments | 0 | 2020-11-30T16:30:21Z | 2024-06-27T13:04:54Z | https://github.com/MonetDB/MonetDB/issues/6637 | 753,622,811 | 6,637 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-02 11:16:08 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2019-04-30 12:36:01 +0200
## Comment 26584
Date: 2018-08-02 11:16:08 +0200
From: @yzchang
Currently, sys.queue() only shows the running queries of the same db user account, even the 'monetdb' user.
We should extend sys.queue() so that a DBA can have an overview of all running queries on a database.
## Comment 26858
Date: 2019-01-29 15:33:05 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [f06ab9e5f30b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f06ab9e5f30b) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f06ab9e5f30b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f06ab9e5f30b)
Changeset description:
Allow the superuser to see all users' queries.
This fixes bug #6636.
| sys.queue() extension: allow DBA to see all running queries | https://api.github.com/repos/MonetDB/MonetDB/issues/6636/comments | 0 | 2020-11-30T16:30:18Z | 2024-06-27T13:04:53Z | https://github.com/MonetDB/MonetDB/issues/6636 | 753,622,769 | 6,636 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-02 11:12:41 +0200
From: @yzchang
To: Merovingian devs <<bugs-merovingian>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-08-31 13:23:12 +0200
## Comment 26583
Date: 2018-08-02 11:12:41 +0200
From: @yzchang
When one tries to establish too many concurrent client connections to monetdbd (e.g. 1000 mclients), acceptConnections() will fail with "Too many open files". Subsequently monetdbd will decide to simply stop working (i.e. exit(0)).
So, it's not a crash, but monetdbd shouldn't exit after such a non-critical error.
## Comment 26588
Date: 2018-08-03 13:19:01 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [a0fec1753e6f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a0fec1753e6f) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a0fec1753e6f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a0fec1753e6f)
Changeset description:
Not all errors are the same: don't exit for transient failures.
This (hopefully) fixes bug #6635.
## Comment 26589
Date: 2018-08-08 10:13:21 +0200
From: @sjoerdmullender
With no indication to the contrary, I'm assuming this has been adequately fixed.
| monetdbd exits due to "Too many open files" error | https://api.github.com/repos/MonetDB/MonetDB/issues/6635/comments | 0 | 2020-11-30T16:30:14Z | 2024-06-27T13:04:52Z | https://github.com/MonetDB/MonetDB/issues/6635 | 753,622,715 | 6,635 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-02 07:44:18 +0200
From: Yakup Yasin KALAFAT <<yasinkalafat>>
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @PedroTadim
Last updated: 2018-08-08 10:18:58 +0200
## Comment 26581
Date: 2018-08-02 07:44:18 +0200
From: Yakup Yasin KALAFAT <<yasinkalafat>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.75 Safari/537.36
Build Identifier:
Is there a way to activate HUGEINT sqltype in windows.
Reproducible: Always
## Comment 26582
Date: 2018-08-02 10:22:17 +0200
From: @PedroTadim
Hello Yakup, we support HUGEINT on Unix platforms via a 128-bit integer extension supported in GCC (https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html) and Clang (https://github.com/llvm-mirror/clang/blob/master/test/Sema/types.c) compilers on 64-bit platforms.
Unfortunately, Visual C/C++ compiler does not support it yet (https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2643778-support-int128-on-64-bit-platform), which it is the compiler we use for Windows builds. However, Intel and MinGW compilers do support it. If you have the possibility, you can compile MonetDB using one of these compilers to use HUGEINT on Windows.
Best regards,
Pedro
## Comment 26590
Date: 2018-08-08 10:18:58 +0200
From: @sjoerdmullender
We're not going to implement 128 bit integer support for compilers that don't provide it out of the box.
With some work it may be possible to compile and run MonetDB on Windows using Cygwin or MinGW (compiling the Aug2018 branch on Cygwin is now possible, although running the resulting binaries has not been tested).
| HUGEINT support for windows | https://api.github.com/repos/MonetDB/MonetDB/issues/6634/comments | 0 | 2020-11-30T16:30:11Z | 2024-06-28T13:10:57Z | https://github.com/MonetDB/MonetDB/issues/6634 | 753,622,679 | 6,634 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-08-01 16:57:09 +0200
From: @PedroTadim
To: SQL devs <<bugs-sql>>
Version: -- development
Last updated: 2018-08-31 13:23:25 +0200
## Comment 26579
Date: 2018-08-01 16:57:09 +0200
From: @PedroTadim
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Build Identifier:
Ilike doesn't work properly on characters such as ä,ö,ü.
Reproducible: Always
### Steps to Reproduce:
1. CREATE TABLE debugme (acol CLOB);
2. INSERT INTO debugme VALUES ('aa'), ('aä'), ('aÄ');
3. SELECT acol FROM debugme WHERE acol ILIKE '%ä%';
### Actual Results:
+------+
| acol |
+======+
| aä |
+------+
### Expected Results:
+------+
| acol |
+======+
| aä |
| aÄ |
+------+
This works on MonetDBLite because we had to remove the PCRE dependency ;)
## Comment 26580
Date: 2018-08-01 17:28:45 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [e565656ecb74](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e565656ecb74) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e565656ecb74](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e565656ecb74)
Changeset description:
Added test for bug #6633.
## Comment 26586
Date: 2018-08-03 12:40:14 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [fccfa2ae186e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fccfa2ae186e) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fccfa2ae186e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fccfa2ae186e)
Changeset description:
Don't use strcasecmp and strcasestr since they work byte-for-byte.
This fixes bug #6633.
## Comment 26587
Date: 2018-08-03 12:55:46 +0200
From: @sjoerdmullender
It turns out you can't use strcasecmp usefully on UTF-8-encoded strings.
| ILIKE clauses don't work on certain characters | https://api.github.com/repos/MonetDB/MonetDB/issues/6633/comments | 0 | 2020-11-30T16:30:08Z | 2024-06-27T13:04:50Z | https://github.com/MonetDB/MonetDB/issues/6633 | 753,622,659 | 6,633 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-31 13:25:32 +0200
From: @yzchang
To: MonetDB5 devs <<bugs-monetdb5>>
Version: 11.29.3 (Mar2018)
Last updated: 2018-08-31 13:23:23 +0200
## Comment 26575
Date: 2018-07-31 13:25:32 +0200
From: @yzchang
In DFLOWworker(), the return value of "thr = THRnew("DFLOWworker");" is not checked. So, if THRnew() failed (e.g. too many threads already), DFLOWworker() will trigger a SIGSEGV when thr is used.
In general, there are 6 places where THRnew is used:
$ grep -r =.*THRnew *
monetdb5/modules/mal/tablet.c: thr = THRnew("SQLworker");
monetdb5/modules/mal/tablet.c: thr = THRnew("SQLproducer");
monetdb5/mal/mal_client.c: t = THRnew(cname);
monetdb5/mal/mal_dataflow.c: thr = THRnew("DFLOWworker");
sql/server/sql_mvc.c: Thread thr = THRnew("logmanager");
sql/server/sql_mvc.c: Thread thr = THRnew("idlemanager");
Only in mal_client.c, the return value is checked.
## Comment 26576
Date: 2018-08-01 10:12:32 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [7f7bdde7c0d6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f7bdde7c0d6) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7f7bdde7c0d6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7f7bdde7c0d6)
Changeset description:
Check THRnew result.
This should fix bug #6632.
## Comment 26577
Date: 2018-08-01 12:29:33 +0200
From: @sjoerdmullender
The changesets [7f7bdde7c0d6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f7bdde7c0d6) [2b373f2e74f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2b373f2e74f3) and [709ebc975d62](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=709ebc975d62) together fix this issue. All THRnew calls are now checked.
## Comment 26578
Date: 2018-08-01 12:55:03 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [0d3f2de0372f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d3f2de0372f) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0d3f2de0372f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0d3f2de0372f)
Changeset description:
Check THRnew result.
This should fix bug #6632.
(grafted from 7f7bdde7c0d6b9b4176030d3fc68dacf2e959b63)
| Dataflow causes crash when THRnew fails | https://api.github.com/repos/MonetDB/MonetDB/issues/6632/comments | 0 | 2020-11-30T16:30:05Z | 2024-06-27T13:04:49Z | https://github.com/MonetDB/MonetDB/issues/6632 | 753,622,622 | 6,632 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-26 18:15:17 +0200
From: @yzchang
To: GDK devs <<bugs-common>>
Version: 11.29.3 (Mar2018)
Last updated: 2018-07-26 18:15:17 +0200
## Comment 26573
Date: 2018-07-26 18:15:17 +0200
From: @yzchang
When multiple FATAL errors have happened, we'll have multiple threads trying to exit. This might have caused mserver5 to hang for some users.
I discussed this with Sjoerd. His suggestion is to let GDKfatal exit in a harder way. After a fatal error has happened, there is no need any more to still try exit in a neat way.
| GDKfatal should exit harder | https://api.github.com/repos/MonetDB/MonetDB/issues/6631/comments | 0 | 2020-11-30T16:30:02Z | 2024-06-28T13:39:47Z | https://github.com/MonetDB/MonetDB/issues/6631 | 753,622,567 | 6,631 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-25 11:16:36 +0200
From: @PedroTadim
To: SQL devs <<bugs-sql>>
Version: -- development
CC: @njnes
Last updated: 2018-08-31 13:23:15 +0200
## Comment 26569
Date: 2018-07-25 11:16:36 +0200
From: @PedroTadim
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36
Build Identifier:
The query bellow returns the number used by mserver5 to represent a NULL value instead of the NULL value itself.
Reproducible: Always
### Steps to Reproduce:
1. SELECT 0 + CAST ( NULL AS INTEGER ) + 0;
### Actual Results:
-9223372036854775808 (Mserver5 compiled with hugeint)
### Expected Results:
A single NULL value.
In the test I'm about to commit I added more examples.
## Comment 26570
Date: 2018-07-25 11:20:17 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [d050192b5c60](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d050192b5c60) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d050192b5c60](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d050192b5c60)
Changeset description:
Added test for bug #6630.
## Comment 26571
Date: 2018-07-25 16:46:05 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [a70bec1fec0e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a70bec1fec0e) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a70bec1fec0e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a70bec1fec0e)
Changeset description:
fixes for bug #6630, ie handle null in atom_* (add,sub,mul) code
## Comment 26572
Date: 2018-07-25 17:57:37 +0200
From: @njnes
fixed by handling null's in atom_add etc
| Sqlitelogictest cast NULL to integer failing | https://api.github.com/repos/MonetDB/MonetDB/issues/6630/comments | 0 | 2020-11-30T16:29:58Z | 2024-06-27T13:04:47Z | https://github.com/MonetDB/MonetDB/issues/6630 | 753,622,509 | 6,630 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-19 15:58:50 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @PedroTadim
Last updated: 2018-08-31 13:23:27 +0200
## Comment 26558
Date: 2018-07-19 15:58:50 +0200
From: @yzchang
See the following outputs, the second CREATE TABLE IF NOT EXISTS shouldn't returns an error:
sql>create table if not exists test (i int);
operation successful
sql>create table if not exists test (i int);
42000!
## Comment 26559
Date: 2018-07-19 16:37:12 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [d0ccbcf6ba07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d0ccbcf6ba07) made by Ying Zhang <y.zhang@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d0ccbcf6ba07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d0ccbcf6ba07)
Changeset description:
Added test for Bug #6629
## Comment 26562
Date: 2018-07-19 17:33:40 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [d76c8980d34d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d76c8980d34d) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d76c8980d34d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d76c8980d34d)
Changeset description:
Fixes for bug #6629, ie create an empty PSM relation when a table or schema already exists on a "IF NOT EXISTS" query.
## Comment 26563
Date: 2018-07-20 10:10:18 +0200
From: @sjoerdmullender
It was fixed in the Mar2018 branch.
| CREATE TABLE IF NOT EXISTS returns 42000! | https://api.github.com/repos/MonetDB/MonetDB/issues/6629/comments | 0 | 2020-11-30T16:29:55Z | 2024-06-27T13:04:46Z | https://github.com/MonetDB/MonetDB/issues/6629 | 753,622,463 | 6,629 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-19 11:23:35 +0200
From: @swingbit
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2018-08-31 13:23:26 +0200
## Comment 26557
Date: 2018-07-19 11:23:35 +0200
From: @swingbit
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Build Identifier:
I admit I always had a hard time with SQL roles and permissions, so perhaps it's just me doing something wrong.
If I create a user (with admin privileges), and the user operates in its own schema:
CREATE USER "spinque" WITH UNENCRYPTED PASSWORD '123456789' NAME 'Spinque user' SCHEMA "sys";
CREATE ROLE "spinque" WITH ADMIN CURRENT_USER;
GRANT "spinque" TO "spinque" WITH ADMIN OPTION;
CREATE SCHEMA "spinque" AUTHORIZATION "spinque";
ALTER USER "spinque" SET SCHEMA "spinque";
Then login as this user, this happens:
sql>start transaction;
auto commit mode: off
sql>create local temporary table test(i int);
operation successful
sql>insert into test values (2);
INSERT INTO: insufficient privileges for user 'spinque' to insert into table 'test'
The user can create the table in schema 'tmp', but not write into it.
My understanding was that regardless of roles and privileges explicitly assigned, users always has full rights on the tables that they create. This doesn't seem to be true for tables created in a different schema.
Reproducible: Always
$ mserver5 --version
MonetDB 5 server v11.29.8 (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 15.5GiB available memory, 8 available cpu cores
Libraries:
libpcre: 8.42 2018-03-20 (compiled with 8.42)
openssl: OpenSSL 1.1.0h 27 Mar 2018 (compiled with OpenSSL 1.1.0h-fips 27 Mar 2018)
libxml2: 2.9.7 (compiled with 2.9.7)
Compiled by: roberto@photon.hq.spinque.com (x86_64-pc-linux-gnu)
Compilation: gcc -O3 -fomit-frame-pointer -pipe -D_FORTIFY_SOURCE=2
Linking : /usr/bin/ld -m elf_x86_64 -Wl,-Bsymbolic-functions
## Comment 26574
Date: 2018-07-27 10:18:48 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [c65a60e3b9cb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c65a60e3b9cb) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c65a60e3b9cb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c65a60e3b9cb)
Changeset description:
fix for bug #6628 (users are allowed to access there temporary tables)
| User cannot insert into own local temporary table | https://api.github.com/repos/MonetDB/MonetDB/issues/6628/comments | 0 | 2020-11-30T16:29:52Z | 2024-06-27T13:04:45Z | https://github.com/MonetDB/MonetDB/issues/6628 | 753,622,424 | 6,628 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-18 19:08:18 +0200
From: Manuel <<manuel>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-08-31 13:23:09 +0200
## Comment 26553
Date: 2018-07-18 19:08:18 +0200
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Build Identifier:
The function stddev_pop has inconsistent behaviours depending on the groupings.
I will attach the sql used in the example:
The query:
select stddev_pop("C"), "A" from "unitTestDontDelete" group by "A";
returns
L2 A
--------------------------------
<null> <null>
2.82843 Cat1
2.23607 Cat2
i.e., stddev_pop returns null, if all the values for that group have a null value.
The query
select stddev_pop("C"), "A", "B" from "unitTestDontDelete" group by "A", "B";
returns
L2 A B
-----------------------------------------
0 <null> <null>
0 Cat1 0
0 Cat2 1
0 Cat1 2
0 Cat2 3
0 Cat1 4
0 Cat2 5
0 Cat1 6
0 Cat2 7
0 Cat1 8
i.e., stddev_pop returns 0, if all the values for that group have a null value.
Reproducible: Always
### Steps to Reproduce:
1. Import the table unitTestDontDelete from the attached sql file
2. run the two queries
### Actual Results:
L2 A
--------------------------------
<null> <null>
and
L2 A B
-----------------------------------------
0 <null> <null>
### Expected Results:
consistent results, regardless of the groupings.
## Comment 26554
Date: 2018-07-18 19:08:49 +0200
From: Manuel <<manuel>>
Created attachment 606
sql file used to create the table used in the exampes
> Attached file: [unitTestDontDelete.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6627_unitTestDontDelete.sql_606) (text/plain, 1176 bytes)
> Description: sql file used to create the table used in the exampes
## Comment 26564
Date: 2018-07-23 14:54:32 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [a64e00558d71](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a64e00558d71) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a64e00558d71](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a64e00558d71)
Changeset description:
Population standard deviation for singleton groups is 0 unless value is nil.
There was a shortcut for singleton groups (as many groups as input
values) that returned 0 for all groups (for stddev_pop()), but it
didn't take into consideration that one or more values might be nil
(NULL) (in which case the result for that group should be nil as
well).
This fixes bug #6627.
## Comment 26565
Date: 2018-07-23 14:54:36 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [1a27ca5c032c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1a27ca5c032c) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1a27ca5c032c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1a27ca5c032c)
Changeset description:
Test for bug #6627.
## Comment 26566
Date: 2018-07-23 15:05:01 +0200
From: @sjoerdmullender
Should be fixed now.
| stddev_pop inconsistent behaviour | https://api.github.com/repos/MonetDB/MonetDB/issues/6627/comments | 0 | 2020-11-30T16:29:48Z | 2024-06-27T13:04:44Z | https://github.com/MonetDB/MonetDB/issues/6627 | 753,622,370 | 6,627 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-18 11:33:56 +0200
From: Guillaume de GENTILE <<gentile_g>>
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2018-11-28 16:43:21 +0100
## Comment 26548
Date: 2018-07-18 11:33:56 +0200
From: Guillaume de GENTILE <<gentile_g>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36
Build Identifier:
Hi,
I found an issue in the function str_to_date().
Below query is returning an exception as it fails to parse the DATE1.
select
str_to_date(DATE1, '%Y%m%d') as DATE1,
str_to_date(DATE2, '%Y-%m-%d') as DATE2,
str_to_date(DATE3, '%Y/%m/%d') as DATE3,
str_to_date(DATE4, '%Y-%m-%d %H:%M:%S') as DATE4,
str_to_date(DATE5, '%d-%m-%Y %H:%M') as DATE5,
str_to_date(DATE6, '%Y %B %d') as DATE6
from (
select
'20181201' as DATE1,
'2018-12-01' as DATE2,
'2018/12/01' as DATE3,
'2018-12-01 06:12:15' as DATE4,
'01-09-2008 06:12' as DATE5,
'2008 May 12' as DATE6
) A
java.sql.SQLException: MALException:mtime.str_to_date:format '%Y%m%d', doesn't match date '20181201'
Reproducible: Always
### Steps to Reproduce:
1.Execute the code provided
2.
3.
### Actual Results:
java.sql.SQLException: MALException:mtime.str_to_date:format '%Y%m%d', doesn't match date '20181201'
### Expected Results:
Date correctly formatted
I am using MonetDB Java embedded database
## Comment 26560
Date: 2018-07-19 16:46:55 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [8c393a0ad3d1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8c393a0ad3d1) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8c393a0ad3d1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=8c393a0ad3d1)
Changeset description:
On Windows, use C++ std::get_time() function for strptime.
In new enough C++ versions, std::get_time() is defined and it is
compatible with the definition of strptime.
Unfortunately, this doesn't fix bug #6626.
## Comment 26561
Date: 2018-07-19 16:48:32 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [37ef1e5b492c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37ef1e5b492c) made by Sjoerd Mullender <sjoerd@acm.org> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=37ef1e5b492c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=37ef1e5b492c)
Changeset description:
Added test for bug #6626.
## Comment 26567
Date: 2018-07-23 15:20:39 +0200
From: @sjoerdmullender
This looks like it is a Windows-specific problem. On Windows we used to use a version of strptime that we found on the Internet. Since a few days we now use a version that is based on the standard C++ function std::get_time(), but that turns out to have the same restriction. The version of strptime in the GNU standard C library does not have this restriction.
We will not implement our own version of strptime, so I'm afraid this bug will not be fixed (unless you can convince Microsoft to fix their implementation of std::get_time()). We can also not use the glibc (GNU C library) version because of licensing issues.
## Comment 26700
Date: 2018-11-28 16:43:21 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [2c07d9a52c78](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c07d9a52c78) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2c07d9a52c78](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=2c07d9a52c78)
Changeset description:
Another attempt for strptime implementation for Windows and bug #6626.
| function str_to_date() fails to parse date '20181201' using date pattern '%Y%m%d' | https://api.github.com/repos/MonetDB/MonetDB/issues/6626/comments | 0 | 2020-11-30T16:29:45Z | 2024-06-28T13:10:57Z | https://github.com/MonetDB/MonetDB/issues/6626 | 753,622,327 | 6,626 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-12 14:30:41 +0200
From: austin
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @njnes
Last updated: 2018-08-31 13:23:13 +0200
## Comment 26547
Date: 2018-07-12 14:30:41 +0200
From: austin
Problem: Server crashes with segmentation fault when executing a query with a subselect which contains an OR-expression.
Environment:
ubuntu 16.04 in a docker container
Reproducible: Always
### Steps to Reproduce:
CREATE TABLE a (a integer, b integer);
CREATE TABLE b (a integer, b integer);
SELECT (SELECT count(*) FROM b where a.a=b.a and (b.b=1 or b.b=2)) FROM a;
This is the smallest example we could find. Since even an EXPLAIN on the select does not work, it looks like the query planner already fails to parse and optimise the query. As soon as you replace the expressions of the OR-Part with something else then equals, the query will work just fine e.g.:
SELECT (SELECT count(*) FROM b where a.a=b.a and (b.b<=1 or b.b>=2)) FROM a;
Expected result:
Successful query execution without the server crashing
## Comment 26551
Date: 2018-07-18 18:57:13 +0200
From: @njnes
seems to run without crashing on the March 2018 branch (after recent changes?)
## Comment 26552
Date: 2018-07-18 18:58:15 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [fc8c8ae71f88](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc8c8ae71f88) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fc8c8ae71f88](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fc8c8ae71f88)
Changeset description:
add test for bug #6625
| OR in subselect causes the server to crash with segmentation fault | https://api.github.com/repos/MonetDB/MonetDB/issues/6625/comments | 0 | 2020-11-30T16:29:42Z | 2024-06-27T13:04:42Z | https://github.com/MonetDB/MonetDB/issues/6625 | 753,622,284 | 6,625 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-11 16:30:47 +0200
From: Chris Bing <<chris.bing>>
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2018-08-31 13:23:19 +0200
## Comment 26543
Date: 2018-07-11 16:30:47 +0200
From: Chris Bing <<chris.bing>>
We are getting a parser error with what we believe to be valid SQL.
This is a minimal repro using the standard sys.columns table, based on a much more complicated SQL query on our dataset.
sql>SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 ORDER BY COUNT(id) DESC;
Cannot use non GROUP BY column 'type' in query results without an aggregate function
This was discovered in a build based on Mar2018 just before the SP1 release. I have tested that the behaviour is the same on the latest (to revision 66818) Mar2018. It does not occur on the Jun2016 release, we haven't tested further.
Replace the expression in the order by with the column number, and it works:
sql>SELECT type,COUNT(id) FROM sys.columns GROUP BY type HAVING COUNT(id)>10 ORDER BY 2 DESC;
+-----------+------+
| type | L16 |
+===========+======+
| int | 232 |
| varchar | 195 |
| smallint | 70 |
| bigint | 57 |
| clob | 39 |
| boolean | 28 |
| timestamp | 26 |
| decimal | 18 |
+-----------+------+
8 tuples
Remove the HAVING clause, and it works:
sql>SELECT type,COUNT(id) FROM sys.columns GROUP BY type ORDER BY COUNT(id) DESC;
+-----------+------+
| type | L16 |
+===========+======+
| int | 232 |
| varchar | 195 |
| smallint | 70 |
| bigint | 57 |
| clob | 39 |
| boolean | 28 |
| timestamp | 26 |
| decimal | 18 |
| tinyint | 10 |
| char | 5 |
| oid | 4 |
| hugeint | 1 |
+-----------+------+
12 tuples
Remove the ORDER BY clause and it works:
sql>SELECT type,COUNT(id) from sys.columns GROUP BY type HAVING COUNT(id)>10;
+-----------+------+
| type | L16 |
+===========+======+
| int | 232 |
| varchar | 195 |
| boolean | 28 |
| bigint | 57 |
| smallint | 70 |
| clob | 39 |
| timestamp | 26 |
| decimal | 18 |
+-----------+------+
8 tuples
We are investigating whether we can apply the first workaround, but as this is a very complicated query generated by code it may be tricky, and to my mind this is a clear SQL parser bug.
## Comment 26549
Date: 2018-07-18 17:58:29 +0200
From: @njnes
add handling of the group by expressions in the order by part
## Comment 26550
Date: 2018-07-18 18:37:21 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [4ddcff76a52a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4ddcff76a52a) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4ddcff76a52a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4ddcff76a52a)
Changeset description:
fixes for bug #6624, ie handle orderby with aggregate expressions
## Comment 26556
Date: 2018-07-19 11:12:45 +0200
From: Chris Bing <<chris.bing>>
Thanks Niels, our original query now runs without the error.
| "Cannot use non GROUP BY column in query results without an aggregate function" when using aggregate function in both HAVING and ORDER BY clauses. | https://api.github.com/repos/MonetDB/MonetDB/issues/6624/comments | 0 | 2020-11-30T16:29:38Z | 2024-06-27T13:04:40Z | https://github.com/MonetDB/MonetDB/issues/6624 | 753,622,251 | 6,624 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-11 13:59:28 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
Last updated: 2018-07-11 13:59:28 +0200
## Comment 26540
Date: 2018-07-11 13:59:28 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Build Identifier:
The current implementation of the sys.rejects table needs some improvements to be easier usable for normal users (i.e. not db admin):
1) A user with the COPY INTO global privilege should automatically have all privileges on sys.rejects. Currently, an explicit "grant select on sys.rejects to <my-user>;" is needed.
2) The "rejects" table should be moved from the "sys" schema to the "tmp" schema.
Reproducible: Always
| sys.rejects table need improvements | https://api.github.com/repos/MonetDB/MonetDB/issues/6623/comments | 0 | 2020-11-30T16:29:35Z | 2024-06-28T13:39:47Z | https://github.com/MonetDB/MonetDB/issues/6623 | 753,622,213 | 6,623 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-10 19:07:51 +0200
From: @bartscheers
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
Last updated: 2018-07-12 12:25:26 +0200
## Comment 26538
Date: 2018-07-10 19:07:51 +0200
From: @bartscheers
User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0
Build Identifier:
Since Mar2018 release TRUNCATE() function does not work anymore.
Reproducible: Always
### Steps to Reproduce:
1. declare idecldeg double;
2. set idecldeg = -3.14159265;
3. select TRUNCATE(idecldeg, 2);
### Actual Results:
Actual result: syntax error, unexpected TRUNCATE in: "select truncate"
### Expected Results:
Expected (as in previous releases): -3
I use this in a UDF, to convert units of variables.
This used to work in the Jul2017 releases, but stopped since Mar2018 release.
## Comment 26539
Date: 2018-07-11 09:58:47 +0200
From: @sjoerdmullender
The syntax is:
TRUNCATE [ TABLE ] [ <schema name> . ] <table name>
[ CONTINUE IDENTITY | RESTART IDENTITY ]
[ RESTRICT | CASCADE ]
See https://www.monetdb.org/Documentation/Manuals/SQLreference/SQLSyntaxOverviewTRUNCATE
## Comment 26542
Date: 2018-07-11 16:16:36 +0200
From: @bartscheers
Fine, but where is my TRUNCATE function? In the sys.functions it is still there.
## Comment 26545
Date: 2018-07-11 16:58:59 +0200
From: @sjoerdmullender
The function "truncate" you can find in sys.functions is a totally different function. It truncates a string to a particular number of characters, as in:
SELECT sys."truncate"('some string', 4);
which gives the string 'some'.
## Comment 26546
Date: 2018-07-12 12:25:26 +0200
From: @bartscheers
The function needs to be in lower case and double quoted, then it works as before (including on non-string arguments):
So
select TRUNCATE(idecldeg, 2);
must be
select "truncate"(idecldeg, 2);
I consider it as resolved.
| SQL function TRUNCATE() does not work anymore | https://api.github.com/repos/MonetDB/MonetDB/issues/6622/comments | 0 | 2020-11-30T16:29:32Z | 2024-06-28T06:40:11Z | https://github.com/MonetDB/MonetDB/issues/6622 | 753,622,173 | 6,622 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-07-02 18:22:16 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @njnes
Last updated: 2018-08-31 13:23:17 +0200
## Comment 26533
Date: 2018-07-02 18:22:16 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Build Identifier:
Applying the comparison '<>' on a remote table returns incorrect results.
Reproducible: Always
### Steps to Reproduce:
1. Start two MonetDB servers:
$ mserver5 --dbpath=/tmp/mdb1 --set mapi_port=60001 --set monet_daemon=yes&
$ mserver5 --dbpath=/tmp/mdb3 --set mapi_port=60003 --set monet_daemon=yes&
2. Connect to mdb1 to create a simple table:
$ mclient -d mdb1 -u monetdb -p 60001
...
sql>create table bug1 (i int, v varchar(10));
operation successful
sql>insert into bug1 values (48, 'foo'), (29, 'bar'), (63, 'abc');
3 affected rows
3. Connect to mdb3 to create a remote table:
$ mclient -d mdb3 -u monetdb -p 60003
...
sql>create remote table bug1 (i int, v varchar(10)) on 'mapi:monetdb://localhost:60001/mdb1';
operation successful
sql>select * from bug1; -- sanity check
+------+------+
| i | v |
+======+======+
| 48 | foo |
| 29 | bar |
| 63 | abc |
+------+------+
3 tuples
sql>select * from bug1 where i < 50; -- correct
+------+------+
| i | v |
+======+======+
| 48 | foo |
| 29 | bar |
+------+------+
2 tuples
sql>select * from bug1 where i > 50; -- correct
+------+------+
| i | v |
+======+======+
| 63 | abc |
+------+------+
1 tuple
sql>select * from bug1 where i <> 50; -- WRONG!
+---+---+
| i | v |
+===+===+
+---+---+
0 tuples
sql>select * from bug1 where v = 'foo'; -- correct
+------+------+
| i | v |
+======+======+
| 48 | foo |
+------+------+
1 tuple
sql>select * from bug1 where v <> 'foo'; -- WRONG!
+------+------+
| i | v |
+======+======+
| 48 | foo |
+------+------+
1 tuple
sql>select * from bug1 where v <> 'bla'; -- WRONG!
+---+---+
| i | v |
+===+===+
+---+---+
0 tuples
## Comment 26534
Date: 2018-07-02 18:34:33 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [6f2a93ed55a0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f2a93ed55a0) made by Ying Zhang <y.zhang@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f2a93ed55a0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f2a93ed55a0)
Changeset description:
Added tests for Bug #6621
## Comment 26541
Date: 2018-07-11 14:36:50 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [b3ccbde786b1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3ccbde786b1) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b3ccbde786b1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b3ccbde786b1)
Changeset description:
fix bug #6621, make sure we handle the anti when reading a relational plan
| SELECT FROM REMOTE TABLE WHERE <> returns wrong results | https://api.github.com/repos/MonetDB/MonetDB/issues/6621/comments | 0 | 2020-11-30T16:29:29Z | 2024-06-27T13:04:37Z | https://github.com/MonetDB/MonetDB/issues/6621 | 753,622,125 | 6,621 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-27 16:15:54 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @PedroTadim, wocyg, zelular
Last updated: 2020-03-30 11:16:28 +0200
## Comment 26515
Date: 2018-06-27 16:15:54 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Build Identifier:
When selecting from a REPLICA TABLE, or joining a REPLICA TABLE with a MERGE TABLE, the locally available replica is not detected. Thereby, a remote replica is used.
Reproducible: Always
### Steps to Reproduce:
1. Set up three MonetDB instances. We'll use 'mdb3' as the master:
$ mserver5 --dbpath=/tmp/mdb1 --set mapi_port=60001 --set monet_daemon=yes &
$ mserver5 --dbpath=/tmp/mdb2 --set mapi_port=60002 --set monet_daemon=yes &
$ mserver5 --dbpath=/tmp/mdb3 --set mapi_port=60003 --set monet_daemon=yes &
2. Create tables on each instances. s1,s2,s3 will be used in a REPLICA TABLE. t1,t2,t3 will be used in a MERGE TABLE.
$ mclient -d mdb1 -u monetdb -p 60001
create table s1 (i int);
insert into s1 values (23), (42);
create table t1 (s varchar(10));
insert into t1 values ('abc'), ('efg');
$ mclient -d mdb2 -u monetdb -p 60002
create table s2 (i int);
insert into s2 values (23), (42);
create table t2 (s varchar(10));
insert into t2 values ('foo'), ('bar');
$ mclient -d mdb3 -u monetdb -p 60003
create table s3 (i int);
insert into s3 values (23), (42);
create table t3 (s varchar(10));
insert into t3 values ('baz'), ('qux');
3. Set up the REPLICA TABLE and MERGE TABLE on 'mdb3'
$ mclient -d mdb3 -u monetdb -p 60003
create remote table s1 (i int) on 'mapi:monetdb://localhost:60001/mdb1';
create remote table s2 (i int) on 'mapi:monetdb://localhost:60002/mdb2';
create remote table t1 (s varchar(10)) on 'mapi:monetdb://localhost:60001/mdb1';
create remote table t2 (s varchar(10)) on 'mapi:monetdb://localhost:60002/mdb2';
-- s3 is a locally available replica:
create replica table repS(i int);
alter table repS add table s2;
alter table repS add table s1;
alter table repS add table s3;
create merge table mrgT (s varchar(10));
alter table mrgT add table t2;
alter table mrgT add table t1;
alter table mrgT add table t3;
4. Problem 1: when we select from repS. the local replica s3 is not used:
sql>plan select * from repS;
+------------------------------------------------------------------------------------------------+
| rel |
+================================================================================================+
| project ( |
| | table |
| | | REMOTE(sys.s2) [ "s2"."i" as "reps"."i", "s2"."%TID%" NOT NULL as "reps"."%TID%" ] REMOTE |
: mapi:monetdb://localhost:60002/mdb2 [ "reps"."i", "reps"."%TID%" NOT NULL ] :
| ) [ "reps"."i" ] |
+------------------------------------------------------------------------------------------------+
4 tuples
5. Problem 2: when we join repS with mrgT, the local replica s3 is not used to join with t3:
sql>plan select * from repS, mrgT;
+------------------------------------------------------------------------------------------------+
| rel |
+================================================================================================+
| union ( |
| | union ( |
| | | table |
| | | | project ( |
| | | | | crossproduct ( |
| | | | | | REMOTE(sys.s2) [ "s2"."i" as "reps"."i", "s2"."%TID%" NOT NULL as "reps"."%TID%" ], |
| | | | | | project ( |
| | | | | | | REMOTE(sys.t2) [ "t2"."s" as "mrgt"."s" ] COUNT |
| | | | | | ) [ "mrgt"."s" ] |
| | | | | ) [ ] |
| | | | ) [ "reps"."i", "mrgt"."s" ] REMOTE mapi:monetdb://localhost:60002/mdb2 [ "reps"."i", "m |
: rgt"."s" ], :
| | | table |
| | | | project ( |
| | | | | crossproduct ( |
| | | | | | REMOTE(sys.s1) [ "s1"."i" as "reps"."i", "s1"."%TID%" NOT NULL as "reps"."%TID%" ], |
| | | | | | project ( |
| | | | | | | REMOTE(sys.t1) [ "t1"."s" as "mrgt"."s" ] COUNT |
| | | | | | ) [ "mrgt"."s" ] |
| | | | | ) [ ] |
| | | | ) [ "reps"."i", "mrgt"."s" ] REMOTE mapi:monetdb://localhost:60001/mdb1 [ "reps"."i", "m |
: rgt"."s" ] :
| | ) [ "reps"."i", "mrgt"."s" ], |
| | project ( |
| | | crossproduct ( |
| | | | table |
| | | | | REMOTE(sys.s2) [ "s2"."i" as "reps"."i", "s2"."%TID%" NOT NULL as "reps"."%TID%" ] REM |
: OTE mapi:monetdb://localhost:60002/mdb2 [ "reps"."i", "reps"."%TID%" NOT NULL ], :
| | | | project ( |
| | | | | table(sys.t3) [ "t3"."s" as "mrgt"."s" ] COUNT |
| | | | ) [ "mrgt"."s" ] |
| | | ) [ ] |
| | ) [ "reps"."i", "mrgt"."s" ] |
| ) [ "reps"."i", "mrgt"."s" ] |
+------------------------------------------------------------------------------------------------+
31 tuples
### Expected Results:
Problem 1: s3 should be used for this SELECT
Problem 2: s3 should be used for the join with t3
## Comment 26532
Date: 2018-06-29 16:24:11 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [6b85ab2bb368](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6b85ab2bb368) made by Ying Zhang <y.zhang@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6b85ab2bb368](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6b85ab2bb368)
Changeset description:
Added tests for Bug #6620
## Comment 27539
Date: 2020-02-12 11:14:03 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [0b4e046a12ca](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0b4e046a12ca) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0b4e046a12ca](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0b4e046a12ca)
Changeset description:
Test local_replica_table_not_detected.Bug-6620 is no longer failing
| Local replica in a REPLICA TABLE not detected | https://api.github.com/repos/MonetDB/MonetDB/issues/6620/comments | 0 | 2020-11-30T16:29:25Z | 2024-06-27T13:04:36Z | https://github.com/MonetDB/MonetDB/issues/6620 | 753,622,088 | 6,620 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-27 15:13:03 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @yzchang
Last updated: 2018-06-27 15:41:14 +0200
## Comment 26514
Date: 2018-06-27 15:13:03 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Build Identifier:
When using INSERT INTO to insert values into a table containing an auto_increment column, the current MAL plan uses multiple sql.next_value and bat.append to generate and insert values for the auto_increment column.
This can be improved using bulk operations, such as how COPY INTO fills in the values of an auto_increment column.
Reproducible: Always
### Steps to Reproduce:
See the difference in the MAL plans of the following queries:
sql>create table slow (a int, b int auto_increment);
operation successful
sql>explain insert into slow(a) values (1), (2), (3), (4);
+----------------------------------------------------------------------------------------------------------------------------+
| mal |
+============================================================================================================================+
| function user.s18_1():void; |
| X_5:void := querylog.define("explain insert into slow(a) values (1), (2), (3), (4);":str, "default_pipe":str, 42:int); |
| X_9:bat[:int] := bat.new(nil:int); |
| X_8:int := sql.mvc(); |
| X_13:bat[:int] := bat.append(X_9:bat[:int], 1:int, true:bit); |
| X_17:bat[:int] := bat.append(X_13:bat[:int], 2:int, true:bit); |
| X_20:bat[:int] := bat.append(X_17:bat[:int], 3:int, true:bit); |
| X_23:bat[:int] := bat.append(X_20:bat[:int], 4:int, true:bit); |
| X_24:bat[:int] := bat.new(nil:int); |
| X_29:lng := sql.next_value("sys":str, "seq_8595":str); |
| X_30:int := calc.int(X_29:lng); |
| X_31:bat[:int] := bat.append(X_24:bat[:int], X_30:int, true:bit); |
| X_34:lng := sql.next_value("sys":str, "seq_8595":str); |
| X_35:int := calc.int(X_34:lng); |
| X_36:bat[:int] := bat.append(X_31:bat[:int], X_35:int, true:bit); |
| X_39:lng := sql.next_value("sys":str, "seq_8595":str); |
| X_40:int := calc.int(X_39:lng); |
| X_41:bat[:int] := bat.append(X_36:bat[:int], X_40:int, true:bit); |
| X_44:lng := sql.next_value("sys":str, "seq_8595":str); |
| X_45:int := calc.int(X_44:lng); |
| X_46:bat[:int] := bat.append(X_41:bat[:int], X_45:int, true:bit); |
| X_49:int := sql.append(X_8:int, "sys":str, "slow":str, "a":str, X_23:bat[:int]); |
| X_53:int := sql.append(X_49:int, "sys":str, "slow":str, "b":str, X_46:bat[:int]); |
| X_55:lng := aggr.count(X_46:bat[:int]); |
| sql.affectedRows(X_53:int, X_55:lng); |
| end user.s18_1; |
| optimizer.mitosis() |
| optimizer.dataflow() |
| ... |
+----------------------------------------------------------------------------------------------------------------------------+
52 tuples
sql>explain copy into slow(a) from '/tmp/ints.csv'(a);
+---------------------------------------------------------------------------------------------------------------------------------------------------+
| mal |
+===================================================================================================================================================+
| function user.s12_1():void; |
| X_1:void := querylog.define("copy into slow(a) from \\'/tmp/ints.csv\\'(a);":str, "default_pipe":str, 25:int); |
| barrier X_91:bit := language.dataflow(); |
| X_4:int := sql.mvc(); |
| X_25:bat[:int] := sql.copy_from(nil:ptr, "|":str, "\\n":str, nil:str, "null":str, "/tmp/ints.csv":str, -1:lng, 0:lng, 0:int, 0:int, nil:str); |
| X_28:bat[:str] := algebra.project(X_25:bat[:int], "sys":str); |
| X_31:bat[:lng] := batsql.next_value(X_28:bat[:str], "seq_8595":str); |
| X_34:bat[:int] := batcalc.int(X_31:bat[:lng]); |
| X_36:int := sql.append(X_4:int, "sys":str, "slow":str, "a":str, X_25:bat[:int]); |
| X_40:int := sql.append(X_36:int, "sys":str, "slow":str, "b":str, X_34:bat[:int]); |
| X_42:lng := aggr.count(X_34:bat[:int]); |
| language.pass(X_25:bat[:int]); |
| language.pass(X_34:bat[:int]); |
| exit X_91:bit; |
| sql.affectedRows(X_40:int, X_42:lng); |
| end user.s12_1; |
| ... |
+---------------------------------------------------------------------------------------------------------------------------------------------------+
41 tuples
$ cat /tmp/ints.csv
234
13
123
4345
| INSERT INTO table with auto_increment column needs bulk execution | https://api.github.com/repos/MonetDB/MonetDB/issues/6619/comments | 0 | 2020-11-30T16:29:21Z | 2024-06-28T13:39:46Z | https://github.com/MonetDB/MonetDB/issues/6619 | 753,622,038 | 6,619 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-26 14:53:00 +0200
From: @yzchang
To: SQL devs <<bugs-sql>>
Version: 11.29.3 (Mar2018)
CC: @njnes, @yzchang
Last updated: 2018-08-31 13:23:25 +0200
## Comment 26502
Date: 2018-06-26 14:53:00 +0200
From: @yzchang
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Safari/605.1.15
Build Identifier:
When creating a table with an auto_increment column, a sequence is created automatically. However, the dependency on this sequence is not checked when one tries to drop this sequence.
Also, the dependency of the table on the sequence is not recorded in 'sys'.'dependences'.
Reproducible: Always
### Steps to Reproduce:
The following queries demonstrate the two problems mentioned above:
select * from sequences;
create table t (i int auto_increment, val int);
select * from sequences;
-- however, the dependency is not recorded in the "dependencies" table:
select * from dependencies d, sequences s where d.id = s.id or d.depend_id = s.id;
insert into t(val) values (425), (492);
drop sequence seq_8595; -- this shouldn't succeed
insert into t(val) values (425), (492); -- now we can't insert values any more
### Actual Results:
1. no record in the "dependencies" table to register the dependency of table "t" on the automatically created sequence for column "i".
2. the new sequence can be dropped, while "t" still exists. After this, insert into "t" returns error on column "i"
### Expected Results:
1. The dependency of "t" on the sequence should be recorded in "dependencies" table.
2. Dropping the sequence while "t" exists should return a dependency violated error.
## Comment 26505
Date: 2018-06-26 15:12:58 +0200
From: @yzchang
I updated the subject of this bug, because:
1. The problem also happens with explicitly created sequence:
sql>CREATE SEQUENCE "my_test_seq" as integer START WITH 2;
operation successful
sql>CREATE TABLE test (t int DEFAULT NEXT VALUE FOR "my_test_seq", v char);
operation successful
sql>INSERT INTO test(v) VALUES ('a');
1 affected row, last generated key: 2
sql>drop sequence my_test_seq;
operation successful
sql>INSERT INTO test(v) VALUES ('a');
NEXT VALUE FOR: no such sequence 'sys'.'my_test_seq'
2. Some parts of MonetDB, e.g. DROP TABLE, handles the column=>sequence dependency correctly. The queries below show that DROP TABLE also deletes the automatically created sequence (but not an explicitly created sequence). For now, I only know that DROP SEQUENCE doesn't check the dependency.
sql>select * from sequences;
+----+-----------+------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+====+===========+======+=======+==========+==========+===========+==========+=======+
+----+-----------+------+-------+----------+----------+-----------+----------+-------+
0 tuples
sql>create table t (i int auto_increment);
operation successful
sql>select * from sequences;
+------+-----------+----------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+======+===========+==========+=======+==========+==========+===========+==========+=======+
| 8627 | 2000 | seq_8623 | 1 | 0 | 0 | 1 | 1 | false |
+------+-----------+----------+-------+----------+----------+-----------+----------+-------+
1 tuple
sql>drop table t;
operation successful
sql>select * from sequences;
+----+-----------+------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+====+===========+======+=======+==========+==========+===========+==========+=======+
+----+-----------+------+-------+----------+----------+-----------+----------+-------+
0 tuples
sql>CREATE SEQUENCE "my_test_seq" as integer START WITH 2;
operation successful
sql>select * from sequences;
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+======+===========+=============+=======+==========+==========+===========+==========+=======+
| 8630 | 2000 | my_test_seq | 2 | 0 | 0 | 1 | 1 | false |
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
1 tuple
sql>CREATE TABLE test (t int DEFAULT NEXT VALUE FOR "my_test_seq", v char);
operation successful
sql>select * from sequences;
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+======+===========+=============+=======+==========+==========+===========+==========+=======+
| 8630 | 2000 | my_test_seq | 2 | 0 | 0 | 1 | 1 | false |
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
1 tuple
sql>drop table test;
operation successful
sql>select * from sequences;
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
| id | schema_id | name | start | minvalue | maxvalue | increment | cacheinc | cycle |
+======+===========+=============+=======+==========+==========+===========+==========+=======+
| 8630 | 2000 | my_test_seq | 2 | 0 | 0 | 1 | 1 | false |
+------+-----------+-------------+-------+----------+----------+-----------+----------+-------+
1 tuple
## Comment 26531
Date: 2018-06-29 14:36:32 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [bc6eeffbd123](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc6eeffbd123) made by Ying Zhang <y.zhang@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bc6eeffbd123](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bc6eeffbd123)
Changeset description:
Added tests for Bug #6618
## Comment 26544
Date: 2018-07-11 16:47:02 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset [532e145f1c85](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=532e145f1c85) made by Niels Nes <niels@cwi.nl> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=532e145f1c85](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=532e145f1c85)
Changeset description:
add dependencies on default functions (including sequences), solves
bug #6618
| dependency column on sequence violated by DROP SEQUENCE | https://api.github.com/repos/MonetDB/MonetDB/issues/6618/comments | 0 | 2020-11-30T16:29:17Z | 2024-06-27T13:04:34Z | https://github.com/MonetDB/MonetDB/issues/6618 | 753,621,990 | 6,618 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-19 16:23:19 +0200
From: Manuel <<manuel>>
To: Martin van Dinther <<martin.van.dinther>>
Version: 11.25.21 (Dec2016-SP4)
CC: martin.van.dinther
Last updated: 2018-06-28 18:38:37 +0200
## Comment 26490
Date: 2018-06-19 16:23:19 +0200
From: Manuel <<manuel>>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Build Identifier:
Using the jdbc driver, it is possible to retrieve the entire list of tables stored in the DBMS, even if the user does not have SELECT privileges, it is possible to retrieve the complete list
of the tables present in the DBMS. Of course, attempting to do any select will fail, but I think this is somewhat of a security hole
nonetheless (although not a critical one of course).
Is this intentional behaviour, or is just an oversight?
Reproducible: Always
### Steps to Reproduce:
1. String[] types = new String[]{"GLOBAL TEMPORARY TABLE", "LOCAL TEMPORARY TABLE", "MERGE TABLE", "REMOTE TABLE", "REPLICA TABLE", "STREAM TABLE", "TABLE", "VIEW"};
2. Using the jdbc driver, simply invoke MonetConnectiongetMetaData().getTables(null, null, null, types) on a MonetConnection instance
### Actual Results:
the entire list of tables present in the database
### Expected Results:
only the tables visible to the user
## Comment 26498
Date: 2018-06-25 21:34:54 +0200
From: Martin van Dinther <<martin.van.dinther>>
According to the JDBC spec it is possible/normal to return all requested tables.
See the "Note: Some databases may not return information for all tables." in the JDBC specification API:
https://docs.oracle.com/javase/7/docs/api/java/sql/DatabaseMetaData.htmlgetTables(java.lang.String,%20java.lang.String,%20java.lang.String,%20java.lang.String[])
or: https://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.htmlgetTables-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-
or: https://docs.oracle.com/javase/9/docs/api/java/sql/DatabaseMetaData.htmlgetTables-java.lang.String-java.lang.String-java.lang.String-java.lang.String:A-
However the tableNamePattern argument should not be null per JDBC spec, as in your example. We could have returned an SQLException (missing value for argument tableNamePattern).
However if calling getTables(null, null, "%", types) instead, it would still return all non system tables from all schemas, for the array of table types.
If we would filter out all tables for which the user has no SELECT privilege in the getTables(), the current user can still query the system table sys.tables directly and thus still get all schema and table names. So the security hole would still not be fixed.
As MonetDB server currently does not filter out non-selectable tables when querying sys.tables (or sys._tables) directly and because it is not required by JDBC getTables() documentation I do not think this is a bug.
FYI: The method boolean allTablesAreSelectable() could be called to "Retrieves whether the current user can use all the tables returned by the method getTables in a SELECT statement.". This method currently always returns true in MonetDB JDBC, which could be wrong for the tables for which the user has no SELECT privilege.
I think we must improve the method allTablesAreSelectable() by returning false instead of true.
Idem for allProceduresAreCallable() which currently also always retuns true.
## Comment 26522
Date: 2018-06-28 18:33:11 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset 55375d489024, made by Martin van Dinther <martin.van.dinther@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=55375d489024
Changeset description:
Corrected return values of DatabaseMetaData methods allTablesAreSelectable() and allProceduresAreCallable().
They used to return true but now return false.
This issue is found when analysing bug #6617.
| MonetConnection#getMetaData().getTables(null, null, null, types) returns the entire list of tables stored in the DB | https://api.github.com/repos/MonetDB/MonetDB/issues/6617/comments | 0 | 2020-11-30T16:29:14Z | 2024-06-28T06:40:44Z | https://github.com/MonetDB/MonetDB/issues/6617 | 753,621,940 | 6,617 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-19 11:54:22 +0200
From: J. Koetsier <<mail>>
To: clients devs <<bugs-clients>>
Version: 11.29.7 (Mar2018-SP1)
CC: @PedroTadim
Last updated: 2020-09-17 14:53:24 +0200
## Comment 26489
Date: 2018-06-19 11:54:22 +0200
From: J. Koetsier <<mail>>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Build Identifier:
Same as https://www.monetdb.org/bugzilla/show_bug.cgi?id=6615 , but in this case it's the integer column type.
Reproducible: Always
### Steps to Reproduce:
See https://www.monetdb.org/bugzilla/show_bug.cgi?id=6615
### Actual Results:
getObject(i) returns -2147483648
### Expected Results:
return null
See https://www.monetdb.org/bugzilla/show_bug.cgi?id=6615 for code snippet.
## Comment 26491
Date: 2018-06-20 11:30:28 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset b992f0ea77c2, made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=b992f0ea77c2
Changeset description:
Fixes for bugs 6614, 6615 and 6616 (ie in a MAPI connection Datablock check for a null value first before retrieving a value as an object or string)
## Comment 26495
Date: 2018-06-20 11:38:20 +0200
From: @PedroTadim
Just made a SNAPSHOT release with the fix.
| JDBC 2.35 returns minint (-2147483648) for int NULL | https://api.github.com/repos/MonetDB/MonetDB/issues/6616/comments | 0 | 2020-11-30T16:29:10Z | 2024-06-27T13:04:32Z | https://github.com/MonetDB/MonetDB/issues/6616 | 753,621,879 | 6,616 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-19 11:46:44 +0200
From: J. Koetsier <<mail>>
To: clients devs <<bugs-clients>>
Version: 11.29.7 (Mar2018-SP1)
CC: @PedroTadim
Last updated: 2020-09-17 14:53:10 +0200
## Comment 26488
Date: 2018-06-19 11:46:44 +0200
From: J. Koetsier <<mail>>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Build Identifier:
When querying a column of type Boolean that contains a NULL value, the JDBC driver returns false instead of NULL.
Reproducible: Always
### Steps to Reproduce:
1. Create table with Boolean column
2. Create a row with the Boolean column set to NULL
3. Query that row from Java using the JDBC driver
### Actual Results:
getObject(int i) returns boolean value false for the column (see below for code snippet)
### Expected Results:
Return null
Code snippet where I expect null to be returned:
// This method is used below
private String[] getColumnNames(ResultSet resultSet) throws SQLException {
ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
String[] columns = new String[columnCount];
for (int i = 1; i <= columnCount; i++) {
columns[i - 1] = metaData.getColumnName(i);
}
return columns;
}
String[] columns = getColumnNames(resultSet);
int columnCount = columns.length;
while (resultSet.next()) {
String[] row = new String[columnCount];
for (int i = 1; i <= columnCount; i++) {
if (resultSet.getObject(i) == null) {
row[i - 1] = "NULL";
} else {
row[i - 1] = resultSet.getObject(i).toString();
}
}
System.out.println(row);
}
## Comment 26493
Date: 2018-06-20 11:30:30 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset b992f0ea77c2, made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=b992f0ea77c2
Changeset description:
Fixes for bugs 6614, 6615 and 6616 (ie in a MAPI connection Datablock check for a null value first before retrieving a value as an object or string)
## Comment 26494
Date: 2018-06-20 11:38:01 +0200
From: @PedroTadim
Just made a SNAPSHOT release with the fix.
| JDBC 2.35 returns "false" for Boolean NULL | https://api.github.com/repos/MonetDB/MonetDB/issues/6615/comments | 0 | 2020-11-30T16:29:06Z | 2024-06-27T13:04:31Z | https://github.com/MonetDB/MonetDB/issues/6615 | 753,621,816 | 6,615 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-19 11:08:33 +0200
From: J. Koetsier <<mail>>
To: clients devs <<bugs-clients>>
Version: 11.29.7 (Mar2018-SP1)
CC: @PedroTadim
Last updated: 2020-09-17 14:53:04 +0200
## Comment 26486
Date: 2018-06-19 11:08:33 +0200
From: J. Koetsier <<mail>>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36
Build Identifier:
When I call ResultSet.getObject(int i) (https://docs.oracle.com/javase/8/docs/api/java/sql/ResultSet.htmlgetObject-int-) on a column with data type Timestamp a NullPointerException is thrown. This happens both when the column contains a value and when the column is null.
Tested with different tablesand the results are consistent; I iterate over all columns of my result set, and it consistently fails at a Timestamp column. Tested on both 2.35 and 2.36. Both throw the same exception, but with a slightly different stack trace (line numbers), see below.
Code fragment used for iterating over rows and columns is added below as well.
Reproducible: Always
### Steps to Reproduce:
1. Create a table with Timestamp column
2. Loop over the columns as in the script attached.
### Actual Results:
NullPointerException
### Expected Results:
Return either null or a Timestamp object.
Code for column iteration:
// This method is used below
private String[] getColumnNames(ResultSet resultSet) throws SQLException {
ResultSetMetaData metaData = resultSet.getMetaData();
int columnCount = metaData.getColumnCount();
String[] columns = new String[columnCount];
for (int i = 1; i <= columnCount; i++) {
columns[i - 1] = metaData.getColumnName(i);
}
return columns;
}
String[] columns = getColumnNames(resultSet);
int columnCount = columns.length;
while (resultSet.next()) {
String[] row = new String[columnCount];
for (int i = 1; i <= columnCount; i++) {
if (resultSet.getObject(i) == null) {
row[i - 1] = "NULL";
} else {
row[i - 1] = resultSet.getObject(i).toString();
}
}
System.out.println(row);
}
Stack traces:
2.36:
java.lang.NullPointerException
at nl.cwi.monetdb.mcl.protocol.oldmapi.OldMapiDataBlockResponse.getValueAsObject(OldMapiDataBlockResponse.java:295)
at nl.cwi.monetdb.jdbc.MonetResultSet.getTimestamp(MonetResultSet.java:2874)
at nl.cwi.monetdb.jdbc.MonetResultSet.getTimestamp(MonetResultSet.java:2832)
at nl.cwi.monetdb.jdbc.MonetResultSet.getObject(MonetResultSet.java:1916)
at nl.jkoetsier.uva.dbbench.connector.JdbcDatabaseConnector.getResults(JdbcDatabaseConnector.java:106)
at nl.jkoetsier.uva.dbbench.connector.JdbcDatabaseConnector.getLastResults(JdbcDatabaseConnector.java:76)
at nl.jkoetsier.uva.dbbench.bench.BenchRunner.run(BenchRunner.java:115)
at nl.jkoetsier.uva.dbbench.DbbenchApplication.run(DbbenchApplication.java:192)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:788)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:778)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
at nl.jkoetsier.uva.dbbench.DbbenchApplication.main(DbbenchApplication.java:57)
2.35:
java.lang.NullPointerException
at nl.cwi.monetdb.mcl.protocol.oldmapi.OldMapiDataBlockResponse.getValueAsObject(OldMapiDataBlockResponse.java:295)
at nl.cwi.monetdb.jdbc.MonetResultSet.getTimestamp(MonetResultSet.java:2855)
at nl.cwi.monetdb.jdbc.MonetResultSet.getTimestamp(MonetResultSet.java:2816)
at nl.cwi.monetdb.jdbc.MonetResultSet.getObject(MonetResultSet.java:1916)
at nl.jkoetsier.uva.dbbench.connector.JdbcDatabaseConnector.getResults(JdbcDatabaseConnector.java:106)
at nl.jkoetsier.uva.dbbench.connector.JdbcDatabaseConnector.getLastResults(JdbcDatabaseConnector.java:76)
at nl.jkoetsier.uva.dbbench.bench.BenchRunner.run(BenchRunner.java:115)
at nl.jkoetsier.uva.dbbench.DbbenchApplication.run(DbbenchApplication.java:192)
at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:788)
at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:778)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
at nl.jkoetsier.uva.dbbench.DbbenchApplication.main(DbbenchApplication.java:57)
## Comment 26487
Date: 2018-06-19 11:13:51 +0200
From: J. Koetsier <<mail>>
Also reproducible on 2.31, 2.33 and 2.34
## Comment 26492
Date: 2018-06-20 11:30:29 +0200
From: MonetDB Mercurial Repository <<hg>>
Changeset b992f0ea77c2, made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the monetdb-java repo, refers to this bug.
For complete details, see https://dev.monetdb.org/hg/monetdb-java?cmd=changeset;node=b992f0ea77c2
Changeset description:
Fixes for bugs 6614, 6615 and 6616 (ie in a MAPI connection Datablock check for a null value first before retrieving a value as an object or string)
## Comment 26496
Date: 2018-06-20 11:38:36 +0200
From: @PedroTadim
Just made a SNAPSHOT release with the fix.
| JDBC 2.35/2.36 throws NullPointerException on getObject(int i) on Timestamp column | https://api.github.com/repos/MonetDB/MonetDB/issues/6614/comments | 0 | 2020-11-30T16:29:03Z | 2024-06-27T13:04:30Z | https://github.com/MonetDB/MonetDB/issues/6614 | 753,621,757 | 6,614 |
[
"MonetDB",
"MonetDB"
] | Date: 2018-06-14 01:46:38 +0200
From: @skinkie
To: SQL devs <<bugs-sql>>
Version: 11.29.7 (Mar2018-SP1)
CC: @njnes
Last updated: 2019-11-28 10:00:05 +0100
## Comment 26484
Date: 2018-06-14 01:46:38 +0200
From: @skinkie
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36
Build Identifier:
From MonetDB-users.
with Mar2018 & Mar2018-SP1 and this script:
drop table if exists segments;
create table segments (meter int, distance int, speed int);
insert into segments values (1,1,1),(9,9,9);
select * from segments;
I get:
SELECT t.meter, s.distance, s.speed FROM segments AS s, LATERAL generate_series(s.meter, s.meter+s.distance+1) AS t(meter);
->
SELECT: no such column 't.meter'
SELECT * FROM segments AS s, LATERAL generate_series(s.meter, s.meter+s.distance+1) ;
->
mserver5: /ufs/manegold/_/Monet/preview/source/MonetDB/sql/backends/monet5/rel_bin.c:1473: rel2bin_table: Assertion `0' failed.
Aborted (core dumped)
SELECT t.* , s.distance, s.speed FROM segments AS s, LATERAL generate_series(s.meter, s.meter+s.distance+1) AS t(meter);
->
mserver5: /ufs/manegold/_/Monet/preview/source/MonetDB/sql/backends/monet5/rel_bin.c:1473: rel2bin_table: Assertion `0' failed.
Aborted (core dumped)
Reproducible: Always
## Comment 26708
Date: 2018-12-03 12:22:23 +0100
From: MonetDB Mercurial Repository <<hg>>
Changeset [19359e42134b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=19359e42134b) made by Pedro Ferreira <pedro.ferreira@monetdbsolutions.com> in the MonetDB repo, refers to this bug.
For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=19359e42134b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=19359e42134b)
Changeset description:
Added test for bug #6613.
## Comment 26984
Date: 2019-05-01 13:01:24 +0200
From: @njnes
fixed in default, where the subquery implementation is renewed
| LATERAL crash /.../rel_bin.c:1473: rel2bin_table: Assertion `0' failed. | https://api.github.com/repos/MonetDB/MonetDB/issues/6613/comments | 0 | 2020-11-30T16:28:59Z | 2024-06-27T13:04:29Z | https://github.com/MonetDB/MonetDB/issues/6613 | 753,621,697 | 6,613 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.