Skip to content

Commit

Permalink
[hotfix-#1289][jdbc-base] change column size used (#1290)
Browse files Browse the repository at this point in the history
  • Loading branch information
liumengkai authored Sep 30, 2022
1 parent 2683734 commit d35e785
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ public static Pair<List<String>, List<String>> buildColumnWithMeta(
List<String> metaColumnType = tableMetaData.getRight();

List<FieldConf> column = jdbcConf.getColumn();
int size = column.size();
int size = metaColumnName.size();
List<String> columnNameList = new ArrayList<>(size);
List<String> columnTypeList = new ArrayList<>(size);
if (column.size() == 1 && ConstantValue.STAR_SYMBOL.equals(column.get(0).getName())) {
Expand Down Expand Up @@ -559,6 +559,7 @@ private static Pair<List<String>, List<String>> checkAndModifyColumnWithMeta(
String constantType) {
// check columnName and modify columnType
int size = column.size();
int metaColumnSize = metaColumnName.size();
List<String> columnNameList = new ArrayList<>(size);
List<String> columnTypeList = new ArrayList<>(size);
int index = 0;
Expand All @@ -570,7 +571,7 @@ private static Pair<List<String>, List<String>> checkAndModifyColumnWithMeta(
String name = fieldConf.getName();
String metaType = null;
int i = 0;
for (; i < size; i++) {
for (; i < metaColumnSize; i++) {
// todo get precision and scale
if (metaColumnName.get(i).equalsIgnoreCase(name)) {
metaType = metaColumnType.get(i);
Expand All @@ -581,7 +582,7 @@ private static Pair<List<String>, List<String>> checkAndModifyColumnWithMeta(
break;
}
}
if (i == size) {
if (i == metaColumnSize) {
throw new ChunJunRuntimeException(
String.format(
"The column[%s] does not exist in the table[%s]",
Expand Down

0 comments on commit d35e785

Please sign in to comment.