Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mysql: introduce icuregex package (vitessio#13391)
* mysql: introduce icuregex package Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com> Signed-off-by: Vicent Marti <vmg@strn.cat> * icuregex: implement freeze set optimization Signed-off-by: Vicent Marti <vmg@strn.cat> * evalengine: wire up regex Signed-off-by: Vicent Marti <vmg@strn.cat> * Fix remaining TODOs and fix a bunch of bugs Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Update sizegen Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * icuregex: Fix invalid slice creation Parse the structure so we can create buffers with the proper size and never with infinite sizes. While this was not the immediate cause of the race error, it's better to create with the right slice size also for debugging when digging into it. The real fix here is that the size of `algorithmicRange` includes the size of the struct itself, so if we want to get the remaining slice size it needs to subtract this value. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * icuregex: Create valid slice length for algorithmicRange We also want to create a valid slice length for the additional data, this was too long if an offset was given and would read into the next entry. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * icuregex: Clean up more unsafe usage This reduces unsafe usage to just udata and doesn't use it anywhere outside of it. Makes it more Go idiomatic this way. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * icuregex: Use more Go like naming and reduce exposed API Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * regex: Implement additional regular expression functions This implements the additional MySQL regular expression functions in the evalengine. The evaluator is only implementing this for now, but the compiler is up next. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * regexp: Update generated data Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Revert accidentally committed test Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * evalengine: Add compilation for regular expressions Also fixes a whole slew of bugs identified. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * icuregex: Allow for setting explicit dumper Remove the usage of a global variable here. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * evalengine: Add a whole bunch of regex tests This adds a bunch of tests and fixes the bugs exposed through them. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * Fix license Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * More license fixes Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> * evalengine: Improve handling of constant expression regexps Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> --------- Signed-off-by: Vicent Marti <vmg@strn.cat> Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Co-authored-by: Dirkjan Bussink <d.bussink@gmail.com>
- Loading branch information