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 2019/06/20 01:41:03 UTC

[GitHub] [incubator-shardingsphere] wingshadow opened a new issue #2589: sql语句解析出错,出现越界错误

wingshadow opened a new issue #2589: sql语句解析出错,出现越界错误
URL: https://github.com/apache/incubator-shardingsphere/issues/2589
 
 
   sql:
   SELECT
   	t_region.inscode AS inscode,
   	t_region.seq AS seq,
   	t_region.NAME,
   	t_region.address,
   	t_region.area,
   	t_region.type,
   	t_region.vehicle_type AS vehicleType,
   	t_region.polygon,
   	t_region.totalveh_num totalvehNum,
   	t_region.curveh_num AS curvehNum,
   	t_region.verify_status AS verifyStatus,
   	t_region.verify_userid AS verifyUserid,
   	t_region.verify_time AS verifyTime,
   	t_region.reason,
   	t_region.inform,
   	t_region.platform_num AS platformNum,
   	t_region.aduit_status AS aduitStatus,
   	t_institution.short_name AS shortName,
   	c.NAME AS cityName 
   FROM
   	t_region
   	JOIN t_institution ON t_region.inscode = t_institution.inscode
   	LEFT JOIN t_city c ON t_institution.district = c.id 
   WHERE
   	t_region.is_del = '0' 
   该sql不是规范语句,from后面表名没有添加别名,在解析sql语句时出现字符串越界
   Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -8
   	at java.lang.String.substring(String.java:1967)
   	at org.apache.shardingsphere.core.rewrite.SQLRewriteEngine.appendRest(SQLRewriteEngine.java:507)
   
   解析sql的stopPosition小于startIndex

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services