You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Date: 2012-02-21 11:36:30 +0100
From: George Garbis <>
To: SQL devs <>
Version: -- development
CC: charnik, ggarbis, @drstmane
Last updated: 2012-02-29 10:34:23 +0100
Comment 16964
Date: 2012-02-21 11:36:30 +0100
From: George Garbis <>
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build Identifier: 03600f3e6c1b tip
A query with INNER JOIN between a table and a subquery produces mal errors. These errors concern datatypes of subquery columns.
Reproducible: Always
Steps to Reproduce:
Create tables and insert values
CREATE TABLE table1 (a INTEGER);
CREATE TABLE table2 (a INTEGER, b INTEGER);
INSERT INTO table1 VALUES(1);
INSERT INTO table1 VALUES(2);
INSERT INTO table2 VALUES(2, 2);
Pose the problematic query
SELECT * FROM (SELECT a, 2 AS b FROM table1) t1 INNER JOIN table2 t2 ON (t1.b = t2.b);
+------+------+------+----+
| a | b | a | b |
+======+======+======+====+
| 2 | 2 | 2 | 2 |
| 1 | 2 | 2 | 2 |
+------+------+------+----+
If a user creates a table with the results of the aforementioned query and pose the same query with the new table instead of the subquery, then query executes flawlessly and expected results are returned.
CREATE TABLE table3 (a INTEGER, b INTEGER);
INSERT INTO table3(a,b) (SELECT a, 2 AS b FROM table1);
SELECT * FROM (SELECT a, b FROM table3) t1 INNER JOIN table2 t2 ON (t1.b = t2.b);
Date: 2012-02-21 11:36:30 +0100
From: George Garbis <>
To: SQL devs <>
Version: -- development
CC: charnik, ggarbis, @drstmane
Last updated: 2012-02-29 10:34:23 +0100
Comment 16964
Date: 2012-02-21 11:36:30 +0100
From: George Garbis <>
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Build Identifier: 03600f3e6c1b tip
A query with INNER JOIN between a table and a subquery produces mal errors. These errors concern datatypes of subquery columns.
Reproducible: Always
Steps to Reproduce:
Create tables and insert values
CREATE TABLE table1 (a INTEGER);
CREATE TABLE table2 (a INTEGER, b INTEGER);
INSERT INTO table1 VALUES(1);
INSERT INTO table1 VALUES(2);
INSERT INTO table2 VALUES(2, 2);
Pose the problematic query
SELECT * FROM (SELECT a, 2 AS b FROM table1) t1 INNER JOIN table2 t2 ON (t1.b = t2.b);
Actual Results:
Expected Results:
+------+------+------+----+
| a | b | a | b |
+======+======+======+====+
| 2 | 2 | 2 | 2 |
| 1 | 2 | 2 | 2 |
+------+------+------+----+
If a user creates a table with the results of the aforementioned query and pose the same query with the new table instead of the subquery, then query executes flawlessly and expected results are returned.
CREATE TABLE table3 (a INTEGER, b INTEGER);
INSERT INTO table3(a,b) (SELECT a, 2 AS b FROM table1);
SELECT * FROM (SELECT a, b FROM table3) t1 INNER JOIN table2 t2 ON (t1.b = t2.b);
Comment 16974
Date: 2012-02-22 23:53:06 +0100
From: @drstmane
IMHO the problem is not the inner join, but an incorrect treatment of the constant "2 AS b" column of the sub query.
In any case, it is a bug.
Comment 16980
Date: 2012-02-23 14:44:25 +0100
From: @njnes
Changeset 86d94f21e92c 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=86d94f21e92c
Changeset description:
The text was updated successfully, but these errors were encountered: