Skip to content

return error result when executing "select count(*) from ...where not ( ...in subquery)" #742

@yexiaoli88

Description

@yexiaoli88
  • dble version:5.6.29-dble-9.9.9.9-153cf8b-20180928075325
  • preconditions :
create table global_table2(id int(11),C_NAME varchar(20),C_NATIONKEY varchar(20),C_ORDERKEY varchar(20),C_CUSTKEY varchar(20) primary key);
insert into global_table2 (id,C_NAME,C_NATIONKEY,C_ORDERKEY,C_CUSTKEY) values (1,'chenxiao','NATIONKEY_001','ORDERKEY_001','CUSTKEY_003'),(3,'wangye','NATIONKEY_001','ORDERKEY_004','CUSTKEY_111'),(2,'xiaojuan','NATIONKEY_001','ORDERKEY_005','CUSTKEY_132'),(4,'chenqi','NATIONKEY_051','ORDERKEY_010','CUSTKEY_333'),(5,'marui','NATIONKEY_002','ORDERKEY_011','CUSTKEY_012'),(8,'huachen','NATIONKEY_002','ORDERKEY_007','CUSTKEY_980'),(7,'yanglu','NATIONKEY_132','ORDERKEY_006','CUSTKEY_420');

create table global_table1 (id int(11),O_ORDERKEY varchar(20) primary key,O_CUSTKEY varchar(20),O_TOTALPRICE int(20),MYDATE date);
insert into global_table1 (id,O_ORDERKEY,O_CUSTKEY,O_TOTALPRICE,MYDATE) values (1,'ORDERKEY_001','CUSTKEY_003',200000,'20141022'),(2,'ORDERKEY_002','CUSTKEY_003',100000,'19920501'),(4,'ORDERKEY_004','CUSTKEY_111',500,'20080105'),(5,'ORDERKEY_005','CUSTKEY_132',100,'19920628'),(10,'ORDERKEY_010','CUSTKEY_333',88888888,'19920720'),(11,'ORDERKEY_011','CUSTKEY_012',323456,'19920822'),(7,'ORDERKEY_007','CUSTKEY_980',12000,'19920910'),(6,'ORDERKEY_006','CUSTKEY_420',231,'19921111');
  • configs:

schema.xml

		<table name="global_table1" primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4" />
		<table name="global_table2" primaryKey="id" type="global" dataNode="dn1,dn2,dn3,dn4" />

  • steps:
    step1. query in dble
mysql> select count(*) from global_table1 as a where not (a.id in(select id from global_table2 where C_ORDERKEY in(1,2)));
+----------+
| COUNT(*) |
+----------+
|        0 |
+----------+
1 row in set (0.20 sec)

step2 query in mysql

mysql>  select count(*) from global_table1 as a where not (a.id in(select id from global_table2 where C_ORDERKEY in(1,2)));
+----------+
| count(*) |
+----------+
|        8 |
+----------+
1 row in set, 7 warnings (0.00 sec)

  • expect result:
    query result from dble should be the same as result from mysql

/label ~BUG

Metadata

Metadata

Assignees

Labels

from auto_testresolveproblem has been fixed by developerverifiedissue's resolve was verified by tester

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions