Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DistSQL pymysql execute error #31264

Open
dobet opened this issue May 17, 2024 · 0 comments
Open

DistSQL pymysql execute error #31264

dobet opened this issue May 17, 2024 · 0 comments

Comments

@dobet
Copy link

dobet commented May 17, 2024

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.5.0
pymysql 0.10.1

Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?

shardingsphere-proxy

  1. pymysql connect shardingsphere-proxy ----- success

  2. pymysql create database and use database. pymysql.connect.commit() ----- success

  3. pymysql register two storage unit ----- success

  4. show storage units ----- success

  5. unregister first storage unit ------ failed
    pass first exception. and continue unregister second storage unit --- success

Expected behavior

unregister success

Actual behavior

unregister failed .

Reason analyze (If you can)

[ERROR] 2024-05-17 14:45:33.802 [ShardingSphere-Command-16] o.a.s.p.f.c.CommandExecutorTask - Exception occur:
java.lang.NullPointerException: null
at org.apache.shardingsphere.infra.datasource.pool.CatalogSwitchableDataSource.getConnection(CatalogSwitchableDataSource.java:46)
at org.apache.shardingsphere.infra.database.DatabaseTypeEngine.getStorageType(DatabaseTypeEngine.java:118)
at org.apache.shardingsphere.infra.database.DatabaseTypeEngine.getProtocolType(DatabaseTypeEngine.java:62)
at org.apache.shardingsphere.metadata.factory.ExternalMetaDataFactory.create(ExternalMetaDataFactory.java:54)
at org.apache.shardingsphere.mode.manager.context.ConfigurationContextManager.createChangedDatabase(ConfigurationContextManager.java:334)
at org.apache.shardingsphere.mode.manager.context.ConfigurationContextManager.createChangedDatabases(ConfigurationContextManager.java:306)
at org.apache.shardingsphere.mode.manager.context.ConfigurationContextManager.createMetaDataContexts(ConfigurationContextManager.java:282)
at org.apache.shardingsphere.mode.manager.standalone.StandaloneModeContextManager.unregisterStorageUnits(StandaloneModeContextManager.java:246)
at org.apache.shardingsphere.distsql.handler.executor.rdl.resource.UnregisterStorageUnitExecutor.executeUpdate(UnregisterStorageUnitExecutor.java:60)
at org.apache.shardingsphere.distsql.handler.executor.rdl.resource.UnregisterStorageUnitExecutor.executeUpdate(UnregisterStorageUnitExecutor.java:47)
at org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine.executeNormalUpdate(DistSQLUpdateExecuteEngine.java:86)
at org.apache.shardingsphere.distsql.handler.engine.update.DistSQLUpdateExecuteEngine.executeUpdate(DistSQLUpdateExecuteEngine.java:64)
at org.apache.shardingsphere.proxy.backend.handler.distsql.DistSQLUpdateBackendHandler.execute(DistSQLUpdateBackendHandler.java:45)
at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:86)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.doExecuteCommand(CommandExecutorTask.java:126)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:121)
at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:78)
at com.alibaba.ttl.TtlRunnable.run(TtlRunnable.java:60)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)

Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.

Example codes for reproduce this issue (such as a github link).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants