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/03/25 16:28:54 UTC

[GitHub] [shardingsphere] terrymanu opened a new issue #16383: Dynamic load SQL parser test cases from MySQL and PostgreSQL

terrymanu opened a new issue #16383:
URL: https://github.com/apache/shardingsphere/issues/16383


   The current SQL parser test case for unsupported SQL is `org.apache.shardingsphere.test.sql.parser.parameterized.engine.UnsupportedSQLParserParameterizedTest`. 
   The test data is in `src/main/resources/sql/unsupported/unsupported.xml` which composed by static and dynamic.
   
   ![image](https://user-images.githubusercontent.com/5516298/160160614-edbc3aa8-09dc-4b5a-9872-855453694013.png)
   
   
   We need to keep the static test cases in `UnsupportedSQLParserParameterizedTest` and create a new class, which name maybe `DynamicLoadingSQLParserParameterizedTest`.
   
   The class should load SQL cases from official test cases from MySQL[1] and PostgreSQL[2]. 
   The step of `DynamicLoadingSQLParserParameterizedTest`:
   
   1. Load official test cases from GitHub
   2. Generate to arrays by parameterized test.
   3. Run `SQLParserEngine.parse()` try to parse SQL
   4. Assert result as `SQLStatement`
   5. Catch `SQLParserException` for unsupported SQL
   6. Catch `CastException` for parse error
   7. Record and print exception number, the final objective is zero exception, please do not assert fail if exception number is not zero, just let the test cases can be done.
   
   [1] https://github.com/mysql/mysql-server/tree/8.0/mysql-test/t
   [2] https://github.com/postgres/postgres/tree/master/src/test/regress/sql


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