Browse Source

fixed issue #3538 , compatiable mysql8.0 filed meta

jianghang.loujh 3 years ago
parent
commit
e41e903984

+ 2 - 1
deployer/src/main/resources/example/instance.properties

@@ -52,7 +52,8 @@ canal.mq.topic=example
 #canal.mq.dynamicTopic=mytest1.user,mytest2\\..*,.*\\..*
 canal.mq.partition=0
 # hash partition config
+#canal.mq.enableDynamicQueuePartition=false
 #canal.mq.partitionsNum=3
-#canal.mq.partitionHash=test.table:id^name,.*\\..*
 #canal.mq.dynamicTopicPartitionNum=test.*:4,mycanal:6
+#canal.mq.partitionHash=test.table:id^name,.*\\..*
 #################################################

+ 7 - 7
parse/src/main/java/com/alibaba/otter/canal/parse/inbound/mysql/dbsync/TableMetaCache.java

@@ -31,12 +31,12 @@ import com.google.common.cache.LoadingCache;
  */
 public class TableMetaCache {
 
-    public static final String              COLUMN_NAME    = "COLUMN_NAME";
-    public static final String              COLUMN_TYPE    = "COLUMN_TYPE";
-    public static final String              IS_NULLABLE    = "IS_NULLABLE";
-    public static final String              COLUMN_KEY     = "COLUMN_KEY";
-    public static final String              COLUMN_DEFAULT = "COLUMN_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 class TableMetaCache {
         Map<String, Integer> nameMaps = new HashMap<>(6, 1f);
         int index = 0;
         for (FieldPacket fieldPacket : packet.getFieldDescriptors()) {
-            nameMaps.put(fieldPacket.getOriginalName(), index++);
+            nameMaps.put(fieldPacket.getName(), index++);
         }
 
         int size = packet.getFieldDescriptors().size();