问题
I would like to obtain a MySQL function which calculates the difference between the 2 varchar fields in a diff patch format. Any developer which have familiarity with SVN or Git knows how a "patch" file is calculated through a diff tool, I would like to create this procedure in MySQL.
Let's take two very long string from a varchar field in MySQL. The two long text which are the 1st and 2nd version of the same article / piece of code. They are about 1000 words long and differ just for this small piece of text:
<a href="oldlink">link</a>
<a href="newlink">link</a>
I need to create a Function that takes two varchar and returns something like:
--<a href="oldlink">link</a>
++<a href="newlink">link</a>
I've found this answer Compare text differences between two almost identical rows / tables in MySql. Are there MySQL native function which could help me with this task?
来源:https://stackoverflow.com/questions/56583317/creating-a-diff-patch-function-in-mysql-for-varchar-fields