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/06 12:55:23 UTC
[GitHub] [shardingsphere] yunmengmeng opened a new pull request, #18905: fix 18904(#18904)
yunmengmeng opened a new pull request, #18905:
URL: https://github.com/apache/shardingsphere/pull/18905
Fixes #18904
--
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 #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#issuecomment-1179997030
# [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/18905?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 [#18905](https://codecov.io/gh/apache/shardingsphere/pull/18905?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (e5a029a) into [master](https://codecov.io/gh/apache/shardingsphere/commit/23de794b0e381915db71196b2db46eeeb60f6a22?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (23de794) will **increase** coverage by `0.19%`.
> The diff coverage is `100.00%`.
```diff
@@ Coverage Diff @@
## master #18905 +/- ##
============================================
+ Coverage 59.25% 59.45% +0.19%
- Complexity 2292 2319 +27
============================================
Files 3779 3803 +24
Lines 54513 54667 +154
Branches 9221 9238 +17
============================================
+ Hits 32302 32500 +198
+ Misses 19492 19438 -54
- Partials 2719 2729 +10
```
| [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/18905?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...ore/statement/ShardingSpherePreparedStatement.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvc3RhdGVtZW50L1NoYXJkaW5nU3BoZXJlUHJlcGFyZWRTdGF0ZW1lbnQuamF2YQ==) | `64.08% <100.00%> (+0.83%)` | :arrow_up: |
| [...y/workerid/generator/ClusterWorkerIdGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9jb29yZGluYXRvci9yZWdpc3RyeS93b3JrZXJpZC9nZW5lcmF0b3IvQ2x1c3RlcldvcmtlcklkR2VuZXJhdG9yLmphdmE=) | `4.76% <0.00%> (-95.24%)` | :arrow_down: |
| [...orkerid/generator/StandaloneWorkerIdGenerator.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtc3RhbmRhbG9uZS1tb2RlL3NoYXJkaW5nc3BoZXJlLXN0YW5kYWxvbmUtbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvc3RhbmRhbG9uZS93b3JrZXJpZC9nZW5lcmF0b3IvU3RhbmRhbG9uZVdvcmtlcklkR2VuZXJhdG9yLmphdmE=) | `20.00% <0.00%> (-80.00%)` | :arrow_down: |
| [...nfra/metadata/database/ShardingSphereDatabase.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9tZXRhZGF0YS9kYXRhYmFzZS9TaGFyZGluZ1NwaGVyZURhdGFiYXNlLmphdmE=) | `68.00% <0.00%> (-26.45%)` | :arrow_down: |
| [...iver/jdbc/core/driver/ShardingSphereDriverURL.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtamRiYy9zaGFyZGluZ3NwaGVyZS1qZGJjLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL2RyaXZlci9qZGJjL2NvcmUvZHJpdmVyL1NoYXJkaW5nU3BoZXJlRHJpdmVyVVJMLmphdmE=) | `80.00% <0.00%> (-20.00%)` | :arrow_down: |
| [...ardingsphere/transaction/rule/TransactionRule.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uLWNvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL3RyYW5zYWN0aW9uL3J1bGUvVHJhbnNhY3Rpb25SdWxlLmphdmE=) | `20.40% <0.00%> (-10.15%)` | :arrow_down: |
| [...atus/compute/service/ComputeNodeStatusService.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9jb29yZGluYXRvci9yZWdpc3RyeS9zdGF0dXMvY29tcHV0ZS9zZXJ2aWNlL0NvbXB1dGVOb2RlU3RhdHVzU2VydmljZS5qYXZh) | `70.58% <0.00%> (-5.28%)` | :arrow_down: |
| [...shardingsphere/infra/instance/InstanceContext.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9pbnN0YW5jZS9JbnN0YW5jZUNvbnRleHQuamF2YQ==) | `48.57% <0.00%> (-5.09%)` | :arrow_down: |
| [...min/postgresql/PostgreSQLAdminExecutorCreator.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2FkbWluL3Bvc3RncmVzcWwvUG9zdGdyZVNRTEFkbWluRXhlY3V0b3JDcmVhdG9yLmphdmE=) | `56.00% <0.00%> (-4.61%)` | :arrow_down: |
| [.../distsql/ral/impl/QueryableRALStatementAssert.java](https://codecov.io/gh/apache/shardingsphere/pull/18905/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-c2hhcmRpbmdzcGhlcmUtdGVzdC9zaGFyZGluZ3NwaGVyZS1wYXJzZXItdGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdGVzdC9zcWwvcGFyc2VyL3BhcmFtZXRlcml6ZWQvYXNzZXJ0cy9zdGF0ZW1lbnQvZGlzdHNxbC9yYWwvaW1wbC9RdWVyeWFibGVSQUxTdGF0ZW1lbnRBc3NlcnQuamF2YQ==) | `95.65% <0.00%> (-4.35%)` | :arrow_down: |
| ... and [120 more](https://codecov.io/gh/apache/shardingsphere/pull/18905/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/18905?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/18905?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 [23de794...e5a029a](https://codecov.io/gh/apache/shardingsphere/pull/18905?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] terrymanu merged pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
terrymanu merged PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905
--
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] strongduanmu commented on pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#issuecomment-1193706242
Hi @yunmengmeng, can you sync the latest master branch code?
--
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] strongduanmu commented on a diff in pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#discussion_r925147197
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,31 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastIdObject = null;
+ Object idObject = null;
+ for (int i = 1; i <= 3; i++) {
+ preparedStatement.setObject(1, null);
+ preparedStatement.setString(2, "OK");
+ preparedStatement.executeUpdate();
+ ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
+ assertTrue(generatedKeys.next());
+ int columnCount = generatedKeys.getMetaData().getColumnCount();
+ for (int index = 0; index < columnCount; index++) {
Review Comment:
Can you remove this loop logic? Just call `generatedKeys.getObject(1)` once.
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -30,30 +31,31 @@
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertNotEquals;
public final class ReadwriteSplittingPreparedStatementTest extends AbstractShardingSphereDataSourceForReadwriteSplittingTest {
-
Review Comment:
Please execute `mvn spotless:apply` to format code on your local machine.
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,31 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastIdObject = null;
Review Comment:
Do you think `lastGeneratedId` and `generatedId` is better?
--
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] rfscholte commented on pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
rfscholte commented on PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#issuecomment-1190050874
@strongduanmu hi me?
--
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] strongduanmu commented on a diff in pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
strongduanmu commented on code in PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#discussion_r928198232
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,28 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastGeneratedId = null;
+ Object generatedId = null;
+ for (int i = 1; i <= 3; i++) {
+ preparedStatement.setObject(1, null);
+ preparedStatement.setString(2, "OK");
+ preparedStatement.executeUpdate();
+ ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
+ assertTrue(generatedKeys.next());
+ generatedId = generatedKeys.getObject(1);
+ assertNotEquals(lastGeneratedId, generatedId);
Review Comment:
Please use assertThat instead of assertNotEquals.
--
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] yunmengmeng commented on a diff in pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
yunmengmeng commented on code in PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#discussion_r928378079
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,28 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastGeneratedId = null;
+ Object generatedId = null;
+ for (int i = 1; i <= 3; i++) {
+ preparedStatement.setObject(1, null);
+ preparedStatement.setString(2, "OK");
+ preparedStatement.executeUpdate();
+ ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
+ assertTrue(generatedKeys.next());
+ generatedId = generatedKeys.getObject(1);
+ assertNotEquals(lastGeneratedId, generatedId);
Review Comment:
ok
--
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] yunmengmeng commented on a diff in pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
yunmengmeng commented on code in PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#discussion_r925236275
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,31 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastIdObject = null;
+ Object idObject = null;
+ for (int i = 1; i <= 3; i++) {
+ preparedStatement.setObject(1, null);
+ preparedStatement.setString(2, "OK");
+ preparedStatement.executeUpdate();
+ ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
+ assertTrue(generatedKeys.next());
+ int columnCount = generatedKeys.getMetaData().getColumnCount();
+ for (int index = 0; index < columnCount; index++) {
Review Comment:
> Can you remove this loop logic? Just call `generatedKeys.getObject(1)` once.
I saw the previous test case and imitated it.I have changed them now.
--
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] yunmengmeng commented on pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
yunmengmeng commented on PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#issuecomment-1179970848
> Can you fix the CI?
ok , i change the code and pull the request again
--
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] yunmengmeng commented on a diff in pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
yunmengmeng commented on code in PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#discussion_r928378288
##########
shardingsphere-jdbc/shardingsphere-jdbc-core/src/test/java/org/apache/shardingsphere/driver/jdbc/core/statement/ReadwriteSplittingPreparedStatementTest.java:
##########
@@ -92,4 +94,28 @@ public void assertGetGeneratedKeysWithPrimaryKeyIsNull() throws SQLException {
assertFalse(generatedKeys.next());
}
}
+
+ @Test
+ public void assertGetGeneratedKeysWithPrimaryKeyIsNullInTransactional() throws SQLException {
+ try (
+ Connection connection = getReadwriteSplittingDataSource()
+ .getConnection();
+ PreparedStatement preparedStatement = connection.prepareStatement("INSERT INTO t_config(id, status) VALUES(?, ?);", Statement.RETURN_GENERATED_KEYS)) {
+ connection.setAutoCommit(false);
+ Object lastGeneratedId = null;
+ Object generatedId = null;
+ for (int i = 1; i <= 3; i++) {
+ preparedStatement.setObject(1, null);
+ preparedStatement.setString(2, "OK");
+ preparedStatement.executeUpdate();
+ ResultSet generatedKeys = preparedStatement.getGeneratedKeys();
+ assertTrue(generatedKeys.next());
+ generatedId = generatedKeys.getObject(1);
+ assertNotEquals(lastGeneratedId, generatedId);
Review Comment:
> Please use assertThat instead of assertNotEquals.
ok
--
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] yunmengmeng commented on pull request #18905: fix 18904(#18904)
Posted by GitBox <gi...@apache.org>.
yunmengmeng commented on PR #18905:
URL: https://github.com/apache/shardingsphere/pull/18905#issuecomment-1196534331
> Hi @yunmengmeng, can you sync the latest master branch code?
It seems that it created one more single_table. When executing sql "SHOW SINGLE TABLES",it's expected 3 and returned 4.I don't kown whether it is related to my change code ?
--
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