You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "boyjoy1127 (via GitHub)" <gi...@apache.org> on 2023/02/22 01:00:30 UTC

[GitHub] [shardingsphere] boyjoy1127 opened a new issue, #24289: Proxy not support date type in query sql.

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

   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   5.3.1
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   ShardingSphere-Proxy
   
   ### Expected behavior
   Running integration test in `org.apache.shardingsphere.test.e2e.engine.dql.GeneralDQLE2EIT`
   
   Settings in it-env.properties is below:
   ```
   it.run.modes=Cluster
   it.run.additional.cases=false
   
   #it.scenarios=db,tbl,readwrite_splitting,encrypt,shadow,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,rdl_empty_rules,empty_rules,sharding_and_encrypt,encrypt_and_readwrite_splitting,encrypt_shadow,readwrite_splitting_and_shadow,sharding_and_shadow,sharding_encrypt_shadow,mask,mask_encrypt,mask_sharding,mask_encrypt_sharding
   it.scenarios=db
   # it.cluster.env.type=DOCKER,NATIVE
   it.cluster.env.type=DOCKER
   
   # it.cluster.adapters=jdbc,proxy
   it.cluster.adapters=proxy
   
   # it.cluster.databases=MySQL,PostgreSQL,openGauss
   it.cluster.databases=PostgreSQL
   ```
   Add a test in 'dql-integration-test-cases.xml'
   ```
       <test-case sql="SELECT * FROM t_product p INNER JOIN t_product_detail d ON p.product_id = d.product_id WHERE p.creation_date = ?" db-types="MySQL,PostgreSQL,openGauss" scenario-types="db">
           <assertion parameters="2017-08-08:Date" expected-data-source-name="read_dataset" />
       </test-case>
   ```
   
   'PostgreSQLComParsePacket.readParameterType() '  analyze the date type
   ```
       public List<PostgreSQLColumnType> readParameterTypes() {
           int parameterCount = payload.readInt2();
           List<PostgreSQLColumnType> result = new ArrayList<>(parameterCount);
           for (int i = 0; i < parameterCount; i++) {
               result.add(PostgreSQLColumnType.valueOf(payload.readInt4()));
           }
           return result;
       }
   ```
   
   Expect the date type in 'result' could be analyzed as 'Date'.
   ### Actual behavior
   Actually the date type is analyzed as 'POSTGRESQL_TYPE_UNSPECIFIED',' PostgreSQLTypeUnspecifiedSQLParameter '.
   
   
   ### Reason analyze (If you can)
   I suspect the proxy frontend hasn't support the date type yet.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
   Running integration test in `org.apache.shardingsphere.test.e2e.engine.dql.GeneralDQLE2EIT`
   
   Settings in it-env.properties is below:
   ```
   it.run.modes=Cluster
   it.run.additional.cases=false
   
   #it.scenarios=db,tbl,readwrite_splitting,encrypt,shadow,dbtbl_with_readwrite_splitting,dbtbl_with_readwrite_splitting_and_encrypt,rdl_empty_rules,empty_rules,sharding_and_encrypt,encrypt_and_readwrite_splitting,encrypt_shadow,readwrite_splitting_and_shadow,sharding_and_shadow,sharding_encrypt_shadow,mask,mask_encrypt,mask_sharding,mask_encrypt_sharding
   it.scenarios=db
   # it.cluster.env.type=DOCKER,NATIVE
   it.cluster.env.type=DOCKER
   
   # it.cluster.adapters=jdbc,proxy
   it.cluster.adapters=proxy
   
   # it.cluster.databases=MySQL,PostgreSQL,openGauss
   it.cluster.databases=PostgreSQL
   ```
   Add a test in 'dql-integration-test-cases.xml'
   ```
       <test-case sql="SELECT * FROM t_product p INNER JOIN t_product_detail d ON p.product_id = d.product_id WHERE p.creation_date = ?" db-types="MySQL,PostgreSQL,openGauss" scenario-types="db">
           <assertion parameters="2017-08-08:Date" expected-data-source-name="read_dataset" />
       </test-case>
   ```
   
   'PostgreSQLComParsePacket.readParameterType() '  analyze the date type
   ```
       public List<PostgreSQLColumnType> readParameterTypes() {
           int parameterCount = payload.readInt2();
           List<PostgreSQLColumnType> result = new ArrayList<>(parameterCount);
           for (int i = 0; i < parameterCount; i++) {
               result.add(PostgreSQLColumnType.valueOf(payload.readInt4()));
           }
           return result;
       }
   ```
   
   ### 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] TeslaCN commented on issue #24289: Proxy not support date type in query sql.

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on issue #24289:
URL: https://github.com/apache/shardingsphere/issues/24289#issuecomment-1449467174

   The type `POSTGRESQL_TYPE_UNSPECIFIED` might be specified by client.


-- 
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 #24289: Proxy not support date type in query sql.

Posted by "strongduanmu (via GitHub)" <gi...@apache.org>.
strongduanmu commented on issue #24289:
URL: https://github.com/apache/shardingsphere/issues/24289#issuecomment-1439305746

   @boyjoy1127 Thank you for your feedback. @TeslaCN Can you help check this problem?


-- 
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] TeslaCN commented on issue #24289: Proxy not support date type in query sql.

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN commented on issue #24289:
URL: https://github.com/apache/shardingsphere/issues/24289#issuecomment-1526878589

   I used Proxy 965a7c664f91e9d93eeb5ccf524eb1962e3b75b7 and ran the case
   ```xml
   <test-case sql="SELECT * FROM t_product p INNER JOIN t_product_detail d ON p.product_id = d.product_id WHERE p.creation_date = ?" db-types="MySQL,PostgreSQL,openGauss" scenario-types="db">
       <assertion parameters="2017-08-08:Date" expected-data-source-name="read_dataset" />
   </test-case>
   ```
   The test passed.
   ![image](https://user-images.githubusercontent.com/20503072/235037331-54622ec3-efcd-4984-b414-9a798bd5ab1d.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] TeslaCN closed issue #24289: Proxy not support date type in query sql.

Posted by "TeslaCN (via GitHub)" <gi...@apache.org>.
TeslaCN closed issue #24289: Proxy not support date type in query sql.
URL: https://github.com/apache/shardingsphere/issues/24289


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