1'#--------------------FN_DYNVARS_033_01-------------------------#'
2SET @@global.ft_boolean_syntax = ' -+()<>~*:``&|';
3connect  con1,localhost,root,,,,;
4connection con1;
5SELECT @@global.ft_boolean_syntax;
6@@global.ft_boolean_syntax
7 -+()<>~*:``&|
8SET @@global.ft_boolean_syntax = '+ -><()~*:""&|';
9connect  con2,localhost,root,,,,;
10connection con2;
11SELECT @@global.ft_boolean_syntax;
12@@global.ft_boolean_syntax
13+ -><()~*:""&|
14disconnect con2;
15disconnect con1;
16'#--------------------FN_DYNVARS_033_02-------------------------#'
17connection default;
18DROP TABLE IF EXISTS t1;
19CREATE TABLE articles (
20id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
21title VARCHAR(200),
22body TEXT,
23FULLTEXT (title,body)
24);
25INSERT INTO articles (title,body) VALUES
26('MySQL Tutorial','DBMS stands for DataBase ...'),
27('How To',''),
28('How To Use MySQL Well','After you went through a ...'),
29('Optimizing MySQL','In this tutorial we will show .... Run command line ...'),
30('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
31('100 Tips for Myisam','1. Myisam is faster than innodb 2. Tricks and Tips for Myisam...'),
32('MySQL vs. YourSQL','In the following database comparison ...'),
33('MySQL Security','When configured properly, MySQL ...'),
34('Database Security','Configuring MySQL for ...');
35SET @@global.ft_boolean_syntax = DEFAULT;
36SELECT * FROM articles WHERE MATCH (title,body)
37AGAINST ('+mySQL -yourSQL' IN BOOLEAN MODE);
38id	title	body
391	MySQL Tutorial	DBMS stands for DataBase ...
403	How To Use MySQL Well	After you went through a ...
414	Optimizing MySQL	In this tutorial we will show .... Run command line ...
425	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
438	MySQL Security	When configured properly, MySQL ...
449	Database Security	Configuring MySQL for ...
45SELECT * FROM articles WHERE MATCH (title,body)
46AGAINST ('+MySQL +YourSQL' IN BOOLEAN MODE);
47id	title	body
487	MySQL vs. YourSQL	In the following database comparison ...
49SELECT * FROM articles WHERE MATCH (title,body)
50AGAINST ('MySQL' IN BOOLEAN MODE);
51id	title	body
521	MySQL Tutorial	DBMS stands for DataBase ...
533	How To Use MySQL Well	After you went through a ...
544	Optimizing MySQL	In this tutorial we will show .... Run command line ...
555	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
567	MySQL vs. YourSQL	In the following database comparison ...
578	MySQL Security	When configured properly, MySQL ...
589	Database Security	Configuring MySQL for ...
59SELECT * FROM articles WHERE MATCH (title,body)
60AGAINST ('mysql tutorial dbms' IN BOOLEAN MODE);
61id	title	body
621	MySQL Tutorial	DBMS stands for DataBase ...
633	How To Use MySQL Well	After you went through a ...
644	Optimizing MySQL	In this tutorial we will show .... Run command line ...
655	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
667	MySQL vs. YourSQL	In the following database comparison ...
678	MySQL Security	When configured properly, MySQL ...
689	Database Security	Configuring MySQL for ...
69SELECT id,title,body, (MATCH (title,body)
70AGAINST ('+security configuring' IN BOOLEAN MODE)) AS relevance
71FROM articles WHERE MATCH (title,body)
72AGAINST ('+security configuring' IN BOOLEAN MODE);
73id	title	body	relevance
748	MySQL Security	When configured properly, MySQL ...	1
759	Database Security	Configuring MySQL for ...	1.3333333730697632
76SELECT * FROM articles WHERE MATCH (title,body)
77AGAINST ('"faster than"' IN BOOLEAN MODE);
78id	title	body
796	100 Tips for Myisam	1. Myisam is faster than innodb 2. Tricks and Tips for Myisam...
80SELECT * FROM articles WHERE MATCH (title,body)
81AGAINST ('+tutorial ~line' IN BOOLEAN MODE);
82id	title	body
831	MySQL Tutorial	DBMS stands for DataBase ...
844	Optimizing MySQL	In this tutorial we will show .... Run command line ...
85SELECT * FROM articles WHERE MATCH (title,body)
86AGAINST ('10*' IN BOOLEAN MODE);
87id	title	body
885	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
89SELECT id,title,body, (MATCH (title,body)
90AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)) AS relevance
91FROM articles WHERE MATCH (title,body)
92AGAINST ('+MySQL +(>show <dbms)' IN BOOLEAN MODE)
93ORDER BY relevance DESC;
94id	title	body	relevance
954	Optimizing MySQL	In this tutorial we will show .... Run command line ...	1.25
961	MySQL Tutorial	DBMS stands for DataBase ...	0.8333333730697632
97'---try setting different operators. Default '+ -><()~*:""&|'--'
98SET @@global.ft_boolean_syntax='~ /!@#$%^&*()-';
99SELECT * FROM articles WHERE MATCH (title,body)
100AGAINST ('~mySQL /yourSQL' IN BOOLEAN MODE);
101id	title	body
1021	MySQL Tutorial	DBMS stands for DataBase ...
1033	How To Use MySQL Well	After you went through a ...
1044	Optimizing MySQL	In this tutorial we will show .... Run command line ...
1055	1001 MySQL Tricks	1. Never run mysqld as root. 2. ...
1068	MySQL Security	When configured properly, MySQL ...
1079	Database Security	Configuring MySQL for ...
108SET @@global.ft_boolean_syntax=DEFAULT;
109DROP TABLE articles;
110