2014-02-17 11:00:51 +01:00
|
|
|
/* Copyright (c) 2005, 2013, Oracle and/or its affiliates
|
2017-03-06 13:06:03 +01:00
|
|
|
Copyright (C) 2009, 2017, MariaDB
|
2005-11-05 13:20:35 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2006-12-27 02:23:51 +01:00
|
|
|
the Free Software Foundation; version 2 of the License.
|
2005-11-05 13:20:35 +02:00
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2019-05-11 21:29:06 +03:00
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
|
2005-11-05 13:20:35 +02:00
|
|
|
|
2017-03-06 22:42:00 +01:00
|
|
|
#ifndef MYSQL_PLUGIN_INCLUDED
|
|
|
|
#define MYSQL_PLUGIN_INCLUDED
|
2005-11-05 13:20:35 +02:00
|
|
|
|
2009-06-10 10:59:49 +02:00
|
|
|
/*
|
|
|
|
On Windows, exports from DLL need to be declared
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
Also, plugin needs to be declared as extern "C" because MSVC
|
|
|
|
unlike other compilers, uses C++ mangling for variables not only
|
|
|
|
for functions.
|
2009-06-10 10:59:49 +02:00
|
|
|
*/
|
2019-06-28 15:53:49 +02:00
|
|
|
#ifdef MYSQL_DYNAMIC_PLUGIN
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define MYSQL_DLLEXPORT _declspec(dllexport)
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#else
|
2019-06-28 15:53:49 +02:00
|
|
|
#define MYSQL_DLLEXPORT
|
WL#5161 : Cross-platform build with CMake
BUILD-CMAKE:
WL#5161 : Documentation on how to build with CMake on Unix/Windows
BUILD/Makefile.am:
Add new file
BUILD/autorun.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
BUILD/choose_configure.sh:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
CMakeLists.txt:
WL#5161 : Rewrite top-level CMakeLists.txt.
Remove Windows specifics
- compiler flags handling moved to configure.cmake
- storage engine/plugin stuff moved into cmake/plugin.cmake
- copy docs
Makefile.am:
Added new files
client/CMakeLists.txt:
WL#5161 : Rewrite CMakeLists.txt to be platform-independent
Handle packagng (add INSTALL commands)
cmake/Makefile.am:
WL#5161 : use choose_configure instead of autotools configure script
(choose configure will call cmake if cmake is available)
cmake/abi_check.cmake:
Custom targets for abi_check (for cmake)
cmake/bison.cmake:
- Check bison availability
- Add RUN_BISON macro (used to create sql_yacc.cc and sql_yacc.h)
cmake/cat.cmake:
Add helper script to concatenate files.
cmake/character_sets.cmake:
Handle configuration parameters WITH_EXTRA_CHARSETS
cmake/check_minimal_version.cmake:
Helper script to check the minimum required version of cmake
cmake/configure.pl:
Add perl script to convert ./configure parameters for cmake
cmake/create_initial_db.cmake.in:
Add script helper to create initial database.
(on Windows, we pack initial db with the redistribution
package)
cmake/do_abi_check.cmake:
Perform abi check
cmake/dtrace.cmake:
Handle dtrace in CMake Build.
Check for dtrace availablility,
run dtrace -G on solaris in prelink step
cmake/dtrace_prelink.cmake:
Run dtrace -G on Solaris in pre-link step,
link the object it creates together with library or
executable
cmake/install_macros.cmake:
Helper macros for packaging
(install pdb on Windows, install symlinks on Unix)
cmake/make_dist.cmake.in:
"make dist" -
- pack autotools ./configure script with the source
(renamed to configure.am)
- pack bison output
cmake/merge_archives_unix.cmake.in:
script to merge static libraries on Unix
cmake/misc.cmake:
Build helper macros
- MERGE_STATIC_LIBS
We use it when building client library and embedded
(avoid recompilation)
- Convert source file paths to absolute names.
We use it in to locate files of a different project,
when the files need to be recompiled (e.g in embedded
several storage engines are recompiled with
-DEMBEDDED_LIBRARY)
cmake/mysql_version.cmake:
Extract version info from configure.in
Handle package names.
cmake/plugin.cmake:
Rewrote storage/mysql_storage_engine.cmake to handle
other types of plugins and do it in OS-independent manner.
cmake/readline.cmake:
Macros to handle WITH_READLINE/WITH_LIBEDIT parameters
cmake/ssl.cmake:
Add macros to handle WITH_SSL parameter.
cmake/stack_direction.c:
Helper to check stack direction.
cmake/zlib.cmake:
Add macros to handle WITH_ZLIB parameter
cmd-line-utils/libedit/CMakeLists.txt:
Build libedit with cmake.
cmd-line-utils/libedit/Makefile.am:
Add new file
cmd-line-utils/readline/CMakeLists.txt:
Build readline with CMake.
cmd-line-utils/readline/Makefile.am:
Add new file
config.h.cmake:
WL#5161 : Add config.h template for cmake
configure.cmake:
WL#5161 : Add platform tests ( for cmake)
configure.in:
Added new subdirectories
dbug/CMakeLists.txt:
WL#5161
extra/CMakeLists.txt:
WL#5161
extra/yassl/CMakeLists.txt:
WL#5161
extra/yassl/taocrypt/CMakeLists.txt:
WL#5161
include/Makefile.am:
Add new file
include/keycache.h:
remove configure-win.h and remove HUGE_PTR defined there.
include/my_global.h:
use my_config.h for Windows, not config-win.h anymore
include/my_pthread.h:
- Move thread_safe_increment from config-win.h to other headers
(config-win.h is not used anymore)
- Declare pthread_cancel on Windows (it is used in daemon_example)
include/my_sys.h:
Add malloc.h on Windows (we use -D_WIN32_LEAN_AND_MEAN now, and
with this define malloc.h is not included automatically via windows.h)
include/mysql/plugin.h:
Handle pure-C plugins with Microsoft compiler.
include/thr_alarm.h:
remove rf_SetTimer that used to be defined in config-win.h
Replace with UINT_PTR (we do not use config-win.h anymore
and typedef was needed in this single place only)
libmysql/CMakeLists.txt:
Avoid pointless recompilation of source files
in client library if possible. Merge static
libs (dbug, mysys) to create static client
library.
libmysqld/CMakeLists.txt:
Avoid pointless recompilation of source files
when building embedded. Instead, merge dbug and
mysys (and some other static libs) into embedded.
libmysqld/examples/CMakeLists.txt:
Embedded compilation on Unix
libmysqld/lib_sql.cc:
Do not define THD::clear_error() in lib_sql.cc
for embedded. Instead, use the same inline
definition from sql_class.h as in none-embedded
case (fixes duplicate symbol errors on Windows
and removes pointless #ifdef EMBEDDED)
man/CMakeLists.txt:
Install man files.
man/Makefile.am:
Add new file.
mysql-test/CMakeLists.txt:
Install mysql-test files
mysql-test/Makefile.am:
Add new files
mysql-test/lib/My/ConfigFactory.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/Find.pm:
the build configurations are now also available on Unix
Xcode on Mac uses the Release, RelwithDebinfo and Debug
subdirectories for executables. Earlier, build configurations
were available only on Windows.
mysql-test/lib/My/SafeProcess.pm:
Allow testing with mtr in out-of-source builds.
mysql-test/lib/My/SafeProcess/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysql-test/lib/My/SafeProcess/safe_kill_win.cc:
add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
mysql-test/lib/My/SafeProcess/safe_process_win.cc:
Add stdlib.h (to be able to compile with -DWIN32_LEAN_AND_MEAN)
define JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE if not defined
(can happen using MinGW compiler that comes with old SDK)
mysql-test/mtr.out-of-source:
Allow testing with mtr in out-of-source builds.
mysql-test/mysql-test-run.pl:
Allow testing with mtr in out-of-source builds.
Use common find_plugin macro for Windows and unix.
mysql-test/t/fulltext_plugin.test:
This test can now run on Windows as well.
mysys/CMakeLists.txt:
Port CMakeLists.txt to Unix
mysys/my_create.c:
config-win.h is dead => NO_OPEN_3 is never defined.
mysys/my_getsystime.c:
config-win.h is dead => define OFFSET_TO_EPOCH where it is used.
mysys/my_winthread.c:
Add win32 pthread_cancel - used by daemon_example
mysys/mysys_priv.h:
config-win.h is dead => include <sys/stat.h> where it is used
fix prototype of my_win_(f)stat
plugin/daemon_example/CMakeLists.txt:
Compile daemon_example with CMake
plugin/daemon_example/Makefile.am:
Add new file
plugin/fulltext/CMakeLists.txt:
Compile full-text example with CMake
plugin/fulltext/Makefile.am:
Add new file.
plugin/semisync/CMakeLists.txt:
Fix semisync to use common macro for plugins.
regex/CMakeLists.txt:
Use absolute filenames, when adding regex library
(we recompile files in embedded, and want to locate
sources via GET_TARGET_PROPERTY( ... SOURCES ..))
regex/regex2.h:
Remove pointless typedef (produces error with MinGW compiler)
scripts/CMakeLists.txt:
Add configure/install for scripts
sql-bench/CMakeLists.txt:
install sql-bench files
sql-bench/Makefile.am:
Add new file
sql/CMakeLists.txt:
Port CmakeLists.txt to Unix
sql/nt_servc.cc:
compile server with -DWIN32_LEAN_AND_MEAN
sql/share/CMakeLists.txt:
Install charsets
sql/share/Makefile.am:
Add new file
sql/sql_builtin.cc.in:
Handle pure-C plugins on Windows.
sql/sql_class.h:
Use the same clear_error macro in embedded and not embedded.
Fixes pointless #ifdef and avoids duplicate symbols when linking
on Windows.
storage/Makefile.am:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
storage/archive/CMakeLists.txt:
Add names for static and dynamic plugin libraries.
Link archive with zlib
storage/blackhole/CMakeLists.txt:
Add names for static and dynamic storage
engine libraries
storage/csv/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/example/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/federated/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/heap/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/ibmdb2i/CMakeLists.txt:
Better port for ibmdb2i plugin
storage/innobase/CMakeLists.txt:
Run system checks.
Add names for static and dynamic storage engine
libraries.
storage/innobase/include/page0page.ic:
Fix compile error on OpenSolaris.
storage/myisam/CMakeLists.txt:
Port CmakeLists.txt to Unix
storage/myisammrg/CMakeLists.txt:
Add names for static and dynamic storage engine
libraries
storage/mysql_storage_engine.cmake:
storage/mysql_storage_engine.cmake => cmake/plugin.cmake
support-files/CMakeLists.txt:
Configure and install some files from support-files.
support-files/Makefile.am:
Add new file
tests/CMakeLists.txt:
In general case, mysqlclient library can be dependent
on C++ runtime(if it includes yassl and is not compiled
with gcc or MSVC)
unittest/mysys/CMakeLists.txt:
Add unit tests
unittest/mysys/Makefile.am:
Add new file
unittest/mytap/CMakeLists.txt:
Add library for unit tests
unittest/mytap/Makefile.am:
Add new file
unittest/mytap/tap.c:
fix function definitions to match declarations
win/create_def_file.js:
Fix link error with intel compiler (icl
defines of special label for exception handler)
2009-11-09 12:32:48 +01:00
|
|
|
#endif
|
2019-06-28 15:53:49 +02:00
|
|
|
#else
|
|
|
|
#define MYSQL_DLLEXPORT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define MYSQL_PLUGIN_EXPORT extern "C" MYSQL_DLLEXPORT
|
|
|
|
#else
|
|
|
|
#define MYSQL_PLUGIN_EXPORT MYSQL_DLLEXPORT
|
2009-06-10 10:59:49 +02:00
|
|
|
#endif
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
class THD;
|
|
|
|
class Item;
|
|
|
|
#define MYSQL_THD THD*
|
|
|
|
#else
|
|
|
|
#define MYSQL_THD void*
|
|
|
|
#endif
|
|
|
|
|
2013-06-03 11:57:34 +04:00
|
|
|
typedef char my_bool;
|
2013-03-26 00:03:13 +02:00
|
|
|
typedef void * MYSQL_PLUGIN;
|
2013-06-03 11:57:34 +04:00
|
|
|
|
2009-11-02 21:05:42 +01:00
|
|
|
#include <mysql/services.h>
|
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
2007-07-05 01:05:47 +02:00
|
|
|
|
|
|
|
#define MYSQL_XIDDATASIZE 128
|
|
|
|
/**
|
|
|
|
struct st_mysql_xid is binary compatible with the XID structure as
|
|
|
|
in the X/Open CAE Specification, Distributed Transaction Processing:
|
|
|
|
The XA Specification, X/Open Company Ltd., 1991.
|
|
|
|
http://www.opengroup.org/bookstore/catalog/c193.htm
|
|
|
|
|
|
|
|
@see XID in sql/handler.h
|
|
|
|
*/
|
|
|
|
struct st_mysql_xid {
|
|
|
|
long formatID;
|
|
|
|
long gtrid_length;
|
|
|
|
long bqual_length;
|
|
|
|
char data[MYSQL_XIDDATASIZE]; /* Not \0-terminated */
|
|
|
|
};
|
|
|
|
typedef struct st_mysql_xid MYSQL_XID;
|
2007-03-02 08:43:45 -08:00
|
|
|
|
2005-11-05 13:20:35 +02:00
|
|
|
/*************************************************************************
|
|
|
|
Plugin API. Common for all plugin types.
|
|
|
|
*/
|
|
|
|
|
2010-04-01 17:34:51 +03:00
|
|
|
/* MySQL plugin interface version */
|
2013-03-26 00:03:13 +02:00
|
|
|
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0104
|
2005-11-05 13:20:35 +02:00
|
|
|
|
2010-04-01 17:34:51 +03:00
|
|
|
/* MariaDB plugin interface version */
|
2021-09-06 22:34:35 +04:00
|
|
|
#define MARIA_PLUGIN_INTERFACE_VERSION 0x010f
|
2005-11-05 13:20:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
The allowable types of plugins
|
|
|
|
*/
|
2014-11-25 21:58:14 +01:00
|
|
|
#define MYSQL_UDF_PLUGIN 0 /* not implemented */
|
|
|
|
#define MYSQL_STORAGE_ENGINE_PLUGIN 1
|
handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().
mysql-test-run.pl bugfixes
include/mysql/plugin.h:
added st_mysql_storage_engine
made handlerton tied to MySQL version
mysql-test/mysql-test-run.pl:
bugfixes (umask, --no-defaults)
mysql-test/r/ndb_dd_basic.result:
update error message
mysql-test/t/partition_mgm_err2.test:
fix typo
sql/ha_berkeley.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_berkeley.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_federated.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_heap.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisam.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisammrg.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster_binlog.cc:
no 'name' in the handlerton anymore
sql/ha_partition.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/handler.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
handlerton->plugin mapping
sql/handler.h:
handlerton cleanup: remove duplicate fields
sql/log.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/mysql_priv.h:
handler.h needs plugin.h
sql/mysqld.cc:
Convert --default-storage-engine to a handlerton* when
all storage engines are initialized and not in getopt
sql/set_var.cc:
no name in the handlerton anymore
sql/sql_parse.cc:
no default_hton anymore
sql/sql_partition.cc:
no name in the handlerton anymore
sql/sql_plugin.cc:
generalize plugin type-specific initialization.
initialize built-in plugins too
sql/sql_plugin.h:
generalize plugin type-specific initialization.
sql/sql_show.cc:
st_mysql_storage_engine structure
no name in the handlerton anymore
sql/sql_table.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_tablespace.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_yacc.yy:
no default_hton anymore
issue "unknown storage engine" warning where it is discovered
storage/archive/ha_archive.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/archive/ha_archive.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/blackhole/ha_blackhole.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/csv/ha_tina.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/example/ha_example.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
2006-05-28 14:51:01 +02:00
|
|
|
#define MYSQL_FTPARSER_PLUGIN 2 /* Full-text parser plugin */
|
2014-11-25 21:58:14 +01:00
|
|
|
#define MYSQL_DAEMON_PLUGIN 3
|
|
|
|
#define MYSQL_INFORMATION_SCHEMA_PLUGIN 4
|
|
|
|
#define MYSQL_AUDIT_PLUGIN 5
|
|
|
|
#define MYSQL_REPLICATION_PLUGIN 6
|
|
|
|
#define MYSQL_AUTHENTICATION_PLUGIN 7
|
2019-10-16 16:22:04 +04:00
|
|
|
#define MYSQL_MAX_PLUGIN_TYPE_NUM 12 /* The number of plugin types */
|
2005-11-05 13:20:35 +02:00
|
|
|
|
2014-11-25 21:58:14 +01:00
|
|
|
/* MariaDB plugin types */
|
2015-01-05 13:36:14 +01:00
|
|
|
#define MariaDB_PASSWORD_VALIDATION_PLUGIN 8
|
2015-03-27 09:45:22 +01:00
|
|
|
#define MariaDB_ENCRYPTION_PLUGIN 9
|
2019-10-04 18:33:09 +04:00
|
|
|
#define MariaDB_DATA_TYPE_PLUGIN 10
|
2019-10-16 12:43:24 +04:00
|
|
|
#define MariaDB_FUNCTION_PLUGIN 11
|
2014-11-25 21:58:14 +01:00
|
|
|
|
2006-10-05 00:41:29 -07:00
|
|
|
/* We use the following strings to define licenses for plugins */
|
|
|
|
#define PLUGIN_LICENSE_PROPRIETARY 0
|
|
|
|
#define PLUGIN_LICENSE_GPL 1
|
|
|
|
#define PLUGIN_LICENSE_BSD 2
|
|
|
|
|
|
|
|
#define PLUGIN_LICENSE_PROPRIETARY_STRING "PROPRIETARY"
|
|
|
|
#define PLUGIN_LICENSE_GPL_STRING "GPL"
|
|
|
|
#define PLUGIN_LICENSE_BSD_STRING "BSD"
|
|
|
|
|
2010-04-01 17:34:51 +03:00
|
|
|
/* definitions of code maturity for plugins */
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_UNKNOWN 0
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_EXPERIMENTAL 1
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_ALPHA 2
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_BETA 3
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_GAMMA 4
|
|
|
|
#define MariaDB_PLUGIN_MATURITY_STABLE 5
|
|
|
|
|
2005-11-05 13:20:35 +02:00
|
|
|
/*
|
|
|
|
Macros for beginning and ending plugin declarations. Between
|
|
|
|
mysql_declare_plugin and mysql_declare_plugin_end there should
|
|
|
|
be a st_mysql_plugin struct for each plugin to be declared.
|
|
|
|
*/
|
|
|
|
|
2006-04-13 13:49:29 -07:00
|
|
|
|
|
|
|
#ifndef MYSQL_DYNAMIC_PLUGIN
|
2006-05-02 04:11:00 -07:00
|
|
|
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
2006-04-13 13:49:29 -07:00
|
|
|
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
|
|
|
int PSIZE= sizeof(struct st_mysql_plugin); \
|
|
|
|
struct st_mysql_plugin DECLS[]= {
|
2010-04-01 17:34:51 +03:00
|
|
|
|
2010-11-25 18:17:28 +01:00
|
|
|
#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
|
2012-01-18 22:09:20 +01:00
|
|
|
MYSQL_PLUGIN_EXPORT int VERSION; \
|
|
|
|
int VERSION= MARIA_PLUGIN_INTERFACE_VERSION; \
|
|
|
|
MYSQL_PLUGIN_EXPORT int PSIZE; \
|
|
|
|
int PSIZE= sizeof(struct st_maria_plugin); \
|
|
|
|
MYSQL_PLUGIN_EXPORT struct st_maria_plugin DECLS[]; \
|
2010-04-01 17:34:51 +03:00
|
|
|
struct st_maria_plugin DECLS[]= {
|
2006-04-13 13:49:29 -07:00
|
|
|
#else
|
2010-04-01 17:34:51 +03:00
|
|
|
|
2006-05-02 04:11:00 -07:00
|
|
|
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
|
2011-12-02 16:26:43 +01:00
|
|
|
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_; \
|
|
|
|
int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
|
|
|
|
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_; \
|
|
|
|
int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
|
|
|
|
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]; \
|
|
|
|
struct st_mysql_plugin _mysql_plugin_declarations_[]= {
|
|
|
|
|
|
|
|
#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
|
|
|
|
MYSQL_PLUGIN_EXPORT int _maria_plugin_interface_version_; \
|
|
|
|
int _maria_plugin_interface_version_= MARIA_PLUGIN_INTERFACE_VERSION; \
|
|
|
|
MYSQL_PLUGIN_EXPORT int _maria_sizeof_struct_st_plugin_; \
|
|
|
|
int _maria_sizeof_struct_st_plugin_= sizeof(struct st_maria_plugin); \
|
|
|
|
MYSQL_PLUGIN_EXPORT struct st_maria_plugin _maria_plugin_declarations_[]; \
|
|
|
|
struct st_maria_plugin _maria_plugin_declarations_[]= {
|
2010-04-01 17:34:51 +03:00
|
|
|
|
2006-04-13 13:49:29 -07:00
|
|
|
#endif
|
|
|
|
|
2006-05-02 04:11:00 -07:00
|
|
|
#define mysql_declare_plugin(NAME) \
|
|
|
|
__MYSQL_DECLARE_PLUGIN(NAME, \
|
|
|
|
builtin_ ## NAME ## _plugin_interface_version, \
|
2006-04-13 13:49:29 -07:00
|
|
|
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
|
|
|
|
builtin_ ## NAME ## _plugin)
|
|
|
|
|
2010-04-01 17:34:51 +03:00
|
|
|
#define maria_declare_plugin(NAME) \
|
|
|
|
MARIA_DECLARE_PLUGIN__(NAME, \
|
|
|
|
builtin_maria_ ## NAME ## _plugin_interface_version, \
|
|
|
|
builtin_maria_ ## NAME ## _sizeof_struct_st_plugin, \
|
|
|
|
builtin_maria_ ## NAME ## _plugin)
|
|
|
|
|
2011-08-15 20:12:11 +02:00
|
|
|
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
|
2010-04-01 17:34:51 +03:00
|
|
|
#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
|
2006-01-07 14:41:57 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
declarations for SHOW STATUS support in plugins
|
|
|
|
*/
|
|
|
|
enum enum_mysql_show_type
|
|
|
|
{
|
2011-11-22 18:05:34 +01:00
|
|
|
SHOW_UNDEF, SHOW_BOOL, SHOW_UINT, SHOW_ULONG,
|
|
|
|
SHOW_ULONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
|
2009-11-02 21:05:42 +01:00
|
|
|
SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE,
|
2012-10-03 01:44:54 +03:00
|
|
|
SHOW_SINT, SHOW_SLONG, SHOW_SLONGLONG, SHOW_SIMPLE_FUNC,
|
2019-07-03 17:31:20 +03:00
|
|
|
SHOW_SIZE_T, SHOW_always_last
|
2006-01-07 14:41:57 +01:00
|
|
|
};
|
|
|
|
|
2011-11-22 18:05:34 +01:00
|
|
|
/* backward compatibility mapping. */
|
|
|
|
#define SHOW_INT SHOW_UINT
|
|
|
|
#define SHOW_LONG SHOW_ULONG
|
|
|
|
#define SHOW_LONGLONG SHOW_ULONGLONG
|
|
|
|
|
2015-02-01 15:24:22 +02:00
|
|
|
enum enum_var_type
|
|
|
|
{
|
|
|
|
SHOW_OPT_DEFAULT= 0, SHOW_OPT_SESSION, SHOW_OPT_GLOBAL
|
|
|
|
};
|
|
|
|
|
2006-01-07 14:41:57 +01:00
|
|
|
struct st_mysql_show_var {
|
|
|
|
const char *name;
|
2015-03-04 10:13:06 +01:00
|
|
|
void *value;
|
2006-01-07 14:41:57 +01:00
|
|
|
enum enum_mysql_show_type type;
|
|
|
|
};
|
|
|
|
|
2016-04-28 11:10:55 +03:00
|
|
|
struct system_status_var;
|
|
|
|
|
2014-10-08 18:49:34 +02:00
|
|
|
#define SHOW_VAR_FUNC_BUFF_SIZE (256 * sizeof(void*))
|
2016-04-28 11:10:55 +03:00
|
|
|
typedef int (*mysql_show_var_func)(MYSQL_THD, struct st_mysql_show_var*, void *, struct system_status_var *status_var, enum enum_var_type);
|
2007-03-02 08:43:45 -08:00
|
|
|
|
|
|
|
|
2022-11-17 17:51:01 +04:00
|
|
|
static inline
|
|
|
|
struct st_mysql_show_var SHOW_FUNC_ENTRY(const char *name,
|
|
|
|
mysql_show_var_func func_arg)
|
|
|
|
{
|
|
|
|
struct st_mysql_show_var tmp;
|
|
|
|
tmp.name= name;
|
|
|
|
tmp.value= (void*) func_arg;
|
|
|
|
tmp.type= SHOW_FUNC;
|
|
|
|
return tmp;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-08-15 20:12:11 +02:00
|
|
|
/*
|
|
|
|
Constants for plugin flags.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define PLUGIN_OPT_NO_INSTALL 1UL /* Not dynamically loadable */
|
|
|
|
#define PLUGIN_OPT_NO_UNINSTALL 2UL /* Not dynamically unloadable */
|
|
|
|
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
/*
|
|
|
|
declarations for server variables and command line options
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define PLUGIN_VAR_BOOL 0x0001
|
|
|
|
#define PLUGIN_VAR_INT 0x0002
|
|
|
|
#define PLUGIN_VAR_LONG 0x0003
|
|
|
|
#define PLUGIN_VAR_LONGLONG 0x0004
|
|
|
|
#define PLUGIN_VAR_STR 0x0005
|
|
|
|
#define PLUGIN_VAR_ENUM 0x0006
|
|
|
|
#define PLUGIN_VAR_SET 0x0007
|
2013-05-19 23:38:06 +05:30
|
|
|
#define PLUGIN_VAR_DOUBLE 0x0008
|
2007-03-02 08:43:45 -08:00
|
|
|
#define PLUGIN_VAR_UNSIGNED 0x0080
|
|
|
|
#define PLUGIN_VAR_THDLOCAL 0x0100 /* Variable is per-connection */
|
|
|
|
#define PLUGIN_VAR_READONLY 0x0200 /* Server variable is read only */
|
|
|
|
#define PLUGIN_VAR_NOSYSVAR 0x0400 /* Not a server variable */
|
|
|
|
#define PLUGIN_VAR_NOCMDOPT 0x0800 /* Not a command line option */
|
|
|
|
#define PLUGIN_VAR_NOCMDARG 0x1000 /* No argument for cmd line */
|
|
|
|
#define PLUGIN_VAR_RQCMDARG 0x0000 /* Argument required for cmd line */
|
|
|
|
#define PLUGIN_VAR_OPCMDARG 0x2000 /* Argument optional for cmd line */
|
2022-02-15 16:18:55 +09:00
|
|
|
#define PLUGIN_VAR_DEPRECATED 0x4000 /* Server variable is deprecated */
|
2007-03-02 08:43:45 -08:00
|
|
|
#define PLUGIN_VAR_MEMALLOC 0x8000 /* String needs memory allocated */
|
|
|
|
|
|
|
|
struct st_mysql_sys_var;
|
|
|
|
struct st_mysql_value;
|
|
|
|
|
2007-03-23 10:14:46 -07:00
|
|
|
/*
|
|
|
|
SYNOPSIS
|
|
|
|
(*mysql_var_check_func)()
|
|
|
|
thd thread handle
|
|
|
|
var dynamic variable being altered
|
|
|
|
save pointer to temporary storage
|
|
|
|
value user provided value
|
|
|
|
RETURN
|
|
|
|
0 user provided value is OK and the update func may be called.
|
|
|
|
any other value indicates error.
|
|
|
|
|
|
|
|
This function should parse the user provided value and store in the
|
|
|
|
provided temporary storage any data as required by the update func.
|
|
|
|
There is sufficient space in the temporary storage to store a double.
|
|
|
|
Note that the update func may not be called if any other error occurs
|
|
|
|
so any memory allocated should be thread-local so that it may be freed
|
|
|
|
automatically at the end of the statement.
|
|
|
|
*/
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
typedef int (*mysql_var_check_func)(MYSQL_THD thd,
|
|
|
|
struct st_mysql_sys_var *var,
|
|
|
|
void *save, struct st_mysql_value *value);
|
2007-03-23 10:14:46 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
SYNOPSIS
|
|
|
|
(*mysql_var_update_func)()
|
|
|
|
thd thread handle
|
|
|
|
var dynamic variable being altered
|
|
|
|
var_ptr pointer to dynamic variable
|
|
|
|
save pointer to temporary storage
|
|
|
|
RETURN
|
|
|
|
NONE
|
|
|
|
|
|
|
|
This function should use the validated value stored in the temporary store
|
|
|
|
and persist it in the provided pointer to the dynamic variable.
|
|
|
|
For example, strings may require memory to be allocated.
|
|
|
|
*/
|
2007-03-02 08:43:45 -08:00
|
|
|
typedef void (*mysql_var_update_func)(MYSQL_THD thd,
|
|
|
|
struct st_mysql_sys_var *var,
|
2008-02-19 12:55:13 -08:00
|
|
|
void *var_ptr, const void *save);
|
2007-03-02 08:43:45 -08:00
|
|
|
|
|
|
|
|
|
|
|
/* the following declarations are for internal use only */
|
|
|
|
|
|
|
|
|
|
|
|
#define PLUGIN_VAR_MASK \
|
|
|
|
(PLUGIN_VAR_READONLY | PLUGIN_VAR_NOSYSVAR | \
|
|
|
|
PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_NOCMDARG | \
|
2022-02-15 16:18:55 +09:00
|
|
|
PLUGIN_VAR_OPCMDARG | PLUGIN_VAR_RQCMDARG | \
|
|
|
|
PLUGIN_VAR_DEPRECATED | PLUGIN_VAR_MEMALLOC)
|
2007-03-02 08:43:45 -08:00
|
|
|
|
|
|
|
#define MYSQL_PLUGIN_VAR_HEADER \
|
|
|
|
int flags; \
|
|
|
|
const char *name; \
|
|
|
|
const char *comment; \
|
|
|
|
mysql_var_check_func check; \
|
|
|
|
mysql_var_update_func update
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_NAME(name) mysql_sysvar_ ## name
|
|
|
|
#define MYSQL_SYSVAR(name) \
|
|
|
|
((struct st_mysql_sys_var *)&(MYSQL_SYSVAR_NAME(name)))
|
|
|
|
|
|
|
|
/*
|
|
|
|
for global variables, the value pointer is the first
|
|
|
|
element after the header, the default value is the second.
|
|
|
|
for thread variables, the value offset is the first
|
|
|
|
element after the header, the default value is the second.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
|
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
2007-05-01 18:25:29 -07:00
|
|
|
type *value; \
|
2010-09-27 21:48:10 +03:00
|
|
|
const type def_val; \
|
2007-03-02 08:43:45 -08:00
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
2021-02-05 15:48:45 +02:00
|
|
|
#define DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, type) struct { \
|
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
|
|
|
const type *value; \
|
|
|
|
const type def_val; \
|
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
#define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
|
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
2007-03-28 21:29:16 -07:00
|
|
|
type *value; type def_val; \
|
|
|
|
type min_val; type max_val; \
|
|
|
|
type blk_sz; \
|
2007-03-02 08:43:45 -08:00
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
2007-04-30 16:42:15 -07:00
|
|
|
#define DECLARE_MYSQL_SYSVAR_TYPELIB(name, type) struct { \
|
2007-03-02 08:43:45 -08:00
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
2007-04-30 16:42:15 -07:00
|
|
|
type *value; type def_val; \
|
2007-03-02 08:43:45 -08:00
|
|
|
TYPELIB *typelib; \
|
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
|
|
|
#define DECLARE_THDVAR_FUNC(type) \
|
|
|
|
type *(*resolve)(MYSQL_THD thd, int offset)
|
|
|
|
|
|
|
|
#define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \
|
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
|
|
|
int offset; \
|
2007-05-01 18:25:29 -07:00
|
|
|
const type def_val; \
|
2007-03-02 08:43:45 -08:00
|
|
|
DECLARE_THDVAR_FUNC(type); \
|
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
|
|
|
#define DECLARE_MYSQL_THDVAR_SIMPLE(name, type) struct { \
|
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
|
|
|
int offset; \
|
2007-03-28 21:29:16 -07:00
|
|
|
type def_val; type min_val; \
|
|
|
|
type max_val; type blk_sz; \
|
2007-03-02 08:43:45 -08:00
|
|
|
DECLARE_THDVAR_FUNC(type); \
|
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
2007-04-30 16:42:15 -07:00
|
|
|
#define DECLARE_MYSQL_THDVAR_TYPELIB(name, type) struct { \
|
2007-03-02 08:43:45 -08:00
|
|
|
MYSQL_PLUGIN_VAR_HEADER; \
|
|
|
|
int offset; \
|
2010-09-27 21:48:10 +03:00
|
|
|
const type def_val; \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_THDVAR_FUNC(type); \
|
2007-03-02 08:43:45 -08:00
|
|
|
TYPELIB *typelib; \
|
|
|
|
} MYSQL_SYSVAR_NAME(name)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
the following declarations are for use by plugin implementors
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_BOOL(name, varname, opt, comment, check, update, def) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_BASIC(name, char) = { \
|
|
|
|
PLUGIN_VAR_BOOL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def}
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_STR(name, varname, opt, comment, check, update, def) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_BASIC(name, char *) = { \
|
|
|
|
PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def}
|
|
|
|
|
2021-02-05 15:48:45 +02:00
|
|
|
#define MYSQL_SYSVAR_CONST_STR(name, varname, opt, comment, check, update, def) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_CONST_BASIC(name, char *) = { \
|
|
|
|
PLUGIN_VAR_STR | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def}
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
#define MYSQL_SYSVAR_INT(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, int) = { \
|
|
|
|
PLUGIN_VAR_INT | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_UINT(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned int) = { \
|
|
|
|
PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_LONG(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, long) = { \
|
|
|
|
PLUGIN_VAR_LONG | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_ULONG(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long) = { \
|
|
|
|
PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_LONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_LONGLONG | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_ULONGLONG(name, varname, opt, comment, check, update, def, min, max, blk) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, unsigned long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
2017-04-01 10:37:36 +00:00
|
|
|
#define MYSQL_SYSVAR_UINT64_T(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, uint64_t) = { \
|
|
|
|
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
|
|
|
#ifdef _WIN64
|
|
|
|
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
|
|
|
|
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
#else
|
|
|
|
#define MYSQL_SYSVAR_SIZE_T(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, size_t) = { \
|
|
|
|
PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
#endif
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
#define MYSQL_SYSVAR_ENUM(name, varname, opt, comment, check, update, def, typelib) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_ENUM | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, typelib }
|
|
|
|
|
|
|
|
#define MYSQL_SYSVAR_SET(name, varname, opt, comment, check, update, def, typelib) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_SYSVAR_TYPELIB(name, unsigned long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_SET | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, typelib }
|
|
|
|
|
2013-05-19 23:38:06 +05:30
|
|
|
#define MYSQL_SYSVAR_DOUBLE(name, varname, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_SYSVAR_SIMPLE(name, double) = { \
|
|
|
|
PLUGIN_VAR_DOUBLE | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, &varname, def, min, max, blk }
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
#define MYSQL_THDVAR_BOOL(name, opt, comment, check, update, def) \
|
|
|
|
DECLARE_MYSQL_THDVAR_BASIC(name, char) = { \
|
|
|
|
PLUGIN_VAR_BOOL | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, NULL}
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_STR(name, opt, comment, check, update, def) \
|
|
|
|
DECLARE_MYSQL_THDVAR_BASIC(name, char *) = { \
|
|
|
|
PLUGIN_VAR_STR | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, NULL}
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_INT(name, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, int) = { \
|
|
|
|
PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_UINT(name, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned int) = { \
|
|
|
|
PLUGIN_VAR_INT | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_LONG(name, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, long) = { \
|
|
|
|
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_ULONG(name, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long) = { \
|
|
|
|
PLUGIN_VAR_LONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_LONGLONG(name, opt, comment, check, update, def, min, max, blk) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_ULONGLONG(name, opt, comment, check, update, def, min, max, blk) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, unsigned long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_LONGLONG | PLUGIN_VAR_THDLOCAL | PLUGIN_VAR_UNSIGNED | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_ENUM(name, opt, comment, check, update, def, typelib) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_ENUM | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, NULL, typelib }
|
|
|
|
|
|
|
|
#define MYSQL_THDVAR_SET(name, opt, comment, check, update, def, typelib) \
|
2007-04-30 16:42:15 -07:00
|
|
|
DECLARE_MYSQL_THDVAR_TYPELIB(name, unsigned long long) = { \
|
2007-03-02 08:43:45 -08:00
|
|
|
PLUGIN_VAR_SET | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, NULL, typelib }
|
|
|
|
|
2013-05-19 23:38:06 +05:30
|
|
|
#define MYSQL_THDVAR_DOUBLE(name, opt, comment, check, update, def, min, max, blk) \
|
|
|
|
DECLARE_MYSQL_THDVAR_SIMPLE(name, double) = { \
|
|
|
|
PLUGIN_VAR_DOUBLE | PLUGIN_VAR_THDLOCAL | ((opt) & PLUGIN_VAR_MASK), \
|
|
|
|
#name, comment, check, update, -1, def, min, max, blk, NULL }
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
/* accessor macros */
|
|
|
|
|
|
|
|
#define SYSVAR(name) \
|
|
|
|
(*(MYSQL_SYSVAR_NAME(name).value))
|
|
|
|
|
|
|
|
/* when thd == null, result points to global value */
|
|
|
|
#define THDVAR(thd, name) \
|
|
|
|
(*(MYSQL_SYSVAR_NAME(name).resolve(thd, MYSQL_SYSVAR_NAME(name).offset)))
|
|
|
|
|
2005-11-05 13:20:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Plugin description structure.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct st_mysql_plugin
|
|
|
|
{
|
|
|
|
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
|
|
|
|
void *info; /* pointer to type-specific plugin descriptor */
|
|
|
|
const char *name; /* plugin name */
|
2010-03-16 17:15:19 +04:00
|
|
|
const char *author; /* plugin author (for I_S.PLUGINS) */
|
|
|
|
const char *descr; /* general descriptive text (for I_S.PLUGINS) */
|
2006-12-05 18:05:53 +04:00
|
|
|
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
2024-01-16 17:17:50 +11:00
|
|
|
/*
|
|
|
|
The function to invoke when plugin is loaded. Plugin
|
|
|
|
initialisation done here should defer any ALTER TABLE queries to
|
|
|
|
after the ddl recovery is done, in the signal_ddl_recovery_done()
|
|
|
|
callback called by ha_signal_ddl_recovery_done().
|
|
|
|
*/
|
|
|
|
int (*init)(void *);
|
2006-09-15 10:28:00 -07:00
|
|
|
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
2010-03-16 17:15:19 +04:00
|
|
|
unsigned int version; /* plugin version (for I_S.PLUGINS) */
|
2006-01-07 14:41:57 +01:00
|
|
|
struct st_mysql_show_var *status_vars;
|
2007-03-02 08:43:45 -08:00
|
|
|
struct st_mysql_sys_var **system_vars;
|
|
|
|
void * __reserved1; /* reserved for dependency checking */
|
2011-08-15 20:12:11 +02:00
|
|
|
unsigned long flags; /* flags for plugin */
|
2005-11-05 13:20:35 +02:00
|
|
|
};
|
|
|
|
|
2010-04-01 17:34:51 +03:00
|
|
|
/*
|
|
|
|
MariaDB extension for plugins declaration structure.
|
|
|
|
|
|
|
|
It also copy current MySQL plugin fields to have more independency
|
|
|
|
in plugins extension
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct st_maria_plugin
|
|
|
|
{
|
|
|
|
int type; /* the plugin type (a MYSQL_XXX_PLUGIN value) */
|
|
|
|
void *info; /* pointer to type-specific plugin descriptor */
|
|
|
|
const char *name; /* plugin name */
|
|
|
|
const char *author; /* plugin author (for SHOW PLUGINS) */
|
|
|
|
const char *descr; /* general descriptive text (for SHOW PLUGINS ) */
|
|
|
|
int license; /* the plugin license (PLUGIN_LICENSE_XXX) */
|
2024-01-16 17:17:50 +11:00
|
|
|
/*
|
|
|
|
The function to invoke when plugin is loaded. Plugin
|
|
|
|
initialisation done here should defer any ALTER TABLE queries to
|
|
|
|
after the ddl recovery is done, in the signal_ddl_recovery_done()
|
|
|
|
callback called by ha_signal_ddl_recovery_done().
|
|
|
|
*/
|
|
|
|
int (*init)(void *);
|
2010-04-01 17:34:51 +03:00
|
|
|
int (*deinit)(void *);/* the function to invoke when plugin is unloaded */
|
|
|
|
unsigned int version; /* plugin version (for SHOW PLUGINS) */
|
|
|
|
struct st_mysql_show_var *status_vars;
|
|
|
|
struct st_mysql_sys_var **system_vars;
|
|
|
|
const char *version_info; /* plugin version string */
|
2010-06-15 21:12:13 +02:00
|
|
|
unsigned int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
|
2010-04-01 17:34:51 +03:00
|
|
|
};
|
|
|
|
|
2005-11-05 13:20:35 +02:00
|
|
|
/*************************************************************************
|
handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().
mysql-test-run.pl bugfixes
include/mysql/plugin.h:
added st_mysql_storage_engine
made handlerton tied to MySQL version
mysql-test/mysql-test-run.pl:
bugfixes (umask, --no-defaults)
mysql-test/r/ndb_dd_basic.result:
update error message
mysql-test/t/partition_mgm_err2.test:
fix typo
sql/ha_berkeley.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_berkeley.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_federated.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_heap.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisam.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisammrg.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster_binlog.cc:
no 'name' in the handlerton anymore
sql/ha_partition.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/handler.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
handlerton->plugin mapping
sql/handler.h:
handlerton cleanup: remove duplicate fields
sql/log.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/mysql_priv.h:
handler.h needs plugin.h
sql/mysqld.cc:
Convert --default-storage-engine to a handlerton* when
all storage engines are initialized and not in getopt
sql/set_var.cc:
no name in the handlerton anymore
sql/sql_parse.cc:
no default_hton anymore
sql/sql_partition.cc:
no name in the handlerton anymore
sql/sql_plugin.cc:
generalize plugin type-specific initialization.
initialize built-in plugins too
sql/sql_plugin.h:
generalize plugin type-specific initialization.
sql/sql_show.cc:
st_mysql_storage_engine structure
no name in the handlerton anymore
sql/sql_table.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_tablespace.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_yacc.yy:
no default_hton anymore
issue "unknown storage engine" warning where it is discovered
storage/archive/ha_archive.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/archive/ha_archive.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/blackhole/ha_blackhole.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/csv/ha_tina.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/example/ha_example.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
2006-05-28 14:51:01 +02:00
|
|
|
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
|
2005-11-05 13:20:35 +02:00
|
|
|
*/
|
2009-12-15 23:52:47 +04:00
|
|
|
#include "plugin_ftparser.h"
|
2005-11-05 13:20:35 +02:00
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
/*************************************************************************
|
|
|
|
API for Storage Engine plugin. (MYSQL_DAEMON_PLUGIN)
|
2005-11-05 13:20:35 +02:00
|
|
|
*/
|
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
/* handlertons of different MySQL releases are incompatible */
|
|
|
|
#define MYSQL_DAEMON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
|
2005-11-05 13:20:35 +02:00
|
|
|
|
WL#2575 - Fulltext: Parser plugin for FTS
Manual merge.
Makefile.am:
Added new 'plugin' subdir.
configure.in:
Added plugin related makefiles.
include/my_base.h:
Added HA_OPEN_FROM_SQL_LAYER flag - indicates that a table was openned from the sql layer.
Added HA_OPTION_RELIES_ON_SQL_LAYER flag - indicates that a table relies on the sql layer.
Added HA_CREATE_RELIES_ON_SQL_LAYER flag - indicates that a table must be created with
HA_OPTION_RELIES_ON_SQL_LAYER flag.
include/myisam.h:
Distinct fulltext parser number added.
include/plugin.h:
Revise comment.
sql/ha_myisam.cc:
Pass HA_OPEN_FROM_SQL_LAYER flag to mi_open().
Pass HA_CREATE_RELIES_ON_SQL_LAYER flag to mi_create().
sql/sql_plugin.cc:
Reuse "unused" dynamic array elements.
A check for plugin info interface version.
sql/sql_plugin.h:
Added plugin_type_names[] - string plugin type names.
sql/sql_show.cc:
Use plugin_type_names array instead of switch to find literal parser name representation.
sql/sql_table.cc:
Fixed that ALTER TABLE ... ADD INDEX loses WITH PARSER info.
storage/myisam/ft_boolean_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_nlq_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_parser.c:
Added two functions:
ftparser_call_initializer() - calls parser->init() function if specified and parser is not yet
initialized. Returns MYSQL_FTPARSER_PARAM *.
ftparser_call_deinitializer() - calls parser->deinit() function if specified and parser was
initialized. Deinitializes all parsers.
ft_parse() accepts additional param now - MYSQL_FTPARSER_PARM and passes it to parser->parse().
storage/myisam/ft_update.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to _mi_ft_parse().
_mi_ft_parse() accepts additional param now - MYSQL_FTPARSER_PARAM and passes
it to parser->parse().
storage/myisam/ftdefs.h:
Prototypes for new functions were added. MYSQL_FTPARSER_PARAM was added
to ft_parse and _mi_ft_parse().
storage/myisam/mi_close.c:
Free ftparser_param allocated by ftparser_call_initializer().
storage/myisam/mi_create.c:
If a table relies on the sql layer, set HA_OPTION_RELIES_ON_SQL_LAYER.
storage/myisam/mi_locking.c:
Call deinitializer for each initialized parser.
storage/myisam/mi_open.c:
Set default values for share->ftparser and keydef->ftparser_nr.
If a table is openned from the non-sql layer and HA_OPTION_RELIES_ON_SQL_LAYER is set, raise
HA_ERR_UNSUPPORTED error.
storage/myisam/myisamdef.h:
Added number of distinct parsers to MYISAM_SHARE.
Added ftparser_param to MI_INFO.
plugin/Makefile.am:
New BitKeeper file ``plugin/Makefile.am''
plugin/fulltext/Makefile.am:
New BitKeeper file ``plugin/fulltext/Makefile.am''
plugin/fulltext/plugin_example.c:
New BitKeeper file ``plugin/fulltext/plugin_example.c''
2005-12-28 16:05:30 +04:00
|
|
|
/*
|
2009-12-15 23:52:47 +04:00
|
|
|
Here we define only the descriptor structure, that is referred from
|
|
|
|
st_mysql_plugin.
|
WL#2575 - Fulltext: Parser plugin for FTS
Manual merge.
Makefile.am:
Added new 'plugin' subdir.
configure.in:
Added plugin related makefiles.
include/my_base.h:
Added HA_OPEN_FROM_SQL_LAYER flag - indicates that a table was openned from the sql layer.
Added HA_OPTION_RELIES_ON_SQL_LAYER flag - indicates that a table relies on the sql layer.
Added HA_CREATE_RELIES_ON_SQL_LAYER flag - indicates that a table must be created with
HA_OPTION_RELIES_ON_SQL_LAYER flag.
include/myisam.h:
Distinct fulltext parser number added.
include/plugin.h:
Revise comment.
sql/ha_myisam.cc:
Pass HA_OPEN_FROM_SQL_LAYER flag to mi_open().
Pass HA_CREATE_RELIES_ON_SQL_LAYER flag to mi_create().
sql/sql_plugin.cc:
Reuse "unused" dynamic array elements.
A check for plugin info interface version.
sql/sql_plugin.h:
Added plugin_type_names[] - string plugin type names.
sql/sql_show.cc:
Use plugin_type_names array instead of switch to find literal parser name representation.
sql/sql_table.cc:
Fixed that ALTER TABLE ... ADD INDEX loses WITH PARSER info.
storage/myisam/ft_boolean_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_nlq_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_parser.c:
Added two functions:
ftparser_call_initializer() - calls parser->init() function if specified and parser is not yet
initialized. Returns MYSQL_FTPARSER_PARAM *.
ftparser_call_deinitializer() - calls parser->deinit() function if specified and parser was
initialized. Deinitializes all parsers.
ft_parse() accepts additional param now - MYSQL_FTPARSER_PARM and passes it to parser->parse().
storage/myisam/ft_update.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to _mi_ft_parse().
_mi_ft_parse() accepts additional param now - MYSQL_FTPARSER_PARAM and passes
it to parser->parse().
storage/myisam/ftdefs.h:
Prototypes for new functions were added. MYSQL_FTPARSER_PARAM was added
to ft_parse and _mi_ft_parse().
storage/myisam/mi_close.c:
Free ftparser_param allocated by ftparser_call_initializer().
storage/myisam/mi_create.c:
If a table relies on the sql layer, set HA_OPTION_RELIES_ON_SQL_LAYER.
storage/myisam/mi_locking.c:
Call deinitializer for each initialized parser.
storage/myisam/mi_open.c:
Set default values for share->ftparser and keydef->ftparser_nr.
If a table is openned from the non-sql layer and HA_OPTION_RELIES_ON_SQL_LAYER is set, raise
HA_ERR_UNSUPPORTED error.
storage/myisam/myisamdef.h:
Added number of distinct parsers to MYISAM_SHARE.
Added ftparser_param to MI_INFO.
plugin/Makefile.am:
New BitKeeper file ``plugin/Makefile.am''
plugin/fulltext/Makefile.am:
New BitKeeper file ``plugin/fulltext/Makefile.am''
plugin/fulltext/plugin_example.c:
New BitKeeper file ``plugin/fulltext/plugin_example.c''
2005-12-28 16:05:30 +04:00
|
|
|
*/
|
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
struct st_mysql_daemon
|
2005-11-05 13:20:35 +02:00
|
|
|
{
|
2009-12-15 23:52:47 +04:00
|
|
|
int interface_version;
|
2005-11-05 13:20:35 +02:00
|
|
|
};
|
|
|
|
|
WL#2575 - Fulltext: Parser plugin for FTS
Manual merge.
Makefile.am:
Added new 'plugin' subdir.
configure.in:
Added plugin related makefiles.
include/my_base.h:
Added HA_OPEN_FROM_SQL_LAYER flag - indicates that a table was openned from the sql layer.
Added HA_OPTION_RELIES_ON_SQL_LAYER flag - indicates that a table relies on the sql layer.
Added HA_CREATE_RELIES_ON_SQL_LAYER flag - indicates that a table must be created with
HA_OPTION_RELIES_ON_SQL_LAYER flag.
include/myisam.h:
Distinct fulltext parser number added.
include/plugin.h:
Revise comment.
sql/ha_myisam.cc:
Pass HA_OPEN_FROM_SQL_LAYER flag to mi_open().
Pass HA_CREATE_RELIES_ON_SQL_LAYER flag to mi_create().
sql/sql_plugin.cc:
Reuse "unused" dynamic array elements.
A check for plugin info interface version.
sql/sql_plugin.h:
Added plugin_type_names[] - string plugin type names.
sql/sql_show.cc:
Use plugin_type_names array instead of switch to find literal parser name representation.
sql/sql_table.cc:
Fixed that ALTER TABLE ... ADD INDEX loses WITH PARSER info.
storage/myisam/ft_boolean_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_nlq_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_parser.c:
Added two functions:
ftparser_call_initializer() - calls parser->init() function if specified and parser is not yet
initialized. Returns MYSQL_FTPARSER_PARAM *.
ftparser_call_deinitializer() - calls parser->deinit() function if specified and parser was
initialized. Deinitializes all parsers.
ft_parse() accepts additional param now - MYSQL_FTPARSER_PARM and passes it to parser->parse().
storage/myisam/ft_update.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to _mi_ft_parse().
_mi_ft_parse() accepts additional param now - MYSQL_FTPARSER_PARAM and passes
it to parser->parse().
storage/myisam/ftdefs.h:
Prototypes for new functions were added. MYSQL_FTPARSER_PARAM was added
to ft_parse and _mi_ft_parse().
storage/myisam/mi_close.c:
Free ftparser_param allocated by ftparser_call_initializer().
storage/myisam/mi_create.c:
If a table relies on the sql layer, set HA_OPTION_RELIES_ON_SQL_LAYER.
storage/myisam/mi_locking.c:
Call deinitializer for each initialized parser.
storage/myisam/mi_open.c:
Set default values for share->ftparser and keydef->ftparser_nr.
If a table is openned from the non-sql layer and HA_OPTION_RELIES_ON_SQL_LAYER is set, raise
HA_ERR_UNSUPPORTED error.
storage/myisam/myisamdef.h:
Added number of distinct parsers to MYISAM_SHARE.
Added ftparser_param to MI_INFO.
plugin/Makefile.am:
New BitKeeper file ``plugin/Makefile.am''
plugin/fulltext/Makefile.am:
New BitKeeper file ``plugin/fulltext/Makefile.am''
plugin/fulltext/plugin_example.c:
New BitKeeper file ``plugin/fulltext/plugin_example.c''
2005-12-28 16:05:30 +04:00
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
/*************************************************************************
|
|
|
|
API for I_S plugin. (MYSQL_INFORMATION_SCHEMA_PLUGIN)
|
2005-11-05 13:20:35 +02:00
|
|
|
*/
|
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
/* handlertons of different MySQL releases are incompatible */
|
|
|
|
#define MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
|
2005-11-05 13:20:35 +02:00
|
|
|
|
WL#2575 - Fulltext: Parser plugin for FTS
Manual merge.
Makefile.am:
Added new 'plugin' subdir.
configure.in:
Added plugin related makefiles.
include/my_base.h:
Added HA_OPEN_FROM_SQL_LAYER flag - indicates that a table was openned from the sql layer.
Added HA_OPTION_RELIES_ON_SQL_LAYER flag - indicates that a table relies on the sql layer.
Added HA_CREATE_RELIES_ON_SQL_LAYER flag - indicates that a table must be created with
HA_OPTION_RELIES_ON_SQL_LAYER flag.
include/myisam.h:
Distinct fulltext parser number added.
include/plugin.h:
Revise comment.
sql/ha_myisam.cc:
Pass HA_OPEN_FROM_SQL_LAYER flag to mi_open().
Pass HA_CREATE_RELIES_ON_SQL_LAYER flag to mi_create().
sql/sql_plugin.cc:
Reuse "unused" dynamic array elements.
A check for plugin info interface version.
sql/sql_plugin.h:
Added plugin_type_names[] - string plugin type names.
sql/sql_show.cc:
Use plugin_type_names array instead of switch to find literal parser name representation.
sql/sql_table.cc:
Fixed that ALTER TABLE ... ADD INDEX loses WITH PARSER info.
storage/myisam/ft_boolean_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_nlq_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_parser.c:
Added two functions:
ftparser_call_initializer() - calls parser->init() function if specified and parser is not yet
initialized. Returns MYSQL_FTPARSER_PARAM *.
ftparser_call_deinitializer() - calls parser->deinit() function if specified and parser was
initialized. Deinitializes all parsers.
ft_parse() accepts additional param now - MYSQL_FTPARSER_PARM and passes it to parser->parse().
storage/myisam/ft_update.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to _mi_ft_parse().
_mi_ft_parse() accepts additional param now - MYSQL_FTPARSER_PARAM and passes
it to parser->parse().
storage/myisam/ftdefs.h:
Prototypes for new functions were added. MYSQL_FTPARSER_PARAM was added
to ft_parse and _mi_ft_parse().
storage/myisam/mi_close.c:
Free ftparser_param allocated by ftparser_call_initializer().
storage/myisam/mi_create.c:
If a table relies on the sql layer, set HA_OPTION_RELIES_ON_SQL_LAYER.
storage/myisam/mi_locking.c:
Call deinitializer for each initialized parser.
storage/myisam/mi_open.c:
Set default values for share->ftparser and keydef->ftparser_nr.
If a table is openned from the non-sql layer and HA_OPTION_RELIES_ON_SQL_LAYER is set, raise
HA_ERR_UNSUPPORTED error.
storage/myisam/myisamdef.h:
Added number of distinct parsers to MYISAM_SHARE.
Added ftparser_param to MI_INFO.
plugin/Makefile.am:
New BitKeeper file ``plugin/Makefile.am''
plugin/fulltext/Makefile.am:
New BitKeeper file ``plugin/fulltext/Makefile.am''
plugin/fulltext/plugin_example.c:
New BitKeeper file ``plugin/fulltext/plugin_example.c''
2005-12-28 16:05:30 +04:00
|
|
|
/*
|
2009-12-15 23:52:47 +04:00
|
|
|
Here we define only the descriptor structure, that is referred from
|
|
|
|
st_mysql_plugin.
|
WL#2575 - Fulltext: Parser plugin for FTS
Manual merge.
Makefile.am:
Added new 'plugin' subdir.
configure.in:
Added plugin related makefiles.
include/my_base.h:
Added HA_OPEN_FROM_SQL_LAYER flag - indicates that a table was openned from the sql layer.
Added HA_OPTION_RELIES_ON_SQL_LAYER flag - indicates that a table relies on the sql layer.
Added HA_CREATE_RELIES_ON_SQL_LAYER flag - indicates that a table must be created with
HA_OPTION_RELIES_ON_SQL_LAYER flag.
include/myisam.h:
Distinct fulltext parser number added.
include/plugin.h:
Revise comment.
sql/ha_myisam.cc:
Pass HA_OPEN_FROM_SQL_LAYER flag to mi_open().
Pass HA_CREATE_RELIES_ON_SQL_LAYER flag to mi_create().
sql/sql_plugin.cc:
Reuse "unused" dynamic array elements.
A check for plugin info interface version.
sql/sql_plugin.h:
Added plugin_type_names[] - string plugin type names.
sql/sql_show.cc:
Use plugin_type_names array instead of switch to find literal parser name representation.
sql/sql_table.cc:
Fixed that ALTER TABLE ... ADD INDEX loses WITH PARSER info.
storage/myisam/ft_boolean_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_nlq_search.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to parser->parse().
storage/myisam/ft_parser.c:
Added two functions:
ftparser_call_initializer() - calls parser->init() function if specified and parser is not yet
initialized. Returns MYSQL_FTPARSER_PARAM *.
ftparser_call_deinitializer() - calls parser->deinit() function if specified and parser was
initialized. Deinitializes all parsers.
ft_parse() accepts additional param now - MYSQL_FTPARSER_PARM and passes it to parser->parse().
storage/myisam/ft_update.c:
Call fulltext parser init() function, pass MYSQL_FTPARSER_PARAM, returned by
ftparser_call_initializer(), to _mi_ft_parse().
_mi_ft_parse() accepts additional param now - MYSQL_FTPARSER_PARAM and passes
it to parser->parse().
storage/myisam/ftdefs.h:
Prototypes for new functions were added. MYSQL_FTPARSER_PARAM was added
to ft_parse and _mi_ft_parse().
storage/myisam/mi_close.c:
Free ftparser_param allocated by ftparser_call_initializer().
storage/myisam/mi_create.c:
If a table relies on the sql layer, set HA_OPTION_RELIES_ON_SQL_LAYER.
storage/myisam/mi_locking.c:
Call deinitializer for each initialized parser.
storage/myisam/mi_open.c:
Set default values for share->ftparser and keydef->ftparser_nr.
If a table is openned from the non-sql layer and HA_OPTION_RELIES_ON_SQL_LAYER is set, raise
HA_ERR_UNSUPPORTED error.
storage/myisam/myisamdef.h:
Added number of distinct parsers to MYISAM_SHARE.
Added ftparser_param to MI_INFO.
plugin/Makefile.am:
New BitKeeper file ``plugin/Makefile.am''
plugin/fulltext/Makefile.am:
New BitKeeper file ``plugin/fulltext/Makefile.am''
plugin/fulltext/plugin_example.c:
New BitKeeper file ``plugin/fulltext/plugin_example.c''
2005-12-28 16:05:30 +04:00
|
|
|
*/
|
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
struct st_mysql_information_schema
|
2005-11-05 13:20:35 +02:00
|
|
|
{
|
|
|
|
int interface_version;
|
|
|
|
};
|
handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().
mysql-test-run.pl bugfixes
include/mysql/plugin.h:
added st_mysql_storage_engine
made handlerton tied to MySQL version
mysql-test/mysql-test-run.pl:
bugfixes (umask, --no-defaults)
mysql-test/r/ndb_dd_basic.result:
update error message
mysql-test/t/partition_mgm_err2.test:
fix typo
sql/ha_berkeley.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_berkeley.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_federated.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_heap.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisam.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisammrg.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster_binlog.cc:
no 'name' in the handlerton anymore
sql/ha_partition.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/handler.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
handlerton->plugin mapping
sql/handler.h:
handlerton cleanup: remove duplicate fields
sql/log.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/mysql_priv.h:
handler.h needs plugin.h
sql/mysqld.cc:
Convert --default-storage-engine to a handlerton* when
all storage engines are initialized and not in getopt
sql/set_var.cc:
no name in the handlerton anymore
sql/sql_parse.cc:
no default_hton anymore
sql/sql_partition.cc:
no name in the handlerton anymore
sql/sql_plugin.cc:
generalize plugin type-specific initialization.
initialize built-in plugins too
sql/sql_plugin.h:
generalize plugin type-specific initialization.
sql/sql_show.cc:
st_mysql_storage_engine structure
no name in the handlerton anymore
sql/sql_table.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_tablespace.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_yacc.yy:
no default_hton anymore
issue "unknown storage engine" warning where it is discovered
storage/archive/ha_archive.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/archive/ha_archive.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/blackhole/ha_blackhole.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/csv/ha_tina.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/example/ha_example.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
2006-05-28 14:51:01 +02:00
|
|
|
|
2007-01-26 15:36:39 -08:00
|
|
|
|
handlerton cleanup:
duplicate fields removed, st_mysql_storage_engine added to support
run-time handlerton initialization (no compiler warnings), handler API
is now tied to MySQL version, handlerton->plugin mapping added
(slot-based), dummy default_hton removed, plugin-type-specific
initialization generalized, built-in plugins are now initialized too,
--default-storage-engine no longer needs a list of storage engines
in handle_options().
mysql-test-run.pl bugfixes
include/mysql/plugin.h:
added st_mysql_storage_engine
made handlerton tied to MySQL version
mysql-test/mysql-test-run.pl:
bugfixes (umask, --no-defaults)
mysql-test/r/ndb_dd_basic.result:
update error message
mysql-test/t/partition_mgm_err2.test:
fix typo
sql/ha_berkeley.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_berkeley.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_federated.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_heap.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_innodb.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisam.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_myisammrg.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/ha_ndbcluster_binlog.cc:
no 'name' in the handlerton anymore
sql/ha_partition.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/handler.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
handlerton->plugin mapping
sql/handler.h:
handlerton cleanup: remove duplicate fields
sql/log.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
sql/mysql_priv.h:
handler.h needs plugin.h
sql/mysqld.cc:
Convert --default-storage-engine to a handlerton* when
all storage engines are initialized and not in getopt
sql/set_var.cc:
no name in the handlerton anymore
sql/sql_parse.cc:
no default_hton anymore
sql/sql_partition.cc:
no name in the handlerton anymore
sql/sql_plugin.cc:
generalize plugin type-specific initialization.
initialize built-in plugins too
sql/sql_plugin.h:
generalize plugin type-specific initialization.
sql/sql_show.cc:
st_mysql_storage_engine structure
no name in the handlerton anymore
sql/sql_table.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_tablespace.cc:
no name in the handlerton anymore
no default_hton anymore
sql/sql_yacc.yy:
no default_hton anymore
issue "unknown storage engine" warning where it is discovered
storage/archive/ha_archive.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/archive/ha_archive.h:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/blackhole/ha_blackhole.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/csv/ha_tina.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
storage/example/ha_example.cc:
handlerton cleanup: remove duplicate fields, add st_mysql_storage_engine,
initialize handlerton run-time to avoid compiler warnings
2006-05-28 14:51:01 +02:00
|
|
|
/*************************************************************************
|
|
|
|
API for Storage Engine plugin. (MYSQL_STORAGE_ENGINE_PLUGIN)
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* handlertons of different MySQL releases are incompatible */
|
|
|
|
#define MYSQL_HANDLERTON_INTERFACE_VERSION (MYSQL_VERSION_ID << 8)
|
|
|
|
|
|
|
|
/*
|
|
|
|
The real API is in the sql/handler.h
|
|
|
|
Here we define only the descriptor structure, that is referred from
|
|
|
|
st_mysql_plugin.
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct st_mysql_storage_engine
|
|
|
|
{
|
|
|
|
int interface_version;
|
|
|
|
};
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
struct handlerton;
|
|
|
|
|
2007-01-26 15:36:39 -08:00
|
|
|
|
2009-09-26 12:49:49 +08:00
|
|
|
/*
|
|
|
|
API for Replication plugin. (MYSQL_REPLICATION_PLUGIN)
|
|
|
|
*/
|
2013-03-26 00:03:13 +02:00
|
|
|
#define MYSQL_REPLICATION_INTERFACE_VERSION 0x0200
|
2009-09-26 12:49:49 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
Replication plugin descriptor
|
|
|
|
*/
|
|
|
|
struct Mysql_replication {
|
|
|
|
int interface_version;
|
|
|
|
};
|
2007-03-02 08:43:45 -08:00
|
|
|
|
2009-12-15 23:52:47 +04:00
|
|
|
/*************************************************************************
|
2007-03-02 08:43:45 -08:00
|
|
|
st_mysql_value struct for reading values from mysqld.
|
|
|
|
Used by server variables framework to parse user-provided values.
|
|
|
|
Will be used for arguments when implementing UDFs.
|
2007-03-23 10:14:46 -07:00
|
|
|
|
|
|
|
Note that val_str() returns a string in temporary memory
|
|
|
|
that will be freed at the end of statement. Copy the string
|
|
|
|
if you need it to persist.
|
2007-03-02 08:43:45 -08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define MYSQL_VALUE_TYPE_STRING 0
|
|
|
|
#define MYSQL_VALUE_TYPE_REAL 1
|
|
|
|
#define MYSQL_VALUE_TYPE_INT 2
|
|
|
|
|
|
|
|
struct st_mysql_value
|
|
|
|
{
|
|
|
|
int (*value_type)(struct st_mysql_value *);
|
|
|
|
const char *(*val_str)(struct st_mysql_value *, char *buffer, int *length);
|
2007-04-13 19:23:02 +02:00
|
|
|
int (*val_real)(struct st_mysql_value *, double *realbuf);
|
|
|
|
int (*val_int)(struct st_mysql_value *, long long *intbuf);
|
2009-12-22 10:35:56 +01:00
|
|
|
int (*is_unsigned)(struct st_mysql_value *);
|
2007-03-02 08:43:45 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
Miscellaneous functions for plugin implementors
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
int thd_in_lock_tables(const MYSQL_THD thd);
|
|
|
|
int thd_tablespace_op(const MYSQL_THD thd);
|
|
|
|
long long thd_test_options(const MYSQL_THD thd, long long test_options);
|
|
|
|
int thd_sql_command(const MYSQL_THD thd);
|
2021-06-11 15:34:23 +03:00
|
|
|
struct DDL_options_st;
|
|
|
|
struct DDL_options_st *thd_ddl_options(const MYSQL_THD thd);
|
2010-08-17 01:19:24 -07:00
|
|
|
void thd_storage_lock_wait(MYSQL_THD thd, long long value);
|
2007-04-15 15:47:27 +02:00
|
|
|
int thd_tx_isolation(const MYSQL_THD thd);
|
2013-03-26 00:03:13 +02:00
|
|
|
int thd_tx_is_read_only(const MYSQL_THD thd);
|
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
2007-07-05 01:05:47 +02:00
|
|
|
/**
|
|
|
|
Create a temporary file.
|
|
|
|
|
|
|
|
@details
|
|
|
|
The temporary file is created in a location specified by the mysql
|
|
|
|
server configuration (--tmpdir option). The caller does not need to
|
|
|
|
delete the file, it will be deleted automatically.
|
|
|
|
|
|
|
|
@param prefix prefix for temporary file name
|
|
|
|
@retval -1 error
|
|
|
|
@retval >= 0 a file handle that can be passed to dup or my_close
|
|
|
|
*/
|
|
|
|
int mysql_tmpfile(const char *prefix);
|
|
|
|
|
2008-02-19 09:44:09 -07:00
|
|
|
/**
|
|
|
|
Return the thread id of a user thread
|
|
|
|
|
|
|
|
@param thd user thread connection handle
|
|
|
|
@return thread id
|
|
|
|
*/
|
|
|
|
unsigned long thd_get_thread_id(const MYSQL_THD thd);
|
|
|
|
|
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
2007-07-05 01:05:47 +02:00
|
|
|
/**
|
|
|
|
Get the XID for this connection's transaction
|
|
|
|
|
|
|
|
@param thd user thread connection handle
|
|
|
|
@param xid location where identifier is stored
|
|
|
|
*/
|
|
|
|
void thd_get_xid(const MYSQL_THD thd, MYSQL_XID *xid);
|
|
|
|
|
|
|
|
/**
|
|
|
|
Invalidate the query cache for a given table.
|
|
|
|
|
|
|
|
@param thd user thread connection handle
|
2007-08-16 21:14:47 +04:00
|
|
|
@param key databasename\\0tablename\\0
|
WL#3914: Additonal accessors required to compile InnoDB as a plugin storage engine
Add more accessors to MySQL internals in mysql/plugin.h, for storage
engine plugins.
Add some accessors specific to the InnoDB storage engine, to allow
InnoDB to be compiled as a plugin (without MYSQL_SERVER). InnoDB
has additional requirements, due to its foreign key support, etc.
include/m_string.h:
Add structure tag to LEX_STRING definition, so that it can be referred
to by forward declarations. Allow struct st_mysql_lex_string to be
defined here, or in mysql/plugin.h.
include/my_global.h:
Define INNODB_COMPATIBILITY_HOOKS unconditionally; it brackets
some definitions needed for the InnoDB storage engine plugin
which do not belong in our general plugin interface.
include/mysql/plugin.h:
Additional accessors for MySQL internals:
- Full definition of MYSQL_LEX_STRING (identical to LEX_STRING from
m_string.h)
- Full definition of MYSQL_XID (binary compatible with XID from
handler.h)
- mysql_tmpfile(), creates a temporary file in mysqld's tmpdir
- thd_killed(), to check killed state of connection
- thd_alloc() and similar allocation functions
- thd_get_xid(), to get XID of connection's transaction
- mysql_query_cache_invalidate4, to invalidate a table's query cache entries
sql/handler.h:
Use MYSQL_XIDDATASIZE definition from mysql/plugin.h, to avoid redundant
definitions
sql/log.cc:
Add definitions for two InnoDB compatibility hooks:
- mysql_bin_log_file(), to get log filename
- mysql_bin_log_file_pos, to get position in file
These are defined only if INNODB_COMPATIBILITY_HOOKS is defined;
they are needed by the InnoDB plugin, but aren't part of the general
plugin interface. They are declared in ha_innodb.h for InnoDB's
use.
sql/mysql_priv.h:
Expose some server internals when INNODB_COMPATIBILITY_HOOKS is
defined, so that InnoDB can be built as a plugin when MYSQL_SERVER
is not defined.
Move make_lex_string inside THD class.
sql/sql_cache.cc:
Add definiton of mysql_query_cache_invalidate4(), a part of the
plugin API (mysql/plugin.h).
sql/sql_class.cc:
Add definitions for several accessor functions which form part
of the plugin API (mysql/plugin.h):
- mysql_tmpfile()
- thd_alloc() and friends
- thd_make_lex_string()
- thd_get_xid()
Add definitons for accessor functions which InnoDB requires,
but which are not part of the plugin interface:
- thd_charset()
- thd_query()
- thd_slave_thread()
- thd_non_transactional_update()
- thd_binlog_format()
Move definition of make_lex_string() from sql_show.cc into THD class
sql/sql_class.h:
Remove LEX_STRING_make(), and move make_lex_string() from sql_show.cc inside THD
class.
sql/sql_parse.cc:
Use thd->make_lex_string() instead of thd->LEX_STRING_make()
sql/sql_show.cc:
Move make_lex_string() inside THD class
storage/innobase/handler/ha_innodb.cc:
Call thd_make_lex_string() instead of make_lex_string().
2007-07-05 01:05:47 +02:00
|
|
|
@param key_length length of key in bytes, including the NUL bytes
|
|
|
|
@param using_trx flag: TRUE if using transactions, FALSE otherwise
|
|
|
|
*/
|
|
|
|
void mysql_query_cache_invalidate4(MYSQL_THD thd,
|
|
|
|
const char *key, unsigned int key_length,
|
|
|
|
int using_trx);
|
|
|
|
|
2007-03-02 08:43:45 -08:00
|
|
|
|
2007-08-31 10:19:52 +04:00
|
|
|
/**
|
|
|
|
Provide a handler data getter to simplify coding
|
|
|
|
*/
|
2010-04-14 13:53:59 +04:00
|
|
|
void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
|
|
|
|
|
2007-08-31 10:19:52 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
Provide a handler data setter to simplify coding
|
2010-04-14 13:53:59 +04:00
|
|
|
|
|
|
|
@details
|
|
|
|
Set ha_data pointer (storage engine per-connection information).
|
|
|
|
|
|
|
|
To avoid unclean deactivation (uninstall) of storage engine plugin
|
|
|
|
in the middle of transaction, additional storage engine plugin
|
|
|
|
lock is acquired.
|
|
|
|
|
|
|
|
If ha_data is not null and storage engine plugin was not locked
|
|
|
|
by thd_set_ha_data() in this connection before, storage engine
|
|
|
|
plugin gets locked.
|
|
|
|
|
|
|
|
If ha_data is null and storage engine plugin was locked by
|
|
|
|
thd_set_ha_data() in this connection before, storage engine
|
|
|
|
plugin lock gets released.
|
|
|
|
|
|
|
|
If handlerton::close_connection() didn't reset ha_data, server does
|
|
|
|
it immediately after calling handlerton::close_connection().
|
2007-08-31 10:19:52 +04:00
|
|
|
*/
|
2010-04-14 13:53:59 +04:00
|
|
|
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
|
|
|
|
const void *ha_data);
|
2013-06-26 12:10:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
Signal that the first part of handler commit is finished, and that the
|
|
|
|
committed transaction is now visible and has fixed commit ordering with
|
|
|
|
respect to other transactions. The commit need _not_ be durable yet, and
|
|
|
|
typically will not be when this call makes sense.
|
|
|
|
|
|
|
|
This call is optional, if the storage engine does not call it the upper
|
|
|
|
layer will after the handler commit() method is done. However, the storage
|
|
|
|
engine may choose to call it itself to increase the possibility for group
|
|
|
|
commit.
|
|
|
|
|
|
|
|
In-order parallel replication uses this to apply different transaction in
|
|
|
|
parallel, but delay the commits of later transactions until earlier
|
|
|
|
transactions have committed first, thus achieving increased performance on
|
|
|
|
multi-core systems while still preserving full transaction consistency.
|
|
|
|
|
|
|
|
The storage engine can call this from within the commit() method, typically
|
|
|
|
after the commit record has been written to the transaction log, but before
|
|
|
|
the log has been fsync()'ed. This will allow the next replicated transaction
|
|
|
|
to proceed to commit before the first one has done fsync() or similar. Thus,
|
|
|
|
it becomes possible for multiple sequential replicated transactions to share
|
|
|
|
a single fsync() inside the engine in group commit.
|
|
|
|
|
|
|
|
Note that this method should _not_ be called from within the commit_ordered()
|
|
|
|
method, or any other place in the storage engine. When commit_ordered() is
|
|
|
|
used (typically when binlog is enabled), the transaction coordinator takes
|
|
|
|
care of this and makes group commit in the storage engine possible without
|
|
|
|
any other action needed on the part of the storage engine. This function
|
|
|
|
thd_wakeup_subsequent_commits() is only needed when no transaction
|
|
|
|
coordinator is used, meaning a single storage engine and no binary log.
|
|
|
|
*/
|
2013-10-14 15:28:16 +02:00
|
|
|
void thd_wakeup_subsequent_commits(MYSQL_THD thd, int wakeup_error);
|
2013-06-26 12:10:35 +02:00
|
|
|
|
2010-04-14 13:53:59 +04:00
|
|
|
#ifdef __cplusplus
|
2007-08-31 10:19:52 +04:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-11-05 13:20:35 +02:00
|
|
|
#endif
|
|
|
|
|