diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-15 15:09:22 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-15 15:09:22 +0200 |
commit | a9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254 (patch) | |
tree | a9df7341e91623f62fe37cd47fce139d8888fc95 /plugin | |
parent | 3a1c91d87d69ef243b3e78be6089102cafef0a8e (diff) | |
parent | f57ecb7786177e0af3b1e3ec94302720b2e0f967 (diff) | |
download | mariadb-git-a9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254.tar.gz |
10.0-base merge
Diffstat (limited to 'plugin')
-rw-r--r-- | plugin/audit_null/audit_null.c | 10 | ||||
-rw-r--r-- | plugin/auth_examples/CMakeLists.txt | 2 | ||||
-rw-r--r-- | plugin/auth_examples/auth_0x0100.c | 91 | ||||
-rw-r--r-- | plugin/auth_socket/CMakeLists.txt | 14 | ||||
-rw-r--r-- | plugin/auth_socket/auth_socket.c | 17 | ||||
-rw-r--r-- | plugin/daemon_example/daemon_example.cc | 17 | ||||
-rw-r--r-- | plugin/fulltext/plugin_example.c | 18 | ||||
-rw-r--r-- | plugin/qc_info/CMakeLists.txt | 4 | ||||
-rw-r--r-- | plugin/qc_info/qc_info.cc | 213 | ||||
-rw-r--r-- | plugin/semisync/CMakeLists.txt | 7 | ||||
-rw-r--r-- | plugin/semisync/semisync_master.cc | 3 | ||||
-rw-r--r-- | plugin/semisync/semisync_master.h | 4 | ||||
-rw-r--r-- | plugin/semisync/semisync_master_plugin.cc | 12 | ||||
-rw-r--r-- | plugin/semisync/semisync_slave_plugin.cc | 11 | ||||
-rw-r--r-- | plugin/sql_errlog/sql_errlog.c | 18 |
15 files changed, 348 insertions, 93 deletions
diff --git a/plugin/audit_null/audit_null.c b/plugin/audit_null/audit_null.c index be0c70fbd35..0616f192f20 100644 --- a/plugin/audit_null/audit_null.c +++ b/plugin/audit_null/audit_null.c @@ -127,12 +127,10 @@ static struct st_mysql_audit audit_null_descriptor= static struct st_mysql_show_var simple_status[]= { - { "Audit_null_called", (char *) &number_of_calls, SHOW_INT }, - { "Audit_null_general_log", (char *) &number_of_calls_general_log, SHOW_INT }, - { "Audit_null_general_error", (char *) &number_of_calls_general_error, - SHOW_INT }, - { "Audit_null_general_result", (char *) &number_of_calls_general_result, - SHOW_INT }, + { "called", (char *) &number_of_calls, SHOW_INT }, + { "general_log", (char *) &number_of_calls_general_log, SHOW_INT }, + { "general_error", (char *) &number_of_calls_general_error, SHOW_INT }, + { "general_result", (char *) &number_of_calls_general_result, SHOW_INT }, { 0, 0, 0} }; diff --git a/plugin/auth_examples/CMakeLists.txt b/plugin/auth_examples/CMakeLists.txt index fb27289770f..f6c2b637067 100644 --- a/plugin/auth_examples/CMakeLists.txt +++ b/plugin/auth_examples/CMakeLists.txt @@ -27,5 +27,7 @@ MYSQL_ADD_PLUGIN(qa_auth_server qa_auth_server.c MYSQL_ADD_PLUGIN(qa_auth_client qa_auth_client.c MODULE_ONLY COMPONENT Test) +MYSQL_ADD_PLUGIN(auth_0x0100 auth_0x0100.c MODULE_ONLY COMPONENT Test) + MYSQL_ADD_PLUGIN(mysql_clear_password clear_password_client.c MODULE_ONLY COMPONENT SharedLibraries) diff --git a/plugin/auth_examples/auth_0x0100.c b/plugin/auth_examples/auth_0x0100.c new file mode 100644 index 00000000000..d1373b8a0b4 --- /dev/null +++ b/plugin/auth_examples/auth_0x0100.c @@ -0,0 +1,91 @@ +/* Copyright (C) 2013 Sergei Golubchik and Monty Program Ab + + 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 the Free Software Foundation; version 2 of the + License. + + 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 + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ + +/** + @file + + auth plugin that uses old structures as of + MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0100 + + To test the old version support. + It intentionally uses no constants like CR_OK ok PASSWORD_USED_YES. +*/ + +#include <mysql/plugin.h> +#include <string.h> +#include <stdio.h> +#include <stdlib.h> + +#if 0 +#include <mysql/plugin_auth.h> +#else +#define MYSQL_AUTHENTICATION_INTERFACE_VERSION 0x0100 +typedef void MYSQL_PLUGIN_VIO; /* we don't use it here */ + +typedef struct st_mysql_server_auth_info +{ + char *user_name; + unsigned int user_name_length; + const char *auth_string; + unsigned long auth_string_length; + char authenticated_as[49]; + char external_user[512]; + int password_used; + const char *host_or_ip; + unsigned int host_or_ip_length; +} MYSQL_SERVER_AUTH_INFO; + +struct st_mysql_auth +{ + int interface_version; + const char *client_auth_plugin; + int (*authenticate_user)(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info); +}; +#endif + +static int do_auth_0x0100(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) +{ + info->password_used= 1; + strcpy(info->authenticated_as, "zzzzzzzzzzzzzzzz"); + memset(info->external_user, 'o', 510); + info->external_user[510]='.'; + info->external_user[511]=0; + return vio ? -1 : 0; /* use vio to avoid the 'unused' warning */ +} + +static struct st_mysql_auth auth_0x0100_struct= +{ + MYSQL_AUTHENTICATION_INTERFACE_VERSION, 0, do_auth_0x0100 +}; + +maria_declare_plugin(auth_0x0100) +{ + MYSQL_AUTHENTICATION_PLUGIN, + &auth_0x0100_struct, + "auth_0x0100", + "Sergei Golubchik", + "Test for API 0x0100 support", + PLUGIN_LICENSE_GPL, + NULL, + NULL, + 0x0100, + NULL, + NULL, + "1.0", + MariaDB_PLUGIN_MATURITY_EXPERIMENTAL, +} +maria_declare_plugin_end; + diff --git a/plugin/auth_socket/CMakeLists.txt b/plugin/auth_socket/CMakeLists.txt index 731f7d01f9a..ae7dbffe2ae 100644 --- a/plugin/auth_socket/CMakeLists.txt +++ b/plugin/auth_socket/CMakeLists.txt @@ -21,7 +21,19 @@ int main() { struct ucred cred; getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); }" HAVE_PEERCRED) + +IF (NOT HAVE_PEERCRED) + # Hi, OpenBSD! + CHECK_CXX_SOURCE_COMPILES( + "#include <sys/types.h> + #include <sys/socket.h> + int main() { + struct sockpeercred cred; + getsockopt(0, SOL_SOCKET, SO_PEERCRED, &cred, 0); + }" HAVE_SOCKPEERCRED) + ADD_DEFINITIONS(-Ducred=sockpeercred) +ENDIF() -IF(HAVE_PEERCRED) +IF(HAVE_PEERCRED OR HAVE_SOCKPEERCRED) MYSQL_ADD_PLUGIN(auth_socket auth_socket.c MODULE_ONLY) ENDIF() diff --git a/plugin/auth_socket/auth_socket.c b/plugin/auth_socket/auth_socket.c index 41cb1039fd2..78d7e769f7b 100644 --- a/plugin/auth_socket/auth_socket.c +++ b/plugin/auth_socket/auth_socket.c @@ -85,23 +85,6 @@ static struct st_mysql_auth socket_auth_handler= socket_auth }; -mysql_declare_plugin(socket_auth) -{ - MYSQL_AUTHENTICATION_PLUGIN, - &socket_auth_handler, - "unix_socket", - "Sergei Golubchik", - "Unix Socket based authentication", - PLUGIN_LICENSE_GPL, - NULL, - NULL, - 0x0100, - NULL, - NULL, - NULL, - 0, -} -mysql_declare_plugin_end; maria_declare_plugin(socket_auth) { MYSQL_AUTHENTICATION_PLUGIN, diff --git a/plugin/daemon_example/daemon_example.cc b/plugin/daemon_example/daemon_example.cc index ec2979de3c3..7d047b2eaf7 100644 --- a/plugin/daemon_example/daemon_example.cc +++ b/plugin/daemon_example/daemon_example.cc @@ -188,23 +188,6 @@ struct st_mysql_daemon daemon_example_plugin= Plugin library descriptor */ -mysql_declare_plugin(daemon_example) -{ - MYSQL_DAEMON_PLUGIN, - &daemon_example_plugin, - "daemon_example", - "Brian Aker", - "Daemon example, creates a heartbeat beat file in mysql-heartbeat.log", - PLUGIN_LICENSE_GPL, - daemon_example_plugin_init, /* Plugin Init */ - daemon_example_plugin_deinit, /* Plugin Deinit */ - 0x0100 /* 1.0 */, - NULL, /* status variables */ - NULL, /* system variables */ - NULL, /* config options */ - 0, /* flags */ -} -mysql_declare_plugin_end; maria_declare_plugin(daemon_example) { MYSQL_DAEMON_PLUGIN, diff --git a/plugin/fulltext/plugin_example.c b/plugin/fulltext/plugin_example.c index 981335bddd6..2af3555393c 100644 --- a/plugin/fulltext/plugin_example.c +++ b/plugin/fulltext/plugin_example.c @@ -254,24 +254,6 @@ static struct st_mysql_sys_var* simple_system_variables[]= { Plugin library descriptor */ -mysql_declare_plugin(ftexample) -{ - MYSQL_FTPARSER_PLUGIN, /* type */ - &simple_parser_descriptor, /* descriptor */ - "simple_parser", /* name */ - "Sergei Golubchik", /* author */ - "Simple Full-Text Parser", /* description */ - PLUGIN_LICENSE_GPL, - simple_parser_plugin_init, /* init function (when loaded) */ - simple_parser_plugin_deinit,/* deinit function (when unloaded) */ - 0x0001, /* version */ - simple_status, /* status variables */ - simple_system_variables, /* system variables */ - NULL, - 0, -} -mysql_declare_plugin_end; - maria_declare_plugin(ftexample) { MYSQL_FTPARSER_PLUGIN, /* type */ diff --git a/plugin/qc_info/CMakeLists.txt b/plugin/qc_info/CMakeLists.txt new file mode 100644 index 00000000000..f9c58f77466 --- /dev/null +++ b/plugin/qc_info/CMakeLists.txt @@ -0,0 +1,4 @@ +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/sql ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + +MYSQL_ADD_PLUGIN(QUERY_CACHE_INFO qc_info.cc) diff --git a/plugin/qc_info/qc_info.cc b/plugin/qc_info/qc_info.cc new file mode 100644 index 00000000000..af13b6edf93 --- /dev/null +++ b/plugin/qc_info/qc_info.cc @@ -0,0 +1,213 @@ +/* + Copyright (c) 2008, Roland Bouman + http://rpbouman.blogspot.com/ + roland.bouman@gmail.com + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Roland Bouman nor the + names of the contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY + DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +/* + * TODO: report query cache flags + */ +#ifndef MYSQL_SERVER +#define MYSQL_SERVER +#endif + +#include <sql_cache.h> +#include <sql_parse.h> // check_global_access +#include <sql_acl.h> // PROCESS_ACL +#include <sql_class.h> // THD +#include <table.h> // ST_SCHEMA_TABLE +#include <mysql/plugin.h> + +class Accessible_Query_Cache : public Query_cache { +public: + HASH *get_queries() + { + return &this->queries; + } +} *qc; + +bool schema_table_store_record(THD *thd, TABLE *table); + +#define MAX_STATEMENT_TEXT_LENGTH 32767 +#define COLUMN_STATEMENT_SCHEMA 0 +#define COLUMN_STATEMENT_TEXT 1 +#define COLUMN_RESULT_BLOCKS_COUNT 2 +#define COLUMN_RESULT_BLOCKS_SIZE 3 +#define COLUMN_RESULT_BLOCKS_SIZE_USED 4 + +/* ST_FIELD_INFO is defined in table.h */ +static ST_FIELD_INFO qc_info_fields[]= +{ + {"STATEMENT_SCHEMA", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0, 0}, + {"STATEMENT_TEXT", MAX_STATEMENT_TEXT_LENGTH, MYSQL_TYPE_STRING, 0, 0, 0, 0}, + {"RESULT_BLOCKS_COUNT", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONG, 0, 0, 0, 0}, + {"RESULT_BLOCKS_SIZE", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, + {"RESULT_BLOCKS_SIZE_USED", MY_INT32_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, 0, 0, 0}, + {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, 0} +}; + +static int qc_info_fill_table(THD *thd, TABLE_LIST *tables, + COND *cond) +{ + int status= 1; + CHARSET_INFO *scs= system_charset_info; + TABLE *table= tables->table; + HASH *queries = qc->get_queries(); + + /* one must have PROCESS privilege to see others' queries */ + if (check_global_access(thd, PROCESS_ACL, true)) + return 0; + + if (qc->try_lock(thd)) + return status; + + /* loop through all queries in the query cache */ + for (uint i= 0; i < queries->records; i++) + { + const uchar *query_cache_block_raw; + Query_cache_block* query_cache_block; + Query_cache_query* query_cache_query; + uint result_blocks_count; + ulonglong result_blocks_size; + ulonglong result_blocks_size_used; + Query_cache_block *first_result_block; + Query_cache_block *result_block; + const char *statement_text; + size_t statement_text_length; + const char *key, *db; + size_t key_length, db_length; + + query_cache_block_raw = my_hash_element(queries, i); + query_cache_block = (Query_cache_block*)query_cache_block_raw; + if (query_cache_block->type != Query_cache_block::QUERY) + continue; + + query_cache_query = query_cache_block->query(); + + /* Get the actual SQL statement for this query cache query */ + statement_text = (const char*)query_cache_query->query(); + statement_text_length = strlen(statement_text); + /* We truncate SQL statements up to MAX_STATEMENT_TEXT_LENGTH in our I_S table */ + table->field[COLUMN_STATEMENT_TEXT]->store((char*)statement_text, + min(statement_text_length, MAX_STATEMENT_TEXT_LENGTH), scs); + + /* get the entire key that identifies this query cache query */ + key = (const char*)query_cache_query_get_key(query_cache_block_raw, + &key_length, 0); + /* The database against which the statement is executed is part of the + query cache query key + */ + compile_time_assert(QUERY_CACHE_DB_LENGTH_SIZE == 2); + db= key + statement_text_length + 1 + QUERY_CACHE_DB_LENGTH_SIZE; + db_length= uint2korr(db - QUERY_CACHE_DB_LENGTH_SIZE); + + table->field[COLUMN_STATEMENT_SCHEMA]->store(db, db_length, scs); + + /* If we have result blocks, process them */ + first_result_block= query_cache_query->result(); + if(first_result_block) + { + /* initialize so we can loop over the result blocks*/ + result_block= first_result_block; + result_blocks_count = 1; + result_blocks_size = result_block->length; + result_blocks_size_used = result_block->used; + + /* loop over the result blocks*/ + while((result_block= result_block->next)!=first_result_block) + { + /* calculate total number of result blocks */ + result_blocks_count++; + /* calculate total size of result blocks */ + result_blocks_size += result_block->length; + /* calculate total of used size of result blocks */ + result_blocks_size_used += result_block->used; + } + } + else + { + result_blocks_count = 0; + result_blocks_size = 0; + result_blocks_size_used = 0; + } + table->field[COLUMN_RESULT_BLOCKS_COUNT]->store(result_blocks_count, 0); + table->field[COLUMN_RESULT_BLOCKS_SIZE]->store(result_blocks_size, 0); + table->field[COLUMN_RESULT_BLOCKS_SIZE_USED]->store(result_blocks_size_used, 0); + + if (schema_table_store_record(thd, table)) + goto cleanup; + } + status = 0; + +cleanup: + qc->unlock(); + return status; +} + +static int qc_info_plugin_init(void *p) +{ + ST_SCHEMA_TABLE *schema= (ST_SCHEMA_TABLE *)p; + + schema->fields_info= qc_info_fields; + schema->fill_table= qc_info_fill_table; + +#ifdef _WIN32 + qc = (Accessible_Query_Cache *) + GetProcAddress(GetModuleHandle(NULL), "?query_cache@@3VQuery_cache@@A"); +#else + qc = (Accessible_Query_Cache *)&query_cache; +#endif + + return qc == 0; +} + + +static struct st_mysql_information_schema qc_info_plugin= +{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION }; + +/* + Plugin library descriptor +*/ + +maria_declare_plugin(query_cache_info) +{ + MYSQL_INFORMATION_SCHEMA_PLUGIN, + &qc_info_plugin, + "QUERY_CACHE_INFO", + "Roland Bouman", + "Lists all queries in the query cache.", + PLUGIN_LICENSE_BSD, + qc_info_plugin_init, /* Plugin Init */ + 0, /* Plugin Deinit */ + 0x0100, /* version, hex */ + NULL, /* status variables */ + NULL, /* system variables */ + "1.0", /* version as a string */ + MariaDB_PLUGIN_MATURITY_ALPHA +} +maria_declare_plugin_end; + diff --git a/plugin/semisync/CMakeLists.txt b/plugin/semisync/CMakeLists.txt index f1ada507f4f..33c0895e5e1 100644 --- a/plugin/semisync/CMakeLists.txt +++ b/plugin/semisync/CMakeLists.txt @@ -17,11 +17,10 @@ SET(SEMISYNC_MASTER_SOURCES semisync.cc semisync_master.cc semisync_master_plugin.cc semisync.h semisync_master.h) -MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES} - MODULE_ONLY MODULE_OUTPUT_NAME "semisync_master") +MYSQL_ADD_PLUGIN(semisync_master ${SEMISYNC_MASTER_SOURCES}) SET(SEMISYNC_SLAVE_SOURCES semisync.cc semisync_slave.cc semisync_slave_plugin.cc semisync.h semisync_slave.h ) -MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_SLAVE_SOURCES} - MODULE_ONLY MODULE_OUTPUT_NAME "semisync_slave") + +MYSQL_ADD_PLUGIN(semisync_slave ${SEMISYNC_SLAVE_SOURCES}) diff --git a/plugin/semisync/semisync_master.cc b/plugin/semisync/semisync_master.cc index 88ffdd8ee73..ca25c74c8fa 100644 --- a/plugin/semisync/semisync_master.cc +++ b/plugin/semisync/semisync_master.cc @@ -429,12 +429,13 @@ int ReplSemiSyncMaster::disableMaster() return 0; } -ReplSemiSyncMaster::~ReplSemiSyncMaster() +void ReplSemiSyncMaster::cleanup() { if (init_done_) { mysql_mutex_destroy(&LOCK_binlog_); mysql_cond_destroy(&COND_binlog_send_); + init_done_= 0; } delete active_tranxs_; diff --git a/plugin/semisync/semisync_master.h b/plugin/semisync/semisync_master.h index 18143241e7c..66fa176624b 100644 --- a/plugin/semisync/semisync_master.h +++ b/plugin/semisync/semisync_master.h @@ -455,7 +455,9 @@ class ReplSemiSyncMaster public: ReplSemiSyncMaster(); - ~ReplSemiSyncMaster(); + ~ReplSemiSyncMaster() {} + + void cleanup(); bool getMasterEnabled() { return master_enabled_; diff --git a/plugin/semisync/semisync_master_plugin.cc b/plugin/semisync/semisync_master_plugin.cc index 70aa744604e..b8240c80ef3 100644 --- a/plugin/semisync/semisync_master_plugin.cc +++ b/plugin/semisync/semisync_master_plugin.cc @@ -19,7 +19,7 @@ #include "semisync_master.h" #include "sql_class.h" // THD -ReplSemiSyncMaster repl_semisync; +static ReplSemiSyncMaster repl_semisync; C_MODE_START @@ -415,6 +415,7 @@ static int semi_sync_master_plugin_deinit(void *p) sql_print_error("unregister_binlog_transmit_observer failed"); return 1; } + repl_semisync.cleanup(); sql_print_information("unregister_replicator OK"); return 0; } @@ -426,7 +427,7 @@ struct Mysql_replication semi_sync_master_plugin= { /* Plugin library descriptor */ -mysql_declare_plugin(semi_sync_master) +maria_declare_plugin(semisync_master) { MYSQL_REPLICATION_PLUGIN, &semi_sync_master_plugin, @@ -439,7 +440,8 @@ mysql_declare_plugin(semi_sync_master) 0x0100 /* 1.0 */, semi_sync_master_status_vars, /* status variables */ semi_sync_master_system_vars, /* system variables */ - NULL, /* config options */ - 0, /* flags */ + "1.0", + MariaDB_PLUGIN_MATURITY_UNKNOWN } -mysql_declare_plugin_end; +maria_declare_plugin_end; + diff --git a/plugin/semisync/semisync_slave_plugin.cc b/plugin/semisync/semisync_slave_plugin.cc index 5d373fa0862..96e614b845e 100644 --- a/plugin/semisync/semisync_slave_plugin.cc +++ b/plugin/semisync/semisync_slave_plugin.cc @@ -18,7 +18,7 @@ #include "semisync_slave.h" #include <mysql.h> -ReplSemiSyncSlave repl_semisync; +static ReplSemiSyncSlave repl_semisync; /* indicate whether or not the slave should send a reply to the master. @@ -212,7 +212,7 @@ struct Mysql_replication semi_sync_slave_plugin= { /* Plugin library descriptor */ -mysql_declare_plugin(semi_sync_slave) +maria_declare_plugin(semisync_slave) { MYSQL_REPLICATION_PLUGIN, &semi_sync_slave_plugin, @@ -225,7 +225,8 @@ mysql_declare_plugin(semi_sync_slave) 0x0100 /* 1.0 */, semi_sync_slave_status_vars, /* status variables */ semi_sync_slave_system_vars, /* system variables */ - NULL, /* config options */ - 0, /* flags */ + "1.0", + MariaDB_PLUGIN_MATURITY_UNKNOWN } -mysql_declare_plugin_end; +maria_declare_plugin_end; + diff --git a/plugin/sql_errlog/sql_errlog.c b/plugin/sql_errlog/sql_errlog.c index ce383916621..f84af963aca 100644 --- a/plugin/sql_errlog/sql_errlog.c +++ b/plugin/sql_errlog/sql_errlog.c @@ -144,24 +144,6 @@ static struct st_mysql_audit descriptor = { MYSQL_AUDIT_GENERAL_CLASSMASK } }; -mysql_declare_plugin(sql_errlog) -{ - MYSQL_AUDIT_PLUGIN, - &descriptor, - "SQL_ERROR_LOG", - "Alexey Botchkov", - "Log SQL level errors to a file with rotation", - PLUGIN_LICENSE_GPL, - sql_error_log_init, - sql_error_log_deinit, - 0x0100, - NULL, - vars, - NULL, - 0 -} -mysql_declare_plugin_end; - maria_declare_plugin(sql_errlog) { MYSQL_AUDIT_PLUGIN, |