You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/11/23 07:38:47 UTC

[GitHub] [shardingsphere] peilinqian opened a new issue, #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

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: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324811096

   According to MySQL document, when the user uses using , duplicate associated columns are also removed.
   
   ```
   Redundant columns of a NATURAL join do not appear. Consider this set of statements:
   
   CREATE TABLE t1 (i INT, j INT);
   CREATE TABLE t2 (k INT, j INT);
   INSERT INTO t1 VALUES(1, 1);
   INSERT INTO t2 VALUES(1, 1);
   SELECT * FROM t1 NATURAL JOIN t2;
   SELECT * FROM t1 JOIN t2 USING (j);
   In the first [SELECT](https://dev.mysql.com/doc/refman/8.0/en/select.html) statement, column j appears in both tables and thus becomes a join column, so, according to standard SQL, it should appear only once in the output, not twice. Similarly, in the second SELECT statement, column j is named in the USING clause and should appear only once in the output, not twice.
   
   Thus, the statements produce this output:
   
   +------+------+------+
   | j    | i    | k    |
   +------+------+------+
   |    1 |    1 |    1 |
   +------+------+------+
   +------+------+------+
   | j    | i    | k    |
   +------+------+------+
   |    1 |    1 |    1 |
   +------+------+------+
   ```


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1325011622

   Following is the new result when I execute `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;` statement with openGauss.
   
   ![4d9c3c48-b00d-45d2-9d49-f1674a301aeb](https://user-images.githubusercontent.com/10829171/203551536-3153f4cd-f5f5-4166-a391-634b56d8662a.jpeg)
   


-- 
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] taojintianxia closed issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
taojintianxia closed issue #22355: The select result of ‘join with USING(column)’  exists problem;The column name and value doesn't match.
URL: https://github.com/apache/shardingsphere/issues/22355


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1326021038

   According to SQLServer document——https://learn.microsoft.com/en-us/sql/t-sql/queries/from-transact-sql?view=sql-server-ver16, it doesn't seem to support the using syntax. 


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324668257

   Besides, can you provide your sharding configuration?


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1326025753

   According to oracle document——https://docs.oracle.com/javadb/10.6.2.1/ref/rrefsqljusing.html, when a USING clause is specified, an asterisk (*) in the select list of the query will be expanded to the following list of columns (in this order):
   
   - All the columns in the USING clause
   - All the columns of the first (left) table that are not specified in the USING clause
   - All the columns of the second (right) table that are not specified in the USING clause
   
   An asterisk qualified by a table name (for example, COUNTRIES.*) will be expanded to every column of that table that is not listed in the USING clause.


-- 
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] wsm12138 commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
wsm12138 commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1328860365

   32cfedba769e156e4109d6bfa2f07a6c9d30edbe
   
   <img width="1281" alt="image" src="https://user-images.githubusercontent.com/86462784/204256714-506bc16a-434f-4132-9592-b27fbf6c1457.png">
   


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324689167

   This looks like a kernel bug, I will check it together.


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324676875

   server.yaml
   
   ```yaml
   mode:
     type: Cluster
     repository:
       type: ZooKeeper
       props:
         namespace: governance_ds
         server-lists: localhost:2181
         retryIntervalMilliseconds: 500
         timeToLiveSeconds: 60
         maxRetries: 3
         operationTimeoutMilliseconds: 500
   
   rules:
   - !AUTHORITY
     users:
       - root@%:root
       - sharding@:sharding
     provider:
       type: ALL_PERMITTED
   - !TRANSACTION
     defaultType: XA
     providerType: Atomikos
   - !SQL_PARSER
     sqlCommentParseEnabled: true
     sqlStatementCache:
       initialCapacity: 2000
       maximumSize: 65535
     parseTreeCache:
       initialCapacity: 128
       maximumSize: 1024
   
   props:
     max-connections-size-per-query: 1
     kernel-executor-size: 16  # Infinite by default.
     proxy-frontend-flush-threshold: 128  # The default value is 128.
     proxy-hint-enabled: false
     sql-show: true
     check-table-metadata-enabled: false
       # Proxy backend query fetch size. A larger value may increase the memory usage of ShardingSphere Proxy.
       # The default value is -1, which means set the minimum value for different JDBC drivers.
     proxy-backend-query-fetch-size: -1
     proxy-frontend-executor-size: 0 # Proxy frontend executor size. The default value is 0, which means let Netty decide.
       # Available options of proxy backend executor suitable: OLAP(default), OLTP. The OLTP option may reduce time cost of writing packets to client, but it may increase the latency of SQL execution
       # and block other clients if client connections are more than `proxy-frontend-executor-size`, especially executing slow SQL.
     proxy-backend-executor-suitable: OLAP
     proxy-frontend-max-connections: 0 # Less than or equal to 0 means no limitation.
       # Available sql federation type: NONE (default), ORIGINAL, ADVANCED
     sql-federation-type: ADVANCED
       # Available proxy backend driver type: JDBC (default), ExperimentalVertx
     proxy-backend-driver-type: JDBC
     proxy-mysql-default-version: 5.7.22 # In the absence of schema name, the default version will be used.
     proxy-default-port: 3307 # Proxy default port.
     proxy-netty-backlog: 1024 # Proxy netty backlog.
   ```
   
   config-sharding.yaml
   
   ```yaml
   databaseName: sharding_db
   
   dataSources:
     ds_0:
       url: jdbc:opengauss://localhost:15432/db_0
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_1:
       url: jdbc:opengauss://localhost:15432/db_1
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_2:
       url: jdbc:opengauss://localhost:15432/db_2
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_3:
       url: jdbc:opengauss://localhost:15432/db_3
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_4:
       url: jdbc:opengauss://localhost:15432/db_4
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_5:
       url: jdbc:opengauss://localhost:15432/db_5
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_6:
       url: jdbc:opengauss://localhost:15432/db_6
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_7:
       url: jdbc:opengauss://localhost:15432/db_7
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_8:
       url: jdbc:opengauss://localhost:15432/db_8
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
     ds_9:
       url: jdbc:opengauss://localhost:15432/db_9
       username: gaussdb
       password: Sphere@123
       connectionTimeoutMilliseconds: 30000
       idleTimeoutMilliseconds: 60000
       maxLifetimeMilliseconds: 1800000
       maxPoolSize: 50
       minPoolSize: 1
   
   rules:
   - !SHARDING
     tables:
       t_order:
         actualDataNodes: ds_${0..9}.t_order
         databaseStrategy:
           standard:
             shardingColumn: user_id
             shardingAlgorithmName: database_inline
       t_order_item:
         actualDataNodes: ds_${0..9}.t_order_item
         databaseStrategy:
           standard:
             shardingColumn: user_id
             shardingAlgorithmName: database_inline
     bindingTables:
       - t_order,t_order_item
     broadcastTables:
       - t_product_category
       - t_country
     shardingAlgorithms:
       database_inline:
         type: INLINE
         props:
           algorithm-expression: ds_${user_id % 10}
   ```


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324667877

   @peilinqian Thank you for your feedback, I will try to reproduce this bug.


