Closed atlkay closed 4 months ago
Hi @atlkay, can you try the latest 5.4.1 version?
I changed "select * "to "select a,b,c...." In this form, the sql does not throw an error, which is a strange problem.
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Hi @atlkay, can you try the latest 5.4.1 version?
I can't get the version from https://mvnrepository.com/
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
The markdown format in your issue is incorrect. To facilitate reading, could you please revise it?
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
Bug Report
For English only, other languages will not accept.
Before report a bug, make sure you have:
Please pay attention on issues you submitted, because we maybe need more details. If no response anymore and we cannot reproduce it on current information, we will close it.
Please answer these questions before submitting your issue. Thanks!
Which version of ShardingSphere did you use?
5.2.1
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-JDBC
Expected behavior
For tables with no sharding rules set, the framework should not affect their query statements.
Actual behavior
There are some tables in my project that do not have a split table rule set. When I write a query involving these tables, an exception occurs. When I remove the pom dependency of shardingjdbc, the query will not report an error, so I think this problem may be related to the version.
Reason analyze (If you can)
I tried a few things, but I couldn't figure out why.
Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
sql:
SELECT en.* FROM evaluation_norm en LEFT JOIN evaluation_type et ON en.STARLEVEL_TYPE_CODE = et.TYPE_CODE LEFT JOIN ( SELECT DISTINCT em.STARLEVEL_TYPE_CODE, em.STARLEVEL_CODE, em.NORM_CODE FROM evaluation_norm em LEFT JOIN evaluation_type ee ON em.STARLEVEL_TYPE_CODE = ee.TYPE_CODE WHERE 1 = 1 AND ee.TYPE_STATUS = '1' AND em.STARLEVEL_STATUS != '0' ) b ON en.STARLEVEL_TYPE_CODE = b.STARLEVEL_TYPE_CODE AND en.STARLEVEL_CODE = b.STARLEVEL_CODE AND en.NORM_CODE = b.NORM_CODE WHERE 1 = 1 AND et.TYPE_STATUS = '1' AND en.STARLEVEL_STATUS != '0' AND en.STARLEVEL_TYPE_CODE = b.STARLEVEL_TYPE_CODE AND en.STARLEVEL_CODE = b.STARLEVEL_CODE AND en.NORM_CODE = b.NORM_CODE AND en.NORM_VERSION = ( SELECT max( CONVERT ( nn.NORM_VERSION, DECIMAL ( 7, 5 ))) FROM evaluation_norm nn LEFT JOIN evaluation_type tt ON nn.STARLEVEL_TYPE_CODE = tt.TYPE_CODE WHERE 1 = 1 AND tt.TYPE_STATUS = '1' AND nn.STARLEVEL_STATUS != '0' AND nn.STARLEVEL_TYPE_CODE = en.STARLEVEL_TYPE_CODE AND nn.STARLEVEL_CODE = en.STARLEVEL_CODE AND nn.NORM_CODE = en.NORM_CODE ) ORDER BY en.STARLEVEL_TYPE_CODE, en.STARLEVEL_CODE, en.NORM_CODE LIMIT 1
sharding rule configuration:
spring: autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure shardingsphere:
exception :
org.springframework.dao.TransientDataAccessResourceException:
Error querying database. Cause: java.sql.SQLException: Column index out of range.
The error may exist in file [E:\hljhcpwfw\hcp-cloud-business\vingsoft-service\hcp-management\target\classes\com\vingsoft\hcp\mapper\NormMapper.xml]
The error may involve com.vingsoft.hcp.mapper.NormMapper.selectNormPage2
The error occurred while handling results
SQL: SELECT en.* FROM evaluation_norm en LEFT JOIN evaluation_type et ON en.STARLEVEL_TYPE_CODE = et.TYPE_CODE LEFT JOIN (SELECT DISTINCT em.STARLEVEL_TYPE_CODE, em.STARLEVEL_CODE, em.NORM_CODE FROM evaluation_norm em LEFT JOIN evaluation_type ee ON em.STARLEVEL_TYPE_CODE = ee.TYPE_CODE WHERE 1 = 1 AND ee.TYPE_STATUS = '1' AND em.STARLEVEL_STATUS != '0') b ON en.STARLEVEL_TYPE_CODE = b.STARLEVEL_TYPE_CODE AND en.STARLEVEL_CODE = b.STARLEVEL_CODE AND en.NORM_CODE = b.NORM_CODE WHERE 1 = 1 AND et.TYPE_STATUS = '1' AND en.STARLEVEL_STATUS != '0' AND en.STARLEVEL_TYPE_CODE = b.STARLEVEL_TYPE_CODE AND en.STARLEVEL_CODE = b.STARLEVEL_CODE AND en.NORM_CODE = b.NORM_CODE AND en.NORM_VERSION = (SELECT max(CONVERT(nn.NORM_VERSION, DECIMAL(7, 5))) FROM evaluation_norm nn LEFT JOIN evaluation_type tt ON nn.STARLEVEL_TYPE_CODE = tt.TYPE_CODE WHERE 1 = 1 AND tt.TYPE_STATUS = '1' AND nn.STARLEVEL_STATUS != '0' AND nn.STARLEVEL_TYPE_CODE = en.STARLEVEL_TYPE_CODE AND nn.STARLEVEL_CODE = en.STARLEVEL_CODE AND nn.NORM_CODE = en.NORM_CODE) ORDER BY en.STARLEVEL_TYPE_CODE, en.STARLEVEL_CODE, en.NORM_CODE LIMIT ?
Cause: java.sql.SQLException: Column index out of range.
; Column index out of range.; nested exception is java.sql.SQLException: Column index out of range.
Example codes for reproduce this issue (such as a github link).
Just a mybatisplus paging query, the sql statement is what I described above。