summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-08-15 10:53:25 +0500
committerRamil Kalimullin <ramil@mysql.com>2008-08-15 10:53:25 +0500
commit67a3d9e4d0356665728298097578931c7c5bae1f (patch)
treea08c236e1dd1f862929a2cacef67cf7afea5827d /sql/item_cmpfunc.cc
parent03818bff5a59b588f14e8f1c6d47b913f01f0888 (diff)
downloadmariadb-git-67a3d9e4d0356665728298097578931c7c5bae1f.tar.gz
Fix for bug#37337: Function returns different results
Problem: REGEXP in functions/PSs may return wrong results due to improper initialization. Fix: initialize required REGEXP params. sql/item_cmpfunc.cc: Fix for bug#37337: Function returns different results prev_regexp is used in the Item_func_regex::regcomp() to store previous regex and to avoid re-initialization if given the same pattern. Shoud be deleted in the Item_func_regex::cleanup() where we clean up the regexp structure.
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index c76bbececef..64a2049a37b 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -4592,6 +4592,7 @@ void Item_func_regex::cleanup()
{
my_regfree(&preg);
regex_compiled=0;
+ prev_regexp.length(0);
}
DBUG_VOID_RETURN;
}