• marko's avatar
    branches/zip: Allow the symbols in the dynamic InnoDB plugin to be · cf98f660
    marko authored
    redefined so that the dynamic plugin can replace the builtin InnoDB
    in MySQL 5.1.
    
    ha_innodb.cc, handler0alter.cc: #include "univ.i" before any other InnoDB
    header files or before defining any symbols
    
    innodb_redefine.h: New file, to contain a mapping of symbols.  The idea
    is that this file will be replaced in the build process; because this
    is a large file that can be generated automatically, it does not make sense
    to keep it under version control.
    
    univ.i: #include "innodb_redefine.h" and #define ha_innobase ha_innodb
    
    Makefile.am (ha_innodb_la_CXXFLAGS): Remove -Dha_innobase=ha_innodb
    
    NOTE: there are still some issues in the source code.  One known issue is
    the #undef mutex_free in sync0sync.h, which will cause the plugin to call the
    function mutex_free in the builtin InnoDB.  The preprocessor symbols defined
    in innodb_redefine.h must not be undefined or redefined anywhere in the code.
    cf98f660
innodb_redefine.h 455 Bytes
/* This file is needed for building a dynamic InnoDB plugin that
can replace the builtin InnoDB plugin in MySQL.
It must be generated as follows:

* compile the InnoDB plugin
* overwrite include/innodb_redefine.h with the following command
* compile the final InnoDB plugin

nm .libs/ha_innodb.so.0.0.0|
sed -ne 's/^[^ ]* . \([a-zA-Z][a-zA-Z0-9_]*\)$/#define \1 ibd_\1/p'|
grep -v 'innodb_hton_ptr\|builtin_innobase_plugin' > include/innodb_redefine.h
*/