Bug #70178 InnoDB FTS Information Schema plugins cannot be loaded when built as Shared Lib
Submitted: 28 Aug 2013 22:52 Modified: 10 Jun 2014 11:29
Reporter: David Newgas Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.6.13 OS:Any
Assigned to: CPU Architecture:Any

[28 Aug 2013 22:52] David Newgas
Description:
InnoDB's full text search (FTS) information_schema plugins incorrectly define the info field. This has no effect when InnoDB is compiled statically into MySQL. However when InnoDB is a shared library, the version check causes the FTS information_schema plugins to error during load.

How to repeat:
1. Build InnoDB as a shared library
2. Start mysql
3. Try to load a InnoDB FTS INFORMATION_SCHEMA plugin: INSTALL PLUGIN INNODB_FT_DELETED SONAME 'ha_innodb.so';

Expected result: Plugin loads

Actual result: ERROR 1126 (HY000): Can't open shared library 'ha_innodb.so' (errno: 0 API version for INFORMATION SCHEMA plugin is too different)

Suggested fix:
This appears to be because the definitions of the information_schema plugins in i_s.cc are incorrectly defining the info field. This is not noticed when InnoDB is built in (the only supported configuration) because version numbers are not
checked.

Patch:

--- mysql-5.6.13/storage/innobase/handler/i_s.cc	2013-07-10 09:17:27.000000000 -0700
+++ mysql-5.6.13.patched/storage/innobase/handler/i_s.cc	2013-08-28 15:50:11.587210427 -0700
@@ -2904,7 +2904,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_stopword_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
@@ -3076,7 +3076,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_fts_doc_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
@@ -3163,7 +3163,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_fts_doc_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
@@ -3430,7 +3430,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_fts_index_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
@@ -3735,7 +3735,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_fts_index_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
@@ -3933,7 +3933,7 @@
 
 	/* pointer to type-specific plugin descriptor */
 	/* void* */
-	STRUCT_FLD(info, &i_s_fts_config_fields_info),
+	STRUCT_FLD(info, &i_s_info),
 
 	/* plugin name */
 	/* const char* */
[24 Apr 2014 16:40] MySQL Verification Team
Hi David, I didn't see this old bug here.  I've just filed my own version of the report (with fix also!)

http://bugs.mysql.com/bug.php?id=72441
[10 Jun 2014 11:29] Daniel Price
Fixed as of the upcoming 5.6.20, 5.7.5 release, and here's the changelog entry:

When "InnoDB" is built as a shared library, attempting to load the
"InnoDB" full-text search (FTS) "INFORMATION_SCHEMA" plugin would fail
with a "Can't open shared library 'ha_innodb.so'" error. 

Thank you for the bug report.
[7 Aug 2014 5:45] Laurynas Biveinis
$ bzr log -n0 -r 5984
------------------------------------------------------------
revno: 5984
committer: Jimmy Yang <jimmy.yang@oracle.com>
branch nick: mysql-5.6
timestamp: Tue 2014-06-10 15:59:35 +0800
message:
  Fix Bug #18655281 - INNODB FTS INFORMATION SCHEMA PLUGINS CANNOT BE LOADED
  WHEN BUILT AS SHARED LIB 
  
  rb://5255 approved by Sunny Bains