wsm12138 commented on issue #18434:
URL:
https://github.com/apache/shardingsphere/issues/18434#issuecomment-1159984785
# normal
#### server.yaml
```
rules:
- !AUTHORITY
users:
- root@%:root
# - sharding@:sharding
provider:
type: ALL_PERMITTED
- !SQL_PARSER
sqlCommentParseEnabled: true
sqlStatementCache:
initialCapacity: 2000
maximumSize: 65535
parseTreeCache:
initialCapacity: 128
maximumSize: 1024
props:
sql-show: true
```
#### sql
```
/* ShardingSphere hint: dataSourceName=ds_1 */ CREATE TABLE e(id int, name
char);
INSERT INTO e(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
/* ShardingSphere hint: dataSourceName=ds_2 */ CREATE TABLE f(id int, name
char);
INSERT INTO f(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
/* ShardingSphere hint: dataSourceName=ds_3 */ CREATE TABLE g(id int, name
char);
INSERT INTO g(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
preview select * from e;
preview select * from f;
preview select * from g;
```
#### behavior
<img width="670" alt="image"
src="https://user-images.githubusercontent.com/86462784/174529972-9c3da9f4-a49f-4e68-ad25-8e71c7302cbc.png">
# unnormal
#### server.yaml
```
mode:
type: Cluster
repository:
type: ZooKeeper
props:
namespace: 630_dzq
server-lists: ip:2181
retryIntervalMilliseconds: 500
timeToLiveSeconds: 60
maxRetries: 3
operationTimeoutMilliseconds: 500
overwrite: true
rules:
- !AUTHORITY
users:
- root@%:root
provider:
type: ALL_PERMITTED
props:
sql-show: true
```
#### sql
```
ALTER SQL_PARSER RULE SQL_COMMENT_PARSE_ENABLE=true;
/* ShardingSphere hint: dataSourceName=ds_1 */ CREATE TABLE e(id int, name
char);
INSERT INTO e(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
/* ShardingSphere hint: dataSourceName=ds_2 */ CREATE TABLE f(id int, name
char);
INSERT INTO f(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
/* ShardingSphere hint: dataSourceName=ds_3 */ CREATE TABLE g(id int, name
char);
INSERT INTO g(id, name) VALUES(1, '1'), (2, '2'), (3, '3');
preview select * from e;
preview select * from f;
preview select * from g;
```
#### behavior
<img width="538" alt="image"
src="https://user-images.githubusercontent.com/86462784/174530281-ddb7dd03-01e8-46cb-9352-8abb0e9f103b.png">
--
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]