Skip to content

Commit f080e56

Browse files
authored
merge dev/4.2.2 into main (#915)
merge dev/4.2.2 into main
2 parents 526d3ea + 1284a39 commit f080e56

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

server/odc-core/src/main/java/com/oceanbase/odc/core/sql/util/JdbcDataTypeUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public static void setValueIntoStatement(CallableStatement statement, int index,
147147
public static Object getValueFromStatement(CallableStatement statement, int index, String type)
148148
throws SQLException {
149149
JDBCType jdbcType = parseDataType(type);
150-
if (null == statement.getString(index)) {
150+
if (null == statement.getObject(index)) {
151151
return null;
152152
}
153153
switch (jdbcType) {

server/odc-service/src/main/java/com/oceanbase/odc/service/session/factory/DruidDataSourceFactory.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ private void init(DruidDataSource dataSource) {
9292
properties.setProperty("allowLoadLocalInfile", "false");
9393
properties.setProperty("allowUrlInLocalInfile", "false");
9494
properties.setProperty("allowLoadLocalInfileInPath", "");
95+
properties.setProperty("autoDeserialize", "false");
9596
dataSource.setConnectProperties(properties);
9697
try {
9798
setConnectAndSocketTimeoutFromJdbcUrl(dataSource);

server/odc-service/src/main/java/com/oceanbase/odc/service/session/factory/OBConsoleDataSourceFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ public static Map<String, String> getJdbcParams(@NonNull ConnectionConfig connec
180180
// fix arbitrary file reading vulnerability
181181
jdbcUrlParams.put("allowLoadLocalInfile", "false");
182182
jdbcUrlParams.put("allowUrlInLocalInfile", "false");
183+
jdbcUrlParams.put("allowLoadLocalInfileInPath", "");
184+
jdbcUrlParams.put("autoDeserialize", "false");
183185
return jdbcUrlParams;
184186
}
185187

@@ -198,6 +200,7 @@ public DataSource getDataSource() {
198200
properties.setProperty("allowLoadLocalInfile", "false");
199201
properties.setProperty("allowUrlInLocalInfile", "false");
200202
properties.setProperty("allowLoadLocalInfileInPath", "");
203+
properties.setProperty("autoDeserialize", "false");
201204
dataSource.setConnectionProperties(properties);
202205
if (autoCommit != null) {
203206
dataSource.setAutoCommit(autoCommit);

server/plugins/connect-plugin-mysql/src/main/java/com/oceanbase/odc/plugin/connect/mysql/MySQLConnectionExtension.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public TestResult test(String jdbcUrl, String username, String password, int que
7171
properties.setProperty("allowLoadLocalInfile", "false");
7272
properties.setProperty("allowUrlInLocalInfile", "false");
7373
properties.setProperty("allowLoadLocalInfileInPath", "");
74+
properties.setProperty("autoDeserialize", "false");
7475
TestResult testResult = test(jdbcUrl, properties, queryTimeout);
7576
if (testResult.getErrorCode() != null) {
7677
return testResult;

0 commit comments

Comments
 (0)