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

Mserver receives an assertion error on a procedure call #6479

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

Mserver receives an assertion error on a procedure call #6479

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


Copy link

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

Date: 2017-11-29 13:52:20 +0100
From: @PedroTadim
To: SQL devs <>
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()
    update tmp_aggregate
    set tmp_total = tmp_total + (select sum(val) from sys.stmp10),
    tmp_count = tmp_count + (select count(*) from sys.stmp10);
  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.


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 <>

Changeset 7adffed6a10e made by Pedro Ferreira in the MonetDB repo, refers to this bug.

For complete details, see 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 <>

Changeset 6d0611d709f7 made by Niels Nes in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=6d0611d709f7

Changeset description:

fixed bug #6479, keep subqueries within the procedure context.
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