Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure in /MonetDB-11.19.11/gdk/gdk_bat.c:2841: BATassertHeadProps: Assertion `!b->H->key || cmp != 0' failed. #3719

monetdb-team opened this issue Nov 30, 2020 · 0 comments


Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2015-05-07 18:36:41 +0200
From: Martin van Dinther <<martin.van.dinther>>
To: SQL devs <>
Version: 11.19.11 (Oct2014-SP3)

Last updated: 2015-06-22 22:32:23 +0200

Comment 20851

Date: 2015-05-07 18:36:41 +0200
From: Martin van Dinther <<martin.van.dinther>>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0
Build Identifier:

SQL query
SELECT count(*) FROM t1 AS x WHERE x.c;
causes assertion failure

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 (MonetDB 5 server v11.19.11 "Oct2014-SP3")
  2. start mclient
  3. run SQL:
    INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
    INSERT INTO t1(a,c,d,e,b) VALUES(107,106,108,109,105);
    INSERT INTO t1(e,d,b,a,c) VALUES(110,114,112,111,113);
    INSERT INTO t1(d,c,e,a,b) VALUES(116,119,117,115,118);
    SELECT count() FROM t1 AS x;
    SELECT count(
    ) FROM t1 AS x WHERE x.c;
    -- this last query causes the assertion failure

Actual Results:

bash-4.2$ ./
builtin opt gdk_dbpath = /export/scratch1/dinther/Downloads/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 gdk_debug = 10
MonetDB 5 server v11.19.11 "Oct2014-SP3"
Serving database 'demo', using 8 threads
Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked
Found 15.590 GiB available main-memory.
Copyright (c) 1993-July 2008 CWI.
Copyright (c) August 2008-2015 MonetDB B.V., all rights reserved
Visit for further information
Listening for connection requests on mapi:monetdb://
MonetDB/GIS module loaded
MonetDB/SQL module loaded

SQL catalog created, loading sql scripts once
loading sql script: 09_like.sql
loading sql script: 10_math.sql
loading sql script: 11_times.sql
loading sql script: 12_url.sql
loading sql script: 13_date.sql
loading sql script: 14_inet.sql
loading sql script: 15_querylog.sql
loading sql script: 16_tracelog.sql
loading sql script: 19_cluster.sql
loading sql script: 20_vacuum.sql
loading sql script: 21_dependency_functions.sql
loading sql script: 22_clients.sql
loading sql script: 23_skyserver.sql
loading sql script: 24_zorder.sql
loading sql script: 25_debug.sql
loading sql script: 26_sysmon.sql
loading sql script: 39_analytics.sql
loading sql script: 40_geom.sql
loading sql script: 40_json.sql
loading sql script: 41_jsonstore.sql
loading sql script: 45_uuid.sql
loading sql script: 46_gsl.sql
loading sql script: 75_storagemodel.sql
loading sql script: 80_statistics.sql
loading sql script: 80_udf.sql
loading sql script: 85_bam.sql
loading sql script: 90_generator.sql
loading sql script: 99_system.sql
mserver5: ../../MonetDB-11.19.11/gdk/gdk_bat.c:2841: BATassertHeadProps: Assertion `!b->H->key || cmp != 0' failed.

bash-4.2$ mclient
Welcome to mclient, the MonetDB/SQL interactive terminal (unreleased)
Database: MonetDB v11.19.11 (Oct2014-SP3), 'demo'
Type \q to quit, ? for a list of available commands
auto commit mode: on
operation successful (1.617ms)
sql>INSERT INTO t1(e,c,b,d,a) VALUES(103,102,100,101,104);
1 affected row (2.626ms)
sql>INSERT INTO t1(a,c,d,e,b) VALUES(107,106,108,109,105);
1 affected row (6.187ms)
sql>INSERT INTO t1(e,d,b,a,c) VALUES(110,114,112,111,113);
1 affected row (1.226ms)
sql>INSERT INTO t1(d,c,e,a,b) VALUES(116,119,117,115,118);
1 affected row (1.280ms)
sql>SELECT count() FROM t1 AS x;
| L1 |
| 4 |
1 tuple (1.231ms)
sql>SELECT count(
) FROM t1 AS x WHERE x.c;

Expected Results:

no assertion failure.

Also reproducable on default branch version

Comment 20852

Date: 2015-05-07 21:06:54 +0200
From: MonetDB Mercurial Repository <>

Changeset 68f26b54b3d4 made by Sjoerd Mullender in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=68f26b54b3d4

Changeset description:

When converting to Boolean, sortedness and keyness get lost.
This fixes bug #3719.
Also added test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant