Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
YaoFly authored Dec 24, 2024
2 parents 31f9f11 + 972eabd commit 878d16b
Show file tree
Hide file tree
Showing 327 changed files with 4,747 additions and 1,532 deletions.
5 changes: 5 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
1. Proxy Native: Support Seata AT integration under Proxy Native in GraalVM Native Image - [#33889](https://github.com/apache/shardingsphere/pull/33889)
1. Agent: Simplify the use of Agent's Docker Image - [#33356](https://github.com/apache/shardingsphere/pull/33356)
1. Metadata: Add load-table-metadata-batch-size props to concurrent load table metadata - [#34009](https://github.com/apache/shardingsphere/pull/34009)
1. SQL Binder: Add sql bind logic for create table statement - [#34074](https://github.com/apache/shardingsphere/pull/34074)
1. SQL Binder: Support create index statement sql bind - [#34112](https://github.com/apache/shardingsphere/pull/34112)
1. SQL Parser: Support MySQL update with statement parse - [#34126](https://github.com/apache/shardingsphere/pull/34126)

### Bug Fixes

Expand All @@ -55,6 +58,8 @@
1. Encrypt: Fixes merge exception without encrypt rule in database - [#33708](https://github.com/apache/shardingsphere/pull/33708)
1. SQL Binder: Fixes the expression segment cannot find the outer table when binding - [#34015](https://github.com/apache/shardingsphere/pull/34015)
1. Proxy: Fixes "ALL PRIVILEGES ON `DB`.*" is not recognized during SELECT privilege verification for MySQL - [#34037](https://github.com/apache/shardingsphere/pull/34037)
1. Encrypt: Use sql bind info in EncryptInsertPredicateColumnTokenGenerator to avoid wrong column table mapping - [#34110](https://github.com/apache/shardingsphere/pull/34110)
1. Proxy: Fix mysql longblob wrong column type returned by proxy protocol - [#34121](https://github.com/apache/shardingsphere/pull/34121)

### Change Logs

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ void assertStart() throws IOException {
private ContextManager mockContextManager() {
MetaDataContexts metaDataContexts = MetaDataContextsFactory.create(mock(MetaDataPersistService.class), new ShardingSphereMetaData());
ComputeNodeInstanceContext computeNodeInstanceContext = new ComputeNodeInstanceContext(
new ComputeNodeInstance(mock(InstanceMetaData.class)), new StandaloneWorkerIdGenerator(), new ModeConfiguration("Standalone", null),
mock(LockContext.class), new EventBusContext());
new ComputeNodeInstance(mock(InstanceMetaData.class)), new ModeConfiguration("Standalone", null), new EventBusContext());
computeNodeInstanceContext.init(new StandaloneWorkerIdGenerator(), mock(LockContext.class));
return new ContextManager(metaDataContexts, computeNodeInstanceContext, mock(PersistRepository.class));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ public enum MySQLBinaryColumnType implements BinaryColumnType {
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.DATE, DATE);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.TIME, TIME);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.TIMESTAMP, TIMESTAMP);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.BINARY, STRING);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.VARBINARY, VAR_STRING);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.LONGVARBINARY, VAR_STRING);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.BINARY, LONG_BLOB);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.VARBINARY, TINY_BLOB);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.LONGVARBINARY, BLOB);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.NULL, NULL);
JDBC_TYPE_AND_COLUMN_TYPE_MAP.put(Types.BLOB, BLOB);
for (MySQLBinaryColumnType each : values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public enum MySQLCharacterSet {
UTF32_GENERAL_CI(60, () -> Charset.forName("utf32")),
UTF32_BIN(61, () -> Charset.forName("utf32")),
UTF16LE_BIN(62, () -> StandardCharsets.UTF_16LE),
BINARY(63, () -> Charset.forName("binary")),
ARMSCII8_BIN(64, () -> Charset.forName("armscii8")),
ASCII_BIN(65, () -> StandardCharsets.US_ASCII),
CP1250_BIN(66, () -> Charset.forName("cp1250")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ void assertValueOfJDBC() {
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.DATE), is(MySQLBinaryColumnType.DATE));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.TIME), is(MySQLBinaryColumnType.TIME));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.TIMESTAMP), is(MySQLBinaryColumnType.TIMESTAMP));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.BINARY), is(MySQLBinaryColumnType.STRING));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.VARBINARY), is(MySQLBinaryColumnType.VAR_STRING));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.LONGVARBINARY), is(MySQLBinaryColumnType.VAR_STRING));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.BINARY), is(MySQLBinaryColumnType.LONG_BLOB));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.VARBINARY), is(MySQLBinaryColumnType.TINY_BLOB));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.LONGVARBINARY), is(MySQLBinaryColumnType.BLOB));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.NULL), is(MySQLBinaryColumnType.NULL));
assertThat(MySQLBinaryColumnType.valueOfJDBCType(Types.BLOB), is(MySQLBinaryColumnType.BLOB));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final class OpenGaussProtocolDefaultVersionProvider implements DatabasePr

@Override
public String provide() {
return "12.3";
return "9.2.4";
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import lombok.NoArgsConstructor;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.apache.shardingsphere.infra.util.string.HexStringUtil;

import javax.crypto.Mac;
import javax.crypto.SecretKeyFactory;
Expand Down Expand Up @@ -58,7 +59,7 @@ public final class OpenGaussMacCalculator {
public static String requestServerMac(final String password, final OpenGaussAuthenticationHexData authHexData, final int serverIteration) {
byte[] serverKey = getMacResult(generateSecretKey(password, authHexData.getSalt(), serverIteration), MacType.SERVER.data.getBytes(StandardCharsets.UTF_8));
byte[] result = getMacResult(serverKey, toHexBytes(authHexData.getNonce()));
return toHexString(result);
return HexStringUtil.toHexString(result);
}

/**
Expand Down Expand Up @@ -118,18 +119,6 @@ private static byte charToByte(final char c) {
return (byte) "0123456789ABCDEF".indexOf(c);
}

private static String toHexString(final byte[] hexBytes) {
StringBuilder result = new StringBuilder();
for (byte each : hexBytes) {
String hex = Integer.toHexString(each & 255);
if (hex.length() < 2) {
result.append(0);
}
result.append(hex);
}
return result.toString();
}

private static byte[] xor(final byte[] password1, final byte[] password2) {
Preconditions.checkArgument(password1.length == password2.length, "Xor values with different length.");
int length = password1.length;
Expand Down
1 change: 1 addition & 0 deletions distribution/agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
<profile>
<id>release</id>
<properties>
<remoteresources.skip>false</remoteresources.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<checkstyle.skip>false</checkstyle.skip>
<rat.skip>false</rat.skip>
Expand Down
1 change: 1 addition & 0 deletions distribution/jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<profile>
<id>release</id>
<properties>
<remoteresources.skip>false</remoteresources.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<checkstyle.skip>false</checkstyle.skip>
<rat.skip>false</rat.skip>
Expand Down
1 change: 1 addition & 0 deletions distribution/proxy/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<profile>
<id>release</id>
<properties>
<remoteresources.skip>false</remoteresources.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<checkstyle.skip>false</checkstyle.skip>
<rat.skip>false</rat.skip>
Expand Down
1 change: 1 addition & 0 deletions distribution/src/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<profile>
<id>release</id>
<properties>
<remoteresources.skip>false</remoteresources.skip>
<maven.javadoc.skip>false</maven.javadoc.skip>
<checkstyle.skip>false</checkstyle.skip>
<rat.skip>false</rat.skip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.3</version>
<version>0.10.4</version>
<extensions>true</extensions>
<configuration>
<buildArgs>
Expand Down Expand Up @@ -85,12 +85,12 @@ java.beans.Introspector was unintentionally initialized at build time. To see wh

```groovy
plugins {
id 'org.graalvm.buildtools.native' version '0.10.3'
id 'org.graalvm.buildtools.native' version '0.10.4'
}
dependencies {
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip')
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.4', classifier: 'repository', ext: 'zip')
}
graalvmNative {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ and the documentation of GraalVM Native Build Tools shall prevail.
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.10.3</version>
<version>0.10.4</version>
<extensions>true</extensions>
<configuration>
<buildArgs>
Expand Down Expand Up @@ -89,12 +89,12 @@ Reference https://github.com/graalvm/native-build-tools/issues/572 .

```groovy
plugins {
id 'org.graalvm.buildtools.native' version '0.10.3'
id 'org.graalvm.buildtools.native' version '0.10.4'
}
dependencies {
implementation 'org.apache.shardingsphere:shardingsphere-jdbc:${shardingsphere.version}'
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.3', classifier: 'repository', ext: 'zip')
implementation(group: 'org.graalvm.buildtools', name: 'graalvm-reachability-metadata', version: '0.10.4', classifier: 'repository', ext: 'zip')
}
graalvmNative {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,20 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0
username: default
password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1
username: default
password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2
username: default
password:
rules:
- !SHARDING
tables:
Expand Down Expand Up @@ -305,14 +311,20 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0?transactionSupport=true
username: default
password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1?transactionSupport=true
username: default
password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2?transactionSupport=true
username: default
password:
rules:
- !SHARDING
tables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,20 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0
username: default
password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1
username: default
password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2
username: default
password:
rules:
- !SHARDING
tables:
Expand Down Expand Up @@ -311,14 +317,20 @@ dataSources:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_0?transactionSupport=true
username: default
password:
ds_1:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_1?transactionSupport=true
username: default
password:
ds_2:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.clickhouse.jdbc.ClickHouseDriver
jdbcUrl: jdbc:ch://localhost:8123/demo_ds_2?transactionSupport=true
username: default
password:
rules:
- !SHARDING
tables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ public class ExampleUtils {
assert null == System.getProperty("fixture.hive.ds2.jdbc-url");
String absolutePath = Paths.get("src/test/resources/init.sql").toAbsolutePath().toString();
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_0;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_1;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_2;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds1.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_1;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds2.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_2;initFile=" + absolutePath);
return new HikariDataSource(config);
} finally {
System.clearProperty("fixture.hive.ds0.jdbc-url");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,8 @@ public class ExampleUtils {
assert null == System.getProperty("fixture.hive.ds2.jdbc-url");
String absolutePath = Paths.get("src/test/resources/init.sql").toAbsolutePath().toString();
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_0;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_1;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds0.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_2;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds1.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_1;initFile=" + absolutePath);
System.setProperty("fixture.hive.ds2.jdbc-url", "jdbc:hive2://localhost:10000/demo_ds_2;initFile=" + absolutePath);
return new HikariDataSource(config);
} finally {
System.clearProperty("fixture.hive.ds0.jdbc-url");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,3 +609,15 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer {
5. 微服务实例 `a-service``b-service` 均为 Spring Boot 微服务,但使用的组件是 Spring WebFlux 而非 Spring WebMVC。
在反应式编程 API 下 ShardingSphere JDBC 无法处理 R2DBC DataSource,仅可处理 JDBC DataSource。
在使用 WebFlux 组件的 Spring Boot 微服务中应避免创建 ShardingSphere JDBC DataSource。

### Log 配置

在业务项目启动 Seata Client 后,可能看到如下的 Error Log。

```shell
[ERROR] 2024-12-20 11:46:43.878 [ForkJoinPool.commonPool-worker-1] o.a.s.config.ConfigurationFactory - failed to load non-spring configuration :not found service provider for : org.apache.seata.config.ConfigurationProvider
org.apache.seata.common.loader.EnhancedServiceNotFoundException: not found service provider for : org.apache.seata.config.ConfigurationProvider
```

根据 https://github.com/apache/incubator-seata/issues/6886 ,抛出此异常是 Seata Client 的预期行为。
用户可通过在业务项目的 classpath 放置 `logback.xml` 对 Seata Client 的日志加以配置。
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,15 @@ public class CustomWebMvcConfigurer implements WebMvcConfigurer {
5. Both microservice instances `a-service` and `b-service` are Spring Boot microservices, but the components used are Spring WebFlux instead of Spring WebMVC.
ShardingSphere JDBC cannot handle R2DBC DataSource under the reactive programming API, only JDBC DataSource.
Avoid creating ShardingSphere JDBC DataSource in Spring Boot microservices using WebFlux components.

### Log Configuration

After starting Seata Client in a business project, you may see the following Error Log.

```shell
[ERROR] 2024-12-20 11:46:43.878 [ForkJoinPool.commonPool-worker-1] o.a.s.config.ConfigurationFactory - failed to load non-spring configuration :not found service provider for : org.apache.seata.config.ConfigurationProvider
org.apache.seata.common.loader.EnhancedServiceNotFoundException: not found service provider for : org.apache.seata.config.ConfigurationProvider
```

According to https://github.com/apache/incubator-seata/issues/6886 , throwing this exception is the expected behavior of Seata Client.
Users can configure the log of Seata Client by placing `logback.xml` in the classpath of the business project.
Loading

0 comments on commit 878d16b

Please sign in to comment.