简体   繁体   English

如何将MySQL全文搜索从MyISAM迁移到InnoDB

[英]How to migrate MySQL Fulltext Search from MyISAM to InnoDB

I needed to migrate from MyISAM to InnoDB. 我需要从MyISAM迁移到InnoDB。 In the process I found that the app return now errors on some searches: 在此过程中,我发现该应用程序现在在某些搜索中返回错误:

1064 syntax error, unexpected ')', expecting $end 1064语法错误,意外的是')',期望$ end

Are there any significant changes or characters I have to escape? 是否有任何重大变化或我必须逃避的角色? 80% of the searches work OK. 80%的搜索正常。

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. 这非常像MySQL中的错误。

I suspect that this is a bug in MySQL 5.6.x. 我怀疑这是MySQL 5.6.x中的错误。

One possible solution is to replace the characters in question: 一种可能的解决方案是替换有问题的字符:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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