Bug #89598 plugin_mecab.cc:54:19: warning: unused variable 'bundle_mecab'
Submitted: 9 Feb 4:45 Modified: 23 Mar 18:11
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7,8.0 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, MeCab

[9 Feb 4:45] Laurynas Biveinis
If MeCab plugins are built, then plugin_mecab.cc produces a legit compilation warning with some compilers:

Scanning dependencies of target mecab_parser
[ 59%] Building CXX object plugin/fulltext/CMakeFiles/mecab_parser.dir/mecab_parser/plugin_mecab.cc.o
/Users/laurynas/percona/mysql-server/plugin/fulltext/mecab_parser/plugin_mecab.cc:54:19: warning: unused variable 'bundle_mecab' [-Wunused-const-variable]
static const bool bundle_mecab= false;
1 warning generated.

How to repeat:
I see this with XCode clang, but this has been also seen with Linux clang too, this is not macOS-specific.

$ clang --version
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

cmake -DWITH_MECAB=system

Suggested fix:
Remove the unused variable
[9 Feb 4:49] Laurynas Biveinis
Bug 89598 fix for 5.7 and 8.0

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: bug89598-5.7-8.0.patch (application/octet-stream, text), 958 bytes.

[9 Feb 5:59] Umesh Shastry
Hello Laurynas,

Thank you for the report and contribution.

[23 Mar 18:11] Paul Dubois
Posted by developer:
Fixed in 8.0.12.

Under some conditions, an unused-variable warning occurred in the
MeCab full-text search code. Thanks to Laurynas Biveinis for the