From 9d0a37241f6233c84165404f6d7b89865a9bb258 Mon Sep 17 00:00:00 2001 From: "jianghang.loujh" Date: Mon, 26 Dec 2022 14:40:58 +0800 Subject: [PATCH] fixed desc table case insensitive --- .../parse/inbound/mysql/dbsync/TableMetaCache.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/TableMetaCache.java b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/TableMetaCache.java index 587d749c5a..a7409b999b 100644 --- a/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/TableMetaCache.java +++ b/parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/TableMetaCache.java @@ -31,12 +31,12 @@ */ public class TableMetaCache { - public static final String COLUMN_NAME = "Field"; - public static final String COLUMN_TYPE = "Type"; - public static final String IS_NULLABLE = "Null"; - public static final String COLUMN_KEY = "Key"; - public static final String COLUMN_DEFAULT = "Default"; - public static final String EXTRA = "Extra"; + public static final String COLUMN_NAME = "field"; + public static final String COLUMN_TYPE = "type"; + public static final String IS_NULLABLE = "null"; + public static final String COLUMN_KEY = "key"; + public static final String COLUMN_DEFAULT = "default"; + public static final String EXTRA = "extra"; private MysqlConnection connection; private boolean isOnRDS = false; private boolean isOnPolarX = false; @@ -125,7 +125,7 @@ public static List parseTableMetaByDesc(ResultSetPacket packet) { Map nameMaps = new HashMap<>(6, 1f); int index = 0; for (FieldPacket fieldPacket : packet.getFieldDescriptors()) { - nameMaps.put(fieldPacket.getName(), index++); + nameMaps.put(StringUtils.lowerCase(fieldPacket.getName()), index++); } int size = packet.getFieldDescriptors().size();