简体   繁体   中英

How to migrate MySQL Fulltext Search from MyISAM to InnoDB

I needed to migrate from MyISAM to InnoDB. In the process I found that the app return now errors on some searches:

1064 syntax error, unexpected ')', expecting $end

Are there any significant changes or characters I have to escape? 80% of the searches work OK.

The character -- and ) and @ do not work anymore

eg

SELECT MATCH (anchor) AGAINST ('te--st' IN BOOLEAN MODE) score
FROM seo_content_links

SELECT MATCH (anchor) AGAINST ('te)st' IN BOOLEAN MODE) score
FROM seo_content_links 

SELECT MATCH (anchor) AGAINST ('te@st' IN BOOLEAN MODE) score
FROM seo_content_links  

This very much looks like a bug in MySQL.

I suspect that this is a bug in MySQL 5.6.x.

One possible solution is to replace the characters in question:

$text = addslashes(str_replace(array("--", "@", ")", "(", "-"), " ", $text));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM