Skip to content

Commit d994c54

Browse files
author
chengyitian
committed
AJ-455: optimize code logic for check duplicate colName.
1 parent 3fd7f0b commit d994c54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/xxdb/data/BasicTable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public void replaceColName(String originalColName, String newColName) {
132132
if (Utils.isEmpty(originalColName) || Utils.isEmpty(newColName))
133133
throw new RuntimeException("The param 'newColName' cannot be null or empty.");
134134

135-
if (this.colNames.contains(newColName))
135+
if (!this.colNames.contains(originalColName) && this.colNames.contains(newColName))
136136
throw new RuntimeException("The newColName '" + newColName +"' already exists in table. Column names cannot be duplicated.");
137137

138138
if (this.colNames.contains(originalColName)) {

0 commit comments

Comments
 (0)