zxs / tungsten-replicator

Automatically exported from code.google.com/p/tungsten-replicator
0 stars 0 forks source link

enumToString filter does not support enum which contains parentheses inside values #1112

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
example :

ENUM('test (1)','test (2)','test (3)')

This would lead to an error on the extractor side like :

INFO | jvm 1 | 2015/02/19 21:59:12 | 2015-02-19 21:59:12,290 [goods_itemmaster 
- q-to-thl-0] ERROR pipeline.SingleThreadStageTask Stage task failed: 
stage=q-to-thl seqno=13 fragno=0 
INFO | jvm 1 | 2015/02/19 21:59:12 | 
com.continuent.tungsten.replicator.ReplicatorException: MySQL value (4) for 
ENUM @ Col 7 Row 0 is greater than available values (1) 
INFO | jvm 1 | 2015/02/19 21:59:12 | at 
com.continuent.tungsten.replicator.filter.EnumToStringFilter.transformColumns(En
umToStringFilter.java:652) 
INFO | jvm 1 | 2015/02/19 21:59:12 | at 
com.continuent.tungsten.replicator.filter.EnumToStringFilter.checkForListType(En
umToStringFilter.java:605) 
INFO | jvm 1 | 2015/02/19 21:59:12 | at 
com.continuent.tungsten.replicator.filter.EnumToStringFilter.checkForListType(En
umToStringFilter.java:469) 
INFO | jvm 1 | 2015/02/19 21:59:12 | at 
com.continuent.tungsten.replicator.filter.EnumToStringFilter.filter(EnumToString
Filter.java:216) 

when extracting an event using a table with such a kind of definition.

This is due to the fact that the enum definition parsing stops at the first ')' 
character.

Original issue reported on code.google.com by stephane...@continuent.com on 8 Apr 2015 at 4:10

GoogleCodeExporter commented 9 years ago
This issue was updated by revision r2809.

Handling parentheses inside values by catching the last of the string instead 
of the first

Original comment by stephane...@continuent.com on 8 Apr 2015 at 4:14