Bug #89766 a typo in `cmake/plugin.cmake` prevents `MYSQL_SERVER` to be defined for plugin
Submitted: 22 Feb 2018 13:03 Modified: 5 Mar 2018 15:04
Reporter: Przemysław Skibiński (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5, 5.6, 5.5.59, 5.6.39 OS:Any
Assigned to: CPU Architecture:Any

[22 Feb 2018 13:03] Przemysław Skibiński
Description:
MySQL 5.5 and 5.6 have a typo in `plugin.cmake` that is missing `I` in `COMPILE_DEFINITONS`:
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER")

MySQL 5.7 and 8.0 are fixed:
SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITIONS "MYSQL_SERVER")

This issue prevents `MYSQL_SERVER` to be defined for statically linked plugins.

How to repeat:
Search for "MYSQL_SERVER" in plugin.cmake
[22 Feb 2018 13:16] MySQL Verification Team
Hello Przemysław,

Thank you for the report and feedback!

Thanks,
Umesh
[22 Feb 2018 13:58] Ståle Deraas
This is unfortunately not only about a typo. See the commit message for bug#81666 (orabug-23508762) , where it states in addtion to fixing typo:

"The addition of -DMYSQL_SERVER to all plugins uncovers some other bugs
when compiling performance-schema related code, so more plugins need
to be recompiled for embedded mode (without performance schema)
Before this fix, several plugins were not properly instrumented.

Remove -DMYSQL_SERVER from the 'innobase' plugin, it breaks embedded build.
The alternative would be to do RECOMPILE_FOR_EMBEDDED, but that's a lot
of extra work.

The standalone test utilities hp_test1 and hp_test2 need to be linked
against a library built without performance schema.

The standalone myisam utilities (myisam_ftdump et.al.) also need to
be linked against a library build without performance schema.

Now that the MYSQL_ADD_PLUGIN macro has been fixed, we need to quote the
'curr' variable in NDB_ADD_TARGET_PROPERTY (${curr} is a list)"
[1 Mar 2018 12:00] Przemysław Skibiński
Backport to 5.5.59 of changes from 5.7 at https://bugs.mysql.com/bug.php?id=81666

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

Contribution: 23508762_55.patch (text/x-patch), 6.52 KiB.

[1 Mar 2018 12:01] Przemysław Skibiński
Backport to 5.6.39 of changes from 5.7 at https://bugs.mysql.com/bug.php?id=81666

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

Contribution: 23508762_56.patch (text/x-patch), 6.51 KiB.

[5 Mar 2018 15:00] Przemysław Skibiński
A minimal set of changes required to fix COMPILE_DEFINITIONS in 5.5 and 5.6

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

Contribution: 55_COMPILE_DEFINITIONS.patch (text/x-patch), 1.04 KiB.

[5 Mar 2018 15:04] Przemysław Skibiński
It seems that a backport of changes for 5.7 in bug#81666 (orabug-23508762) is not needed for 5.5 and 5.6. The only file that needs modifications is storage/innobase/CMakeLists.txt. I attached a minimal set of changes required to fix COMPILE_DEFINITIONS in 5.5 and 5.6.