Bug #81666 The MYSQL_SERVER define not defined du to spelling error in plugin.cmake
Submitted: 1 Jun 2016 6:26 Modified: 3 Aug 2016 12:54
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.12 OS:Any
Assigned to: CPU Architecture:Any

[1 Jun 2016 6:26] Magnus Blåudd
Description:
The MYSQL_ADD_PLUGIN macro has a spelling error causing the MYSQL_SERVER define not to be defined. This causes the storage engine plugins to be compiled without MYSQL_SERVER defined and thus may get a different set of function signatures, functions and symbols unless the source of the plugins themself define the MYSQL_SERVER define. 

The plugin.cmake intends to add the MYSQL_SERVER define to the storage engine target but fails to do so since there is a spelling error of the property COMPILE_DEFINITIONS it want to set.

The embedded target properly get both MYSQL_SERVER and EMBEDDED_LIBRARY defined as intended. Similar spelling error there would probably have been noticed.

How to repeat:

diff --git a/cmake/plugin.cmake b/cmake/plugin.cmake
index eb968c7..8a4c89f 100644
--- a/cmake/plugin.cmake
+++ b/cmake/plugin.cmake
@@ -123,6 +123,7 @@ MACRO(MYSQL_ADD_PLUGIN)
   IF (WITH_${plugin} AND NOT ARG_MODULE_ONLY)
     ADD_CONVENIENCE_LIBRARY(${target} STATIC ${SOURCES})
     SET_TARGET_PROPERTIES(${target} PROPERTIES COMPILE_DEFINITONS "MYSQL_SERVER")
+                                                              ^
     DTRACE_INSTRUMENT(${target})
     ADD_DEPENDENCIES(${target} GenError ${ARG_DEPENDENCIES})
     IF(WITH_EMBEDDED_SERVER AND NOT ARG_NOT_FOR_EMBEDDED)

Suggested fix:
Fix the spelling error of COMPILE_DEFINITIONS
[3 Aug 2016 12:54] Paul Dubois
Posted by developer:
 
Noted in 5.7.15 changelog.

The MYSQL_ADD_PLUGIN macro had a spelling error that caused
MYSQL_SERVER not to be defined.