summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/june.mysql.com>2007-04-02 17:26:39 +0500
committerunknown <svoj@mysql.com/june.mysql.com>2007-04-02 17:26:39 +0500
commit3c763afc9c39420f9a2f14c51fe20ddf745f7976 (patch)
tree7b8a8a1a27c95d2b8683bbbbd112223c46b6e0b2 /mysql-test
parentcd4670a7aa270c655dd9a7a45d0c1e05b6f25dd0 (diff)
downloadmariadb-git-3c763afc9c39420f9a2f14c51fe20ddf745f7976.tar.gz
BUG#25729 - boolean full text search is confused by NULLs produced by
LEFT JOIN Fixed that in certain situations MATCH ... AGAINST returns false hits for NULLs produced by LEFT JOIN when there is no fulltext index available. mysql-test/r/fulltext_left_join.result: A test case for BUG#25729. mysql-test/t/fulltext_left_join.test: A test case for BUG#25729. sql/item_func.cc: concat_ws(NULL) returns empty string instead of NULL. There is not much sense to calculate relevance for empty strings, thus return 0 immediately if we got NULL or empty string from concat_ws. sql/item_func.h: Item_func_match::concat renamed to concat_ws.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/fulltext_left_join.result7
-rw-r--r--mysql-test/t/fulltext_left_join.test11
2 files changed, 18 insertions, 0 deletions
diff --git a/mysql-test/r/fulltext_left_join.result b/mysql-test/r/fulltext_left_join.result
index fdf11c14cc4..ea4cacf2fab 100644
--- a/mysql-test/r/fulltext_left_join.result
+++ b/mysql-test/r/fulltext_left_join.result
@@ -90,3 +90,10 @@ id link name relevance
1 1 string 0
2 0 string 0
DROP TABLE t1,t2;
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c TEXT, KEY(b));
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle');
+SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE);
+a b c
+DROP TABLE t1, t2;
diff --git a/mysql-test/t/fulltext_left_join.test b/mysql-test/t/fulltext_left_join.test
index 5942ce119ee..8c13ae5cad9 100644
--- a/mysql-test/t/fulltext_left_join.test
+++ b/mysql-test/t/fulltext_left_join.test
@@ -87,3 +87,14 @@ SELECT t1.*, MATCH(t1.name) AGAINST('string') AS relevance
DROP TABLE t1,t2;
# End of 4.1 tests
+
+#
+# BUG#25729 - boolean full text search is confused by NULLs produced by LEFT
+# JOIN
+#
+CREATE TABLE t1 (a INT);
+CREATE TABLE t2 (b INT, c TEXT, KEY(b));
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2(b,c) VALUES(2,'castle'),(3,'castle');
+SELECT * FROM t1 LEFT JOIN t2 ON a=b WHERE MATCH(c) AGAINST('+castle' IN BOOLEAN MODE);
+DROP TABLE t1, t2;