thswlsqls opened a new issue, #40198:
URL: https://github.com/apache/shardingsphere/issues/40198
## Bug Report
### Which version of ShardingSphere did you use?
master @ 01446d4fad4
### Which project did you use? ShardingSphere-JDBC or ShardingSphere-Proxy?
ShardingSphere-Proxy
### Expected behavior
`CONVERT YAML CONFIGURATION FROM FILE` should output a `REGISTER STORAGE
UNIT` statement that can be executed again.
### Actual behavior
When a data source omits `maxPoolSize`, the output ends with a trailing
comma:
`PROPERTIES('minPoolSize'='1','connectionTimeoutMilliseconds'='30000',)`. When
a data source has only `customPoolProps`, the output starts with a comma:
`PROPERTIES(,'foo1'='bar_1')`. Both are rejected by the DistSQL grammar
`property (COMMA_ property)*`.
### Reason analyze (If you can)
`ConvertYamlConfigurationExecutor.getDataSourcePoolProps()` skips null
values but adds a comma whenever `iterator.hasNext()` is true.
`DataSourcePoolPropertiesCreator` puts omitted standard pool keys as null, and
`maxPoolSize` is iterated last. The separator before custom properties is added
even when no standard property was written.
### Steps to reproduce the behavior, such as: SQL to execute, sharding rule
configuration, when exception occur etc.
1. Create a database YAML whose data source sets
`connectionTimeoutMilliseconds: 30000` and `minPoolSize: 1` but not
`maxPoolSize`.
2. Run `CONVERT YAML CONFIGURATION FROM FILE '<path>'` in Proxy.
3. Execute the returned statement; parsing fails.
### Example codes for reproduce this issue (such as a github link).
N/A
--
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]