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

Type resolution error #3622

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

Type resolution error #3622

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

Comments

@monetdb-team
Copy link

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

Date: 2014-11-20 07:27:30 +0100
From: @mlkersten
To: SQL devs <>
Version: 11.17.13 (Jan2014-SP1)
CC: @njnes

Last updated: 2015-04-22 22:37:57 +0200

Comment 20447

Date: 2014-11-20 07:27:30 +0100
From: @mlkersten

User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0
Build Identifier:

An erroneous type downcast is triggered in the query below on the columns in the range join.
File added to the test suite.

A bypass is to properly cast the generate_series arguments to integer.

Reproducible: Always

Steps to Reproduce:

CREATE FUNCTION seq_char(val integer, seq string, pos integer, cigar string)
RETURNS INTEGER
BEGIN
RETURN 1;
END;

CREATE TABLE "bam"."alignments_2" (
"virtual_offset" BIGINT NOT NULL,
"qname" CHARACTER LARGE OBJECT NOT NULL,
"flag" SMALLINT NOT NULL,
"rname" CHARACTER LARGE OBJECT NOT NULL,
"pos" INTEGER NOT NULL,
"epos" INTEGER NOT NULL,
"mapq" SMALLINT NOT NULL,
"cigar" CHARACTER LARGE OBJECT NOT NULL,
"rnext" CHARACTER LARGE OBJECT NOT NULL,
"pnext" INTEGER NOT NULL,
"tlen" INTEGER NOT NULL,
"seq" CHARACTER LARGE OBJECT NOT NULL,
"qual" CHARACTER LARGE OBJECT NOT NULL,
CONSTRAINT "alignments_2_pkey_virtual_offset" PRIMARY KEY ("virtual_offset")
);
ALTER TABLE bam.alignments_2 SET READ ONLY;

EXPLAIN SELECT s.value AS refpos, COUNT(*) AS cnt
FROM
generate_series(128, 18960) AS s
JOIN (
SELECT epos, pos, seq, cigar
FROM bam.alignments_2
WHERE pos > 0
) AS al
ON (
s.value >= al.pos AND s.value <= al."epos"
AND seq_char(s.value, al.seq, al.pos, al.cigar) IS NOT NULL
)
GROUP BY refpos
ORDER BY cnt DESC
LIMIT 10;

DROP TABLE bam.alignments_2;
DROP FUNCTION seq_char;

Comment 20448

Date: 2014-11-20 07:31:18 +0100
From: MonetDB Mercurial Repository <>

Changeset f80d7e960167 made by Martin Kersten mk@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

Added a type-cast error bug #3622

Comment 20509

Date: 2014-12-03 13:33:58 +0100
From: @njnes

fixed by the correction done for bug #3633

Comment 20510

Date: 2014-12-03 13:41:21 +0100
From: MonetDB Mercurial Repository <>

Changeset 1837da979e2f made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

added test for bug #3622

Comment 20606

Date: 2015-01-29 14:07:39 +0100
From: @sjoerdmullender

Oct2014-SP2 has been released.

Comment 20833

Date: 2015-04-22 22:37:57 +0200
From: MonetDB Mercurial Repository <>

Changeset 5bb9e125f99c made by Stefan Manegold Stefan.Manegold@cwi.nl in the MonetDB repo, refers to this bug.

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

Changeset description:

make test typecast_error.Bug-3622 work also without SAMTOOLS / BAM support,

i.e., without schema "bam" existing
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