peilinqian opened a new issue, #22355:
URL: https://github.com/apache/shardingsphere/issues/22355

   ### Which version of ShardingSphere did you use?
   we find java version: java8, full_version=1.8.0_342, 
full_path=/home/peilq_sharding/bisheng-jdk1.8.0_342//bin/java
   ShardingSphere-5.2.2-SNAPSHOT
   Commit ID: dirty-753c0cee8ee6fd3db00536da55b64bc5198a3758
   Commit Message: Optimize sqlFederationExecutor init logic when 
sqlFederationType modify dynamically (#22209)
   Branch: 753c0cee8ee6fd3db00536da55b64bc5198a3758
   Build time: 2022-11-19T10:18:41+0800
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   The select result of ‘join with USING(column)’  is correct;
   ### Actual behavior
   The select result of ‘join with USING(column)’  exists problem;The column 
name and value doesn't match.
   
   ### Reason analyze (If you can)
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   ```
   DROP TABLE IF EXISTS t_order; 
   DROP TABLE IF EXISTS t_order_item; 
   CREATE TABLE t_order (order_id INT PRIMARY KEY, user_id INT NOT NULL, status 
VARCHAR(50) NOT NULL, merchant_id INT NOT NULL, remark VARCHAR(50) NOT NULL, 
creation_date DATE NOT NULL);
   CREATE TABLE t_order_item (item_id INT PRIMARY KEY, order_id INT NOT NULL, 
user_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, 
creation_date DATE NOT NULL);
   INSERT INTO t_order VALUES(1000, 10, 'init', 1, 'test', '2017-07-08');
   INSERT INTO t_order VALUES(1001, 10, 'init', 2, 'test', '2017-07-08');
   INSERT INTO t_order VALUES(2000, 20, 'init', 3, 'test', '2017-08-08');
   INSERT INTO t_order VALUES(2001, 20, 'init', 4, 'test', '2017-08-08');
   INSERT INTO t_order_item VALUES(100001, 1000, 10, 1, 1, '2017-07-08');
   INSERT INTO t_order_item VALUES(100002, 1000, 10, 1, 1, '2017-07-08');
   INSERT INTO t_order_item VALUES(100101, 1001, 10, 2, 1, '2017-07-08');
   INSERT INTO t_order_item VALUES(100102, 1001, 10, 2, 1, '2017-07-08');
   
   SELECT * FROM t_order o RIGHT JOIN t_order_item i using(order_id) WHERE 
o.user_id = 10 ORDER BY o.order_id, 7;
   ```
   
   **The result of sharding-proxy**
   ```
   test_db=> SELECT * FROM t_order o RIGHT JOIN t_order_item i using(order_id) 
WHERE o.user_id = 10 ORDER BY o.order_id, 7;
    order_id | user_id | status | merchant_id | remark |     creation_date     
| item_id | order_id | user_id | product_id |       quantity
   
----------+---------+--------+-------------+--------+-----------------------+---------+----------+---------+------------+-----------------------
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 
|  100001 |       10 |       1 |          1 | 2017-07-08 00:00:00.0
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 
|  100002 |       10 |       1 |          1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 
|  100101 |       10 |       2 |          1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 
|  100102 |       10 |       2 |          1 | 2017-07-08 00:00:00.0
   (4 rows)
   ```
   
   **The result of opengauss**
   ```
   tpccdb=# SELECT * FROM t_order o RIGHT JOIN t_order_item i using(order_id) 
WHERE o.user_id = 10 ORDER BY o.order_id, 7;
    order_id | user_id | status | merchant_id | remark |    creation_date    | 
item_id | user_id | product_id | quantity |    creation_date
   
----------+---------+--------+-------------+--------+---------------------+---------+---------+------------+----------+---------------------
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00 |  
100001 |      10 |          1 |        1 | 2017-07-08 00:00:00
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00 |  
100002 |      10 |          1 |        1 | 2017-07-08 00:00:00
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00 |  
100101 |      10 |          2 |        1 | 2017-07-08 00:00:00
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00 |  
100102 |      10 |          2 |        1 | 2017-07-08 00:00:00
   (4 rows)
   ```
   
   ### Example codes for reproduce this issue (such as a github link).
   
   
   


-- 
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: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to