-- 
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] strongduanmu commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
strongduanmu commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324795697

   According to PostgreSQL document, when we use using condition, it will only return one join field in result. So we should be compatible with this behavior. Besides, after testing, openGauss has the same behavior.
   
   ```
   USING ( join_column [, ...] ) [ AS join_using_alias ]
   A clause of the form USING ( a, b, ... ) is shorthand for ON left_table.a = right_table.a AND left_table.b = right_table.b .... Also, USING implies that only one of each pair of equivalent columns will be included in the join output, not both.
   
   If a join_using_alias name is specified, it provides a table alias for the join columns. Only the join columns listed in the USING clause are addressable by this name. Unlike a regular alias, this does not hide the names of the joined tables from the rest of the query. Also unlike a regular alias, you cannot write a column alias list — the output names of the join columns are the same as they appear in the USING list.
   ```


-- 
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] peilinqian commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
peilinqian commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1324686097

   **There is problem,if this SQL only can be excuted in federation scenarios?
   two single table (one datasource) excuted with error**
   ```
   test_db=> preview select * from t_order22;
    data_source_name |       actual_sql
   ------------------+-------------------------
    ds_1             | select * from t_order22
   (1 row)
   
   test_db=> preview select * from t_order_item22;
    data_source_name |          actual_sql
   ------------------+------------------------------
    ds_1             | select * from t_order_item22
   (1 row)
   
   test_db=> SELECT * FROM t_order22 o RIGHT JOIN t_order_item22 i using(order_id) WHERE o.user_id = 10 ORDER BY o.order_id, 7;
   ERROR:  The column index is out of range: 12, number of columns: 11.
   test_db=>
   ```
   **Replace 'using' with 'on' ,the result is correct**
   ```
   test_db=> SELECT * FROM t_order22 o RIGHT JOIN t_order_item22 i on o.order_id = i.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 |     creation_date
   ----------+---------+--------+-------------+--------+-----------------------+---------+----------+---------+------------+----------+-----------------------
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 |  100001 |     1000 |      10 |          1 |        1 | 2017-07-08 00:00:00.0
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 |  100002 |     1000 |      10 |          1 |        1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 |  100101 |     1001 |      10 |          2 |        1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 |  100102 |     1001 |      10 |          2 |        1 | 2017-07-08 00:00:00.0
   (4 rows)
   ```
   
   


-- 
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] peilinqian commented on issue #22355: The select result of ‘join with USING(column)’ exists problem;The column name and value doesn't match.

Posted by GitBox <gi...@apache.org>.
peilinqian commented on issue #22355:
URL: https://github.com/apache/shardingsphere/issues/22355#issuecomment-1348104220

   **version**
   ```
   we find java version: java8, full_version=1.8.0_282, full_path=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64/bin/java
   ShardingSphere-5.2.2-SNAPSHOT
   Commit ID: dirty-631fdf40f87223e176abe5c851a51b3287b4d6de
   Commit Message: Fix wrong decide result when execute same sharding condition subquery with sql federation (https://github.com/apache/shardingsphere/pull/22754)
   Branch: https://github.com/apache/shardingsphere/commit/631fdf40f87223e176abe5c851a51b3287b4d6de
   Build time: 2022-12-12T10:48:40+0800
   ```
   **result :pass**
   ```
   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 | user_id | product_id | quantity |     creation_date
   ----------+---------+--------+-------------+--------+-----------------------+---------+---------+------------+----------+-----------------------
        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)
   
   test_db=> SELECT * FROM t_order o RIGHT JOIN t_order_item i on o.order_id=i.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 |     creation_date
   ----------+---------+--------+-------------+--------+-----------------------+---------+----------+---------+------------+----------+-----------------------
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 |  100001 |     1000 |      10 |          1 |        1 | 2017-07-08 00:00:00.0
        1000 |      10 | init   |           1 | test   | 2017-07-08 00:00:00.0 |  100002 |     1000 |      10 |          1 |        1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 |  100101 |     1001 |      10 |          2 |        1 | 2017-07-08 00:00:00.0
        1001 |      10 | init   |           2 | test   | 2017-07-08 00:00:00.0 |  100102 |     1001 |      10 |          2 |        1 | 2017-07-08 00:00:00.0
   (4 rows)
   
   test_db=>
   
   ```


-- 
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