This is an automated email from the ASF dual-hosted git repository.
sunnianjun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 44c49a17420 Fix index out of bounds exception for migration without
unique keys (#34127)
44c49a17420 is described below
commit 44c49a17420c85a3d5a788562642f8adf799516a
Author: Haoran Meng <[email protected]>
AuthorDate: Mon Dec 23 17:34:05 2024 +0800
Fix index out of bounds exception for migration without unique keys (#34127)
---
.../table/calculator/RecordSingleTableInventoryCalculator.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/calculator/RecordSingleTableInventoryCalculator.java
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/calculator/RecordSingleTableInventoryCalculator.java
index 22af62850c3..ebf59bb3c7c 100644
---
a/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/calculator/RecordSingleTableInventoryCalculator.java
+++
b/kernel/data-pipeline/core/src/main/java/org/apache/shardingsphere/data/pipeline/core/consistencycheck/table/calculator/RecordSingleTableInventoryCalculator.java
@@ -148,7 +148,7 @@ public final class RecordSingleTableInventoryCalculator
extends AbstractStreamin
}
private String getQuerySQL(final SingleTableInventoryCalculateParameter
param) {
- ShardingSpherePreconditions.checkNotNull(param.getFirstUniqueKey(),
+ ShardingSpherePreconditions.checkState(param.getUniqueKeys() != null
&& !param.getUniqueKeys().isEmpty() && null != param.getFirstUniqueKey(),
() -> new UnsupportedOperationException("Record inventory
calculator does not support table without unique key and primary key now."));
PipelineDataConsistencyCalculateSQLBuilder pipelineSQLBuilder = new
PipelineDataConsistencyCalculateSQLBuilder(param.getDatabaseType());
Collection<String> columnNames = param.getColumnNames().isEmpty() ?
Collections.singleton("*") : param.getColumnNames();