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

gdk_calc.c:13113: BATcalcifthenelse_intern: Assertion `col2 != NULL' failed. #6075

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working GDK Kernel normal

Comments

@monetdb-team
Copy link

Date: 2016-10-13 13:14:14 +0200
From: Bo Tang <>
To: GDK devs <>
Version: 11.23.13 (Jun2016-SP2)
CC: @drstmane

Last updated: 2016-12-21 13:06:59 +0100

Comment 24504

Date: 2016-10-13 13:14:14 +0200
From: Bo Tang <>

User-Agent: Mozilla/5.0 (X11; Fedora; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36
Build Identifier:

sqlsmith triggered the following assertion:

gdk_calc.c:13113: BATcalcifthenelse_intern: Assertion `col2 != NULL' failed.

query details:

select
ref_17.progress as c0,
cast(coalesce(ref_17.tag,
ref_17.tag) as oid) as c1
from
sys.queue as ref_17
where false
limit 156;
select
(select event from sys.triggers limit 1 offset 5)
as c0,
ref_101.function_id as c1,
ref_89.s_nationkey as c2,
45 as c3,
(select value from sys.environment limit 1 offset 2)
as c4,
4 as c5,
ref_89.s_suppkey as c6,
cast(coalesce(ref_90.writes,
ref_90.majflt) as bigint) as c7,
ref_96.ps_availqty as c8,
(select id from tmp._tables limit 1 offset 1)
as c9,
ref_86.r_regionkey as c10,
ref_90.thread as c11,
(select table_id from tmp.keys limit 1 offset 4)
as c12,
ref_91.id as c13,
3 as c14,
6 as c15,
ref_90.event as c16,
(select table_id from sys.idxs limit 1 offset 2)
as c17,
(select commit_action from sys.tables limit 1 offset 5)
as c18,
cast(coalesce(ref_99.type_scale,
40) as int) as c19,
72 as c20,
ref_101.function_id as c21,
(select active from sys.sessions limit 1 offset 2)
as c22,
cast(coalesce((select typewidth from sys.storagemodelinput limit 1 offset 1)
,
ref_99.type_digits) as int) as c23,
ref_98.f_table_schema as c24,
ref_89.s_address as c25,
(select id from sys._tables limit 1 offset 5)
as c26,
(select l_returnflag from sys.lineitem limit 1 offset 4)
as c27
from
sys.region as ref_86
right join bam.sq as ref_87
inner join sys.keywords as ref_88
inner join sys.supplier as ref_89
left join sys.tracelog as ref_90
on (ref_89.s_nationkey = ref_90.event )
on (ref_88.keyword = ref_90.clk )
on (ref_87.ur = ref_90.stmt )
on (ref_86.r_regionkey = ref_87.ln )
inner join sys.objects as ref_91
inner join sys.partsupp as ref_96
inner join sys.keys as ref_97
inner join sys.geometry_columns as ref_98
on (ref_97.rkey = ref_98.srid )
on (ref_96.ps_partkey = ref_97.id )
on (ref_91.nr = ref_96.ps_partkey )
on (ref_90.clk = ref_98.f_table_schema )
inner join tmp._columns as ref_99
on (ref_97.rkey = ref_99.id )
inner join sys.systemfunctions as ref_101
on (ref_86.r_regionkey = ref_101.function_id )
where true
limit 39;

Reproducible: Always

Steps to Reproduce:

  1. start mserver5 with database "tpch-1" (i.e., tpch dataset with scale factor 1)
  2. run the above query

Actual Results:

mserver5 aborted

Comment 24509

Date: 2016-10-13 13:44:58 +0200
From: Bo Tang <>

Created attachment 478
a more simple query for this bug

Attached file: bug-1.sql (application/sql, 224 bytes)
Description: a more simple query for this bug

Comment 24518

Date: 2016-10-17 14:32:27 +0200
From: @drstmane

Already the first query

select
ref_17.progress as c0,
cast(coalesce(ref_17.tag,
ref_17.tag) as oid) as c1
from
sys.queue as ref_17
where false
limit 156;

triggers the assertion on an empty virgin database.

Comment 24519

Date: 2016-10-17 14:36:00 +0200
From: @drstmane

The second query triggers a syntax error:

syntax error, unexpected LIMIT, expecting UNION or EXCEPT or INTERSECT or ')' in: "select
(select event from sys.triggers limit"

Comment 24521

Date: 2016-10-17 14:41:49 +0200
From: @drstmane

The syntax error is "correct" by MonetDB standards: "limit" (and "offset"?) are not allowed in subqueries.

Comment 24525

Date: 2016-10-17 16:08:55 +0200
From: MonetDB Mercurial Repository <>

Changeset 0f67d09dfca6 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Provide missing implementation for batcalc.ifthenelse for void columns.

This fixes bug #6075.

Comment 24526

Date: 2016-10-17 16:09:12 +0200
From: MonetDB Mercurial Repository <>

Changeset 65b10dd14c09 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

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

Changeset description:

Added test for bug #6075.

Comment 24527

Date: 2016-10-17 17:05:23 +0200
From: @sjoerdmullender

The assertion has been fixed. The syntax errors won't be.

@monetdb-team monetdb-team added bug Something isn't working GDK Kernel normal labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GDK Kernel normal
Projects
None yet
Development

No branches or pull requests

2 participants