Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
1.4.3
-
None
-
2020-4, 2020-5
Description
Consider the following sequence from working_tpch/union/union.sql
CREATE TABLE t1 (
cid smallint(5) ,
cv varchar(250)
) engine=columnstore;
INSERT INTO t1 VALUES (8,'dummy');
CREATE TABLE t2 (
cid bigint(20),
cap varchar(255)
) engine=columnstore;
CREATE TABLE t3 (
gid bigint(20) ,
gn varchar(255),
must tinyint(4)
) engine=columnstore;
INSERT INTO t3 VALUES (1,'V1',NULL);
CREATE TABLE t4 (
uid bigint(20),
gid bigint(20),
rid bigint(20),
cid bigint(20)
) engine=columnstore;
INSERT INTO t4 VALUES (1,1,NULL,NULL);
CREATE TABLE t5 (
rid bigint(20),
rl varchar(255)
) engine=columnstore;
CREATE TABLE t6 (
uid bigint(20),
un varchar(250),
uc smallint(5)
) engine=columnstore;
INSERT INTO t6 VALUES (1,'test',8);
SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test";
SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t3.must IS NOT NULL AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test";
(SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t3.must IS NOT NULL AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test") UNION (SELECT t4.uid, t5.rl, t3.gn as g1, t4.cid, t4.gid as gg FROM t3, t6, t1, t4 left join t5 on t5.rid = t4.rid left join t2 on t2.cid = t4.cid WHERE t3.gid=t4.gid AND t6.uid = t4.uid AND t6.uc = t1.cid AND t1.cv = "dummy" AND t6.un = "test");
drop table if exists t1;
drop table if exists t2;
drop table if exists t3;
drop table if exists t4;
drop table if exists t5;
drop table if exists t6;
create table t1 (a int) engine=columnstore;
insert into t1 values (1),(2),(3);
create table t2 (a int) engine=columnstore;
insert into t2 values (3),(4),(5);
SELECT * FROM t1 UNION SELECT * FROM t2 ORDER BY a desc;
ERROR 1815 (HY000): Internal error: IDB-2006: 'tpch1.t6' does not exist in Columnstore.
This only happens if you run the full sequence. Otherwise, there's no complaint about a table not existing – one that isn't in the query at all.
Attachments
Issue Links
- relates to
-
MCOL-3747 Regression in 1.4 working_ssb_compareLogOnly/sub/order_limit_sub
-
- Closed
-
This appears to be a similar problem that sometimes occurs in working_tpch1_comparelogonly.view/view.sql
CREATE TABLE t1 (lid int, name char(10)) engine=columnstore;
INSERT INTO t1 (lid, name) VALUES (1, 'YES'), (2, 'NO');
CREATE TABLE t2 ( id int, gid int, lid int, dt date) engine=columnstore;
INSERT INTO t2 (id, gid, lid, dt) VALUES
(1, 1, 1, '2007-01-01'),(2, 1, 2, '2007-01-02'),
(3, 2, 2, '2007-02-01'),(4, 2, 1, '2007-02-02');
SELECT DISTINCT t2.gid AS lgid,(SELECT t1.name FROM t1, t2 WHERE t1.lid = t2.lid AND t2.gid = t1.lid and t1.lid =1 ) as clid FROM t2 order by 1, 2;
CREATE VIEW v1 AS SELECT DISTINCT t2.gid AS lgid,(SELECT t1.name FROM t1, t2 WHERE t1.lid = t2.lid AND t2.gid = t1.lid and t1.lid =1 ) as clid FROM t2;
SELECT * FROM v1 order by 1, 2;
DROP VIEW v1;
DROP table t1;
drop table t2;
CREATE TABLE t1 (a INT) engine=columnstore;
INSERT INTO t1 VALUES (1),(2),(3);
CREATE VIEW v1 AS SELECT a FROM t1 ORDER BY a;
SELECT * FROM t1 UNION SELECT * FROM v1;
ERROR 1815 (HY000) at line 896: Internal error: IDB-2006: 'tpch1.t2' does not exist in Columnstore.