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

   # Oracle parser example fails to parse multi-table DROP TABLE statement
   
   ## Bug Report
   
   ### Which version of ShardingSphere did you use?
   master @ cb50781
   
   ### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
   N/A (SQL parser example module)
   
   ### Expected behavior
   Running `OracleParserStatementExample.main()` parses and visits all its demo 
statements without error.
   
   ### Actual behavior
   `main()` throws a parse exception on `DDL_DROP_SQL = "DROP TABLE table1, 
table2;"`: `You have an error in your SQL syntax: DROP TABLE table1, table2;`. 
Execution stops after the CREATE TABLE statement, so the DROP and ALTER demos 
never run.
   
   ### Reason analyze (If you can)
   `OracleParserStatementExample.DDL_DROP_SQL` 
(`examples/shardingsphere-parser-example/src/main/java/org/apache/shardingsphere/example/parser/oracle/statement/OracleParserStatementExample.java`
 line 41) uses the MySQL-style comma-separated form. The Oracle grammar 
`dropTable : DROP TABLE tableName (CASCADE CONSTRAINTS)? (PURGE)?` 
(`parser/sql/engine/dialect/oracle/src/main/antlr4/imports/oracle/DDLStatement.g4`
 line 172) accepts a single table only, so the comma list is invalid Oracle 
syntax.
   
   ### Steps to reproduce the behavior, such as: SQL to execute, sharding rule 
configuration, when exception occur etc.
   Run the `main` method of `OracleParserStatementExample`; the exception 
occurs when the engine parses `DDL_DROP_SQL`.
   
   ### Example codes for reproduce this issue (such as a github link).
   
`examples/shardingsphere-parser-example/.../oracle/statement/OracleParserStatementExample.java`
   


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