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

   ## Bug Report
   
   **For English only**, other languages will not accept.
   
   Before report a bug, make sure you have:
   
   - Searched open and closed [GitHub 
issues](https://github.com/apache/shardingsphere/issues).
   - Read documentation: [ShardingSphere 
Doc](https://shardingsphere.apache.org/document/current/en/overview).
   
   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!
   
   
   **sharding-proxy 5.2.0**
   DQL:
   `SELECT si.*,
          s.batch_name       AS so_name,
          so_link.link_value AS so_no
   FROM t_sim_issue si
            LEFT JOIN t_sim_issue_link so_link ON so_link.issue_id = si.id
       AND so_link.link_type = 'SO'
       AND so_link.tenant_id = si.tenant_id
       AND so_link.is_deleted = 0
            LEFT JOIN (SELECT so.batch_name,
                              so.batch_no
                       FROM t_sd_so so
                       WHERE so.is_deleted = 0
                         AND so.tenant_id = '10030') s ON so_link.link_value = 
s.batch_no
   WHERE si.tenant_id = '10030'
     AND si.is_deleted = 0
   limit 100;`
   
   exception:
   `java.sql.SQLException: Column index out of range.
        at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:127)
        at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:95)
        at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:87)
        at 
com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:61)
        at 
com.mysql.cj.jdbc.result.ResultSetMetaData.getField(ResultSetMetaData.java:300)
        at 
com.mysql.cj.jdbc.result.ResultSetMetaData.getColumnLabel(ResultSetMetaData.java:228)
        at 
org.apache.shardingsphere.infra.executor.sql.execute.result.query.impl.driver.jdbc.metadata.JDBCQueryResultMetaData.getColumnLabel(JDBCQueryResultMetaData.java:52)
        at 
org.apache.shardingsphere.proxy.backend.response.header.query.QueryHeaderBuilderEngine.getColumnLabel(QueryHeaderBuilderEngine.java:73)
        at 
org.apache.shardingsphere.proxy.backend.response.header.query.QueryHeaderBuilderEngine.build(QueryHeaderBuilderEngine.java:67)
        at 
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.createQueryHeader(DatabaseCommunicationEngine.java:159)
        at 
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.createQueryHeaders(DatabaseCommunicationEngine.java:152)
        at 
org.apache.shardingsphere.proxy.backend.communication.DatabaseCommunicationEngine.processExecuteQuery(DatabaseCommunicationEngine.java:142)
        at 
org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:136)
        at 
org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:94)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:110)
        at 
org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:77)
        at 
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:469)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:384)`
   
   When I change the query field of sql from `select si.*,
          s.batch_name       AS so_name,
          so_link.link_value AS so_no` to `SELECT si.*`,exception disappeared.
   
   sharding-proxy config file is as follows:
   `max-connections-size-per-query: 1
   kernel-executor-size: 16
   proxy-frontend-flush-threshold: 128
   proxy-hint-enabled: false
   sql-show: true
   check-table-metadata-enabled: false
   proxy-backend-query-fetch-size: -1
   proxy-frontend-executor-size: 0
   proxy-backend-executor-suitable: OLTP
   proxy-frontend-max-connections: 0
   sql-federation-enabled: true
   proxy-backend-driver-type: JDBC
   proxy-mysql-default-version: 8.0.11
   proxy-default-port: 3307
   proxy-netty-backlog: 1024`
   


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