diff options
-rw-r--r-- | mysql-test/r/fulltext.result | 11 | ||||
-rw-r--r-- | mysql-test/t/fulltext.test | 12 | ||||
-rw-r--r-- | sql/item_func.h | 4 |
3 files changed, 24 insertions, 3 deletions
diff --git a/mysql-test/r/fulltext.result b/mysql-test/r/fulltext.result index 3e6dd896ed8..d683fcfa3ff 100644 --- a/mysql-test/r/fulltext.result +++ b/mysql-test/r/fulltext.result @@ -445,3 +445,14 @@ t1 CREATE TABLE `t1` ( FULLTEXT KEY `a` (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; +CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a)); +INSERT INTO t1 VALUES('test'),('test1'),('test'); +PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')"; +EXECUTE stmt; +a MATCH(a) AGAINST('test1 test') +test1 0.68526661396027 +EXECUTE stmt; +a MATCH(a) AGAINST('test1 test') +test1 0.68526661396027 +DEALLOCATE PREPARE stmt; +DROP TABLE t1; diff --git a/mysql-test/t/fulltext.test b/mysql-test/t/fulltext.test index a90344784cd..91033fe2ba9 100644 --- a/mysql-test/t/fulltext.test +++ b/mysql-test/t/fulltext.test @@ -365,4 +365,16 @@ CREATE TABLE t1 (a VARCHAR(10000), FULLTEXT(a)); SHOW CREATE TABLE t1; DROP TABLE t1; +# +# BUG#14496: Crash or strange results with prepared statement, +# MATCH and FULLTEXT +# +CREATE TABLE t1 (a TEXT, FULLTEXT KEY(a)); +INSERT INTO t1 VALUES('test'),('test1'),('test'); +PREPARE stmt from "SELECT a, MATCH(a) AGAINST('test1 test') FROM t1 WHERE MATCH(a) AGAINST('test1 test')"; +EXECUTE stmt; +EXECUTE stmt; +DEALLOCATE PREPARE stmt; +DROP TABLE t1; + # End of 4.1 tests diff --git a/sql/item_func.h b/sql/item_func.h index d81eb5f6ebf..d8fa45fb9c0 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1283,10 +1283,8 @@ public: DBUG_ENTER("Item_func_match"); Item_real_func::cleanup(); if (!master && ft_handler) - { ft_handler->please->close_search(ft_handler); - ft_handler=0; - } + ft_handler= 0; concat= 0; DBUG_VOID_RETURN; } |