Skip to content

Commit

Permalink
[improvement](sqlserver catalog) Configurable whether to use encrypt …
Browse files Browse the repository at this point in the history
…when connecting to SQL Server using the catalog (apache#36659)

In previous versions, we used druid as the default JDBC connection pool,
which can use custom decryption to parse the certificate when SQL Server
encryption is turned on. However, in the new version, after changing
HikariCP as the default connection pool, the SQLServer certificate
cannot be parsed, so encryption needs to be turned off for normal use.
Therefore, a parameter is added to decide whether to disable SQLServer
encryption. It is not disabled by default.
  • Loading branch information
zy-kkk authored Jun 27, 2024
1 parent 83cd4f0 commit dd77c84
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ public class Config extends ConfigBase {
"MySQL Jdbc Catalog mysql does not support pushdown functions"})
public static String[] jdbc_mysql_unsupported_pushdown_functions = {"date_trunc", "money_format", "negative"};

@ConfField(description = {"SQLServer Jdbc Catalog 关闭加密",
"SQLServer Jdbc Catalog close encrypt"})
public static boolean disable_jdbc_sqlserver_encrypt = false;

@ConfField(mutable = true, masterOnly = true, description = {"broker load 时,单个节点上 load 执行计划的默认并行度",
"The default parallelism of the load execution plan on a single node when the broker load is submitted"})
public static int default_load_parallelism = 8;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ public static String handleJdbcUrl(String jdbcUrl) throws DdlException {
newJdbcUrl = checkAndSetJdbcBoolParam(dbType, newJdbcUrl, "reWriteBatchedInserts", "false", "true");
}
if (dbType.equals(SQLSERVER)) {
if (Config.disable_jdbc_sqlserver_encrypt) {
newJdbcUrl = checkAndSetJdbcBoolParam(dbType, newJdbcUrl, "encrypt", "true", "false");
}
newJdbcUrl = checkAndSetJdbcBoolParam(dbType, newJdbcUrl, "useBulkCopyForBatchInsert", "false", "true");
}
return newJdbcUrl;
Expand Down

0 comments on commit dd77c84

Please sign in to comment.