MySQL 8 issues with Regex

  • We had a server which updated their MySQL version to 8, which ended up breaking a few things on the site. It's a shop which uses variants, and the main issue was that users couldn't add products with variants.


    In MySQL 8 the way regexp work have changed and here is a brief outline one the changes that affect perch

    Quote

    The Spencer library supports word-beginning and word-end boundary markers ([[:<:]] and [[:>:]] notation). ICU does not. For ICU, you can use \b to match word boundaries; double the backslash because MySQL interprets it as the escape character within strings.


    So if you are using perch shop or any regex filters in your collections or perch_content_custom functions then you'll need to update [[:<:]] and [[:>:]] to \\\\b.


    As you might not be locally developing on MySQL 8 what I did was replace [[:<:]] with a global BOUNDARY_START and [[:>:]] with BOUNDARY_END then in your local config you can set these to what you need without needing it go backwards and forwards

  • I am also having the same issue with mySQL 8 and I think there is no way to fix it at least I didn't find something which is helpful, if you have solved this issue then please share the details how to solve this issue here thanks...