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/26 11:36:53 UTC

[GitHub] [shardingsphere] sandynz commented on a diff in pull request #21727: fix issue: refactor MySQLJdbcQueryPropertiesExtension.

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