RaigorJiang opened a new issue, #33366:
URL: https://github.com/apache/shardingsphere/issues/33366
## Bug Report
### Which version of ShardingSphere did you use?
5.5.2-SNAPSHOT 53d9616d18b5de1cd5f8e3bec00a3ea81dc47d02
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy and ShardingSphere-JDBC
### Expected behavior
SQLHint can transparently execute SQL, and HintManager can also achieve the
same effect.
### Actual behavior
In the sharding scenario, query a sharding table node on a specified storage
unit.
The query is successful when SQLHint is used, but when use HintManager to do
same operation, the message "Table or view does not exist" is displayed.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
1. Create database in proxy
```sql
CREATE DATABASE sharding_db;
USE sharding_db;
```
2. Register storage units
```sql
REGISTER STORAGE UNIT ds_study_dev_0 (
URL="jdbc:mysql://127.0.0.1:3306/demo_ds_0?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER="root",
PASSWORD="123456",
PROPERTIES("maximumPoolSize"=10)
), ds_study_dev_1 (
URL="jdbc:mysql://127.0.0.1:3306/demo_ds_1?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER="root",
PASSWORD="123456",
PROPERTIES("maximumPoolSize"=10)
), ds_study_dev_2 (
URL="jdbc:mysql://127.0.0.1:3306/demo_ds_2?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER="root",
PASSWORD="123456",
PROPERTIES("maximumPoolSize"=10)
), ds_study_dev_3 (
URL="jdbc:mysql://127.0.0.1:3306/demo_ds_3?serverTimezone=UTC&useSSL=false&allowPublicKeyRetrieval=true",
USER="root",
PASSWORD="123456",
PROPERTIES("maximumPoolSize"=10)
);
```
3. Create sharding table
```sql
CREATE SHARDING TABLE RULE t_membership_order (
DATANODES("ds_study_dev_${0}.t_membership_order_${0..3},ds_study_dev_${1}.t_membership_order_${4..7},ds_study_dev_${2}.t_membership_order_${8..11},ds_study_dev_${3}.t_membership_order_${12..15}"),
DATABASE_STRATEGY(
TYPE="STANDARD",
SHARDING_COLUMN=order_id,
SHARDING_ALGORITHM(
TYPE(NAME="inline",PROPERTIES("algorithm-expression"="ds_study_dev_${(order_id
% 16 / 4) as int}","allow-range-query-with-inline-sharding"=true)))
),
TABLE_STRATEGY(
TYPE="STANDARD",
SHARDING_COLUMN=order_id,
SHARDING_ALGORITHM(
TYPE(NAME="inline",PROPERTIES("algorithm-expression"="t_membership_order_${order_id
% 16}","allow-range-query-with-inline-sharding"=true)))
)
);
CREATE TABLE `t_membership_order` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`order_id` BIGINT(20) UNSIGNED NOT NULL COMMENT 'order id',
PRIMARY KEY (`id`)
);
```
4. Create a JDBC application and config ShardingSphere-JDBC in cluster mode
...
5. Execute SQL in JDBC with SQLHint

6. Execute SQL in JDBC with HintManager

--
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]