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

explain result error #2042

Closed
FlyingMao opened this issue Aug 14, 2020 · 2 comments
Closed

explain result error #2042

FlyingMao opened this issue Aug 14, 2020 · 2 comments
Assignees
Labels
autotest-added the case has append to autotest from outside resolve problem has been fixed by developer sql-coverage
Milestone

Comments

@FlyingMao
Copy link

FlyingMao commented Aug 14, 2020

  • dble version:
    dble-2.20.04.0-7b5f749b8fbea5443c6e21cb520b2c2afbafa48d-20200519034453
  • preconditions :
CREATE TABLE `o_dept` (
  `DEPT_NO` varchar(16) NOT NULL,
  `ORG_NO` varchar(16) NOT NULL,
  `NAME` varchar(256) DEFAULT NULL,
  PRIMARY KEY (`DEPT_NO`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `o_org` (
  `ORG_NO` varchar(16) NOT NULL,
  `ORG_NAME` varchar(256) DEFAULT NULL,
  `P_ORG_NO` varchar(16) DEFAULT NULL,
  PRIMARY KEY (`ORG_NO`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `p_sys_user` (
  `SYS_USER_NAME` varchar(30) NOT NULL,
  `DEPT_NO` varchar(16) DEFAULT NULL,
  `ORG_NO` varchar(16) NOT NULL,
  `USER_NAME` varchar(64) DEFAULT NULL,
  `PWD` varchar(256) NOT NULL,
  `CUR_STATUS_CODE` varchar(8) DEFAULT NULL,
  `ADMIN_FLAG` decimal(3,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  • configs:

schema.xml

<table name="o_dept" dataNode="dn1" />
 <table name="p_sys_user" dataNode="dn1"/>
<table name="o_org" dataNode="dn1,dn2" type="global"/>

rule.xml



server.xml



  • steps:
    step1.
explain SELECT
	a.sys_user_name AS sysUserName,
	d.org_no AS orgNo,
	d.org_name AS orgName,
	c.dept_no AS deptNo,
	c. NAME AS deptName,
	a.user_name AS userName,
	a.cur_status_code AS curStatusCode,
	a.admin_flag AS adminFlag
FROM
	p_sys_user a
LEFT JOIN o_dept c ON a.dept_no = c.dept_no,
 o_org d
WHERE
	a.org_no = d.org_no
AND a.org_no IN (SELECT org_no FROM o_org)
AND (
	a.cur_status_code IS NULL
	OR a.cur_status_code <> '03'
)
  • expect result:
    1.
| DATA_NODE | TYPE     | SQL/REF                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
+-----------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| dn1_0     | BASE SQL | select `a`.`sys_user_name` as `sysUserName`,`d`.`org_no` as `orgNo`,`d`.`org_name` as `orgName`,`c`.`dept_no`s `userName`,`a`.`cur_status_code` as `curStatusCode`,`a`.`admin_flag` as `adminFlag` from  (  (  `p_sys_user` `a` left join  `o_dept``d` )  join (select  distinct `o_org`.`org_no` as `autoalias_scalar` from  `o_org`) autoalias_o_org where `a`.`org_no` = `d`.`org_no`  and (a.cur_status_code IS NULL OR `a`.`cur_status_code` <> '03') |
| merge_1   | MERGE    | dn1_0       ****
  • real result:
    1.
| DATA_NODE | TYPE     | SQL/REF                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
+-----------+----------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| dn1_0     | BASE SQL | select `a`.`sys_user_name` as `sysUserName`,`d`.`org_no` as `orgNo`,`d`.`org_name` as `orgName`,`c`.`dept_no`s `userName`,`a`.`cur_status_code` as `curStatusCode`,`a`.`admin_flag` as `adminFlag` from  (  (  `p_sys_user` `a` left join  `o_dept``d` )  join (select  distinct `o_org`.`org_no` as `autoalias_scalar` from  `o_org`) autoalias_o_org where `a`.`org_no` = `d`.`org_no`  and (a.cur_status_code IS NULL) OR (`a`.`cur_status_code` <> '03') |
| merge_1   | MERGE    | dn1_0                                           
  • supplements:
    1.
@yanhuqing666 yanhuqing666 assigned ylinzhu and unassigned yanhuqing666 Oct 19, 2020
@yanhuqing666 yanhuqing666 added this to the 3.20.10.0 milestone Nov 3, 2020
@yanhuqing666 yanhuqing666 assigned wjl1619 and unassigned ylinzhu Nov 5, 2020
@yanhuqing666 yanhuqing666 added the resolve problem has been fixed by developer label Nov 5, 2020
@yanhuqing666
Copy link
Member

now fix only in 2.20.04.99

@wjl1619 wjl1619 added the autotest-wait issue waits to be added to autotest label Nov 12, 2020
@wjl1619 wjl1619 assigned quexiuping and unassigned wjl1619 Nov 12, 2020
@wjl1619
Copy link
Member

wjl1619 commented Nov 12, 2020

verified on version: 5.7.21-dble-9.9.9.9-60d726b625c288e1d5715d41c90fbab06ab758ce-20201111094506

@quexiuping quexiuping added autotest-added the case has append to autotest and removed autotest-wait issue waits to be added to autotest labels Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autotest-added the case has append to autotest from outside resolve problem has been fixed by developer sql-coverage
Projects
None yet
Development

No branches or pull requests

5 participants