forked from babelfish-for-postgresql/babelfish_extensions
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix infinite loop in replace with AI collations (babelfish-for-postgrโฆ
โฆesql#2849) (babelfish-for-postgresql#2867) ICU usearch_next() goes into infinite loop when pattern to search starts with a surrogate pair. To get around this we check if output of usearch_next() is stuck and not proceeding forwards and set the offset for next search ourselves. The next offset is simply the next character after the current char in source string. SRC STRING - 'abc๐defghi๐๐' PATTERN TO FIND = '๐def' usearch_next() gets stuck on "๐" idx = 3 and repeatedly returns this index. We will intervene and set the offset to "d" idx = 4. So that usearch_next only starts looking from this character. Taks: BABEL-5167 Signed-off-by: Tanzeel Khan <[email protected]>
- Loading branch information
1 parent
eecb8f2
commit 8607687
Showing
3 changed files
with
136 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters