TherChenYang opened a new pull request, #30184:
URL: https://github.com/apache/shardingsphere/pull/30184

   Fixes #ISSUSE_ID.
   
   Changes proposed in this pull request:
     - Support parsing SQL Server delimited brackets identifier
     - Support the parsing of SQL in ISSUE #29178
   
   #### SQL Case 
   ```sql
   SELECT name AS column_name   
       ,column_id   
       ,TYPE_NAME(user_type_id) AS type_name  
       ,max_length  
       ,CASE   
          WHEN max_length = -1 AND TYPE_NAME(user_type_id) <> 'xml'  
               THEN 1  
               ELSE 0  
        END AS [(max)]  
   FROM sys.columns  
   WHERE object_id=OBJECT_ID('<schema_name.table_name>')   
       AND ( TYPE_NAME(user_type_id) IN ('xml','text', 'ntext','image')  
            OR (TYPE_NAME(user_type_id) IN ('varchar','nvarchar','varbinary')  
            AND max_length = -1)  
           )
   ```
   
   ```sql
   SELECT OBJECT_NAME(object_id) AS object_name   
       ,c.name AS column_name   
       ,SCHEMA_NAME(t.schema_id) AS schema_name  
       ,TYPE_NAME(c.user_type_id) AS user_type_name  
       ,c.max_length  
       ,c.precision  
       ,c.scale  
       ,c.is_nullable  
       ,c.is_computed  
   FROM sys.columns AS c  
   INNER JOIN sys.types AS t ON c.user_type_id = t.user_type_id  
   WHERE c.user_type_id = TYPE_ID('<schema_name.data_type_name>')
   ```
   
   ```sql
   INSERT INTO Production.UnitMeasure  
   VALUES (N'FT2', N'Square Feet ', '20080923'), (N'Y', N'Yards', '20080923')
       , (N'Y3', N'Cubic Yards', '20080923')
   ```
   
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following 
options:
   - [x] My code follows the [code of 
conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) 
of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the 
pull request.
   - [x] I have passed maven check locally : `./mvnw clean install -B -T1C 
-Dmaven.javadoc.skip -Dmaven.jacoco.skip -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [x] I have added corresponding unit tests for my changes.
   


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