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

select a string column from a view over a table with primary key crashes #2673

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

Comments

@monetdb-team
Copy link

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

Date: 2010-09-21 14:49:54 +0200
From: @romulogoncalves
To: SQL devs <>
Version: 2.40.1 (Oct2010) [obsolete]
CC: @njnes

Last updated: 2011-03-28 17:31:25 +0200

Comment 14921

Date: 2010-09-21 14:49:54 +0200
From: @romulogoncalves

User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.1.12) Gecko/20100907 Fedora/3.5.12-1.fc12 Firefox/3.5.12
Build Identifier:

The following sql statements crash mserver:
CREATE TABLE t1 (name varchar(128) NOT NULL, field varchar(128) NOT NULL,
CONSTRAINT pk_t1_field_name PRIMARY KEY
(
field ,
name
)
);
CREATE VIEW v1 AS SELECT name FROM t1 WHERE field='SpecLineNames';
SELECT
v1.name
FROM
v1
WHERE
v1.name <> 'UNKNOWN'
and v1.name = 'Hb_4863'
;

DROP VIEW v1;
DROP TABLE t1;

Note: The crash only happens if the primary key is created and if both statements in where clause are used.

Reproducible: Always

Actual Results:

mserver crashes

Expected Results:

empty selection result

[New Thread 0x7fffdf9c2710 (LWP 1035)]
mserver5: /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1698: rel2bin_hash_lookup: Assertion `e->type == e_cmp && e->flag == cmp_equal' failed.

Program received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffdf9c2710 (LWP 1035)]
0x000000399e8326c5 in raise () from /lib64/libc.so.6
(gdb) up
1 0x000000399e833ea5 in abort () from /lib64/libc.so.6
(gdb)
2 0x000000399e82b7b5 in __assert_fail () from /lib64/libc.so.6
(gdb)
3 0x00007fffe00b9b8c in rel2bin_hash_lookup (sql=0x7fffd0005468,
rel=0x7fffd049f118, sub=0x7fffd049fd88, i=0x7fffd03ecf28,
en=0x7fffd04a1378)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1698
1698 assert(e->type == e_cmp && e->flag == cmp_equal);
(gdb)
4 0x00007fffe00b9eca in rel2bin_select (sql=0x7fffd0005468,
rel=0x7fffd049f118, refs=0x7fffd049f7c8)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1760
1760 sel = rel2bin_hash_lookup(sql, rel, sub, i, en);
(gdb) bt
0 0x000000399e8326c5 in raise () from /lib64/libc.so.6
1 0x000000399e833ea5 in abort () from /lib64/libc.so.6
2 0x000000399e82b7b5 in __assert_fail () from /lib64/libc.so.6
3 0x00007fffe00b9b8c in rel2bin_hash_lookup (sql=0x7fffd0005468,
rel=0x7fffd049f118, sub=0x7fffd049fd88, i=0x7fffd03ecf28,
en=0x7fffd04a1378)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1698
4 0x00007fffe00b9eca in rel2bin_select (sql=0x7fffd0005468,
rel=0x7fffd049f118, refs=0x7fffd049f7c8)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1760
5 0x00007fffe00c1f1d in subrel_bin (sql=0x7fffd0005468, rel=0x7fffd049f118,
refs=0x7fffd049f7c8)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:3835
6 0x00007fffe00b92d7 in rel2bin_project (sql=0x7fffd0005468,
rel=0x7fffd044bb18, refs=0x7fffd049f7c8, topn=0x0)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:1556
7 0x00007fffe00c1eef in subrel_bin (sql=0x7fffd0005468, rel=0x7fffd044bb18,
refs=0x7fffd049f7c8)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:3831
8 0x00007fffe00c21be in output_rel_bin (sql=0x7fffd0005468,
rel=0x7fffd044bb18)
at /ufs/goncalve/MonetDB/stable/sql/src/server/rel_bin.mx:3896
9 0x00007fffdffebd5f in sql_symbol2stmt (c=0x7fffd0005468,
---Type to continue, or q to quit---
sym=0x7fffd0007fb8)
at /ufs/goncalve/MonetDB/stable/sql/src/backends/monet5/sql.mx:1394
10 0x00007fffe00393fb in SQLparser (c=0x605b38)
at /ufs/goncalve/MonetDB/stable/sql/src/backends/monet5/sql_scenario.mx:1285
11 0x00007ffff7d23a62 in runPhase (c=0x605b38, phase=1)
at /ufs/goncalve/MonetDB/stable/MonetDB5/src/mal/mal_scenario.mx:604
12 0x00007ffff7d23b9a in runScenarioBody (c=0x605b38)
at /ufs/goncalve/MonetDB/stable/MonetDB5/src/mal/mal_scenario.mx:646
13 0x00007ffff7d23e21 in runScenario (c=0x605b38)
at /ufs/goncalve/MonetDB/stable/MonetDB5/src/mal/mal_scenario.mx:682
14 0x00007ffff7cd7017 in MSserveClient (dummy=0x605b38)
at /ufs/goncalve/MonetDB/stable/MonetDB5/src/mal/mal_session.mx:473
15 0x000000399f406a3a in start_thread () from /lib64/libpthread.so.0
16 0x000000399e8de77d in clone () from /lib64/libc.so.6
17 0x0000000000000000 in ?? ()
(gdb)

Comment 14980

Date: 2010-10-05 17:27:12 +0200
From: @sjoerdmullender

Changeset 35cf18ead3b5 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=35cf18ead3b5

Changeset description:

Add test for bug #2673.

Comment 15617

Date: 2011-03-28 17:31:25 +0200
From: @sjoerdmullender

The Mar2011 version has been released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant