terrymanu commented on issue #20258: URL: https://github.com/apache/shardingsphere/issues/20258#issuecomment-5707753553
Hi @sandynz, thanks for reporting this. This issue has already been resolved on the current `master` branch. The root cause was similar to #16325, but it was not the same case. At the reported commit, `JDBCBackendStatement` obtained the `DatabaseType` from the currently selected database. Therefore, when the current database was `sys` or `mysql` while the SQL explicitly accessed `sharding_db.t_order`, the metadata lookup could return null and cause an NPE in `setFetchSize()`. #20115 removed `SQLStatementDatabaseHolder` and eliminated the metadata lookup based on the current database name from `JDBCBackendStatement`. #21715 later improved this path by explicitly passing the `DatabaseType` of the actual storage unit to `JDBCBackendStatement`. The current implementation determines the logical database from the SQL context first, so the original NPE path no longer exists. Please verify the following scenario with the current `master` branch or a newer version that includes #20115 and #21715: `USE sys; SELECT COUNT(1) FROM sharding_db.t_order;` If it can no longer be reproduced, I suggest labeling this issue as `type: duplicate`, retaining `in: metadata`, and closing it. If it is still reproducible, please provide the current commit ID, Proxy configuration, and complete exception stack trace so that we can check whether it has a different root cause. -- 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]
