]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 19 Feb 2014 18:26:17 +0000 (18:26 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 19 Feb 2014 18:26:17 +0000 (18:26 +0000)
commite9d641a2de2b4469d3d9eacc2cd42d13484cce37
tree1f832bb9d6bb4f4051ed87506d892120ed3328d3
parent771ab0b35da8dc62a4cecbcc609a2d46534687ca
res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.

The sorcery astDB wizzard does not handle regex correctly if the pattern
begins with an anchor character.

This patch attempts to convert the anchored regex pattern to a prefix
pattern supported by astDB for performance reasons.  If it is not able to
convert the pattern it falls back to getting all astDB members of the
family and doing a normal regex pattern matching on the retrieved records.

Review: https://reviewboard.asterisk.org/r/3161/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@408385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_sorcery_astdb.c