From 788be2aebdb0bce63b45b1fecf2f2d8a12a5cfc7 Mon Sep 17 00:00:00 2001 From: Ramil Kalimullin Date: Fri, 5 Sep 2008 13:30:01 +0500 Subject: Fix for bug #39021: SELECT REGEXP BINARY NULL never returns Problem: SELECT ... REGEXP BINARY NULL may lead to server crash/hang. Fix: properly handle NULL regular expressions. mysql-test/r/func_regexp.result: Fix for bug #39021: SELECT REGEXP BINARY NULL never returns - test result. mysql-test/t/func_regexp.test: Fix for bug #39021: SELECT REGEXP BINARY NULL never returns - test case. sql/item_cmpfunc.cc: Fix for bug #39021: SELECT REGEXP BINARY NULL never returns - checking regular expressions' null_value we tested it without a val_xxx() call before, which is wrong. Now Item_func_regex::regcomp() returns -1 in the case and allows to handle NULL expessions properly. sql/item_cmpfunc.h: Fix for bug #39021: SELECT REGEXP BINARY NULL never returns - checking regular expressions' null_value we tested it without a val_xxx() call before, which is wrong. Now Item_func_regex::regcomp() returns -1 in the case and allows to handle NULL expessions properly. --- mysql-test/t/func_regexp.test | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mysql-test/t/func_regexp.test') diff --git a/mysql-test/t/func_regexp.test b/mysql-test/t/func_regexp.test index 1b35fab9d54..43fda0d11a8 100644 --- a/mysql-test/t/func_regexp.test +++ b/mysql-test/t/func_regexp.test @@ -64,4 +64,14 @@ drop table t1; SELECT 1 REGEXP NULL; + +# +# Bug #39021: SELECT REGEXP BINARY NULL never returns +# + +SELECT '' REGEXP BINARY NULL; +SELECT NULL REGEXP BINARY NULL; +SELECT 'A' REGEXP BINARY NULL; +SELECT "ABC" REGEXP BINARY NULL; + --echo End of 5.0 tests -- cgit v1.2.1