Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
None
Description
Adding extended regular expressions support to the QLA Filter would allow more useful operators like "|" that will match either of its arguments, for example "update|delete" will match either "update" or "delete" query statements.
The changes to implement this seem pretty straight forward:
--- a/server/modules/filter/qlafilter.c
|
+++ b/server/modules/filter/qlafilter.c
|
@@ -227,7 +227,7 @@ createInstance(char **options, FILTER_PARAMETER **params) |
}
|
my_instance->sessions = 0; |
if (my_instance->match && |
- regcomp(&my_instance->re, my_instance->match, REG_ICASE))
|
+ regcomp(&my_instance->re, my_instance->match, REG_EXTENDED | REG_ICASE))
|
{
|
MXS_ERROR("qlafilter: Invalid regular expression '%s'" |
" for the match parameter.\n", |
@@ -243,7 +243,7 @@ createInstance(char **options, FILTER_PARAMETER **params) |
}
|
if (my_instance->nomatch && |
regcomp(&my_instance->nore, my_instance->nomatch,
|
- REG_ICASE))
|
+ REG_EXTENDED | REG_ICASE))
|
{
|
MXS_ERROR("qlafilter: Invalid regular expression '%s'" |
" for the nomatch paramter.", |