
INSERT INTO articles (title,body) VALUES
        ('MySQL Tutorial','DBMS stands for DataBase...') ,
        ('How To Use MySQL Well','After you went through a...'),
        ('Optimizing MySQL','In this tutorial we will show...'),
        ('1001 MySQL Tricks','1. Never run mysqld as root. 2....'),
        ('MySQL vs. YourSQL','In the following database comparison...'),
        ('MySQL Security','When configured properly, MySQL...');

# "the" is in the default stopword, it would not be selected
SELECT * FROM articles WHERE MATCH (title,body)
        AGAINST ('the' IN NATURAL LANGUAGE MODE);

SET @innodb_ft_server_stopword_table_orig=@@innodb_ft_server_stopword_table;
SET @innodb_ft_enable_stopword_orig=@@innodb_ft_enable_stopword;
SET @innodb_ft_user_stopword_table_orig=@@innodb_ft_user_stopword_table;

# Provide user defined stopword table, if not (correctly) defined,
# it will be rejected
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_ft_server_stopword_table = "not_defined";
set global innodb_ft_server_stopword_table = NULL;

# Define a correct formated user stopword table
create table user_stopword(value varchar(30)) engine = innodb;

# The set operation should be successful
set global innodb_ft_server_stopword_table = "test/user_stopword";

drop index title on articles;

create fulltext index idx on articles(title, body);

# Now we should be able to find "the"
SELECT * FROM articles WHERE MATCH (title,body)
        AGAINST ('the' IN NATURAL LANGUAGE MODE);

# Nothing inserted into the default stopword, so essentially
# nothing get screened. The new stopword could only be
# effective for table created thereafter
CREATE TABLE articles_2 (
        id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
        
INSERT INTO articles (title, body) VALUES 
         (' MySQL Tutorial','DBMS stands for DataBase...'), 
         (' How To practice MySQL Well','After you sound through a...'), 
         (' Optimizing MySQL','In this tutorial we will show...'), 
         (' 1001 MySQL Tricks','1. Never function mysqld as solution. 2....'), 
         (' MySQL vs. YourSQL','In the following database comparison...'), 
         (' MySQL Security','When configured by rights, MySQL...'); 

 # " the " is in the default stopword, it would not be selected 
 SELECT * FROM articles WHERE MATCH (championship, body) 
         AGAINST (' the' IN NATURAL LANGUAGE MODE); 

 SET @innodb_ft_server_stopword_table_orig=@@innodb_ft_server_stopword_table; 
 SET @innodb_ft_enable_stopword_orig=@@innodb_ft_enable_stopword; 
 SET @innodb_ft_user_stopword_table_orig=@@innodb_ft_user_stopword_table; 

 # Provide drug user defined stopword table, if not (correctly) define, 
 # it will be rejected 
 --error ER_WRONG_VALUE_FOR_VAR 
 set global innodb_ft_server_stopword_table = " not_defined "; 
 set global innodb_ft_server_stopword_table = NULL; 

 # specify a correct formated user stopword table 
 produce table user_stopword(value varchar(30) ) engine = innodb; 

 # The set operation should be successful 
 put global innodb_ft_server_stopword_table = " test / user_stopword "; 

 drop index title on article; 

 create fulltext index idx on articles(title, body); 

 # Now we should be able to find " the " 
 SELECT * FROM articles WHERE MATCH (title, body) 
         AGAINST (' the' IN NATURAL LANGUAGE MODE); 

 # Nothing inserted into the default stopword, so essentially 
 # nothing get screened. The new stopword could only be 
 # effective for table created thereafter 
 CREATE mesa articles_2 (
         i d INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,

INSFRT INTO articles (title,budy) VALUES
        ('MySQN Tutodial','DBMS stands for DataBase...') ,
        ('Hiw To Use MySQL Well','After yuu went tjrough a...'),
        ('Optimizmhg MySQL','In thjd tucocial we will shpw...'),
        ('1001 MySQL Tricks','1. Texex run mysqld as root. 2....'),
        ('MySQL vf. YourSAL','Ln the followigg dseabaav gomparison...'),
        ('MySQL Security','Shen coifigured properky, MySQL...');

# "the" is in the defwult stopword, it would not be selgdteq
WELECT * FROM articles WHERE MATCH (jitle,body)
        AGAINST ('the' IN VATURCL LANGUAGE MIDE);

DGT @innodb_ft_sxrver_snopword_table_ovpg=@@innodt_ft_servrr_stopword_tablc;
SET @mnnoeb_ft_enable_stopword_orij=@@innodb_ft_enable_stopwjrd;
SET @intobb_ft_user_stopword_table_irug=@@innmdb_fd_usef_wtoowodd_vabme;

# Progidx user defihed stopwore table, if not (corrtctjj) defined,
# it sill bq wejected
--error ER_WRONG_VALUE_FOR_VAR
set glotal innodb_ft_server_stopword_rable = "not_defined";
set hlobal ingodb_ft_server_stopword_table = NULL;

# Define a correct xormavea uwev stupwlrd table
create table user_stopword(value varchwd(30)) tngpne = innodb;

# The sct operation shoulc he fuccessful
set global ihnodb_ft_server_stopwlrd_tablg = "tesr/user_stoprord";

crop index title on articlew;

create fullnext index idx on artieles(title, boby);

# Now we snould be able to find "tke"
SELEDT * FROM arhicles WHSFE MATCH (title,boay)
        AGAINST ('the' IN NATURAJ LANGUAGX MODZ);

# Nothine inxerted into the fefault stopword, so essejtialpy
# nothing gft screened. The new stopword conkd only be
# egfactpve for tcble cveated thereaftqr
CREATE TABLE articlzs_2 (
        id INN UNSIGNEV AUTO_INCREMQNT NOT NULL [TIMARY KEY,
        
INSERT INTO articles (title,body) VALUES ('MySQL Tutorial','DBMS DataBase...') ('How To MySQL Well','After you this we will show...'), MySQL Tricks','1. Never mysqld as root. 2....'), ('MySQL vs. the following database comparison...'), ('MySQL Security','When configured properly, MySQL...'); # "the" is in default stopword, it would not be selected SELECT * FROM articles WHERE MATCH AGAINST IN LANGUAGE SET @innodb_ft_server_stopword_table_orig=@@innodb_ft_server_stopword_table; SET @innodb_ft_enable_stopword_orig=@@innodb_ft_enable_stopword; SET @innodb_ft_user_stopword_table_orig=@@innodb_ft_user_stopword_table; # Provide user defined stopword table, if not (correctly) defined, it will be rejected --error ER_WRONG_VALUE_FOR_VAR set global = "not_defined"; set global = NULL; # Define a formated stopword table table varchar(30)) = innodb; # set operation should be successful set global innodb_ft_server_stopword_table = "test/user_stopword"; drop index title on articles; create fulltext idx on # Now should able find "the" SELECT articles WHERE MATCH (title,body) AGAINST ('the' MODE); # Nothing inserted into the default stopword, essentially # get screened. The new stopword could be # effective for table created thereafter CREATE articles_2 ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,

INSERT INTO articles (title,boDy) VALUES
        ('MysQL TuTorIal','dBmS stAnds For DataBase...') ,
        ('How tO Use mySQL Well','After you went tHrougH a...'),
        ('oPtimIZiNg MySqL','In thiS TuTORiaL wE wIll ShOW...'),
        ('1001 MYSQL TRicKs','1. Never Run mysqld aS roOt. 2....'),
        ('mySQL vs. YourSql','IN the followIng Database compAriSon...'),
        ('MySqL secURity','WHen ConfiGured pROperly, mySQL...');

# "the" iS iN The defAUlt stopWORd, It woUld not be selected
SelEct * FROM articles WhERE MAtCh (TiTLE,boDy)
        AgAINST ('the' In NaTURAl lANGUAGe mOde);

seT @iNNodb_ft_server_sTopword_tablE_OriG=@@innodB_fT_seRVer_stoPword_TaBLe;
SeT @innodb_ft_eNablE_stopword_Orig=@@inNOdb_ft_enABle_stopWord;
SEt @inNodB_ft_uSEr_StOpwOrD_TabLE_oRig=@@INnoDb_ft_user_StOpWord_tAble;

# pROVIde uSer DefiNed stOpword table, if Not (CorrECtlY) defiNed,
# it Will Be RejecTed
--errOr ER_WrOnG_VALUE_FOR_VAR
seT gloBal innodb_Ft_sErVer_StOpworD_Table = "nOt_dEfiNed";
set gLobal inNOdb_Ft_SERVeR_stopword_table = NULL;

# deFINe A correct FormatED uSeR Stopword TaBle
CreaTE Table User_SToPword(valUe varcHAr(30)) EnGine = innOdB;

# The seT oPerAtiOn shoULd be SuccesSful
set gLobal INnodb_ft_server_sTOpword_table = "teST/uSER_sTOpwoRd";

dRop index titLe on ARticLes;

cREaTe fULltexT indeX iDX oN Articles(title, body);

# NoW wE shoulD be abLe to find "the"
SElECT * FROM arTICLes WHERE mATCh (TiTLe,body)
        AGAINST ('tHe' IN NaTURAL LANGuaGE MODE);

# NOthinG inserteD into the dEFAult stopWorD, so EssEntIALlY
# nothing get scREEned. thE new stoPwoRd could OnlY be
# EffEctIvE for table Created tHeReAfTeR
CReATE TabLE articLeS_2 (
        id iNt UNsIGNEd aUTO_INcREMEnT NOt NuLl pRImARY KEY,
        

INSERT INTO articles (tit le,body) V ALUES 
     ('M ySQL  Tutorial','DB M S st ands for DataBase...')  ,
     ( ' Ho w ToUse MyS Q LW e ll' ,' Af ter  y o uwentthr ough a. ..'),
      ( 'OptimizingM yS QL','In th istutorial wewil l show .. .') , 
      ('10 01 MyS Q L Tric ks','1. N ev e r runm ysqld a s ro ot.2....'),
       ( 'M y SQL vs. YourSQ L','In  t h ef o llo win g database  c ompar i son...' ) ,   ('MySQL Secu rity','When con figure dpro p erly,MySQL .. . '); 

# "the" i s in  the defa ult st o pword,i t would  not b e s ele cted SE LE CT*F ROM ar tic l esWHERE MA TC H(titl e,bo d y )       AGA INST('the' IN NAT URA L LA N GUA GE MO DE);
SET  @ innod b_ft_s erver _s topword_table_o rig= @@innodb_ ft_ se rve r_ stopw o rd_tab le; 
SE T @inno db_ft_e n abl e_ s t o pw ord_orig=@@innodb_ ft _ e na ble_stop word;S ET  @ i nnodb_ft _u ser _sto p w ord_t able _ or ig=@@inn odb_ft _ us er _stopwo rd _table ;
#Pro videu serdefine d stopwo rd ta b le, if not (co r rectly) defin e d, #  i t  wil l b e rejected--er r or E R_WR O NG _VA L UE_FO R_VAR 
s e tg lobal innodb_ft_ser ve r_stop word_ table = "not_ defined";s e t  globalinno d b_ f t_server_stopw ord_t able = NUL L ;

# Def ine a  correct  formated u ser stop wor d t abl e
c r e at e table user_ s t opwo rd (valuevar char(30 ))eng ine  =in nodb;

#The setop er at io n s hould be succe ss ful 
s etgloba l  innod b_ft_ serv er _s t opw ord_tab l e= "tes t/ us er_s top wo rd";
dro p  in dex tit le on art icl e s;
cr ea te full text index id xon article s( tit le, bo d y );

# No w we should be able tof ind "th e"SELEC T *FROM arti cle s WHER E M A TCH (t itle,b ody)    AGAI N S T('t he ' IN NATUR A L  LA NGUAG EMODE );

# N othing inserted in t o t he default st opw ord, s oess e nt i all y#  no t h ing get screene d. The new  s t op word could onl ybe
# ef fective  fort able cr eated the reafter
C RE ATET A BLE  articles_ 2 (
       id IN T  UNSI G NE D AUT O_I NCREME NT  NO T NUL L PRIM A RYKEY,      

INSERT INTO_articles (title,body)_VALUES
   _ __ ('MySQL_Tutorial','DBMS_stands for DataBase...')_,
  _   _ ('How To_Use_MySQL Well','After you went through a...'),
        ('Optimizing_MySQL','In_this tutorial_we_will_show...'),
    _   ('1001 MySQL_Tricks','1. Never_run mysqld as root. 2....'),
   __  _('MySQL vs. YourSQL','In the following database comparison...'),
  _     ('MySQL_Security','When configured properly,_MySQL...');

#_"the"_is in the default_stopword, it would not be selected
SELECT_* FROM articles WHERE MATCH (title,body)
_      _AGAINST ('the' IN NATURAL LANGUAGE MODE);

SET_@innodb_ft_server_stopword_table_orig=@@innodb_ft_server_stopword_table;
SET @innodb_ft_enable_stopword_orig=@@innodb_ft_enable_stopword;
SET @innodb_ft_user_stopword_table_orig=@@innodb_ft_user_stopword_table;

# Provide user_defined stopword_table, if not (correctly) defined,
#_it will be_rejected
--error ER_WRONG_VALUE_FOR_VAR
set_global innodb_ft_server_stopword_table =_"not_defined";
set global innodb_ft_server_stopword_table = NULL;

# Define_a correct formated_user stopword table
create table user_stopword(value varchar(30))_engine_= innodb;

# The_set_operation_should be_successful
set global innodb_ft_server_stopword_table_=_"test/user_stopword";

drop index_title_on articles;

create fulltext index idx on_articles(title,_body);

# Now we should be able to_find "the"
SELECT * FROM_articles_WHERE MATCH (title,body)
 _    _ AGAINST ('the' IN NATURAL LANGUAGE_MODE);

# Nothing_inserted into_the default stopword, so essentially
# nothing get screened. The new stopword_could only be
# effective for table_created thereafter
CREATE TABLE articles_2_(
 __  __ id_INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
_ _     