You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "vasiliy-mikhailov (via GitHub)" <gi...@apache.org> on 2026/06/26 19:16:09 UTC

[PR] Avoid NPE in DatabaseMetaDataManager.dropSchema by capturing the schema first [shardingsphere]

vasiliy-mikhailov opened a new pull request, #38930:
URL: https://github.com/apache/shardingsphere/pull/38930

   `DatabaseMetaDataManager.dropSchema` reads `database.getSchema(schemaName).getAllTables()` **after** calling `database.dropSchema(schemaName)`. The schema is already gone at that point, so `getSchema(...)` returns `null` and `getAllTables()` throws a `NullPointerException`.
   
   Capture the schema reference before dropping it. Added a test asserting `dropSchema` does not throw after the schema is removed.
   


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Avoid NPE in DatabaseMetaDataManager.dropSchema by capturing the schema first [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu merged PR #38930:
URL: https://github.com/apache/shardingsphere/pull/38930


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Avoid NPE in DatabaseMetaDataManager.dropSchema by capturing the schema first [shardingsphere]

Posted by "vasiliy-mikhailov (via GitHub)" <gi...@apache.org>.
vasiliy-mikhailov commented on PR #38930:
URL: https://github.com/apache/shardingsphere/pull/38930#issuecomment-4828671381

   Thanks for the detailed review. Cleaned up the test as suggested: imported java.util.Properties and use new Properties() instead of the inline fully-qualified name, removed the // comment since the method name and assertion already describe the intent, and removed the trailing whitespace on the blank line after the method. git diff --check is clean now. Pushed.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Avoid NPE in DatabaseMetaDataManager.dropSchema by capturing the schema first [shardingsphere]

Posted by "vasiliy-mikhailov (via GitHub)" <gi...@apache.org>.
vasiliy-mikhailov commented on PR #38930:
URL: https://github.com/apache/shardingsphere/pull/38930#issuecomment-4821383234

   Done, thanks. Fixed the Spotless formatting in `DatabaseMetaDataManagerTest` (comment indentation) and pushed; `./mvnw spotless:check -Pcheck` is clean now.


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Avoid NPE in DatabaseMetaDataManager.dropSchema by capturing the schema first [shardingsphere]

Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu commented on PR #38930:
URL: https://github.com/apache/shardingsphere/pull/38930#issuecomment-4816219221

   Please fix spotless first


-- 
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: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org