tristaZero commented on issue #4849: Add start-index and stop-index assertion 
for ParameterMarkerExpression
URL: 
https://github.com/apache/incubator-shardingsphere/issues/4849#issuecomment-601093808
 
 
   ### How to find the targets to be fixed?
   1. Open class `SQLParserParameterizedTest` and delete the following lines,
   ```
           // TODO Correct for new parser, please remove them after using new 
parser
           
sqlCases.add("insert_on_duplicate_key_update_with_base64_aes_encrypt");
           sqlCases.add("insert_with_one_auto_increment_column");
           
sqlCases.add("insert_on_duplicate_key_update_with_complicated_expression");
           sqlCases.add("insert_without_columns_and_with_generate_key_column");
           
sqlCases.add("insert_without_columns_and_without_generate_key_column");
           sqlCases.add("insert_without_columns_with_all_placeholders");
   ```
   2. run `SQLParserParameterizedTest`
   3. All the SQL cases which have the error assertion results are our targets 
to be fixed.
   
   ### How to fix the above assertion results?
   1. Look at the exception log and find the corresponding `SQL Case ID` and 
`SQL`.
   2. Find out the `parsing result` of this `SQL Case ID` in 
`./incubator-shardingsphere/shardingsphere-sql-parser/shardingsphere-sql-parser-test/src/test/resources/sql/dml`
   3. Calculate the correct `start-index` and `stop-index` of 
`parameter-marker-expression` segment (i.e., `?`) of this `SQL`.
   4. Add the calculated `start-index` and `stop-index` labels of 
`parameter-marker-expression` segment to `parsing result` of this `SQL Case 
ID`, like
   ```
               <parameter-marker-expression value="2" start-index="10" 
stop-index="11" />
   ```
   5. Run `SQLParserParameterizedTest` again to check whether this `SQL Case 
ID` does not stay in the list of `SQL` with  `bad assertion result`.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to