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 2022/07/13 12:09:15 UTC
[GitHub] [shardingsphere] csonezp opened a new pull request, #19110: make CONNECTION_ID() support alias
csonezp opened a new pull request, #19110:
URL: https://github.com/apache/shardingsphere/pull/19110
Fixes #17949
Changes proposed in this pull request:
- make CONNECTION_ID() support alias
--
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 #19110: make CONNECTION_ID() support alias
Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #19110:
URL: https://github.com/apache/shardingsphere/pull/19110
--
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 a diff in pull request #19110: make CONNECTION_ID() support alias
Posted by GitBox <gi...@apache.org>.
terrymanu commented on code in PR #19110:
URL: https://github.com/apache/shardingsphere/pull/19110#discussion_r920176180
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowConnectionIdExecutorTest.java:
##########
@@ -47,4 +72,28 @@ private ConnectionSession mockConnectionSession() {
when(result.getConnectionId()).thenReturn(109);
return result;
}
+
+ private SelectStatement mockSelectStatement() {
+
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
Review Comment:
Please remove useless blank line
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowConnectionIdExecutorTest.java:
##########
@@ -47,4 +72,28 @@ private ConnectionSession mockConnectionSession() {
when(result.getConnectionId()).thenReturn(109);
return result;
}
+
+ private SelectStatement mockSelectStatement() {
+
Review Comment:
Please remove useless blank line
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowConnectionIdExecutorTest.java:
##########
@@ -47,4 +72,28 @@ private ConnectionSession mockConnectionSession() {
when(result.getConnectionId()).thenReturn(109);
return result;
}
+
+ private SelectStatement mockSelectStatement() {
+
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
+ SelectStatement statement = mock(SelectStatement.class);
+ when(statement.getProjections()).thenReturn(segment);
+ return statement;
+ }
+
+ private SelectStatement mockSelectStatementWithAlias() {
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ExpressionProjectionSegment projectionSegment = new ExpressionProjectionSegment(0, 0, "connection_id()");
+ projectionSegment.setAlias(new AliasSegment(0, 0, new IdentifierValue("test_alias")));
+ projections.add(projectionSegment);
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
+ SelectStatement statement = mock(SelectStatement.class);
+ when(statement.getProjections()).thenReturn(segment);
+ return statement;
Review Comment:
return value should name as `result`
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowConnectionIdExecutorTest.java:
##########
@@ -47,4 +72,28 @@ private ConnectionSession mockConnectionSession() {
when(result.getConnectionId()).thenReturn(109);
return result;
}
+
+ private SelectStatement mockSelectStatement() {
+
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
+ SelectStatement statement = mock(SelectStatement.class);
+ when(statement.getProjections()).thenReturn(segment);
+ return statement;
+ }
+
+ private SelectStatement mockSelectStatementWithAlias() {
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ExpressionProjectionSegment projectionSegment = new ExpressionProjectionSegment(0, 0, "connection_id()");
+ projectionSegment.setAlias(new AliasSegment(0, 0, new IdentifierValue("test_alias")));
+ projections.add(projectionSegment);
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
Review Comment:
Please remove useless blank line
##########
shardingsphere-proxy/shardingsphere-proxy-backend/src/test/java/org/apache/shardingsphere/proxy/backend/text/admin/mysql/executor/ShowConnectionIdExecutorTest.java:
##########
@@ -47,4 +72,28 @@ private ConnectionSession mockConnectionSession() {
when(result.getConnectionId()).thenReturn(109);
return result;
}
+
+ private SelectStatement mockSelectStatement() {
+
+ Collection<ProjectionSegment> projections = new LinkedList<>();
+ ProjectionsSegment segment = mock(ProjectionsSegment.class);
+ when(segment.getProjections()).thenReturn(projections);
+
+ SelectStatement statement = mock(SelectStatement.class);
+ when(statement.getProjections()).thenReturn(segment);
+ return statement;
Review Comment:
return value should name as `result`
--
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 #19110: make CONNECTION_ID() support alias
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #19110:
URL: https://github.com/apache/shardingsphere/pull/19110#issuecomment-1183193235
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/19110?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 [#19110](https://codecov.io/gh/apache/shardingsphere/pull/19110?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (9cf148f) into [master](https://codecov.io/gh/apache/shardingsphere/commit/accc198c5e9ce0eff34c8874d1bfe2771f102360?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (accc198) will **decrease** coverage by `0.04%`.
> The diff coverage is `72.72%`.
```diff
@@ Coverage Diff @@
## master #19110 +/- ##
============================================
- Coverage 59.44% 59.39% -0.05%
- Complexity 2319 2321 +2
============================================
Files 3803 3804 +1
Lines 54666 54717 +51
Branches 9238 9227 -11
============================================
+ Hits 32494 32501 +7
- Misses 19442 19497 +55
+ Partials 2730 2719 -11
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/19110?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...nd/text/admin/mysql/MySQLAdminExecutorCreator.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2FkbWluL215c3FsL015U1FMQWRtaW5FeGVjdXRvckNyZWF0b3IuamF2YQ==) | `50.00% <0.00%> (+2.38%)` | :arrow_up: |
| [...admin/mysql/executor/ShowConnectionIdExecutor.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2FkbWluL215c3FsL2V4ZWN1dG9yL1Nob3dDb25uZWN0aW9uSWRFeGVjdXRvci5qYXZh) | `83.33% <80.00%> (-16.67%)` | :arrow_down: |
| [...ckend/text/data/DatabaseBackendHandlerFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2RhdGEvRGF0YWJhc2VCYWNrZW5kSGFuZGxlckZhY3RvcnkuamF2YQ==) | `40.00% <0.00%> (-10.00%)` | :arrow_down: |
| [...tor/dml/impl/ShardingDeleteStatementValidator.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmcvc2hhcmRpbmdzcGhlcmUtc2hhcmRpbmctY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvc2hhcmRpbmcvcm91dGUvZW5naW5lL3ZhbGlkYXRvci9kbWwvaW1wbC9TaGFyZGluZ0RlbGV0ZVN0YXRlbWVudFZhbGlkYXRvci5qYXZh) | `28.57% <0.00%> (-4.77%)` | :arrow_down: |
| [...er/standalone/StandaloneContextManagerBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtc3RhbmRhbG9uZS1tb2RlL3NoYXJkaW5nc3BoZXJlLXN0YW5kYWxvbmUtbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvc3RhbmRhbG9uZS9TdGFuZGFsb25lQ29udGV4dE1hbmFnZXJCdWlsZGVyLmphdmE=) | `84.61% <0.00%> (-3.39%)` | :arrow_down: |
| [...sphere/dbdiscovery/rule/DatabaseDiscoveryRule.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtZmVhdHVyZXMvc2hhcmRpbmdzcGhlcmUtZGItZGlzY292ZXJ5L3NoYXJkaW5nc3BoZXJlLWRiLWRpc2NvdmVyeS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9kYmRpc2NvdmVyeS9ydWxlL0RhdGFiYXNlRGlzY292ZXJ5UnVsZS5qYXZh) | `66.25% <0.00%> (-2.99%)` | :arrow_down: |
| [...gsphere/spi/type/required/RequiredSPIRegistry.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtc3BpL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9zcGkvdHlwZS9yZXF1aXJlZC9SZXF1aXJlZFNQSVJlZ2lzdHJ5LmphdmE=) | `57.14% <0.00%> (-2.86%)` | :arrow_down: |
| [...atabase/ShardingSphereDistributedDatabaseLock.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9jb29yZGluYXRvci9sb2NrL2RhdGFiYXNlL1NoYXJkaW5nU3BoZXJlRGlzdHJpYnV0ZWREYXRhYmFzZUxvY2suamF2YQ==) | `27.02% <0.00%> (-2.71%)` | :arrow_down: |
| [...roxy/frontend/mysql/err/MySQLErrPacketFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtbXlzcWwvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3Byb3h5L2Zyb250ZW5kL215c3FsL2Vyci9NeVNRTEVyclBhY2tldEZhY3RvcnkuamF2YQ==) | `55.93% <0.00%> (-1.97%)` | :arrow_down: |
| [...end/postgresql/err/PostgreSQLErrPacketFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/19110/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQvc2hhcmRpbmdzcGhlcmUtcHJveHktZnJvbnRlbmQtcG9zdGdyZXNxbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvZnJvbnRlbmQvcG9zdGdyZXNxbC9lcnIvUG9zdGdyZVNRTEVyclBhY2tldEZhY3RvcnkuamF2YQ==) | `31.57% <0.00%> (-1.76%)` | :arrow_down: |
| ... and [240 more](https://codecov.io/gh/apache/shardingsphere/pull/19110/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/19110?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/19110?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 [6145d75...9cf148f](https://codecov.io/gh/apache/shardingsphere/pull/19110?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] csonezp commented on pull request #19110: make CONNECTION_ID() support alias
Posted by GitBox <gi...@apache.org>.
csonezp commented on PR #19110:
URL: https://github.com/apache/shardingsphere/pull/19110#issuecomment-1183920374
@terrymanu done
--
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