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/10/24 13:15:49 UTC

[GitHub] [shardingsphere] pandaapo opened a new pull request, #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

pandaapo opened a new pull request, #21727:
URL: https://github.com/apache/shardingsphere/pull/21727

   Fixes #21701.
   
   ---
   
   Before committing this PR, I'm sure that I have checked the following options:
   - [x] My code follows the [code of conduct](https://shardingsphere.apache.org/community/en/involved/conduct/code/) of this project.
   - [x] I have self-reviewed the commit code.
   - [ ] I have (or in comment I request) added corresponding labels for the pull request.
   - [ ] I have passed maven check locally : `mvn clean install -B -T2C -DskipTests -Dmaven.javadoc.skip=true -e`.
   - [ ] I have made corresponding changes to the documentation.
   - [ ] I have added corresponding unit tests for my changes.
   


-- 
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] sandynz merged pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

Posted by GitBox <gi...@apache.org>.
sandynz merged PR #21727:
URL: https://github.com/apache/shardingsphere/pull/21727


-- 
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] sandynz commented on pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

Posted by GitBox <gi...@apache.org>.
sandynz commented on PR #21727:
URL: https://github.com/apache/shardingsphere/pull/21727#issuecomment-1291899387

   Hi @pandaapo , thanks for your contribution. I've just submit the review.


-- 
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] sandynz commented on a diff in pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

Posted by GitBox <gi...@apache.org>.
sandynz commented on code in PR #21727:
URL: https://github.com/apache/shardingsphere/pull/21727#discussion_r1005564286


##########
kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/datasource/MySQLJdbcQueryPropertiesExtension.java:
##########
@@ -47,14 +49,19 @@ public MySQLJdbcQueryPropertiesExtension() {
         queryProps.setProperty("useSSL", Boolean.FALSE.toString());
         queryProps.setProperty("rewriteBatchedStatements", Boolean.TRUE.toString());
         queryProps.setProperty("yearIsDateType", Boolean.FALSE.toString());
+        queryProps.setProperty("zeroDateTimeBehavior", getZeroDateTimeBehavior());
+        queryProps.setProperty("noDatetimeStringSync", Boolean.TRUE.toString());
+        queryProps.setProperty("jdbcCompliantTruncation", Boolean.FALSE.toString());
+

Review Comment:
   This blank line could be deleted



##########
kernel/data-pipeline/dialect/mysql/src/main/java/org/apache/shardingsphere/data/pipeline/mysql/datasource/MySQLJdbcQueryPropertiesExtension.java:
##########
@@ -29,15 +29,17 @@
 @Slf4j
 public final class MySQLJdbcQueryPropertiesExtension implements JdbcQueryPropertiesExtension {
     
-    private static String mysqlConnectorVersion;
+    private static final String MYSQL_CONNECTOR_VERSION = initMysqlConnectorVersion();
     
-    static {
+    private static String initMysqlConnectorVersion() {
         try {
             Class<?> mysqlDriverClass = MySQLJdbcQueryPropertiesExtension.class.getClassLoader().loadClass("com.mysql.jdbc.Driver");
-            mysqlConnectorVersion = mysqlDriverClass.getPackage().getImplementationVersion();
+            String mysqlConnectorVersion = mysqlDriverClass.getPackage().getImplementationVersion();

Review Comment:
   Variable name `mysqlConnectorVersion` should be `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] pandaapo commented on pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

Posted by GitBox <gi...@apache.org>.
pandaapo commented on PR #21727:
URL: https://github.com/apache/shardingsphere/pull/21727#issuecomment-1291894204

   @sandynz Could you review this PR?


-- 
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] pandaapo commented on pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

Posted by GitBox <gi...@apache.org>.
pandaapo commented on PR #21727:
URL: https://github.com/apache/shardingsphere/pull/21727#issuecomment-1292089082

   > Hi @pandaapo , thanks for your contribution. I've just submit the review.
   
   Thanks for you review.


-- 
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