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: 2018-01-12 14:01:51 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.11 (Jul2017-SP3) CC: @njnes Last updated: 2018-02-12 16:12:15 +0100 ## Comment 26073 Date: 2018-01-12 14:01:51 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Build Identifier: I have seen this crash that I have been able to reproduce it every time. When I run the query contained in query.sql, against the dataset contained in BondPricesWithNulls.sql, Montedb crashes with the error: Error: could not allocate space SQLState: HY001 ErrorCode: 0 Error: COLnew:tt error SQLState: 22000 ErrorCode: 0 Using a nested query solves the issue. Reproducible: Always ### Steps to Reproduce: 1. Import the table contained in BondPricesWithNulls.sql 2. Run the query contained in query.sql ### Actual Results: crash ## Comment 26074 Date: 2018-01-12 14:02:25 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 589 the table used in the query > Attached file: [BondPricesWithNulls.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6512_BondPricesWithNulls.sql_589) (text/plain, 210717 bytes) > Description: the table used in the query ## Comment 26075 Date: 2018-01-12 14:02:58 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 590 query.sql > Attached file: [query.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6512_query.sql_590) (text/plain, 37144 bytes) > Description: query.sql ## Comment 26088 Date: 2018-01-18 08:05:55 +0100 From: @njnes make sure we only call bat.single on constants (ie not on bats). ## Comment 26091 Date: 2018-01-18 08:08:04 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [248aa8f21695](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=248aa8f21695) 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=248aa8f21695](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=248aa8f21695) Changeset description: Fixes for bugs 6510, 6512, 6514 and 6515 6510 start sum's at 0 instead of nil in case of count/sum 2 step aggregation 6512 make sure we only call bat.single on constants (ie not on bats). 6514 handle NULL (type void) on both sides of an compare operator, ie cast to a valid type. 6515 handle null in calc.second_interval ## Comment 26095 Date: 2018-01-18 08:17:32 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d6a18014adce](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d6a18014adce) 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=d6a18014adce](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d6a18014adce) Changeset description: add test and output for bug #6512
Monetdb crashes on query with limit after sort with case
https://api.github.com/repos/MonetDB/MonetDB/issues/6512/comments
0
2020-11-30T16:23:28Z
2024-06-27T13:02:43Z
https://github.com/MonetDB/MonetDB/issues/6512
753,617,285
6,512
[ "MonetDB", "MonetDB" ]
Date: 2018-01-12 13:19:42 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-01-16 09:38:03 +0100 ## Comment 26071 Date: 2018-01-12 13:19:42 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Build Identifier: MonetDB gives an empty result set in a query where it should retrieve a single column result with values -1,-1,-1. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. INSERT INTO tab2 VALUES(64,77,40); 3. INSERT INTO tab2 VALUES(75,67,58); 4. INSERT INTO tab2 VALUES(46,51,23); 5. SELECT ALL - col0 / col0 FROM tab2 cor0 WHERE - col0 NOT BETWEEN ( + col1 + - 0 ) AND ( NULL ); ### Actual Results: An empty result set. ### Expected Results: A single column result with values -1,-1,-1 ## Comment 26072 Date: 2018-01-12 13:25:54 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [524d1efcea88](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=524d1efcea88) 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=524d1efcea88](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=524d1efcea88) Changeset description: Added test for bug #6511 ## Comment 26081 Date: 2018-01-15 21:20:50 +0100 From: @njnes could you give me the sql specs which state that between should do something with NULL's (other than not include anything (NULL != all)). ## Comment 26082 Date: 2018-01-16 09:38:03 +0100 From: @sjoerdmullender ISO_9075_02_Foundation_2011_E.pdf, section 4.5.1 specifies that the Unknown truth value and the null value mean exactly the same thing. Section 6.35, Table 11 shows that True AND Unknown is Unknown, and that Unknown AND True is Unknown. Section 8.2 says that X <comp op> Y is Unknown if at least one of XV and YV is the null value (XV is the value of X, YV is the value of Y, <comp op> is a comparison operator). Section 8.3 says that X BETWEEN ASYMMETRIC Y AND Z is equivalent to X >= Y AND X <= Z. It also says that if neither SYMMETRIC nor ASYMMETRIC is specified, ASYMMETRIC is implicit. So, working back from these rules it should be clear that the WHERE clause does not match anything (the result for all rows is Unknown, i.e. null.
Sqlitelogictest: Wrong output in select query with not between query
https://api.github.com/repos/MonetDB/MonetDB/issues/6511/comments
0
2020-11-30T16:23:25Z
2024-06-27T13:02:42Z
https://github.com/MonetDB/MonetDB/issues/6511
753,617,232
6,511
[ "MonetDB", "MonetDB" ]
Date: 2018-01-12 12:58:33 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:15 +0100 ## Comment 26069 Date: 2018-01-12 12:58:33 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Build Identifier: MonetDB gives wrong results in a product of two count aggregation calls from an intermediate relation with no tuples. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. INSERT INTO tab1 VALUES(51,14,96); 3. INSERT INTO tab1 VALUES(85,5,59); 4. INSERT INTO tab1 VALUES(91,47,68); 5. SELECT ALL COUNT ( DISTINCT - 34 ) * - COUNT ( * ) AS col2 FROM tab1 WHERE + col1 IS NULL; ### Actual Results: A single atom in the result set with value NULL. ### Expected Results: A single atom in the result set with value 0. ## Comment 26070 Date: 2018-01-12 13:05:42 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [3d050eebe253](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d050eebe253) 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=3d050eebe253](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=3d050eebe253) Changeset description: Added test for bug #6510 ## Comment 26087 Date: 2018-01-18 08:02:48 +0100 From: @njnes handle partial count/sum where count results are empty ## Comment 26094 Date: 2018-01-18 08:08:08 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [248aa8f21695](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=248aa8f21695) 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=248aa8f21695](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=248aa8f21695) Changeset description: Fixes for bugs 6510, 6512, 6514 and 6515 6510 start sum's at 0 instead of nil in case of count/sum 2 step aggregation 6512 make sure we only call bat.single on constants (ie not on bats). 6514 handle NULL (type void) on both sides of an compare operator, ie cast to a valid type. 6515 handle null in calc.second_interval
Sqlitelogictest: Wrong output in aggregation query
https://api.github.com/repos/MonetDB/MonetDB/issues/6510/comments
0
2020-11-30T16:23:22Z
2024-06-27T13:02:41Z
https://github.com/MonetDB/MonetDB/issues/6510
753,617,192
6,510
[ "MonetDB", "MonetDB" ]
Date: 2018-01-08 10:02:21 +0100 From: Guillaume de GENTILE &lt;<gentile_g>&gt; To: clients devs &lt;<bugs-clients>&gt; Version: 11.27.11 (Jul2017-SP3) CC: martin.van.dinther Last updated: 2019-09-26 17:49:13 +0200 ## Comment 26060 Date: 2018-01-08 10:02:21 +0100 From: Guillaume de GENTILE &lt;<gentile_g>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Build Identifier: Hi, I have created a test table containing 51 columns as below: CREATE TABLE test (id int, col1 varchar(30), col2 varchar(30), col3 varchar(30), col4 varchar(30), col5 varchar(30), col6 varchar(30), col7 varchar(30), col8 varchar(30), col9 varchar(30), col10 varchar(30), col11 varchar(30), col12 varchar(30), col13 varchar(30), col14 varchar(30), col15 varchar(30), col16 varchar(30), col17 varchar(30), col18 varchar(30), col19 varchar(30), col20 varchar(30), col21 varchar(30), col22 varchar(30), col23 varchar(30), col24 varchar(30), col25 varchar(30), col26 varchar(30), col27 varchar(30), col28 varchar(30), col29 varchar(30), col30 varchar(30), col31 varchar(30), col32 varchar(30), col33 varchar(30), col34 varchar(30), col35 varchar(30), col36 varchar(30), col37 varchar(30), col38 varchar(30), col39 varchar(30), col40 varchar(30), col41 varchar(30), col42 varchar(30), col43 varchar(30), col44 varchar(30), col45 varchar(30), col46 varchar(30), col47 varchar(30), col48 varchar(30), col49 varchar(30), col50 varchar(30)) then I have populated this table with 50 millions rows. When I read all data from this test table, my CPU is only using 40% of available ressources with very small disk usage (I imagine that data are loaded in memory). I have monitored my process using JProfiler and I found out that the read next method is the bottleneck with 73% of allocated CPU: 73.4% - 13,585 ms org.apache.commons.dbcp2.DelegatingResultSet.next 73.4% - 13,585 ms nl.cwi.monetdb.jdbc.MonetResultSet.next 73.4% - 13,585 ms nl.cwi.monetdb.jdbc.MonetResultSet.relative 73.4% - 13,585 ms nl.cwi.monetdb.jdbc.MonetResultSet.absolute 39.7% - 7,347 ms nl.cwi.monetdb.mcl.parser.TupleLineParser.parse 33.7% - 6,238 ms nl.cwi.monetdb.jdbc.MonetConnection$ResultSetResponse.getLine 33.7% - 6,238 ms nl.cwi.monetdb.jdbc.MonetConnection$ResponseList.executeQuery 33.7% - 6,228 ms nl.cwi.monetdb.mcl.io.BufferedMCLReader.readLine 33.7% - 6,228 ms java.io.BufferedReader.readLine 33.7% - 6,228 ms nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.read 33.7% - 6,228 ms nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream.readBlock 33.7% - 6,228 ms nl.cwi.monetdb.mcl.net.MapiSocket$BlockInputStream._read 33.7% - 6,228 ms java.io.BufferedInputStream.read Is there a way to improve performance, knowing that only 40% of the CPU is used ? Is there a setting related to multithreading that could be adjusted so that the process will use more that 40% of the CPU? Best regards, Guillaume Reproducible: Always ## Comment 26200 Date: 2018-02-15 16:13:17 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; If only 40% (or 74%) of the CPU is used (I assume this is the CPU running the Java/JDBC driver code), then the CPU (and JDBC driver code) is apparently not the blocking issue. Maybe reading the data over the socket is the limiting resource? So what MonetDB setup are you using? Are both on the same host or on different hosts? If they are on different hosts, what network do you use (LAN or WAN) and what max bandwidth does it have. Also try to run the Java client and the MonetDB server on the same host (so connect to localhost) and see how fast it is compared to your scenario. There is no setting in the JDBC driver to enable multithreading. However the MonetDB server uses multithreading by default (default_pipe optimizer). You can disable it by using sequential_pipe. See also: https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/OptimizerPipelines I will analyze if more speed can be gained by optimizing java: nl.cwi.monetdb.mcl.parser.TupleLineParser.parse() (consuming 39.7%) and nl.cwi.monetdb.jdbc.MonetConnection$ResultSetResponse.getLine() (consuming 33.7%) methods. Both methods are needed to be called for each MonetResultSet.next() and MonetResultSet.absolute() methods. ## Comment 27328 Date: 2019-09-26 17:49:13 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; In the new: monetdb-jdbc-2.29.jre7.jar release we have further optimized methods: TupleLineParser.parse() and MonetConnection$ResponseList.executeQuery(). The new jar file is downloadable from https://www.monetdb.org/downloads/Java/ Please check if the performance has improved for your test case and let us know.
Performance improvement
https://api.github.com/repos/MonetDB/MonetDB/issues/6509/comments
0
2020-11-30T16:23:20Z
2024-06-27T13:02:40Z
https://github.com/MonetDB/MonetDB/issues/6509
753,617,150
6,509
[ "MonetDB", "MonetDB" ]
Date: 2018-01-08 00:11:21 +0100 From: Niklas B &lt;<niklas.bivald>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.11 (Jul2017-SP3) CC: @njnes, niklas.bivald Last updated: 2018-02-12 16:12:21 +0100 ## Comment 26058 Date: 2018-01-08 00:11:21 +0100 From: Niklas B &lt;<niklas.bivald>&gt; User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: I haven't found this bug in the archive, so I'm reporting it. Hopefully it's not a dupe :) Using a Python UDF which takes a TIMESTAMP column as input crashes mserver5 on Debian Stretch if the table column has NULL values in it. Running (linux~debian stretch) on commit a7f8b1f865b7 (https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a7f8b1f865b7) Thread 6 "mserver5" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffe97c1700 (LWP 22566)] 0x00007ffff1c53d5c in PyNullMask_FromBAT (b=0x7fffd817d200, t_start=0, t_end=2) at conversion.c:438 438 CreateNullMask(lng); (gdb) l 433 break; 434 case TYPE_int: 435 CreateNullMask(int); 436 break; 437 case TYPE_lng: 438 CreateNullMask(lng); 439 break; 440 case TYPE_flt: 441 CreateNullMask(flt); 442 break; Only tried on Debian Stretch build from source at commit a7f8b1f865b7, with and without debugging enabled. GDB produced the output above. Reproducible: Always ### Steps to Reproduce: drop all function test_timestamp_with_nulls; CREATE FUNCTION test_timestamp_with_nulls(actual_takeoff_datetime timestamp) RETURNS STRING LANGUAGE PYTHON { return "it works"; }; drop table if exists example; CREATE TABLE example ( "column1" timestamp ); insert into example ("column1") values ('2017-01-01 00:00:01'); insert into example ("column1") values (NULL); select test_timestamp_with_nulls("column1") from example; ### Actual Results: Segmentation fault ### Expected Results: Query should return data If I cast the column to a STRING it works: select test_timestamp_with_nulls(cast("column1" as string)) from example; ## Comment 26059 Date: 2018-01-08 00:17:28 +0100 From: Niklas B &lt;<niklas.bivald>&gt; I realise I perhaps wasn't as clear in my communication as I hoped, I apologise, it's after midnight. To summarise: If I have a Python UDF that takes timestamp input, like so: CREATE FUNCTION test_timestamp_with_nulls(actual_takeoff_datetime timestamp) RETURNS STRING LANGUAGE PYTHON { return "it works"; }; And I pass a column to it, like so: select test_timestamp_with_nulls("column1") from example; Then if "column1" in table "example" is a timestamp and any value in the column is NULL, mserver5 crashes. If there are no NULl values, it works. I've only tested this on Linux Debian Stretch, but I can reproduce it every time. I haven't made any changes to the source. ## Comment 26061 Date: 2018-01-08 10:16:12 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7d2a93f65310](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d2a93f65310) 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=7d2a93f65310](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7d2a93f65310) Changeset description: Use correct bat. This fixes bug #6508. ## Comment 26062 Date: 2018-01-08 10:16:17 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [cc06e0c02cb1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc06e0c02cb1) 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=cc06e0c02cb1](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cc06e0c02cb1) Changeset description: Added test for bug #6508. ## Comment 26063 Date: 2018-01-08 11:40:58 +0100 From: Niklas B &lt;<niklas.bivald>&gt; Works like a charm, thank you so much :) ## Comment 26064 Date: 2018-01-08 22:19:06 +0100 From: Niklas B &lt;<niklas.bivald>&gt; Sorry for the re-open, but it would appears as if even though it doesn't crash, the NULL:s are actually converted into string "nil": drop all function test_timestamp_with_nulls; CREATE FUNCTION test_timestamp_with_nulls(actual_takeoff_datetime timestamp) RETURNS STRING LANGUAGE PYTHON { import json return json.dumps(actual_takeoff_datetime.tolist()); }; drop table if exists example; CREATE TABLE example ( "column1" timestamp ); insert into example ("column1") values ('2017-01-01 00:00:01'); insert into example ("column1") values (NULL); select test_timestamp_with_nulls("column1") from example; Gives: +------------------------------------+ | L2 | +====================================+ | ["2017-01-01 00:00:01.000", "nil"] | +------------------------------------+ But should give: +------------------------------------+ | L2 | +====================================+ | ["2017-01-01 00:00:01.000", null] | +------------------------------------+ I.e the null value shouldn't be converted to string "nil", (but probably a numpy or python NaN) Running commit cc06e0c02cb1 Or is NIL actually expected behaviour? If so feel free to close. ## Comment 26067 Date: 2018-01-10 16:43:46 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0dd61564584d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0dd61564584d) 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=0dd61564584d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0dd61564584d) Changeset description: Don't replace bat; updated test. This fixes the reopened bug #6508.
Segmentation fault in mserver5 on Python2 UDF with TIMESTAMP column input that has NULL values (conversion.c:438, PyNullMask_FromBAT)
https://api.github.com/repos/MonetDB/MonetDB/issues/6508/comments
0
2020-11-30T16:23:16Z
2024-06-27T13:02:39Z
https://github.com/MonetDB/MonetDB/issues/6508
753,617,099
6,508
[ "MonetDB", "MonetDB" ]
Date: 2018-01-06 09:00:17 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; To: clients devs &lt;<bugs-clients>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-03-29 15:39:09 +0200 ## Comment 26057 Date: 2018-01-06 09:00:17 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36 Build Identifier: SQL> SELECT SUM("TABLE_NAME".COLUMN_NAME) FROM "TABLE_NAME"; +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | L3 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 79892245957480 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ SQLRowCount returns 1 1 rows fetched MonetDB 5 server v11.27.9 "Jul2017-SP2" (64-bit, 128-bit integers) Compiler Details: configure:5030: checking for C compiler version configure:5039: gcc --version >&5 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16) define PACKAGE_NAME "MonetDB" | define PACKAGE_TARNAME "MonetDB" | define PACKAGE_VERSION "11.27.9" | define PACKAGE_STRING "MonetDB 11.27.9" Reproducible: Always ### Steps to Reproduce: 1.Compile the source code build with above compiler details and use any ODBC client with sample SQL provided 2. 3. ### Actual Results: SQL> SELECT SUM("TABLE_NAME".COLUMN_NAME) FROM "TABLE_NAME"; +---------------------+ | L3 | +---------------------+ | 79892245957480 | +---------------------+ ### Expected Results: SQL> SELECT SUM("TABLE_NAME".COLUMN_NAME) FROM "TABLE_NAME"; +---------------------+ | L3 | +---------------------+ | 79892245957480 | +---------------------+ ## Comment 26147 Date: 2018-01-31 16:17:39 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [5a253ae53941](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5a253ae53941) 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=5a253ae53941](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5a253ae53941) Changeset description: Initial support for HUGEINT in the ODBC driver. This fixes bug #6507. ## Comment 26148 Date: 2018-01-31 16:24:43 +0100 From: @sjoerdmullender I have implemented support for getting values of type HUGEINT from the server, however at the application end of things, nothing has changed. This means that if the server sends a value of type HUGEINT and that value is too large for a 64 bit integer, you cannot retrieve it as an integer. You can, however, retrieve it as a string (SQL_C_CHAR or SQL_C_WCHAR). Values of type HUGEINT that do fit in 64 bits can be retrieved into a 64 bit integer (SQL_C_BIGINT). This is implemented in the default branch, meaning it will be in the next feature release. Before (using isql from UNIXodbc): SQL> select sum(id) from tables; +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | L41 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | 340669 | +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ After: SQL> select sum(id) from tables; +-----------------------------------------+ | L41 | +-----------------------------------------+ | 387258 | +-----------------------------------------+ (different server, so different numeric values, but those are not the point.) ## Comment 26304 Date: 2018-03-29 15:39:09 +0200 From: @sjoerdmullender The Mar2018 version has been released.
Column Header coming with trailing spaces in compiled version of MonetDB 11.27.9/11
https://api.github.com/repos/MonetDB/MonetDB/issues/6507/comments
0
2020-11-30T16:23:13Z
2024-06-27T13:02:38Z
https://github.com/MonetDB/MonetDB/issues/6507
753,617,054
6,507
[ "MonetDB", "MonetDB" ]
Date: 2018-01-03 16:44:18 +0100 From: @mlkersten To: clients devs &lt;<bugs-clients>&gt; Version: -- development Last updated: 2018-08-31 13:23:28 +0200 ## Comment 26055 Date: 2018-01-03 16:44:18 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0 Build Identifier: When using the TRACE option, then the performance counter is shown twice the same value, derived from the generation of the trace table rendering. It should report two different numbers corresponding to the actual query execution and the trace table rendering. Reproducible: Always ## Comment 26528 Date: 2018-06-29 10:50:43 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [bb0d2665ca06](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb0d2665ca06) 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=bb0d2665ca06](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bb0d2665ca06) Changeset description: Only report times once. This fixes bug #6506.
Improper performance counters
https://api.github.com/repos/MonetDB/MonetDB/issues/6506/comments
0
2020-11-30T16:23:10Z
2024-06-27T13:02:37Z
https://github.com/MonetDB/MonetDB/issues/6506
753,617,022
6,506
[ "MonetDB", "MonetDB" ]
Date: 2017-12-31 23:19:37 +0100 From: Javier Pastorino &lt;<jpastorino.ucdenver>&gt; To: Merovingian devs &lt;<bugs-merovingian>&gt; Version: 11.27.11 (Jul2017-SP3) CC: shery35 Last updated: 2020-01-14 15:56:09 +0100 ## Comment 26053 Date: 2017-12-31 23:19:37 +0100 From: Javier Pastorino &lt;<jpastorino.ucdenver>&gt; User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: I'm loading a 600 row by 400K columns table using the copy into from statement. After running for a while, the process abort and in the log mentioned that the db was killed by sigkill signal. Statement: mclient -d myUser -s "COPY 1000 records OFFSET 2 INTO echo.betanorm_test FROM ('/..../file.csv') USING DELIMITERS ',','\n','' NULL AS '';" merovingian.log (filtered target and proxying lines, if needed I gladly provide the whole log): root@lead:/data/monetdb/decodeFarm tail -2000 merovingian.log |grep -v target | grep -v proxying 2017-12-31 08:47:16 MSG merovingian[62066]: database 'decode' (63524) was killed by signal SIGKILL 2017-12-31 08:50:02 MSG merovingian[62066]: database 'decode' has crashed after start on 2017-12-29 12:30:09, attempting restart, up min/avg/max: 3m/6h/17h, crash average: 1.00 0.30 0.10 (6-3=3) 2017-12-31 08:50:02 MSG decode[94254]: arguments: /usr/bin/mserver5 --dbpath=/data/monetdb/decodeFarm/decode --set merovingian_uri=mapi:monetdb://lead:50000/decode --set mapi_open=false --set mapi_port=0 --set mapi_usock=/data/monetdb/decodeFarm/decode/.mapi.sock --set monet_vault_key=/data/monetdb/decodeFarm/decode/.vaultkey --set gdk_nr_threads=40 --set max_clients=64 --set sql_optimizer=default_pipe --set monet_daemon=yes 2017-12-31 08:50:02 ERR control[62066]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused' 2017-12-31 08:50:02 MSG merovingian[62066]: starting a proxy failed: cannot connect: Connection refused 2017-12-31 08:50:02 ERR control[62066]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused' 2017-12-31 08:50:02 MSG merovingian[62066]: starting a proxy failed: cannot connect: Connection refused 2017-12-31 08:50:02 MSG merovingian[62066]: starting a proxy failed: cannot connect: Connection refused 2017-12-31 08:50:02 ERR control[62066]: !monetdbd: an internal error has occurred 'cannot connect: Connection refused' 2017-12-31 08:50:07 ERR merovingian[62066]: client error: cannot connect: Connection refused 2017-12-31 08:50:07 ERR merovingian[62066]: client error: cannot connect: Connection refused 2017-12-31 08:50:10 MSG decode[94254]: MonetDB 5 server v11.27.11 "Jul2017-SP3" 2017-12-31 08:50:10 MSG decode[94254]: Serving database 'decode', using 40 threads 2017-12-31 08:50:10 MSG decode[94254]: Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers 2017-12-31 08:50:10 MSG decode[94254]: Found 125.800 GiB available main-memory. 2017-12-31 08:50:10 MSG decode[94254]: Copyright (c) 1993-July 2008 CWI. 2017-12-31 08:50:10 MSG decode[94254]: Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved 2017-12-31 08:50:10 MSG decode[94254]: Visit https://www.monetdb.org/ for further information 2017-12-31 08:50:10 MSG decode[94254]: Listening for UNIX domain connection requests on mapi:monetdb:///data/monetdb/decodeFarm/decode/.mapi.sock 2017-12-31 08:50:12 ERR merovingian[62066]: client error: cannot connect: Connection refused 2017-12-31 08:50:12 MSG decode[94254]: MonetDB/SQL module loaded Reproducible: Always ### Steps to Reproduce: 1.either with the same table or dropping and recreating the table. 2. run the copy into and wait. ### Actual Results: db killed (crashed) and restarted. No data loaded (0 row) ### Expected Results: data (~600 rows) loaded. ## Comment 26529 Date: 2018-06-29 11:02:20 +0200 From: @sjoerdmullender (In reply to Javier Pastorino from comment 0) > I'm loading a 600 row by 400K columns table using the copy into from > statement. After running for a while, the process abort and in the log > mentioned that the db was killed by sigkill signal. This most likely means that the system is running out of resources and the operating system decided to kill the worst offender. There is nothing we can do about a SIGKILL signal, so the only solution would be to limit the resources used during the query. 400K columns is quite extreme. Remember that all columns have to be processed at the same time for a COPY INTO, so all 400K columns have to be in memory (possibly using memory-mapped files, although if there are only 600 rows perhaps just malloced memory) so this takes up a lot of resources. You could monitor the system (e.g. using top) to see what's happening with memory (both virtual and real) during the import process.
Big table load with copy into crashes the db.
https://api.github.com/repos/MonetDB/MonetDB/issues/6505/comments
0
2020-11-30T16:23:07Z
2024-06-28T06:50:52Z
https://github.com/MonetDB/MonetDB/issues/6505
753,616,977
6,505
[ "MonetDB", "MonetDB" ]
Date: 2017-12-31 09:34:30 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: martin.van.dinther Last updated: 2018-06-29 11:06:08 +0200 ## Comment 26052 Date: 2017-12-31 09:34:30 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:57.0) Gecko/20100101 Firefox/57.0 Build Identifier: Consider a table tmp(i int) and its derivation create table tmp2 as select i,1 from tmp; Then the new label L3 (and l3) is not properly recognized as a column name. Instead it should be quoted as 'L3' Reproducible: Always ### Steps to Reproduce: create table tmp(i int); create table tmp2 as select i,1 from tmp; select l3 from tmp2; select 'L3' from tmp2; ## Comment 26380 Date: 2018-04-18 22:44:54 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; I guess you mean: select "L3" from tmp2; instead of select 'L3' from tmp2; which shows the string value 'L3' for each row in tmp2. It has L2 as column name. Character strings need single quotes in SQL, like 'text' Identifier names need double quotes in SQL, like "tmp2"."L3". You can avoid the system choosen label/name for expression columns (such as "L3") by using an alias in the query/table creation, for example: create table tmp3 as select i,1 as nr1 from tmp; select nr1 from tmp3; ## Comment 26530 Date: 2018-06-29 11:06:08 +0200 From: @sjoerdmullender As Martin vD rightly comments, the syntax of the problem query is incorrect. This works: create table tmp(i int); create table tmp2 as select i,1 from tmp; select "L3" from tmp2;
Recognize column names from derived tables
https://api.github.com/repos/MonetDB/MonetDB/issues/6504/comments
0
2020-11-30T16:23:04Z
2024-06-28T06:51:19Z
https://github.com/MonetDB/MonetDB/issues/6504
753,616,936
6,504
[ "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/6503/comments
0
2020-11-30T16:23:01Z
2020-11-30T16:23:03Z
https://github.com/MonetDB/MonetDB/issues/6503
753,616,896
6,503
[ "MonetDB", "MonetDB" ]
Date: 2017-12-20 18:34:07 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.11 (Jul2017-SP3) CC: @njnes, @drstmane Last updated: 2018-02-12 16:12:06 +0100 ## Comment 26035 Date: 2017-12-20 18:34:07 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: The query reported below returns nothing, not even an empty table. Removing one of the limit clauses fixes this issue. I will attach the sql to generate the table referenced in the query. I am aware that in this case the query could be simplified as to use only limit clause, but it might not be always the case in a different query, and maybe this is a generic issue. Hope this helps SELECT "t4jdu"."c4jdd_store_phone_number_8958366756", "t4jdu"."c4jde_line_cost__singleton__3098294", "t4jdu"."c4jdf_yyyymmdd__mean__3928221090907", "t4jdu"."c4jdg_line_price__sum__145489358291", "t4jdu"."c4jdh_month_begin_date__min__838817", "t4jdu"."c4jdi_customer_state__max__67562250", "t4jdu"."c4jdo_mode_product_family" , "t4jdu"."c4jdp_product_subcategory__unique_v" FROM ( SELECT "t4jds"."c4jdd_store_phone_number_8958366756", "t4jds"."c4jde_line_cost__singleton__3098294", "t4jds"."c4jdf_yyyymmdd__mean__3928221090907", "t4jds"."c4jdg_line_price__sum__145489358291", "t4jds"."c4jdh_month_begin_date__min__838817", "t4jds"."c4jdi_customer_state__max__67562250", "t4jds"."c4jdo_mode_product_family" , "t4jds"."c4jdp_product_subcategory__unique_v" FROM ( SELECT "t4jdq"."c4jdd_store_phone_number_8958366756", "t4jdq"."c4jde_line_cost__singleton__3098294", "t4jdq"."c4jdf_yyyymmdd__mean__3928221090907", "t4jdq"."c4jdg_line_price__sum__145489358291", "t4jdq"."c4jdh_month_begin_date__min__838817", "t4jdq"."c4jdi_customer_state__max__67562250", "t4jdr"."c4jdo_mode_product_family" , "t4jdq"."c4jdp_product_subcategory__unique_v" FROM ( SELECT "t4jdc"."c4jcu_store_phone_number" AS "c4jdd_store_phone_number_8958366756", CASE WHEN ( Count("t4jdc"."c4jd7_line_cost") = Count(*) AND Min("t4jdc"."c4jd7_line_cost") = Max("t4jdc"."c4jd7_line_cost")) THEN Min("t4jdc"."c4jd7_line_cost") END AS "c4jde_line_cost__singleton__3098294", (Avg("c4jdb_m_yyyymmdd_yyyymm") / CASE WHEN Avg("t4jdc"."c4jd3_yyyymm") = 0.0 THEN NULL ELSE Avg("t4jdc"."c4jd3_yyyymm") END) AS "c4jdf_yyyymmdd__mean__3928221090907", Sum("t4jdc"."c4jd6_line_price") AS "c4jdg_line_price__sum__145489358291", Min("t4jdc"."c4jd2_month_begin_date") AS "c4jdh_month_begin_date__min__838817", Max("t4jdc"."c4jcg_customer_state") AS "c4jdi_customer_state__max__67562250", Count(DISTINCT "t4jdc"."c4jcm_product_subcategory") AS "c4jdp_product_subcategory__unique_v" FROM ( SELECT "t4jcc"."Customer_Gender" AS "c4jcd_customer_gender" , "t4jcc"."Customer_Region" AS "c4jce_customer_region" , "t4jcc"."Customer_Country" AS "c4jcf_customer_country" , "t4jcc"."Customer_State" AS "c4jcg_customer_state" , "t4jcc"."Customer_City" AS "c4jch_customer_city" , "t4jcc"."Customer_Date_Of_Birth" AS "c4jci_customer_date_of_birth", "t4jcc"."Customer_Id" AS "c4jcj_customer_id" , "t4jcc"."Product_Family" AS "c4jck_product_family" , "t4jcc"."Product_Category" AS "c4jcl_product_category" , "t4jcc"."Product_Subcategory" AS "c4jcm_product_subcategory" , "t4jcc"."Product_Name" AS "c4jcn_product_name" , "t4jcc"."Product_Id" AS "c4jco_product_id" , "t4jcc"."Store_Id" AS "c4jcp_store_id" , "t4jcc"."Store_Longitude" AS "c4jcq_store_longitude" , "t4jcc"."Store_Latitude" AS "c4jcr_store_latitude" , "t4jcc"."Store_Name" AS "c4jcs_store_name" , "t4jcc"."Store_Manager" AS "c4jct_store_manager" , "t4jcc"."Store_Phone_Number" AS "c4jcu_store_phone_number" , "t4jcc"."Store_Region" AS "c4jcv_store_region" , "t4jcc"."Store_Country" AS "c4jcw_store_country" , "t4jcc"."Store_State" AS "c4jcx_store_state" , "t4jcc"."Store_City" AS "c4jcy_store_city" , "t4jcc"."Order_Date" AS "c4jcz_order_date" , "t4jcc"."Year_Begin_Date" AS "c4jd0_year_begin_date" , "t4jcc"."Quarter_Begin_Date" AS "c4jd1_quarter_begin_date" , "t4jcc"."Month_Begin_Date" AS "c4jd2_month_begin_date" , "t4jcc"."Yyyymm" AS "c4jd3_yyyymm" , "t4jcc"."Yyyymmdd" AS "c4jd4_yyyymmdd" , "t4jcc"."Ddmonyyyy" AS "c4jd5_ddmonyyyy" , "t4jcc"."Line_Price" AS "c4jd6_line_price" , "t4jcc"."Line_Cost" AS "c4jd7_line_cost" , "t4jcc"."Line_Margin" AS "c4jd8_line_margin" , "t4jcc"."Line_Margin_Percent" AS "c4jd9_line_margin_percent" , "t4jcc"."_visokio_row_id_" AS "c4jda__visokio_row_id_" , ("t4jcc"."Yyyymm" * "t4jcc"."Yyyymmdd") AS "c4jdb_m_yyyymmdd_yyyymm" FROM ( SELECT * FROM "lineitem_denormalized_first1k_sanitised" AS "t4jcb") AS "t4jcc") AS "t4jdc" GROUP BY "t4jdc"."c4jcu_store_phone_number") AS "t4jdq" LEFT OUTER JOIN ( SELECT "t4jdn"."c4jdj_modeg_c4jcu_store_phone_numbe", "t4jdn"."c4jdl_modec_product_family" AS "c4jdo_mode_product_family" FROM ( SELECT "t4jdc"."c4jcu_store_phone_number" AS "c4jdj_modeg_c4jcu_store_phone_numbe", "t4jdc"."c4jck_product_family" AS "c4jdl_modec_product_family" , Count(*) AS "c4jdk_mode_count" , Row_number() OVER ( partition BY "t4jdc"."c4jcu_store_phone_number" ORDER BY Count(*) DESC, "t4jdc"."c4jck_product_family" DESC) AS "c4jdm_mode_rank" FROM ( SELECT "t4jcc"."Customer_Gender" AS "c4jcd_customer_gender" , "t4jcc"."Customer_Region" AS "c4jce_customer_region" , "t4jcc"."Customer_Country" AS "c4jcf_customer_country" , "t4jcc"."Customer_State" AS "c4jcg_customer_state" , "t4jcc"."Customer_City" AS "c4jch_customer_city" , "t4jcc"."Customer_Date_Of_Birth" AS "c4jci_customer_date_of_birth", "t4jcc"."Customer_Id" AS "c4jcj_customer_id" , "t4jcc"."Product_Family" AS "c4jck_product_family" , "t4jcc"."Product_Category" AS "c4jcl_product_category" , "t4jcc"."Product_Subcategory" AS "c4jcm_product_subcategory" , "t4jcc"."Product_Name" AS "c4jcn_product_name" , "t4jcc"."Product_Id" AS "c4jco_product_id" , "t4jcc"."Store_Id" AS "c4jcp_store_id" , "t4jcc"."Store_Longitude" AS "c4jcq_store_longitude" , "t4jcc"."Store_Latitude" AS "c4jcr_store_latitude" , "t4jcc"."Store_Name" AS "c4jcs_store_name" , "t4jcc"."Store_Manager" AS "c4jct_store_manager" , "t4jcc"."Store_Phone_Number" AS "c4jcu_store_phone_number" , "t4jcc"."Store_Region" AS "c4jcv_store_region" , "t4jcc"."Store_Country" AS "c4jcw_store_country" , "t4jcc"."Store_State" AS "c4jcx_store_state" , "t4jcc"."Store_City" AS "c4jcy_store_city" , "t4jcc"."Order_Date" AS "c4jcz_order_date" , "t4jcc"."Year_Begin_Date" AS "c4jd0_year_begin_date" , "t4jcc"."Quarter_Begin_Date" AS "c4jd1_quarter_begin_date" , "t4jcc"."Month_Begin_Date" AS "c4jd2_month_begin_date" , "t4jcc"."Yyyymm" AS "c4jd3_yyyymm" , "t4jcc"."Yyyymmdd" AS "c4jd4_yyyymmdd" , "t4jcc"."Ddmonyyyy" AS "c4jd5_ddmonyyyy" , "t4jcc"."Line_Price" AS "c4jd6_line_price" , "t4jcc"."Line_Cost" AS "c4jd7_line_cost" , "t4jcc"."Line_Margin" AS "c4jd8_line_margin" , "t4jcc"."Line_Margin_Percent" AS "c4jd9_line_margin_percent" , "t4jcc"."_visokio_row_id_" AS "c4jda__visokio_row_id_" , ("t4jcc"."Yyyymm" * "t4jcc"."Yyyymmdd") AS "c4jdb_m_yyyymmdd_yyyymm" FROM ( SELECT * FROM "lineitem_denormalized_first1k_sanitised" AS "t4jcb") AS "t4jcc") AS "t4jdc" WHERE "t4jdc"."c4jck_product_family" IS NOT NULL GROUP BY "t4jdc"."c4jcu_store_phone_number", "t4jdc"."c4jck_product_family") AS "t4jdn" WHERE ( "t4jdn"."c4jdm_mode_rank" = 1 AND "t4jdn"."c4jdk_mode_count" > 1)) AS "t4jdr" ON ( "t4jdq"."c4jdd_store_phone_number_8958366756" = "t4jdr"."c4jdj_modeg_c4jcu_store_phone_numbe" OR ( "t4jdq"."c4jdd_store_phone_number_8958366756" IS NULL AND "t4jdr"."c4jdj_modeg_c4jcu_store_phone_numbe" IS NULL))) AS "t4jds" ORDER BY "c4jdd_store_phone_number_8958366756" ASC limit 1000) AS "t4jdu" limit 125000 Reproducible: Always ### Steps to Reproduce: 1. Import the table "lineitem_denormalized_first1k_sanitised" as per attachment 2. Execute the query reported in details ### Actual Results: Nothing, not even an empty result set ### Expected Results: The result of the query ## Comment 26036 Date: 2017-12-20 18:34:41 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 584 the sql to generate the table and import the records to reproduce the issue > Attached file: [lineitem_denormalized_first1k_sanitised.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6502_lineitem_denormalized_first1k_sanitised.sql_584) (application/octet-stream, 885584 bytes) > Description: the sql to generate the table and import the records to reproduce the issue ## Comment 26038 Date: 2017-12-21 11:32:33 +0100 From: @njnes what encoding does your 1k file use? its not utf8 as one expects.. ## Comment 26039 Date: 2017-12-21 11:42:20 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 585 the sql to generate the table and import the records to reproduce the issue in UTF8 Same sql file with utf-8 encoding > Attached file: [lineitem_denormalized_first1k_sanitised_monetdb.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6502_lineitem_denormalized_first1k_sanitised_monetdb.sql_585) (text/plain, 545931 bytes) > Description: the sql to generate the table and import the records to reproduce the issue in UTF8 ## Comment 26040 Date: 2017-12-21 11:43:52 +0100 From: Manuel &lt;<manuel>&gt; (In reply to Niels Nes from comment 2) > what encoding does your 1k file use? its not utf8 as one expects.. Apologies for the previous file, unfortunately when using exporting tables using windows power shell, and redirect the output to a file, something goes wrong.... I updated the a new file (for the same table) in UTF-8 thanks, Manuel ## Comment 26044 Date: 2017-12-22 11:14:07 +0100 From: @drstmane The query "returns nothing" because it crashes the server: could not find t4jds.c4jdd_store_phone_number_8958366756 t4jdu.c4jdd_store_phone_number_8958366756 t4jdu.c4jde_line_cost__singleton__3098294 t4jdu.c4jdf_yyyymmdd__mean__3928221090907 t4jdu.c4jdg_line_price__sum__145489358291 t4jdu.c4jdh_month_begin_date__min__838817 t4jdu.c4jdi_customer_state__max__67562250 t4jdu.c4jdo_mode_product_family t4jdu.c4jdp_product_subcategory__unique_v t4jdu.c4jdd_store_phone_number_8958366756 t4jdu.c4jde_line_cost__singleton__3098294 t4jdu.c4jdf_yyyymmdd__mean__3928221090907 t4jdu.c4jdg_line_price__sum__145489358291 t4jdu.c4jdh_month_begin_date__min__838817 t4jdu.c4jdi_customer_state__max__67562250 t4jdu.c4jdo_mode_product_family t4jdu.c4jdp_product_subcategory__unique_v *** Error in `mserver5': double free or corruption (!prev): 0x00007fc4c897cd50 *** Aborted (core dumped) ## Comment 26046 Date: 2017-12-23 15:13:16 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [e075b1f804db](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e075b1f804db) 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=e075b1f804db](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e075b1f804db) Changeset description: fix for bug #6502, ie use a wrapping project instead of inplace renaming. This is needed as the order by columns my refer to the projections columns, which will not work if they are inplace renamed.
Query with multiple limit clauses does not return anything
https://api.github.com/repos/MonetDB/MonetDB/issues/6502/comments
0
2020-11-30T16:22:58Z
2024-06-27T13:02:34Z
https://github.com/MonetDB/MonetDB/issues/6502
753,616,855
6,502
[ "MonetDB", "MonetDB" ]
Date: 2017-12-19 17:28:28 +0100 From: Benny Fuhry &lt;<benny.fuhry>&gt; To: Documentation maintainers &lt;<bugs-docs>&gt; Version: unspecified CC: knight4553kai, @PedroTadim Last updated: 2019-11-20 10:17:21 +0100 ## Comment 26032 Date: 2017-12-19 17:28:28 +0100 From: Benny Fuhry &lt;<benny.fuhry>&gt; User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: You provide an illustrative session to introduce the debugger features on https://www.monetdb.org/Documentation/Manuals/MonetDB/debugger/features. I started my server and connected to the server with mclient and the "-l mal" option. There, I tried to copy the individual lines of your example. However, after "end test;", I get the following error: MAPI = (monetdb) /tmp/.s.monetdb.50000 QUERY = end test; ERROR = !TypeException:user.test[4]:'bat.insert' undefined in: bat.insert(b:bat[:int], 1:int, i:int); Reproducible: Always ### Steps to Reproduce: 1. monetdbd start <path to db-farm> 2. mclient -l mal 3. Insert line by line function test(i:int):str; io.print(i); i:= i*2; b:= bat.new(:int,:int); bat.insert(b,1,i); io.print(b); return test:= "ok"; end test; ### Actual Results: MAPI = (monetdb) /tmp/.s.monetdb.50000 QUERY = end test; ERROR = !TypeException:user.test[4]:'bat.insert' undefined in: bat.insert(b:bat[:int], 1:int, i:int); ### Expected Results: No error MonetDB 5 server v11.28.0 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 62.6GiB available memory, 8 available cpu cores Libraries: 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: x (x86_64-pc-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wnested-externs -Wno-char-subscripts -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 26777 Date: 2019-01-04 10:26:13 +0100 From: @sjoerdmullender The documentation is out of date. The function should contain b:= bat.new(:int); bat.append(b,i);
MAL debugger example not executable
https://api.github.com/repos/MonetDB/MonetDB/issues/6501/comments
0
2020-11-30T16:22:54Z
2024-06-27T13:02:33Z
https://github.com/MonetDB/MonetDB/issues/6501
753,616,793
6,501
[ "MonetDB", "MonetDB" ]
Date: 2017-12-17 14:59:45 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @mlkersten, @njnes, @drstmane Last updated: 2017-12-23 15:42:07 +0100 ## Comment 26027 Date: 2017-12-17 14:59:45 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: We were validating few long length SQL and found if there are too many AND/OR operators we are getting "SELECT: too many nested operators". Not sure if there is any limitations. The same SQL will go-through other database. Reproducible: Always ### Steps to Reproduce: 1.Run the SQL with AND/OR operators 2. 3. ### Actual Results: getting error - SELECT: too many nested operators ### Expected Results: Should show the results as per the SQL ## Comment 26028 Date: 2017-12-17 18:20:35 +0100 From: @mlkersten It would be helpful to receive the example schema and query to investigate further. (No data needed) And an indication on what database is runs. This bug is already known as /BugTracker-2008/Tests/too_many_nested_operators.SF-2102167.sql since 2008 where an expression of 2000 operators was used. It indicates that the recursive descend relational optimizer is running out of heap space. Instead of returning a partial optimized plan, it is aborted, such a query is indicative to a badly formulated query. Any such query is likely to create a stress on the optimizer to find a good relational plan. ## Comment 26029 Date: 2017-12-18 06:12:46 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 582 Attachment has the sample SQL which we will be used for validation. No data provided. > Attached file: [samplesql.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6500_samplesql.zip_582) (application/x-zip-compressed, 71577 bytes) > Description: Attachment has the sample SQL which we will be used for validation. No data provided. ## Comment 26030 Date: 2017-12-18 06:13:55 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; I saw your note, is there any workaround to handle this situation? ## Comment 26031 Date: 2017-12-19 16:37:30 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; The attached scenario is valid SQL in our BI case and there are similar cases where we will have combination of numerous AND and OR combination. Also, we have enough memory available in our servers and no limitation of space too. Is there any way where we can increase THREAD_STACK_SIZE to more than 16MB? If so will it impact anywhere? if so, we can use the compiled code with mentioned change. ## Comment 26033 Date: 2017-12-20 10:04:13 +0100 From: @njnes could you also attach the schema for this sql statement? ## Comment 26034 Date: 2017-12-20 16:57:42 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 583 Attached file has the table definition. Let me know if there anything else needed. Attached file has the table definition. Let me know if there anything else needed. > Attached file: [ITEMR_DIM.txt](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6500_ITEMR_DIM.txt_583) (text/plain, 26961 bytes) > Description: Attached file has the table definition. Let me know if there anything else needed. ## Comment 26042 Date: 2017-12-21 17:45:46 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 586 I have increased stack size to 4MB and tried. I was able to run the SQL through now, however it's taking too long. Attached is the plan. Can some one comment on why it's taking too long? > Attached file: [samplesql_plan.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6500_samplesql_plan.zip_586) (application/x-zip-compressed, 105401 bytes) > Description: I have increased stack size to 4MB and tried. I was able to run the SQL through now, however it's taking too long. Attached is the plan. Can some one comment on why it's taking too long? ## Comment 26043 Date: 2017-12-22 11:08:37 +0100 From: @drstmane (a) your attached sample does not work: $ mclient samplesql.ddl operation successful $ mclient samplesql.sql syntax error, unexpected SCOLON, expecting ')' or OR in: "select sum(distinct "ITEMR_DIM".sr_493274_key) from "ITEMR_DIM" where (("ITEMR_D" without even being able to reproduce your problem, we cannot do much at all. (b) "too long" is very vague. Without any indication about the hardware used and the amount of data processed, we cannot even guess what executions times to expect ... ## Comment 26045 Date: 2017-12-22 12:19:32 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 587 Attached is updated sample SQL. Attached is updated sample SQL. System: Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 128 RAM: 3TB Disk Space: 10TB Total rowcount : 4349480 Expected Value out of SQL : 1 Let me know what other information is needed, > Attached file: [samplesql.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6500_samplesql.zip_587) (application/x-zip-compressed, 71576 bytes) > Description: Attached is updated sample SQL. ## Comment 26047 Date: 2017-12-23 15:19:49 +0100 From: @njnes The query now gives.. SELECT: no such column 'ITEMR_DIM.sr_530041_key' ## Comment 26050 Date: 2017-12-23 15:42:07 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 588 use attached. > Attached file: [samplesql.zip](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6500_samplesql.zip_588) (application/x-zip-compressed, 71569 bytes) > Description: use attached.
SELECT: too many nested operators
https://api.github.com/repos/MonetDB/MonetDB/issues/6500/comments
0
2020-11-30T15:57:51Z
2024-06-27T13:02:32Z
https://github.com/MonetDB/MonetDB/issues/6500
753,597,436
6,500
[ "MonetDB", "MonetDB" ]
Date: 2017-12-15 16:26:28 +0100 From: @swingbit To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.11 (Jul2017-SP3) CC: @njnes Last updated: 2018-02-12 16:12:15 +0100 ## Comment 26012 Date: 2017-12-15 16:26:28 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: From a schema "spinque": sql>select * from sys.functions where name='levenshtein'; +------+-------------+-------------+--------+----------+------+-------------+--------+--------+-----------+ | id | name | func | mod | language | type | side_effect | varres | vararg | schema_id | +======+=============+=============+========+==========+======+=============+========+========+===========+ | 1273 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | | 1274 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | | 1327 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | | 1328 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | | 1381 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | | 1382 | levenshtein | levenshtein | txtsim | 0 | 1 | false | false | false | 2000 | +------+-------------+-------------+--------+----------+------+-------------+--------+--------+-----------+ 6 tuples (2.607ms) sql>CREATE OR REPLACE FUNCTION levenshtein(s1 string, s2 string) RETURNS integer EXTERNAL NAME spinque."levenshtein_utf8"; <crash> This only occurs when the new function is replacing one in schema sys, not when replacing one in the same schema. Reproducible: Always $ mserver5 --version MonetDB 5 server v11.27.12 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0g 2 Nov 2017 (compiled with OpenSSL 1.1.0g-fips 2 Nov 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -O3 -fomit-frame-pointer -pipe -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code -D_FORTIFY_SOURCE=2 Linking : /usr/bin/ld -m elf_x86_64 ## Comment 26024 Date: 2017-12-17 11:30:39 +0100 From: @njnes the problem is indeed related to the schema (as these functions do not have a schema). For now we cannot allow dropping/replacing these functions. ## Comment 26025 Date: 2017-12-17 12:29:49 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [c47c58f29320](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c47c58f29320) 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=c47c58f29320](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=c47c58f29320) Changeset description: corrected fix for bug #6499, ie only disallow system functions (not all)
Crash when trying to replace a function defined in sys from a different schema
https://api.github.com/repos/MonetDB/MonetDB/issues/6499/comments
0
2020-11-30T15:57:48Z
2024-06-27T13:02:31Z
https://github.com/MonetDB/MonetDB/issues/6499
753,597,396
6,499
[ "MonetDB", "MonetDB" ]
Date: 2017-12-14 20:33:45 +0100 From: Anton Kravchenko &lt;<kravchenko.anton86>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.11 (Jul2017-SP3) Last updated: 2018-02-12 16:12:09 +0100 ## Comment 26008 Date: 2017-12-14 20:33:45 +0100 From: Anton Kravchenko &lt;<kravchenko.anton86>&gt; User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: 'select count(v_blob) from blob_table' produces a virtual memory spike ~800Gb [on the second run within same session] Reproducible: Always ### Steps to Reproduce: ### Steps to Reproduce: 1. to generate data by using Python hex_blob='47'*2000 hex_blob_chunk=(hex_blob+'\n')*1000 f=open('blob_data.txt','w') for ichunk in range(10000): f.write(hex_blob_chunk) f.close() 2. to load data into Monet blob_table create table blob_table(v_blob blob); COPY 10000000 RECORDS INTO blob_table FROM '/home/blob_data.txt' using delimiters ',','\n' NULL AS '' LOCKED; 3. select count(v_blob) from blob_table; 1st run: OK select count(v_blob) from blob_table; 2nd run: very slow [~30s] and memory spike of ~800 GB ### Actual Results: virtual memory spike of ~800GB ### Expected Results: virtual memory of ~25GB [MonetDB storage size of the blob column] MonetDB 5 server v11.27.11 "Jul2017-SP3" (64-bit, 128-bit integers) Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 503.6GiB available memory, 32 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.2l 25 May 2017) libxml2: 2.9.1 (compiled with 2.9.1) Compiled by: akravchenko@cent7-1 (x86_64-pc-linux-gnu) Compilation: gcc -O3 -fomit-frame-pointer -pipe -D_FORTIFY_SOURCE=2 Linking : /usr/bin/ld -m elf_x86_64 ## Comment 26009 Date: 2017-12-15 13:25:57 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a2f70a576335](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a2f70a576335) 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=a2f70a576335](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a2f70a576335) Changeset description: Save no_mitosis flag in query cache. This should fix bug #6498. ## Comment 26010 Date: 2017-12-15 13:30:07 +0100 From: @sjoerdmullender I couldn't really reproduce the big slow down, nor did I see the large memory spike, but I did find something that could still explain your observations. We save query plans in a cache. The first query that you did was executed and saved, the second one was retrieved from the cache, but the optimizations that happened on the first and second queries were different (after the plan was stored into / retrieved from the cache). I have now fixed this. Asuming this was indeed the problem, I'm closing this bug. Please reopen if this doesn't fix the problem. ## Comment 26014 Date: 2017-12-15 18:59:42 +0100 From: Anton Kravchenko &lt;<kravchenko.anton86>&gt; thanks Sjoerd, it works as expected now.
large virtual memory spike on BLOB column COUNT
https://api.github.com/repos/MonetDB/MonetDB/issues/6498/comments
0
2020-11-30T15:57:44Z
2024-06-27T13:02:30Z
https://github.com/MonetDB/MonetDB/issues/6498
753,597,343
6,498
[ "MonetDB", "MonetDB" ]
Date: 2017-12-13 17:36:57 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:18 +0100 ## Comment 26006 Date: 2017-12-13 17:36:57 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: A simple select query with a not between predicate is producing wrong results. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. INSERT INTO tab0 VALUES(97,1,99); 3. INSERT INTO tab0 VALUES(15,81,47); 4. INSERT INTO tab0 VALUES(87,21,10); 5. SELECT * FROM tab0 WHERE + col1 NOT BETWEEN col2 + - 99 AND + 20; ### Actual Results: +------+------+------+ | col0 | col1 | col2 | +======+======+======+ | 97 | 1 | 99 | +------+------+------+ ### Expected Results: +------+------+------+ | col0 | col1 | col2 | +======+======+======+ | 15 | 81 | 47 | | 87 | 21 | 10 | +------+------+------+ ## Comment 26007 Date: 2017-12-13 17:38:13 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [64a5f2bfdb52](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=64a5f2bfdb52) 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=64a5f2bfdb52](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=64a5f2bfdb52) Changeset description: Added test for Bug #6497 ## Comment 26011 Date: 2017-12-15 13:55:29 +0100 From: @sjoerdmullender Somehow the "NOT" gets lost: the query plans for the two queries SELECT * FROM tab0 WHERE + col1 NOT BETWEEN col2 + - 99 AND + 20; and SELECT * FROM tab0 WHERE + col1 BETWEEN col2 + - 99 AND + 20; are identical. ## Comment 26015 Date: 2017-12-16 12:00:49 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a3a06432dc17) 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=a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a3a06432dc17) Changeset description: fixes for bug #6491 (select returns null) bug #6497 (incorrect not between) bug #6490 (handle multiple columns in in in selection) fixed type checking, allowed more equal types (int with 17 bits equals one with 31 etc)
Sqlitelogictest - Select not between query producing wrong results
https://api.github.com/repos/MonetDB/MonetDB/issues/6497/comments
0
2020-11-30T15:57:41Z
2024-06-27T13:02:29Z
https://github.com/MonetDB/MonetDB/issues/6497
753,597,308
6,497
[ "MonetDB", "MonetDB" ]
Date: 2017-12-13 16:27:43 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:18 +0100 ## Comment 26002 Date: 2017-12-13 16:27:43 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: Adding a BETWEEN clause between a floating-point and a null value produces wrong results. The same behavior happens with other comparison predicates. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. INSERT INTO tab0 VALUES(0,698,169.42,'apdbu',431,316.15,'sqvis'); 3. INSERT INTO tab0 VALUES(1,538,676.36,'fuqeu',514,685.97,'bgwrq'); 4. INSERT INTO tab0 VALUES(2,90,205.26,'yrrzx',123,836.88,'kpuhc'); 5. INSERT INTO tab0 VALUES(3,620,864.8,'myrdv',877,820.98,'oxkuv'); 6. INSERT INTO tab0 VALUES(4,754,677.3,'iofrg',67,665.49,'bzqba'); 7. INSERT INTO tab0 VALUES(5,107,710.19,'lhfro',286,504.28,'kwwsg'); 8. INSERT INTO tab0 VALUES(6,904,193.16,'eozui',48,698.55,'ejyzs'); 9. INSERT INTO tab0 VALUES(7,606,650.64,'ovmce',417,962.43,'dvkbh'); 10. INSERT INTO tab0 VALUES(8,535,18.11,'ijika',630,489.63,'hpnyu'); 11. INSERT INTO tab0 VALUES(9,501,776.40,'cvygg',725,75.5,'etlyv'); 12. SELECT + - COUNT ( * ) FROM tab0 AS cor0 WHERE NOT ( - col0 ) BETWEEN - + col4 AND NULL; 13. CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER); 14. INSERT INTO tab1 VALUES(51,14,96); 15. INSERT INTO tab1 VALUES(85,5,59); 16. INSERT INTO tab1 VALUES(91,47,68); 17. SELECT ALL + COUNT ( DISTINCT 64 ) FROM tab1 AS cor0 WHERE col2 + 5 > NULL; ### Actual Results: The first query 0, the second 1 ### Expected Results: The first query -5, the second 0 ## Comment 26003 Date: 2017-12-13 16:30:12 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f3ac2786528) 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=6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f3ac2786528) Changeset description: Added tests for bugs 6494, 6495 and 6496 ## Comment 26020 Date: 2017-12-17 11:10:23 +0100 From: @njnes fixed bug in groupby_expr reduction. I do not agree on the -5, as the result of a < NULL should not return anything. ## Comment 26022 Date: 2017-12-17 11:12:29 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [ecafd37b7cb4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ecafd37b7cb4) 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=ecafd37b7cb4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ecafd37b7cb4) Changeset description: fixed bugs 6496 and 6493, don't over reduce the number of group by expressions.
Sqlitelogictest - Select interval comparisons between floating-points and NULL
https://api.github.com/repos/MonetDB/MonetDB/issues/6496/comments
0
2020-11-30T15:57:38Z
2024-06-27T13:02:28Z
https://github.com/MonetDB/MonetDB/issues/6496
753,597,279
6,496
[ "MonetDB", "MonetDB" ]
Date: 2017-12-13 16:09:40 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:04 +0100 ## Comment 26001 Date: 2017-12-13 16:09:40 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: It is not possible to omit the AS keyword in a result set column alias definition: SELECT - col4 [AS] col0 FROM tab0 WHERE NOT NULL IS NULL; Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. SELECT - col4 col0 FROM tab0 WHERE NOT NULL IS NULL; ### Actual Results: Query compilation error: syntax error, unexpected IDENT, expecting SCOLON in: "select - col4 col0" ### Expected Results: An empty result set. Yesterday I fixed this by adding the extra grammar rule in the parser, but it created 2 new shift/reduce conflicts which caused the hexadecimal_literals.Bug-3621 test to fail :( ## Comment 26005 Date: 2017-12-13 16:30:14 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f3ac2786528) 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=6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f3ac2786528) Changeset description: Added tests for bugs 6494, 6495 and 6496 ## Comment 26018 Date: 2017-12-16 13:23:18 +0100 From: @njnes the fix is correct. As now incorrect hex values gets accepted as column names (ie 0xg is value 0 with alias xg)
Sqlitelogictest - Omitting AS in a result set column alias name
https://api.github.com/repos/MonetDB/MonetDB/issues/6495/comments
0
2020-11-30T15:57:36Z
2024-06-27T13:02:26Z
https://github.com/MonetDB/MonetDB/issues/6495
753,597,241
6,495
[ "MonetDB", "MonetDB" ]
Date: 2017-12-13 15:49:24 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development Last updated: 2018-02-12 16:12:18 +0100 ## Comment 26000 Date: 2017-12-13 15:49:24 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: The algebra operators priority is not followed in this query: SELECT 85 * + 52 * 50 * ( + + 82 ) + - 78; due to lack of parenthesis over +52 Reproducible: Always ### Steps to Reproduce: 1. SELECT 85 * + 52 * 50 * ( + + 82 ) + - 78; ### Actual Results: -62 ### Expected Results: 18121922 Removing the first plus sign gives the right result: SELECT 85 * 52 * 50 * ( + + 82 ) + - 78; ## Comment 26004 Date: 2017-12-13 16:30:13 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6f3ac2786528) 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=6f3ac2786528](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6f3ac2786528) Changeset description: Added tests for bugs 6494, 6495 and 6496 ## Comment 26013 Date: 2017-12-15 16:38:06 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [b35a861df01d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b35a861df01d) 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=b35a861df01d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b35a861df01d) Changeset description: Use "largest" type as result type in atom_{add,sub,mul}. This fixes bug #6494.
Sqlitelogictest - Algebra operators priority in select query
https://api.github.com/repos/MonetDB/MonetDB/issues/6494/comments
0
2020-11-30T15:57:33Z
2024-06-27T13:02:25Z
https://github.com/MonetDB/MonetDB/issues/6494
753,597,202
6,494
[ "MonetDB", "MonetDB" ]
Date: 2017-12-13 11:34:54 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:14 +0100 ## Comment 25998 Date: 2017-12-13 11:34:54 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: Doing a minimum aggregation query with a distinct clause on a constant from an empty table should return NULL instead of the constant. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. SELECT - MIN ( DISTINCT + 79 ) FROM tab0 AS cor0 WHERE NOT + col4 IS NOT NULL; ### Actual Results: -79 ### Expected Results: NULL ## Comment 25999 Date: 2017-12-13 12:07:40 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [743945dfef8d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=743945dfef8d) 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=743945dfef8d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=743945dfef8d) Changeset description: Added test for Bug #6493 ## Comment 26021 Date: 2017-12-17 11:11:16 +0100 From: @njnes fixed with same fix as for bug #6496, ie don't over reduce the groupby list ## Comment 26023 Date: 2017-12-17 11:12:30 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [ecafd37b7cb4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ecafd37b7cb4) 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=ecafd37b7cb4](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ecafd37b7cb4) Changeset description: fixed bugs 6496 and 6493, don't over reduce the number of group by expressions.
Sqlitelogictest - Aggregation query on empty table with DISTINCT clause
https://api.github.com/repos/MonetDB/MonetDB/issues/6493/comments
0
2020-11-30T15:57:29Z
2024-06-27T13:02:24Z
https://github.com/MonetDB/MonetDB/issues/6493
753,597,149
6,493
[ "MonetDB", "MonetDB" ]
Date: 2017-12-11 16:36:48 +0100 From: @swingbit To: GDK devs &lt;<bugs-common>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-02-12 16:12:05 +0100 ## Comment 25982 Date: 2017-12-11 16:36:48 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: Source code compiled with define PERSISTENTHASH 1 undef DISABLE_PARENT_HASH Working on this table (any table with many strings will do) sql>\d bva_obj_dict CREATE TABLE "spinque"."bva_obj_dict" ( "id" INTEGER NOT NULL, "idstr" CHARACTER LARGE OBJECT NOT NULL, "prob" FLOAT(51) NOT NULL ); Moreover, the table is marked as READ ONLY. sql>select * from storage where "table"='bva_obj_dict' and column='idstr'; +---------+--------------+--------+------+----------+----------+----------+-----------+------------+-----------+--------+-------+----------+--------+-----------+--------+----------+ | schema | table | column | type | mode | location | count | typewidth | columnsize | heapsize | hashes | phash | imprints | sorted | revsorted | unique | orderidx | +=========+==============+========+======+==========+==========+==========+===========+============+===========+========+=======+==========+========+===========+========+==========+ | spinque | bva_obj_dict | idstr | clob | readonly | 12/1271 | 14414658 | 58 | 57658632 | 464470386 | 0 | false | 0 | false | false | null | 0 | +---------+--------------+--------+------+----------+----------+----------+-----------+------------+-----------+--------+-------+----------+--------+-----------+--------+----------+ If I run: SELECT * from bva_obj_dict where idstr = 'something'; this creates a hash for column idstr. It takes 8 seconds, and here I can see my hash: sql>select * from storage where "table"='bva_obj_dict' and column='idstr'; +---------+--------------+--------+------+----------+----------+----------+-----------+------------+-----------+-----------+-------+----------+--------+-----------+--------+----------+ | schema | table | column | type | mode | location | count | typewidth | columnsize | heapsize | hashes | phash | imprints | sorted | revsorted | unique | orderidx | +=========+==============+========+======+==========+==========+==========+===========+============+===========+===========+=======+==========+========+===========+========+==========+ | spinque | bva_obj_dict | idstr | clob | readonly | 12/1271 | 14414658 | 58 | 57658632 | 464470386 | 124780584 | false | 0 | false | false | null | 0 | +---------+--------------+--------+------+----------+----------+----------+-----------+------------+-----------+-----------+-------+----------+--------+-----------+--------+----------+ However, this hash is not persistent and is gone after a few seconds. The issue is that it should have been persistent, as I compiled with PERSISTENDHASH = 1 (and I'm not even working on a view). I followed the hash creation with gdb, it actually DOES get into BAThashsync and persist it. I can even see the file on my filesystem: $ ll bat/12/1271* -rw-------. 1 roberto roberto 57671680 Nov 12 12:39 bat/12/1271.tail -rw-------. 1 roberto roberto 124846080 Dec 11 16:27 bat/12/1271.thash -rw-------. 1 roberto roberto 464846848 Dec 11 15:45 bat/12/1271.theap However it seems to be forgotten. Next time the hash is needed, it is recreated and persisted again. Side-question: why is the modification time of the heap so recent? That table has been created on Nov 12, made READ ONLY and never modified again. Can the heap file have been modified? Reproducible: Always $ mserver5 --version MonetDB 5 server v11.27.12 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0g 2 Nov 2017 (compiled with OpenSSL 1.1.0g-fips 2 Nov 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25983 Date: 2017-12-11 16:38:40 +0100 From: @swingbit And, for what is worth, this is with sequential_pipe ## Comment 25984 Date: 2017-12-11 20:59:19 +0100 From: @swingbit The same thing happens with ORDERED INDEX. I create an index, it shows in storage (its size), and after a few seconds it's gone. ## Comment 25985 Date: 2017-12-11 21:12:54 +0100 From: @swingbit Correction. It is not "after a few seconds", but when the mclient session is closed. sql>\d x CREATE TABLE "sys"."x" ( "idstr" CHARACTER LARGE OBJECT, CONSTRAINT "x_idstr_unique" UNIQUE ("idstr") ); sql>select column,"unique",orderidx from storage where "table"='x' and column='idstr'; +--------+--------+----------+ | column | unique | orderidx | +========+========+==========+ | idstr | null | 0 | +--------+--------+----------+ 1 tuple (7.360ms) sql>create ordered index idx on x(idstr); operation successful (230.850ms) sql>select column,"unique",orderidx from storage where "table"='x' and column='idstr'; +--------+--------+----------+ | column | unique | orderidx | +========+========+==========+ | idstr | null | 3177888 | +--------+--------+----------+ 1 tuple (12.909ms) sql>select column,"unique",orderidx from storage where "table"='x' and column='idstr'; +--------+--------+----------+ | column | unique | orderidx | +========+========+==========+ | idstr | null | 3177888 | +--------+--------+----------+ 1 tuple (10.924ms) $ mclient ... Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.12 (unreleased), 'mapi:monetdb://photon.hq.spinque.com:55500/pacombi01' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select column,"unique",orderidx from storage where "table"='x' and column='idstr'; +--------+--------+----------+ | column | unique | orderidx | +========+========+==========+ | idstr | null | 0 | +--------+--------+----------+ 1 tuple (15.250ms) sql> Also: why is column "unique" from storage always null (even after running ANALYZE), give that this column has UNIQUE CONSTRAINT? ## Comment 25987 Date: 2017-12-12 10:07:31 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 0) > Side-question: why is the modification time of the heap so recent? That > table has been created on Nov 12, made READ ONLY and never modified again. > Can the heap file have been modified? When the server starts up, it has no way of knowing in what state the database was left when the previous session ended. When you were to append data to a table, the SQL layer might well append the data to the bats and also write in the write-ahead log. If that transaction was never finished due to a crash, the bat was appended to, but the count remained as it was. For fixed-sized data types that's totally fine. For variable-sized data, the offset heap is also fine, but the data heap may have been changed in a way that is not consistent with the bat size. In particular, in string heaps, the hash table at the start of the string heap may have been modified. So at startup, the variable-sized heaps are repaired (a fairly simple operation). This involves rewriting the hash table. In your case, the repair code recognizes that nothing was in fact modified (the newly created hash table is identical to what it was), so it doesn't explicitly write the changes back to disk. However, since the heap is most likely memory-mapped and the repair code did rewrite the hash table, the OS does write the hash table back. This causes the update in the modification time. ## Comment 25988 Date: 2017-12-12 10:19:28 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 3) > Correction. It is not "after a few seconds", but when the mclient session is > closed. > > sql>\d x > CREATE TABLE "sys"."x" ( > "idstr" CHARACTER LARGE OBJECT, > CONSTRAINT "x_idstr_unique" UNIQUE ("idstr") > ); > > sql>select column,"unique",orderidx from storage where "table"='x' and > column='idstr'; > +--------+--------+----------+ > | column | unique | orderidx | > +========+========+==========+ > | idstr | null | 0 | > +--------+--------+----------+ > 1 tuple (7.360ms) > sql>create ordered index idx on x(idstr); > operation successful (230.850ms) > > sql>select column,"unique",orderidx from storage where "table"='x' and > column='idstr'; > +--------+--------+----------+ > | column | unique | orderidx | > +========+========+==========+ > | idstr | null | 3177888 | > +--------+--------+----------+ > 1 tuple (12.909ms) > > sql>select column,"unique",orderidx from storage where "table"='x' and > column='idstr'; > +--------+--------+----------+ > | column | unique | orderidx | > +========+========+==========+ > | idstr | null | 3177888 | > +--------+--------+----------+ > 1 tuple (10.924ms) > > $ mclient ... > > Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) > Database: MonetDB v11.27.12 (unreleased), > 'mapi:monetdb://photon.hq.spinque.com:55500/pacombi01' > Type \q to quit, \? for a list of available commands > auto commit mode: on > sql>select column,"unique",orderidx from storage where "table"='x' and > column='idstr'; > +--------+--------+----------+ > | column | unique | orderidx | > +========+========+==========+ > | idstr | null | 0 | > +--------+--------+----------+ > 1 tuple (15.250ms) > sql> > > > > Also: why is column "unique" from storage always null (even after running > ANALYZE), give that this column has UNIQUE CONSTRAINT? This may well be a red herring. After client disconnect, the bats are most likely unloaded, including the index heaps. When you then ask about this information again, the server doesn't see a loaded index heap, so it doesn't report a size for it. However, when the server (GDK layer) actually wants to use the ordered index, it checks for its existence and loads it if it is (still) valid. Try a point select. After this, when you look in sys.storage you'll find the ordered index again. By the way, you can also use sys.storage('sys','bva_obj_dict', 'idstr'). The UNIQUE constraint doesn't say anything about NULL: you can still have multiple NULLs in the column, so the UNIQUE constraint doesn't map to the key property (called unique by sys.storage). The key property reflects the knowledge the GDK layer has about the uniqueness of the column, and in this case, it just doesn't know anything yet. ## Comment 25989 Date: 2017-12-12 10:49:29 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [394dbcf8bb99](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=394dbcf8bb99) 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=394dbcf8bb99](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=394dbcf8bb99) Changeset description: Don't ignore persisted hash tables. This fixes bug #6492. ## Comment 25991 Date: 2017-12-12 11:25:40 +0100 From: @swingbit Hi Sjoerd, About the persistent hash: thanks for the fix. About the ordered index: I had the impression it was related to the persistent hash issue, but apparently I was wrong. Thanks for the explanation, I see why it happens. I would argue it is still something to fix because the catalogue not reflecting the actual state of the db can be very confusing. Especially because \d tells you that an ordered index exists, while the catalogue says the opposite. But the index works indeed, so it is definitely lower priority than I had thought. About the unique column in the storage table: you are right that there was no NOT NULL constraint. However, even with both UNIQUE and NOT NULL constraints, and after running ANALYZE, the "unique" column in storage still shows null. Another non-critical but to-be-fixed point? As a side note, I actually wasn't sure how NULLs would be treated with a UNIQUE constraint. MonetDB allows them through, following the principle that two NULLs are not equal. That is, as far as I understand the behaviour described in SQL standard. Other vendors, including Microsoft and Oracle, follow this principle in most operations, but not in the unique constraint, allowing at most one NULL. That is pretty ugly and confusing - I'm glad MonetDB cares about consistency. ## Comment 25992 Date: 2017-12-12 11:26:28 +0100 From: @swingbit Oh and thanks for the detailed explanation about the heap file modification time. ## Comment 25993 Date: 2017-12-12 14:45:09 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 8) > Oh and thanks for the detailed explanation about the heap file modification > time. That's also fixed. ## Comment 25994 Date: 2017-12-12 14:59:47 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 7) > Hi Sjoerd, > > About the persistent hash: thanks for the fix. > > About the ordered index: I had the impression it was related to the > persistent hash issue, but apparently I was wrong. Thanks for the > explanation, I see why it happens. I would argue it is still something to > fix because the catalogue not reflecting the actual state of the db can be > very confusing. Especially because \d tells you that an ordered index > exists, while the catalogue says the opposite. But the index works indeed, > so it is definitely lower priority than I had thought. Now that ordered indexes are (also) created in other cases than just when you use CREATE ORDERED INDEX, and also since they are dropped when the column changes, the \d doesn't reflect whether an ordered index actually exists. We should probably recreate the index after the column was modified if it was created using the CREATE ORDERED INDEX statement. It would be nice if sys.storage would at least acknoledge the indexes when they're not yet loaded. The question is, should it check whether the unloaded indexes are actually valid (that happens when we want to use it)? > About the unique column in the storage table: you are right that there was > no NOT NULL constraint. However, even with both UNIQUE and NOT NULL > constraints, and after running ANALYZE, the "unique" column in storage still > shows null. Another non-critical but to-be-fixed point? Even when UNIQUE and NOT NULL are both in effect, there can *still* be duplicate values in the BAT. Namely ones of which all duplicates were deleted at the SQL level (but not at the BAT level since we don't delete). > As a side note, I actually wasn't sure how NULLs would be treated with a > UNIQUE constraint. MonetDB allows them through, following the principle that > two NULLs are not equal. That is, as far as I understand the behaviour > described in SQL standard. Other vendors, including Microsoft and Oracle, > follow this principle in most operations, but not in the unique constraint, > allowing at most one NULL. That is pretty ugly and confusing - I'm glad > MonetDB cares about consistency. Anyway, I'm closing this.
Persistent hashes stored and then ignored. Storage info not in sync with actual indices.
https://api.github.com/repos/MonetDB/MonetDB/issues/6492/comments
0
2020-11-30T15:57:25Z
2024-06-27T13:02:23Z
https://github.com/MonetDB/MonetDB/issues/6492
753,597,078
6,492
[ "MonetDB", "MonetDB" ]
Date: 2017-12-11 15:54:04 +0100 From: @joerivanruth To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:07 +0100 ## Comment 25981 Date: 2017-12-11 15:54:04 +0100 From: @joerivanruth User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:58.0) Gecko/20100101 Firefox/58.0 Build Identifier: This happens on the Jul2017_SP3 release candidate and also on default. Reproducible: Always ### Steps to Reproduce: CREATE TABLE t(i INT); INSERT INTO t VALUES (1), (2), (3); SELECT 1 IN (SELECT i FROM t); -- expect true SELECT 4 IN (SELECT i FROM t); -- expect false, got null ### Actual Results: +-------+ | L5 | +=======+ | true | +-------+ +-------+ | L5 | +=======+ | null | +-------+ ### Expected Results: +-------+ | L5 | +=======+ | true | +-------+ +-------+ | L5 | +=======+ | false | +-------+ ## Comment 26017 Date: 2017-12-16 12:00:51 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a3a06432dc17) 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=a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a3a06432dc17) Changeset description: fixes for bug #6491 (select returns null) bug #6497 (incorrect not between) bug #6490 (handle multiple columns in in in selection) fixed type checking, allowed more equal types (int with 17 bits equals one with 31 etc)
SELECT IN returns NULL instead of false when not found
https://api.github.com/repos/MonetDB/MonetDB/issues/6491/comments
0
2020-11-30T15:57:22Z
2024-06-27T13:02:22Z
https://github.com/MonetDB/MonetDB/issues/6491
753,597,043
6,491
[ "MonetDB", "MonetDB" ]
Date: 2017-12-11 12:10:15 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:10 +0100 ## Comment 25979 Date: 2017-12-11 12:10:15 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: In a select query with an IN clause, it seems that it is not possible to provide a table a column there. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. SELECT ALL * FROM tab0 AS cor0 WHERE NOT CAST ( NULL AS INTEGER ) NOT IN ( col3 / col1 ); ### Actual Results: Parse error: SELECT: identifier 'col3' unknown ### Expected Results: An empty result set. ## Comment 25980 Date: 2017-12-11 12:15:35 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [68357599b75f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=68357599b75f) 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=68357599b75f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=68357599b75f) Changeset description: Added test for Bug #6490 ## Comment 25986 Date: 2017-12-12 07:42:05 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d141a1e54895](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d141a1e54895) 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=d141a1e54895](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d141a1e54895) Changeset description: fix bug #6490, ie add missing 'in' function and handeling ## Comment 25990 Date: 2017-12-12 11:01:59 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [f0b359491fbd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f0b359491fbd) 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=f0b359491fbd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=f0b359491fbd) Changeset description: Added queries related to bug #6490 still failing ## Comment 26016 Date: 2017-12-16 12:00:50 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a3a06432dc17) 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=a3a06432dc17](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a3a06432dc17) Changeset description: fixes for bug #6491 (select returns null) bug #6497 (incorrect not between) bug #6490 (handle multiple columns in in in selection) fixed type checking, allowed more equal types (int with 17 bits equals one with 31 etc)
Sqlitelogictest - Select query with an IN clause parse error
https://api.github.com/repos/MonetDB/MonetDB/issues/6490/comments
0
2020-11-30T15:57:18Z
2024-06-27T13:02:21Z
https://github.com/MonetDB/MonetDB/issues/6490
753,596,992
6,490
[ "MonetDB", "MonetDB" ]
Date: 2017-12-08 15:46:05 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2018-02-12 16:12:10 +0100 ## Comment 25972 Date: 2017-12-08 15:46:05 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: The server outputs a wrong result set for a complex select query in one of the SQLitelogictests. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. INSERT INTO tab0 VALUES(0,12,15.70,'jrjqj',55,64.9,'mcxlo'); 3. INSERT INTO tab0 VALUES(1,30,85.9,'qevld',61,28.45,'ptqcc'); 4. INSERT INTO tab0 VALUES(2,59,33.53,'zcima',67,27.7,'tlkbd'); 5. INSERT INTO tab0 VALUES(3,43,43.70,'xhixm',20,57.7,'bgrne'); 6. INSERT INTO tab0 VALUES(4,26,22.50,'iqtqt',59,29.40,'fndas'); 7. INSERT INTO tab0 VALUES(5,46,69.20,'wmnog',35,16.96,'caknv'); 8. INSERT INTO tab0 VALUES(6,70,25.58,'unfoi',21,31.68,'kylow'); 9. INSERT INTO tab0 VALUES(7,83,53.2,'lasra',26,63.67,'hfklb'); 10. INSERT INTO tab0 VALUES(8,21,87.65,'zbwej',8,82.36,'cmega'); 11. INSERT INTO tab0 VALUES(9,65,98.48,'ylwvi',83,60.61,'shwdq'); 12. SELECT pk FROM tab0 WHERE ((col0 IS NULL OR (col0 < 19) OR (((col0 > 86))) OR col4 < 33.55 OR (col1 <= 97.79) AND col0 > 23 AND col0 IN (33,7,60,65,32)) AND (col1 IS NULL)) OR (((((col4 IS NULL)))) AND col0 >= 37 OR ((col0 >= 16 OR col0 > 84 AND (col1 >= 7.8)))) AND (((col1 IN (SELECT col4 FROM tab0 WHERE col1 >= 29.15)) OR col1 > 78.13)); ### Actual Results: A result set with the integers 2 and 9 ### Expected Results: A result set with the integers 1, 8 and 9 I am also debugging it :) ## Comment 25973 Date: 2017-12-08 16:11:42 +0100 From: @PedroTadim Sorry! Wrong query! This is the one failing: SELECT pk FROM tab0 WHERE ((col4 <= 58.66) AND ((col0 >= 55 OR col0 <= 94 AND (col0 BETWEEN 44 AND 80) OR (((col0 > 49 OR col1 >= 40.18 OR col3 > 40 AND col4 > 46.95 OR col3 IN (42,45,3,49,42,64) AND col0 <= 92 AND (col3 > 56) AND col0 > 43) OR col4 IS NULL) OR col0 IN (86) OR (col4 > 47.25) OR col3 IS NULL AND (col1 < 50.52) AND (col4 > 10.91) OR (col0 IS NULL) AND (col1 < 99.56 AND (col0 IS NULL) AND col3 > 95 OR (((col0 IS NULL)))) AND (col0 < 82) AND ((col0 > 17)) AND (col0 = 84 OR col4 = 38.74) OR ((col3 = 47) AND col0 IN (6,40,51,32,45,87) OR (col1 <= 55.60) AND (col4 = 73.84) OR ((col0 < 52 AND (col1 > 88.42) AND (((col3 > 66) OR col3 > 73)) OR (((((((col3 > 97)) AND (col3 >= 53)) OR col1 < 70.80))) AND col0 > 35) AND ((col3 = 42) AND (col3 <= 87) OR (col3 < 54) AND (((col0 > 21 AND col4 = 51.35) AND (col3 = 53)) OR col1 >= 30.64)) AND (col1 IN (SELECT col4 FROM tab0 WHERE col0 >= 9)) AND (col0 >= 78)))) AND col4 IN (SELECT col1 FROM tab0 WHERE (col1 < 44.79))) AND ((((col0 < 14)) OR col0 IN (SELECT col3 FROM tab0 WHERE col1 > 62.61) AND ((((col0 > 6)))))))) OR (col1 < 82.4 AND (((col3 <= 65 OR col0 < 44 AND col3 <= 79 OR (((col1 = 61.10 AND (col3 > 7))) OR col0 = 78)) AND col0 = 30))) OR col0 > 83) OR (col0 > 52) OR col4 BETWEEN 59.77 AND 33.71 AND col0 >= 11 ### Actual Results: A result set with the integers: 2 3 6 7 9 ### Expected Results: A result set with the integers: 2 5 6 7 9 Maybe is related to floating-point comparisons. ## Comment 25978 Date: 2017-12-10 17:52:29 +0100 From: @njnes seems to work just fine
Sqlitelogictest - Wrong result set of complex conditional query
https://api.github.com/repos/MonetDB/MonetDB/issues/6489/comments
0
2020-11-30T15:57:14Z
2024-06-27T13:02:20Z
https://github.com/MonetDB/MonetDB/issues/6489
753,596,942
6,489
[ "MonetDB", "MonetDB" ]
Date: 2017-12-08 15:22:46 +0100 From: @swingbit To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-02-12 16:12:05 +0100 ## Comment 25971 Date: 2017-12-08 15:22:46 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: -- Just to be sure we can't blame mitosis set optimizer='sequential_pipe'; -- Sequence of integers from 1 to 2050 create table dict as select value from generate_series(cast(1 as int), cast(2050 as int)) with data; create table t (i int); insert into t values (2),(2); -- This should return 1 tuple, with value 2 select * from dict where value in (select i from t); +-------+ | value | +=======+ | 2 | | 2 | +-------+ 2 tuples (1.443ms) Obviously (for how it was created) dict contains only one 2: select * from dict where value = 2; +-------+ | value | +=======+ | 2 | +-------+ 1 tuple (1.443ms) Interesting notes: - If I generate the sequence with 2049 integers or less, I get the correct result - The problem is not in how the sequence is generated. The error popped up in a different way. Reproducible: Always $ mserver5 --ver MonetDB 5 server v11.27.10 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0g 2 Nov 2017 (compiled with OpenSSL 1.1.0g-fips 2 Nov 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25974 Date: 2017-12-08 16:16:44 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [6af80c755cc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6af80c755cc6) 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=6af80c755cc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6af80c755cc6) Changeset description: Don't use fetchjoin implementation for semijoin. This fixes bug #6488.
Semijoin returns duplicate values from a column with unique values
https://api.github.com/repos/MonetDB/MonetDB/issues/6488/comments
0
2020-11-30T15:57:11Z
2024-06-27T13:02:19Z
https://github.com/MonetDB/MonetDB/issues/6488
753,596,900
6,488
[ "MonetDB", "MonetDB" ]
Date: 2017-12-08 11:43:10 +0100 From: @hannesmuehleisen To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2018-02-12 16:12:04 +0100 ## Comment 25968 Date: 2017-12-08 11:43:10 +0100 From: @hannesmuehleisen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36 Build Identifier: CREATE TABLE g AS SELECT NULL AS j UNION ALL SELECT NULL AS j UNION ALL SELECT 'asdf' AS j WITH DATA; worked fine with previous releases, fails now: types char(4,0) and smallint(16,0) are not equal for column 'j' Reproducible: Always ### Actual Results: This should work fine as it did before. ## Comment 25969 Date: 2017-12-08 11:43:58 +0100 From: @hannesmuehleisen Clarification: Fails with SP3 Release Candidate branch ## Comment 25970 Date: 2017-12-08 14:39:42 +0100 From: @hannesmuehleisen IMHO this is due to the first UNION of NULLs creating a smallint type (sql_semantic.c, function supertype). Then, under strict coercion rules, strings cannot be UNIONed with this. ## Comment 25975 Date: 2017-12-08 16:54:23 +0100 From: @sjoerdmullender Jul2017-SP1: works, Jul2017-SP2: fails. ## Comment 25976 Date: 2017-12-08 17:02:14 +0100 From: @sjoerdmullender Bisect says, the culprit is changeset [b7681c154e83](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b7681c154e83) "reimplemented IN/NOT IN. Fixed bug #6411". ## Comment 26019 Date: 2017-12-16 18:13:00 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [bc4e4730f58d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bc4e4730f58d) 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=bc4e4730f58d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=bc4e4730f58d) Changeset description: fixed bug #6487, ie handle union all null properly
UNION of NULLs with several tables fails
https://api.github.com/repos/MonetDB/MonetDB/issues/6487/comments
0
2020-11-30T15:57:08Z
2024-06-27T13:02:18Z
https://github.com/MonetDB/MonetDB/issues/6487
753,596,860
6,487
[ "MonetDB", "MonetDB" ]
Date: 2017-12-06 21:46:30 +0100 From: @swingbit To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: bradley2844maximus, martin.van.dinther, @drstmane Last updated: 2019-11-20 10:13:12 +0100 ## Comment 25961 Date: 2017-12-06 21:46:30 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: sql>create table a(i int); operation successful (5.294ms) sql>insert into a values (1),(2); 2 affected rows (3.232ms) sql>select * from a; +------+ | i | +======+ | 1 | | 2 | +------+ 2 tuples (1.266ms) sql>create temporary table b as select * from a with data; operation successful (12.143ms) sql>select * from b; +---+ | i | +===+ +---+ 0 tuples (1.303ms) sql>drop table b; operation successful (4.106ms) sql>create temporary table b(i int); operation successful (4.594ms) sql>insert into b values (1),(2); 2 affected rows (3.194ms) sql>select * from b; +---+ | i | +===+ +---+ 0 tuples (1.097ms) Reproducible: Always ### Actual Results: $ mserver5 --version MonetDB 5 server v11.27.10 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0g 2 Nov 2017 (compiled with OpenSSL 1.1.0g-fips 2 Nov 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25962 Date: 2017-12-06 22:03:29 +0100 From: @drstmane Updates on temporary tables are only visible during the very same transaction they happen in; in auto-commit mode, the transaction last only for the update statement itself; hence, you need to wrap the update and select into an explicit transaction: ======== $ cat /tmp/x.sql -------- create table a(i int); insert into a values (1),(2); select * from a; create temporary table b as select * from a with data; select * from b; drop table b; create temporary table b(i int); insert into b values (1),(2); select * from b; drop table b; start transaction; create temporary table b as select * from a with data; select * from b; drop table b; create temporary table b(i int); insert into b values (1),(2); select * from b; drop table b; commit; create temporary table b(i int); start transaction; insert into b values (1),(2); select * from b; commit; select * from b; drop table b; drop table a; ======== $ mclient -i -e /tmp/x.sql -------- create table a(i int); operation successful (14.747ms) insert into a values (1),(2); 2 affected rows (9.762ms) select * from a; +------+ | i | +======+ | 1 | | 2 | +------+ 2 tuples (1.359ms) create temporary table b as select * from a with data; operation successful (17.446ms) select * from b; +---+ | i | +===+ +---+ 0 tuples (2.509ms) drop table b; operation successful (5.375ms) create temporary table b(i int); operation successful (5.865ms) insert into b values (1),(2); 2 affected rows (4.132ms) select * from b; +---+ | i | +===+ +---+ 0 tuples (1.095ms) drop table b; operation successful (4.145ms) start transaction; auto commit mode: off create temporary table b as select * from a with data; operation successful (0.945ms) select * from b; +------+ | i | +======+ | 1 | | 2 | +------+ 2 tuples (0.913ms) drop table b; operation successful (1.270ms) create temporary table b(i int); operation successful (0.703ms) insert into b values (1),(2); 2 affected rows (0.802ms) select * from b; +------+ | i | +======+ | 1 | | 2 | +------+ 2 tuples (1.120ms) drop table b; operation successful (1.437ms) commit; auto commit mode: on create temporary table b(i int); operation successful (7.131ms) start transaction; auto commit mode: off insert into b values (1),(2); 2 affected rows (2.684ms) select * from b; +------+ | i | +======+ | 1 | | 2 | +------+ 2 tuples (2.988ms) commit; auto commit mode: on select * from b; +---+ | i | +===+ +---+ 0 tuples (4.322ms) drop table b; operation successful (11.201ms) drop table a; operation successful (4.562ms) ======== ## Comment 25963 Date: 2017-12-06 22:24:41 +0100 From: @swingbit Oops. My bad. ## Comment 25965 Date: 2017-12-07 09:59:08 +0100 From: @sjoerdmullender I think we can agree on the invalidity of this issue. ## Comment 25967 Date: 2017-12-07 14:08:07 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; Use the option ON COMMIT PRESERVE ROWS to retain the inserted rows after (auto-)commit; So use: create temporary table b as select * from a with data ON COMMIT PRESERVE ROWS; select * from b; or create temporary table c (i int) ON COMMIT PRESERVE ROWS; insert into c select i from a; select * from c; See https://www.monetdb.org/Documentation/Manuals/SQLreference/Tables Similar bug: https://www.monetdb.org/bugzilla/show_bug.cgi?id=3600
Temporary tables don't store any data
https://api.github.com/repos/MonetDB/MonetDB/issues/6486/comments
0
2020-11-30T15:57:04Z
2024-06-28T06:51:53Z
https://github.com/MonetDB/MonetDB/issues/6486
753,596,805
6,486
[ "MonetDB", "MonetDB" ]
Date: 2017-12-06 16:28:54 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2018-01-10 10:30:13 +0100 ## Comment 25951 Date: 2017-12-06 16:28:54 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: I am using monetdb to run some quite complex queries. I am having troubles with monetdb crashing in many cases. I will attach the sql for the example dataset and some queries that will make it crash. I am running on a modestly powerful machine. Monetdb is running on its own dedicated ssd drive, with plenty of space, and 32 gb ram. These are just some examples of queries raising this issues. Any suggestion of what the cause may be ? Thanks, Manuel Reproducible: Always ### Steps to Reproduce: 1. Import the table lineitem_denormalized_first1k (file li.sql) 2. Execute the the queries contained in the file query_x.sql 3. Run the query multiple times if needed. ### Actual Results: Monetdb crashes I can generate other queries if needed ## Comment 25952 Date: 2017-12-06 16:29:25 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 576 file containing schema definition + records > Attached file: [li.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_li.sql_576) (text/plain, 535900 bytes) > Description: file containing schema definition + records ## Comment 25953 Date: 2017-12-06 16:29:47 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 577 query 0 > Attached file: [query_0.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_query_0.sql_577) (text/plain, 113810 bytes) > Description: query 0 ## Comment 25954 Date: 2017-12-06 16:30:04 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 578 query 1 > Attached file: [query_1.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_query_1.sql_578) (text/plain, 74081 bytes) > Description: query 1 ## Comment 25955 Date: 2017-12-06 16:30:33 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 579 query3 > Attached file: [query_3.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_query_3.sql_579) (text/plain, 3548 bytes) > Description: query3 ## Comment 25956 Date: 2017-12-06 16:30:52 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 580 query 4 > Attached file: [query_4.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_query_4.sql_580) (text/plain, 4482 bytes) > Description: query 4 ## Comment 25957 Date: 2017-12-06 16:31:28 +0100 From: Manuel &lt;<manuel>&gt; Created attachment 581 query 2 > Attached file: [query_2.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6485_query_2.sql_581) (text/plain, 64627 bytes) > Description: query 2 ## Comment 25958 Date: 2017-12-06 16:43:34 +0100 From: @njnes running this (multiple times) on the 2017 branch doesn't crash on my even smaller laptop. Maybe you have some more input (info) of when/how this crashes (what you see happening) ## Comment 25959 Date: 2017-12-06 16:44:37 +0100 From: @njnes your running on window. My test sofar was on linux. ## Comment 25960 Date: 2017-12-06 16:51:33 +0100 From: Manuel &lt;<manuel>&gt; (In reply to Niels Nes from comment 8) > your running on window. My test sofar was on linux. Yes I have done these tests on Windows. However I had similar issues on Linux (with possibly slightly different queries). I am running version v11.27.9, and I simply execute the queries via a simple jdbc based client called Squirrel(http://squirrel-sql.sourceforge.net/) configured with the latest version of the jdbc driver. This is what I see in the console Error: Connection reset (mserver5 still alive?) SQLState: 08006 ErrorCode: 0 ## Comment 26048 Date: 2017-12-23 15:22:16 +0100 From: @njnes could you give us the queries which crash on Linux. Also on windows could you see if the mserver5 is running low on memory? ## Comment 26065 Date: 2018-01-10 10:30:13 +0100 From: Manuel &lt;<manuel>&gt; The issue is not reproducible with monetdb version 11.27.11 (not available at the time of writing). Thanks, Manuel
Monetdb crashes on order by after union
https://api.github.com/repos/MonetDB/MonetDB/issues/6485/comments
0
2020-11-30T15:57:00Z
2024-06-27T13:02:16Z
https://github.com/MonetDB/MonetDB/issues/6485
753,596,755
6,485
[ "MonetDB", "MonetDB" ]
Date: 2017-12-05 11:41:19 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @yzchang Last updated: 2017-12-07 09:56:32 +0100 ## Comment 25947 Date: 2017-12-05 11:41:19 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: I have experienced this issue multiple times. Monetdb fails to startup because the file is already present in the db farm folder. I think the file is a leftover after monetdb crashed. Is it safe to attempt to delete the file before starting up monetdb? This started happening after I upgraded to monetdb July 2017 version SP2 from June 2016. Reproducible: Sometimes ## Comment 25948 Date: 2017-12-05 13:44:58 +0100 From: @yzchang Hello Manuel, This is not a bug. It is more suitable as a question that you can send to the MonetDB users mailing list. You CANNOT just delete this file. This is an active lock. Assuming this lock is on a local file system, then its existence indicates that there is still a MonetDB server (i.e. an mserver5 process) active. So the correct and safe thing you should do is to find the mserver5 process on your machine, make sure it is stopped/killed, then you can restart your monetdb server. I'm closing this bug for now. If you have information to show that this situation is caused by a bug, please feel free to reopen it with additional information. Thanks! Regards, Jennie ## Comment 25949 Date: 2017-12-05 13:58:19 +0100 From: Manuel &lt;<manuel>&gt; (In reply to Ying Zhang from comment 1) > Hello Manuel, > > This is not a bug. It is more suitable as a question that you can send to > the MonetDB users mailing list. > > You CANNOT just delete this file. This is an active lock. Assuming this > lock is on a local file system, then its existence indicates that there is > still a MonetDB server (i.e. an mserver5 process) active. So the correct > and safe thing you should do is to find the mserver5 process on your > machine, make sure it is stopped/killed, then you can restart your monetdb > server. > > I'm closing this bug for now. If you have information to show that this > situation is caused by a bug, please feel free to reopen it with additional > information. Thanks! > > Regards, > Jennie Hi Jennie, thank you for your help. I do understand your point, but the issue is that there aren't any monetdb service running when this is happening. I suspect this is happening after a crash, and it started happening after the upgrade. Can I ask you where I can find the mailing list that you mentioned ? Thanks, Manuel ## Comment 25950 Date: 2017-12-05 14:46:06 +0100 From: @yzchang Hai Mauel, You can find the mailing lists here: https://www.monetdb.org/Developers/Mailinglists Regards, Jennie ## Comment 25964 Date: 2017-12-07 09:56:32 +0100 From: @sjoerdmullender (In reply to Manuel from comment 2) > I do understand your point, but the issue is that there aren't any monetdb > service running when this is happening. Note that Jennie wrote "mserver5 process", not "monetdb service".
!FATAL: GDKlockHome: Database lock '.gdk_lock' denied
https://api.github.com/repos/MonetDB/MonetDB/issues/6484/comments
0
2020-11-30T15:56:57Z
2024-06-28T06:52:17Z
https://github.com/MonetDB/MonetDB/issues/6484
753,596,714
6,484
[ "MonetDB", "MonetDB" ]
Date: 2017-12-04 13:13:26 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-02-12 16:12:20 +0100 ## Comment 25943 Date: 2017-12-04 13:13:26 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: This is the table used in my tests CREATE TABLE "sys"."unitTestDontDelete" ( "A" VARCHAR(255), "B" BIGINT, "C" DOUBLE, "D" TIMESTAMP, "id" BIGINT NOT NULL, CONSTRAINT "\"unitTestDontDelete\"_PK" PRIMARY KEY ("id") ); INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL, 0); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000', 1); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000', 2); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000', 3); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000', 4); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000', 5); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000', 6); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000', 7); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000', 8); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000', 9); running the following query will cause monetdb to crash. It does not happen all the time, but It's easy to reproduce if the query is run multiple times in a short time. SELECT "cpt_field_name" AS "crx_field_name" , "cpu_field_value" AS "cry_field_value" , "cpv_measure_name" AS "crz_measure_name" , "cpw_measure_value" AS "cs0_measure_value", "cpx_d__unique_values_count_" AS "cs1_d__unique_values_count_" FROM ( SELECT "trv"."crq___if__12_appd_src_det_" , "trv"."cpt_field_name" , "trv"."cpu_field_value" , "trv"."cpv_measure_name" , "trv"."cpw_measure_value" , "trv"."cpx_d__unique_values_count_", "trv"."cpy___if__0_field_value_" , "trv"."cpz___if__1_field_value_" , "trv"."cq0___if__2_field_value_" , "trv"."cqi___if__3_field_value_" , "trv"."cqj___if__4_field_value_" , "trv"."cqk___if__5_field_value_" , "trv"."cr2___if__6_field_value_" , "trv"."cr3___if__7_field_value_" , "trv"."cr4___if__8_field_value_" , "trv"."crm___if__9_field_value_" , "trv"."crn___if__10_field_value_" , "trv"."cro___if__11_field_value_" FROM ( ( SELECT 0.0 AS "crq___if__12_appd_src_det_" , "trr"."cpt_field_name" AS "cpt_field_name" , "trr"."cpu_field_value" AS "cpu_field_value" , "trr"."cpv_measure_name" AS "cpv_measure_name" , "trr"."cpw_measure_value" AS "cpw_measure_value" , "trr"."cpx_d__unique_values_count_" AS "cpx_d__unique_values_count_", "trr"."cpy___if__0_field_value_" AS "cpy___if__0_field_value_" , "trr"."cpz___if__1_field_value_" AS "cpz___if__1_field_value_" , "trr"."cq0___if__2_field_value_" AS "cq0___if__2_field_value_" , CAST(NULL AS bigint) AS "cqi___if__3_field_value_" , CAST(NULL AS bigint) AS "cqj___if__4_field_value_" , CAST(NULL AS bigint) AS "cqk___if__5_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr2___if__6_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr3___if__7_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr4___if__8_field_value_" , CAST(NULL AS bigint) AS "crm___if__9_field_value_" , CAST(NULL AS bigint) AS "crn___if__10_field_value_" , CAST(NULL AS bigint) AS "cro___if__11_field_value_" FROM ( SELECT "cpn_field_name" AS "cpt_field_name" , "cpo_field_value" AS "cpu_field_value" , "cpp_measure_name" AS "cpv_measure_name" , "cpq_measure_value" AS "cpw_measure_value" , "cpr_d__unique_values_count_" AS "cpx_d__unique_values_count_", "cpo_field_value" AS "cpy___if__0_field_value_" , "cpo_field_value" AS "cpz___if__1_field_value_" , "cpo_field_value" AS "cq0___if__2_field_value_" FROM ( SELECT 'A' AS "cpn_field_name" , "cpk_a_2" AS "cpo_field_value" , 'B (MEAN)' AS "cpp_measure_name" , "cpm_b__mean__2" AS "cpq_measure_value", "cpl_d__unique_values_count_" AS "cpr_d__unique_values_count_" FROM ( SELECT "tpj"."A" AS "cpk_a_2" , COUNT(DISTINCT "tpj"."D") AS "cpl_d__unique_values_count_", AVG("tpj"."B") AS "cpm_b__mean__2" FROM ( SELECT "tpi"."A", "tpi"."B", "tpi"."C", "tpi"."D", "tpi"."id" FROM "unitTestDontDelete" AS "tpi") AS "tpj" GROUP BY "tpj"."A") AS "tps") AS "tq1") AS "trr") UNION ALL ( SELECT 1.0 AS "crq___if__12_appd_src_det_" , "trs"."cqd_field_name" AS "cpt_field_name" , CAST("cqe_field_value" AS CLOB) AS "cpu_field_value" , "trs"."cqf_measure_name" AS "cpv_measure_name" , "trs"."cqg_measure_value" AS "cpw_measure_value" , "trs"."cqh_d__unique_values_count_" AS "cpx_d__unique_values_count_", CAST(NULL AS VARCHAR(255)) AS "cpy___if__0_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cpz___if__1_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cq0___if__2_field_value_" , "trs"."cqi___if__3_field_value_" AS "cqi___if__3_field_value_" , "trs"."cqj___if__4_field_value_" AS "cqj___if__4_field_value_" , "trs"."cqk___if__5_field_value_" AS "cqk___if__5_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr2___if__6_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr3___if__7_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr4___if__8_field_value_" , CAST(NULL AS bigint) AS "crm___if__9_field_value_" , CAST(NULL AS bigint) AS "crn___if__10_field_value_" , CAST(NULL AS bigint) AS "cro___if__11_field_value_" FROM ( SELECT "cq7_field_name" AS "cqd_field_name" , "cq8_field_value" AS "cqe_field_value" , "cq9_measure_name" AS "cqf_measure_name" , "cqa_measure_value" AS "cqg_measure_value" , "cqb_d__unique_values_count_" AS "cqh_d__unique_values_count_", "cq8_field_value" AS "cqi___if__3_field_value_" , "cq8_field_value" AS "cqj___if__4_field_value_" , "cq8_field_value" AS "cqk___if__5_field_value_" FROM ( SELECT 'B' AS "cq7_field_name" , "cq4_b_2" AS "cq8_field_value" , 'B (MEAN)' AS "cq9_measure_name" , "cq6_b__mean__2" AS "cqa_measure_value", "cq5_d__unique_values_count_" AS "cqb_d__unique_values_count_" FROM ( SELECT "tq3"."B" AS "cq4_b_2" , COUNT(DISTINCT "tq3"."D") AS "cq5_d__unique_values_count_", AVG("tq3"."B") AS "cq6_b__mean__2" FROM ( SELECT "tq2"."A", "tq2"."B", "tq2"."C", "tq2"."D", "tq2"."id" FROM "unitTestDontDelete" AS "tq2") AS "tq3" GROUP BY "tq3"."B") AS "tqc") AS "tql") AS "trs") UNION ALL ( SELECT 2.0 AS "crq___if__12_appd_src_det_" , "trt"."cqx_field_name" AS "cpt_field_name" , "trt"."cqy_field_value" AS "cpu_field_value" , "trt"."cqz_measure_name" AS "cpv_measure_name" , "trt"."cr0_measure_value" AS "cpw_measure_value" , "trt"."cr1_d__unique_values_count_" AS "cpx_d__unique_values_count_", CAST(NULL AS VARCHAR(255)) AS "cpy___if__0_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cpz___if__1_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cq0___if__2_field_value_" , CAST(NULL AS bigint) AS "cqi___if__3_field_value_" , CAST(NULL AS bigint) AS "cqj___if__4_field_value_" , CAST(NULL AS bigint) AS "cqk___if__5_field_value_" , "trt"."cr2___if__6_field_value_" AS "cr2___if__6_field_value_" , "trt"."cr3___if__7_field_value_" AS "cr3___if__7_field_value_" , "trt"."cr4___if__8_field_value_" AS "cr4___if__8_field_value_" , CAST(NULL AS bigint) AS "crm___if__9_field_value_" , CAST(NULL AS bigint) AS "crn___if__10_field_value_" , CAST(NULL AS bigint) AS "cro___if__11_field_value_" FROM ( SELECT "cqr_field_name" AS "cqx_field_name" , "cqs_field_value" AS "cqy_field_value" , "cqt_measure_name" AS "cqz_measure_name" , "cqu_measure_value" AS "cr0_measure_value" , "cqv_d__unique_values_count_" AS "cr1_d__unique_values_count_", "cqs_field_value" AS "cr2___if__6_field_value_" , "cqs_field_value" AS "cr3___if__7_field_value_" , "cqs_field_value" AS "cr4___if__8_field_value_" FROM ( SELECT 'A' AS "cqr_field_name" , "cqo_a_2" AS "cqs_field_value" , 'RECORD_COUNT' AS "cqt_measure_name" , "cqq_record_count_2" AS "cqu_measure_value", "cqp_d__unique_values_count_" AS "cqv_d__unique_values_count_" FROM ( SELECT "tqn"."A" AS "cqo_a_2" , COUNT(DISTINCT "tqn"."D") AS "cqp_d__unique_values_count_", COUNT(*) AS "cqq_record_count_2" FROM ( SELECT "tqm"."A", "tqm"."B", "tqm"."C", "tqm"."D", "tqm"."id" FROM "unitTestDontDelete" AS "tqm") AS "tqn" GROUP BY "tqn"."A") AS "tqw") AS "tr5") AS "trt") UNION ALL ( SELECT 3.0 AS "crq___if__12_appd_src_det_" , "tru"."crh_field_name" AS "cpt_field_name" , CAST("cri_field_value" AS CLOB) AS "cpu_field_value" , "tru"."crj_measure_name" AS "cpv_measure_name" , "tru"."crk_measure_value" AS "cpw_measure_value" , "tru"."crl_d__unique_values_count_" AS "cpx_d__unique_values_count_", CAST(NULL AS VARCHAR(255)) AS "cpy___if__0_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cpz___if__1_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cq0___if__2_field_value_" , CAST(NULL AS bigint) AS "cqi___if__3_field_value_" , CAST(NULL AS bigint) AS "cqj___if__4_field_value_" , CAST(NULL AS bigint) AS "cqk___if__5_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr2___if__6_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr3___if__7_field_value_" , CAST(NULL AS VARCHAR(255)) AS "cr4___if__8_field_value_" , "tru"."crm___if__9_field_value_" AS "crm___if__9_field_value_" , "tru"."crn___if__10_field_value_" AS "crn___if__10_field_value_" , "tru"."cro___if__11_field_value_" AS "cro___if__11_field_value_" FROM ( SELECT "crb_field_name" AS "crh_field_name" , "crc_field_value" AS "cri_field_value" , "crd_measure_name" AS "crj_measure_name" , "cre_measure_value" AS "crk_measure_value" , "crf_d__unique_values_count_" AS "crl_d__unique_values_count_", "crc_field_value" AS "crm___if__9_field_value_" , "crc_field_value" AS "crn___if__10_field_value_" , "crc_field_value" AS "cro___if__11_field_value_" FROM ( SELECT 'B' AS "crb_field_name" , "cr8_b_2" AS "crc_field_value" , 'RECORD_COUNT' AS "crd_measure_name" , "cra_record_count_2" AS "cre_measure_value", "cr9_d__unique_values_count_" AS "crf_d__unique_values_count_" FROM ( SELECT "tr7"."B" AS "cr8_b_2" , COUNT(DISTINCT "tr7"."D") AS "cr9_d__unique_values_count_", COUNT(*) AS "cra_record_count_2" FROM ( SELECT "tr6"."A", "tr6"."B", "tr6"."C", "tr6"."D", "tr6"."id" FROM "unitTestDontDelete" AS "tr6") AS "tr7" GROUP BY "tr7"."B") AS "trg") AS "trp") AS "tru")) AS "trv") AS "trw" ORDER BY "crq___if__12_appd_src_det_" ASC, "cpy___if__0_field_value_" ASC , "cqi___if__3_field_value_" ASC , "cr2___if__6_field_value_" ASC , "crm___if__9_field_value_" ASC limit 200000 Reproducible: Always ### Steps to Reproduce: 1.Import the table 2. Run the query (multiple times if necessary) ## Comment 25944 Date: 2017-12-04 15:53:15 +0100 From: @sjoerdmullender I can reproduce this with the Jul2017 SP2 release, but not with the upcoming SP3. I'm pretty sure the fix was in changeset [870aa0af7e1a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=870aa0af7e1a)
Monetdb crashes, on query
https://api.github.com/repos/MonetDB/MonetDB/issues/6483/comments
0
2020-11-30T15:56:53Z
2024-06-27T13:02:13Z
https://github.com/MonetDB/MonetDB/issues/6483
753,596,664
6,483
[ "MonetDB", "MonetDB" ]
Date: 2017-12-04 12:23:38 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-02-12 16:12:12 +0100 ## Comment 25942 Date: 2017-12-04 12:23:38 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: This is the test table used during my tests: CREATE TABLE "sys"."unitTestDontDelete" ( "A" VARCHAR(255), "B" BIGINT, "C" DOUBLE, "D" TIMESTAMP, "id" BIGINT NOT NULL, CONSTRAINT "\"unitTestDontDelete\"_PK" PRIMARY KEY ("id") ); INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL, 0); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000', 1); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000', 2); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000', 3); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000', 4); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000', 5); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000', 6); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000', 7); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000', 8); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000', 9); The following query SELECT "ctf_measure_1_name" AS "cup_measure_1_name" , "ctg_measure_2_name" AS "cuq_measure_2_name" , "cth_measure_1_value" AS "cur_measure_1_value", "cti_measure_2_value" AS "cus_measure_2_value", "ctj_record_count" AS "cut_record_count" FROM ( SELECT "tun"."cui___if__0_appd_src_det_", "tun"."ctf_measure_1_name" , "tun"."ctg_measure_2_name" , "tun"."cth_measure_1_value" , "tun"."cti_measure_2_value" , "tun"."ctj_record_count" FROM ( ( SELECT 0.0 AS "cui___if__0_appd_src_det_", "tuj"."ctf_measure_1_name" AS "ctf_measure_1_name" , "tuj"."ctg_measure_2_name" AS "ctg_measure_2_name" , "tuj"."cth_measure_1_value" AS "cth_measure_1_value" , "tuj"."cti_measure_2_value" AS "cti_measure_2_value" , "tuj"."ctj_record_count" AS "ctj_record_count" FROM ( SELECT 'A (UNIQUE_VALUES_COUNT)' AS "ctf_measure_1_name" , 'C (SUM)' AS "ctg_measure_2_name" , "cte_a__unique_values_count__2" AS "cth_measure_1_value", "ctd_c__sum__2" AS "cti_measure_2_value", "ctc_record_count" AS "ctj_record_count" FROM ( SELECT COUNT(*) AS "ctc_record_count", SUM("ttb"."C") AS "ctd_c__sum__2" , COUNT(DISTINCT "ttb"."A") AS "cte_a__unique_values_count__2" FROM ( SELECT "tta"."A", "tta"."B", "tta"."C", "tta"."D", "tta"."id" FROM "unitTestDontDelete" AS "tta") AS "ttb") AS "ttk") AS "tuj") UNION ALL ( SELECT 1.0 AS "cui___if__0_appd_src_det_", "tuk"."ctq_measure_1_name" AS "ctf_measure_1_name" , "tuk"."ctr_measure_2_name" AS "ctg_measure_2_name" , "tuk"."cts_measure_1_value" AS "cth_measure_1_value" , CAST("ctt_measure_2_value" AS DOUBLE PRECISION) AS "cti_measure_2_value" , "tuk"."ctu_record_count" AS "ctj_record_count" FROM ( SELECT 'A (UNIQUE_VALUES_COUNT)' AS "ctq_measure_1_name" , 'RECORD_COUNT' AS "ctr_measure_2_name" , "ctp_a__unique_values_count__2" AS "cts_measure_1_value", "cto_record_count_2" AS "ctt_measure_2_value", "ctn_record_count" AS "ctu_record_count" FROM ( SELECT COUNT(*) AS "ctn_record_count" , COUNT(*) AS "cto_record_count_2", COUNT(DISTINCT "ttm"."A") AS "ctp_a__unique_values_count__2" FROM ( SELECT "ttl"."A", "ttl"."B", "ttl"."C", "ttl"."D", "ttl"."id" FROM "unitTestDontDelete" AS "ttl") AS "ttm") AS "ttv") AS "tuk") ) AS "tun") AS "tuo" ORDER BY CASE WHEN "ctf_measure_1_name" = 'A (UNIQUE_VALUES_COUNT)' THEN 0 WHEN "ctf_measure_1_name" = 'B (SUM)' THEN 1 WHEN "ctf_measure_1_name" IS NULL THEN 2 ELSE 3 END ASC, "ctf_measure_1_name" ASC , "ctf_measure_1_name" ASC , CASE WHEN "ctg_measure_2_name" = 'C (SUM)' THEN 0 WHEN "ctg_measure_2_name" = 'RECORD_COUNT' THEN 1 WHEN "ctg_measure_2_name" IS NULL THEN 2 ELSE 3 END ASC , "ctg_measure_2_name" ASC , "ctg_measure_2_name" ASC , "cui___if__0_appd_src_det_" ASC limit 200000 fails with the error: Error: could not allocate space SQLState: HY001 ErrorCode: 0 Error: COLnew:tt error SQLState: 22000 ErrorCode: 0 I have plenty of disk space and available ram (32GB) Reproducible: Always ### Steps to Reproduce: 1.Create the table unitTestDontDelete with the records in description 2. run the query in description ### Actual Results: Error: could not allocate space SQLState: HY001 ErrorCode: 0 Error: COLnew:tt error SQLState: 22000 ErrorCode: 0 ## Comment 25945 Date: 2017-12-04 16:02:26 +0100 From: @sjoerdmullender Why did you close this bug? It's not been fixed. ## Comment 25946 Date: 2017-12-04 16:46:50 +0100 From: Manuel &lt;<manuel>&gt; I realised it is caused by a duplicate column in the order by clause. Feel free to re-open it, if relevant. thanks, Manuel
Query failures on order by on union
https://api.github.com/repos/MonetDB/MonetDB/issues/6482/comments
0
2020-11-30T15:56:50Z
2024-06-27T13:02:12Z
https://github.com/MonetDB/MonetDB/issues/6482
753,596,612
6,482
[ "MonetDB", "MonetDB" ]
Date: 2017-12-01 17:28:35 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; To: MonetDB5 devs &lt;<bugs-monetdb5>&gt; Version: 11.27.9 (Jul2017-SP2) CC: akkaran046, folebi, gawiha2418, @mlkersten, ooberdickdsrze, shawpolakcrax12 Last updated: 2020-11-16 09:19:40 +0100 ## Comment 25932 Date: 2017-12-01 17:28:35 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: In the latest build of MonetDB 11.27.9, when compared to previous build a slowness is identified in SQLs which contains COUNT(DISTINCT) SUM(DISTINCT). Reproducible: Always ### Steps to Reproduce: 1.Execute any SQL with COUNT(DISTINCT) SUM(DISTINCT) 2.Run the SQL in concurrency or single user 3. ### Actual Results: select count(DISTINCT columnc) as column 289.189ms(11.27.5) 1.1s(11.27.9) We have similar examples ### Expected Results: Ideally above case should be almost same when tested in idle environment. create table new CREATE TABLE "TEST"."SQL_TEST" ( "columna" int, "columnb" int, "columnc" varchar(20)); Queries for new select sum(columna), count(columnc) as columnc from "TEST"."SQL_TEST"; select sum(DISTINCT columna), count(columnc) as columnc from "TEST"."SQL_TEST"; select sum(columna), count(DISTINCT columnc) as columnc from "TEST"."SQL_TEST"; select sum(DISTINCT columna), count(DISTINCT columnc) as columnc from "TEST"."SQL_TEST"; select count(DISTINCT columnc) as columnc from "TEST"."SQL_TEST"; select sum(DISTINCT columna) from "TEST"."SQL_TEST"; Create table old CREATE TABLE "TEST_OLD"."SQL_TEST_OLD" ( "columna" int, "columnb" int, "columnc" varchar(20)); Queries for old select sum(DISTINCT columna) as columnc from "TEST"."SQL_TEST"; select sum(DISTINCT columna) as columnc from "TEST_OLD"."SQL_TEST_OLD"; select count(DISTINCT columnc) as columnc from "TEST"."SQL_TEST"; select count(DISTINCT columnc) as columnc from "TEST_OLD"."SQL_TEST_OLD"; select count(DISTINCT columnc) as columnc from "TEST_OLD"."SQL_TEST_OLD"; select sum(DISTINCT columna) from "TEST_OLD"."SQL_TEST_OLD"; ## Comment 25933 Date: 2017-12-01 17:29:31 +0100 From: Sreejith Sharma &lt;<sreejith.sharma>&gt; Created attachment 575 Attached sample data set created as mock up > Attached file: [Sample_Records.xlsx](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6481_Sample_Records.xlsx_575) (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, 30545 bytes) > Description: Attached sample data set created as mock up ## Comment 25995 Date: 2017-12-12 17:01:39 +0100 From: @sjoerdmullender Can you run one of those slow queries with the keyword TRACE prepended and post the result? The query would be something like trace select count(distinct columnc) as column; I created a single column table with 100000 integers and ran the sum(distinct X) and count(distinct X) queries. Both were deon in under 8 ms, both on 11.27.9 and on the current version of the release branch. ## Comment 25996 Date: 2017-12-12 17:02:51 +0100 From: @sjoerdmullender (In reply to Sjoerd Mullender from comment 2) > I created a single column table with 100000 integers and ran the > sum(distinct X) and count(distinct X) queries. Both were deon in under 8 > ms, both on 11.27.9 and on the current version of the release branch. That was with a debug build, which is significantly slower than binaries we build for release. ## Comment 27589 Date: 2020-03-15 09:25:34 +0100 From: @mlkersten No further information received. Closed for the time being.
COUNT DISTINCT or SUM DISTINCT causing slowness
https://api.github.com/repos/MonetDB/MonetDB/issues/6481/comments
0
2020-11-30T15:56:46Z
2024-06-27T13:02:11Z
https://github.com/MonetDB/MonetDB/issues/6481
753,596,572
6,481
[ "MonetDB", "MonetDB" ]
Date: 2017-12-01 15:22:18 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2019-12-09 15:38:11 +0100 ## Comment 25931 Date: 2017-12-01 15:22:18 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0 Build Identifier: Thread 2913 "mserver5" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7f9dcd0ff700 (LWP 12788)] 0x00007f9dee6b6bae in __strcmp_sse2_unaligned () from /lib64/libc.so.6 (gdb) where 0 0x00007f9dee6b6bae in __strcmp_sse2_unaligned () from /lib64/libc.so.6 1 0x00007f9de8ffdb80 in mvc_find_subexp (m=0x7f9d9c00c220, rname=0x0, name=0x0) at /export/scratch1/home/mk/default//package/sql/server/sql_mvc.c:1859 2 0x00007f9de9041a1f in exp_rename (sql=0x7f9d9c00c220, e=0x0, f=0x7f9d9c6d2db0, t=0x7f9d9c6d2850) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1208 3 0x00007f9de904174c in exps_rename (sql=0x7f9d9c00c220, l=0x7f9d9c6d4320, f=0x7f9d9c6d2db0, t=0x7f9d9c6d2850) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1173 4 0x00007f9de9041f57 in exp_rename (sql=0x7f9d9c00c220, e=0x7f9d9c6d43c0, f=0x7f9d9c6d2db0, t=0x7f9d9c6d2850) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1256 5 0x00007f9de9041d63 in exp_rename (sql=0x7f9d9c00c220, e=0x7f9d9c6d44d0, f=0x7f9d9c6d2db0, t=0x7f9d9c6d2850) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1233 6 0x00007f9de9056afa in rel_push_project_up (changes=0x7f9dcd0fe764, sql=0x7f9d9c00c220, rel=0x7f9d9c6d4530) Reproducible: Always ### Steps to Reproduce: select subq_0.c5 as c0, case when subq_0.c4 is not NULL then subq_0.c1 else subq_0.c1 end as c1, subq_0.c0 as c2, subq_0.c5 as c3, subq_0.c5 as c4, subq_0.c3 as c5, subq_0.c1 as c6, subq_0.c4 as c7, subq_0.c4 as c8, subq_0.c5 as c9, subq_0.c4 as c10, subq_0.c5 as c11, cast(coalesce(case when cast(coalesce(subq_0.c4, subq_0.c0) as int) is NULL then subq_0.c2 else subq_0.c2 end , subq_0.c4) as int) as c12, subq_0.c5 as c13, subq_0.c5 as c14, subq_0.c3 as c15, subq_0.c5 as c16, subq_0.c1 as c17, subq_0.c0 as c18, subq_0.c1 as c19, case when subq_0.c3 is NULL then subq_0.c2 else subq_0.c2 end as c20, subq_0.c0 as c21, subq_0.c2 as c22, subq_0.c5 as c23, subq_0.c2 as c24, case when subq_0.c5 is not NULL then case when EXISTS ( select ref_4.srid as c0 from sys.db_user_info as ref_3 right join sys.spatial_ref_sys as ref_4 on (ref_3.fullname = ref_4.auth_name ) inner join sys.tablestoragemodel as ref_6 on (ref_3.name is not NULL) where true) then subq_0.c3 else subq_0.c3 end else case when EXISTS ( select ref_4.srid as c0 from sys.db_user_info as ref_3 right join sys.spatial_ref_sys as ref_4 on (ref_3.fullname = ref_4.auth_name ) inner join sys.tablestoragemodel as ref_6 on (ref_3.name is not NULL) where true) then subq_0.c3 else subq_0.c3 end end as c25, case when false then subq_0.c5 else subq_0.c5 end as c26, case when false then subq_0.c3 else subq_0.c3 end as c27, subq_0.c0 as c28 from (select ref_1.owner as c0, ref_0.minvalue as c1, ref_1.authorization as c2, ref_0.id as c3, 37 as c4, ref_1.id as c5 from sys.sequences as ref_0 inner join sys.schemas as ref_1 on (ref_1.authorization is NULL) where ref_0.increment is NULL) as subq_0 where subq_0.c4 is NULL limit 176; ## Comment 25934 Date: 2017-12-02 15:23:04 +0100 From: @njnes crash is fixed (ie only lookup names of e_columns) ## Comment 25966 Date: 2017-12-07 11:43:12 +0100 From: @mlkersten select 64 as c0, ref_12.y as c1, ref_12.y as c2, case when true then ref_12.z else ref_12.z end as c3, cast(coalesce(ref_12.b, ref_12.b) as boolean) as c4, ref_12.x as c5 from sys.s as ref_12 where EXISTS ( select ref_17.keyword as c0, subq_0.c5 as c1, ref_12.x as c2, subq_0.c1 as c3, ref_17.keyword as c4, subq_0.c6 as c5, ref_17.keyword as c6, subq_0.c9 as c7, ref_12.z as c8, ref_12.y as c9, 23 as c10, subq_0.c1 as c11 from sys.keywords as ref_17 left join (select ref_19.y as c0, ref_12.x as c1, ref_19.z as c2, ref_19.y as c3, ref_12.z as c4, ref_12.y as c5, ref_19.y as c6, 24 as c7, ref_12.b as c8, ref_12.z as c9 from sys.r2 as ref_19 where false limit 79) as subq_0 on ((subq_0.c4 is NULL) or (subq_0.c2 is NULL)) where false) limit 123; 4 0x00007f7a5775c21d in exp_bin (be=0x7f7a0c001990, e=0x7f7a0de266b0, left=0x7f7a0dbac880, right=0x7f7a0dbac9b0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:575 5 0x00007f7a57765512 in rel2bin_project (be=0x7f7a0c001990, rel=0x7f7a0de26ac0, refs=0x7f7a0db8af60, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2479 6 0x00007f7a57770351 in subrel_bin (be=0x7f7a0c001990, rel=0x7f7a0de26ac0, refs=0x7f7a0db8af60) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4856 7 0x00007f7a5776543f in rel2bin_project (be=0x7f7a0c001990, rel=0x7f7a0de20b50, refs=0x7f7a0db8af60, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2467 8 0x00007f7a57770351 in subrel_bin (be=0x7f7a0c001990, rel=0x7f7a0de20b50, refs=0x7f7a0db8af60) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4856 9 0x00007f7a57765e93 in rel2bin_select (be=0x7f7a0c001990, rel=0x7f7a0de27950, refs=0x7f7a0db8af60) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2603 ## Comment 25977 Date: 2017-12-10 16:53:55 +0100 From: @njnes on which schema was this tested ## Comment 27465 Date: 2019-12-09 15:38:11 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [5fbc87474be2](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5fbc87474be2) 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=5fbc87474be2](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5fbc87474be2) Changeset description: Test sqlsmith.Bug-6480.sql requires mergedb_create
Segfault in mvc_find_subexp (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6480/comments
0
2020-11-30T15:56:43Z
2024-06-27T13:02:10Z
https://github.com/MonetDB/MonetDB/issues/6480
753,596,540
6,480
[ "MonetDB", "MonetDB" ]
Date: 2017-11-29 13:52:20 +0100 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:03 +0100 ## Comment 25922 Date: 2017-11-29 13:52:20 +0100 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: When calling a update statement inside a SQL procedure, the server receives a SIGABRT on exp_bin function call while compiling the procedure. Reproducible: Always ### Steps to Reproduce: 1. create table stmp10 (t timestamp, sensor integer, val decimal(8,2)) ; 2. create table tmp_aggregate(tmp_total decimal(8,2), tmp_count decimal(8,2)); 3. insert into tmp_aggregate values(0.0,0.0); 4. create procedure cq_collector() begin update tmp_aggregate set tmp_total = tmp_total + (select sum(val) from sys.stmp10), tmp_count = tmp_count + (select count(*) from sys.stmp10); end; 5. call cq_collector(); ### Actual Results: Servers receives a SIGABRT on the exp_bin function call. ### Expected Results: The table tmp_aggregate continues unchanged. The assertion error: mserver5: rel_bin.c:575: exp_bin: Assertion `s' failed. Backtrace: 0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 1 0x00007ffff46aa3b1 in __GI_abort () at abort.c:79 2 0x00007ffff46a092a in __assert_fail_base (fmt=0x7ffff481d330 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fffe86b7c30 "s", file=file@entry=0x7fffe86b7bc2 "rel_bin.c", line=line@entry=575, function=function@entry=0x7fffe86b82d8 <__PRETTY_FUNCTION__.13952> "exp_bin") at assert.c:92 3 0x00007ffff46a09a2 in __GI___assert_fail (assertion=0x7fffe86b7c30 "s", file=0x7fffe86b7bc2 "rel_bin.c", line=575, function=0x7fffe86b82d8 <__PRETTY_FUNCTION__.13952> "exp_bin") at assert.c:101 4 0x00007fffe85378cf in exp_bin (be=0x7fffd0002b50, e=0x7fffd012b9a0, left=0x7fffd012f5f0, right=0x7fffd012f6c0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:575 5 0x00007fffe8536faf in exp_bin (be=0x7fffd0002b50, e=0x7fffd012e450, left=0x7fffd012f5f0, right=0x7fffd012f6c0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 6 0x00007fffe8536d8c in exp_bin (be=0x7fffd0002b50, e=0x7fffd012e4b0, left=0x7fffd012f5f0, right=0x7fffd012f6c0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449 7 0x00007fffe8540bad in rel2bin_project (be=0x7fffd0002b50, rel=0x7fffd012dd80, refs=0x7fffd012ef90, topn=0x0) at rel_bin.c:2477 8 0x00007fffe854b979 in subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012dd80, refs=0x7fffd012ef90) at rel_bin.c:4847 9 0x00007fffe8540ada in rel2bin_project (be=0x7fffd0002b50, rel=0x7fffd012e140, refs=0x7fffd012ef90, topn=0x0) at rel_bin.c:2465 10 0x00007fffe854b979 in subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012e140, refs=0x7fffd012ef90) at rel_bin.c:4847 11 0x00007fffe8549234 in rel2bin_update (be=0x7fffd0002b50, rel=0x7fffd012ddb0, refs=0x7fffd012ef90) at rel_bin.c:4286 12 0x00007fffe854baa0 in subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012ddb0, refs=0x7fffd012ef90) at rel_bin.c:4872 13 0x00007fffe854bc21 in _subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012ddb0, refs=0x7fffd012ef90) at rel_bin.c:4904 14 0x00007fffe854bca2 in rel_bin (be=0x7fffd0002b50, rel=0x7fffd012ddb0) at rel_bin.c:4913 15 0x00007fffe8536a4a in exp_bin (be=0x7fffd0002b50, e=0x7fffd012de40, left=0x0, right=0x0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:409 16 0x00007fffe854ac5a in rel2bin_psm (be=0x7fffd0002b50, rel=0x7fffd012ded0) at rel_bin.c:4638 17 0x00007fffe854b5d0 in rel2bin_ddl (be=0x7fffd0002b50, rel=0x7fffd012ded0, refs=0x7fffd012eeb0) at rel_bin.c:4771 18 0x00007fffe854bb14 in subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012ded0, refs=0x7fffd012eeb0) at rel_bin.c:4882 19 0x00007fffe854bc21 in _subrel_bin (be=0x7fffd0002b50, rel=0x7fffd012ded0, refs=0x7fffd012eeb0) at rel_bin.c:4904 20 0x00007fffe854bd39 in output_rel_bin (be=0x7fffd0002b50, rel=0x7fffd012ded0) at rel_bin.c:4927 21 0x00007fffe8566fe2 in sql_relation2stmt (be=0x7fffd0002b50, r=0x7fffd012ded0) at sql_gencode.c:529 22 0x00007fffe85671eb in backend_dumpstmt (be=0x7fffd0002b50, mb=0x7fffc4004620, r=0x7fffd012ded0, top=0, add_end=1, query=0x0) at sql_gencode.c:569 23 0x00007fffe8568a3e in backend_create_sql_func (be=0x7fffd0002b50, f=0x7fffd006a970, restypes=0x0, ops=0x7fffd0129100) at sql_gencode.c:1003 24 0x00007fffe8568d6d in backend_create_func (be=0x7fffd0002b50, f=0x7fffd006a970, restypes=0x0, ops=0x7fffd0129100) at sql_gencode.c:1049 25 0x00007fffe8568e7d in backend_create_subfunc (be=0x7fffd0002b50, f=0x7fffd0128d00, ops=0x7fffd0129100) at sql_gencode.c:1078 26 0x00007fffe855fea6 in stmt_Nop (be=0x7fffd0002b50, ops=0x7fffd0129170, f=0x7fffd0128d00) at sql_statement.c:2807 27 0x00007fffe8537263 in exp_bin (be=0x7fffd0002b50, e=0x7fffd0128d30, left=0x0, right=0x0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:500 28 0x00007fffe854ac5a in rel2bin_psm (be=0x7fffd0002b50, rel=0x7fffd0128e30) at rel_bin.c:4638 29 0x00007fffe854b5d0 in rel2bin_ddl (be=0x7fffd0002b50, rel=0x7fffd0128e30, refs=0x7fffd0129020) at rel_bin.c:4771 30 0x00007fffe854bb14 in subrel_bin (be=0x7fffd0002b50, rel=0x7fffd0128e30, refs=0x7fffd0129020) at rel_bin.c:4882 31 0x00007fffe854bc21 in _subrel_bin (be=0x7fffd0002b50, rel=0x7fffd0128e30, refs=0x7fffd0129020) at rel_bin.c:4904 32 0x00007fffe854bd39 in output_rel_bin (be=0x7fffd0002b50, rel=0x7fffd0128e30) at rel_bin.c:4927 33 0x00007fffe8566fe2 in sql_relation2stmt (be=0x7fffd0002b50, r=0x7fffd0128e30) at sql_gencode.c:529 34 0x00007fffe85671eb in backend_dumpstmt (be=0x7fffd0002b50, mb=0x7fffd00f71a0, r=0x7fffd0128e30, top=1, add_end=1, query=0x7fffd0104350 "call cq_collector();") at sql_gencode.c:569 35 0x00007fffe8567a4a in backend_dumpproc (be=0x7fffd0002b50, c=0x7fffe9671338, cq=0x7fffd010f0d0, r=0x7fffd0128e30) at sql_gencode.c:696 36 0x00007fffe852b33f in SQLparser (c=0x7fffe9671338) at sql_scenario.c:1187 37 0x00007ffff7a1403c in runPhase (c=0x7fffe9671338, phase=1) at mal_scenario.c:506 38 0x00007ffff7a14180 in runScenarioBody (c=0x7fffe9671338) at mal_scenario.c:539 39 0x00007ffff7a14323 in runScenario (c=0x7fffe9671338) at mal_scenario.c:568 40 0x00007ffff7a15ed8 in MSserveClient (dummy=0x7fffe9671338) at mal_session.c:473 41 0x00007ffff7a159c8 in MSscheduleClient (command=0x7fffd0000b20 <incomplete sequence \340>, challenge=0x7fffe76b9dab "SUEXcJ3pgP", fin=0x17ca660, fout=0x7fffe0002d80, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 42 0x00007ffff7ab5b08 in doChallenge (data=0x17ca670) at mal_mapi.c:273 43 0x00007ffff768f156 in thread_starter (arg=0x7fffe0004e70) at gdk_system.c:485 44 0x00007ffff4a5d609 in start_thread (arg=0x7fffe76ba700) at pthread_create.c:465 45 0x00007ffff478ae6f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 ## Comment 25923 Date: 2017-11-29 13:56:32 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7adffed6a10e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7adffed6a10e) 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=7adffed6a10e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7adffed6a10e) Changeset description: Added test for bug #6479 ## Comment 25926 Date: 2017-11-29 16:07:31 +0100 From: @njnes fixed by keeping the subqueries within a procedure ## Comment 25928 Date: 2017-11-29 16:12:20 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [6d0611d709f7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6d0611d709f7) 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=6d0611d709f7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6d0611d709f7) Changeset description: fixed bug #6479, keep subqueries within the procedure context.
Mserver receives an assertion error on a procedure call
https://api.github.com/repos/MonetDB/MonetDB/issues/6479/comments
0
2020-11-30T15:56:40Z
2024-06-27T13:02:09Z
https://github.com/MonetDB/MonetDB/issues/6479
753,596,489
6,479
[ "MonetDB", "MonetDB" ]
Date: 2017-11-28 11:58:24 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-12-14 14:46:02 +0100 ## Comment 25921 Date: 2017-11-28 11:58:24 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36 Build Identifier: I have had several crashes when trying to execute queries involving nested order by/ limit offset. This is the test table used during my tests: CREATE TABLE "sys"."unitTestDontDelete" ( "A" VARCHAR(255), "B" BIGINT, "C" DOUBLE, "D" TIMESTAMP, "id" BIGINT NOT NULL, CONSTRAINT "\"unitTestDontDelete\"_PK" PRIMARY KEY ("id") ); INSERT INTO "sys"."unitTestDontDelete" VALUES (NULL, NULL, NULL, NULL, 0); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 0, 0.5, '2013-06-10 11:10:10.000000', 1); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 1, 1.5, '2013-06-11 12:11:11.000000', 2); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 2, 2.5, '2013-06-12 13:12:12.000000', 3); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 3, 3.5, '2013-06-13 14:13:13.000000', 4); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 4, 4.5, '2013-06-14 15:14:14.000000', 5); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 5, 5.5, '2013-06-15 16:15:15.000000', 6); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 6, 6.5, '2013-06-16 17:16:16.000000', 7); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat2', 7, 7.5, '2013-06-17 18:17:17.000000', 8); INSERT INTO "sys"."unitTestDontDelete" VALUES ('Cat1', 8, 8.5, '2013-06-18 19:18:18.000000', 9); The following query crashes: select "A" as "cb_a", "B" as "cc_b", "C" as "cd_c", "D" as "ce_d" from ( select "t8"."A", "t8"."B", "t8"."C", "t8"."D", "t8"."id" from ( select "t7"."A", "t7"."B", "t7"."C", "t7"."D", "t7"."id" from "unitTestDontDelete" as "t7" ) as "t8" order by "A" desc, "id" asc limit 4 offset 1 ) as "ta" order by "B" asc, "A" desc, "id" asc limit 1 Reproducible: Always ### Steps to Reproduce: 1. Import the table executing the sql in details 2. Execute the query: select "A" as "cb_a", "B" as "cc_b", "C" as "cd_c", "D" as "ce_d" from ( select "t8"."A", "t8"."B", "t8"."C", "t8"."D", "t8"."id" from ( select "t7"."A", "t7"."B", "t7"."C", "t7"."D", "t7"."id" from "unitTestDontDelete" as "t7" ) as "t8" order by "A" desc, "id" asc limit 4 offset 1 ) as "ta" order by "B" asc, "A" desc, "id" asc limit 1 ### Actual Results: Monetdb crashes ## Comment 25927 Date: 2017-11-29 16:11:32 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [43eb145717a3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43eb145717a3) 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=43eb145717a3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=43eb145717a3) Changeset description: add test for bug #6478 ## Comment 25929 Date: 2017-11-29 16:19:23 +0100 From: @njnes fixed crash in firstn with distinct ## Comment 25930 Date: 2017-11-29 18:55:05 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [870aa0af7e1a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=870aa0af7e1a) 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=870aa0af7e1a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=870aa0af7e1a) Changeset description: Fixed some thinkos in BATfirstn_unique_with_groups. - Make sure *lastp and *lastgp are assigned a value. - Don't blindly assume there is a candidate list if there are groups. - Copy correct bit of candidate list, or create a dense bat referring to correct part of input bat. This fixes bug #6478.
Crash with nested order by/ limit offset
https://api.github.com/repos/MonetDB/MonetDB/issues/6478/comments
0
2020-11-30T15:56:37Z
2024-06-27T13:02:08Z
https://github.com/MonetDB/MonetDB/issues/6478
753,596,450
6,478
[ "MonetDB", "MonetDB" ]
Date: 2017-11-27 12:37:58 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:03 +0100 ## Comment 25919 Date: 2017-11-27 12:37:58 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0 Build Identifier: Assertion errors raised in mergedb example 3 0x00007f173b4cfdd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f1735ee7938 in rel_push_project_up (changes=0x7f171a290764, sql=0x7f16f410a4b0, rel=0x7f16f4cf7a40) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5632 5 0x00007f1735ef521a in rewrite (sql=0x7f16f410a4b0, rel=0x7f16f4cf7a40, rewriter=0x7f1735ee6ea5 <rel_push_project_up>, has_changes=0x7f171a290868) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8973 6 0x00007f1735ef50f7 in rewrite (sql=0x7f16f410a4b0, rel=0x7f16f4cf7b80, rewriter=0x7f1735ee6ea5 <rel_push_project_up>, has_changes=0x7f171a290868) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8957 7 0x00007f1735ef50f7 in rewrite (sql=0x7f16f410a4b0, rel=0x7f16f4cfd440, rewriter=0x7f1735ee6ea5 <rel_push_project_up>, has_changes=0x7f171a290868) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8957 8 0x00007f1735ef50f7 in rewrite (sql=0x7f16f410a4b0, rel=0x7f16f4cfc5b0, rewriter=0x7f1735ee6ea5 <rel_push_project_up>, has_changes=0x7f171a290868) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8957 9 0x00007f1735ef5652 in optimize_rel (sql=0x7f16f410a4b0, rel=0x7f16f4cfc5b0, g_changes=0x7f171a2908f0, level=0) Reproducible: Always ### Steps to Reproduce: select cast(coalesce(ref_0.stop, ref_0.stop) as timestamp) as c0, ref_0.id as c1, cast(coalesce(ref_0.cpu, ref_0.io) as int) as c2, ref_0.run as c3, ref_0.stop as c4, ref_0.cpu as c5, case when cast(nullif(ref_0.tuples, ref_0.tuples) as bigint) is not NULL then ref_0.io else ref_0.io end as c6 from sys.querylog_calls as ref_0 where cast(coalesce(ref_0.tuples, case when EXISTS ( select ref_1.id as c0 from sys.args as ref_1 left join tmp.objects as ref_2 right join sys.spatial_ref_sys as ref_3 on (true) on (ref_1.type_scale = ref_2.id ) where true) then ref_0.run else ref_0.run end ) as bigint) is not NULL limit 101; ~ ## Comment 25924 Date: 2017-11-29 14:38:59 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [900ea35c5fd5](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=900ea35c5fd5) 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=900ea35c5fd5](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=900ea35c5fd5) Changeset description: fixed bug #6477, no need to rename expressions from other subqueries ## Comment 25925 Date: 2017-11-29 16:06:35 +0100 From: @njnes fixed, no need to rename subquery expressions in the rel_push_project_up optimizer
assertion eror rel_push_project_up (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6477/comments
0
2020-11-30T15:56:34Z
2024-06-27T13:02:07Z
https://github.com/MonetDB/MonetDB/issues/6477
753,596,416
6,477
[ "MonetDB", "MonetDB" ]
Date: 2017-11-24 12:50:40 +0100 From: @yzchang To: SQL devs &lt;<bugs-sql>&gt; Version: -- development Last updated: 2019-01-23 13:14:29 +0100 ## Comment 25907 Date: 2017-11-24 12:50:40 +0100 From: @yzchang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5 Build Identifier: An extension of Bug #6475, we should check all current SQL global variables to clean up the unused ones. Reproducible: Always ## Comment 26843 Date: 2019-01-23 13:14:29 +0100 From: @sjoerdmullender The remaining SQL global variables are: debug, cache, current_schema, current_user, current_role, optimizer, current_timezone, last_id, and rowcnt (see view sys.var_values). They all have their purpose. Closing, since I did what was asked here.
Clean up unused SQL global variables
https://api.github.com/repos/MonetDB/MonetDB/issues/6476/comments
0
2020-11-30T15:56:31Z
2024-06-28T13:39:42Z
https://github.com/MonetDB/MonetDB/issues/6476
753,596,370
6,476
[ "MonetDB", "MonetDB" ]
Date: 2017-11-24 11:50:03 +0100 From: @yzchang To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @yzchang Last updated: 2019-04-30 12:36:03 +0200 ## Comment 25906 Date: 2017-11-24 11:50:03 +0100 From: @yzchang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/604.3.5 (KHTML, like Gecko) Version/11.0.1 Safari/604.3.5 Build Identifier: MonetDB has a global variable called "history": $ mclient ... sql>select history; +-------+ | L2 | +=======+ | false | +-------+ 1 tuple (11.354ms) sql>set history = true; operation successful (11.904ms) sql>select history; +-------+ | L2 | +=======+ | true | +-------+ 1 tuple (11.616ms) But it seems to be unused. Probably it's a left over of the earlier query log implementation. If that's indeed the case, it should be removed. Reproducible: Always ## Comment 26811 Date: 2019-01-18 18:45:14 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [9da76d750a37](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9da76d750a37) 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=9da76d750a37](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9da76d750a37) Changeset description: Removed unused global SQL variable "history". This fixes bug #6475.
Remove unused SQL global variable "history"
https://api.github.com/repos/MonetDB/MonetDB/issues/6475/comments
0
2020-11-30T15:56:28Z
2024-06-27T13:02:05Z
https://github.com/MonetDB/MonetDB/issues/6475
753,596,343
6,475
[ "MonetDB", "MonetDB" ]
Date: 2017-11-17 13:21:13 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-11-22 13:53:52 +0100 ## Comment 25899 Date: 2017-11-17 13:21:13 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: On default branch: 0 0x00007f9a03c6769b in raise () from /lib64/libc.so.6 1 0x00007f9a03c694a0 in abort () from /lib64/libc.so.6 2 0x00007f9a03c5fd5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f9a03c5fdd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f99fe6ba978 in exp_bin (be=0x7f99d0009240, e=0x7f99d02ccdd0, left=0x7f99d0365300, right=0x7f99d0365df0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:564 5 0x00007f99fe6c3c52 in rel2bin_project (be=0x7f99d0009240, rel=0x7f99d02cd7e0, refs=0x7f99d0335010, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2467 6 0x00007f99fe6cea7f in subrel_bin (be=0x7f99d0009240, rel=0x7f99d02cd7e0, refs=0x7f99d0335010) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4843 7 0x00007f99fe6c3b7f in rel2bin_project (be=0x7f99d0009240, rel=0x7f99d02ba7c0, refs=0x7f99d0335010, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2455 8 0x00007f99fe6cea7f in subrel_bin (be=0x7f99d0009240, rel=0x7f99d02ba7c0, refs=0x7f99d0335010) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4843 9 0x00007f99fe6c3b7f in rel2bin_project (be=0x7f99d0009240, rel=0x7f99d0309ea0, refs=0x7f99d0335010, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2455 10 0x00007f99fe6cea7f in subrel_bin (be=0x7f99d0009240, rel=0x7f99d0309ea0, refs=0x7f99d0335010) .... Reproducible: Always ### Steps to Reproduce: select subq_0.c14 as c0, subq_0.c15 as c1, ref_3.access as c2, subq_0.c11 as c3, ref_3.id as c4, ref_3.id as c5, cast(nullif(ref_3.id, case when ref_3.system is not NULL then ref_3.schema_id else ref_3.schema_id end ) as int) as c6, cast(coalesce(ref_3.commit_action, cast(coalesce(cast(nullif(ref_3.access, ref_3.commit_action) as smallint), case when subq_0.c15 is NULL then case when ref_3.schema_id is not NULL then ref_3.type else ref_3.type end else case when ref_3.schema_id is not NULL then ref_3.type else ref_3.type end end ) as smallint)) as smallint) as c7, case when true then ref_3.system else ref_3.system end as c8 from sys._tables as ref_3 inner join (select ref_4.name as c0, case when ref_6.commit_action is not NULL then ref_6.commit_action else ref_6.commit_action end as c1, ref_5.x as c2, ref_5.x as c3, ref_6.schema_id as c4, ref_6.name as c5, ref_6.commit_action as c6, ref_5.x as c7, ref_4.default_schema as c8, cast(coalesce(ref_5.y, ref_6.id) as int) as c9, ref_4.name as c10, ref_6.type as c11, ref_6.query as c12, ref_5.y as c13, ref_6.name as c14, cast(nullif(ref_6.id, ref_4.default_schema) as int) as c15, ref_6.system as c16, ref_4.default_schema as c17, ref_5.y as c18, ref_6.query as c19, ref_6.name as c20 from sys.users as ref_4 inner join sys.r2 as ref_5 right join tmp._tables as ref_6 on (ref_5.y is not NULL) on (ref_4.name is NULL) where ref_5.b is NULL) as subq_0 on (ref_3.type is NULL) where EXISTS ( select 87 as c0, 11 as c1, 52 as c2, ref_16.function_type_name as c3, 17 as c4 from (select ref_13.privileges as c0 from sys.privileges as ref_13 where ref_3.name is NULL limit 26) as subq_2 right join sys.statistics as ref_14 right join sys.netcdf_dims as ref_15 on (false) on ((ref_15.dim_id is NULL) or (subq_2.c0 is not NULL)) left join sys.function_types as ref_16 on (subq_0.c1 is not NULL) where true) limit 155; ## Comment 25900 Date: 2017-11-20 14:58:35 +0100 From: @mlkersten Similar issue: select case when false then ref_12.y else ref_12.y end as c0, ref_12.z as c1, ref_12.b as c2, ref_12.b as c3 from sys.s1 as ref_12 where EXISTS ( select ref_12.z as c0, ref_12.y as c1, ref_12.y as c2, subq_1.c0 as c3, cast(nullif(ref_20.nils, ref_20.count) as bigint) as c4, ref_12.x as c5 from (select ref_17.comments as c0, ref_17.comments as c1, ref_12.b as c2, ref_12.x as c3, ref_12.y as c4, ref_17.file_id as c5, ref_17.file_location as c6, ref_17.sorting_order as c7 from bam.files as ref_17 where EXISTS ( select ref_17.sorting_order as c0, ref_18.privilege_code_id as c1, ref_18.privilege_code_name as c2, ref_17.sorting_order as c3, ref_12.y as c4 from sys.privilege_codes as ref_18 where ref_17.comments is not NULL) limit 166) as subq_1 inner join sys.triggers as ref_19 on (subq_1.c3 = ref_19.id ) right join sys.statistics as ref_20 on ((ref_12.b is not NULL) or (true)) where ref_20.stamp is not NULL) limit 30; ## Comment 25901 Date: 2017-11-22 13:53:52 +0100 From: @njnes both give a missing refxxx.b (ie which schema did you use)?
Assertion error in exp_bin (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6474/comments
0
2020-11-30T15:56:26Z
2024-06-27T13:02:04Z
https://github.com/MonetDB/MonetDB/issues/6474
753,596,302
6,474
[ "MonetDB", "MonetDB" ]
Date: 2017-11-16 16:48:09 +0100 From: @swingbit To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @kutsurak Last updated: 2017-11-16 17:11:06 +0100 ## Comment 25893 Date: 2017-11-16 16:48:09 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: This behaves as expected: SELECT * from tables limit 2; These are accepted, and behave as without the LIMIT clause: SELECT * from tables limit2; SELECT * from tables limitabc; SELECT * from tables limitmrxfffiufhmpfruhmp; Reproducible: Always MonetDB 5 server v11.27.10 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0f 25 May 2017 (compiled with OpenSSL 1.1.0f-fips 25 May 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25894 Date: 2017-11-16 16:58:56 +0100 From: @swingbit Actually, it's independent from "limit". This also is accepted and ignored: SELECT * from tables fecrjfmefjref; ## Comment 25896 Date: 2017-11-16 17:03:54 +0100 From: @kutsurak Hi Roberto, This is not actually a bug: An identifier just after a table name is considered an alias by the SQL standard. In essence the following two are exactly equivalent: SELECT * from tables foo; SELECT * FROM tables AS foo; ## Comment 25897 Date: 2017-11-16 17:10:54 +0100 From: @swingbit Ahh, you're right, I completely failed to see it as the alias.
Parser accepts and ignores broken limit clauses
https://api.github.com/repos/MonetDB/MonetDB/issues/6473/comments
0
2020-11-30T15:56:23Z
2024-06-28T06:52:36Z
https://github.com/MonetDB/MonetDB/issues/6473
753,596,271
6,473
[ "MonetDB", "MonetDB" ]
Date: 2017-11-16 14:58:33 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:05 +0100 ## Comment 25891 Date: 2017-11-16 14:58:33 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: 3 0x00007fe29e573dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fe2990ab75a in rel_rename_exps (sql=0x7fe260003e20, exps1=0x7fe260e0a7c0, exps2=0x7fe260e14030) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1869 5 0x00007fe2990b8dde in rel_push_select_down_union (changes=0x7fe27d3688b8, sql=0x7fe260003e20, rel=0x7fe260e0a6b0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4739 6 0x00007fe2990ca9eb in rewrite_topdown (sql=0x7fe260003e20, rel=0x7fe260e0a6b0, rewriter=0x7fe2990b8b4f <rel_push_select_down_union>, has_changes=0x7fe27d3688b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8943 7 0x00007fe2990cab3a in rewrite_topdown (sql=0x7fe260003e20, rel=0x7fe260e09890, rewriter=0x7fe2990b8b4f <rel_push_select_down_union>, has_changes=0x7fe27d3688b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8972 8 0x00007fe2990cab0e in rewrite_topdown (sql=0x7fe260003e20, rel=0x7fe260e0a550, rewriter=0x7fe2990b8b4f <rel_push_select_down_union>, has_changes=0x7fe27d3688b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8965 9 0x00007fe2990cab3a in rewrite_topdown (sql=0x7fe260003e20, rel=0x7fe260df1b90, rewriter=0x7fe2990b8b4f <rel_push_select_down_union>, Reproducible: Always ### Steps to Reproduce: select subq_0.c1 as c0, subq_0.c3 as c1, subq_0.c1 as c2 from (select ref_0.rrsmb as c0, ref_0.ticks as c1, ref_0.thread as c2, 92 as c3, ref_0.majflt as c4, ref_0.stmt as c5, ref_0.minflt as c6, ref_0.majflt as c7, ref_0.majflt as c8, 36 as c9, ref_0.writes as c10, ref_0.writes as c11, ref_0.thread as c12, ref_0.thread as c13 from sys.tracelog as ref_0 where ref_0.rrsmb is NULL limit 90) as subq_0 where EXISTS ( select subq_0.c9 as c0, subq_0.c13 as c1, ref_3.name as c2, ref_3.length as c3, ref_5.rkey as c4 from sys.netcdf_dims as ref_3 inner join tmp._columns as ref_4 left join tmp.keys as ref_5 on (true) on (ref_3.name = ref_5.name ) left join (select subq_0.c1 as c0 from sys._tables as ref_6 where ref_6.access is not NULL) as subq_1 on ((true) or (true)) where true); ## Comment 25910 Date: 2017-11-26 10:10:29 +0100 From: @njnes merged or expressions fixed the bug
Assertion failure in rel_rename (Sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6472/comments
0
2020-11-30T15:56:20Z
2024-06-27T13:02:02Z
https://github.com/MonetDB/MonetDB/issues/6472
753,596,225
6,472
[ "MonetDB", "MonetDB" ]
Date: 2017-11-16 10:37:46 +0100 From: @sjoerdmullender To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-12-14 14:46:01 +0100 ## Comment 25889 Date: 2017-11-16 10:37:46 +0100 From: @sjoerdmullender Nothing more needs to be said: sql>create table t (i) as (select * from sys.generate_series(0, 10000000, 1)); overflow in conversion of 10000000 to bte. ## Comment 25936 Date: 2017-12-03 16:24:17 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [fa09cb21a5c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa09cb21a5c8) 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=fa09cb21a5c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fa09cb21a5c8) Changeset description: improved function resolution, fixing Bugs 6436 and 6471 ## Comment 25937 Date: 2017-12-03 16:24:44 +0100 From: @njnes improved function resolution and type checking
calls to sys.generate_series should auto-convert arguments
https://api.github.com/repos/MonetDB/MonetDB/issues/6471/comments
0
2020-11-30T15:56:17Z
2024-06-27T13:02:01Z
https://github.com/MonetDB/MonetDB/issues/6471
753,596,177
6,471
[ "MonetDB", "MonetDB" ]
Date: 2017-11-16 10:34:03 +0100 From: @sjoerdmullender To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes, @drstmane Last updated: 2017-12-14 14:46:07 +0100 ## Comment 25887 Date: 2017-11-16 10:34:03 +0100 From: @sjoerdmullender When you have a large table and do a simple select, mitosis kicks in and splits up the select in pieces, just to combine the (basically unaltered) pieces again before returning them. Try this: create table t (i) as (select * from sys.generate_series(cast(0 as integer), 10000000, 1)); explain select * from t limit 1000; explain select * from t; Both selects use mitosis. This bug is derived from bug #6462. ## Comment 25890 Date: 2017-11-16 12:54:56 +0100 From: @drstmane Indeed, there is not much value in parallelizing query parts that do not (significantly) reduce the data volume (or do not have worse than linear complexity, or do not have significant CPU cost). We need to find a robust way to detect such situations easily and generically ... ## Comment 25916 Date: 2017-11-26 18:35:43 +0100 From: @njnes make sure a simple topn(project(basetable)) (or smaller) query isn't parallelised (as its only output production) ## Comment 25918 Date: 2017-11-26 20:46:37 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [ffab2b52402d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ffab2b52402d) 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=ffab2b52402d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ffab2b52402d) Changeset description: fixes for bug #6470 (it seems to hint on new problems in the thetaselect though)
mitosis gets in the way of simple select
https://api.github.com/repos/MonetDB/MonetDB/issues/6470/comments
0
2020-11-30T15:56:13Z
2024-06-27T13:02:00Z
https://github.com/MonetDB/MonetDB/issues/6470
753,596,125
6,470
[ "MonetDB", "MonetDB" ]
Date: 2017-11-15 16:46:03 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2018-01-10 10:34:13 +0100 ## Comment 25881 Date: 2017-11-15 16:46:03 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: I have experienced intermittent crashes in monetdb. The error messages say "tail type mismatch" or "Cannot subtract delete column". Unfortunately I cannot reproduce them deterministically, but they seem to occur quite often. Are you aware of these problems, and what may be the cause ? thanks Reproducible: Couldn't Reproduce ## Comment 25882 Date: 2017-11-15 17:07:38 +0100 From: @sjoerdmullender You indicate that you're using the Jul2017-SP2 release. Is that correct? Was your database by any chance upgraded from the Jul2017 or Jul2017-SP1 release? If so, that may well be the problem. See the release notes [1], especially the first line after the title for the SP2 release, and the text just above the title for the SP1 release. Also the email at [2]. [1] https://www.monetdb.org/Downloads/ReleaseNotes [2] https://www.monetdb.org/pipermail/announce-list/2017-October/000113.html ## Comment 25883 Date: 2017-11-15 17:07:38 +0100 From: @sjoerdmullender You indicate that you're using the Jul2017-SP2 release. Is that correct? Was your database by any chance upgraded from the Jul2017 or Jul2017-SP1 release? If so, that may well be the problem. See the release notes [1], especially the first line after the title for the SP2 release, and the text just above the title for the SP1 release. Also the email at [2]. [1] https://www.monetdb.org/Downloads/ReleaseNotes [2] https://www.monetdb.org/pipermail/announce-list/2017-October/000113.html ## Comment 25884 Date: 2017-11-15 17:57:19 +0100 From: Manuel &lt;<manuel>&gt; (In reply to Sjoerd Mullender from comment 2) > You indicate that you're using the Jul2017-SP2 release. Is that correct? > > Was your database by any chance upgraded from the Jul2017 or Jul2017-SP1 > release? If so, that may well be the problem. > > See the release notes [1], especially the first line after the title for the > SP2 release, and the text just above the title for the SP1 release. Also > the email at [2]. > > [1] https://www.monetdb.org/Downloads/ReleaseNotes > [2] https://www.monetdb.org/pipermail/announce-list/2017-October/000113.html Hi Sjoerd, thank you for your answer yes I am using the latest version of monetdb as of this writing (Jul2017-SP2). I recently upgraded my db farm from Dec2016-SP5, but the tables have been created with the newest version of monetdb. Are the two types of crashes related ? What could be the cause of them ? thanks! Manuel ## Comment 25885 Date: 2017-11-15 18:10:29 +0100 From: Manuel &lt;<manuel>&gt; I suspect it is happening when the table is queries shortly after it has been created. regards Manuel ## Comment 26049 Date: 2017-12-23 15:23:52 +0100 From: @njnes anymore crashes with clean databases being created with SP2 and up? ## Comment 26066 Date: 2018-01-10 10:34:13 +0100 From: Manuel &lt;<manuel>&gt; (In reply to Niels Nes from comment 5) > anymore crashes with clean databases being created with SP2 and up? The database was created using sp2. Haven't seen since the upgrade to sp3.
Monetdb crashes
https://api.github.com/repos/MonetDB/MonetDB/issues/6469/comments
0
2020-11-30T15:56:09Z
2024-06-27T13:01:59Z
https://github.com/MonetDB/MonetDB/issues/6469
753,596,075
6,469
[ "MonetDB", "MonetDB" ]
Date: 2017-11-15 11:13:34 +0100 From: @swingbit To: Martin van Dinther &lt;<martin.van.dinther>&gt; Version: 11.23.13 (Jun2016-SP2) CC: martin.van.dinther Last updated: 2018-05-31 18:44:02 +0200 ## Comment 25877 Date: 2017-11-15 11:13:34 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: JDBC 2.27: Welcome to the MonetDB interactive JDBC terminal! Database Server: MonetDB v11.27.10 JDBC Driver: MonetDB Native Driver v2.27 (Liberica 20171023 based on MCL v1.16) Current Schema: spinque Type \q to quit, \h for a list of available commands auto commit mode: on sql> select cast('0033-12-25' as date); +------------+ | L2 | +============+ |Error [22007]: Could not convert value to a Date. Expected JDBC date escape format yyyy-[m]m-[d]d. null sql> JDBC 2.26: Welcome to the MonetDB interactive JDBC terminal! Database Server: MonetDB v11.27.10 JDBC Driver: MonetDB Native Driver v2.26 (Liberica 20170728 based on MCL v1.15) Current Schema: spinque Type \q to quit, \h for a list of available commands auto commit mode: on sql> select cast('0033-12-25' as date); +------------+ | L2 | +============+ | 0033-12-25 | +------------+ 1 row Elapsed Time: 11 ms sql> MCLIENT: Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.10 (unreleased), 'mapi:monetdb://photon.hq.spinque.com:55500/x' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select cast('0033-12-25' as date); +------------+ | L2 | +============+ | 33-12-25 | +------------+ 1 tuple (1.157ms) sql> Reproducible: Always ## Comment 25895 Date: 2017-11-16 17:01:32 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; I couldn't reproduce this with the JdbcClient program. I tested all versions of jdbcclient.jar from 2.27 back to 2.21. However I know the error is thrown from method MonetResultSet.getDate(int, Calendar). I could reproduce the problem with the JDBC driver (monetdb-jdbc-2.27.jar) used from SQuirreL (which uses getObject() which calls getDate() when the result column data type is date). It appears that the standard java method https://docs.oracle.com/javase/7/docs/api/java/sql/Date.htmlvalueOf(java.lang.String) which convert a String to a Date object fails to do this for years which do not have 4 digits. I will make a fix for this. ## Comment 25898 Date: 2017-11-16 18:58:57 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset 95b48b249f68, 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=95b48b249f68 Changeset description: First fix for bug #6468 Works now for all years between 1 and 999, but not yet correct for negative years (-33 is shown as 0034). ToDo: also make and include test program ## Comment 26041 Date: 2017-12-21 13:03:14 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; Completed fix and extended test program https://dev.monetdb.org/hg/monetdb-java/rev/376a15ce49e3 https://dev.monetdb.org/hg/MonetDB/rev/b9bcb4267074 ## Comment 26472 Date: 2018-05-31 18:44:02 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; A new version (2.28) of the MonetDB JDBC driver is released, see https://www.monetdb.org/downloads/Java/ which includes the fix.
JDBC 2.27 fails with year < 1000
https://api.github.com/repos/MonetDB/MonetDB/issues/6468/comments
0
2020-11-30T15:56:05Z
2024-06-27T13:01:58Z
https://github.com/MonetDB/MonetDB/issues/6468
753,596,022
6,468
[ "MonetDB", "MonetDB" ]
Date: 2017-11-14 05:49:27 +0100 From: Antoine Jouanjean &lt;<antoine.jouanjean>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-12-14 14:46:01 +0100 ## Comment 25875 Date: 2017-11-14 05:49:27 +0100 From: Antoine Jouanjean &lt;<antoine.jouanjean>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: Date/time format specifiers for week number and days name does not seems to work properly. Reproducible: Always ### Steps to Reproduce: ❯ mclient -d demodb Welcome to mclient, the MonetDB/SQL interactive terminal (Jul2017-SP2) Database: MonetDB v11.27.9 (Jul2017-SP2), 'mapi:monetdb://theserver:50000/demodb' Type \q to quit, \? for a list of available commands auto commit mode: on sql>SELECT CURRENT_DATE, EXTRACT(year from current_date), date_to_str(CURRENT_DATE, '%Y %m %d -A:%A -G:%G V:%V w:%w W:%W'); +------------+------+--------------------------------------------+ | L2 | L4 | L6 | +============+======+============================================+ | 2017-11-14 | 2017 | 2017 11 14 -A:Sunday -G:2016 V:52 w:0 W:00 | +------------+------+--------------------------------------------+ ### Actual Results: +------------+------+--------------------------------------------+ | L2 | L4 | L6 | +============+======+============================================+ | 2017-11-14 | 2017 | 2017 11 14 -A:Sunday -G:2016 V:52 w:0 W:00 | +------------+------+--------------------------------------------+ ### Expected Results: +------------+------+---------------------------------------------+ | L2 | L4 | L6 | +============+======+=============================================+ | 2017-11-14 | 2017 | 2017 11 14 -A:Tuesday -G:2017 V:46 w:2 W:46 | +------------+------+---------------------------------------------+ Thought of a localization issue but `LC_ALL=C mclient -d demodb` gives identical results ## Comment 25878 Date: 2017-11-15 14:26:21 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [9fc902729295](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9fc902729295) 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=9fc902729295](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9fc902729295) Changeset description: re-init the tm structure using mktime (solves bug #6467). ## Comment 25879 Date: 2017-11-15 14:41:00 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [525499af2586](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=525499af2586) 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=525499af2586](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=525499af2586) Changeset description: fixed bug #6467 ## Comment 25880 Date: 2017-11-15 14:41:25 +0100 From: @njnes Fixed by finishing the initialization of the tm struct using mktime().
date_to_str formatter is wrong
https://api.github.com/repos/MonetDB/MonetDB/issues/6467/comments
0
2020-11-30T15:56:01Z
2024-06-27T13:01:57Z
https://github.com/MonetDB/MonetDB/issues/6467
753,595,968
6,467
[ "MonetDB", "MonetDB" ]
Date: 2017-11-13 17:34:34 +0100 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.25.23 (Dec2016-SP5) Last updated: 2017-11-13 17:34:34 +0100 ## Comment 25874 Date: 2017-11-13 17:34:34 +0100 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: It would be nice to have the MODE of a field as a native measure, so that one will be able to do queries like SELECT MODE(X), MEDIAN(Y) .... from ... group by .... Reproducible: Always ### Expected Results: MODE(X) would return the equivalent of select "X" from (select "X", count(1) as "count" from "T0" group by "X") as "T1" order by "count" desc limit 1; but with the advantage of being able to specify other measures in the same query, and more importantly, being able to use the query with the mode function as a sub-query
Mode measure
https://api.github.com/repos/MonetDB/MonetDB/issues/6466/comments
0
2020-11-30T15:55:58Z
2024-06-28T13:39:41Z
https://github.com/MonetDB/MonetDB/issues/6466
753,595,940
6,466
[ "MonetDB", "MonetDB" ]
Date: 2017-11-13 15:27:36 +0100 From: @sjoerdmullender To: GDK devs &lt;<bugs-common>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2017-12-14 14:46:00 +0100 ## Comment 25873 Date: 2017-11-13 15:27:36 +0100 From: @sjoerdmullender The SQL front end uses the force flag in calls to BATappend and other BAT changing functions to overrule the read-only setting of the BAT because SQL maintains its own recovery mechanism. The understanding SQL has is that by appending, the already existing part of the BAT is not changed, and so recovery in the case of a crash (or just exit) before the appended data was properly committed consists of just replaying the appends (which are stored in the write-ahead log). This works fine for the most part. The string heap of string BATs don't just append, but this is already handled by the recovery code. The problem here is that other atom heaps of variable sized atoms (e.g. BLOB) also modify more in the heap when data gets appended, and these modifications are not handled when the heap is recovered at startup. ## Comment 25876 Date: 2017-11-14 14:44:42 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7253f70231be](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7253f70231be) 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=7253f70231be](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7253f70231be) Changeset description: Recover varheaps on first loading after startup. This fixes bug #6465. ## Comment 25902 Date: 2017-11-23 14:56:33 +0100 From: @sjoerdmullender I believe this is now fixed.
appending to variables sized atom bats other than str bats with force flag may result in corrupted heap
https://api.github.com/repos/MonetDB/MonetDB/issues/6465/comments
0
2020-11-30T15:55:55Z
2024-06-27T13:01:55Z
https://github.com/MonetDB/MonetDB/issues/6465
753,595,896
6,465
[ "MonetDB", "MonetDB" ]
Date: 2017-11-11 23:50:06 +0100 From: @drstmane To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-11-26 18:32:46 +0100 ## Comment 25865 Date: 2017-11-11 23:50:06 +0100 From: @drstmane When loading data via COPY LOADER INFO using a PYTHON LOADER function, but omitting columns in the emit() statements, the implementation of the emit() function replaces these columns by NULL values, rather than skipping these columns using the columns' default values --- I'm not sure which part of the code does / is supposed to take care of using default values for omitted columns --- thus effectively overruling the default, incl. triggering unexpected errors in case an omitted columns has a default other than NULL and is (explicitly or implicitly) declared NOT NULL. As an example, for this code: CREATE LOADER myloader(x integer, y string) LANGUAGE PYTHON { z={} i=0 for j in ('a','b','c','d','e','f','g'): i += 1 if j in y: z[j] = x - i _emit.emit(z) }; create table t ( a integer auto_increment primary key, b integer generated always as identity (start with 2) unique, c integer generated always as identity (start with 3) not null, d integer generated always as identity (start with 4), e integer default 5 not null, f integer default 6, g integer ); COPY LOADER INTO t FROM myloader(-10,'abcdefg'); COPY LOADER INTO t FROM myloader(-20,'abcdef'); COPY LOADER INTO t FROM myloader(-30,'abcdeg'); COPY LOADER INTO t FROM myloader(-40,'abcdfg'); COPY LOADER INTO t FROM myloader(-50,'abcefg'); COPY LOADER INTO t FROM myloader(-60,'abdefg'); COPY LOADER INTO t FROM myloader(-70,'acdefg'); COPY LOADER INTO t FROM myloader(-80,'bcdefg'); select * from t; drop table t; drop loader myloader; We get this results: operation successful operation successful 1 affected row 1 affected row 1 affected row INSERT INTO: NOT NULL constraint violated for column t.e 1 affected row INSERT INTO: NOT NULL constraint violated for column t.c 1 affected row INSERT INTO: NOT NULL constraint violated for column t.a +------+------+------+------+------+------+------+ | a | b | c | d | e | f | g | +======+======+======+======+======+======+======+ | -11 | -12 | -13 | -14 | -15 | -16 | -17 | | -21 | -22 | -23 | -24 | -25 | -26 | null | | -31 | -32 | -33 | -34 | -35 | null | -37 | | -51 | -52 | -53 | null | -55 | -56 | -57 | | -71 | null | -73 | -74 | -75 | -76 | -77 | +------+------+------+------+------+------+------+ 5 tuples operation successful operation successful While we would expect this results: operation successful 1 affected row 1 affected row 1 affected row 1 affected row 1 affected row, last generated key: 4 1 affected row, last generated key: 3 1 affected row, last generated key: 2 1 affected row, last generated key: 1 +------+------+------+------+------+------+------+ | a | b | c | d | e | f | g | +======+======+======+======+======+======+======+ | -11 | -12 | -13 | -14 | -15 | -16 | -17 | | -21 | -22 | -23 | -24 | -25 | -26 | null | | -31 | -32 | -33 | -34 | -35 | 6 | -37 | | -41 | -42 | -43 | -44 | 5 | -46 | -47 | | -51 | -52 | -53 | 4 | -55 | -56 | -57 | | -61 | -62 | 3 | -64 | -65 | -66 | -67 | | -71 | 2 | -73 | -74 | -75 | -76 | -77 | | 1 | -82 | -83 | -84 | -85 | -86 | -87 | +------+------+------+------+------+------+------+ 8 tuples operation successful ## Comment 25866 Date: 2017-11-11 23:53:27 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [b6e8be70fea0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b6e8be70fea0) 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=b6e8be70fea0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b6e8be70fea0) Changeset description: added test for bug #6464 ## Comment 25911 Date: 2017-11-26 10:16:03 +0100 From: @njnes the test has been approved with the correct result (as far as I can see). ## Comment 25912 Date: 2017-11-26 13:02:52 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0f5827e686f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0f5827e686f3) 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=0f5827e686f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0f5827e686f3) Changeset description: test for Bug-6464: undo output approval of changeset [b3bc5cb7c32e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3bc5cb7c32e) on default branch, only; while the behaviour in the Jul2017 release branch will not change, i.e., the Python loader does not support default values, I consider bug #6464 (still/now) a feature request for the default branch and have the (failing) test (with "desired" output) remind us of it. ## Comment 25913 Date: 2017-11-26 13:05:41 +0100 From: @drstmane While the bug is "fixed" in the Jul2017 branch by accepting that the Python loader does not support default values, and making it throw an error message, I consider this now a feature request for the default branch and have the (failing) test (with "desired" output) remind us of it. ## Comment 25915 Date: 2017-11-26 18:32:46 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [dc98e14ee24a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=dc98e14ee24a) 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=dc98e14ee24a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=dc98e14ee24a) Changeset description: test for Bug-6464: undo output approval of changeset [b3bc5cb7c32e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b3bc5cb7c32e) on default branch, only; while the behaviour in the Jul2017 release branch will not change, i.e., the Python loader does not support default values, I consider bug #6464 (still/now) a feature request for the default branch and have the (failing) test (with "desired" output) remind us of it.
Python loader / COPY LOADER INTO overrules defaults with NUL
https://api.github.com/repos/MonetDB/MonetDB/issues/6464/comments
0
2020-11-30T15:55:52Z
2024-06-28T13:39:41Z
https://github.com/MonetDB/MonetDB/issues/6464
753,595,872
6,464
[ "MonetDB", "MonetDB" ]
# Deleted Bugzilla Bug Date: 2020-11-30T15:44:36Z 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/6463/comments
0
2020-11-30T15:55:50Z
2020-11-30T15:55:52Z
https://github.com/MonetDB/MonetDB/issues/6463
753,595,834
6,463
[ "MonetDB", "MonetDB" ]
Date: 2017-11-09 16:40:36 +0100 From: Anton Kravchenko &lt;<kravchenko.anton86>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: kravchenko.anton86, @njnes Last updated: 2017-12-14 14:46:07 +0100 ## Comment 25859 Date: 2017-11-09 16:40:36 +0100 From: Anton Kravchenko &lt;<kravchenko.anton86>&gt; User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36 Build Identifier: 1) 'select v_blob from blob_table' produces a virtual memory spike ~800Gb [using a 'limit' reproduces virtual memory spike too] From 'select * from storage()' it looks like a blob column size is ~25Gb. 2) And 'create table new_blob_table as (select v_blob from blob_table) with data;' consumes only ~50Gb of virtual memory. 3) Also for a table with non-blob column both 'select * from nonblob_table' and 'create new_nonblobtable as (select * from nonblob_table) with data;' consume the ~same virtual memory. Reproducible: Always ### Steps to Reproduce: 1. to generate data by using Python hex_blob='47'*2000 hex_blob_chunk=(hex_blob+'\n')*1000 f=open('blob_data.txt','w') for irow in range(10000): f.write(hex_blob_chunk) f.close() 2. to load data into Monet blob_table create table blob_table(v_blob blob); COPY 10000000 RECORDS INTO blob_table FROM '/home/blob_data.txt' using delimiters ',','\n' NULL AS '' LOCKED; 3. to produce virtual memory spike of ~800GB select * from blob_table limit 50000; ### Actual Results: virtual memory spike of ~800GB ### Expected Results: virtual memory of ~25GB [MonetDB storage size of the blob column] MonetDB 5 server v11.27.9 "Jul2017-SP2" (64-bit, 128-bit integers) Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 503.6GiB available memory, 32 available cpu cores Libraries: libpcre: 8.39 2016-06-14 (compiled with 8.32) openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2l 25 May 2017) libxml2: 2.9.1 (compiled with 2.9.1) Compiled by: akravchenko@cent7-1 (x86_64-pc-linux-gnu) Compilation: gcc -O3 -fomit-frame-pointer -pipe -D_FORTIFY_SOURCE=2 Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25872 Date: 2017-11-12 16:25:57 +0100 From: @njnes the spike is caused by concurrent worker threads. They all make a slice of the inputs, combined with aggressive heap-copying this results in gdk_nr_threads*25GB (on my test system 200GB, with 8 threads). You have 32 ie leading to even more copies. ## Comment 25886 Date: 2017-11-16 10:11:32 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [230412789aec](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=230412789aec) 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=230412789aec](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=230412789aec) Changeset description: Try much harder to share vheaps of transient bats. This fixes bug #6462, or at least the part about the (virtual) memory consumption. ## Comment 25888 Date: 2017-11-16 10:35:39 +0100 From: @sjoerdmullender The query now runs very fast and does not produce a spike in VM use. For the slicing that also shouldn't happen, see bug #6470.
large virtual memory spike on BLOB column select
https://api.github.com/repos/MonetDB/MonetDB/issues/6462/comments
0
2020-11-30T15:55:47Z
2024-06-27T13:01:53Z
https://github.com/MonetDB/MonetDB/issues/6462
753,595,782
6,462
[ "MonetDB", "MonetDB" ]
Date: 2017-11-09 12:33:42 +0100 From: @mlkersten To: clients devs &lt;<bugs-clients>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2018-08-28 09:46:42 +0200 ## Comment 25856 Date: 2017-11-09 12:33:42 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: The Mclient uses the dump functions, but it does not support dumping Python or R scripts. Reproducible: Always ## Comment 25903 Date: 2017-11-23 14:59:18 +0100 From: @sjoerdmullender Fixed in changeset [c709820aef3f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c709820aef3f) and [c16655e0757e](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c16655e0757e) in the Jul2017 branch. Can you test?
Dumping python and R UDFs
https://api.github.com/repos/MonetDB/MonetDB/issues/6461/comments
0
2020-11-30T15:55:44Z
2024-06-27T13:01:52Z
https://github.com/MonetDB/MonetDB/issues/6461
753,595,757
6,461
[ "MonetDB", "MonetDB" ]
Date: 2017-11-04 23:04:56 +0100 From: @sjoerdmullender To: buildtools devs &lt;<bugs-buildtools>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2017-11-05 12:57:02 +0100 ## Comment 25849 Date: 2017-11-04 23:04:56 +0100 From: @sjoerdmullender When running on Fedora 27 under systemd with SELinux enabled (and MonetDB-selinux installed), SELinux prevents mserver5 from using mmap. AVC avc: denied { map } for pid=24559 comm="mserver5" path="/var/monetdb5/dbfarm/database/bat/04/407.theap" dev="nvme0n1p3" ino=2360534 scontext=system_u:system_r:mserver5_t:s0 tcontext=system_u:object_r:mserver5_db_t:s0 tclass=file permissive=0 ## Comment 25850 Date: 2017-11-05 12:55:05 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a86d789c71f7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a86d789c71f7) 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=a86d789c71f7](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a86d789c71f7) Changeset description: Fix for bug #6460. This is a small patch on top of the Jul2017-SP2 release specifically for Fedora 27 to allow mserver5 running under monetdbd running under the control of systemd to perform mmap calls when SELinux is enabled. ## Comment 25851 Date: 2017-11-05 12:57:02 +0100 From: @sjoerdmullender I have created a new MonetDB-selinux RPM for Fedora 27 fixing this issue.
selinux doen't allow mmap
https://api.github.com/repos/MonetDB/MonetDB/issues/6460/comments
0
2020-11-30T15:55:41Z
2024-06-27T13:01:51Z
https://github.com/MonetDB/MonetDB/issues/6460
753,595,729
6,460
[ "MonetDB", "MonetDB" ]
Date: 2017-11-02 23:05:36 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:08 +0100 ## Comment 25840 Date: 2017-11-02 23:05:36 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: After recompilation this assertion is still triggered. 3 0x00007f6c00f2edd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f6bfb98d174 in exp_bin (be=0x7f6bc8129b10, e=0x7f6bc82a87a0, left=0x7f6bc8348900, right=0x0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:734 5 0x00007f6bfb995e18 in rel2bin_select (be=0x7f6bc8129b10, rel=0x7f6bc82a7db0, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2629 6 0x00007f6bfb9a0038 in subrel_bin (be=0x7f6bc8129b10, rel=0x7f6bc82a7db0, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4840 7 0x00007f6bfb99517d in rel2bin_project (be=0x7f6bc8129b10, rel=0x7f6bc82a7a20, refs=0x7f6bc82f9610, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2455 8 0x00007f6bfb9a000a in subrel_bin (be=0x7f6bc8129b10, rel=0x7f6bc82a7a20, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4836 9 0x00007f6bfb992970 in rel2bin_semijoin (be=0x7f6bc8129b10, rel=0x7f6bc82a7c50, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1925 10 0x00007f6bfb99ff50 in subrel_bin (be=0x7f6bc8129b10, rel=0x7f6bc82a7c50, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4820 11 0x00007f6bfb99517d in rel2bin_project (be=0x7f6bc8129b10, rel=0x7f6bc82814e0, refs=0x7f6bc82f9610, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2455 12 0x00007f6bfb9a000a in subrel_bin (be=0x7f6bc8129b10, rel=0x7f6bc82814e0, refs=0x7f6bc82f9610) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4836 13 0x00007f6bfb9a0301 in output_rel_bin (be=0x7f6bc8129b10, rel=0x7f6bc82814e0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4901 14 0x00007f6bfb9bc104 in sql_relation2stmt (be=0x7f6bc8129b10, r=0x7f6bc82814e0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_gencode.c:531 15 0x00007f6bfb9bc30d in backend_dumpstmt (be=0x7f6bc8129b10, mb=0x7f6bc812a170, Reproducible: Always ### Steps to Reproduce: select subq_0.c0 as c0 from (select ref_2.coord_dimension as c0 from sys.geometry_columns as ref_2 where ref_2.f_table_catalog is not NULL limit 127) as subq_0 where EXISTS ( select ref_4.srtext as c0, ref_4.auth_srid as c1, 37 as c2, subq_0.c0 as c3, ref_5.minflt as c4 from sys.spatial_ref_sys as ref_4 right join sys.tracelog as ref_5 on (ref_4.proj4text = ref_5.clk ) where case when EXISTS ( select subq_0.c0 as c0, ref_4.proj4text as c1, ref_5.thread as c2, subq_0.c0 as c3, ref_6.commit_action as c4 from sys.tables as ref_6 where false) then ref_4.auth_srid else ref_4.auth_srid end is not NULL); ## Comment 25848 Date: 2017-11-03 21:55:12 +0100 From: @mlkersten Another example of the same problem. select cast(coalesce(cast(coalesce(subq_0.c0, subq_0.c0) as clob), subq_0.c0) as clob) as c0, subq_0.c3 as c1, subq_0.c1 as c2, subq_0.c2 as c3, subq_0.c1 as c4, subq_0.c2 as c5, subq_0.c1 as c6, subq_0.c2 as c7, subq_0.c0 as c8, subq_0.c2 as c9, subq_0.c3 as c10 from (select ref_0.z as c0, ref_0.x as c1, case when false then ref_0.x else ref_0.x end as c2, case when EXISTS ( select ref_0.x as c0, ref_1.type as c1, ref_0.y as c2, ref_0.y as c3, 44 as c4, ref_0.z as c5, ref_0.y as c6, ref_1.id as c7 from sys.tables as ref_1 where EXISTS ( select ref_0.y as c0, ref_2.login_id as c1, ref_2.login_id as c2 from sys.user_role as ref_2 where ref_0.x is NULL)) then ref_0.y else ref_0.y end as c3 from sys.r2 as ref_0 where ref_0.y is NULL limit 72) as subq_0 where case when 86 is NULL then subq_0.c1 else subq_0.c1 end is NULL; ## Comment 25852 Date: 2017-11-08 21:57:45 +0100 From: @njnes fixed by improved handling of subqueries in the optimizers. Now before any optimizer is run the subquery flags are reset. ## Comment 25854 Date: 2017-11-08 21:59:03 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0d8fd1c7710c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d8fd1c7710c) 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=0d8fd1c7710c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0d8fd1c7710c) Changeset description: fixed bug #6459 and bug #6456
Assertion error in exp_bin (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6459/comments
0
2020-11-30T15:55:39Z
2024-06-27T13:01:50Z
https://github.com/MonetDB/MonetDB/issues/6459
753,595,696
6,459
[ "MonetDB", "MonetDB" ]
Date: 2017-11-02 18:55:40 +0100 From: @swingbit To: GDK devs &lt;<bugs-common>&gt; Version: 11.27.9 (Jul2017-SP2) Last updated: 2017-11-03 10:49:53 +0100 ## Comment 25836 Date: 2017-11-02 18:55:40 +0100 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: This seems similar to bugs 6317 and 6321. Data is available at this link: https://drive.google.com/open?id=0BwkuZ5tb4WEnTTV2RTVTaDFxYXM It consists of one table of ~ 70M rows: CREATE TABLE "dt" ( "a1" INTEGER, "a2" INTEGER, "prob" DOUBLE ); This table is sorted on column a1 (I have even run ANALYZE to make sure it gets marked as sorted). With this data, the following completes in 12s on my machine: CREATE TABLE x AS SELECT a1, a2, cast(1 as double) AS prob FROM dt GROUP BY a1, a2 WITH DATA; The following (sum instead of constant 1), eats up all memory (16GB) and gets killed by the OS: CREATE TABLE x AS SELECT a1, a2, sum(prob) AS prob FROM dt GROUP BY a1, a2 WITH DATA; Reproducible: Always Branch Jul2017 on changeset 65447:25b47b5e79b2 $ mserver5 --version MonetDB 5 server v11.27.10 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.1.0f 25 May 2017 (compiled with OpenSSL 1.1.0f-fips 25 May 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -O3 -fomit-frame-pointer -pipe -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wunreachable-code -D_FORTIFY_SOURCE=2 Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25837 Date: 2017-11-02 19:02:28 +0100 From: @swingbit Using aggregations min / max / prod also completes in 10-12 seconds. Only sum is the problem ## Comment 25838 Date: 2017-11-02 19:04:56 +0100 From: @swingbit Possibly related to changeset 65038:f7a7cc576c0a ? ## Comment 25839 Date: 2017-11-02 19:18:31 +0100 From: @swingbit To be noted: this table is already *almost* grouped on a1,a2. 70039519 groups come out of the initial 70991479 rows. ## Comment 25841 Date: 2017-11-03 09:21:23 +0100 From: @sjoerdmullender Can you try changing the 32 somewhere near the beginning of function dofsum to 3? ## Comment 25842 Date: 2017-11-03 09:37:52 +0100 From: @sjoerdmullender Also change the call to GDKrealloc to include *sizeof(double) (second arg should be "pergroup[grp].maxpartials * sizeof(double)"). ## Comment 25843 Date: 2017-11-03 10:19:36 +0100 From: @swingbit I applied both changes and it works now, although a bit slower than other aggregations (~20s vs. ~12s). I see that you committed the change to GDKrealloc already. Also with that fixed, maxpartials=32 makes it fail. ## Comment 25844 Date: 2017-11-03 10:27:20 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [4d0e87f34f62](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4d0e87f34f62) 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=4d0e87f34f62](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4d0e87f34f62) Changeset description: Be less resource hungry during floating point summation. We use smaller types where we can, especially when we need lots of them. Also preallocate fewer spaces for partial results. This should fix bug #6458. ## Comment 25845 Date: 2017-11-03 10:30:04 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 6) > I applied both changes and it works now, although a bit slower than other > aggregations (~20s vs. ~12s). > > I see that you committed the change to GDKrealloc already. > > Also with that fixed, maxpartials=32 makes it fail. Doesn't surprise me at all. GDKrealloc wasn't called with maxpartials=32, so it wasn't called incorrectly either. As you've seen, I have committed a fuller change, part of which is to reduce maxpartials (to 2 now). The patch also uses a smaller pergroup struct, so we now allocate far less memory. ## Comment 25846 Date: 2017-11-03 10:41:52 +0100 From: @swingbit Tested last changeset, it works well. ## Comment 25847 Date: 2017-11-03 10:49:53 +0100 From: @sjoerdmullender (In reply to Roberto Cornacchia from comment 6) > I applied both changes and it works now, although a bit slower than other > aggregations (~20s vs. ~12s). Unfortunately, correctness almost always comes at a cost. (In reply to Roberto Cornacchia from comment 9) > Tested last changeset, it works well. That means I can close this.
Floating-point sum aggregation out of memory
https://api.github.com/repos/MonetDB/MonetDB/issues/6458/comments
0
2020-11-30T15:55:35Z
2024-06-27T13:01:49Z
https://github.com/MonetDB/MonetDB/issues/6458
753,595,654
6,458
[ "MonetDB", "MonetDB" ]
Date: 2017-10-31 11:55:24 +0100 From: @kutsurak To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-11-01 16:25:07 +0100 ## Comment 25826 Date: 2017-10-31 11:55:24 +0100 From: @kutsurak User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Non admin users cannot select from some system tables. This prevents the \d command in mclient from working correctly Reproducible: Always ### Steps to Reproduce: 1. create user "foo" with password 'foo' name 'foo' schema "sys"; 2. select * from sys.objects; ### Actual Results: SELECT: access denied for foo to table 'sys.objects' The restricted tables are: sys.keys sys.idxs sys.triggers sys.objects sys.db_user_info sys.users sys.querylog_catalog sys.querylog_calls sys.querylog_history sys.tracelog sys.sessiona sys.optimizers sys.queue sys.rejects sys.storage sys.storagemodelinput sys.storagemodel sys.tablestoragemodel sys.statistics Not sure if all of these should be open though. ## Comment 25833 Date: 2017-11-01 16:25:07 +0100 From: @njnes on the stable this seems to work just fine.
Users don't have access to system tables
https://api.github.com/repos/MonetDB/MonetDB/issues/6457/comments
0
2020-11-30T15:55:32Z
2024-06-28T06:53:10Z
https://github.com/MonetDB/MonetDB/issues/6457
753,595,619
6,457
[ "MonetDB", "MonetDB" ]
Date: 2017-10-31 11:21:58 +0100 From: @joerivanruth To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-12-14 14:46:04 +0100 ## Comment 25825 Date: 2017-10-31 11:21:58 +0100 From: @joerivanruth User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: I have three databases running on mapi:monetdb://localhost:50001/slave1 mapi:monetdb://localhost:50002/slave2 mapi:monetdb://localhost:50003/master They are initialized with the following scripts -- all of them DROP SCHEMA IF EXISTS foo; CREATE SCHEMA foo; SET SCHEMA foo; CREATE TABLE data_local (origin CHAR(5), dest CHAR(5)); INSERT INTO data_local VALUES -- flights from foo to bar and vice versa ('foo', 'bar'), ('bar', 'foo'), ('foo', 'bar'), -- but one way only from foo to baz ('foo', 'baz'); -- master CREATE REMOTE TABLE data_slave1 (LIKE data_local) ON 'mapi:monetdb://localhost:50001/slave1'; CREATE REMOTE TABLE data_slave2 (LIKE data_local) ON 'mapi:monetdb://localhost:50002/slave2'; CREATE MERGE TABLE data_1merged (LIKE data_local); ALTER TABLE data_1merged ADD TABLE data_slave1; CREATE MERGE TABLE data_2merged (LIKE data_local); ALTER TABLE data_2merged ADD TABLE data_slave1; ALTER TABLE data_2merged ADD TABLE data_slave2; -- slave1 CREATE TABLE data_slave1 AS SELECT * FROM data_local WITH DATA; -- slave2 CREATE TABLE data_slave2 AS SELECT * FROM data_local WITH DATA; If I then run the following queries -- inc SELECT origin, count(*) as incoming FROM data_2merged WHERE dest = 'foo' GROUP BY origin ; -- outg SELECT dest, count(*) as outgoing FROM data_2merged WHERE origin = 'foo' GROUP BY dest ; WITH inc AS ( SELECT origin, count(*) as incoming FROM data_2merged WHERE dest = 'foo' GROUP BY origin ), outg AS ( SELECT dest, count(*) as outgoing FROM data_2merged WHERE origin = 'foo' GROUP BY dest ) SELECT * FROM inc FULL OUTER JOIN outg ON inc.origin = outg.dest ; I expect the output +--------+----------+ | origin | incoming | +========+==========+ | bar | 2 | +--------+----------+ 1 tuple +-------+----------+ | dest | outgoing | +=======+==========+ | bar | 4 | | baz | 2 | +-------+----------+ 2 tuples +--------+----------+-------+----------+ | origin | incoming | dest | outgoing | +========+==========+=======+==========+ | bar | 2 | bar | 4 | | null | null | baz | 2 | +--------+----------+-------+----------+ But on the last line I get | null | 0 | baz | 2 | instead. Reproducible: Always ## Comment 25853 Date: 2017-11-08 21:59:01 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0d8fd1c7710c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d8fd1c7710c) 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=0d8fd1c7710c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0d8fd1c7710c) Changeset description: fixed bug #6459 and bug #6456 ## Comment 25855 Date: 2017-11-08 21:59:51 +0100 From: @njnes fixed, removed flag for changing null into 0 incase of outer joins
NULL becomes 0 in outer join
https://api.github.com/repos/MonetDB/MonetDB/issues/6456/comments
0
2020-11-30T15:55:29Z
2024-06-27T13:01:46Z
https://github.com/MonetDB/MonetDB/issues/6456
753,595,577
6,456
[ "MonetDB", "MonetDB" ]
Date: 2017-10-30 12:26:38 +0100 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:00 +0100 ## Comment 25823 Date: 2017-10-30 12:26:38 +0100 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: Using the mergedb database example 3 0x00007fd2ae541dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fd2a9097fbf in rel_apply_rewrite (changes=0x7fd284a4c4f4, sql=0x7fd25410c850, rel=0x7fd2542eda50) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8647 5 0x00007fd2a90990b2 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542eda50, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8821 6 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd2542eda80, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 7 0x00007fd2a90990e4 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542eda80, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8824 8 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd2542e8e00, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 9 0x00007fd2a90990e4 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542e8e00, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8824 10 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd2542e3c90, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 11 0x00007fd2a9098f63 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542e5110, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8798 12 0x00007fd2a90990e4 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542e5110, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8824 13 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd2542dea10, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 14 0x00007fd2a90990e4 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542dea10, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8824 15 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd2542d8cc0, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 16 0x00007fd2a90990e4 in rewrite (sql=0x7fd25410c850, rel=0x7fd2542d8cc0, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8824 17 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd25432d550, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 18 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd254336030, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 19 0x00007fd2a9098f8f in rewrite (sql=0x7fd25410c850, rel=0x7fd254331120, rewriter=0x7fd2a9096c7f <rel_apply_rewrite>, has_changes=0x7fd284a4c8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 20 0x00007fd2a909989f in _rel_optimizer ... Reproducible: Always ### Steps to Reproduce: select ref_6.length as c0, case when EXISTS ( select 97 as c0, ref_3.y as c1, ref_16.z as c2, ref_9.x as c3, ref_1.dependency_type_name as c4, ref_16.z as c5, ref_6.name as c6, ref_7.y as c7, ref_18.grantor as c8, subq_0.c4 as c9, 5 as c10, ref_3.x as c11, ref_4.index_type_id as c12, ref_27.z as c13, ref_1.dependency_type_name as c14, ref_27.y as c15, ref_17.query as c16, ref_7.x as c17, ref_9.z as c18, ref_3.z as c19, ref_1.dependency_type_name as c20, case when EXISTS ( select ref_20.vararg as c0, subq_0.c4 as c1, ref_27.y as c2, ref_9.y as c3, ref_21.pnext as c4, ref_6.dim_id as c5, ref_7.z as c6, ref_8.table_id as c7 from sys.storagemodel as ref_28 where false) then ref_2.depend_id else ref_2.depend_id end as c21, ref_16.x as c22, ref_4.index_type_name as c23, ref_6.name as c24, ref_21.seq as c25, ref_16.z as c26, ref_16.x as c27, ref_14.system as c28, ref_1.dependency_type_name as c29, ref_9.z as c30, ref_4.index_type_name as c31, ref_3.y as c32 from sys.s1 as ref_27 where ref_27.y is NULL) then ref_9.x else ref_9.x end as c1, ref_14.id as c2, ref_14.id as c3, case when ref_20.language is not NULL then ref_2.id else ref_2.id end as c4, ref_20.func as c5, ref_9.x as c6, case when true then ref_18.name else ref_18.name end as c7, ref_19.function_type_id as c8 from sys.dependency_types as ref_1 inner join sys.dependencies as ref_2 on (ref_1.dependency_type_id = ref_2.depend_type ) left join sys.r3 as ref_3 on (ref_2.depend_id = ref_3.x ) inner join sys.index_types as ref_4 on (ref_2.depend_type is not NULL) right join sys.netcdf_dims as ref_6 left join sys.r as ref_7 inner join tmp.keys as ref_8 on (ref_7.z is not NULL) right join sys.r2 as ref_9 on (ref_7.z is not NULL) on (ref_6.file_id = ref_8.id ) on (ref_9.x is NULL) left join sys.schemas as ref_14 right join sys.r1 as ref_16 inner join tmp._tables as ref_17 on (ref_16.y = ref_17.id ) inner join sys.auths as ref_18 on (false) inner join sys.function_types as ref_19 inner join sys.functions as ref_20 on (ref_19.function_type_name = ref_20.name ) left join bam.export as ref_21 on (ref_20.id = ref_21.pos ) on (ref_17.type is NULL) on (ref_14.name = ref_17.name ) on (true) right join (select 83 as c0, ref_26.y as c1, ref_26.y as c2, 90 as c3, ref_26.y as c4, case when true then ref_26.y else ref_26.y end as c5 from sys.r as ref_26 where false limit 59) as subq_0 on (ref_3.x = subq_0.c0 ) where ref_4.index_type_id is NULL limit 131; ## Comment 25831 Date: 2017-11-01 16:14:57 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=860ca030d222) 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=860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=860ca030d222) Changeset description: fixes for bugs 6451, 6453 and 6455 fixed bug in apply expression name conflict resolution fixed naming of relations with correlations also added tests and stable output
Assertion error in rel_apply_rewrite (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6455/comments
0
2020-11-30T15:55:27Z
2024-06-27T13:01:45Z
https://github.com/MonetDB/MonetDB/issues/6455
753,595,547
6,455
[ "MonetDB", "MonetDB" ]
Date: 2017-10-27 12:59:01 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:03 +0100 ## Comment 25816 Date: 2017-10-27 12:59:01 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: Create a function whose name is 'prep' then the function table is extended with a function called 'prepare', modifying the intended name. Reproducible: Always ### Steps to Reproduce: create function prep() returns table(z integer) language python{ res = dict() res.append([1]) return res }; ## Comment 25817 Date: 2017-10-27 12:59:42 +0200 From: @mlkersten .... | 8299 | prepare | { | pyapi | 6 | 5 | false | false | false | 2000 | : : : res = dic : : : : : : : : : : : t() : : : : : : : : : : : res.appen : : : : : : : : : : : d([1])... > : : : : : : : +------+------- ## Comment 25822 Date: 2017-10-30 08:59:28 +0100 From: @njnes indeed prep is a alias for prepare. We should make this more context aware ## Comment 25824 Date: 2017-10-30 22:05:49 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0d0613bfa3f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0d0613bfa3f3) 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=0d0613bfa3f3](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0d0613bfa3f3) Changeset description: handle PREP / PREPARE and EXEC / EXECUTE seperately (fixes bug #6454)
SQL lexical error
https://api.github.com/repos/MonetDB/MonetDB/issues/6454/comments
0
2020-11-30T15:55:24Z
2024-06-27T13:01:44Z
https://github.com/MonetDB/MonetDB/issues/6454
753,595,511
6,454
[ "MonetDB", "MonetDB" ]
Date: 2017-10-27 11:03:31 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:05 +0100 ## Comment 25815 Date: 2017-10-27 11:03:31 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: On the mergedb example database 4 0x00007fbd13aa1f0b in rel_rename_exps (sql=0x7fbcc810afe0, exps1=0x7fbcc8796680, exps2=0x7fbcc87971b0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1869 5 0x00007fbd13aafb31 in rel_push_project_down_union (changes=0x7fbce73f88b8, sql=0x7fbcc810afe0, rel=0x7fbcc866c950) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4798 6 0x00007fbd13ac113e in rewrite_topdown (sql=0x7fbcc810afe0, rel=0x7fbcc866c950, rewriter=0x7fbd13aaf7b0 <rel_push_project_down_union>, has_changes=0x7fbce73f88b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8835 7 0x00007fbd13ac1261 in rewrite_topdown (sql=0x7fbcc810afe0, rel=0x7fbcc8796550, rewriter=0x7fbd13aaf7b0 <rel_push_project_down_union>, has_changes=0x7fbce73f88b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8857 8 0x00007fbd13ac128d in rewrite_topdown (sql=0x7fbcc810afe0, rel=0x7fbcc865ce50, rewriter=0x7fbd13aaf7b0 <rel_push_project_down_union>, has_changes=0x7fbce73f88b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8864 9 0x00007fbd13ac128d in rewrite_topdown (sql=0x7fbcc810afe0, rel=0x7fbcc865dbf0, rewriter=0x7fbd13aaf7b0 <rel_push_project_down_union>, has_changes=0x7fbce73f88b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8864 10 0x00007fbd13ac128d in rewrite_topdown Reproducible: Always ### Steps to Reproduce: select cast(nullif(subq_0.c3, subq_0.c3) as int) as c0 from (select ref_0.x as c0, ref_0.y as c1, ref_0.z as c2, ref_0.x as c3, ref_0.y as c4 from sys.s2 as ref_0 where (ref_0.z is NULL) and (EXISTS ( select ref_1.role_id as c0, ref_0.z as c1, ref_1.role_id as c2, ref_1.role_id as c3, ref_0.z as c4, ref_1.login_id as c5, ref_0.z as c6, ref_0.y as c7 from sys.user_role as ref_1 where (EXISTS ( select ref_0.y as c0, ref_1.login_id as c1, ref_0.x as c2, ref_0.x as c3, ref_0.x as c4, 77 as c5, ref_1.role_id as c6, ref_1.login_id as c7, ref_0.x as c8, ref_0.x as c9, ref_2.name as c10, ref_0.y as c11, ref_2.file_id as c12, ref_2.vartype as c13 from sys.netcdf_vars as ref_2 where ref_0.x is not NULL)) or (ref_0.y is NULL))) limit 109) as subq_0 where (EXISTS ( select ref_3.z as c0, subq_0.c2 as c1, ref_3.z as c2, ref_3.x as c3, 100 as c4, ref_3.x as c5, ref_3.z as c6 from sys.r as ref_3 where ref_3.x is not NULL)) or (subq_0.c2 is NULL) limit 141; ## Comment 25830 Date: 2017-11-01 16:14:56 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=860ca030d222) 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=860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=860ca030d222) Changeset description: fixes for bugs 6451, 6453 and 6455 fixed bug in apply expression name conflict resolution fixed naming of relations with correlations also added tests and stable output ## Comment 25832 Date: 2017-11-01 16:21:07 +0100 From: @njnes fixed problem with naming relations with correlated sub queries
Assertion error in rel_rename_exps (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6453/comments
0
2020-11-30T15:55:21Z
2024-06-27T13:01:43Z
https://github.com/MonetDB/MonetDB/issues/6453
753,595,472
6,453
[ "MonetDB", "MonetDB" ]
Date: 2017-10-27 10:55:06 +0200 From: @mlkersten To: clients devs &lt;<bugs-clients>&gt; Version: 11.27.9 (Jul2017-SP2) CC: castro8583bennett Last updated: 2018-10-16 15:22:28 +0200 ## Comment 25814 Date: 2017-10-27 10:55:06 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: If you have mserver compiled without geo, then a FATAL message is produced. 2017-10-27 10:47:14 ERR demo[65650]: !FATAL: SQL type mbr missing However, if you have started the server using a direct call to mclient, the latter hangs waiting for a message from the server that will never come. Reproducible: Always ## Comment 25904 Date: 2017-11-23 16:22:02 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [805d8e0173c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=805d8e0173c8) 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=805d8e0173c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=805d8e0173c8) Changeset description: Fix potential race condition. This may very well fix bug #6452. Lock the _mero_topdp_lock lock *before* forking, so that when the newly started process dies quickly, it's not harvested before we enter it in our administration. In this way harvesting does something. Also, try to do as little as possible between fork and exec in the child process. ## Comment 25997 Date: 2017-12-12 17:04:41 +0100 From: @sjoerdmullender Martin, can you test? ## Comment 26478 Date: 2018-06-08 17:08:57 +0200 From: Castro B &lt;<castro8583bennett>&gt; Hello Martin, does this issue fixed already? Or any source? Thanks Castro B. https://alternatives.co/ ## Comment 26643 Date: 2018-10-16 15:22:28 +0200 From: @sjoerdmullender Assuming fixed due to lack of response.
Mclient hangs when mserver raises a FATAL error
https://api.github.com/repos/MonetDB/MonetDB/issues/6452/comments
0
2020-11-30T15:55:18Z
2024-06-27T13:01:42Z
https://github.com/MonetDB/MonetDB/issues/6452
753,595,432
6,452
[ "MonetDB", "MonetDB" ]
Date: 2017-10-27 09:43:51 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:45:59 +0100 ## Comment 25813 Date: 2017-10-27 09:43:51 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: 4 0x00007f7b0bc80699 in sql_ref_dec (r=0x7f7ad4172210) at /export/scratch1/home/mk/default//package/sql/common/sql_mem.c:29 5 0x00007f7b0bbec4a3 in rel_destroy (rel=0x7f7ad4172210) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:77 6 0x00007f7b0bbec39a in rel_destroy_ (rel=0x7f7ad4176860) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:60 7 0x00007f7b0bbec4b3 in rel_destroy (rel=0x7f7ad4176860) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:79 8 0x00007f7b0bbcff07 in rel_joinquery_ (sql=0x7f7ad410d640, rel=0x7f7ad4172210, tab1=0x7f7ad416d970, natural=0, jointype=jt_left, tab2=0x7f7ad416ea00, js=0x7f7ad416ece0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5325 9 0x00007f7b0bbd07e6 in rel_joinquery (sql=0x7f7ad410d640, rel=0x7f7ad4172210, q=0x7f7ad416edc0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5439 10 0x00007f7b0bbb7ee5 in query_exp_optname (sql=0x7f7ad410d640, r=0x7f7ad4172210, q=0x7f7ad416edc0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:340 11 0x00007f7b0bbbb30e in table_ref (sql=0x7f7ad410d640, rel=0x7f7ad4172210, tableref=0x7f7ad416edc0, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:945 12 0x00007f7b0bbcfce4 in rel_joinquery_ (sql=0x7f7ad410d640, rel=0x7f7ad4172210, tab1=0x7f7ad416edc0, natural=0, jointype=jt_right, tab2=0x7f7ad416ef70, js=0x7f7ad416f160) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5305 13 0x00007f7b0bbd07e6 in rel_joinquery (sql=0x7f7ad410d640, rel=0x7f7ad4172210, q=0x7f7ad416f240) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5439 14 0x00007f7b0bbb7ee5 in query_exp_optname (sql=0x7f7ad410d640, r=0x7f7ad4172210, q=0x7f7ad416f240) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:340 15 0x00007f7b0bbbb30e in table_ref (sql=0x7f7ad410d640, rel=0x7f7ad4172210, tableref=0x7f7ad416f240, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:945 16 0x00007f7b0bbcf0f1 in rel_query (sql=0x7f7ad410d640, rel=0x7f7ad4172210, sq=0x7f7ad416f440, toplevel=0, ek=..., apply=32) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5117 17 0x00007f7b0bbd0c00 in rel_subquery (sql=0x7f7ad410d640, rel=0x7f7ad4171050, sq=0x7f7ad416f440, ek=..., apply=32) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5518 18 0x00007f7b0bbc3755 in rel_logical_exp (sql=0x7f7ad410d640, rel=0x7f7ad4171050, sc=0x7f7ad416f4c0, f=1) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:2723 19 0x00007f7b0bbce042 in rel_select_exp (sql=0x7f7ad410d640, rel=0x7f7ad4171050, sn=0x7f7ad416f580, ek=...) Reproducible: Always ### Steps to Reproduce: select ref_2.y as c0, cast(coalesce(ref_2.z, ref_2.z) as clob) as c1, ref_2.z as c2, case when ref_2.y is NULL then subq_0.c0 else subq_0.c0 end as c3, ref_2.y as c4, cast(coalesce(subq_0.c0, ref_2.z) as clob) as c5, ref_2.x as c6 from sys.r2 as ref_2, lateral (select ref_2.z as c0 from sys.netcdf_vardim as ref_3 where ref_3.dim_id is NULL) as subq_0 where EXISTS ( select case when false then ref_9.z else ref_9.z end as c0, subq_2.c5 as c1, subq_0.c0 as c2, ref_2.z as c3, subq_2.c5 as c4 from (select ref_2.y as c0, ref_4.type as c1, subq_0.c0 as c2, ref_2.y as c3 from sys.keys as ref_4 where ref_2.z is NULL) as subq_1 left join (select ref_5.gr_name as c0, ref_5.att_name as c1, ref_2.z as c2, subq_0.c0 as c3, 44 as c4, subq_0.c0 as c5, ref_2.y as c6, ref_2.x as c7, ref_2.y as c8 from sys.netcdf_attrs as ref_5 where false) as subq_2 on (subq_1.c2 = subq_2.c2 ) right join sys.r as ref_9 on (subq_2.c4 = ref_9.x ) where ref_9.x is not NULL) limit 64; ## Comment 25828 Date: 2017-11-01 12:28:40 +0100 From: @njnes fixed naming of subqueries with correlated parts (ie don't rename the correlated partes). ## Comment 25829 Date: 2017-11-01 16:14:54 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=860ca030d222) 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=860ca030d222](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=860ca030d222) Changeset description: fixes for bugs 6451, 6453 and 6455 fixed bug in apply expression name conflict resolution fixed naming of relations with correlations also added tests and stable output
Assertion error in sql_ref_dec (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6451/comments
0
2020-11-30T15:55:15Z
2024-06-27T13:01:41Z
https://github.com/MonetDB/MonetDB/issues/6451
753,595,402
6,451
[ "MonetDB", "MonetDB" ]
Date: 2017-10-26 14:13:34 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:07 +0100 ## Comment 25806 Date: 2017-10-26 14:13:34 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: 3 0x00007f98ae1c6dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f98a8c23ef0 in exp_bin (be=0x7f9868006610, e=0x7f9868943e10, left=0x7f9868a872f0, right=0x7f9868a87420, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:564 5 0x00007f98a8c2d1ca in rel2bin_project (be=0x7f9868006610, rel=0x7f9868944c40, refs=0x7f9868982200, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2467 6 0x00007f98a8c37f84 in subrel_bin (be=0x7f9868006610, rel=0x7f9868944c40, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4836 7 0x00007f98a8c2a8af in rel2bin_semijoin (be=0x7f9868006610, rel=0x7f9868947d20, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1923 8 0x00007f98a8c37eca in subrel_bin (be=0x7f9868006610, rel=0x7f9868947d20, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4820 9 0x00007f98a8c2955a in rel2bin_join (be=0x7f9868006610, rel=0x7f9868958f30, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1702 10 0x00007f98a8c37e7d in subrel_bin (be=0x7f9868006610, rel=0x7f9868958f30, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4813 11 0x00007f98a8c2db4b in rel2bin_select (be=0x7f9868006610, rel=0x7f9868958f60, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2591 12 0x00007f98a8c37fb2 in subrel_bin (be=0x7f9868006610, rel=0x7f9868958f60, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4840 13 0x00007f98a8c2d0f7 in rel2bin_project (be=0x7f9868006610, rel=0x7f98689303e0, refs=0x7f9868982200, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2455 14 0x00007f98a8c37f84 in subrel_bin (be=0x7f9868006610, rel=0x7f98689303e0, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4836 15 0x00007f98a8c2b88a in rel2bin_union (be=0x7f9868006610, rel=0x7f9868930440, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2144 16 0x00007f98a8c37ef8 in subrel_bin (be=0x7f9868006610, rel=0x7f9868930440, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4824 17 0x00007f98a8c2db4b in rel2bin_select (be=0x7f9868006610, rel=0x7f9868955d70, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2591 18 0x00007f98a8c37fb2 in subrel_bin (be=0x7f9868006610, rel=0x7f9868955d70, refs=0x7f9868982200) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4840 19 0x00007f98a8c2d0f7 in rel2bin_project (be=0x7f9868006610, rel=0x7f9868961d90, refs=0x7f9868982200, topn=0x7f98689814a0) Reproducible: Always ### Steps to Reproduce: select ref_25.columnsize as c0, ref_11.dim_id as c1, ref_18.function_id as c2 from sys.function_languages as ref_9 left join bam.export as ref_10 on (ref_9.language_id = ref_10.flag ) right join sys.netcdf_vardim as ref_11 on (EXISTS ( select ref_9.language_name as c0, ref_11.file_id as c1, ref_11.dimpos as c2, ref_9.language_name as c3, ref_10.tlen as c4 from tmp.idxs as ref_12 where ref_9.language_id is NULL)) left join sys.args as ref_17 left join sys.systemfunctions as ref_18 right join sys.s as ref_19 inner join sys.storage as ref_20 on (ref_19.z = ref_20.schema ) on (ref_18.function_id = ref_20.typewidth ) on (ref_17.type_digits = ref_20.typewidth ) left join sys.storage as ref_25 on (ref_18.function_id is not NULL) on ((true) or (ref_10.rname is NULL)) where ref_9.language_name is NULL limit 158; ## Comment 25821 Date: 2017-10-30 08:30:41 +0100 From: @njnes fixed order of handling the referenced sub queries in the dead code elimination, ie first using the parents mark the expressions as used. This was done incorrectly leading to to many eliminated expressions.
Assertion error in exp_bin (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6450/comments
0
2020-11-30T15:55:13Z
2024-06-27T13:01:40Z
https://github.com/MonetDB/MonetDB/issues/6450
753,595,371
6,450
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 21:58:11 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:06 +0100 ## Comment 25795 Date: 2017-10-24 21:58:11 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: SF1 database triggers assertion. 0 0x00007f0d8e9a469b in raise () from /lib64/libc.so.6 1 0x00007f0d8e9a64a0 in abort () from /lib64/libc.so.6 2 0x00007f0d8e99cd5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f0d8e99cdd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f0d894e8779 in rel_dce_refs (sql=0x7f0d58101750, rel=0x7f0d581287b0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6158 5 0x00007f0d894e86d1 in rel_dce_refs (sql=0x7f0d58101750, rel=0x7f0d58128230) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6126 6 0x00007f0d894e8754 in rel_dce_refs (sql=0x7f0d58101750, rel=0x7f0d58128680) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6154 7 0x00007f0d894e86d1 in rel_dce_refs (sql=0x7f0d58101750, rel=0x7f0d58124330) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6126 8 0x00007f0d894e86d1 in rel_dce_refs (sql=0x7f0d58101750, rel=0x7f0d58124cf0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6126 9 0x00007f0d894e8f37 in rel_dce (sql=0x7f0d58101750, rel=0x7f0d58124cf0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6352 10 0x00007f0d894f4b41 in _rel_optimizer (sql=0x7f0d58101750, rel=0x7f0d58124cf0, g_changes=0x7f0d6ea9b940, level=0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9027 11 0x00007f0d894f4ce1 in rel_optimizer (sql=0x7f0d58101750, rel=0x7f0d58124cf0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9054 12 0x00007f0d893ce855 in sql_symbol2relation (c=0x7f0d58101750, sym=0x7f0d5811aab0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121 13 0x00007f0d893ee008 in SQLparser Reproducible: Always ### Steps to Reproduce: select ref_3.name as c0, ref_4.index_type_name as c1, ref_3.name as c2, ref_3.value as c3 from sys.environment as ref_3 inner join sys.index_types as ref_4 on (ref_3.value is NULL) where EXISTS ( select ref_3.value as c0 from (select ref_5.table_id as c0, ref_5.table_id as c1, ref_6.lb as c2, ref_4.index_type_name as c3, ref_4.index_type_id as c4 from tmp._columns as ref_5 left join bam.rg as ref_6 on (ref_5.id is not NULL) where false limit 97) as subq_0 where true) limit 136; ## Comment 25818 Date: 2017-10-29 10:39:06 +0100 From: @njnes fixed by handling the topn/sample in the apply rewriters ## Comment 25819 Date: 2017-10-29 10:39:24 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7d28d093c817](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d28d093c817) 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=7d28d093c817](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7d28d093c817) Changeset description: fixed bug #6449 ## Comment 25820 Date: 2017-10-29 11:41:15 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [751f31299c66](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=751f31299c66) 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=751f31299c66](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=751f31299c66) Changeset description: add test for bug #6449
Assertion error in rel_dce_refs (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6449/comments
0
2020-11-30T15:55:10Z
2024-06-27T13:01:39Z
https://github.com/MonetDB/MonetDB/issues/6449
753,595,323
6,449
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 17:37:29 +0200 From: @rkoopmanschap To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @kutsurak, @njnes Last updated: 2017-12-14 14:46:06 +0100 ## Comment 25790 Date: 2017-10-24 17:37:29 +0200 From: @rkoopmanschap User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: If you try to insert multiple rows at once and your 'insert into' statement contains subqueries it will crash the database. Reproducible: Always ### Steps to Reproduce: -- The code below crashes the database: CREATE TABLE test_table(x VARCHAR(10), y INTEGER); INSERT INTO test_table VALUES ('test1', (SELECT 1)), ('test3', (SELECT 1)); SELECT * FROM test_table; ### Actual Results: MonetDB crashes on linux and hangs on mac ### Expected Results: +-------+------+ | x | y | +=======+======+ | test1 | 1 | | test3 | 1 | +-------+------+ 2 tuples (1.680ms) ## Comment 25791 Date: 2017-10-24 17:41:37 +0200 From: @kutsurak It hits the following assertion: mserver5: ../../../monetdb5/optimizer/opt_garbageCollector.c:123: OPTgarbageCollectorImplementation: Assertion `p->token == ENDsymbol' failed. ## Comment 25802 Date: 2017-10-25 13:04:22 +0200 From: @njnes fixed 2 problems. One better check for atoms in the insert (else we use references without a relations and that will give crashes) Two fixed merge of 2 projects, ie don't merge value lists. ## Comment 25807 Date: 2017-10-26 14:21:33 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d245a7b07594](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d245a7b07594) made by Richard Koopmanschap <richard.koopmanschap@monetdbsolutions.com> in the MonetDB repo, refers to this bug. For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d245a7b07594](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d245a7b07594) Changeset description: Added tests for bug #6444 and 6448 ## Comment 25809 Date: 2017-10-26 15:41:07 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [96ff384f1c07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=96ff384f1c07) made by Richard Koopmanschap <richard.koopmanschap@monetdbsolutions.com> in the MonetDB repo, refers to this bug. For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=96ff384f1c07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=96ff384f1c07) Changeset description: Added tests for bugs 6444 and 6448
'insert into' with multiple rows containing subqueries crashes
https://api.github.com/repos/MonetDB/MonetDB/issues/6448/comments
0
2020-11-30T15:55:07Z
2024-06-27T13:01:38Z
https://github.com/MonetDB/MonetDB/issues/6448
753,595,283
6,448
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 17:14:46 +0200 From: Omri &lt;<ocschwar>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes, ocschwar, @PedroTadim Last updated: 2018-12-11 17:37:55 +0100 ## Comment 25788 Date: 2017-10-24 17:14:46 +0200 From: Omri &lt;<ocschwar>&gt; The following SQL command ends with a segfault: select (AVG(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING )) as foo, turbine,time from sys.tablename group by time,turbine; Here's a stack trace: (gdb) where 0 0x00007f4772ae5c96 in exp_subtype (e=0x0) at rel_exp.c:658 1 0x00007f4772acaaaf in rel_rankop (sql=0x7f473800ab60, rel=0x7f474f5ed7f0, se=0x7f47380e0f10, f=2) at rel_select.c:4436 2 0x00007f4772acaec3 in rel_value_exp2 (sql=0x7f473800ab60, rel=0x7f474f5ed7f0, se=0x7f47380e0f10, f=2, ek=..., is_last=0x7f474f5ed70c) at rel_select.c:4479 3 0x00007f4772acbabf in rel_value_exp (sql=0x7f473800ab60, rel=0x7f474f5ed7f0, se=0x7f47380e0f10, f=2, ek=...) at rel_select.c:4651 4 0x00007f4772acbbbe in column_exp (sql=0x7f473800ab60, rel=0x7f474f5ed7f0, column_e=0x7f47380e0fa0, f=2) at rel_select.c:4664 5 0x00007f4772acbe25 in rel_column_exp (sql=0x7f473800ab60, rel=0x7f474f5ed7f0, column_e=0x7f47380e0fa0, f=2) at rel_select.c:4708 6 0x00007f4772accae0 in rel_select_exp (sql=0x7f473800ab60, rel=0x7f47380e22b0, sn=0x7f47380e1580, ek=...) at rel_select.c:4904 7 0x00007f4772acdbaa in rel_query (sql=0x7f473800ab60, rel=0x0, sq=0x7f47380e1580, toplevel=1, ek=..., apply=8) at rel_select.c:5157 8 0x00007f4772acf452 in rel_subquery (sql=0x7f473800ab60, rel=0x0, sq=0x7f47380e1580, ek=..., apply=8) at rel_select.c:5518 9 0x00007f4772acf579 in rel_selects (sql=0x7f473800ab60, s=0x7f47380e1580) at rel_select.c:5539 10 0x00007f4772ab50f0 in rel_semantic (sql=0x7f473800ab60, s=0x7f47380e1580) at rel_semantic.c:225 11 0x00007f47729f07f3 in sql_symbol2relation (c=0x7f473800ab60, sym=0x7f47380e1580) at sql.c:117 12 0x00007f4772a0fe26 in SQLparser (c=0x7f4773d6c368) at sql_scenario.c:1120 13 0x00007f477e098de4 in runPhase (c=0x7f4773d6c368, phase=1) at mal_scenario.c:510 14 0x00007f477e098eed in runScenarioBody (c=0x7f4773d6c368, once=0) at mal_scenario.c:532 15 0x00007f477e0991a3 in runScenario (c=0x7f4773d6c368, once=0) at mal_scenario.c:569 16 0x00007f477e09ad76 in MSserveClient (dummy=0x7f4773d6c368) at mal_session.c:495 17 0x00007f477e09a892 in MSscheduleClient (command=0x7f47380008d0 "\001", challenge=0x7f474f5ede3b "V08seaGX", fin=0x7f4738002990, fout=0x7f4744002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:378 18 0x00007f477e13aeb4 in doChallenge (data=0x7f47440008d0) at mal_mapi.c:273 19 0x00007f477dd17cad in thread_starter (arg=0x7f4744004c60) at gdk_system.c:485 20 0x00007f477d3b86da in start_thread (arg=0x7f474f5ee700) at pthread_create.c:456 21 0x00007f477d0f2d7f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:105 I can offer a core once I reproduce this with a table that isn't holding my employer's proprietary information. A the schema is like this: CREATE TABLE "sys"."tablename" ( "time" TIMESTAMP(0), "turbine" VARCHAR(12), "energy" DOUBLE, ... [ more DOUBLE s] ); ## Comment 25789 Date: 2017-10-24 17:20:16 +0200 From: Omri &lt;<ocschwar>&gt; The sum and count functions trigger the same thing. ## Comment 25792 Date: 2017-10-24 18:00:42 +0200 From: Omri &lt;<ocschwar>&gt; Related? https://www.monetdb.org/bugzilla/show_bug.cgi?id=3530 ## Comment 25793 Date: 2017-10-24 18:58:11 +0200 From: Omri &lt;<ocschwar>&gt; Steps to reproduce: sql>CREATE TABLE "sys"."bugtest" ( "time" TIMESTAMP(0), "turbine" VARCHAR(12), "energy" DOUBLE,"windn" DOUBLE); operation successful (35.847ms) sql>select (sum(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 PRECEDING )) as foo, turbine,time from sys.bugtest group by time,turbine; sql> ## Comment 25794 Date: 2017-10-24 19:01:22 +0200 From: Omri &lt;<ocschwar>&gt; Core available from here: https://www.mit.edu/~ocschwar/core.gz ## Comment 25835 Date: 2017-11-02 15:41:40 +0100 From: Omri &lt;<ocschwar>&gt; The latest version (2017-11-02) does away with the segfault: sql>select (sum(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 PRECEDING )) as foo, turbine,time from sys.bugtest group by time,turbine; syntax error, unexpected PRECEDING in: "select (sum(energy) over ( partition by turbine order by time rows between curre" sql>select (sum(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; SELECT: cannot use non GROUP BY column 'energy' in query results without an aggregate function sql>select (avg(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; SELECT: cannot use non GROUP BY column 'energy' in query results without an aggregate function sql>select (rank(energy) over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; syntax error, unexpected IDENT, expecting ')' in: "select (rank(energy" sql>select (rank() over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; +-----+---------+------+ | foo | turbine | time | +=====+=========+======+ +-----+---------+------+ 0 tuples (14.459ms) sql>select (rank() over ( PARTITION BY turbine ORDER BY time ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; +-----+---------+------+ | foo | turbine | time | +=====+=========+======+ +-----+---------+------+ 0 tuples (2.272ms) sql>select (rank(energy) over ( ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; syntax error, unexpected IDENT, expecting ')' in: "select (rank(energy" sql>select (rank() over ( ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; +-----+---------+------+ | foo | turbine | time | +=====+=========+======+ +-----+---------+------+ 0 tuples (3.378ms) sql>select (avg(energy) over ( ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; SELECT: cannot use non GROUP BY column 'energy' in query results without an aggregate function sql> ## Comment 26707 Date: 2018-11-30 16:51:13 +0100 From: @PedroTadim I extended our sql catalog to process both aggregations and frames over window functions, and it should be available in the next feature release of MonetDB. However in your case, the query: select (avg(energy) over ( ORDER BY time ROWS BETWEEN CURRENT ROW AND 2 FOLLOWING)) as foo, turbine,time from sys.bugtest group by time,turbine; is not correct, because the window function call is a projection in the aggregation dictated by the group by clause, and energy column is not part of the group by clause, that's why the error.
segfault on windowing function.
https://api.github.com/repos/MonetDB/MonetDB/issues/6447/comments
0
2020-11-30T15:55:03Z
2024-06-28T13:39:40Z
https://github.com/MonetDB/MonetDB/issues/6447
753,595,228
6,447
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 17:06:36 +0200 From: Omri &lt;<ocschwar>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:01 +0100 ## Comment 25786 Date: 2017-10-24 17:06:36 +0200 From: Omri &lt;<ocschwar>&gt; sql_parser.y has the following stanza: window_frame_following: value_exp PRECEDING { $$ = $1; } ; I believe that should be "value_exp FOLLOWING { $$ = $1} " ## Comment 25798 Date: 2017-10-25 09:34:20 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [4948a6800fdf](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4948a6800fdf) 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=4948a6800fdf](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=4948a6800fdf) Changeset description: Typo. This fixes bug #6446. ## Comment 25805 Date: 2017-10-26 07:58:22 +0200 From: @njnes fixed by the change in the parser (still implementation of the window functionality is missing)
sql_parser.y bug?
https://api.github.com/repos/MonetDB/MonetDB/issues/6446/comments
0
2020-11-30T15:55:00Z
2024-06-27T13:01:36Z
https://github.com/MonetDB/MonetDB/issues/6446
753,595,177
6,446
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 17:00:39 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-12-14 14:46:04 +0100 ## Comment 25785 Date: 2017-10-24 17:00:39 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: I am now running Sqlitelogictest queries that are exclusive to some database systems. This query is supposed to run only on MySQL. In MonetDB I guess we are are supposed to get a compilation error or an empty result set instead of a crash. The original query for the other database systems including MonetDB was: SELECT col0 + - - CAST ( NULL AS REAL ) - + col0 + + col1 FROM tab1 cor0 WHERE ( NULL ) IS NOT NULL In the MySQL version the cast is made to a DECIMAL instead of a REAL, because I guess MySQL does not support the REAL type. However I think that the MySQL version should also run in MonetDB, by casting the col0 column into a decimal. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab1(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. SELECT col0 + - - CAST( NULL AS DECIMAL ) - + col0 + + col1 FROM tab1 cor0 WHERE ( NULL ) IS NOT NULL; ### Actual Results: A SIGSEGV is received in a exp_is_atom call. ### Expected Results: An empty result set. The SIGSEV: Thread 6 "mserver5" received signal SIGSEGV, Segmentation fault. 0x00007fffe8b0a4b5 in exp_is_atom (e=0x0) at rel_exp.c:1337 1337 switch (e->type) { Backtrace: 0 0x00007fffe8b0a4b5 in exp_is_atom (e=0x0) at rel_exp.c:1337 1 0x00007fffe8b1d51f in exp_simplify_math (sql=0x7fffb800a5f0, e=0x7fffb80baf40, changes=0x7fffcd396874) at rel_optimizer.c:2941 2 0x00007fffe8b1de61 in rel_simplify_math (changes=0x7fffcd396874, sql=0x7fffb800a5f0, rel=0x7fffb80b8630) at rel_optimizer.c:3080 3 0x00007fffe8b377e4 in rewrite (sql=0x7fffb800a5f0, rel=0x7fffb80b8630, rewriter=0x7fffe8b1dd02 <rel_simplify_math>, has_changes=0x7fffcd396938) at rel_optimizer.c:8821 4 0x00007fffe8b37816 in rewrite (sql=0x7fffb800a5f0, rel=0x7fffb80b8630, rewriter=0x7fffe8b1dd02 <rel_simplify_math>, has_changes=0x7fffcd396938) at rel_optimizer.c:8824 5 0x00007fffe8b376c1 in rewrite (sql=0x7fffb800a5f0, rel=0x7fffb80ba3b0, rewriter=0x7fffe8b1dd02 <rel_simplify_math>, has_changes=0x7fffcd396938) at rel_optimizer.c:8805 6 0x00007fffe8b37bd1 in _rel_optimizer (sql=0x7fffb800a5f0, rel=0x7fffb80ba3b0, g_changes=0x7fffcd3969c0, level=0) at rel_optimizer.c:8907 7 0x00007fffe8b3843f in rel_optimizer (sql=0x7fffb800a5f0, rel=0x7fffb80b8630) at rel_optimizer.c:9054 8 0x00007fffe8a18b85 in sql_symbol2relation (c=0x7fffb800a5f0, sym=0x7fffb80b7da0) at sql.c:121 9 0x00007fffe8a37a35 in SQLparser (c=0x7fffea11e338) at sql_scenario.c:1129 10 0x00007ffff7a15e20 in runPhase (c=0x7fffea11e338, phase=1) at mal_scenario.c:506 11 0x00007ffff7a15f64 in runScenarioBody (c=0x7fffea11e338) at mal_scenario.c:539 12 0x00007ffff7a16107 in runScenario (c=0x7fffea11e338) at mal_scenario.c:568 13 0x00007ffff7a17cbc in MSserveClient (dummy=0x7fffea11e338) at mal_session.c:473 14 0x00007ffff7a177ac in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd396deb "jwuMCBng4", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 15 0x00007ffff7ab7694 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 16 0x00007ffff7691213 in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 17 0x00007ffff4ca436d in start_thread () from /lib64/libpthread.so.0 18 0x00007ffff49dcbbf in clone () from /lib64/libc.so.6 ## Comment 25787 Date: 2017-10-24 17:11:17 +0200 From: @PedroTadim I added the test in this commit https://dev.monetdb.org/hg/MonetDB/rev/6d5c21f423bd Sorry I misspelled the Bug number with 64455 instead of 6445. ## Comment 25801 Date: 2017-10-25 11:42:21 +0200 From: @njnes fixed (properly return old expression if optimization isn't possible) ## Comment 25804 Date: 2017-10-26 07:56:37 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [5e59ce515a5b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5e59ce515a5b) 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=5e59ce515a5b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5e59ce515a5b) Changeset description: fixed bugs 6444, 6445
Sqlitelogictest crash in MySQL query
https://api.github.com/repos/MonetDB/MonetDB/issues/6445/comments
0
2020-11-30T15:54:56Z
2024-06-27T13:01:35Z
https://github.com/MonetDB/MonetDB/issues/6445
753,595,132
6,445
[ "MonetDB", "MonetDB" ]
Date: 2017-10-24 14:37:02 +0200 From: @rkoopmanschap To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:04 +0100 ## Comment 25784 Date: 2017-10-24 14:37:02 +0200 From: @rkoopmanschap User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: The code below crashes, it seems to be caused by using 'with' in combination with a table returning function. Reproducible: Always ### Steps to Reproduce: -- Run the following code, make sure python UDFs are enabled: -- Create input table CREATE TABLE test_table(x STRING, y STRING, z STRING); INSERT INTO test_table VALUES ('test value 1', 'test value 2', 'test value 3'); -- Create test function CREATE FUNCTION test_function(x STRING, y STRING, z STRING) RETURNS TABLE(a STRING, b STRING, c FLOAT) LANGUAGE PYTHON { result = dict() result['a'] = ['test value a'] result['b'] = ['test value b'] result['c'] = [3] return result }; -- Failing query CREATE TABLE results_table AS ( WITH test_table_tmp AS ( SELECT * FROM test_table ) SELECT * FROM test_function(test_table_tmp.x, test_table_tmp.y, test_table_tmp.z) ); SELECT * FROM results_table; ### Actual Results: MonetDB crashes on linux and hangs on a mac. ### Expected Results: +--------------+--------------+--------------------------+ | a | b | c | +==============+==============+==========================+ | test value a | test value b | 3 | +--------------+--------------+--------------------------+ 1 tuple (1.324ms) A possible workaround for this would be to change the query to: CREATE TABLE results_table AS ( SELECT * FROM test_function( (select x, y, z FROM test_table ) ) ); This query does work and returns the correct results. The failing query should be equivalent however. ## Comment 25799 Date: 2017-10-25 11:24:14 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [813fd7d13da9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=813fd7d13da9) 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=813fd7d13da9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=813fd7d13da9) Changeset description: fixed crash in bug #6444 ## Comment 25800 Date: 2017-10-25 11:25:21 +0200 From: @njnes fixed crash, so we now get an error. But the 2 queries are not equivalent ## Comment 25803 Date: 2017-10-26 07:56:36 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [5e59ce515a5b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5e59ce515a5b) 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=5e59ce515a5b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5e59ce515a5b) Changeset description: fixed bugs 6444, 6445 ## Comment 25808 Date: 2017-10-26 14:21:34 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d245a7b07594](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d245a7b07594) made by Richard Koopmanschap <richard.koopmanschap@monetdbsolutions.com> in the MonetDB repo, refers to this bug. For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d245a7b07594](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d245a7b07594) Changeset description: Added tests for bug #6444 and 6448 ## Comment 25810 Date: 2017-10-26 15:41:08 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [96ff384f1c07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=96ff384f1c07) made by Richard Koopmanschap <richard.koopmanschap@monetdbsolutions.com> in the MonetDB repo, refers to this bug. For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=96ff384f1c07](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=96ff384f1c07) Changeset description: Added tests for bugs 6444 and 6448
Using 'with' keyword with table returning function crashes monetdb
https://api.github.com/repos/MonetDB/MonetDB/issues/6444/comments
0
2020-11-30T15:54:53Z
2024-06-27T13:01:34Z
https://github.com/MonetDB/MonetDB/issues/6444
753,595,086
6,444
[ "MonetDB", "MonetDB" ]
Date: 2017-10-22 19:22:38 +0200 From: @drstmane To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:03 +0100 ## Comment 25783 Date: 2017-10-22 19:22:38 +0200 From: @drstmane Using the Jul2017-SP2 release candidate, in the below example, the first query works fine, while the second one fails with "SELECT: identifier 'c' unknown", which it IMHO should not. start transaction; create table "t" ( "c" int ); insert into "t" values (1),(2); select * from "t"; -- works fine: select ( sum( ("c" - (select avg("c") from "t")) * ("c" - (select avg("c") from "t")) ) -- / -- (select count("c") from "t") ) / ( stddev_pop(c) * stddev_pop(c) ) / (select count("c") from "t") from "t" ; -- FAILS with "SELECT: identifier 'c' unknown" select ( sum( ("c" - (select avg("c") from "t")) * ("c" - (select avg("c") from "t")) ) / (select count("c") from "t") ) / ( stddev_pop(c) * stddev_pop(c) ) -- / -- (select count("c") from "t") from "t" ; rollback; ## Comment 25908 Date: 2017-11-26 10:05:38 +0100 From: @njnes fixed, we now keep the value returning 'relational expressions' in a dag of seperate relational operators (not a one big relation). This simplifies a lot (more simplification is still required) ## Comment 25909 Date: 2017-11-26 10:06:33 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [df058ebf2575](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=df058ebf2575) 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=df058ebf2575](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=df058ebf2575) Changeset description: fixed bug #6443, keep value returning subqueries in a seperate list.
complex(?) query forgets(?) column name
https://api.github.com/repos/MonetDB/MonetDB/issues/6443/comments
0
2020-11-30T15:54:50Z
2024-06-27T13:01:33Z
https://github.com/MonetDB/MonetDB/issues/6443
753,595,039
6,443
[ "MonetDB", "MonetDB" ]
Date: 2017-10-20 23:52:07 +0200 From: @drstmane To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:45:59 +0100 ## Comment 25774 Date: 2017-10-20 23:52:07 +0200 From: @drstmane Created attachment 574 test script COPY INTO BEST EFFORT makes mserver5 segfault in case input columns are skipped, as, e.g., in the following examples. Please find a sample GDB trace below and an exhaustive test script attached. start transaction; create table t ( c1 int , c2 int ); copy 1 records into t (c1) from stdin (c1,c2) best effort; 1|2 rollback; start transaction; create table t ( c1 int , c2 int ); copy 1 records into t (c2) from stdin (c1,c2) best effort; 1|2 rollback; start transaction; create table t ( c1 int , c2 int ); copy 1 records into t (c1,c2) from stdin (x,c1,c2) best effort; 0|1|2 rollback; start transaction; create table t ( c1 int , c2 int ); copy 1 records into t (c1,c2) from stdin (c1,x,c2) best effort; 1|0|2 rollback; start transaction; create table t ( c1 int , c2 int ); copy 1 records into t (c1,c2) from stdin (c1,c2,x) best effort; 1|2|0 rollback; ======== Thread 6 "mserver5" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fffd49d5700 (LWP 26217)] 0x00007ffff7b0ee61 in SQLload_file (cntxt=0x7ffff0cc8338, as=0x7fffd49d4170, b=0x7fffc0002970, out=0x7fffcc002b70, csep=0x7fffc00e8360 "|", rsep=0x7fffc00e8390 "\n", quote=0 '\000', skip=0, maxrow=1, best=1) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/modules/mal/tablet.c:1836 1836 width = as->format[attr].c->twidth; Missing separate debuginfos, use: dnf debuginfo-install R-core-3.4.1-1.fc26.x86_64 SuperLU-5.2.0-2.fc26.x86_64 armadillo-7.900.1-1.fc26.x86_64 arpack-3.5.0-1.fc26.x86_64 atlas-3.10.2-16.fc26.x86_64 blas-3.6.1-4.fc26.x86_64 boost-atomic-1.63.0-6.fc26.x86_64 boost-chrono-1.63.0-6.fc26.x86_64 boost-date-time-1.63.0-6.fc26.x86_64 boost-filesystem-1.63.0-6.fc26.x86_64 boost-iostreams-1.63.0-6.fc26.x86_64 boost-program-options-1.63.0-6.fc26.x86_64 boost-regex-1.63.0-6.fc26.x86_64 boost-system-1.63.0-6.fc26.x86_64 boost-thread-1.63.0-6.fc26.x86_64 bzip2-libs-1.0.6-22.fc26.x86_64 cfitsio-3.370-7.fc26.x86_64 cyrus-sasl-lib-2.1.26-32.fc26.x86_64 expat-2.2.4-1.fc26.x86_64 fontconfig-2.12.1-4.fc26.x86_64 freetype-2.7.1-9.fc26.x86_64 freexl-1.0.3-1.fc26.x86_64 gdal-libs-2.1.3-1.fc26.x86_64 geos-3.6.1-2.fc26.x86_64 giflib-4.1.6-16.fc26.x86_64 hdf5-1.8.18-5.fc26.x86_64 jasper-libs-2.0.12-1.fc26.x86_64 jbigkit-libs-2.1-6.fc26.x86_64 json-c-0.12.1-2.fc26.x86_64 keyutils-libs-1.5.10-1.fc26.x86_64 krb5-libs-1.15.1-28.fc26.x86_64 lapack-3.6.1-4.fc26.x86_64 laszip-2.2.0-7.fc26.x86_64 lcms2-2.8-3.fc26.x86_64 libICE-1.0.9-9.fc26.x86_64 libSM-1.2.2-5.fc26.x86_64 libX11-1.6.5-2.fc26.x86_64 libXau-1.0.8-7.fc26.x86_64 libatomic_ops-7.4.4-2.fc26.x86_64 libcom_err-1.43.4-2.fc26.x86_64 libcrypt-nss-2.25-10.fc26.x86_64 libcurl-7.53.1-10.fc26.x86_64 libdap-3.18.3-2.fc26.x86_64 libgcc-7.1.1-3.fc26.x86_64 libgeotiff-1.4.0-9.fc26.x86_64 libgfortran-7.1.1-3.fc26.x86_64 libgomp-7.1.1-3.fc26.x86_64 libgta-1.0.7-4.fc26.x86_64 libicu-57.1-6.fc26.x86_64 libidn2-2.0.4-1.fc26.x86_64 libjpeg-turbo-1.5.1-0.fc26.x86_64 libkml-1.3.0-4.fc26.x86_64 liblas-1.8.0-16.fc26.x86_64 libnghttp2-1.21.1-1.fc26.x86_64 libpng-1.6.28-2.fc26.x86_64 libpsl-0.18.0-1.fc26.x86_64 libquadmath-7.1.1-3.fc26.x86_64 libselinux-2.6-7.fc26.x86_64 libspatialite-4.3.0a-4.fc26.x86_64 libssh2-1.8.0-2.fc26.x86_64 libstdc++-7.1.1-3.fc26.x86_64 libtiff-4.0.8-1.fc26.x86_64 libtool-ltdl-2.4.6-17.fc26.x86_64 libunistring-0.9.7-1.fc26.x86_64 libuuid-2.30.1-1.fc26.x86_64 libwebp-0.6.0-2.fc26.x86_64 libxcb-1.12-3.fc26.x86_64 libxml2-2.9.4-2.fc26.x86_64 mariadb-libs-10.1.26-2.fc26.x86_64 minizip-1.2.11-2.fc26.x86_64 ncurses-libs-6.0-8.20170212.fc26.x86_64 netcdf-4.4.1.1-4.fc26.x86_64 nspr-4.16.0-1.fc26.x86_64 nss-3.32.0-1.1.fc26.x86_64 nss-softokn-freebl-3.32.0-1.2.fc26.x86_64 nss-util-3.32.0-1.0.fc26.x86_64 ogdi-3.2.0-1.fc26.x86_64 openblas-Rblas-0.2.20-2.fc26.x86_64 openblas-openmp-0.2.20-2.fc26.x86_64 openjpeg2-2.2.0-3.fc26.x86_64 openldap-2.4.45-1.fc26.x86_64 openssl-libs-1.1.0f-7.fc26.x86_64 pcre-8.41-1.fc26.x86_64 poppler-0.52.0-4.fc26.x86_64 postgresql-libs-9.6.4-1.fc26.x86_64 proj-4.9.3-2.fc26.x86_64 readline-7.0-5.fc26.x86_64 sqlite-libs-3.20.1-1.fc26.x86_64 tre-0.8.0-19.20140228gitc2f5d13.fc26.x86_64 unixODBC-2.3.4-5.fc26.x86_64 uriparser-0.8.4-4.fc26.x86_64 xerces-c-3.1.4-2.fc26.x86_64 xz-libs-5.2.3-2.fc26.x86_64 zlib-1.2.11-2.fc26.x86_64 (gdb) bt 0 0x00007ffff7b0ee61 in SQLload_file (cntxt=0x7ffff0cc8338, as=0x7fffd49d4170, b=0x7fffc0002970, out=0x7fffcc002b70, csep=0x7fffc00e8360 "|", rsep=0x7fffc00e8390 "\n", quote=0 '\000', skip=0, maxrow=1, best=1) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/modules/mal/tablet.c:1836 1 0x00007fffef36bb8a in mvc_import_table (cntxt=0x7ffff0cc8338, bats=0x7fffd49d4250, m=0x7fffc000adf0, bs=0x7fffc0002970, t=0x7fffc0070a40, sep=0x7fffc00e8360 "|", rsep=0x7fffc00e8390 "\n", ssep=0x0, ns=0x7fffc006b020 "null", sz=1, offset=0, locked=0, best=1) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/sql/backends/monet5/sql_result.c:982 2 0x00007fffef314340 in mvc_import_table_wrap (cntxt=0x7ffff0cc8338, mb=0x7fffc05de750, stk=0x7fffc01f6a60, pci=0x7fffc00879a0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/sql/backends/monet5/sql.c:2477 3 0x00007ffff79e98f3 in runMALsequence (cntxt=0x7ffff0cc8338, mb=0x7fffc05de750, startpc=1, stoppc=0, stk=0x7fffc01f6a60, env=0x0, pcicaller=0x0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_interpreter.c:645 4 0x00007ffff79e8496 in runMAL (cntxt=0x7ffff0cc8338, mb=0x7fffc05de750, mbcaller=0x0, env=0x0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_interpreter.c:354 5 0x00007fffef327be8 in SQLrun (c=0x7ffff0cc8338, be=0x7fffc006ae20, m=0x7fffc000adf0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/sql/backends/monet5/sql_execute.c:352 6 0x00007fffef32945b in SQLengineIntern (c=0x7ffff0cc8338, be=0x7fffc006ae20) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/sql/backends/monet5/sql_execute.c:744 7 0x00007fffef3262cf in SQLengine (c=0x7ffff0cc8338) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/sql/backends/monet5/sql_scenario.c:1243 8 0x00007ffff7a11f00 in runPhase (c=0x7ffff0cc8338, phase=4) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_scenario.c:506 9 0x00007ffff7a120d9 in runScenarioBody (c=0x7ffff0cc8338) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_scenario.c:548 10 0x00007ffff7a121e7 in runScenario (c=0x7ffff0cc8338) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_scenario.c:568 11 0x00007ffff7a13d9c in MSserveClient (dummy=0x7ffff0cc8338) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_session.c:473 12 0x00007ffff7a1388c in MSscheduleClient (command=0x7fffc00008d0 "\020\372\005\300\377\177", challenge=0x7fffd49d4d6b "FdsTcHQWd", fin=0x7fffc0002970, fout=0x7fffcc002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/mal/mal_session.c:364 13 0x00007ffff7ab3711 in doChallenge (data=0x7fffcc0008d0) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/monetdb5/modules/mal/mal_mapi.c:273 14 0x00007ffff768c23a in thread_starter (arg=0x7fffcc004c60) at /export/scratch1/home/manegold/_/Monet/HG/Dec2016/source/MonetDB/gdk/gdk_system.c:485 15 0x00007ffff4caf36d in start_thread () from /lib64/libpthread.so.0 16 0x00007ffff49e7bbf in clone () from /lib64/libc.so.6 (gdb) li 1831 if (best && BATcount(as->format[firstcol].c)) { 1832 BUN limit; 1833 int width; 1834 1835 for (attr = 0; attr < as->nr_attrs; attr++) { 1836 width = as->format[attr].c->twidth; 1837 switch (width){ 1838 case 1: 1839 trimerrors(bte); 1840 break; (gdb) p attr $1 = 1 (gdb) p as $2 = (Tablet *) 0x7fffd49d4170 (gdb) p *as $3 = {offset = 0, nr = 1, nr_attrs = 2, format = 0x7fffc00b2440, error = 0x0, tryall = 0, filename = 0x0, complaints = 0x0} (gdb) p as->nr_attrs $4 = 2 (gdb) p as->format $5 = (Column *) 0x7fffc00b2440 (gdb) p as->format[attr] $6 = {name = 0x7fffc0070d70 "%cn", sep = 0x7fffc00e8390 "\n", rsep = 0x7fffc00e8390 "\n", seplen = 1, type = 0x7fffc006b050 "oid", adt = 6, c = 0x0, ci = {b = 0x0, tvid = 0}, p = 0, tabs = 0, nullstr = 0x7fffc006b020 "null", null_length = 4, width = 0, maxwidth = 0, fieldstart = 0, fieldwidth = 0, scale = 0, precision = 0, tostr = 0x7fffef36a9f9 <_ASCIIadt_toStr>, frstr = 0x7fffef36a617 <_ASCIIadt_frStr>, extra = 0x7fffc0070ce0, data = 0x7fffc01d6a30, skip = 1, len = 8, nillen = 8, ws = 1 '\001', quote = 0 '\000', nildata = 0x7ffff7738218 <lng_nil>, size = 8} (gdb) p as->format[attr].c $7 = (BAT *) 0x0 (gdb) p as->format[attr].c->twidth There is no member named twidth. ======== > Attached file: [best-effort-crash.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6442_best-effort-crash.sql_574) (application/sql, 3651 bytes) > Description: test script ## Comment 25869 Date: 2017-11-12 15:22:02 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [03187aaf584a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=03187aaf584a) 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=03187aaf584a](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=03187aaf584a) Changeset description: fixed bug #6442, skip columns also in the best effort case ## Comment 25870 Date: 2017-11-12 15:22:46 +0100 From: @njnes skip not needed columns (solves crash on correctly mis sing bat) ## Comment 25871 Date: 2017-11-12 15:31:17 +0100 From: @drstmane Thanks!
SEGFAULT with COPY INTO BEST EFFORT and skipping input columns
https://api.github.com/repos/MonetDB/MonetDB/issues/6442/comments
0
2020-11-30T15:54:46Z
2024-06-27T13:01:32Z
https://github.com/MonetDB/MonetDB/issues/6442
753,594,986
6,442
[ "MonetDB", "MonetDB" ]
Date: 2017-10-20 18:06:37 +0200 From: Manuel &lt;<manuel>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.25.23 (Dec2016-SP5) CC: @njnes Last updated: 2019-01-18 16:55:28 +0100 ## Comment 25772 Date: 2017-10-20 18:06:37 +0200 From: Manuel &lt;<manuel>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: On the example dataset (attached) if I execute this query (Q0) select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc I get: Null_Store_State Store_Manager ------------------------------------------ <null> Annie U. Michelgrove <null> Audrey O. Bird <null> Ayden K. Rowdon <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Joetta D. Prelate <null> Kacie D. Denton <null> Kayley I. Bexley <null> Kermit Y. Kellett <null> Lamont G. Godfrey <null> Peronel G. Dalingridge Which is correct. If I add a limit clause (Q1): select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc limit 5 I get back: Null_Store_State Store_Manager -------------------------------------- <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Kayley I. Bexley <null> Kermit Y. Kellett <null> Lamont G. Godfrey where I was expecting: Null_Store_State Store_Manager ------------------------------------------ <null> Annie U. Michelgrove <null> Audrey O. Bird <null> Ayden K. Rowdon <null> Cyril C. Benthey <null> Gallagher J. Lowth Finally, if I add an offset clause (Q2): select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc limit 5 offset 1 The result is still Null_Store_State Store_Manager -------------------------------------- <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Kayley I. Bexley <null> Kermit Y. Kellett <null> Lamont G. Godfrey So the offset has no effect, I was expecting Null_Store_State Store_Manager ------------------------------------------ <null> Audrey O. Bird <null> Ayden K. Rowdon <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Joetta D. Prelate Note how in the order by clause a total ordering is defined in the records Reproducible: Always ### Steps to Reproduce: 1. Import the example data 2. perform 3 queries: Q0: select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc Q1: select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc limit 5 Q2. select null as "Null_Store_State", "Store_Manager" from "lineitem_denormalized_first1k_sanitised" where "Customer_Date_Of_Birth" > timestamp '1993-03-27 00:00:00.000' group by "Null_Store_State", "Store_Manager" order by "Null_Store_State" asc, "Store_Manager" asc limit 5 offset 1 ### Actual Results: Q1: Null_Store_State Store_Manager -------------------------------------- <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Kayley I. Bexley <null> Kermit Y. Kellett <null> Lamont G. Godfrey Q2: Null_Store_State Store_Manager -------------------------------------- <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Kayley I. Bexley <null> Kermit Y. Kellett <null> Lamont G. Godfrey ### Expected Results: Q1: Null_Store_State Store_Manager ------------------------------------------ <null> Annie U. Michelgrove <null> Audrey O. Bird <null> Ayden K. Rowdon <null> Cyril C. Benthey <null> Gallagher J. Lowth Q2: Null_Store_State Store_Manager ------------------------------------------ <null> Audrey O. Bird <null> Ayden K. Rowdon <null> Cyril C. Benthey <null> Gallagher J. Lowth <null> Joetta D. Prelate ## Comment 25773 Date: 2017-10-20 18:17:29 +0200 From: Manuel &lt;<manuel>&gt; Created attachment 573 sql containing the example dataset > Attached file: [lineitem_denormalized_first1k_sanitised.sql](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6441_lineitem_denormalized_first1k_sanitised.sql_573) (application/octet-stream, 885584 bytes) > Description: sql containing the example dataset ## Comment 25777 Date: 2017-10-21 12:24:06 +0200 From: @njnes this is not a bug. NULL != NULL, ie there is no sort order defined. The order by without limit is handled by a different algorithm with treats null somewhat diffent. Simply replace the NULL in your result with a 1 and order by, order by with limit and even offset seem to work fine. ## Comment 25779 Date: 2017-10-22 14:04:37 +0200 From: Manuel &lt;<manuel>&gt; Hi Niels, unfortunately I cannot do that, as the query in the example is a streamlined version of a more complex query. Say I am doing a full outer join between two tables T1 and T2, then order by the pair (K1, K2) where (K1 is the key of T1, and K2 is the T2). Despite the fact that the pair (K1, K2) is a key in the joined result, once I add a limit and offset clause I will get unpredictable results. ## Comment 25780 Date: 2017-10-22 15:37:55 +0200 From: Manuel &lt;<manuel>&gt; (In reply to Niels Nes from comment 2) > this is not a bug. NULL != NULL, ie there is no sort order defined. The > order by without limit is handled by a different algorithm with treats null > somewhat diffent. > > Simply replace the NULL in your result with a 1 and order by, order by with > limit and even offset seem to work fine. Hi Niels thank you for your help. I still think this is an issue, as even when ordering by a key, limit/offset produces unpredictable results if the key is composed by multiple nullable columns. See my comment below for another example. ## Comment 25781 Date: 2017-10-22 17:03:27 +0200 From: @njnes so your request becomes more of a feature request for order by x asc NULLS FIRST/LAST ## Comment 25782 Date: 2017-10-22 17:42:17 +0200 From: Manuel &lt;<manuel>&gt; (In reply to Niels Nes from comment 5) > so your request becomes more of a feature request for > > order by x asc NULLS FIRST/LAST You prefer to this this that way. All I really need is that given: - a table, or the result of a sub-query T - a multi-column key (k1... kn) on T Once T is ordered by k1...kn and a limit/offset is applied, the output records should be consistent with the underlying order, regardless if k1....kn assume null values. If this is not the case (As in the example above) there is little use of the limit/offset clause as its behaviour it's not predictable and null values are often present in the data. ## Comment 26026 Date: 2017-12-17 12:55:58 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d08cd2365b47](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d08cd2365b47) 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=d08cd2365b47](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d08cd2365b47) Changeset description: SORTfndlast on a void/nil column should always return BATcount. Since all values are equal to NIL, and NIL is smaller than any non-NIL value (and equal to NIL), the first value beyond is the end of the column. This fixes bug #6441. ## Comment 26810 Date: 2019-01-18 16:55:28 +0100 From: @sjoerdmullender All queries return what you wanted. In addition, NULLS FIRST and NULLS LAST has been implemented for the upcoming feature release. Closing as FIXED since the fix for this was already in the Jul2017 branch.
Limit/Offset return the wrong result
https://api.github.com/repos/MonetDB/MonetDB/issues/6441/comments
0
2020-11-30T15:54:42Z
2024-06-27T13:01:31Z
https://github.com/MonetDB/MonetDB/issues/6441
753,594,929
6,441
[ "MonetDB", "MonetDB" ]
Date: 2017-10-19 17:16:53 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:39 +0200 ## Comment 25767 Date: 2017-10-19 17:16:53 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Query: select * from sys.tables where id in (select c.table_id from sys.columns c where c."type" = 'clob'); returns many duplicate rows. This is incorrect. Probably the plan generator is generating a faulty plan. See below. Note: I found this on the version MonetDB v11.27.8 (unreleased), Jul2017 branch compiled on 19 okt 2017. I haven't checked it against release Jul2017-SP2 or Jul2017-SP1. Reproducible: Always ### Steps to Reproduce: Run queries: select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables order by schema_id, name, id; -- lists 60 rows, is ok select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) order by schema_id, name, id; -- lists 55 rows, is ok select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables where id in (select table_id from sys.columns where "type" = 'clob') order by schema_id, name, id; -- lists 71 rows, more than exists in sys.tables, is NOT ok, lots of duplicate rows select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) and id in (select table_id from sys.columns where "type" = 'clob') order by schema_id, name, id; -- lists 44 rows, is NOT ok, lots of duplicate rows select distinct /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) and id in (select table_id from sys.columns where "type" = 'clob') order by schema_id, name, id; -- lists 16 rows, is ok -- it does not improve when more aliases are used select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables t where t.id in (select c.table_id from sys.columns c where c."type" = 'clob') and t.schema_id in (select s.id from sys.schemas s where s.name in ('sys', 'tmp')) order by t.schema_id, t.name, t.id; -- lists 44 rows, is NOT ok, lots of duplicate rows plan select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary from sys.tables where id in (select table_id from sys.columns where "type" = 'clob') order by schema_id, name, id; ### Actual Results: bash-4.4$ mclient -p41000 Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>\q bash-4.4$ ./start_squirrel.sh bash-4.4$ bash-4.4$ bash-4.4$ mclient -p41000 Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> order by schema_id, name, id; +--------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +====================+===========+======+========+===============+========+===========+ | _columns | 2000 | 10 | true | 0 | 0 | 0 | | _tables | 2000 | 10 | true | 0 | 0 | 0 | | args | 2000 | 10 | true | 0 | 0 | 0 | | auths | 2000 | 10 | true | 0 | 0 | 0 | | columns | 2000 | 11 | true | 0 | 0 | 0 | | db_user_info | 2000 | 10 | true | 0 | 0 | 0 | | dependencies | 2000 | 10 | true | 0 | 0 | 0 | | dependency_types | 2000 | 10 | true | 0 | 1 | 0 | | environment | 2000 | 11 | true | 0 | 0 | 0 | | function_languages | 2000 | 10 | true | 0 | 1 | 0 | | function_types | 2000 | 10 | true | 0 | 1 | 0 | | functions | 2000 | 10 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | idxs | 2000 | 10 | true | 0 | 0 | 0 | | index_types | 2000 | 10 | true | 0 | 1 | 0 | | key_types | 2000 | 10 | true | 0 | 1 | 0 | | keys | 2000 | 10 | true | 0 | 0 | 0 | | keywords | 2000 | 10 | true | 0 | 1 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_dims | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_files | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_vardim | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_vars | 2000 | 10 | true | 0 | 0 | 0 | | objects | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | privilege_codes | 2000 | 10 | true | 0 | 1 | 0 | | privileges | 2000 | 10 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | schemas | 2000 | 10 | true | 0 | 0 | 0 | | sequences | 2000 | 10 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | spatial_ref_sys | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | systemfunctions | 2000 | 10 | true | 0 | 0 | 0 | | table_types | 2000 | 10 | true | 0 | 1 | 0 | | tables | 2000 | 11 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | | triggers | 2000 | 10 | true | 0 | 0 | 0 | | types | 2000 | 10 | true | 0 | 0 | 0 | | user_role | 2000 | 10 | true | 0 | 0 | 0 | | users | 2000 | 11 | true | 0 | 0 | 0 | | _columns | 2097 | 10 | true | 2 | 0 | 0 | | _tables | 2097 | 10 | true | 2 | 0 | 0 | | idxs | 2097 | 10 | true | 2 | 0 | 0 | | keys | 2097 | 10 | true | 2 | 0 | 0 | | objects | 2097 | 10 | true | 2 | 0 | 0 | | triggers | 2097 | 10 | true | 2 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | files | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | sq | 8043 | 10 | true | 0 | 0 | 0 | +--------------------+-----------+------+--------+---------------+--------+-----------+ 60 tuples (5.861ms) sql>-- lists 60 rows, is ok sql> sql>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) more> order by schema_id, name, id; +--------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +====================+===========+======+========+===============+========+===========+ | _columns | 2000 | 10 | true | 0 | 0 | 0 | | _tables | 2000 | 10 | true | 0 | 0 | 0 | | args | 2000 | 10 | true | 0 | 0 | 0 | | auths | 2000 | 10 | true | 0 | 0 | 0 | | columns | 2000 | 11 | true | 0 | 0 | 0 | | db_user_info | 2000 | 10 | true | 0 | 0 | 0 | | dependencies | 2000 | 10 | true | 0 | 0 | 0 | | dependency_types | 2000 | 10 | true | 0 | 1 | 0 | | environment | 2000 | 11 | true | 0 | 0 | 0 | | function_languages | 2000 | 10 | true | 0 | 1 | 0 | | function_types | 2000 | 10 | true | 0 | 1 | 0 | | functions | 2000 | 10 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | idxs | 2000 | 10 | true | 0 | 0 | 0 | | index_types | 2000 | 10 | true | 0 | 1 | 0 | | key_types | 2000 | 10 | true | 0 | 1 | 0 | | keys | 2000 | 10 | true | 0 | 0 | 0 | | keywords | 2000 | 10 | true | 0 | 1 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_dims | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_files | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_vardim | 2000 | 10 | true | 0 | 0 | 0 | | netcdf_vars | 2000 | 10 | true | 0 | 0 | 0 | | objects | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | privilege_codes | 2000 | 10 | true | 0 | 1 | 0 | | privileges | 2000 | 10 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | schemas | 2000 | 10 | true | 0 | 0 | 0 | | sequences | 2000 | 10 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | spatial_ref_sys | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | systemfunctions | 2000 | 10 | true | 0 | 0 | 0 | | table_types | 2000 | 10 | true | 0 | 1 | 0 | | tables | 2000 | 11 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | | triggers | 2000 | 10 | true | 0 | 0 | 0 | | types | 2000 | 10 | true | 0 | 0 | 0 | | user_role | 2000 | 10 | true | 0 | 0 | 0 | | users | 2000 | 11 | true | 0 | 0 | 0 | | _columns | 2097 | 10 | true | 2 | 0 | 0 | | _tables | 2097 | 10 | true | 2 | 0 | 0 | | idxs | 2097 | 10 | true | 2 | 0 | 0 | | keys | 2097 | 10 | true | 2 | 0 | 0 | | objects | 2097 | 10 | true | 2 | 0 | 0 | | triggers | 2097 | 10 | true | 2 | 0 | 0 | +--------------------+-----------+------+--------+---------------+--------+-----------+ 55 tuples (9.546ms) sql>-- lists 55 rows, is ok sql> sql>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where id in (select table_id from sys.columns where "type" = 'clob') more> order by schema_id, name, id; +-------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +===================+===========+======+========+===============+========+===========+ | environment | 2000 | 11 | true | 0 | 0 | 0 | | environment | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | export | 8043 | 10 | true | 0 | 0 | 0 | | files | 8043 | 10 | true | 0 | 0 | 0 | | files | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | pg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | rg | 8043 | 10 | true | 0 | 0 | 0 | | sq | 8043 | 10 | true | 0 | 0 | 0 | | sq | 8043 | 10 | true | 0 | 0 | 0 | | sq | 8043 | 10 | true | 0 | 0 | 0 | | sq | 8043 | 10 | true | 0 | 0 | 0 | +-------------------+-----------+------+--------+---------------+--------+-----------+ 71 tuples (6.250ms) sql>-- lists 71 rows, more than exists in sys.tables, is NOT ok, lots of duplicate rows sql> sql>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) more> and id in (select table_id from sys.columns where "type" = 'clob') more> order by schema_id, name, id; +-------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +===================+===========+======+========+===============+========+===========+ | environment | 2000 | 11 | true | 0 | 0 | 0 | | environment | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | +-------------------+-----------+------+--------+---------------+--------+-----------+ 44 tuples (8.211ms) sql>-- lists 44 rows, is NOT ok, lots of duplicate rows sql> sql>select distinct /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where schema_id in (select id from sys.schemas where name in ('sys', 'tmp')) more> and id in (select table_id from sys.columns where "type" = 'clob') more> order by schema_id, name, id; +-------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +===================+===========+======+========+===============+========+===========+ | environment | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | +-------------------+-----------+------+--------+---------------+--------+-----------+ 16 tuples (14.232ms) sql>-- lists 16 rows, is ok sql> sql>-- it does not improve when more aliases are used sql>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables t more> where t.id in (select c.table_id from sys.columns c where c."type" = 'clob') more> and t.schema_id in (select s.id from sys.schemas s where s.name in ('sys', 'tmp')) more> order by t.schema_id, t.name, t.id; +-------------------+-----------+------+--------+---------------+--------+-----------+ | name | schema_id | type | system | commit_action | access | temporary | +===================+===========+======+========+===============+========+===========+ | environment | 2000 | 11 | true | 0 | 0 | 0 | | environment | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | geometry_columns | 2000 | 11 | true | 0 | 0 | 0 | | netcdf_attrs | 2000 | 10 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | optimizers | 2000 | 11 | true | 0 | 0 | 0 | | querylog_calls | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_catalog | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | querylog_history | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | queue | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | rejects | 2000 | 11 | true | 0 | 0 | 0 | | sessions | 2000 | 11 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | statistics | 2000 | 10 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storage | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodel | 2000 | 11 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | storagemodelinput | 2000 | 10 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tablestoragemodel | 2000 | 11 | true | 0 | 0 | 0 | | tracelog | 2000 | 11 | true | 0 | 0 | 0 | +-------------------+-----------+------+--------+---------------+--------+-----------+ 44 tuples (11.785ms) sql>-- lists 44 rows, is NOT ok, lots of duplicate rows sql> sql>plan more>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where id in (select table_id from sys.columns where "type" = 'clob') more> order by schema_id, name, id; +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | rel | +==================================================================================================================================================================================================================+ | project ( | | | project ( | | | | join ( | | | | | union ( | | | | | | project ( | | | | | | | project ( | | | | | | | | select ( | | | | | | | | | table(sys._tables) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", "_tables"."type", "_tables"."system", "_tables"."commit_action", "_tables"."access" ] COUNT | | | | | | | | ) [ "_tables"."type" != smallint "2" ] | | | | | | | ) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", sys.isnull("_tables"."system") as "L101"."L101", sys.isnull(sys.=("_tables"."commit_action", smallint "0")) as "L102". | : "L102", sys.ifthenelse("L102"."L102", boolean "false", sys.=("_tables"."commit_action", smallint "0")) as "L103"."L103", sys.ifthenelse("L101"."L101", boolean "false", "_tables"."system") as "L104"."L104", sm : : allint[sys.ifthenelse("L104"."L104", sys.sql_add(int["_tables"."type"], int "10"), sys.ifthenelse("L103"."L103", int["_tables"."type"], sys.sql_add(int["_tables"."type"], int "20")))] as "L7"."type", "_tables : : "."system", "_tables"."commit_action", "_tables"."access", sys.isnull(sys.and(sys.not("_tables"."system"), sys.>("_tables"."commit_action", smallint "0"))) as "L105"."L105", sys.ifthenelse("L105"."L105", bool : : ean "false", sys.and(sys.not("_tables"."system"), sys.>("_tables"."commit_action", smallint "0"))) as "L106"."L106", sys.ifthenelse("L106"."L106", tinyint "1", tinyint "0") as "L14"."temporary" ] : | | | | | ) [ "_tables"."id" as "tables"."id", "_tables"."name" as "tables"."name", "_tables"."schema_id" as "tables"."schema_id", "_tables"."query" as "tables"."query", "L7"."type" as "tables"."type", "_tables | : "."system" as "tables"."system", "_tables"."commit_action" as "tables"."commit_action", "_tables"."access" as "tables"."access", "L14"."temporary" as "tables"."temporary" ], : | | | | | project ( | | | | | | | project ( | | | | | | | | project ( | | | | | | | | | table(tmp._tables) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", "_tables"."type", "_tables"."system", "_tables"."commit_action", "_tables"."access" ] COUNT | | | | | | | | ) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", smallint[sys.sql_add(int["_tables"."type"], int "30")] as "L23"."type", "_tables"."system", "_tables"."commit_action | : ", "_tables"."access", tinyint "1" as "L30"."temporary" ] : | | | | | | ) [ "_tables"."id" as "L32"."id", "_tables"."name" as "L32"."name", "_tables"."schema_id" as "L32"."schema_id", "_tables"."query" as "L32"."query", "L23"."type" as "L32"."type", "_tables"."system" a | : s "L32"."system", "_tables"."commit_action" as "L32"."commit_action", "_tables"."access" as "L32"."access", tinyint["L30"."temporary"] as "L32"."temporary" ] : | | | | | ) [ "L32"."id" as "tables"."id", "L32"."name" as "tables"."name", "L32"."schema_id" as "tables"."schema_id", "L32"."query" as "tables"."query", "L32"."type" as "tables"."type", "L32"."system" as "tabl | : es"."system", "L32"."commit_action" as "tables"."commit_action", "L32"."access" as "tables"."access", "L32"."temporary" as "tables"."temporary" ] : | | | | ) [ "tables"."id", "tables"."name", "tables"."schema_id", "tables"."query", "tables"."type", "tables"."system", "tables"."commit_action", "tables"."access", "tables"."temporary" ], | | | | | union ( | | | | | | project ( | | | | | | | select ( | | | | | | | | table(sys._columns) [ "_columns"."type" as "p"."type", "_columns"."table_id" as "p"."table_id" ] COUNT | | | | | | | ) [ "p"."type" = varchar(1024) "clob" ] | | | | | | ) [ "p"."table_id" as "L67"."L67" ], | | | | | | project ( | | | | | | | select ( | | | | | | | | table(tmp._columns) [ "_columns"."type" as "t"."type", "_columns"."table_id" as "t"."table_id" ] COUNT | | | | | | | ) [ "t"."type" = varchar(1024) "clob" ] | | | | | | ) [ "t"."table_id" as "L67"."L67" ] | | | | | ) [ "L67"."L67" ] | | | | ) [ "tables"."id" = "L67"."L67" ] | | | ) [ "tables"."id", "tables"."name", "tables"."schema_id", "tables"."type", "tables"."system", "tables"."commit_action", "tables"."access", "tables"."temporary" ] | | ) [ "tables"."name", "tables"."schema_id", "tables"."type", "tables"."system", "tables"."commit_action", "tables"."access", "tables"."temporary" ] [ "tables"."schema_id" ASC, "tables"."name" ASC, "tables"."id | : " ASC ] : +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ 34 tuples (2.919ms) sql> ### Expected Results: Should not lists duplicate rows in the result when adding where-clause condition: id in (select table_id from sys.columns where "type" = 'clob') Probably the plan generator is generating a faulty plan. See output of plan of the query with the faulty result. ## Comment 25771 Date: 2017-10-19 23:17:07 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; Tested it also on Jul2017-SP2 (20171011.msi test built) and the problem does not occur in that version. The plan of Jul2017-SP2 is different (line 3 uses a semijoin instead of a join) when compared to the plan of the 20171029 version. The plan output on Jul2017-SP2 is: sql>plan more>select /* id, */ name, schema_id, /*query,*/ type, system, commit_action, access, temporary more> from sys.tables more> where id in (select table_id from sys.columns where "type" = 'clob') more> order by schema_id, name, id; +-----------------------------------------------------------------------------------------------------------------------------------------+ | rel | +=========================================================================================================================================+ | project ( | | | project ( | | | | semijoin ( | | | | | union ( | | | | | | project ( | | | | | | | project ( | | | | | | | | select ( | | | | | | | | | table(sys._tables) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", "_tables"."type", "_tabl | : es"."system", "_tables"."commit_action", "_tables"."access" ] COUNT : | | | | | | | ) [ "_tables"."type" != smallint "2" ] | | | | | | | ) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", sys.isnull("_tables"."system") as "L102"."L10 | : 2", sys.isnull(sys.=("_tables"."commit_action", smallint "0")) as "L103"."L103", sys.ifthenelse("L103"."L103", boolean "false", sys.=(" : : _tables"."commit_action", smallint "0")) as "L104"."L104", sys.ifthenelse("L102"."L102", boolean "false", "_tables"."system") as "L105" : : ."L105", smallint[sys.ifthenelse("L105"."L105", sys.sql_add(int["_tables"."type"], int "10"), sys.ifthenelse("L104"."L104", int["_table : : s"."type"], sys.sql_add(int["_tables"."type"], int "20")))] as "L7"."type", "_tables"."system", "_tables"."commit_action", "_tables"."a : : ccess", sys.isnull(sys.and(sys.not("_tables"."system"), sys.>("_tables"."commit_action", smallint "0"))) as "L106"."L106", sys.ifthenel : : se("L106"."L106", boolean "false", sys.and(sys.not("_tables"."system"), sys.>("_tables"."commit_action", smallint "0"))) as "L107"."L10 : : 7", sys.ifthenelse("L107"."L107", tinyint "1", tinyint "0") as "L14"."temporary" ] : | | | | | ) [ "_tables"."id" as "tables"."id", "_tables"."name" as "tables"."name", "_tables"."schema_id" as "tables"."schema_id", "_tabl | : es"."query" as "tables"."query", "L7"."type" as "tables"."type", "_tables"."system" as "tables"."system", "_tables"."commit_action" as : : "tables"."commit_action", "_tables"."access" as "tables"."access", "L14"."temporary" as "tables"."temporary" ], : | | | | | project ( | | | | | | | project ( | | | | | | | | project ( | | | | | | | | | table(tmp._tables) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", "_tables"."type", "_tabl | : es"."system", "_tables"."commit_action", "_tables"."access" ] COUNT : | | | | | | | ) [ "_tables"."id", "_tables"."name", "_tables"."schema_id", "_tables"."query", smallint[sys.sql_add(int["_tables"."type"], | : int "30")] as "L23"."type", "_tables"."system", "_tables"."commit_action", "_tables"."access", tinyint "1" as "L30"."temporary" ] : | | | | | | ) [ "_tables"."id" as "L32"."id", "_tables"."name" as "L32"."name", "_tables"."schema_id" as "L32"."schema_id", "_tables"."qu | : ery" as "L32"."query", "L23"."type" as "L32"."type", "_tables"."system" as "L32"."system", "_tables"."commit_action" as "L32"."commit_a : : ction", "_tables"."access" as "L32"."access", tinyint["L30"."temporary"] as "L32"."temporary" ] : | | | | | ) [ "L32"."id" as "tables"."id", "L32"."name" as "tables"."name", "L32"."schema_id" as "tables"."schema_id", "L32"."query" as " | : tables"."query", "L32"."type" as "tables"."type", "L32"."system" as "tables"."system", "L32"."commit_action" as "tables"."commit_action : : ", "L32"."access" as "tables"."access", "L32"."temporary" as "tables"."temporary" ] : | | | | ) [ "tables"."id", "tables"."name", "tables"."schema_id", "tables"."query", "tables"."type", "tables"."system", "tables"."commit_ | : action", "tables"."access", "tables"."temporary" ], : | | | | union ( | | | | | | project ( | | | | | | | select ( | | | | | | | | table(sys._columns) [ "_columns"."type" as "p"."type", "_columns"."table_id" as "p"."table_id" ] COUNT | | | | | | | ) [ "p"."type" = varchar(1024) "clob" ] | | | | | | ) [ "p"."table_id" as "L67"."L66" ], | | | | | | project ( | | | | | | | select ( | | | | | | | | table(tmp._columns) [ "_columns"."type" as "t"."type", "_columns"."table_id" as "t"."table_id" ] COUNT | | | | | | | ) [ "t"."type" = varchar(1024) "clob" ] | | | | | | ) [ "t"."table_id" as "L67"."L66" ] | | | | | ) [ "L67"."L66" ] | | | | ) [ "tables"."id" = "L67"."L66" ] | | | ) [ "tables"."id", "tables"."name", "tables"."schema_id", "tables"."type", "tables"."system", "tables"."commit_action", "tables"."acc | : ess", "tables"."temporary" ] : | ) [ "tables"."name", "tables"."schema_id", "tables"."type", "tables"."system", "tables"."commit_action", "tables"."access", "tables"."t | : emporary" ] [ "tables"."schema_id" ASC, "tables"."name" ASC, "tables"."id" ASC ] : +-----------------------------------------------------------------------------------------------------------------------------------------+ 34 tuples (5.598ms) sql> ## Comment 25775 Date: 2017-10-21 11:32:03 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [901a54cbadd9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=901a54cbadd9) 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=901a54cbadd9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=901a54cbadd9) Changeset description: Fixes for bug #6440 (ie properly use semi/anti join for in) Implement drop schema schema_name restrict (see bug #6438) We keep the current default (cascade) in the release branch and switch to the SQL correct default in the default branch. ## Comment 25778 Date: 2017-10-21 13:10:41 +0200 From: @njnes fixed
Faulty plan generated. Query returns more rows than expected or existing in the view sys.tables.
https://api.github.com/repos/MonetDB/MonetDB/issues/6440/comments
0
2020-11-30T15:54:38Z
2024-06-27T13:01:30Z
https://github.com/MonetDB/MonetDB/issues/6440
753,594,875
6,440
[ "MonetDB", "MonetDB" ]
Date: 2017-10-19 15:26:18 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: akkaran046, @njnes Last updated: 2019-02-12 14:00:43 +0100 ## Comment 25766 Date: 2017-10-19 15:26:18 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Analyze schema.table will populate or update rows in table sys.statistics. However when an analysed table or column is dropped the referencing rows in sys.statistics are not dropped also! This creates invalid Foreign Key references to column ids which do not exist in sys.columns. The query: select * from sys.statistics where column_id not in (select id from sys.columns); will than return rows, which indicates inconsistencies in the data and corresponding problems when joining with sys.columns. As those rows are invalid (and useless) they should be deleted automatically when a column or table (including all its columns) is dropped. Reproducible: Always ### Steps to Reproduce: CREATE TABLE sys.abc (a INT, b VARCHAR(10)); INSERT INTO sys.abc VALUES (1, 'one'); INSERT INTO sys.abc VALUES (2, 'two'); SELECT * FROM sys.abc; DELETE FROM sys.statistics; ANALYZE sys.abc; SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; -- expected 2 rows SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); -- expected 0 rows ALTER TABLE sys.abc DROP COLUMN b; SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); -- expected 0 rows but found 1 row ! DROP TABLE sys.abc CASCADE; SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); -- expected 0 rows but found 2 rows ! SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; -- expected 0 rows but found 2 rows ! DELETE FROM sys.statistics; ### Actual Results: bash-4.4$ mclient -p41000 Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>CREATE TABLE sys.abc (a INT, b VARCHAR(10)); operation successful (11.158ms) sql>INSERT INTO sys.abc VALUES (1, 'one'); 1 affected row (2.768ms) sql>INSERT INTO sys.abc VALUES (2, 'two'); 1 affected row (2.228ms) sql>SELECT * FROM sys.abc; +------+------+ | a | b | +======+======+ | 1 | one | | 2 | two | +------+------+ 2 tuples (2.361ms) sql> sql>DELETE FROM sys.statistics; 0 affected rows (2.348ms) sql> sql>ANALYZE sys.abc; sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +=========+=======+========+=======+========+======+========+========+========+===========+ | int | 4 | 2 | 2 | 2 | 0 | 1 | 2 | true | false | | varchar | 1 | 2 | 2 | 2 | 0 | "one" | "two" | true | false | +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 2 tuples (4.628ms) sql>-- expected 2 rows sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +======+=======+========+=======+========+======+========+========+========+===========+ +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 0 tuples (5.592ms) sql>-- expected 0 rows sql> sql>ALTER TABLE sys.abc DROP COLUMN b; operation successful (2.217ms) sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +=========+=======+========+=======+========+======+========+========+========+===========+ | varchar | 1 | 2 | 2 | 2 | 0 | "one" | "two" | true | false | +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 1 tuple (10.743ms) sql>-- expected 0 rows but found 1 row ! sql> sql>DROP TABLE sys.abc CASCADE; operation successful (2.016ms) sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +=========+=======+========+=======+========+======+========+========+========+===========+ | int | 4 | 2 | 2 | 2 | 0 | 1 | 2 | true | false | | varchar | 1 | 2 | 2 | 2 | 0 | "one" | "two" | true | false | +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 2 tuples (5.546ms) sql>-- expected 0 rows but found 2 rows ! sql> sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +=========+=======+========+=======+========+======+========+========+========+===========+ | int | 4 | 2 | 2 | 2 | 0 | 1 | 2 | true | false | | varchar | 1 | 2 | 2 | 2 | 0 | "one" | "two" | true | false | +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 2 tuples (2.838ms) sql>-- expected 0 rows but found 2 rows ! sql>DELETE FROM sys.statistics; 2 affected rows (1.727ms) sql> ### Expected Results: bash-4.4$ mclient -p41000 Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>CREATE TABLE sys.abc (a INT, b VARCHAR(10)); operation successful (11.158ms) sql>INSERT INTO sys.abc VALUES (1, 'one'); 1 affected row (2.768ms) sql>INSERT INTO sys.abc VALUES (2, 'two'); 1 affected row (2.228ms) sql>SELECT * FROM sys.abc; +------+------+ | a | b | +======+======+ | 1 | one | | 2 | two | +------+------+ 2 tuples (2.361ms) sql> sql>DELETE FROM sys.statistics; 0 affected rows (2.348ms) sql> sql>ANALYZE sys.abc; sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +=========+=======+========+=======+========+======+========+========+========+===========+ | int | 4 | 2 | 2 | 2 | 0 | 1 | 2 | true | false | | varchar | 1 | 2 | 2 | 2 | 0 | "one" | "two" | true | false | +---------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 2 tuples (4.628ms) sql>-- expected 2 rows sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +======+=======+========+=======+========+======+========+========+========+===========+ +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 0 tuples (5.592ms) sql>-- expected 0 rows sql> sql>ALTER TABLE sys.abc DROP COLUMN b; operation successful (2.217ms) sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +======+=======+========+=======+========+======+========+========+========+===========+ +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 0 tuples (5.592ms) sql> sql>DROP TABLE sys.abc CASCADE; operation successful (2.016ms) sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics where column_id not in (select id from sys.columns); +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +======+=======+========+=======+========+======+========+========+========+===========+ +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 0 tuples (5.592ms) sql> sql>SELECT /* column_id, */ type, width, /* stamp, */ "sample", "count", "unique", nils, minval, maxval, sorted, revsorted FROM sys.statistics; +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ | type | width | sample | count | unique | nils | minval | maxval | sorted | revsorted | +======+=======+========+=======+========+======+========+========+========+===========+ +------+-------+--------+-------+--------+------+--------+--------+--------+-----------+ 0 tuples (5.592ms) sql>DELETE FROM sys.statistics; 0 affected rows (1.727ms) sql> ## Comment 25914 Date: 2017-11-26 17:53:49 +0100 From: @njnes added code to drop the rows from the statistics table (after column/table drops)
Invalid references to sys.columns.id from sys.statistics.column_id
https://api.github.com/repos/MonetDB/MonetDB/issues/6439/comments
0
2020-11-30T15:54:34Z
2024-06-27T13:01:29Z
https://github.com/MonetDB/MonetDB/issues/6439
753,594,811
6,439
[ "MonetDB", "MonetDB" ]
Date: 2017-10-19 13:55:52 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2018-03-29 15:39:02 +0200 ## Comment 25765 Date: 2017-10-19 13:55:52 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: The SQL command: DROP SCHEMA <schema_name> [ CASCADE | RESTRICT ] allows optional keywords CASCADE or RESTRICT. When specifying RESTRICT it is accepted but NOT enforced, so producing unwanted results: the schema including all its related objects are dropped cascading! Note that the current default behaviour when not specified is CASCADE! When the RESTRICT behaviour is implemented and enforced it could also become the new default behavior, as is the case with DROP TABLE and DROP VIEW, to prevent accidental dropping of schema objects. Reproducible: Always ### Steps to Reproduce: 1. 2. 3. CREATE SCHEMA xyz; CREATE TABLE xyz.t1 (col1 int Primary Key); CREATE VIEW xyz.v1 as SELECT col1 FROM xyz.t1 WHERE col1 > 0 ORDER BY col1; INSERT INTO xyz.t1 VALUES (0), (2), (1); SELECT * FROM xyz.t1; SELECT * FROM xyz.v1; DROP SCHEMA xyz RESTRICT; -- this should return an error as there are objects depending on the schema SELECT * FROM xyz.t1; SELECT * FROM xyz.v1; DROP SCHEMA xyz CASCADE; -- this should return success. Also all depending objects should be dropped SELECT * FROM xyz.t1; SELECT * FROM xyz.v1; ### Actual Results: bash-4.4$ mclient Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>CREATE SCHEMA xyz; operation successful (9.965ms) sql>CREATE TABLE xyz.t1 (col1 int Primary Key); operation successful (7.958ms) sql>CREATE VIEW xyz.v1 as SELECT col1 FROM xyz.t1 WHERE col1 > 0 ORDER BY col1; operation successful (4.855ms) sql>INSERT INTO xyz.t1 VALUES (0), (2), (1); 3 affected rows (2.986ms) sql> sql>SELECT * FROM xyz.t1; +------+ | col1 | +======+ | 0 | | 2 | | 1 | +------+ 3 tuples (2.694ms) sql>SELECT * FROM xyz.v1; +------+ | col1 | +======+ | 1 | | 2 | +------+ 2 tuples (2.962ms) sql> sql>DROP SCHEMA xyz RESTRICT; operation successful (9.146ms) sql>-- this should return an error as there are objects depending on the schema sql>SELECT * FROM xyz.t1; SELECT: no such schema 'xyz' sql>SELECT * FROM xyz.v1; SELECT: no such schema 'xyz' sql> sql>DROP SCHEMA xyz CASCADE; DROP SCHEMA: name xyz does not exist sql>-- this should return success. Also all depending objects should be dropped sql>SELECT * FROM xyz.t1; SELECT: no such schema 'xyz' sql>SELECT * FROM xyz.v1; SELECT: no such schema 'xyz' sql> ### Expected Results: The DROP SCHEMA xyz RESTRICT; command should returns an error indicating that the schema could not be dropped as there are dependent objects. On https://www.monetdb.org/Documentation/SQLreference/Schema it includes the sentence: The drop_action option is supported for compatibility with the SQL standard, however it is not implemented yet. Once this is implemented, the documentation should be updated also. ## Comment 25770 Date: 2017-10-19 20:19:55 +0200 From: @njnes implemented (question is if the change of default is allowed in the release branch). ## Comment 25776 Date: 2017-10-21 11:32:04 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [901a54cbadd9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=901a54cbadd9) 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=901a54cbadd9](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=901a54cbadd9) Changeset description: Fixes for bug #6440 (ie properly use semi/anti join for in) Implement drop schema schema_name restrict (see bug #6438) We keep the current default (cascade) in the release branch and switch to the SQL correct default in the default branch. ## Comment 25860 Date: 2017-11-09 18:15:41 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [5469bd8b51d6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5469bd8b51d6) 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=5469bd8b51d6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=5469bd8b51d6) Changeset description: Implemented correct DROP SCHEMA my_schema RESTRICT behavior in default branch Also the default behavior of DROP SCHEMA my_schema is now RESTRICT instead of CASCADE. Added a note in the sql Changelog Added test This fixes Bug #6438 ## Comment 25862 Date: 2017-11-09 18:30:56 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; This fix is implemented now in the default branch. It will be included in the next feature release. ## Comment 26298 Date: 2018-03-29 15:39:02 +0200 From: @sjoerdmullender The Mar2018 version has been released.
Implement functionality to enforce the restrict option in: DROP SCHEMA xyz RESTRICT;
https://api.github.com/repos/MonetDB/MonetDB/issues/6438/comments
0
2020-11-30T15:54:31Z
2024-06-27T13:01:28Z
https://github.com/MonetDB/MonetDB/issues/6438
753,594,777
6,438
[ "MonetDB", "MonetDB" ]
Date: 2017-10-19 12:58:54 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-12-14 14:46:05 +0100 ## Comment 25764 Date: 2017-10-19 12:58:54 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Dropping a system schema such as profiler or json is possible. System schemas shouldn't be allowed to be dropped, as they are created and needed by the system to operate correctly. Note: schema "bam" is marked as being a system schema, but is in fact not a real system schema, as it is not needed by the system. It is an application specific schema. An optional extension to the system. Reproducible: Always ### Steps to Reproduce: 1. Start mserver5 (MonetDB 5 server v11.27.8) 2. Start mclient 3. Execute SQL: select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; set schema profiler; select current_schema; drop schema profiler; set schema json; select current_schema; drop schema profiler restrict; select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; set schema profiler; set schema tmp; select current_schema; drop schema json restrict; select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; set schema json; set schema sys; select current_schema; drop schema tmp restrict; set schema tmp; drop schema sys restrict; select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; ### Actual Results: bash-4.4$ mclient -p41000 Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; +----------+---------------+-------+ | name | authorization | owner | +==========+===============+=======+ | json | 3 | 3 | | profiler | 3 | 3 | | sys | 2 | 3 | | tmp | 2 | 3 | +----------+---------------+-------+ 4 tuples (2.709ms) sql>set schema profiler; auto commit mode: on sql>select current_schema; +----------+ | L2 | +==========+ | profiler | +----------+ 1 tuple (1.115ms) sql>drop schema profiler; DROP SCHEMA: cannot drop current schema sql>set schema json; auto commit mode: on sql>select current_schema; +------+ | L2 | +======+ | json | +------+ 1 tuple (1.054ms) sql>drop schema profiler restrict; operation successful (11.575ms) sql>select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; +------+---------------+-------+ | name | authorization | owner | +======+===============+=======+ | json | 3 | 3 | | sys | 2 | 3 | | tmp | 2 | 3 | +------+---------------+-------+ 3 tuples (2.634ms) sql>set schema profiler; Schema (profiler) missing sql>set schema tmp; auto commit mode: on sql>select current_schema; +------+ | L2 | +======+ | tmp | +------+ 1 tuple (1.009ms) sql>drop schema json restrict; operation successful (14.841ms) sql>select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; +------+---------------+-------+ | name | authorization | owner | +======+===============+=======+ | sys | 2 | 3 | | tmp | 2 | 3 | +------+---------------+-------+ 2 tuples (2.732ms) sql>set schema json; Schema (json) missing sql>set schema sys; auto commit mode: on sql>select current_schema; +------+ | L2 | +======+ | sys | +------+ 1 tuple (0.991ms) sql>drop schema tmp restrict; DROP SCHEMA: access denied for 'tmp' sql>set schema tmp; auto commit mode: on sql>drop schema sys restrict; DROP SCHEMA: access denied for 'sys' sql>select name, authorization, owner from sys.schemas where system and name NOT IN ('bam') order by name; +------+---------------+-------+ | name | authorization | owner | +======+===============+=======+ | sys | 2 | 3 | | tmp | 2 | 3 | +------+---------------+-------+ 2 tuples (2.595ms) sql> ### Expected Results: Dropping schema profiler or json should return an error, just like the case when trying to drop schema sys or tmp. Note: The keyword restrict in "drop schema profiler restrict" is recognised but NOT enforced. See sentence: The drop_action option is supported for compatibility with the SQL standard, however it is not implemented yet. on https://www.monetdb.org/Documentation/SQLreference/Schema ## Comment 25769 Date: 2017-10-19 20:04:04 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [fc1d11e132eb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc1d11e132eb) 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=fc1d11e132eb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fc1d11e132eb) Changeset description: partial fix of bug #6436 (ie do not overwrite the argument list of a function description) fix bug #6437, ie do not drop systems schemas (later we should remove the system flag from the bam schema) ## Comment 25857 Date: 2017-11-09 14:22:14 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [d4c059ab34ba](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4c059ab34ba) 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=d4c059ab34ba](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=d4c059ab34ba) Changeset description: Add missing test for bug #6437 ## Comment 25858 Date: 2017-11-09 16:15:29 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0c634ffa3285](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0c634ffa3285) 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=0c634ffa3285](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0c634ffa3285) Changeset description: Moved test drop_system_schema.Bug-6437 to be the first test. Strangly the test output is differently when it is run as first test or standalone. The fix for bug #6437 is not yet 100% robust/complete. Also added a test to check that the system schemas: sys, tmp, json and profiler exist after test drop_system_schema.Bug-6437 has run (and the server is restarted). ## Comment 25861 Date: 2017-11-09 18:22:29 +0100 From: Martin van Dinther &lt;<martin.van.dinther>&gt; ReOpened this issue as it appears that when a server is started for a new database the first time, the problem is still reproducable. This occurs by running the test drop_system_schema.Bug-6437 as the first test. Only if the server is shutdown and than restarted the behavior is correct. ## Comment 25867 Date: 2017-11-12 14:35:35 +0100 From: @njnes added a trigger on the update of the system table schemas. This resets the internal c-structures to the values stored in the db. ## Comment 25868 Date: 2017-11-12 14:37:36 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [b72a963da690](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72a963da690) 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=b72a963da690](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b72a963da690) Changeset description: fixed bug #6437, ie added trigger to update the in memory c-structures, which are used to (disallow) dropping of these system schemas.
System schemas "profiler" and "json" shouldn't be allowed to be dropped.
https://api.github.com/repos/MonetDB/MonetDB/issues/6437/comments
0
2020-11-30T15:54:28Z
2024-06-27T13:01:27Z
https://github.com/MonetDB/MonetDB/issues/6437
753,594,744
6,437
[ "MonetDB", "MonetDB" ]
Date: 2017-10-19 12:17:09 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @mlkersten, @njnes Last updated: 2017-12-14 14:46:00 +0100 ## Comment 25763 Date: 2017-10-19 12:17:09 +0200 From: Martin van Dinther &lt;<martin.van.dinther>&gt; User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Next query sequence: SELECT ifthenelse(true, 22347, 34456) as a; SELECT ifthenelse(false, 22347, 34456) as a; SELECT nullif(1, 2) as a; SELECT nullif(11234, 2345) as a; SELECT nullif(null, 2345) as a; SELECT nullif(1234, null) as a; causes mserver5 process to crash, ususally already after query: SELECT nullif(1, 2) as a; Reproducible: Always ### Steps to Reproduce: 1. Start mserver5 (MonetDB 5 server v11.27.8) 2. Start mclient 3. Execute queries: SELECT ifthenelse(true, 22347, 34456) as a; SELECT ifthenelse(false, 22347, 34456) as a; SELECT nullif(1, 2) as a; SELECT nullif(11234, 2345) as a; SELECT nullif(null, 2345) as a; SELECT nullif(1234, null) as a; ### Actual Results: bash-4.4$ mclient Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.27.8 (unreleased), 'demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>SELECT ifthenelse(true, 22347, 34456) as a; TypeException:user.s4_1[6]:'calc.ifthenelse' undefined in: X_7:void := calc.ifthenelse(X_4:bit, X_5:sht, X_6:int); sql>SELECT ifthenelse(false, 22347, 34456) as a; TypeException:user.s6_1[6]:'calc.ifthenelse' undefined in: X_7:void := calc.ifthenelse(X_4:bit, X_5:sht, X_6:int); sql>SELECT nullif(1, 2) as a; sql> bash-4.4$ bash-4.4$ ./start_INSTALL_mserver5.sh builtin opt gdk_dbpath = /export/scratch1/dinther/INSTALL/var/monetdb5/dbfarm/demo builtin opt gdk_debug = 0 builtin opt gdk_vmtrim = no builtin opt monet_prompt = > builtin opt monet_daemon = no builtin opt mapi_port = 50000 builtin opt mapi_open = false builtin opt mapi_autosense = false builtin opt sql_optimizer = default_pipe builtin opt sql_debug = 0 cmdline opt embedded_r = true cmdline opt embedded_py = true cmdline opt gdk_debug = 10 MonetDB 5 server v11.27.8 This is an unreleased version Serving database 'demo', using 4 threads Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers Found 31.312 GiB available main-memory. Copyright (c) 1993-July 2008 CWI. Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Listening for connection requests on mapi:monetdb://127.0.0.1:50000/ MonetDB/GIS module loaded MonetDB/SQL module loaded MonetDB/Python2 module loaded MonetDB/R module loaded >./start_INSTALL_mserver5.sh: line 7: 21137 Segmentation fault (core dumped) /export/scratch1/dinther/INSTALL/bin/mserver5 -d10 --set embedded_r=true --set embedded_py=true --set mapi_port=50000 bash-4.4$ ### Expected Results: No crash of mserver5 process Also happens on Windows (tested with Jul2107-SP2) ## Comment 25768 Date: 2017-10-19 20:04:03 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [fc1d11e132eb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fc1d11e132eb) 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=fc1d11e132eb](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fc1d11e132eb) Changeset description: partial fix of bug #6436 (ie do not overwrite the argument list of a function description) fix bug #6437, ie do not drop systems schemas (later we should remove the system flag from the bam schema) ## Comment 25796 Date: 2017-10-25 07:07:58 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [b11852dcfd52](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b11852dcfd52) made by martin.kersten@cwi.nl in the MonetDB repo, refers to this bug. For complete details, see [https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b11852dcfd52](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b11852dcfd52) Changeset description: Pass errors onwards Partially addresses Bug #6436 ## Comment 25797 Date: 2017-10-25 07:08:48 +0200 From: @mlkersten On default branch the nullif() seem to work. However, the ifthenelse() statements return nothing and the EXPLAIN is empty. The missing MAL primitive was not properly reported. Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased) Database: MonetDB v11.28.0 (unreleased), 'mapi:monetdb://rocks074.scilens.private:50000/demo' Type \q to quit, \? for a list of available commands auto commit mode: on sql>explain SELECT ifthenelse(true, 22347, 34456) as a; sql> ## Comment 25935 Date: 2017-12-03 16:24:16 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [fa09cb21a5c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa09cb21a5c8) 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=fa09cb21a5c8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=fa09cb21a5c8) Changeset description: improved function resolution, fixing Bugs 6436 and 6471 ## Comment 25938 Date: 2017-12-03 16:25:15 +0100 From: @njnes fixed by improved function resolution and type checking
Query sequence with 2x ifthenelse() and next nullif() causes mserver5 Segmentation fault
https://api.github.com/repos/MonetDB/MonetDB/issues/6436/comments
0
2020-11-30T15:54:24Z
2024-06-27T13:01:26Z
https://github.com/MonetDB/MonetDB/issues/6436
753,594,697
6,436
[ "MonetDB", "MonetDB" ]
Date: 2017-10-18 16:56:22 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:37 +0200 ## Comment 25759 Date: 2017-10-18 16:56:22 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: Mserver receives a SIGSEV while compiling a SELECT query Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. SELECT ALL * FROM tab0 cor0 WHERE - 62 NOT IN ( 9, - ( + + 67 ) ) AND - col0 * + 51 BETWEEN + 8 AND - - 95; ### Actual Results: A SIGSEGV in score_gbe function call. ### Expected Results: An empty result set. The SIGSEV: Thread 7 "mserver5" received signal SIGSEGV, Segmentation fault. 0x00007fffe8b25392 in score_gbe (sql=0x7fffb800ab40, rel=0x7fffb8071a70, e=0x7fffb8072650) at rel_optimizer.c:4841 4841 if (!EC_FIXED(t->type->eclass) && t->digits) Bt: 0 0x00007fffe8b25392 in score_gbe (sql=0x7fffb800ab40, rel=0x7fffb8071a70, e=0x7fffb8072650) at rel_optimizer.c:4841 1 0x00007fffe8b2bee8 in score_se (sql=0x7fffb800ab40, rel=0x7fffb8071a70, e=0x7fffb80726f0) at rel_optimizer.c:6543 2 0x00007fffe8b2c04e in rel_select_order (changes=0x7fffcd3958b4, sql=0x7fffb800ab40, rel=0x7fffb8071a70) at rel_optimizer.c:6559 3 0x00007fffe8b366b5 in rewrite (sql=0x7fffb800ab40, rel=0x7fffb8071a70, rewriter=0x7fffe8b2bf13 <rel_select_order>, has_changes=0x7fffcd395938) at rel_optimizer.c:8821 4 0x00007fffe8b36592 in rewrite (sql=0x7fffb800ab40, rel=0x7fffb80737a0, rewriter=0x7fffe8b2bf13 <rel_select_order>, has_changes=0x7fffcd395938) at rel_optimizer.c:8805 5 0x00007fffe8b370f7 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb80737a0, g_changes=0x7fffcd3959c0, level=0) at rel_optimizer.c:9017 6 0x00007fffe8b37310 in rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb80737a0) at rel_optimizer.c:9054 7 0x00007fffe8a17b85 in sql_symbol2relation (c=0x7fffb800ab40, sym=0x7fffb80713e0) at sql.c:121 8 0x00007fffe8a36a35 in SQLparser (c=0x7fffea11d338) at sql_scenario.c:1129 9 0x00007ffff7a14da0 in runPhase (c=0x7fffea11d338, phase=1) at mal_scenario.c:506 10 0x00007ffff7a14ee4 in runScenarioBody (c=0x7fffea11d338) at mal_scenario.c:539 11 0x00007ffff7a15087 in runScenario (c=0x7fffea11d338) at mal_scenario.c:568 12 0x00007ffff7a16c3c in MSserveClient (dummy=0x7fffea11d338) at mal_session.c:473 13 0x00007ffff7a1672c in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd395deb "B2vJIaPcE", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 14 0x00007ffff7ab9ba6 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 15 0x00007ffff769022a in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 16 0x00007ffff4ca336d in start_thread () from /lib64/libpthread.so.0 17 0x00007ffff49dbbbf in clone () from /lib64/libc.so.6 ## Comment 25760 Date: 2017-10-18 16:59:12 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [e1a77e396b94](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e1a77e396b94) 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=e1a77e396b94](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e1a77e396b94) Changeset description: Added test for bug #6435 ## Comment 25761 Date: 2017-10-19 11:05:17 +0200 From: @njnes fixed bug in the is_complex_exp macro, solving this problem ## Comment 25762 Date: 2017-10-19 11:19:32 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [ee3dd8463f58](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ee3dd8463f58) 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=ee3dd8463f58](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ee3dd8463f58) Changeset description: fixed bug #6435. cmp_or + anti is properly handled by the is_complex_exp macro
Sqlitelogictest crash in simple select query
https://api.github.com/repos/MonetDB/MonetDB/issues/6435/comments
0
2020-11-30T15:54:20Z
2024-06-27T13:01:25Z
https://github.com/MonetDB/MonetDB/issues/6435
753,594,652
6,435
[ "MonetDB", "MonetDB" ]
Date: 2017-10-18 15:54:12 +0200 From: @gijzelaerr To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-18 16:10:09 +0200 ## Comment 25757 Date: 2017-10-18 15:54:12 +0200 From: @gijzelaerr User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: this SQL code: CREATE TABLE uniontest ( "a" INTEGER, "b" INTEGER ); SELECT * FROM ((SELECT ut1.a AS a1, ut1.b AS b1 FROM uniontest AS ut1 ORDER BY a1) UNION (SELECT ut2.a AS a2, ut2.b AS b2 FROM uniontest AS ut2 ORDER BY a2)) AS u; gives an error: subquery table reference needs alias, use AS xxx in: "select * from ( ( select ut1.a as a1, ut1.b as b1 from uniontest " I'm not sure what should be aliased. This seems to work though (without the order by): SELECT * FROM ((SELECT ut1.a AS a1, ut1.b AS b1 FROM uniontest AS ut1) UNION (SELECT ut2.a AS a2, ut2.b AS b2 FROM uniontest AS ut2)) AS u ; Reproducible: Always ## Comment 25758 Date: 2017-10-18 16:10:09 +0200 From: @njnes we don't support order by in union's
subquery table reference needs alias in union when using order by
https://api.github.com/repos/MonetDB/MonetDB/issues/6434/comments
0
2020-11-30T15:54:17Z
2024-06-28T06:57:24Z
https://github.com/MonetDB/MonetDB/issues/6434
753,594,616
6,434
[ "MonetDB", "MonetDB" ]
Date: 2017-10-18 10:32:31 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:41 +0200 ## Comment 25751 Date: 2017-10-18 10:32:31 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.62 Safari/537.36 Build Identifier: Mserver gets an assertion error while optimizing in the SQL layer a complex SELECT query with comparisons, AND, OR, BETWEEN and IN operators. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(pk INTEGER PRIMARY KEY, col0 INTEGER, col1 FLOAT, col2 TEXT, col3 INTEGER, col4 FLOAT, col5 TEXT); 2. SELECT pk FROM tab0 WHERE ((col1 <= 601.41 AND (((col0 IS NULL AND (col3 > 768 OR col3 > 89)) AND ((col0 BETWEEN 996 AND 960 OR col4 < 664.34 AND col1 >= 445.23 AND ((col3 > 823 AND ((col3 >= 663)))) AND col0 > 883 AND col4 >= 247.43 OR (col0 = 115))) AND (((col0 > 941 AND col1 > 559.36)) AND (col4 IS NULL OR col0 > 583 AND (col3 > 927) OR col1 > 616.82 OR col0 < 35 OR (col0 > 688 AND (((col0 < 595 AND (col4 > 228.67) OR (col0 = 651) AND (((col1 = 509.82))) AND ((((col0 > 416))) OR col1 > 84.53 AND col1 < 285.58 AND col0 IS NULL AND col1 < 672.99 OR col3 = 682 AND col0 < 708) AND ((((col0 IS NULL))) OR col0 IS NULL OR col3 < 153 AND (col0 BETWEEN 36 AND 310 AND (col1 = 774.43) OR col4 < 876.56 AND col3 < 539 AND (col0 BETWEEN 177 AND 119) AND col3 < 820 OR col3 >= 529 AND col3 >= 268 OR (col3 > 749) AND col3 BETWEEN 511 AND 711 AND (((col3 >= 337) OR col0 IS NULL AND col4 > 965.36 AND ((col3 < 227) AND (col4 < 99.43 AND col3 > 263 OR col3 > 830 AND ((((((col1 < 984.99)))) AND ((col0 > 236 OR col0 > 475 AND col0 >= 150 AND (col3 >= 78) AND (((col4 > 135.83))))))) OR col0 <= 331 AND col1 >= 757.56 OR (col0 < 776) OR ((col1 >= 625.78)) AND col0 IS NULL OR (col3 >= 758 OR (col0 < 140)) AND col3 IS NULL)) AND ((col0 < 107 OR (col3 < 647))) AND (col4 <= 35.83) AND ((((col3 > 959))) OR (col3 >= 425 OR col3 <= 824 AND col1 > 223.73 AND (col4 >= 408.86 AND col4 > 641.19 OR col4 <= 813.85 OR (col0 IS NULL)) AND (((col4 > 587.71))) AND (((col0 > 214 AND col3 > 316 AND ((col0 > 212) AND (col3 >= 606 AND col0 <= 213 OR col3 IS NULL AND col0 <= 529 AND ((col0 = 74))) OR ((((col3 BETWEEN 45 AND 763) OR col4 > 137.10))) AND (col1 < 931.44 AND col3 > 344) AND (col3 > 290 OR col4 < 663.75 AND col4 <= 216.96 AND col3 < 982) AND col3 > 240 AND col1 >= 153.46 OR (col0 IN (540,371,358) AND col0 BETWEEN 299 AND 738) AND col0 < 694 AND ((col3 < 378 AND col3 < 506 AND col0 IS NULL) AND col1 < 145.44) OR (col0 > 687 AND col0 < 667) OR (col0 = 412 OR (((((col0 < 136) AND col3 < 47)))) AND (col3 >= 720)) OR (col3 = 806 AND ((col3 > 988) AND ((((col1 < 786.49)) OR col3 = 752) AND col0 < 740))) AND col0 = 203 OR col0 <= 262 OR ((col3 <= 964 AND col1 < 173.79)) OR col0 > 763 AND (col3 >= 187) OR col0 > 767 AND (col1 <= 872.2) AND col0 = 326 OR (col4 = 57.9) OR col0 > 930 OR col1 < 773.31 AND (col0 >= 394) AND (col0 > 926) AND (col0 IN (305,760,124,899) OR col1 IN (71.18,407.37) AND (((col0 < 533) OR (((col4 > 241.99))) AND col1 > 746.98)))) AND col4 < 802.32 AND ((col0 > 531)) AND col0 < 58) OR col0 IS NULL)) AND col0 < 775))) AND ((col0 < 647 AND col4 <= 907.73) OR (col0 = 99))) AND (col3 > 388 AND (((col0 < 109 AND col0 = 535 AND col3 < 959 OR ((col4 >= 617.70)))))) OR ((((col0 > 95) AND (((col0 < 247 OR col3 > 685 OR (col1 > 477.89 AND col1 > 239.93 OR col0 IS NULL OR col0 >= 641 OR col1 >= 893.3 AND (col3 = 72 AND col0 > 666 AND col3 > 17) AND (col4 BETWEEN 259.28 AND 405.64) AND col3 <= 829 OR col3 IS NULL AND (col1 < 228.68)))))) OR col0 >= 729 OR col0 < 431) AND ((col0 IS NULL))) AND col3 IN (779,539,505,633,380) AND (col3 > 895) AND col1 < 604.14 OR (col0 > 626 AND ((col0 IS NULL AND (((((col4 <= 777.85) AND col0 > 388) OR col0 >= 30))) OR (col0 IS NULL) OR col0 < 692 OR col0 <= 368 OR col3 > 698 OR col3 > 349 AND (((col0 < 303)) OR (col0 = 191) AND col1 IN (108.43) AND (col4 < 816.73)))) OR col0 < 45) OR col0 <= 900 OR col0 < 218 OR (col1 > 472.9 AND (col3 > 800) OR (col3 IN (918)) AND (col3 = 813) OR col1 IS NULL OR ((col1 <= 997.17) AND ((col1 > 808.22 AND (col1 > 539.58 OR col3 IS NULL)) AND (((col4 < 173.56)))))) AND col1 < 91.27 OR col0 > 696)) OR (col3 >= 50) AND (((col0 < 609))) AND col3 < 295)) AND col0 < 400 AND col3 > 267) OR col3 > 157 AND col3 <= 642 OR (col0 = 209) AND col0 > 921 AND col1 > 587.17 OR col0 < 950) AND col0 > 805 OR col3 >= 829 AND ((((col3 >= 214)))) OR ((col0 > 744 AND col1 < 102.6 AND ((col3 <= 779)) AND (((((col3 < 876))))) AND col3 >= 707) AND (col3 < 265)))))) AND (col1 < 985.78) OR col4 BETWEEN 314.64 AND 482.24)); ### Actual Results: The server gets an assertion 0 error in a _rel_optimizer call. ### Expected Results: An empty result set. Assertion error: mserver5: rel_optimizer.c:9031: _rel_optimizer: Assertion `0' failed. Backtrace: 0 0x00007ffff490169b in raise () from /lib64/libc.so.6 1 0x00007ffff49034a0 in abort () from /lib64/libc.so.6 2 0x00007ffff48f9d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007ffff48f9dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fffe8b37329 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=11) at rel_optimizer.c:9031 5 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=11) at rel_optimizer.c:9036 6 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=10) at rel_optimizer.c:9036 7 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=9) at rel_optimizer.c:9036 8 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=8) at rel_optimizer.c:9036 9 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=7) at rel_optimizer.c:9036 10 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=6) at rel_optimizer.c:9036 11 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=5) at rel_optimizer.c:9036 12 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=4) at rel_optimizer.c:9036 13 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=3) at rel_optimizer.c:9036 14 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=2) at rel_optimizer.c:9036 15 0x00007fffe8b37359 in _rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040, level=1) at rel_optimizer.c:9036 16 0x00007fffe8b373ac in rel_optimizer (sql=0x7fffb800ab40, rel=0x7fffb81b4040) at rel_optimizer.c:9044 17 0x00007fffe8a17b85 in sql_symbol2relation (c=0x7fffb800ab40, sym=0x7fffb812d410) at sql.c:121 18 0x00007fffe8a36a35 in SQLparser (c=0x7fffea11d338) at sql_scenario.c:1129 19 0x00007ffff7a14da0 in runPhase (c=0x7fffea11d338, phase=1) at mal_scenario.c:506 20 0x00007ffff7a14ee4 in runScenarioBody (c=0x7fffea11d338) at mal_scenario.c:539 21 0x00007ffff7a15087 in runScenario (c=0x7fffea11d338) at mal_scenario.c:568 22 0x00007ffff7a16c3c in MSserveClient (dummy=0x7fffea11d338) at mal_session.c:473 23 0x00007ffff7a1672c in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd395deb "riPbNGQg78v", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 24 0x00007ffff7ab9ba6 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 25 0x00007ffff769022a in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 26 0x00007ffff4ca336d in start_thread () from /lib64/libpthread.so.0 27 0x00007ffff49dbbbf in clone () from /lib64/libc.so.6 ## Comment 25752 Date: 2017-10-18 10:34:13 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [955d928d6427](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=955d928d6427) 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=955d928d6427](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=955d928d6427) Changeset description: Added test for bug #6433 ## Comment 25754 Date: 2017-10-18 15:13:32 +0200 From: @njnes fixed by increasing the allowed calls to _rel_optimizer, ie larger queries may require some more optimization rounds. ## Comment 25756 Date: 2017-10-18 15:30:15 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [1d48bbe3e8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d48bbe3e8dc) 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=1d48bbe3e8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1d48bbe3e8dc) Changeset description: fixed bug #6432, make sure all finished projects are set_processed fixed bug #6433, incremented the allowed number of calls to _rel_optimize
Sqlitelogictest crash in complex SELECT query with IN operator
https://api.github.com/repos/MonetDB/MonetDB/issues/6433/comments
0
2020-11-30T15:54:14Z
2024-06-27T13:01:22Z
https://github.com/MonetDB/MonetDB/issues/6433
753,594,586
6,433
[ "MonetDB", "MonetDB" ]
Date: 2017-10-17 21:44:05 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:41 +0200 ## Comment 25750 Date: 2017-10-17 21:44:05 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: 0 0x00007fa2d56f769b in raise () from /lib64/libc.so.6 1 0x00007fa2d56f94a0 in abort () from /lib64/libc.so.6 2 0x00007fa2d56efd5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007fa2d56efdd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fa2d011d092 in exp_bin (be=0x7fa27c001cf0, e=0x7fa27f03f1a0, left=0x7fa27f067270, right=0x0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:734 5 0x00007fa2d011c508 in exp_bin (be=0x7fa27c001cf0, e=0x7fa27f048860, left=0x7fa27f067270, right=0x0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:635 6 0x00007fa2d0125d1f in rel2bin_select (be=0x7fa27c001cf0, rel=0x7fa27f03e6c0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2627 7 0x00007fa2d012ff3f in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f03e6c0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4838 8 0x00007fa2d01214e7 in rel2bin_join (be=0x7fa27c001cf0, rel=0x7fa27f030840, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1700 9 0x00007fa2d012fe0a in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f030840, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4811 10 0x00007fa2d0125084 in rel2bin_project (be=0x7fa27c001cf0, rel=0x7fa27f03a360, refs=0x7fa27f060750, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2453 11 0x00007fa2d012ff11 in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f03a360, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4834 12 0x00007fa2d01214e7 in rel2bin_join (be=0x7fa27c001cf0, rel=0x7fa27f03bff0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1700 13 0x00007fa2d012fe0a in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f03bff0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4811 14 0x00007fa2d0123817 in rel2bin_union (be=0x7fa27c001cf0, rel=0x7fa27f0031a0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2142 15 0x00007fa2d012fe85 in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f0031a0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4822 16 0x00007fa2d01214ac in rel2bin_join (be=0x7fa27c001cf0, rel=0x7fa27f013740, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1698 17 0x00007fa2d012fe0a in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f013740, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4811 18 0x00007fa2d0125ad8 in rel2bin_select (be=0x7fa27c001cf0, rel=0x7fa27f016cb0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2589 19 0x00007fa2d012ff3f in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f016cb0, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4838 20 0x00007fa2d0125084 in rel2bin_project (be=0x7fa27c001cf0, rel=0x7fa27f005fd0, refs=0x7fa27f060750, topn=0x7fa27f006270) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2453 21 0x00007fa2d01266c0 in rel2bin_topn (be=0x7fa27c001cf0, rel=0x7fa27f006270, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2766 22 0x00007fa2d012ff9b in subrel_bin (be=0x7fa27c001cf0, rel=0x7fa27f006270, refs=0x7fa27f060750) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4846 23 0x00007fa2d0130208 in output_rel_bin (be=0x7fa27c001cf0, rel=0x7fa27f006270) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4899 24 0x00007fa2d014b453 in sql_relation2stmt Reproducible: Always ### Steps to Reproduce: select ref_0.name as c0 from sys.objects as ref_0 inner join sys.columns as ref_1 inner join sys.dependencies as ref_2 inner join sys.columns as sample_0 on (sample_0.type_digits is NULL) on ((ref_1.type is NULL) or (ref_2.id is not NULL)) on (12 is NULL) left join sys.queue as ref_3 on (ref_1.number = ref_3.progress ) where ref_3.estimate is not NULL limit 156; ## Comment 25753 Date: 2017-10-18 13:36:05 +0200 From: @njnes fixed by cleanup of set_processed. The project operator created in the optimizer wasn't properly set_processed, which caused incorrect pushdowns. ## Comment 25755 Date: 2017-10-18 15:30:14 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [1d48bbe3e8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1d48bbe3e8dc) 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=1d48bbe3e8dc](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=1d48bbe3e8dc) Changeset description: fixed bug #6432, make sure all finished projects are set_processed fixed bug #6433, incremented the allowed number of calls to _rel_optimize
Assertion error in exp_bin (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6432/comments
0
2020-11-30T15:54:11Z
2024-06-27T13:01:21Z
https://github.com/MonetDB/MonetDB/issues/6432
753,594,551
6,432
[ "MonetDB", "MonetDB" ]
Date: 2017-10-16 17:25:30 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:36 +0200 ## Comment 25745 Date: 2017-10-16 17:25:30 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: The server gets an assertion error while compiling an aggregation query with a long having clause. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. SELECT DISTINCT + ( - col2 ) AS col0 FROM tab2 AS cor0 WHERE NOT ( - 1 * col2 ) <> ( 37 ) GROUP BY col2 HAVING ( col2 ) IN ( COALESCE ( + ( + COALESCE ( - 64, COUNT ( * ) + ( col0 ) * 12 ) ), + COUNT ( * ), COUNT ( * ) / 97 ) ); ### Actual Results: Mserver gets an assertion error on an exp_bin function call. ### Expected Results: An empty result set. Assertion error: mserver5: rel_bin.c:564: exp_bin: Assertion `s' failed. Backtrace: 0 0x00007ffff490169b in raise () from /lib64/libc.so.6 1 0x00007ffff49034a0 in abort () from /lib64/libc.so.6 2 0x00007ffff48f9d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007ffff48f9dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fffe8a42e94 in exp_bin (be=0x7fffb805fc00, e=0x7fffb80756d0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:564 5 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb80796c0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449 6 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079890, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 7 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb80798f0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449 8 0x00007fffe8a4243d in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079f40, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:449 9 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb8079bc0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 10 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a1c0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 11 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a250, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 12 0x00007fffe8a42660 in exp_bin (be=0x7fffb805fc00, e=0x7fffb807a2e0, left=0x7fffb8080480, right=0x7fffb84736d0, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:478 13 0x00007fffe8a4c157 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb80783d0, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2465 14 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb80783d0, refs=0x7fffb807f7a0) at rel_bin.c:4834 15 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb8078e40, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453 16 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb8078e40, refs=0x7fffb807f7a0) at rel_bin.c:4834 17 0x00007fffe8a49877 in rel2bin_semijoin (be=0x7fffb805fc00, rel=0x7fffb8078760, refs=0x7fffb807f7a0) at rel_bin.c:1923 18 0x00007fffe8a56e57 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb8078760, refs=0x7fffb807f7a0) at rel_bin.c:4818 19 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb807da90, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453 20 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb807da90, refs=0x7fffb807f7a0) at rel_bin.c:4834 21 0x00007fffe8a4d003 in rel2bin_groupby (be=0x7fffb805fc00, rel=0x7fffb80734e0, refs=0x7fffb807f7a0) at rel_bin.c:2670 22 0x00007fffe8a56f6d in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb80734e0, refs=0x7fffb807f7a0) at rel_bin.c:4842 23 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb805fc00, rel=0x7fffb807d360, refs=0x7fffb807f7a0, topn=0x0) at rel_bin.c:2453 24 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb805fc00, rel=0x7fffb807d360, refs=0x7fffb807f7a0) at rel_bin.c:4834 25 0x00007fffe8a57208 in output_rel_bin (be=0x7fffb805fc00, rel=0x7fffb807d360) at rel_bin.c:4899 26 0x00007fffe8a72453 in sql_relation2stmt (be=0x7fffb805fc00, r=0x7fffb807d360) at sql_gencode.c:529 27 0x00007fffe8a727d2 in backend_dumpstmt (be=0x7fffb805fc00, mb=0x7fffb84bd760, r=0x7fffb807d360, top=1, add_end=1, query=0x7fffb80f4540 "select distinct + ( - col2 ) as col0 from tab2 as cor0 where not ( - 1 * col2 ) <> ( 37 ) group by col2 having ( col2 ) in ( coalesce ( + ( + coalesce ( - 64, count ( * ) + ( col0 ) * 12 ) ), + count "...) at sql_gencode.c:576 28 0x00007fffe8a73037 in backend_dumpproc (be=0x7fffb805fc00, c=0x7fffea11d338, cq=0x7fffb82009d0, r=0x7fffb807d360) at sql_gencode.c:703 29 0x00007fffe8a36ee5 in SQLparser (c=0x7fffea11d338) at sql_scenario.c:1182 30 0x00007ffff7a14da0 in runPhase (c=0x7fffea11d338, phase=1) at mal_scenario.c:506 31 0x00007ffff7a14ee4 in runScenarioBody (c=0x7fffea11d338) at mal_scenario.c:539 32 0x00007ffff7a15087 in runScenario (c=0x7fffea11d338) at mal_scenario.c:568 33 0x00007ffff7a16c3c in MSserveClient (dummy=0x7fffea11d338) at mal_session.c:473 34 0x00007ffff7a1672c in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd395deb "ZZqqcD1Mb", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 35 0x00007ffff7ab9ba6 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 36 0x00007ffff768fae4 in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 37 0x00007ffff4ca336d in start_thread () from /lib64/libpthread.so.0 38 0x00007ffff49dbbbf in clone () from /lib64/libc.so.6 ## Comment 25746 Date: 2017-10-16 17:30:03 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [788e56f1c467](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=788e56f1c467) 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=788e56f1c467](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=788e56f1c467) Changeset description: Added test for bug #6431 ## Comment 25747 Date: 2017-10-17 13:57:13 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7d459ebe5c26](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7d459ebe5c26) 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=7d459ebe5c26](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7d459ebe5c26) Changeset description: fixed bug #6431 ## Comment 25749 Date: 2017-10-17 13:58:37 +0200 From: @njnes fixed, ie the col0 in the having isn't known (ie isn't passed in the alias list or group by columns)
Sqlitelogictest crash in aggregation query with a long having clause
https://api.github.com/repos/MonetDB/MonetDB/issues/6431/comments
0
2020-11-30T15:54:07Z
2024-06-27T13:01:20Z
https://github.com/MonetDB/MonetDB/issues/6431
753,594,504
6,431
[ "MonetDB", "MonetDB" ]
Date: 2017-10-16 11:04:32 +0200 From: @mlkersten To: GDK devs &lt;<bugs-common>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:34 +0200 ## Comment 25742 Date: 2017-10-16 11:04:32 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0 Build Identifier: 0 0x00007f300a2a569b in raise () from /lib64/libc.so.6 1 0x00007f300a2a74a0 in abort () from /lib64/libc.so.6 2 0x00007f300a29dd5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f300a29ddd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f300ce9bdf4 in eq_typeswitchloop (lft=0x0, tp1=0, incr1=1, hp1=0x0, wd1=0, rgt=0x7f2fcebf8d40, tp2=10, incr2=0, hp2=0x0, wd2=0, dst=0x7f2fa8009720 '\275' <repeats 200 times>..., cnt=0, start=0, end=0, cand=0x0, candend=0x0, candoff=0, nonil=0, func=0x7f300d0c08c8 <__func__.34404> "BATcalceqcst") at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:27 5 0x00007f300cead03c in BATcalceq_intern (lft=0x0, tp1=0, incr1=1, hp1=0x0, wd1=0, rgt=0x7f2fcebf8d40, tp2=10, incr2=0, hp2=0x0, wd2=0, cnt=0, start=0, end=0, cand=0x0, candend=0x0, candoff=0, nonil=0, seqbase=0, func=0x7f300d0c08c8 <__func__.34404> "BATcalceqcst") at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:555 6 0x00007f300ceae546 in BATcalceqcst (b=0x7f2fa8007e90, v=0x7f2fcebf8d40, s=0x0) at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:626 7 0x00007f300d4b8d8b in CMDbatBINARY0 (stk=0x7f2fcebf8960, pci=0x7f2fcf6f1b70, batfunc=0x7f300cead163 <BATcalceq>, batfunc1=0x7f300ceadc65 <BATcalceqcst>, batfunc2=0x7f300ceae573 <BATcalccsteq>, malfunc=0x7f300d50e122 "batcalc.==") at /export/scratch1/home/mk/default//package/monetdb5/modules/mal/batcalc.c:482 8 0x00007f300d4b9dbe in CMDbatEQ (cntxt=0x7f3006666650, mb=0x7f2fcf59f190, stk=0x7f2fcebf8960, pci=0x7f2fcf6f1b70) at /export/scratch1/home/mk/default//package/monetdb5/modules/mal/batcalc.c:836 9 0x00007f300d380863 in runMALsequence ( Reproducible: Always ### Steps to Reproduce: select subq_0.c0 as c0, subq_0.c0 as c1, subq_0.c0 as c2, subq_0.c0 as c3, subq_0.c0 as c4, cast(nullif(subq_0.c0, subq_0.c0) as oid) as c5 from (select cast(nullif(ref_0.id, cast(null as oid)) as oid) as c0 from sys.querylog_calls as ref_0 where ref_0.cpu is not NULL) as subq_0 where subq_0.c0 is not NULL limit 113; ## Comment 25744 Date: 2017-10-16 16:57:01 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [259a2c0a55d0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=259a2c0a55d0) 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=259a2c0a55d0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=259a2c0a55d0) Changeset description: Never treat comparison of oid/void like int/lng. This fixes bug #6430.
Assertion raised in another eq_typeswitch error (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6430/comments
0
2020-11-30T15:54:04Z
2024-06-27T13:01:19Z
https://github.com/MonetDB/MonetDB/issues/6430
753,594,463
6,430
[ "MonetDB", "MonetDB" ]
Date: 2017-10-16 11:03:18 +0200 From: Gatis Ozolins &lt;<g.ozolins>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.9 (Jul2017-SP2) CC: @njnes Last updated: 2017-12-14 14:46:06 +0100 ## Comment 25741 Date: 2017-10-16 11:03:18 +0200 From: Gatis Ozolins &lt;<g.ozolins>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: SELECT ROUND(123.563, 2) AS val produces DECIMAL(2,3) data type, but it should be DECIMAL(5,2) Reproducible: Always ### Steps to Reproduce: create table zz_round_bug as select ROUND(123.563, 2) as val; select c.type_digits, c.type_scale from sys.tables t join sys.columns c on t.id = c.table_id where t.name = 'zz_round_bug' and c.name = 'val'; ### Actual Results: 2 3 ### Expected Results: 5 2 Any filtering on created table produces error: select * from zz_round_bug where val = 1 SQL Error [22003]: value (123560) exceeds limits of type bte java.sql.SQLException: value (123560) exceeds limits of type bte ## Comment 25939 Date: 2017-12-03 23:13:34 +0100 From: @njnes SQL it self lacks a proper definition of ROUND. Other DBMSes also seem not to agree on the definition. Our current implementation seems to follow the sqlserver one, ie we round (positive numbers right from the dot, negative numbers left from the dot), but leave the type alone (ie stays as the input value). ## Comment 25940 Date: 2017-12-04 09:01:47 +0100 From: Gatis Ozolins &lt;<g.ozolins>&gt; But still it should not be possible to create situation where selecting data from table results in error ## Comment 25941 Date: 2017-12-04 09:50:17 +0100 From: @sjoerdmullender This bug was fixed with changeset [6bfbf16160a6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6bfbf16160a6)
ROUND produces wrong data type
https://api.github.com/repos/MonetDB/MonetDB/issues/6429/comments
0
2020-11-30T15:54:01Z
2024-06-27T13:01:18Z
https://github.com/MonetDB/MonetDB/issues/6429
753,594,427
6,429
[ "MonetDB", "MonetDB" ]
Date: 2017-10-16 10:16:35 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:38 +0200 ## Comment 25739 Date: 2017-10-16 10:16:35 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: The server gets an assertion failure while compiling a sqlitelogictest aggregation query. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab0(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. SELECT - col0 AS col1 FROM tab0 AS cor0 WHERE NOT + col0 IS NOT NULL GROUP BY col1, col0 HAVING NOT - col1 + + AVG ( DISTINCT col0 ) IS NULL; ### Actual Results: Servers gets an assertion failure in an exp_bin function call. ### Expected Results: An empty result set. Assertion error: mserver5: rel_bin.c:564: exp_bin: Assertion `s' failed. Backtrace: 0 0x00007ffff490169b in raise () from /lib64/libc.so.6 1 0x00007ffff49034a0 in abort () from /lib64/libc.so.6 2 0x00007ffff48f9d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007ffff48f9dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fffe8a42e94 in exp_bin (be=0x7fffb80dddd0, e=0x7fffb80ebbc0, left=0x7fffb80ed060, right=0x7fffb80ed490, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:564 5 0x00007fffe8a4d55e in rel2bin_groupby (be=0x7fffb80dddd0, rel=0x7fffb80ebc70, refs=0x7fffb80ec670) at rel_bin.c:2741 6 0x00007fffe8a56f6d in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80ebc70, refs=0x7fffb80ec670) at rel_bin.c:4842 7 0x00007fffe8a4d003 in rel2bin_groupby (be=0x7fffb80dddd0, rel=0x7fffb80e8ae0, refs=0x7fffb80ec670) at rel_bin.c:2670 8 0x00007fffe8a56f6d in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80e8ae0, refs=0x7fffb80ec670) at rel_bin.c:4842 9 0x00007fffe8a4cad8 in rel2bin_select (be=0x7fffb80dddd0, rel=0x7fffb80ea6f0, refs=0x7fffb80ec670) at rel_bin.c:2589 10 0x00007fffe8a56f3f in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80ea6f0, refs=0x7fffb80ec670) at rel_bin.c:4838 11 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb80dddd0, rel=0x7fffb80e8de0, refs=0x7fffb80ec670, topn=0x0) at rel_bin.c:2453 12 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80e8de0, refs=0x7fffb80ec670) at rel_bin.c:4834 13 0x00007fffe8a4c084 in rel2bin_project (be=0x7fffb80dddd0, rel=0x7fffb80eab00, refs=0x7fffb80ec670, topn=0x0) at rel_bin.c:2453 14 0x00007fffe8a56f11 in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80eab00, refs=0x7fffb80ec670) at rel_bin.c:4834 15 0x00007fffe8a57208 in output_rel_bin (be=0x7fffb80dddd0, rel=0x7fffb80eab00) at rel_bin.c:4899 16 0x00007fffe8a72453 in sql_relation2stmt (be=0x7fffb80dddd0, r=0x7fffb80eab00) at sql_gencode.c:529 17 0x00007fffe8a727d2 in backend_dumpstmt (be=0x7fffb80dddd0, mb=0x7fffb810ae70, r=0x7fffb80eab00, top=1, add_end=1, query=0x7fffb810fe80 "select - col0 as col1 from tab0 as cor0 where not + col0 is not null group by col1, col0 having not - col1 + + avg ( distinct col0 ) is null;") at sql_gencode.c:576 18 0x00007fffe8a73037 in backend_dumpproc (be=0x7fffb80dddd0, c=0x7fffea11d338, cq=0x7fffb80ddec0, r=0x7fffb80eab00) at sql_gencode.c:703 19 0x00007fffe8a36ee5 in SQLparser (c=0x7fffea11d338) at sql_scenario.c:1182 20 0x00007ffff7a14da0 in runPhase (c=0x7fffea11d338, phase=1) at mal_scenario.c:506 21 0x00007ffff7a14ee4 in runScenarioBody (c=0x7fffea11d338) at mal_scenario.c:539 22 0x00007ffff7a15087 in runScenario (c=0x7fffea11d338) at mal_scenario.c:568 23 0x00007ffff7a16c3c in MSserveClient (dummy=0x7fffea11d338) at mal_session.c:473 24 0x00007ffff7a1672c in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd395deb "zJlfcarIywQ", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 25 0x00007ffff7ab9ba6 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 26 0x00007ffff768fae4 in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 27 0x00007ffff4ca336d in start_thread () from /lib64/libpthread.so.0 28 0x00007ffff49dbbbf in clone () from /lib64/libc.so.6 ## Comment 25740 Date: 2017-10-16 10:19:50 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [725d659cb419](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=725d659cb419) 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=725d659cb419](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=725d659cb419) Changeset description: Added test for bug #6428 ## Comment 25743 Date: 2017-10-16 15:51:26 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [0900833d1a87](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0900833d1a87) 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=0900833d1a87](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=0900833d1a87) Changeset description: fixed bug #6428, ie don't remove groupby if the alias is different
Sqlitelogictest crash in aggregation query
https://api.github.com/repos/MonetDB/MonetDB/issues/6428/comments
0
2020-11-30T15:53:58Z
2024-06-27T13:01:17Z
https://github.com/MonetDB/MonetDB/issues/6428
753,594,386
6,428
[ "MonetDB", "MonetDB" ]
Date: 2017-10-15 22:07:04 +0200 From: @mlkersten To: GDK devs &lt;<bugs-common>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:33 +0200 ## Comment 25730 Date: 2017-10-15 22:07:04 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: After 250K queries over mergedb 0 0x00007f8767f1969b in raise () from /lib64/libc.so.6 1 0x00007f8767f1b4a0 in abort () from /lib64/libc.so.6 2 0x00007f8767f11d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f8767f11dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f876ab0fdf4 in eq_typeswitchloop (lft=0x0, tp1=0, incr1=1, hp1=0x0, wd1=0, rgt=0x7f87141a33f0, tp2=10, incr2=0, hp2=0x0, wd2=0, dst=0x7f8730015d50 '\275' <repeats 200 times>..., cnt=0, start=0, end=0, cand=0x0, candend=0x0, candoff=0, nonil=0, func=0x7f876ad348c8 <__func__.34404> "BATcalceqcst") at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:27 5 0x00007f876ab2103c in BATcalceq_intern (lft=0x0, tp1=0, incr1=1, hp1=0x0, wd1=0, rgt=0x7f87141a33f0, tp2=10, incr2=0, hp2=0x0, wd2=0, cnt=0, start=0, end=0, cand=0x0, candend=0x0, candoff=0, nonil=0, seqbase=0, func=0x7f876ad348c8 <__func__.34404> "BATcalceqcst") at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:555 6 0x00007f876ab22546 in BATcalceqcst (b=0x7f8730005010, v=0x7f87141a33f0, s=0x0) at /export/scratch1/home/mk/default//package/gdk/gdk_calc_compare.h:626 7 0x00007f876b12cd8b in CMDbatBINARY0 (stk=0x7f87141a2f90, pci=0x7f87141b6ee0, batfunc=0x7f876ab21163 <BATcalceq>, batfunc1=0x7f876ab21c65 <BATcalceqcst>, batfunc2=0x7f876ab22573 <BATcalccsteq>, malfunc=0x7f876b182122 "batcalc.==") at /export/scratch1/home/mk/default//package/monetdb5/modules/mal/batcalc.c:482 8 0x00007f876b12ddbe in CMDbatEQ (cntxt=0x7f87642da650, mb=0x7f8714159160, stk=0x7f87141a2f90, pci=0x7f87141b6ee0) at /export/scratch1/home/mk/default//package/monetdb5/modules/mal/batcalc.c:836 9 0x00007f876aff4863 in runMALsequence (cntxt=0x7f87642da650, mb=0x7f8714159160, startpc=11, stoppc=12, stk=0x7f87141a2f90, env=0x0, pcicaller=0x0) at /export/scratch1/home/mk/default//package/monetdb5/mal/mal_interpreter.c:645 10 0x00007f876aff9c73 in DFLOWworker Reproducible: Always ### Steps to Reproduce: select cast(nullif(sample_1.id, cast(null as oid)) as oid) as c0, sample_1.tuples as c1, sample_1.tuples as c2, sample_1.cpu as c3, sample_1.cpu as c4, sample_1.stop as c5 from sys.querylog_calls as sample_1 where sample_1.io is NULL limit 125; ## Comment 25748 Date: 2017-10-17 13:57:45 +0200 From: @sjoerdmullender Fixed by changeset [259a2c0a55d0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=259a2c0a55d0)
Assertion error in eq_typeswitchloop (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6427/comments
0
2020-11-30T15:53:56Z
2024-06-27T13:01:16Z
https://github.com/MonetDB/MonetDB/issues/6427
753,594,337
6,427
[ "MonetDB", "MonetDB" ]
Date: 2017-10-15 21:39:45 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:41 +0200 ## Comment 25729 Date: 2017-10-15 21:39:45 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: 0 0x00007f4b03e00ac7 in rel_find_exp_ (rel=0x7f4ab9487fe0, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1191 1 0x00007f4b03e00c9c in rel_find_exp (rel=0x7f4ab9487fe0, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1229 2 0x00007f4b03e005da in rel_has_exp (rel=0x7f4ab9487fe0, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1093 3 0x00007f4b03e1a487 in rel_push_semijoin_down (changes=0x7f4ad75f96d4, sql=0x7f4ab8003ec0, rel=0x7f4ab9499fe0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4337 4 0x00007f4b03e2e3d5 in rewrite (sql=0x7f4ab8003ec0, rel=0x7f4ab9499fe0, rewriter=0x7f4b03e1a0fa <rel_push_semijoin_down>, has_changes=0x7f4ad75f9818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8803 5 0x00007f4b03e2e25f in rewrite (sql=0x7f4ab8003ec0, rel=0x7f4ab949a110, rewriter=0x7f4b03e1a0fa <rel_push_semijoin_down>, has_changes=0x7f4ad75f9818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8779 6 0x00007f4b03e2e2b2 in rewrite (sql=0x7f4ab8003ec0, rel=0x7f4ab94a0e70, rewriter=0x7f4b03e1a0fa <rel_push_semijoin_down>, has_changes=0x7f4ad75f9818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 7 0x00007f4b03e2e286 in rewrite (sql=0x7f4ab8003ec0, rel=0x7f4ab948b7d0, rewriter=0x7f4b03e1a0fa <rel_push_semijoin_down>, has_changes=0x7f4ad75f9818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8780 8 0x00007f4b03e2e2b2 in rewrite (sql=0x7f4ab8003ec0, rel=0x7f4ab948cab0, rewriter=0x7f4b03e1a0fa <rel_push_semijoin_down>, has_changes=0x7f4ad75f9818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 9 0x00007f4b03e2ea1f in _rel_optimizer (sql=0x7f4ab8003ec0, rel=0x7f4ab948cab0, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8935 10 0x00007f4b03e2f01c in _rel_optimizer (sql=0x7f4ab8003ec0, rel=0x7f4ab948cab0, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9033 11 0x00007f4b03e2f06f in rel_optimizer (sql=0x7f4ab8003ec0, rel=0x7f4ab948cab0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9041 12 0x00007f4b03d0fb35 in sql_symbol2relation (c=0x7f4ab8003ec0, sym=0x7f4ab9485130) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121 13 0x00007f4b03d2e96c in SQLparser Reproducible: Always ### Steps to Reproduce: select sample_4.x as c0, sample_0.location as c1 from sys.netcdf_files as sample_0 right join tmp.idxs as sample_1 right join sys.types as sample_2 on (sample_1.table_id = sample_2.id ) inner join sys.s as sample_4 inner join tmp.idxs as ref_0 on (false) on (sample_2.digits = ref_0.id ) on (sample_0.file_id = sample_4.x ) left join sys.netcdf_files as sample_6 inner join sys.netcdf_dims as ref_1 inner join sys.s1 as ref_2 on (false) on (sample_6.file_id = ref_1.dim_id ) right join bam.rg as sample_7 on (ref_2.x = sample_7.pi ) left join sys.netcdf_dims as ref_3 right join tmp._columns as ref_4 on (ref_3.length is NULL) right join sys.triggers as sample_8 on (ref_3.name = sample_8.name ) left join sys.systemfunctions as ref_5 on (ref_3.dim_id is not NULL) on ((false) or (true)) on (sample_0.file_id = sample_8.id ) where case when true then ref_0.name else ref_0.name end is NULL; ## Comment 25733 Date: 2017-10-16 07:42:28 +0200 From: @njnes added missing check for proper e_cmp type expression in push join down code ## Comment 25737 Date: 2017-10-16 08:20:21 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfa035d658b6) 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=cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cfa035d658b6) Changeset description: fixed bugs 6424, 6425 and 6426
Assertion error in rel_find_exp_ (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6426/comments
0
2020-11-30T15:53:52Z
2024-06-27T13:01:15Z
https://github.com/MonetDB/MonetDB/issues/6426
753,594,302
6,426
[ "MonetDB", "MonetDB" ]
Date: 2017-10-15 21:30:23 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:26 +0200 ## Comment 25728 Date: 2017-10-15 21:30:23 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: After 185K queries on mergedb 3 0x00007f5b72802dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f5b6d22fd07 in exp_bin (be=0x7f5b30001ec0, e=0x7f5b326781f0, left=0x7f5b3269be10, right=0x7f5b3269c870, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:703 5 0x00007f5b6d2349a3 in rel2bin_join (be=0x7f5b30001ec0, rel=0x7f5b32677f20, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1770 6 0x00007f5b6d242e22 in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32677f20, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4816 7 0x00007f5b6d23809c in rel2bin_project (be=0x7f5b30001ec0, rel=0x7f5b32679400, refs=0x7f5b3269b600, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2458 8 0x00007f5b6d242f29 in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32679400, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4839 9 0x00007f5b6d23682f in rel2bin_union (be=0x7f5b30001ec0, rel=0x7f5b32679460, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2147 10 0x00007f5b6d242e9d in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32679460, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4827 11 0x00007f5b6d23682f in rel2bin_union (be=0x7f5b30001ec0, rel=0x7f5b3267b3a0, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2147 12 0x00007f5b6d242e9d in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b3267b3a0, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4827 13 0x00007f5b6d23445c in rel2bin_join (be=0x7f5b30001ec0, rel=0x7f5b32677aa0, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1698 14 0x00007f5b6d242e22 in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32677aa0, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4816 15 0x00007f5b6d238af0 in rel2bin_select (be=0x7f5b30001ec0, rel=0x7f5b32677e50, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2594 16 0x00007f5b6d242f57 in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32677e50, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4843 17 0x00007f5b6d23809c in rel2bin_project (be=0x7f5b30001ec0, rel=0x7f5b326743a0, refs=0x7f5b3269b600, topn=0x7f5b32674660) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2458 18 0x00007f5b6d2396d8 in rel2bin_topn (be=0x7f5b30001ec0, rel=0x7f5b32674660, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2771 19 0x00007f5b6d242fb3 in subrel_bin (be=0x7f5b30001ec0, rel=0x7f5b32674660, refs=0x7f5b3269b600) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4851 20 0x00007f5b6d243220 in output_rel_bin (be=0x7f5b30001ec0, rel=0x7f5b32674660) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4904 21 0x00007f5b6d25e46b in sql_relation2stmt (be=0x7f5b30001ec0, r=0x7f5b32674660) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_gencode.c:529 22 0x00007f5b6d25e7ea in backend_dumpstmt (be=0x7f5b30001ec0, mb=0x7f5b30003120, r=0x7f5b32674660, top=1, add_end=1, query=0x7f5b3072b4d0 "select \n sample_2.keyword as c0\nfrom \n sys.optimizers as sample_0\n right join sys.netcdf_vardim as sample_1\n on (((true) \n or (false)) \n or (true))\n right join sys.keywords as sample_2\n right join sys"...) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_gencode.c:576 23 0x00007f5b6d25f04f in backend_dumpproc (be=0x7f5b30001ec0, c=0x7f5b6ebcb650, cq=0x7f5b3015f370, r=0x7f5b32674660) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_gencode.c:703 24 0x00007f5b6d222e95 in SQLparser Reproducible: Always ### Steps to Reproduce: select sample_2.keyword as c0 from sys.optimizers as sample_0 right join sys.netcdf_vardim as sample_1 on (((true) or (false)) or (true)) right join sys.keywords as sample_2 right join sys.privilege_codes as sample_3 on (sample_2.keyword = sample_3.privilege_code_name ) on (sample_1.var_id = sample_3.privilege_code_id ) where false limit 106; ## Comment 25734 Date: 2017-10-16 08:13:45 +0200 From: @njnes fixed crash, ie fallback to crossproduct and select for complex or expressions ## Comment 25736 Date: 2017-10-16 08:19:49 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfa035d658b6) 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=cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cfa035d658b6) Changeset description: fixed bugs 6424, 6425 and 6426
Assertion error in exp_bin (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6425/comments
0
2020-11-30T15:53:48Z
2024-06-27T13:01:14Z
https://github.com/MonetDB/MonetDB/issues/6425
753,594,254
6,425
[ "MonetDB", "MonetDB" ]
Date: 2017-10-15 21:10:45 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2019-02-20 16:52:35 +0100 ## Comment 25727 Date: 2017-10-15 21:10:45 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: 4 0x00007fef3ef1f2f4 in rel_rename_exps (sql=0x7feef410c760, exps1=0x7feef546c650, exps2=0x7feef5493120) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1854 5 0x00007fef3ef2cef4 in rel_push_project_down_union (changes=0x7fef1a818818, sql=0x7feef410c760, rel=0x7feef54c95b0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4781 6 0x00007fef3ef3e46f in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54c95b0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8817 7 0x00007fef3ef3e56b in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef548d9a0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8838 8 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54c9e40, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 9 0x00007fef3ef3e56b in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef548dcb0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8838 10 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef548e030, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 11 0x00007fef3ef3e56b in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef549a5d0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8838 12 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54c14a0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 13 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54d9d10, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 14 0x00007fef3ef3e592 in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54cb050, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8839 15 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef5482300, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 16 0x00007fef3ef3e592 in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef549b790, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8839 17 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef549e9e0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 18 0x00007fef3ef3e56b in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54a1310, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8838 19 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54a7420, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 20 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef54dbec0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 21 0x00007fef3ef3e56b in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef546f5d0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8838 22 0x00007fef3ef3e5be in rewrite_topdown (sql=0x7feef410c760, rel=0x7feef547c0e0, rewriter=0x7fef3ef2cb73 <rel_push_project_down_union>, has_changes=0x7fef1a818818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8846 23 0x00007fef3ef3ee69 in _rel_optimizer (sql=0x7feef410c760, rel=0x7feef547c0e0, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9005 24 0x00007fef3ef3f01c in _rel_optimizer (sql=0x7feef410c760, rel=0x7feef547c0e0, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9033 25 0x00007fef3ef3f06f in rel_optimizer (sql=0x7feef410c760, rel=0x7feef546f5d0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9041 26 0x00007fef3ee1fb35 in sql_symbol2relation (c=0x7feef410c760, sym=0x7feef544dca0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121 27 0x00007fef3ee3e96c in SQLparser Reproducible: Always ### Steps to Reproduce: select ref_2.name as c0, case when true then ref_3.dimpos else ref_3.dimpos end as c1 from sys.tables as ref_0 inner join sys.dependencies as ref_1 right join sys.tables as ref_2 on ((ref_2.temporary is NULL) or (ref_2.system is not NULL)) inner join bam.pg as sample_1 on (false) on (ref_0.system = ref_2.system ) inner join sys.netcdf_vardim as ref_3 on (true) where ref_2.commit_action is NULL; ## Comment 25731 Date: 2017-10-16 07:33:01 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [084d4327137c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=084d4327137c) 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=084d4327137c](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=084d4327137c) Changeset description: fix crash in bug #6424 ## Comment 25732 Date: 2017-10-16 07:33:21 +0200 From: @njnes fixed assertion. ## Comment 25735 Date: 2017-10-16 08:19:16 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfa035d658b6) 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=cfa035d658b6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=cfa035d658b6) Changeset description: fixed bugs 6424, 6425 and 6426 ## Comment 26899 Date: 2019-02-20 16:52:35 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; 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.
Assertion error in rel_rename_expr (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6424/comments
0
2020-11-30T15:53:45Z
2024-06-27T13:01:13Z
https://github.com/MonetDB/MonetDB/issues/6424
753,594,227
6,424
[ "MonetDB", "MonetDB" ]
Date: 2017-10-15 11:38:43 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:30 +0200 ## Comment 25721 Date: 2017-10-15 11:38:43 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: Using the mergedb example (gdb) print *e Cannot access memory at address 0x0 0x00007f0ec40a3ae2 in rel_find_exp_ (rel=0x7f0e909dba40, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1191 1191 switch(e->type) { (gdb) where 0 0x00007f0ec40a3ae2 in rel_find_exp_ (rel=0x7f0e909dba40, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1191 1 0x00007f0ec40a3cb7 in rel_find_exp (rel=0x7f0e909dba40, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1229 2 0x00007f0ec40a35f5 in rel_has_exp (rel=0x7f0e909dba40, e=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_exp.c:1093 3 0x00007f0ec40bd248 in rel_push_semijoin_down (changes=0x7f0ea0db8594, sql=0x7f0e90126430, rel=0x7f0e909dbd30) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4302 4 0x00007f0ec40d13e1 in rewrite (sql=0x7f0e90126430, rel=0x7f0e909dbd30, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8803 5 0x00007f0ec40d12be in rewrite (sql=0x7f0e90126430, rel=0x7f0e909dc640, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 6 0x00007f0ec40d126b in rewrite (sql=0x7f0e90126430, rel=0x7f0e909e8220, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8779 7 0x00007f0ec40d12be in rewrite (sql=0x7f0e90126430, rel=0x7f0e909ef4d0, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 8 0x00007f0ec40d1292 in rewrite (sql=0x7f0e90126430, rel=0x7f0e909f0f30, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8780 9 0x00007f0ec40d12be in rewrite (sql=0x7f0e90126430, rel=0x7f0e90a5f150, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 10 0x00007f0ec40d1292 in rewrite (sql=0x7f0e90126430, rel=0x7f0e90a0b480, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8780 11 0x00007f0ec40d12be in rewrite (sql=0x7f0e90126430, rel=0x7f0e90a0b9e0, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 12 0x00007f0ec40d12be in rewrite (sql=0x7f0e90126430, rel=0x7f0e909c4150, rewriter=0x7f0ec40bd115 <rel_push_semijoin_down>, has_changes=0x7f0ea0db8818) at /export/scratch1/home/mk/default//package/sql/server/ Reproducible: Always ### Steps to Reproduce: select cast(nullif(sample_4.id, ref_5.name) as clob) as c0, ref_7.type as c1, sample_4.ds as c2, 65 as c3 from tmp.objects as sample_0 inner join sys.environment as ref_5 left join sys.tables as ref_6 on ((76 is not NULL) or ((true) and ((ref_6.name is NULL) or (ref_6.access is NULL)))) inner join sys.storagemodel as ref_7 left join bam.rg as sample_4 right join sys.key_types as ref_8 on (true) on (true) on (ref_6.commit_action = ref_8.key_type_id ) on (sample_4.lb is not NULL) where ref_7.columnsize is not NULL limit 85; ## Comment 25722 Date: 2017-10-15 13:47:08 +0200 From: @njnes make sure we only look at compare expressions ## Comment 25723 Date: 2017-10-15 13:48:18 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [7f0d859e9317](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7f0d859e9317) 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=7f0d859e9317](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=7f0d859e9317) Changeset description: fixed bug #6423
Dereference null pointer (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6423/comments
0
2020-11-30T15:53:42Z
2024-06-27T13:01:12Z
https://github.com/MonetDB/MonetDB/issues/6423
753,594,181
6,423
[ "MonetDB", "MonetDB" ]
Date: 2017-10-14 23:48:50 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:27 +0200 ## Comment 25714 Date: 2017-10-14 23:48:50 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: On the mergedb example and sf1 0 0x00007f3d40aea69b in raise () from /lib64/libc.so.6 1 0x00007f3d40aec4a0 in abort () from /lib64/libc.so.6 2 0x00007f3d40ae2d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f3d40ae2dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f3d3b5db407 in rel_or (sql=0x7f3cfc0da2c0, rel=0x0, l=0x7f3cfc84a5d0, r=0x7f3cfc84aba0, oexps=0x0, lexps=0x7f3cfc84a6a0, rexps=0x0) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:1152 5 0x00007f3d3b5ad933 in rel_logical_exp (sql=0x7f3cfc0da2c0, rel=0x0, sc=0x7f3cfc8493c0, f=1) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:2377 6 0x00007f3d3b5bbd7d in rel_joinquery_ (sql=0x7f3cfc0da2c0, rel=0x7f3cfc84a5d0, tab1=0x7f3cfc848890, natural=0, jointype=jt_right, tab2=0x7f3cfc848a20, js=0x7f3cfc8493c0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5330 7 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc8494a0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422 8 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc8494a0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339 9 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc8494a0, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941 10 0x00007f3d3b5bbb10 in rel_joinquery_ (sql=0x7f3cfc0da2c0, rel=0x0, tab1=0x7f3cfc8486f0, natural=0, jointype=jt_right, tab2=0x7f3cfc8494a0, js=0x7f3cfc849580) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5299 11 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc849660) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422 12 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc849660) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339 13 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc849660, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941 14 0x00007f3d3b5bb9d2 in rel_joinquery_ (sql=0x7f3cfc0da2c0, rel=0x0, tab1=0x7f3cfc849660, natural=0, jointype=jt_left, tab2=0x7f3cfc849810, js=0x7f3cfc849a00) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5288 15 0x00007f3d3b5bc4d4 in rel_joinquery (sql=0x7f3cfc0da2c0, rel=0x0, q=0x7f3cfc849ae0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5422 16 0x00007f3d3b5a3f6f in query_exp_optname (sql=0x7f3cfc0da2c0, r=0x0, q=0x7f3cfc849ae0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:339 17 0x00007f3d3b5a7294 in table_ref (sql=0x7f3cfc0da2c0, rel=0x0, tableref=0x7f3cfc849ae0, lateral=0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:941 18 0x00007f3d3b5bab65 in rel_query (sql=0x7f3cfc0da2c0, rel=0x0, sq=0x7f3cfc849ce0, toplevel=1, ek=..., apply=8) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5065 19 0x00007f3d3b5bc90a in rel_subquery (sql=0x7f3cfc0da2c0, rel=0x0, sq=0x7f3cfc849ce0, ek=..., apply=8) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5503 20 0x00007f3d3b5bca31 in rel_selects (sql=0x7f3cfc0da2c0, s=0x7f3cfc849ce0) at /export/scratch1/home/mk/default//package/sql/server/rel_select.c:5524 21 0x00007f3d3b5a2786 in rel_semantic (sql=0x7f3cfc0da2c0, s=0x7f3cfc849ce0) at /export/scratch1/home/mk/default//package/sql/server/rel_semantic.c:225 22 0x00007f3d3b4e3b09 in sql_symbol2relation (c=0x7f3cfc0da2c0, sym=0x7f3cfc849ce0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:117 23 0x00007f3d3b50296c in SQLparser Reproducible: Always ### Steps to Reproduce: select sample_5.keyword as c0 from sys.keywords as sample_5 right join sys.dependency_types as sample_6 right join sys.privileges as sample_7 on ((4 is not NULL) or (EXISTS ( select sample_8.table_type_name as c0, sample_8.table_type_id as c1, 63 as c2 from sys.table_types as sample_8 where sample_8.table_type_id is not NULL))) on (sample_7.obj_id is NULL) left join tmp.keys as sample_9 on (sample_5.keyword = sample_9.name ) where sample_5.keyword is not NULL; ## Comment 25718 Date: 2017-10-15 11:12:19 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [e13088976d30](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e13088976d30) 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=e13088976d30](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=e13088976d30) Changeset description: fix crash/assert of Bug #6422 (make sure we only remove the wrapping select if the innner part matches). ## Comment 25719 Date: 2017-10-15 11:12:59 +0200 From: @njnes fixed, we only remove the wrapping selects (and merge the or-ed expression lists), when the innner relations are the same.
Another assertion error in rel_or (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6422/comments
0
2020-11-30T15:53:39Z
2024-06-27T13:01:11Z
https://github.com/MonetDB/MonetDB/issues/6422
753,594,150
6,422
[ "MonetDB", "MonetDB" ]
Date: 2017-10-14 23:43:06 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: antonia.cummins22, arkr17997, martin.van.dinther, @njnes, sagarharish999 Last updated: 2019-02-12 13:17:04 +0100 ## Comment 25713 Date: 2017-10-14 23:43:06 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: 0 0x00007ff384e3b69b in raise () from /lib64/libc.so.6 1 0x00007ff384e3d4a0 in abort () from /lib64/libc.so.6 2 0x00007ff384e33d5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007ff384e33dd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007ff37f9bc72f in sql_ref_dec (r=0x7ff350387ee0) at /export/scratch1/home/mk/default//package/sql/common/sql_mem.c:29 5 0x00007ff37f92897e in rel_destroy (rel=0x7ff350387ee0) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:77 6 0x00007ff37f94c1bd in rel_rewrite_antijoin (changes=0x7ff364f02514, sql=0x7ff350126420, rel=0x7ff3509a52c0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:7350 7 0x00007ff37f9533a0 in rewrite (sql=0x7ff350126420, rel=0x7ff3509a52c0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8810 8 0x00007ff37f95322a in rewrite (sql=0x7ff350126420, rel=0x7ff3509a53f0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8786 9 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff3502956f0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 10 0x00007ff37f953251 in rewrite (sql=0x7ff350126420, rel=0x7ff350296510, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 11 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff35029a440, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 12 0x00007ff37f953251 in rewrite (sql=0x7ff350126420, rel=0x7ff35029b4e0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 13 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff3502b43f0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 14 0x00007ff37f953251 in rewrite (sql=0x7ff350126420, rel=0x7ff350999610, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 15 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff3502ba7c0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 16 0x00007ff37f953251 in rewrite (sql=0x7ff350126420, rel=0x7ff35099fac0, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8787 17 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff35038ba90, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 18 0x00007ff37f95327d in rewrite (sql=0x7ff350126420, rel=0x7ff35038bd30, rewriter=0x7ff37f94bf59 <rel_rewrite_antijoin>, has_changes=0x7ff364f02818) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8794 19 0x00007ff37f953a0c in _rel_optimizer (sql=0x7ff350126420, rel=0x7ff35038bd30, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8944 20 0x00007ff37f953fe7 in _rel_optimizer (sql=0x7ff350126420, rel=0x7ff35038bd30, level=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9040 21 0x00007ff37f95403a in rel_optimizer (sql=0x7ff350126420, rel=0x7ff35038bd30) Reproducible: Always ### Steps to Reproduce: select sample_0.query as c0 from sys.tables as sample_0 left join sys.privileges as sample_2 inner join sys.netcdf_vardim as sample_3 inner join sys.storagemodel as ref_1 left join sys.columns as sample_4 on ((false) or (true)) on (ref_1.revsorted is not NULL) on (true) on (sample_0.access is NULL) where true limit 136; ## Comment 25716 Date: 2017-10-14 23:55:58 +0200 From: @njnes allready fixed ? ## Comment 25717 Date: 2017-10-15 09:48:45 +0200 From: @mlkersten Yes, but it ends with GDK reported error: GDKextendf: could not extend file !OS: No space left on device HEAPalloc: Insufficient space for HEAP of 221748631552 bytes.
Assertion error in sql_ref_dec (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6421/comments
0
2020-11-30T15:53:36Z
2024-06-28T13:10:56Z
https://github.com/MonetDB/MonetDB/issues/6421
753,594,113
6,421
[ "MonetDB", "MonetDB" ]
Date: 2017-10-14 21:22:25 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:42 +0200 ## Comment 25707 Date: 2017-10-14 21:22:25 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: Using the mini database over mergetables triggered an assertion error. Beware, no statistics has been computed over the tables. (gdb) where 0 0x00007f677149769b in raise () from /lib64/libc.so.6 1 0x00007f67714994a0 in abort () from /lib64/libc.so.6 2 0x00007f677148fd5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007f677148fdd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007f676c0186ce in sql_ref_dec (r=0x7f67389a4fc0) at /export/scratch1/home/mk/default//package/sql/common/sql_mem.c:29 5 0x00007f676bf8497e in rel_destroy (rel=0x7f67389a4fc0) at /export/scratch1/home/mk/default//package/sql/server/rel_rel.c:77 6 0x00007f676bfaaeb1 in rel_merge_table_rewrite (changes=0x7f6748c9a8b8, sql=0x7f67381263f0, rel=0x7f67389a4fc0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:7900 7 0x00007f676bfaf3d9 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a4fc0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8819 8 0x00007f676bfaf4fc in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389beb90, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8841 9 0x00007f676bfaf4d5 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389becc0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8840 10 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389bee60, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 11 0x00007f676bfaf4fc in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389bf990, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8841 12 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389db9d0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 13 0x00007f676bfaf4fc in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a5aa0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8841 14 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389dc800, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 15 0x00007f676bfaf4d5 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a75a0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8840 16 0x00007f676bfaf4fc in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a7890, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8841 17 0x00007f676bfaf4fc in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389c22b0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8841 18 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389cf8c0, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 19 0x00007f676bfaf4d5 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389c1f60, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8840 20 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389bc720, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 21 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a8580, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 22 0x00007f676bfaf528 in rewrite_topdown (sql=0x7f67381263f0, rel=0x7f67389a8f80, rewriter=0x7f676bfa9ed3 <rel_merge_table_rewrite>, has_changes=0x7f6748c9a8b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8848 23 0x00007f676bfafee3 in _rel_optimizer (sql=0x7f67381263f0, rel=0x7f67389a8f80, level=0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9025 24 0x00007f676bfaffd9 in rel_optimizer (sql=0x7f67381263f0, rel=0x7f67389a8f80) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9043 25 0x00007f676be90b35 in sql_symbol2relation (c=0x7f67381263f0, sym=0x7f673899ba30) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121 26 0x00007f676beaf96c in SQLparser (c=0x7f676d852338) at /export/scratch1/home Reproducible: Always ### Steps to Reproduce: select ref_7.length as c0, sample_1.type as c1, ref_7.length as c2, sample_8.function_type_id as c3 from sys.columns as sample_1 inner join bam.rg as ref_4 left join sys.keys as ref_6 on (ref_4.pi = ref_6.id ) right join sys.table_types as sample_7 left join sys.function_types as sample_8 left join sys.r as sample_9 on (sample_9.y is not NULL) on (sample_7.table_type_name = sample_8.function_type_name ) left join sys.r as sample_10 right join sys.netcdf_dims as ref_7 on ((false) or (true)) on (sample_10.z is not NULL) right join sys._tables as sample_12 left join bam.rg as ref_8 on (sample_12.id = ref_8.pi ) on (sample_10.y = ref_8.pi ) on (ref_4.cn = sample_9.z ) on (sample_1.type_scale = ref_4.pi ) where sample_10.y is NULL limit 14; ## Comment 25708 Date: 2017-10-14 21:24:47 +0200 From: @mlkersten A variation on the same issue select sample_8.dimpos as c0, ref_4.x as c1, ref_2.y as c2 from sys.r3 as ref_2 left join tmp._tables as sample_6 on (ref_2.y = sample_6.id ) left join sys._tables as sample_7 right join sys.netcdf_vardim as sample_8 left join sys.querylog_catalog as ref_3 on (sample_8.dimpos = ref_3.mal ) on (true) left join sys.s1 as ref_4 on (sample_8.dimpos = ref_4.x ) on ((sample_7.id is NULL) or (sample_8.var_id is not NULL)) left join sys.optimizers as ref_12 inner join bam.sq as ref_13 on (ref_12.def = ref_13.sn ) inner join sys.keywords as ref_14 on (ref_13.sp is not NULL) on ((sample_6.commit_action is NULL) or (ref_14.keyword is not NULL)) where ref_3.optimize is NULL limit 86; ## Comment 25715 Date: 2017-10-14 23:51:05 +0200 From: @njnes fixed reference bug in split_outerjoin optimizer
Assertion error in mergetable task (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6420/comments
0
2020-11-30T15:53:33Z
2024-06-27T13:01:09Z
https://github.com/MonetDB/MonetDB/issues/6420
753,594,071
6,420
[ "MonetDB", "MonetDB" ]
Date: 2017-10-14 21:17:04 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:25 +0200 ## Comment 25706 Date: 2017-10-14 21:17:04 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: Another roadblock encountered: (gdb) print *subrel $2 = {ref = {refcnt = 1}, op = op_union, l = 0x7fad2c9bd780, r = 0x7fad2c9becd0, exps = 0x0, nrcols = 32, flag = 0, card = 3, processed = 1, subquery = 0, p = 0x0} Thread 2896 "mserver5" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7fad42434700 (LWP 26359)] 0x00007fad5ce77c9b in exps_mark_used (sa=0x7fad2c117ba0, rel=0x7fad2c9bbb40, subrel=0x7fad2c9bf8f0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5782 5782 if (subrel && !nr && (is_project(subrel->op) || is_base(subrel->op)) && subrel->exps->h) { (gdb) where 0 0x00007fad5ce77c9b in exps_mark_used (sa=0x7fad2c117ba0, rel=0x7fad2c9bbb40, subrel=0x7fad2c9bf8f0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5782 1 0x00007fad5ce78278 in rel_mark_used (sql=0x7fad2c126420, rel=0x7fad2c9bbb40, proj=0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5902 2 0x00007fad5ce7816b in rel_mark_used (sql=0x7fad2c126420, rel=0x7fad2c9b9430, proj=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5878 3 0x00007fad5ce78115 in rel_mark_used (sql=0x7fad2c126420, rel=0x7fad2c9b9430, proj=1) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:5870 4 0x00007fad5ce78f22 in rel_dce_sub (sql=0x7fad2c126420, rel=0x7fad2c9b96f0, refs=0x7fad2c9c05e0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6254 5 0x00007fad5ce792bb in rel_dce (sql=0x7fad2c126420, rel=0x7fad2c9b96f0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:6337 6 0x00007fad5ce84df3 in _rel_optimizer (sql=0x7fad2c126420, rel=0x7fad2c9b96f0, level=0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9011 7 0x00007fad5ce84fd9 in rel_optimizer (sql=0x7fad2c126420, rel=0x7fad2c9b96f0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9043 8 0x00007fad5cd65b35 in sql_symbol2relation (c=0x7fad2c126420, sym=0x7fad2c9b6630) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql.c:121 9 0x00007fad5cd8496c in SQLparser (c=0x7fad5e727338) at /export/sc Reproducible: Always ### Steps to Reproduce: select ref_0.dependency_type_name as c0 from sys.dependency_types as ref_0 right join sys.queue as ref_1 on ((true) or (ref_0.dependency_type_id is not NULL)) where false limit 39; ## Comment 25711 Date: 2017-10-14 23:33:03 +0200 From: @njnes already fixed ? ## Comment 25712 Date: 2017-10-14 23:36:52 +0200 From: @mlkersten seems fixed
segfault in rel_optimizer (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6419/comments
0
2020-11-30T15:53:30Z
2024-06-27T13:01:08Z
https://github.com/MonetDB/MonetDB/issues/6419
753,594,025
6,419
[ "MonetDB", "MonetDB" ]
Date: 2017-10-13 22:57:10 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:42 +0200 ## Comment 25700 Date: 2017-10-13 22:57:10 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: Looks like the rel-optimizer has some problems. 0x00007fc173348004 in rel_rename_exps (sql=0x7fc144126450, exps1=0x0, exps2=0x7fc14491f390) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1831 1831 for (n = exps1->h, m = exps2->h; n && m; n = n->next, m = m->next, pos++) { (gdb) where 0 0x00007fc173348004 in rel_rename_exps (sql=0x7fc144126450, exps1=0x0, exps2=0x7fc14491f390) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:1831 1 0x00007fc173353ea2 in rel_push_join_down_union (changes=0x7fc1589167b4, sql=0x7fc144126450, rel=0x7fc14491a960) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:4484 2 0x00007fc1733671cf in rewrite (sql=0x7fc144126450, rel=0x7fc14491a960, rewriter=0x7fc173353a12 <rel_push_join_down_union>, has_changes=0x7fc1589168b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8805 3 0x00007fc1733670ac in rewrite (sql=0x7fc144126450, rel=0x7fc14491af60, rewriter=0x7fc173353a12 <rel_push_join_down_union>, has_changes=0x7fc1589168b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8789 4 0x00007fc1733670ac in rewrite (sql=0x7fc144126450, rel=0x7fc14491b130, rewriter=0x7fc173353a12 <rel_push_join_down_union>, has_changes=0x7fc1589168b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8789 5 0x00007fc1733670ac in rewrite (sql=0x7fc144126450, rel=0x7fc14491b9e0, rewriter=0x7fc173353a12 <rel_push_join_down_union>, has_changes=0x7fc1589168b8) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8789 6 0x00007fc173367b87 in _rel_optimizer (sql=0x7fc144126450, rel=0x7fc14491b9e0, level=0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:8992 7 0x00007fc173367e69 in rel_optimizer (sql=0x7fc144126450, rel=0x7fc14491b9e0) at /export/scratch1/home/mk/default//package/sql/server/rel_optimizer.c:9043 8 0x00007fc173248b35 in sql_symbol2relation (c=0x7fc144126450, sym=0x7fc144918170) Reproducible: Always ### Steps to Reproduce: select ref_2.key_type_id as c0, ref_3.ps_availqty as c1, sample_0.name as c2 from tmp.idxs as sample_0 right join sys.sequences as sample_1 on ((true) or ((sample_0.name is NULL) or (sample_0.type is not NULL))) inner join sys.key_types as ref_2 left join sys.partsupp as ref_3 on (ref_2.key_type_id is not NULL) on (sample_1.schema_id is NULL) where true limit 116; ## Comment 25709 Date: 2017-10-14 23:29:16 +0200 From: @njnes make sure we produce a projection list in the split_outerjoin rewriter, fixes this bug ## Comment 25710 Date: 2017-10-14 23:30:50 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [239017b3bde8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=239017b3bde8) 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=239017b3bde8](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=239017b3bde8) Changeset description: fixed bug #6418, ie add full projection list in unions (split outerjoin rewriter)
Segfault in renaming (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6418/comments
0
2020-11-30T15:53:27Z
2024-06-27T13:01:07Z
https://github.com/MonetDB/MonetDB/issues/6418
753,593,995
6,418
[ "MonetDB", "MonetDB" ]
Date: 2017-10-13 22:50:11 +0200 From: @mlkersten To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:45 +0200 ## Comment 25699 Date: 2017-10-13 22:50:11 +0200 From: @mlkersten User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:55.0) Gecko/20100101 Firefox/55.0 Build Identifier: After installing the upgraded sqlsmith 2.0 and runnning sequences, this following simple query caused problems. (gdb) print *s $1 = {type = st_var, op1 = 0x0, op2 = 0x0, op3 = 0x0, op4 = {aval = 0x24c8310, lval = 0x24c8310, stval = 0x24c8310, cval = 0x24c8310, idxval = 0x24c8310, tval = 0x24c8310, typeval = {type = 0x24c8310, digits = 1, scale = 0}, aggrval = 0x24c8310, funcval = 0x24c8310, rel = 0x24c8310}, nrcols = 0 '\000', key = 1 '\001', aggr = 0 '\000', partition = 0 '\000', flag = 0, nr = 169, tname = 0x0, cname = 0x0, q = 0x7f979431b110} x00007f97c44ded35 in stmt_result (be=0x7f9794112190, s=0x7f97948a9250, nr=0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_statement.c:971 971 if (s->op1->nr < 0) (gdb) where 0 0x00007f97c44ded35 in stmt_result (be=0x7f9794112190, s=0x7f97948a9250, nr=0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/sql_statement.c:971 1 0x00007f97c44c4d95 in rel2bin_semijoin (be=0x7f9794112190, rel=0x7f97948892c0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1991 2 0x00007f97c44d1dac in subrel_bin (be=0x7f9794112190, rel=0x7f97948892c0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4815 3 0x00007f97c44c6fd9 in rel2bin_project (be=0x7f9794112190, rel=0x7f979488d2f0, refs=0x7f97948a0cc0, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2450 4 0x00007f97c44d1e66 in subrel_bin (be=0x7f9794112190, rel=0x7f979488d2f0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4831 5 0x00007f97c44c4824 in rel2bin_semijoin (be=0x7f9794112190, rel=0x7f97948893f0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:1924 6 0x00007f97c44d1dac in subrel_bin (be=0x7f9794112190, rel=0x7f97948893f0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4815 7 0x00007f97c44c6fd9 in rel2bin_project (be=0x7f9794112190, rel=0x7f9794889770, refs=0x7f97948a0cc0, topn=0x0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2450 8 0x00007f97c44d1e66 in subrel_bin (be=0x7f9794112190, rel=0x7f9794889770, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4831 9 0x00007f97c44c579b in rel2bin_union (be=0x7f9794112190, rel=0x7f979488a5a0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2141 10 0x00007f97c44d1dda in subrel_bin (be=0x7f9794112190, rel=0x7f979488a5a0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4819 11 0x00007f97c44c7a2d in rel2bin_select (be=0x7f9794112190, rel=0x7f9794886750, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2586 12 0x00007f97c44d1e94 in subrel_bin (be=0x7f9794112190, rel=0x7f9794886750, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4835 13 0x00007f97c44c6fd9 in rel2bin_project (be=0x7f9794112190, rel=0x7f9794883e10, refs=0x7f97948a0cc0, topn=0x7f97948840b0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2450 14 0x00007f97c44c8615 in rel2bin_topn (be=0x7f9794112190, rel=0x7f97948840b0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:2763 15 0x00007f97c44d1ef0 in subrel_bin (be=0x7f9794112190, rel=0x7f97948840b0, refs=0x7f97948a0cc0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4843 16 0x00007f97c44d215d in output_rel_bin (be=0x7f9794112190, rel=0x7f97948840b0) at /export/scratch1/home/mk/default//package/sql/backends/monet5/rel_bin.c:4896 17 0x00007f97c44ed3a8 in sql_relation2stmt (be=0x7f9794112190, r=0x7f97948840b0) Reproducible: Always ### Steps to Reproduce: select ref_0.active as c0 from sys.sessions as ref_0 right join sys.netcdf_dims as sample_5 on ((true) or (ref_0.active is NULL)) where ref_0.querytimeout is NULL limit 106; ## Comment 25703 Date: 2017-10-14 19:21:06 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [43ecd1bf4fce](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=43ecd1bf4fce) 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=43ecd1bf4fce](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=43ecd1bf4fce) Changeset description: handle semi/anti join better with constants (fixes bug #6417) ## Comment 25704 Date: 2017-10-14 19:25:03 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [9649c7ed3440](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9649c7ed3440) 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=9649c7ed3440](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9649c7ed3440) Changeset description: add test for bug #6417 ## Comment 25705 Date: 2017-10-14 19:25:23 +0200 From: @njnes fixed by handling semi/anti join better
Segfault encountered (sqlsmith)
https://api.github.com/repos/MonetDB/MonetDB/issues/6417/comments
0
2020-11-30T15:53:23Z
2024-06-27T13:01:06Z
https://github.com/MonetDB/MonetDB/issues/6417
753,593,943
6,417
[ "MonetDB", "MonetDB" ]
Date: 2017-10-12 10:30:06 +0200 From: @PedroTadim To: SQL devs &lt;<bugs-sql>&gt; Version: -- development CC: @njnes Last updated: 2017-10-26 14:01:36 +0200 ## Comment 25696 Date: 2017-10-12 10:30:06 +0200 From: @PedroTadim User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36 Build Identifier: The server gets an assertion error in an complex aggregation query with a NOT IN clause. Reproducible: Always ### Steps to Reproduce: 1. CREATE TABLE tab2(col0 INTEGER, col1 INTEGER, col2 INTEGER); 2. SELECT ALL - 89 FROM tab2 GROUP BY col1, col1 HAVING - CAST ( NULL AS INTEGER ) * + - 17 + + - COUNT ( * ) NOT IN ( + MAX ( 44 ) ); ### Actual Results: Mserver5 gets an assertion error. ### Expected Results: An empty result set. The assertion error: mserver5: rel_bin.c:564: exp_bin: Assertion `s' failed. Backtrace: 0 0x00007ffff490269b in raise () from /lib64/libc.so.6 1 0x00007ffff49044a0 in abort () from /lib64/libc.so.6 2 0x00007ffff48fad5a in __assert_fail_base () from /lib64/libc.so.6 3 0x00007ffff48fadd2 in __assert_fail () from /lib64/libc.so.6 4 0x00007fffe8a43e44 in exp_bin (be=0x7fffb80dddd0, e=0x7fffb80eb430, left=0x7fffb80f26f0, right=0x7fffb80f2880, grp=0x0, ext=0x0, cnt=0x0, sel=0x0) at rel_bin.c:564 5 0x00007fffe8a4d0ac in rel2bin_project (be=0x7fffb80dddd0, rel=0x7fffb80eb4a0, refs=0x7fffb80f0f10, topn=0x0) at rel_bin.c:2462 6 0x00007fffe8a57e66 in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80eb4a0, refs=0x7fffb80f0f10) at rel_bin.c:4831 7 0x00007fffe8a4a85f in rel2bin_semijoin (be=0x7fffb80dddd0, rel=0x7fffb80eb830, refs=0x7fffb80f0f10) at rel_bin.c:1926 8 0x00007fffe8a57dac in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80eb830, refs=0x7fffb80f0f10) at rel_bin.c:4815 9 0x00007fffe8a4cfd9 in rel2bin_project (be=0x7fffb80dddd0, rel=0x7fffb80e86e0, refs=0x7fffb80f0f10, topn=0x0) at rel_bin.c:2450 10 0x00007fffe8a57e66 in subrel_bin (be=0x7fffb80dddd0, rel=0x7fffb80e86e0, refs=0x7fffb80f0f10) at rel_bin.c:4831 11 0x00007fffe8a5815d in output_rel_bin (be=0x7fffb80dddd0, rel=0x7fffb80e86e0) at rel_bin.c:4896 12 0x00007fffe8a733a8 in sql_relation2stmt (be=0x7fffb80dddd0, r=0x7fffb80e86e0) at sql_gencode.c:529 13 0x00007fffe8a73727 in backend_dumpstmt (be=0x7fffb80dddd0, mb=0x7fffb80e0ca0, r=0x7fffb80e86e0, top=1, add_end=0, query=0x7fffb80ddec0 "select all - 89 from tab2 group by col1, col1 having - cast ( null as integer ) * + - 17 + + - count ( * ) not in ( + max ( 44 ) );") at sql_gencode.c:576 14 0x00007fffe8a37b26 in SQLparser (c=0x7fffea11e338) at sql_scenario.c:1146 15 0x00007ffff7a15baa in runPhase (c=0x7fffea11e338, phase=1) at mal_scenario.c:506 16 0x00007ffff7a15cee in runScenarioBody (c=0x7fffea11e338) at mal_scenario.c:539 17 0x00007ffff7a15e91 in runScenario (c=0x7fffea11e338) at mal_scenario.c:568 18 0x00007ffff7a17a46 in MSserveClient (dummy=0x7fffea11e338) at mal_session.c:473 19 0x00007ffff7a17536 in MSscheduleClient (command=0x7fffb80008d0 "0", challenge=0x7fffcd396deb "nuLOFQd2ohy", fin=0x7fffb80028f0, fout=0x7fffc4002b70, protocol=PROTOCOL_9, blocksize=8190, compute_column_widths=0) at mal_session.c:364 20 0x00007ffff7aba965 in doChallenge (data=0x7fffc40008d0) at mal_mapi.c:273 21 0x00007ffff7690ae4 in thread_starter (arg=0x7fffc4004c60) at gdk_system.c:485 22 0x00007ffff4ca436d in start_thread () from /lib64/libpthread.so.0 23 0x00007ffff49dcbbf in clone () from /lib64/libc.so.6 ## Comment 25697 Date: 2017-10-12 10:40:25 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [ab1b5022ce76](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ab1b5022ce76) 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=ab1b5022ce76](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=ab1b5022ce76) Changeset description: Added test for bug #6416 ## Comment 25701 Date: 2017-10-14 17:03:24 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [9dbd05ca313b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9dbd05ca313b) 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=9dbd05ca313b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=9dbd05ca313b) Changeset description: fix bug #6416, make sure we handle a wrapping select and project in the groupby/aggregate code. ## Comment 25702 Date: 2017-10-14 17:03:59 +0200 From: @njnes fixed. The missing projection column is now added in the rel_aggr code
Sqlitelogictest crash in aggregation query with a NOT IN clause
https://api.github.com/repos/MonetDB/MonetDB/issues/6416/comments
0
2020-11-30T15:53:20Z
2024-06-27T13:01:05Z
https://github.com/MonetDB/MonetDB/issues/6416
753,593,896
6,416
[ "MonetDB", "MonetDB" ]
Date: 2017-10-10 14:46:27 +0200 From: @swingbit To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @mlkersten, @PedroTadim Last updated: 2020-10-19 11:06:20 +0200 ## Comment 25686 Date: 2017-10-10 14:46:27 +0200 From: @swingbit User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36 Build Identifier: Date subtraction returns days: sql>select cast('2017-10-10' as date) - cast('2017-10-01' as date); +------+ | L4 | +======+ | 9 | +------+ 1 tuple (1.234ms) You would expect that reversing the operation behaves consistently. So you would expect that 2017-10-01 + 9 = 2017-10-10. But date addition does not work on days like subtraction, it works on seconds: sql>select cast('2017-10-01' as date) + 9; +------------+ | L3 | +============+ | 2017-10-01 | +------------+ 1 tuple (1.269ms) sql>select cast('2017-10-01' as date) + (9*24*3600); +------------+ | L3 | +============+ | 2017-10-10 | +------------+ 1 tuple (1.420ms) Reproducible: Always $ mserver5 --version MonetDB 5 server v11.27.6 (64-bit, 128-bit integers) This is an unreleased version Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2017 MonetDB B.V., all rights reserved Visit https://www.monetdb.org/ for further information Found 15.6GiB available memory, 8 available cpu cores Libraries: libpcre: 8.41 2017-07-05 (compiled with 8.41) openssl: OpenSSL 1.0.2k 26 Jan 2017 (compiled with OpenSSL 1.0.2k-fips 26 Jan 2017) libxml2: 2.9.4 (compiled with 2.9.4) Compiled by: roberto@photon.hq.spinque.com (x86_64-unknown-linux-gnu) Compilation: gcc -g -Werror -Wall -Wextra -W -Werror-implicit-function-declaration -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wformat=2 -Wno-format-nonliteral -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 -Wnested-externs -Wunreachable-code Linking : /usr/bin/ld -m elf_x86_64 ## Comment 25694 Date: 2017-10-12 08:54:44 +0200 From: @sjoerdmullender It's even worse, I would say. The difference between two dates should be an interval (in this case, INTERVAL DAY), so when you add that interval back to the subtracted date, you should get the subtractee. As in: sql>select cast('2017-10-01' as date) + (cast('2017-10-10' as date) - cast('2017-10-01' as date)); But this result is also wrong. This, at least, works: sql>select cast('2017-10-01' as date) + cast(9 as interval day); +------------+ | L4 | +============+ | 2017-10-10 | +------------+ 1 tuple (2.077ms) ## Comment 25698 Date: 2017-10-12 10:43:47 +0200 From: @swingbit Yes, there seem to be two issues: 1) date - date returns an integer but should return an interval day. 2) date +/- integer should be interpreted as date +/- interval day, i.e. these should be equivalent: select cast('2017-10-01' as date) + cast(9 as interval day); select cast('2017-10-01' as date) + 9; ## Comment 27599 Date: 2020-03-15 11:19:56 +0100 From: @mlkersten Can this bug report being closed? ## Comment 27600 Date: 2020-03-15 11:56:50 +0100 From: @swingbit I just checked, the latest release still has the same issue. ## Comment 27603 Date: 2020-03-17 14:01:05 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [a9d24362b701](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a9d24362b701) 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=a9d24362b701](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=a9d24362b701) Changeset description: Added test for bug #6415 ## Comment 27604 Date: 2020-03-17 15:07:43 +0100 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [18c78c0f2b12](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=18c78c0f2b12) 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=18c78c0f2b12](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=18c78c0f2b12) Changeset description: Partial fix for bug #6415, ie use second interval for difference between dates. We cannot use month interval because it doesn't fit for the difference ## Comment 28142 Date: 2020-10-01 12:10:31 +0200 From: @swingbit Hi Pedro, I'm checking this on Oct2020, I'm still confused about it. The date difference of the original query reports now a second interval, as you said: sql>select cast('2017-10-10' as date) - cast('2017-10-01' as date); +------------+ | %2 | +============+ | 777600.000 | +------------+ 1 tuple The first thing to note is that a trace shows a day_interval, not a second_interval: sql>trace select cast('2017-10-10' as date) - cast('2017-10-01' as date); +------------+ | %2 | +============+ | 777600.000 | +------------+ 1 tuple +------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | usec | statement | +======+==================================================================================================================================================+ | 5 | X_1=0@0:void := querylog.define("trace select cast(\\'2017-10-10\\' as date) - cast(\\'2017-10-01\\' as date);":str, "default_pipe":str, 8:int); | | 120 | sql.resultSet(".%2":str, "%2":str, "day_interval":str, 4:int, 0:int, 9:int, 777600000:lng); | +------+--------------------------------------------------------------------------------------------------------------------------------------------------+ 2 tuples A second point that maybe I haven't grasped, is how to make the operation reversible. I tried the following, but with no luck: sql>select cast('2017-10-10' as date) - 777600; SELECT: no such binary operator 'sql_sub(date,int)' sql>select cast('2017-10-10' as date) - 777600.000; SELECT: no such binary operator 'sql_sub(date,decimal)' sql>select cast('2017-10-10' as date) - cast(777600 as interval second); types int(20,0) and sec_interval(13,0) are not equal sql>select cast('2017-10-10' as date) - cast(777600.000 as interval second); types decimal(9,3) and sec_interval(13,0) are not equal ## Comment 28143 Date: 2020-10-01 12:17:45 +0200 From: @swingbit OK, please ignore the second point. I hadn't really used the interval syntax before, my bad. Here it is. sql>select cast('2017-10-10' as date) - interval '777600' second; +------------+ | %2 | +============+ | 2017-10-01 | +------------+ 1 tuple (although being able to cast would be really nice) Then only the first point may be interesting
Date arithmetic types are inconsistent
https://api.github.com/repos/MonetDB/MonetDB/issues/6415/comments
0
2020-11-30T15:53:16Z
2024-06-27T13:01:03Z
https://github.com/MonetDB/MonetDB/issues/6415
753,593,833
6,415
[ "MonetDB", "MonetDB" ]
Date: 2017-10-09 09:59:49 +0200 From: Gatis Ozolins &lt;<g.ozolins>&gt; To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) Last updated: 2017-10-26 14:01:29 +0200 ## Comment 25685 Date: 2017-10-09 09:59:49 +0200 From: Gatis Ozolins &lt;<g.ozolins>&gt; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0 Build Identifier: Error "could not allocate space" is received when using RPAD with length parameter = 0 Reproducible: Always ### Steps to Reproduce: SELECT RPAD('test', 0) ### Actual Results: SQL Error [HY001]: could not allocate space java.sql.SQLException: could not allocate space ### Expected Results: NULL ## Comment 25695 Date: 2017-10-12 09:21:36 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [32f71cab2c3b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=32f71cab2c3b) 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=32f71cab2c3b](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=32f71cab2c3b) Changeset description: GDKstrndup with size 0 should return an empty string, not no string. This fixes bug #6414.
Using RPAD returns: could not allocate space
https://api.github.com/repos/MonetDB/MonetDB/issues/6414/comments
0
2020-11-30T15:53:13Z
2024-06-27T13:01:02Z
https://github.com/MonetDB/MonetDB/issues/6414
753,593,785
6,414
[ "MonetDB", "MonetDB" ]
Date: 2017-10-06 15:05:21 +0200 From: @drstmane To: SQL devs &lt;<bugs-sql>&gt; Version: 11.27.5 (Jul2017-SP1) CC: @njnes Last updated: 2017-10-26 14:01:43 +0200 ## Comment 25678 Date: 2017-10-06 15:05:21 +0200 From: @drstmane Somewhere between changeset [702993d1f2e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=702993d1f2e0) and changeset [36755134ba9d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36755134ba9d) --- on the Dec2016 branch --- a code change caused TPC-H Q17 (on default SF-1 dataset with default query parameters) to produce a wrong result. While the "official" TPC-H results is 348406.02 MonetDB used to produce the ("officially"?) "acceptable" result 348406.054 up until (and including) changeset [702993d1f2e0](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=702993d1f2e0) At least since changeset [36755134ba9d](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36755134ba9d) --- I haven't tested intermediate changesets, yet --- MonetDB now produces the wrong result 3270416.820 which is off by more than 800% ... ## Comment 25679 Date: 2017-10-06 16:22:51 +0200 From: @drstmane The "culprit" appears to be changeset [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) . ## Comment 25680 Date: 2017-10-06 16:39:31 +0200 From: @drstmane Created attachment 569 Differences in PLAN, EXPLAIN, TRACE for TPCH Q17 between changesets [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) & [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) The attached HTML file shows the differences in PLAN, EXPLAIN, and TRACE for TPCH Q17 on SF-1 (single-threaded) between changesets [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) ("last good") and [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) ("first bad"). > Attached file: [TPCH-SF1-Q17-99aabb9cfcc6-vs-b72b05357cdd.html](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6413_TPCH-SF1-Q17-99aabb9cfcc6-vs-b72b05357cdd.html_569) (text/html, 67586 bytes) > Description: Differences in PLAN, EXPLAIN, TRACE for TPCH Q17 between changesets 99aabb9cfcc6 & b72b05357cdd ## Comment 25690 Date: 2017-10-11 16:46:59 +0200 From: @drstmane Created attachment 572 Differences in PLAN, EXPLAIN, TRACE, RESULT for a revised version of TPCH Q17 between changesets [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) & [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) (edit details) The differences in the EXPLAIN of Q17 between changesets [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) & [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) suggest that in particular the last algebra.projectionpath() differs as follows: [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) (GOOD): X_445:bat[:lng] := algebra.projectionpath(C_433,r1_86,r1_72,X_372,C_327,X_435); [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) (BAD): X_444:bat[:lng] := algebra.projectionpath(C_433,r1_86, X_386 ,C_327,X_435); resulting in picking the wrong lineitem tuples for the final result. The attached differences in PLAN, EXPLAN, TRACE, and RESULT between changesets [99aabb9cfcc6](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=99aabb9cfcc6) & [b72b05357cdd](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b72b05357cdd) for a revised version of Q17 --- that dumps the relevant final intermediate result instead of performing the global aggregation --- seems to confirm this. > Attached file: [TPCH-SF1-Q17x-99aabb9cfcc6-vs-b72b05357cdd.html](https://github.com/MonetDB/monetdb-issues-attachments/blob/master/issue_6413_TPCH-SF1-Q17x-99aabb9cfcc6-vs-b72b05357cdd.html_572) (text/html, 543137 bytes) > Description: Differences in PLAN, EXPLAIN, TRACE, RESULT for a revised version of TPCH Q17 between changesets 99aabb9cfcc6 & b72b05357cdd (edit details) ## Comment 25691 Date: 2017-10-11 21:30:31 +0200 From: @njnes it seems the outer and inner 'lineitem' table are swapped. When I change the sub query using aliases (lineitem l1 and before its columns l1.), it works again. ## Comment 25692 Date: 2017-10-11 22:35:33 +0200 From: @njnes fixed, correctly mark all internal conflicting columns as used/rename all of them. This solve q17, ie it uses the proper extendedprice ## Comment 25693 Date: 2017-10-11 22:37:35 +0200 From: MonetDB Mercurial Repository &lt;<hg>&gt; Changeset [055d1f50bb0f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=055d1f50bb0f) 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=055d1f50bb0f](https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=https//devmonetdborg/hg/MonetDB?cmd=changeset;node=055d1f50bb0f) Changeset description: fixed bug #6413, ie correct output of tpch sf1 q17. A column from the subquery was used in the outer query. This is fixed in the apply/rename optimizer (which correctly marks all internal columns as such and renames them).
Wrong answer for TPC-H Q17
https://api.github.com/repos/MonetDB/MonetDB/issues/6413/comments
0
2020-11-30T15:53:11Z
2024-06-27T13:01:01Z
https://github.com/MonetDB/MonetDB/issues/6413
753,593,753
6,413