You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/01 13:22:22 UTC
[GitHub] [shardingsphere] totalo opened a new pull request #12161: Fixed #12157.
totalo opened a new pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161
Fixes #12157.
Changes proposed in this pull request:
- Fix the separator problem under window.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-911201109
> > > > What is the result with `System.lineSeparator()` in windows?
> > >
> > >
> > > Below win is \r\n.
> >
> >
> > Why `\r\n` cause error?
>
> > > > What is the result with `System.lineSeparator()` in windows?
> > >
> > >
> > > Below win is \r\n.
> >
> >
> > Why `\r\n` cause error?
>
> It is because `YamlEngine.marshal(swapYamlDataSourceConfiguration(dataSourceConfigs))` returns are divided by `\n`, but our parameters are divided by` \r\n`. So the parameters are not equal.I am looking for why it will be divided by `\n ` in the windows environment.
I found that when yaml conversion, the default Unix delimiter is used, and we need to automatically obtain the system delimiter when converting.

--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu commented on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
terrymanu commented on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-911024289
> > What is the result with `System.lineSeparator()` in windows?
>
> Below win is \r\n.
Why `\r\n` cause error?
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] codecov-commenter commented on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-911641348
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#12161](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a9bd093) into [master](https://codecov.io/gh/apache/shardingsphere/commit/8d567410d64da2dc56b821125608cb5e8716470c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8d56741) will **decrease** coverage by `0.19%`.
> The diff coverage is `82.85%`.
[](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #12161 +/- ##
============================================
- Coverage 63.92% 63.72% -0.20%
- Complexity 1252 1258 +6
============================================
Files 2322 2327 +5
Lines 35295 35415 +120
Branches 6140 6161 +21
============================================
+ Hits 22561 22569 +8
- Misses 10914 11032 +118
+ Partials 1820 1814 -6
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...route/impl/ReadwriteSplittingDataSourceRouter.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtcmVhZHdyaXRlLXNwbGl0dGluZy9zaGFyZGluZ3NwaGVyZS1yZWFkd3JpdGUtc3BsaXR0aW5nLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3JlYWR3cml0ZXNwbGl0dGluZy9yb3V0ZS9pbXBsL1JlYWR3cml0ZVNwbGl0dGluZ0RhdGFTb3VyY2VSb3V0ZXIuamF2YQ==) | `42.10% <ø> (ø)` | |
| [...phere/sharding/support/InlineExpressionParser.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctYXBpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zaGFyZGluZy9zdXBwb3J0L0lubGluZUV4cHJlc3Npb25QYXJzZXIuamF2YQ==) | `0.00% <0.00%> (ø)` | |
| [...arding/complex/ComplexInlineShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2NvbXBsZXgvQ29tcGxleElubGluZVNoYXJkaW5nQWxnb3JpdGhtLmphdmE=) | `87.50% <ø> (ø)` | |
| [...thm/sharding/hint/HintInlineShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2hpbnQvSGludElubGluZVNoYXJkaW5nQWxnb3JpdGhtLmphdmE=) | `85.71% <ø> (ø)` | |
| [...rithm/sharding/inline/InlineShardingAlgorithm.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvYWxnb3JpdGhtL3NoYXJkaW5nL2lubGluZS9JbmxpbmVTaGFyZGluZ0FsZ29yaXRobS5qYXZh) | `88.88% <ø> (ø)` | |
| [...apache/shardingsphere/sharding/rule/TableRule.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcnVsZS9UYWJsZVJ1bGUuamF2YQ==) | `87.35% <ø> (ø)` | |
| [...l/parser/core/ShardingDistSQLStatementVisitor.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctZGlzdHNxbC9zaGFyZGluZ3NwaGVyZS1zaGFyZGluZy1kaXN0c3FsLXBhcnNlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvZGlzdHNxbC9wYXJzZXIvY29yZS9TaGFyZGluZ0Rpc3RTUUxTdGF0ZW1lbnRWaXNpdG9yLmphdmE=) | `0.00% <0.00%> (ø)` | |
| [...jdbc/core/connection/ShardingSphereConnection.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvY29ubmVjdGlvbi9TaGFyZGluZ1NwaGVyZUNvbm5lY3Rpb24uamF2YQ==) | `47.57% <ø> (ø)` | |
| [...re/spring/boot/datasource/DataSourceMapSetter.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLXNwcmluZy9zaGFyZGluZ3NwaGVyZS1qZGJjLXNwcmluZy1pbmZyYS9zaGFyZGluZ3NwaGVyZS1qZGJjLXNwcmluZy1ib290LXN0YXJ0ZXItaW5mcmEvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3NwcmluZy9ib290L2RhdGFzb3VyY2UvRGF0YVNvdXJjZU1hcFNldHRlci5qYXZh) | `53.33% <ø> (ø)` | |
| [.../shardingsphere/transaction/TransactionHolder.java](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3RyYW5zYWN0aW9uL1RyYW5zYWN0aW9uSG9sZGVyLmphdmE=) | `100.00% <ø> (ø)` | |
| ... and [59 more](https://codecov.io/gh/apache/shardingsphere/pull/12161/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [22aee26...a9bd093](https://codecov.io/gh/apache/shardingsphere/pull/12161?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-911187348
> > > What is the result with `System.lineSeparator()` in windows?
> >
> >
> > Below win is \r\n.
>
> Why `\r\n` cause error?
> > > What is the result with `System.lineSeparator()` in windows?
> >
> >
> > Below win is \r\n.
>
> Why `\r\n` cause error?
It is because `YamlEngine.marshal(swapYamlDataSourceConfiguration(dataSourceConfigs))` returns are divided by `\n`, but our parameters are divided by` \r\n`. So the parameters are not equal.I am looking for why it will be divided by `\n ` in the windows environment.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] SteNicholas commented on a change in pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
SteNicholas commented on a change in pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#discussion_r700388625
##########
File path: shardingsphere-mode/shardingsphere-mode-core/src/test/java/org/apache/shardingsphere/mode/persist/service/impl/DataSourcePersistServiceTest.java
##########
@@ -61,7 +61,7 @@ public void assertLoad() {
@SneakyThrows({IOException.class, URISyntaxException.class})
private String readDataSourceYaml(final String path) {
return Files.readAllLines(Paths.get(ClassLoader.getSystemResource(path).toURI()))
- .stream().filter(each -> StringUtils.isNotBlank(each) && !each.startsWith("#")).map(each -> each + System.lineSeparator()).collect(Collectors.joining());
+ .stream().filter(each -> StringUtils.isNotBlank(each) && !each.startsWith("#")).map(each -> each + "\n").collect(Collectors.joining());
Review comment:
It shouldn't be fixed here. `System.lineSeparator()` does return the line separator, it will return the corresponding line separator according to the current computer system. Or you could try to use the `System.getProperty("line.separator")`.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo edited a comment on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
totalo edited a comment on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-910304846
> What is the result with `System.lineSeparator()` in windows?
Below win is \r\n.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] terrymanu merged pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
terrymanu merged pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [shardingsphere] totalo commented on pull request #12161: Fix the separator problem under window.
Posted by GitBox <gi...@apache.org>.
totalo commented on pull request #12161:
URL: https://github.com/apache/shardingsphere/pull/12161#issuecomment-910304846
> What is the result with `System.lineSeparator()` in windows?
Below win is /r/n.
--
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: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org