diff options
author | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2022-07-05 18:21:21 +0530 |
---|---|---|
committer | Thirunarayanan Balathandayuthapani <thiru@mariadb.com> | 2022-07-26 15:01:17 +0530 |
commit | f076dc2f667d9270ca08421d466dcbc352738082 (patch) | |
tree | 4a7514f27adc547fd37c5afd08d12a61432fd08e /mysql-test/suite | |
parent | a8a27f1edfc2f48f5c801bae35d6d620ac8192a5 (diff) | |
download | mariadb-git-f076dc2f667d9270ca08421d466dcbc352738082.tar.gz |
MDEV-20797 FULLTEXT search with apostrophe, and mandatory words
- InnoDB should ignore the single word followed by apostrophe while
tokenising the document. Example is that if the input string is O'brien
then right now, InnoDB seperates into two tokens as O, brien. But
after this patch, InnoDB can ignore the token 'O' and consider
only 'brien'.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r-- | mysql-test/suite/innodb_fts/r/fulltext.result | 28 | ||||
-rw-r--r-- | mysql-test/suite/innodb_fts/t/fulltext.test | 13 |
2 files changed, 41 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb_fts/r/fulltext.result b/mysql-test/suite/innodb_fts/r/fulltext.result index 7775a46e0d8..a6c88511670 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext.result +++ b/mysql-test/suite/innodb_fts/r/fulltext.result @@ -732,4 +732,32 @@ ALTER TABLE t1 DROP KEY `ftidx` ; INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL); DROP TABLE t1; SET @@global.innodb_file_per_table = @save; +# +# MDEV-20797 FULLTEXT search with apostrophe, +# and mandatory words +# +CREATE TABLE t1(f1 TINYTEXT NOT NULL, FULLTEXT(f1))ENGINE=InnoDB; +INSERT INTO t1 VALUES('O''Brien'), ('O Brien'), ('Ö''Brien'); +INSERT INTO t1 VALUES('Brien'), ('O ''Brien'), ('O'' Brien'); +INSERT INTO t1 VALUES('Doh''nuts'); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+O'Brien" IN BOOLEAN MODE); +f1 +O'Brien +O Brien +Ö'Brien +Brien +O 'Brien +O' Brien +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE); +f1 +Doh'nuts +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Ö''Brien" IN BOOLEAN MODE); +f1 +O'Brien +O Brien +Ö'Brien +Brien +O 'Brien +O' Brien +DROP TABLE t1; # End of 10.3 tests diff --git a/mysql-test/suite/innodb_fts/t/fulltext.test b/mysql-test/suite/innodb_fts/t/fulltext.test index 4878a0bee3f..f6c53abd525 100644 --- a/mysql-test/suite/innodb_fts/t/fulltext.test +++ b/mysql-test/suite/innodb_fts/t/fulltext.test @@ -757,4 +757,17 @@ INSERT INTO t1 (col_int, col_text) VALUES ( 1255, NULL); DROP TABLE t1; SET @@global.innodb_file_per_table = @save; +--echo # +--echo # MDEV-20797 FULLTEXT search with apostrophe, +--echo # and mandatory words +--echo # +CREATE TABLE t1(f1 TINYTEXT NOT NULL, FULLTEXT(f1))ENGINE=InnoDB; +INSERT INTO t1 VALUES('O''Brien'), ('O Brien'), ('Ö''Brien'); +INSERT INTO t1 VALUES('Brien'), ('O ''Brien'), ('O'' Brien'); +INSERT INTO t1 VALUES('Doh''nuts'); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+O'Brien" IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Doh'nuts" IN BOOLEAN MODE); +SELECT * FROM t1 WHERE MATCH (f1) AGAINST ("+Ö''Brien" IN BOOLEAN MODE); +DROP TABLE t1; + --echo # End of 10.3 tests |