-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Wrong result of information_schema.tables
when sharding a postgreSQL/mySQL table.
#34685
Comments
btw, I wonder if shardingsphere-proxy provides any method to query all the names of logic tables and row names they have in a database, e.g. |
NOTE: postgres=> \d
List of relations
Schema | Name | Type | Owner
--------+-----------+-------+----------
public | t_order_0 | table | postgres
public | t_order_2 | table | postgres
(2 rows) |
information_schema.tables
when sharding a table.information_schema.tables
when sharding a postgreSQL table.
information_schema.tables
when sharding a postgreSQL table.information_schema.tables
when sharding a postgreSQL/mySQL table.
the bug also exists in MySQL. Follow the document to create 4 shards of a table. mysql> SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = DATABASE();
+------------+
| TABLE_NAME |
+------------+
| t_order_0 |
| t_order_2 |
+------------+
2 rows in set (0.02 sec) But mysql> show tables;
+----------------------+
| Tables_in_mydatabase |
+----------------------+
| t_order |
+----------------------+
1 row in set (0.00 sec) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
Which version of ShardingSphere did you use?
Proxy 5.5.2 with Postgres 17.2 as backend.
Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy Standlone
Expected behavior
init state
query
select * from information_schema.tables where table_schema = 'public';
should return 4 tables, beacuse of
"sharding-count"="4"
, and the table name should bet_order_0
tot_order_3
Actual behavior
Reason analyze (If you can)
The query is only pushed down to 1 node(that is ds_0), so the other 2 sharding tables on ds_1 are missed.
The
PREVIEW
of the query:The
EXPLAIN
of the query:Steps to reproduce the behavior, such as: SQL to execute, sharding rule configuration, when exception occur etc.
global.yaml:
database-sharding.yaml:
docker-compose.yaml(to create cluster):
init state reproduction & query is shown above.
The text was updated successfully, but these errors were encountered: