Description:
Different ft_boolean_syntax does not produce result as default operators. Docs says that space has to be either in 1 or 2 position and operator functionality is determined from its position. I wonder if space acts as + operator when positioned at one. Also if space cant be substituted with any other character than its position should be fixed or removed altogether.
How to repeat:
This script can be tested in mysql test environment.
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
);
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...'),
('MySQL vs. YourSQL','In the following database comparison ...');
SET @@global.ft_boolean_syntax=' ~/!@#$%^&*()-';
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST (' mySQL~/yourSQL' IN BOOLEAN MODE);
+id title body
+2 MySQL vs. YourSQL In the following database comparison ...
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE);
+id title body
+1 MySQL Tutorial DBMS stands for DataBase ...
SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-';
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE);
+id title body
+1 MySQL Tutorial DBMS stands for DataBase ...
Suggested fix:
The second result should have come on the first case also. Also if space is positioned at first then operator at second position acts as +. This behavior should be documented.
Description: Different ft_boolean_syntax does not produce result as default operators. Docs says that space has to be either in 1 or 2 position and operator functionality is determined from its position. I wonder if space acts as + operator when positioned at one. Also if space cant be substituted with any other character than its position should be fixed or removed altogether. How to repeat: This script can be tested in mysql test environment. CREATE TABLE articles ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body) ); INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS stands for DataBase ...'), ('MySQL vs. YourSQL','In the following database comparison ...'); SET @@global.ft_boolean_syntax=' ~/!@#$%^&*()-'; SELECT * FROM articles WHERE MATCH (title,body) AGAINST (' mySQL~/yourSQL' IN BOOLEAN MODE); +id title body +2 MySQL vs. YourSQL In the following database comparison ... SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE); +id title body +1 MySQL Tutorial DBMS stands for DataBase ... SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-'; SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE); +id title body +1 MySQL Tutorial DBMS stands for DataBase ... Suggested fix: The second result should have come on the first case also. Also if space is positioned at first then operator at second position acts as +. This behavior should be documented.