Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse longtext data type value getting wrong when using reparo to file #1019

Open
usxiaojunyang opened this issue Dec 1, 2020 · 0 comments

Comments

@usxiaojunyang
Copy link

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    when column in tidb defined as longtext type,reparo cmd would parse wrong value.

  2. What did you expect to see?
    In mysql client,the real value is 'Oct 23 14:12:06 SVRXXXXHP360 salt-minion: [WARNING ] /usr/lib/python2.7/site-packages/salt/modules/config.py:258: DeprecationWarning: pillar_opts will default to False in the Lithium releasexxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

  3. What did you see instead?
    In reparo cmd using '/data/tidb-binlog-cluster-latest-linux-amd64/bin/reparo',the value changed to blow:
    [79 99 116 32 50 51 32 49 52 58 49 50 58 48 54 32 83 86 82 50 49 54 56 49 72 80 51 54 48 32 115 97 108 116 45 109 105 110 105 111 110 58 32 91 87 65 82 78 73 78 71 32 93 32 47 117 115 114 47 108 105 98 47 112 121 116 104 111 110 50 46 55 47 115 105 116 101 45 112 97 99 107 97 103 101 115 47 115 97 108 116 47 109 111 100 117 108 101 115 47 99 111 110 102 105 103 46 112 121 58 50 53 56 58 32 68 101 112 114 101 99 97 116 105 111 110 87 97 114 110 105 110 103 58 32 112 105 108 108 97 114 95 111 112 116 115 32 119 105 108 108 32 100 101 102 97 117 108 116 32 116 111 32 70 97 108 115 101 32 105 110 32 116 104 101 32 76 105 116 104 105 117 109 32 114 101 108 101 97 115 101 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120 120]

  4. Please provide the relate downstream type and version of drainer.
    (run drainer -V in terminal to get drainer's version)
    Release Version: v4.0.0-beta.1-2-g20397869
    Git Commit Hash: 2039786
    Build TS: 2020-03-02 09:50:48
    Go Version: go1.13
    Go OS/Arch: linux/amd64

5.How to fix it?
Add mysql.TypeLongBlob in reparo/syncer/util.go line 26

-       case mysql.TypeDate, mysql.TypeDatetime, mysql.TypeNewDate, mysql.TypeTimestamp, mysql.TypeDuration, mysql.TypeDecimal, mysql.TypeNewDecimal, mysql.TypeVarchar, mysql.TypeString, mysql.TypeJSON:
+      case mysql.TypeDate, mysql.TypeDatetime, mysql.TypeNewDate, mysql.TypeTimestamp, mysql.TypeDuration, mysql.TypeDecimal, mysql.TypeNewDecimal, mysql.TypeVarchar, mysql.TypeString, mysql.TypeJSON, mysql.TypeLongBlob:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant