Loading mysql-test/r/fulltext.result +11 −0 Original line number Diff line number Diff line Loading @@ -436,3 +436,14 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE); a testword'' 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; mysql-test/t/fulltext.test +12 −0 Original line number Diff line number Diff line Loading @@ -357,4 +357,16 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE); SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE); 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 sql/item_func.h +1 −1 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,6 @@ class Item_func_match :public Item_real_func if (!master && ft_handler) { ft_handler->please->close_search(ft_handler); ft_handler=0; if (join_key) table->file->ft_handler=0; table->fulltext_searched=0; Loading @@ -1066,6 +1065,7 @@ class Item_func_match :public Item_real_func delete concat; concat= 0; } ft_handler= 0; DBUG_VOID_RETURN; } enum Functype functype() const { return FT_FUNC; } Loading Loading
mysql-test/r/fulltext.result +11 −0 Original line number Diff line number Diff line Loading @@ -436,3 +436,14 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE); a testword'' 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;
mysql-test/t/fulltext.test +12 −0 Original line number Diff line number Diff line Loading @@ -357,4 +357,16 @@ SELECT a FROM t1 WHERE MATCH a AGAINST('testword' IN BOOLEAN MODE); SELECT a FROM t1 WHERE MATCH a AGAINST('testword\'\'' IN BOOLEAN MODE); 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
sql/item_func.h +1 −1 Original line number Diff line number Diff line Loading @@ -1056,7 +1056,6 @@ class Item_func_match :public Item_real_func if (!master && ft_handler) { ft_handler->please->close_search(ft_handler); ft_handler=0; if (join_key) table->file->ft_handler=0; table->fulltext_searched=0; Loading @@ -1066,6 +1065,7 @@ class Item_func_match :public Item_real_func delete concat; concat= 0; } ft_handler= 0; DBUG_VOID_RETURN; } enum Functype functype() const { return FT_FUNC; } Loading