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

information_schema and sys relevant SQLs can't parse or route #6693

Closed
tuohai666 opened this issue Aug 7, 2020 · 11 comments
Closed

information_schema and sys relevant SQLs can't parse or route #6693

tuohai666 opened this issue Aug 7, 2020 · 11 comments

Comments

@tuohai666
Copy link
Member

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.0.0-RC1-SNAPSHOT

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

ShardingSphere-Proxy

Expected behavior

Get the result from the following SQLs:

show full processlist;
select * from information_schema.processlist ;
select * from information_schema.INNODB_TRX;
select * from sys.schema_redundant_indexes;

Actual behavior

mysql> show full processlist;
Query OK, 0 rows affected (0.06 sec)
Exception in log: 
line 1:10 no viable alternative at input 'showfullprocesslist'
mysql> select * from information_schema.processlist;
ERROR 10002 (C1000): 2Unknown exception: [Can not route tables for `[processlist]`, please make sure the tables are in same schema.]
Exception in log:
[ERROR] 18:09:12.379 [ShardingSphere-Command-5] o.a.s.p.f.c.CommandExecutorTask - Exception occur: 
org.apache.shardingsphere.infra.exception.ShardingSphereException: Can not route tables for `[processlist]`, please make sure the tables are in same schema.
	at org.apache.shardingsphere.sharding.route.engine.type.unconfigured.ShardingUnconfiguredTablesRoutingEngine.route(ShardingUnconfiguredTablesRoutingEngine.java:50)
	at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:72)
	at org.apache.shardingsphere.sharding.route.engine.ShardingRouteDecorator.decorate(ShardingRouteDecorator.java:55)
	at org.apache.shardingsphere.infra.route.DataNodeRouter.executeRoute(DataNodeRouter.java:89)
	at org.apache.shardingsphere.infra.route.DataNodeRouter.route(DataNodeRouter.java:74)
	at org.apache.shardingsphere.proxy.backend.communication.jdbc.wrapper.StatementExecutorWrapper.execute(StatementExecutorWrapper.java:67)
	at org.apache.shardingsphere.proxy.backend.communication.jdbc.execute.engine.jdbc.JDBCExecuteEngine.execute(JDBCExecuteEngine.java:80)
	at org.apache.shardingsphere.proxy.backend.communication.jdbc.JDBCDatabaseCommunicationEngine.execute(JDBCDatabaseCommunicationEngine.java:85)
	at org.apache.shardingsphere.proxy.backend.text.query.QueryBackendHandler.execute(QueryBackendHandler.java:55)
	at org.apache.shardingsphere.proxy.frontend.mysql.command.query.text.query.MySQLComQueryPacketExecutor.execute(MySQLComQueryPacketExecutor.java:78)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.executeCommand(CommandExecutorTask.java:105)
	at org.apache.shardingsphere.proxy.frontend.command.CommandExecutorTask.run(CommandExecutorTask.java:80)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Reason analyze (If you can)

Parse error:
show full processlist;
Route error:
select * from information_schema.processlist;

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

Execute these SQLs straightforwardly.

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

@sandynz
Copy link
Contributor

sandynz commented Aug 10, 2020

Hibernate 5.4 + ShardingSphere JDBC 5.0.0-RC1-SNAPSHOT + PostgreSQL 12, has similar exception: ShardingSphereException: Can not route tables for [sequences], please make sure the tables are in same schema.

Hibernate settings:

  • hibernate.hbm2ddl.auto = update

SQL executed by hibernate automatically: select * from information_schema.sequences

@tuohai666
Copy link
Member Author

The exception caused by parse and route procedure. @tristaZero , can you have a look?

@kimmking
Copy link
Member

any update?

@mark4z
Copy link
Member

mark4z commented Feb 24, 2021

Mysql has same problem here.

@tristaZero
Copy link
Contributor

Hi thanks for your attention.
It is an important but challenging feature definitely. We need to make a schedule to support it step by step. Once there is any plan, I will update it here.

@linchers
Copy link

org.apache.shardingsphere.sharding.route.engine.type.unconfigured.ShardingUnconfiguredTablesRoutingEngine#findDataSourceName
private Optional<String> findDataSourceName() { for (Entry<String, Collection<String>> entry : unconfiguredSchemaMetaDataMap.entrySet()) { if (entry.getValue().containsAll(logicTables)) { return Optional.of(entry.getKey()); } } return Optional.empty(); }

entry.getValue() tablenames is upcase but logicTables is lowercase

@leeey111
Copy link

Any news?
Without this feature support,it is inconvenienced to use "SQL complement" in some SQL clients like DBeaver.

@terrymanu terrymanu modified the milestones: 5.0.0-beta, 5.0.0-RC1 Jun 9, 2021
@terrymanu terrymanu removed this from the 5.0.0-RC1 milestone Oct 15, 2021
@lcxywfe
Copy link
Contributor

lcxywfe commented May 11, 2022

Any news? phpmyadmin also need information_schema.

@github-actions
Copy link

github-actions bot commented Oct 8, 2022

Hello , this issue has not received a reply for several days.
This issue is supposed to be closed.

Copy link

There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.

@github-actions github-actions bot added the stale label Mar 30, 2024
@terrymanu
Copy link
Member

Close because of staled.

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

10 participants