You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "Cindyxin228 (via GitHub)" <gi...@apache.org> on 2023/07/20 16:06:04 UTC
[GitHub] [shardingsphere] Cindyxin228 opened a new issue, #27341: There's maybe a bug in "left join".
Cindyxin228 opened a new issue, #27341:
URL: https://github.com/apache/shardingsphere/issues/27341
# There's something wrong with "left join"
When I tried to use "left join", I found that the actual result repeated every expected reult. Here's the more specific explanation.
I execute the following sql statements in mariaDB and in sharding_db, the virtual database processed through shardingsphere-proxy.
```
DROP TABLE IF EXISTS students,
student_skill;
create table students
(
st_id varchar(20),
name varchar(10),
age INT(2),
tol_score INT(3)
);
insert into students values('973231','wangbindu',22,501);
insert into students values('973232','zhuzhijing',21,538);
insert into students values('973233','gaojing',21,576);
create table student_skill
(
st_id varchar(20),
skill varchar(20)
);
insert into student_skill values('973231','basketball');
insert into student_skill(st_id) values('973232');
insert into student_skill values('973233','football');
SELECT s.*, IFNULL(ss.skill, '') AS skill
FROM students s
LEFT JOIN student_skill ss ON s.st_id = ss.st_id
order by s.tol_score;
```
And the result in mariaDB is as follows.
```
+--------+------------+------+-----------+------------+
| st_id | name | age | tol_score | skill |
+--------+------------+------+-----------+------------+
| 973231 | wangbindu | 22 | 501 | basketball |
| 973232 | zhuzhijing | 21 | 538 | |
| 973233 | gaojing | 21 | 576 | football |
+--------+------------+------+-----------+------------+
```
The result in sharding_db is as follows.
```
+--------+------------+------+-----------+------------+
| st_id | name | age | tol_score | skill |
+--------+------------+------+-----------+------------+
| 973231 | wangbindu | 22 | 501 | |
| 973231 | wangbindu | 22 | 501 | basketball |
| 973232 | zhuzhijing | 21 | 538 | |
| 973232 | zhuzhijing | 21 | 538 | |
| 973233 | gaojing | 21 | 576 | football |
| 973233 | gaojing | 21 | 576 | |
+--------+------------+------+-----------+------------+
```
The result in mariaDB is correct, and we can see the results repeat in sharding_db. Therefore, I think there's maybe a bug here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] Cindyxin228 commented on issue #27341: There's maybe a bug in "left join".
Posted by "Cindyxin228 (via GitHub)" <gi...@apache.org>.
Cindyxin228 commented on issue #27341:
URL: https://github.com/apache/shardingsphere/issues/27341#issuecomment-1647077053
>
My ShardingSphere-proxy version is apache-shardingsphere-5.0.0-alpha-shardingsphere-proxy-bin.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] There's maybe a bug in "left join". [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on issue #27341:
URL: https://github.com/apache/shardingsphere/issues/27341#issuecomment-2212468898
The version is out of service, please try new version.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] github-actions[bot] commented on issue #27341: There's maybe a bug in "left join".
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #27341:
URL: https://github.com/apache/shardingsphere/issues/27341#issuecomment-1690563753
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] zhaojinchao95 commented on issue #27341: There's maybe a bug in "left join".
Posted by "zhaojinchao95 (via GitHub)" <gi...@apache.org>.
zhaojinchao95 commented on issue #27341:
URL: https://github.com/apache/shardingsphere/issues/27341#issuecomment-1646516841
Which your ShardingSphere version?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] There's maybe a bug in "left join". [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #27341: There's maybe a bug in "left join".
URL: https://github.com/apache/shardingsphere/issues/27341
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org