Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3828

UNION: complains about table not in query

    XMLWordPrintable

    Details

      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

            Activity

              People

              Assignee:
              dleeyh Daniel Lee
              Reporter:
              David.Hall David Hall
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: