developers
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
April 2010
- 22 participants
- 164 discussions
[Maria-developers] Rev 2769: fixes for windows builds in http://bazaar.launchpad.net/~maria-captains/maria/5.2/
by serg@askmonty.org 02 Apr '10
by serg@askmonty.org 02 Apr '10
02 Apr '10
At http://bazaar.launchpad.net/~maria-captains/maria/5.2/
------------------------------------------------------------
revno: 2769
revision-id: sergii(a)pisem.net-20100402092009-fsk3s46z6furxi1k
parent: sanja(a)askmonty.org-20100402100339-oxwd8hcrstv3gs1o
committer: Sergei Golubchik <sergii(a)pisem.net>
branch nick: 5.2
timestamp: Fri 2010-04-02 11:20:09 +0200
message:
fixes for windows builds
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2010-04-01 14:34:51 +0000
+++ b/CMakeLists.txt 2010-04-02 09:20:09 +0000
@@ -38,6 +38,7 @@ ADD_DEFINITIONS(-DMYSQL_DATADIR="c:/Prog
ADD_DEFINITIONS(-DDEFAULT_CHARSET_HOME="c:/Program Files/MySQL/MySQL Server ${MYSQL_BASE_VERSION}/")
ADD_DEFINITIONS(-DPACKAGE=mysql)
ADD_DEFINITIONS(-DSHAREDIR="share")
+ADD_DEFINITIONS(-DPLUGINDIR="lib/plugin")
# Set debug options
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DFORCE_INIT_OF_VARS")
=== modified file 'extra/libevent/evbuffer.c'
--- a/extra/libevent/evbuffer.c 2010-02-01 06:14:12 +0000
+++ b/extra/libevent/evbuffer.c 2010-04-02 09:20:09 +0000
@@ -75,8 +75,7 @@ bufferevent_add(struct event *ev, int ti
*/
void
-bufferevent_read_pressure_cb(struct evbuffer *buf,
- size_t old __attribute__((unused)), size_t now,
+bufferevent_read_pressure_cb(struct evbuffer *buf, size_t old, size_t now,
void *arg) {
struct bufferevent *bufev = arg;
/*
=== modified file 'extra/libevent/event.c'
--- a/extra/libevent/event.c 2010-01-06 19:20:16 +0000
+++ b/extra/libevent/event.c 2010-04-02 09:20:09 +0000
@@ -394,8 +394,7 @@ event_base_get_method(struct event_base
}
static void
-event_loopexit_cb(int fd __attribute__((unused)),
- short what __attribute__((unused)), void *arg)
+event_loopexit_cb(int fd, short what, void *arg)
{
struct event_base *base = arg;
base->event_gotterm = 1;
=== modified file 'extra/libevent/signal.c'
--- a/extra/libevent/signal.c 2010-01-06 19:20:16 +0000
+++ b/extra/libevent/signal.c 2010-04-02 09:20:09 +0000
@@ -69,7 +69,7 @@ static void evsignal_handler(int sig);
/* Callback for when the signal handler write a byte to our signaling socket */
static void
-evsignal_cb(int fd, short what __attribute((unused)), void *arg __attribute((unused)))
+evsignal_cb(int fd, short what, void *arg)
{
static char signals[100];
#ifdef WIN32
=== modified file 'include/m_ctype.h'
--- a/include/m_ctype.h 2010-03-31 18:37:45 +0000
+++ b/include/m_ctype.h 2010-04-02 09:20:09 +0000
@@ -311,7 +311,9 @@ struct charset_info_st
#define ILLEGAL_CHARSET_INFO_NUMBER (~0U)
extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_bin;
-extern struct charset_info_st my_charset_bin;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_latin1;
+extern MYSQL_PLUGIN_IMPORT struct charset_info_st my_charset_filename;
+
extern struct charset_info_st my_charset_big5_chinese_ci;
extern struct charset_info_st my_charset_big5_bin;
extern struct charset_info_st my_charset_cp932_japanese_ci;
@@ -324,7 +326,6 @@ extern struct charset_info_st my_charset
extern struct charset_info_st my_charset_gb2312_bin;
extern struct charset_info_st my_charset_gbk_chinese_ci;
extern struct charset_info_st my_charset_gbk_bin;
-extern struct charset_info_st my_charset_latin1;
extern struct charset_info_st my_charset_latin1_german2_ci;
extern struct charset_info_st my_charset_latin1_bin;
extern struct charset_info_st my_charset_latin2_czech_ci;
@@ -341,7 +342,6 @@ extern struct charset_info_st my_charset
extern struct charset_info_st my_charset_utf8_unicode_ci;
extern struct charset_info_st my_charset_utf8_bin;
extern struct charset_info_st my_charset_cp1250_czech_ci;
-extern struct charset_info_st my_charset_filename;
/* declarations for simple charsets */
extern size_t my_strnxfrm_simple(CHARSET_INFO *, uchar *, size_t,
=== modified file 'include/my_global.h'
--- a/include/my_global.h 2010-03-29 15:13:53 +0000
+++ b/include/my_global.h 2010-04-02 09:20:09 +0000
@@ -1522,6 +1522,9 @@ do { doubleget_union _tmp; \
#elif defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
+#ifndef HAVE_DLERROR
+#define dlerror() ""
+#endif
#endif
/* FreeBSD 2.2.2 does not define RTLD_NOW) */
@@ -1529,7 +1532,7 @@ do { doubleget_union _tmp; \
#define RTLD_NOW 1
#endif
-#ifndef HAVE_DLERROR
+#ifndef HAVE_DLOPEN
#define dlerror() "No support for dynamic loading (static build?)"
#define dlopen(A,B) 0
#define dlsym(A,B) 0
=== modified file 'server-tools/CMakeLists.txt'
--- a/server-tools/CMakeLists.txt 2007-02-14 11:42:11 +0000
+++ b/server-tools/CMakeLists.txt 2010-04-02 09:20:09 +0000
@@ -27,7 +27,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc co
user_management_commands.cc
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
- ../../libmysql/errmsg.c)
+ ../../libmysql/errmsg.c ../../sql-common/client_plugin.c)
ADD_DEPENDENCIES(mysqlmanager GenError)
TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32)
=== modified file 'server-tools/instance-manager/CMakeLists.txt'
--- a/server-tools/instance-manager/CMakeLists.txt 2007-12-27 17:16:02 +0000
+++ b/server-tools/instance-manager/CMakeLists.txt 2010-04-02 09:20:09 +0000
@@ -28,7 +28,7 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc co
user_management_commands.cc ../../mysys/my_rnd.c
../../sql/net_serv.cc ../../sql-common/pack.c ../../sql/password.c
../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c
- ../../libmysql/errmsg.c)
+ ../../libmysql/errmsg.c ../../sql-common/client_plugin.c)
ADD_DEPENDENCIES(mysqlmanager GenError)
TARGET_LINK_LIBRARIES(mysqlmanager debug dbug mysys strings taocrypt vio yassl zlib wsock32)
=== modified file 'sql-common/client.c'
--- a/sql-common/client.c 2010-04-01 09:04:26 +0000
+++ b/sql-common/client.c 2010-04-02 09:20:09 +0000
@@ -2345,7 +2345,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_V
case VIO_TYPE_SSL:
{
struct sockaddr addr;
- socklen_t addrlen= sizeof(addr);
+ SOCKET_SIZE_TYPE addrlen= sizeof(addr);
if (getsockname(vio->sd, &addr, &addrlen))
return;
info->protocol= addr.sa_family == AF_UNIX ?
@@ -2360,7 +2360,7 @@ void mpvio_info(Vio *vio, MYSQL_PLUGIN_V
return;
case VIO_TYPE_SHARED_MEMORY:
info->protocol= MYSQL_VIO_MEMORY;
- info->handle= vio->handle_client_file_map; /* or what ? */
+ info->handle= vio->handle_file_map; /* or what ? */
return;
#endif
default: DBUG_ASSERT(0);
=== modified file 'sql/client_settings.h'
--- a/sql/client_settings.h 2010-03-29 15:13:53 +0000
+++ b/sql/client_settings.h 2010-04-02 09:20:09 +0000
@@ -29,7 +29,6 @@
#define mysql_master_send_query(A, B, C) 1
#define mysql_slave_send_query(A, B, C) 1
#define mysql_rpl_probe(mysql) 0
-#undef HAVE_SMEM
#undef _CUSTOMCONFIG_
#define mysql_server_init(a,b,c) mysql_client_plugin_init()
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc 2010-03-15 11:51:23 +0000
+++ b/sql/log_event.cc 2010-04-02 09:20:09 +0000
@@ -1716,8 +1716,7 @@ beg:
case MYSQL_TYPE_DATETIME:
{
- size_t d, t;
- uint64 i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
+ uint64 d, t, i64= uint8korr(ptr); /* YYYYMMDDhhmmss */
d= i64 / 1000000;
t= i64 % 1000000;
my_b_printf(file, "%04d-%02d-%02d %02d:%02d:%02d",
=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc 2010-04-01 09:04:26 +0000
+++ b/sql/mysqld.cc 2010-04-02 09:20:09 +0000
@@ -6645,8 +6645,6 @@ Can't be set to 1 if --log-slave-updates
{"shared-memory", OPT_ENABLE_SHARED_MEMORY,
"Enable the shared memory.",(uchar**) &opt_enable_shared_memory, (uchar**) &opt_enable_shared_memory,
0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-#endif
-#ifdef HAVE_SMEM
{"shared-memory-base-name",OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name, (uchar**) &shared_memory_base_name,
0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc 2010-03-29 15:13:53 +0000
+++ b/sql/sql_class.cc 2010-04-02 09:20:09 +0000
@@ -924,7 +924,7 @@ void THD::update_stats(void)
/* A SQL query. */
if (lex->sql_command == SQLCOM_SELECT)
select_commands++;
- else if (! sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND)
+ else if (! (sql_command_flags[lex->sql_command] & CF_STATUS_COMMAND))
{
/* Ignore 'SHOW ' commands */
}
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-04-01 14:34:51 +0000
+++ b/sql/sql_show.cc 2010-04-02 09:20:09 +0000
@@ -2529,8 +2529,8 @@ int send_user_stats(THD* thd, HASH *all_
table->field[j++]->store(user_stats->user, user_stats->user_name_length,
system_charset_info);
table->field[j++]->store((longlong)user_stats->total_connections,TRUE);
- table->field[j++]->store((longlong)user_stats->concurrent_connections);
- table->field[j++]->store((longlong)user_stats->connected_time);
+ table->field[j++]->store((longlong)user_stats->concurrent_connections, TRUE);
+ table->field[j++]->store((longlong)user_stats->connected_time, TRUE);
table->field[j++]->store((double)user_stats->busy_time);
table->field[j++]->store((double)user_stats->cpu_time);
table->field[j++]->store((longlong)user_stats->bytes_received, TRUE);
=== modified file 'storage/maria/ma_loghandler.c'
--- a/storage/maria/ma_loghandler.c 2010-04-01 09:04:26 +0000
+++ b/storage/maria/ma_loghandler.c 2010-04-02 09:20:09 +0000
@@ -1274,10 +1274,11 @@ static my_bool translog_set_lsn_for_file
for (file= from_file; file <= to_file; file++)
{
LOGHANDLER_FILE_INFO info;
- LINT_INIT(info.max_lsn);
-
File fd= open_logfile_by_number_no_cache(file);
+
LINT_INIT_STRUCT(info);
+ LINT_INIT(info.max_lsn);
+
if ((fd < 0) ||
((translog_read_file_header(&info, fd) ||
(cmp_translog_addr(lsn, info.max_lsn) > 0 &&
1
0
[Maria-developers] Rev 2768: Fixed the test according to the new plugin information in file:///Users/bell/maria/bzr/work-maria-5.2-plugin/
by sanja@askmonty.org 02 Apr '10
by sanja@askmonty.org 02 Apr '10
02 Apr '10
At file:///Users/bell/maria/bzr/work-maria-5.2-plugin/
------------------------------------------------------------
revno: 2768
revision-id: sanja(a)askmonty.org-20100402100339-oxwd8hcrstv3gs1o
parent: sanja(a)askmonty.org-20100401200509-o67qhkcgzv5s9oai
committer: sanja(a)askmonty.org
branch nick: work-maria-5.2-plugin
timestamp: Fri 2010-04-02 13:03:39 +0300
message:
Fixed the test according to the new plugin information
=== modified file 'mysql-test/suite/funcs_1/r/is_columns_is.result'
--- a/mysql-test/suite/funcs_1/r/is_columns_is.result 2010-02-01 06:14:12 +0000
+++ b/mysql-test/suite/funcs_1/r/is_columns_is.result 2010-04-02 10:03:39 +0000
@@ -271,10 +271,12 @@ NULL information_schema PBXT_STATISTICS
NULL information_schema PBXT_STATISTICS Name 2 NO varchar 40 120 NULL NULL utf8 utf8_general_ci varchar(40) select
NULL information_schema PBXT_STATISTICS Value 3 0 NO bigint NULL NULL 19 0 NULL NULL bigint(8) select
NULL information_schema PLUGINS PLUGIN_AUTHOR 8 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
+NULL information_schema PLUGINS PLUGIN_AUTH_VERSION 12 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
NULL information_schema PLUGINS PLUGIN_DESCRIPTION 9 NULL YES longtext 4294967295 4294967295 NULL NULL utf8 utf8_general_ci longtext select
NULL information_schema PLUGINS PLUGIN_LIBRARY 6 NULL YES varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PLUGINS PLUGIN_LIBRARY_VERSION 7 NULL YES varchar 20 60 NULL NULL utf8 utf8_general_ci varchar(20) select
NULL information_schema PLUGINS PLUGIN_LICENSE 10 NULL YES varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
+NULL information_schema PLUGINS PLUGIN_MATURITY 11 NULL YES varchar 12 36 NULL NULL utf8 utf8_general_ci varchar(12) select
NULL information_schema PLUGINS PLUGIN_NAME 1 NO varchar 64 192 NULL NULL utf8 utf8_general_ci varchar(64) select
NULL information_schema PLUGINS PLUGIN_STATUS 3 NO varchar 10 30 NULL NULL utf8 utf8_general_ci varchar(10) select
NULL information_schema PLUGINS PLUGIN_TYPE 4 NO varchar 80 240 NULL NULL utf8 utf8_general_ci varchar(80) select
@@ -791,6 +793,8 @@ NULL information_schema PBXT_STATISTICS
3.0000 information_schema PLUGINS PLUGIN_AUTHOR varchar 64 192 utf8 utf8_general_ci varchar(64)
1.0000 information_schema PLUGINS PLUGIN_DESCRIPTION longtext 4294967295 4294967295 utf8 utf8_general_ci longtext
3.0000 information_schema PLUGINS PLUGIN_LICENSE varchar 80 240 utf8 utf8_general_ci varchar(80)
+3.0000 information_schema PLUGINS PLUGIN_MATURITY varchar 12 36 utf8 utf8_general_ci varchar(12)
+3.0000 information_schema PLUGINS PLUGIN_AUTH_VERSION varchar 80 240 utf8 utf8_general_ci varchar(80)
NULL information_schema PROCESSLIST ID bigint NULL NULL NULL NULL bigint(4)
3.0000 information_schema PROCESSLIST USER varchar 16 48 utf8 utf8_general_ci varchar(16)
3.0000 information_schema PROCESSLIST HOST varchar 64 192 utf8 utf8_general_ci varchar(64)
1
0
[Maria-developers] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (igor:2747)
by Igor Babaev 01 Apr '10
by Igor Babaev 01 Apr '10
01 Apr '10
#At lp:maria/5.2 based on revid:igor@askmonty.org-20100331233728-obczp1ecrffnaa2s
2747 Igor Babaev 2010-04-01
Post-review fixes.
modified:
include/keycache.h
mysql-test/r/key_cache.result
mysql-test/t/key_cache.test
mysys/mf_keycache.c
sql/sql_show.cc
=== modified file 'include/keycache.h'
--- a/include/keycache.h 2010-02-16 16:41:11 +0000
+++ b/include/keycache.h 2010-04-01 21:42:40 +0000
@@ -37,7 +37,6 @@ C_MODE_START
#define MAX_KEY_CACHE_PARTITIONS 64
-
/* The structure to get statistical data about a key cache */
typedef struct st_key_cache_statistics
@@ -53,6 +52,8 @@ typedef struct st_key_cache_statistics
ulonglong writes; /* number of actual writes from buffers into files */
} KEY_CACHE_STATISTICS;
+#define NO_LONG_KEY_CACHE_STAT_VARIABLES 3
+
/* The type of a key cache object */
typedef enum key_cache_type
{
@@ -61,6 +62,55 @@ typedef enum key_cache_type
} KEY_CACHE_TYPE;
+typedef
+ int (*INIT_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ int (*RESIZE_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ void (*CHANGE_KEY_CACHE_PARAM)
+ (void *keycache_cb,
+ uint division_limit, uint age_threshold);
+typedef
+ uchar* (*KEY_CACHE_READ)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int return_buffer);
+typedef
+ int (*KEY_CACHE_INSERT)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length);
+typedef
+ int (*KEY_CACHE_WRITE)
+ (void *keycache_cb,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int force_write);
+typedef
+ int (*FLUSH_KEY_BLOCKS)
+ (void *keycache_cb,
+ int file, void *file_extra,
+ enum flush_type type);
+typedef
+ int (*RESET_KEY_CACHE_COUNTERS)
+ (const char *name, void *keycache_cb);
+typedef
+ void (*END_KEY_CACHE)
+ (void *keycache_cb, my_bool cleanup);
+typedef
+ void (*GET_KEY_CACHE_STATISTICS)
+ (void *keycache_cb, uint partition_no,
+ KEY_CACHE_STATISTICS *key_cache_stats);
+typedef
+ ulonglong (*GET_KEY_CACHE_STAT_VALUE)
+ (void *keycache_cb, uint var_no);
+
/*
An object of the type KEY_CACHE_FUNCS contains pointers to all functions
from the key cache interface.
@@ -74,32 +124,17 @@ typedef enum key_cache_type
typedef struct st_key_cache_funcs
{
- int (*init) (void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
- int (*resize) (void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
- void (*change_param) (void *keycache_cb,
- uint division_limit, uint age_threshold);
- uchar* (*read) (void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length, int return_buffer);
- int (*insert) (void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length);
- int (*write) (void *keycache_cb,
- File file, void *file_extra,
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length, int force_write);
- int (*flush) (void *keycache_cb,
- int file, void *file_extra,
- enum flush_type type);
- int (*reset_counters) (const char *name, void *keycache_cb);
- void (*end) (void *keycache_cb, my_bool cleanup);
- void (*get_stats) (void *keycache_cb, uint partition_no,
- KEY_CACHE_STATISTICS *key_cache_stats);
- ulonglong (*get_stat_val) (void *keycache_cb, uint var_no);
+ INIT_KEY_CACHE init;
+ RESIZE_KEY_CACHE resize;
+ CHANGE_KEY_CACHE_PARAM change_param;
+ KEY_CACHE_READ read;
+ KEY_CACHE_INSERT insert;
+ KEY_CACHE_WRITE write;
+ FLUSH_KEY_BLOCKS flush;
+ RESET_KEY_CACHE_COUNTERS reset_counters;
+ END_KEY_CACHE end;
+ GET_KEY_CACHE_STATISTICS get_stats;
+ GET_KEY_CACHE_STAT_VALUE get_stat_val;
} KEY_CACHE_FUNCS;
=== modified file 'mysql-test/r/key_cache.result'
--- a/mysql-test/r/key_cache.result 2010-03-31 23:37:28 +0000
+++ b/mysql-test/r/key_cache.result 2010-04-01 21:42:40 +0000
@@ -672,12 +672,12 @@ insert into t2 values (2000, 3, 'yyyy');
select * from information_schema.key_caches where key_cache_name like "keycache2"
and partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-keycache2 NULL NULL 1048576 1024 0 # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
-keycache2 NULL NULL 1048576 1024 0 # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
cache index t2 in keycache1;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache status OK
@@ -718,7 +718,7 @@ KEY_CACHE_NAME PARTITIONS PARTITION_NUMB
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 3201 43 1594 30
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024;
insert into t2 values (7000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
@@ -726,66 +726,72 @@ KEY_CACHE_NAME PARTITIONS PARTITION_NUMB
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 6 6 3 3
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
+select * from information_schema.key_caches where partition_number is null;
+KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
+default 2 NULL 32768 1024 # # 0 3172 24 1552 18
+small NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache1 3 NULL 262143 8192 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
insert into t2 values (8000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 262143 8192 # # 0 6 5 3 3
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=64*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 65535 2048 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=128*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 1 NULL 131072 8192 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 131068 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
drop table t1,t2;
set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0;
=== modified file 'mysql-test/t/key_cache.test'
--- a/mysql-test/t/key_cache.test 2010-03-31 23:37:28 +0000
+++ b/mysql-test/t/key_cache.test 2010-04-01 21:42:40 +0000
@@ -469,6 +469,8 @@ insert into t2 values (7000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
set global keycache1.key_cache_block_size=8*1024;
+--replace_column 6 # 7 #
+select * from information_schema.key_caches where partition_number is null;
insert into t2 values (8000, 3, 'yyyy');
--replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null;
=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c 2010-02-16 16:41:11 +0000
+++ b/mysys/mf_keycache.c 2010-04-01 21:42:40 +0000
@@ -49,6 +49,7 @@
One cache can handle many files.
It must contain buffers of the same blocksize.
+
init_key_cache() should be used to init cache handler.
The free list (free_block_list) is a stack like structure.
@@ -151,7 +152,7 @@ typedef struct st_keycache_wqueue
/* Control block for a simple (non-partitioned) key cache */
-typedef struct st_s_key_cache_cb
+typedef struct st_simple_key_cache_cb
{
my_bool key_cache_inited; /* <=> control block is allocated */
my_bool in_resize; /* true during resize operation */
@@ -202,7 +203,7 @@ typedef struct st_s_key_cache_cb
int blocks; /* max number of blocks in the cache */
uint hash_factor; /* factor used to calculate hash function */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
-} S_KEY_CACHE_CB;
+} SIMPLE_KEY_CACHE_CB;
/*
Some compilation flags have been added specifically for this module
@@ -314,12 +315,8 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cac
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
-static int flush_all_key_blocks(S_KEY_CACHE_CB *keycache);
-/*
-static void s_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold);
-*/
-static void s_end_key_cache(void *keycache_cb, my_bool cleanup);
+static int flush_all_key_blocks(SIMPLE_KEY_CACHE_CB *keycache);
+static void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup);
#ifdef THREAD
static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
pthread_mutex_t *mutex);
@@ -328,9 +325,9 @@ static void release_whole_queue(KEYCACHE
#define wait_on_queue(wqueue, mutex) do {} while (0)
#define release_whole_queue(wqueue) do {} while (0)
#endif
-static void free_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block);
+static void free_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block);
#if !defined(DBUG_OFF)
-static void test_key_cache(S_KEY_CACHE_CB *keycache,
+static void test_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
const char *where, my_bool lock);
#endif
#define KEYCACHE_BASE_EXPR(f, pos) \
@@ -433,7 +430,7 @@ static int keycache_pthread_cond_signal(
#define inline /* disabled inline for easier debugging */
static int fail_block(BLOCK_LINK *block);
static int fail_hlink(HASH_LINK *hlink);
-static int cache_empty(S_KEY_CACHE_CB *keycache);
+static int cache_empty(SIMPLE_KEY_CACHE_CB *keycache);
#endif
@@ -447,8 +444,8 @@ static inline uint next_power(uint value
Initialize a simple key cache
SYNOPSIS
- s_init_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ init_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
key_cache_block_size size of blocks to keep cached data
use_mem memory to use for the key cache buferrs/structures
division_limit division limit (may be zero)
@@ -458,8 +455,8 @@ static inline uint next_power(uint value
This function is the implementation of the init_key_cache interface
function that is employed by simple (non-partitioned) key caches.
The function builds a simple key cache and initializes the control block
- structure of the type S_KEY_CACHE_CB that is used for this key cache.
- The parameter keycache_cb is supposed to point to this structure.
+ structure of the type SIMPLE_KEY_CACHE_CB that is used for this key cache.
+ The parameter keycache is supposed to point to this structure.
The parameter key_cache_block_size specifies the size of the blocks in
the key cache to be built. The parameters division_limit and age_threshhold
determine the initial values of those characteristics of the key cache
@@ -478,19 +475,17 @@ static inline uint next_power(uint value
It's assumed that no two threads call this function simultaneously
referring to the same key cache handle.
-
*/
static
-int s_init_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
ulong blocks, hash_links;
size_t length;
int error;
- DBUG_ENTER("init_key_cache");
+ DBUG_ENTER("init_simple_key_cache");
DBUG_ASSERT(key_cache_block_size >= 512);
KEYCACHE_DEBUG_OPEN;
@@ -653,16 +648,16 @@ err:
Prepare for resizing a simple key cache
SYNOPSIS
- s_prepare_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ prepare_resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
with_resize_queue <=> resize queue is used
release_lock <=> release the key cache lock before return
DESCRIPTION
This function flushes all dirty pages from a simple key cache and after
- this it destroys the key cache calling s_end_key_cache. The function
- considers the parameter keycache_cb as a pointer to the control block
- structure of the type S_KEY_CACHE_CB for this key cache.
+ this it destroys the key cache calling end_simple_key_cache. The function
+ takes the parameter keycache as a pointer to the control block
+ structure of the type SIMPLE_KEY_CACHE_CB for this key cache.
The parameter with_resize_queue determines weather the resize queue is
involved (MySQL server never uses this queue). The parameter release_lock
says weather the key cache lock must be released before return from
@@ -673,19 +668,18 @@ err:
1 - otherwise.
NOTES
- This function is the called by s_resize_key_cache and p_resize_key_cache
- that resize simple and partitioned key caches respectively.
-
+ This function is the called by resize_simple_key_cache and
+ resize_partitioned_key_cache that resize simple and partitioned key caches
+ respectively.
*/
static
-int s_prepare_resize_key_cache(void *keycache_cb,
- my_bool with_resize_queue,
- my_bool release_lock)
+int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
+ my_bool with_resize_queue,
+ my_bool release_lock)
{
int res= 0;
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_prepare_resize_key_cache");
+ DBUG_ENTER("prepare_resize_simple_key_cache");
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -749,7 +743,7 @@ int s_prepare_resize_key_cache(void *key
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
#endif
- s_end_key_cache(keycache_cb, 0);
+ end_simple_key_cache(keycache, 0);
finish:
if (release_lock)
@@ -762,16 +756,16 @@ finish:
Finalize resizing a simple key cache
SYNOPSIS
- s_finish_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ finish_resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
with_resize_queue <=> resize queue is used
acquire_lock <=> acquire the key cache lock at start
DESCRIPTION
This function performs finalizing actions for the operation of
- resizing a simple key cache. The function considers the parameter
- keycache_cb as a pointer to the control block structure of the type
- S_KEY_CACHE_CB for this key cache. The function sets the flag
+ resizing a simple key cache. The function takes the parameter
+ keycache as a pointer to the control block structure of the type
+ SIMPLE_KEY_CACHE_CB for this key cache. The function sets the flag
in_resize in this structure to FALSE.
The parameter with_resize_queue determines weather the resize queue
is involved (MySQL server never uses this queue).
@@ -782,22 +776,23 @@ finish:
none
NOTES
- This function is the called by s_resize_key_cache and p_resize_key_cache
- that resize simple and partitioned key caches respectively.
-
+ This function is the called by resize_simple_key_cache and
+ resize_partitioned_key_cache that resize simple and partitioned key caches
+ respectively.
*/
static
-void s_finish_resize_key_cache(void *keycache_cb,
- my_bool with_resize_queue,
- my_bool acquire_lock)
+void finish_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
+ my_bool with_resize_queue,
+ my_bool acquire_lock)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_finish_resize_key_cache");
+ DBUG_ENTER("finish_resize_simple_key_cache");
if (acquire_lock)
keycache_pthread_mutex_lock(&keycache->cache_lock);
-
+
+ safe_mutex_assert_owner(&keycache->cache_lock);
+
/*
Mark the resize finished. This allows other threads to start a
resize or to request new cache blocks.
@@ -820,8 +815,8 @@ void s_finish_resize_key_cache(void *key
Resize a simple key cache
SYNOPSIS
- s_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
key_cache_block_size size of blocks to keep cached data
use_mem memory to use for the key cache buffers/structures
division_limit new division limit (if not zero)
@@ -830,8 +825,8 @@ void s_finish_resize_key_cache(void *key
DESCRIPTION
This function is the implementation of the resize_key_cache interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache to be resized.
The parameter key_cache_block_size specifies the new size of the blocks in
the key cache. The parameters division_limit and age_threshold
@@ -845,47 +840,45 @@ void s_finish_resize_key_cache(void *key
0 - otherwise.
NOTES.
- The function first calls the function s_prepare_resize_key_cache
+ The function first calls the function prepare_resize_simple_key_cache
to flush all dirty blocks from key cache, to free memory used
for key cache blocks and auxiliary structures. After this the
function builds a new key cache with new parameters.
This implementation doesn't block the calls and executions of other
functions from the key cache interface. However it assumes that the
- calls of s_resize_key_cache itself are serialized.
+ calls of resize_simple_key_cache itself are serialized.
The function starts the operation only when all other threads
performing operations with the key cache let her to proceed
(when cnt_for_resize=0).
-
*/
static
-int s_resize_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int blocks= 0;
- DBUG_ENTER("s_resize_key_cache");
+ DBUG_ENTER("resize_simple_key_cache");
if (!keycache->key_cache_inited)
- DBUG_RETURN(keycache->disk_blocks);
+ DBUG_RETURN(blocks);
/*
Note that the cache_lock mutex and the resize_queue are left untouched.
We do not lose the cache_lock and will release it only at the end of
this function.
*/
- if (s_prepare_resize_key_cache(keycache_cb, 1, 0))
+ if (prepare_resize_simple_key_cache(keycache, 1, 0))
goto finish;
/* The following will work even if use_mem is 0 */
- blocks= s_init_key_cache(keycache, key_cache_block_size, use_mem,
- division_limit, age_threshold);
+ blocks= init_simple_key_cache(keycache, key_cache_block_size, use_mem,
+ division_limit, age_threshold);
finish:
- s_finish_resize_key_cache(keycache_cb, 1, 0);
+ finish_resize_simple_key_cache(keycache, 1, 0);
DBUG_RETURN(blocks);
}
@@ -894,7 +887,7 @@ finish:
/*
Increment counter blocking resize key cache operation
*/
-static inline void inc_counter_for_resize_op(S_KEY_CACHE_CB *keycache)
+static inline void inc_counter_for_resize_op(SIMPLE_KEY_CACHE_CB *keycache)
{
keycache->cnt_for_resize_op++;
}
@@ -904,7 +897,7 @@ static inline void inc_counter_for_resiz
Decrement counter blocking resize key cache operation;
Signal the operation to proceed when counter becomes equal zero
*/
-static inline void dec_counter_for_resize_op(S_KEY_CACHE_CB *keycache)
+static inline void dec_counter_for_resize_op(SIMPLE_KEY_CACHE_CB *keycache)
{
if (!--keycache->cnt_for_resize_op)
release_whole_queue(&keycache->waiting_for_resize_cnt);
@@ -915,16 +908,16 @@ static inline void dec_counter_for_resiz
Change key cache parameters of a simple key cache
SYNOPSIS
- s_change_key_cache_param()
- keycache_cb pointer to the control block of a simple key cache
+ change_simple_key_cache_param()
+ keycache pointer to the control block of a simple key cache
division_limit new division limit (if not zero)
age_threshold new age threshold (if not zero)
DESCRIPTION
This function is the implementation of the change_key_cache_param interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache where new values of the division limit and the age threshold used
for midpoint insertion strategy are to be set. The parameters
division_limit and age_threshold provide these new values.
@@ -938,15 +931,13 @@ static inline void dec_counter_for_resiz
This function changes some parameters of a given key cache without
reformatting it. The function does not touch the contents the key
cache blocks.
-
*/
static
-void s_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold)
+void change_simple_key_cache_param(SIMPLE_KEY_CACHE_CB *keycache, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_change_key_cache_param");
+ DBUG_ENTER("change_simple_key_cache_param");
keycache_pthread_mutex_lock(&keycache->cache_lock);
if (division_limit)
keycache->min_warm_blocks= (keycache->disk_blocks *
@@ -963,15 +954,15 @@ void s_change_key_cache_param(void *keyc
Destroy a simple key cache
SYNOPSIS
- s_end_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ end_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
cleanup <=> complete free (free also mutex for key cache)
DESCRIPTION
This function is the implementation of the end_key_cache interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache to be destroyed.
The function frees the memory allocated for the key cache blocks and
auxiliary structures. If the value of the parameter cleanup is TRUE
@@ -982,10 +973,9 @@ void s_change_key_cache_param(void *keyc
*/
static
-void s_end_key_cache(void *keycache_cb, my_bool cleanup)
+void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_end_key_cache");
+ DBUG_ENTER("end_simple_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
if (!keycache->key_cache_inited)
@@ -1276,7 +1266,7 @@ static inline void link_changed(BLOCK_LI
void
*/
-static void link_to_file_list(S_KEY_CACHE_CB *keycache,
+static void link_to_file_list(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, int file,
my_bool unlink_block)
{
@@ -1317,7 +1307,7 @@ static void link_to_file_list(S_KEY_CACH
void
*/
-static void link_to_changed_list(S_KEY_CACHE_CB *keycache,
+static void link_to_changed_list(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block)
{
DBUG_ASSERT(block->status & BLOCK_IN_USE);
@@ -1372,8 +1362,8 @@ static void link_to_changed_list(S_KEY_C
not linked in the LRU ring.
*/
-static void link_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block, my_bool hot,
- my_bool at_end)
+static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
+ my_bool hot, my_bool at_end)
{
BLOCK_LINK *ins;
BLOCK_LINK **pins;
@@ -1493,7 +1483,7 @@ static void link_block(S_KEY_CACHE_CB *k
See NOTES for link_block
*/
-static void unlink_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
+static void unlink_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
{
DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE));
DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/
@@ -1551,7 +1541,8 @@ static void unlink_block(S_KEY_CACHE_CB
RETURN
void
*/
-static void reg_requests(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block, int count)
+static void reg_requests(SIMPLE_KEY_CACHE_CB *keycache,
+ BLOCK_LINK *block, int count)
{
DBUG_ASSERT(block->status & BLOCK_IN_USE);
DBUG_ASSERT(block->hash_link);
@@ -1594,7 +1585,7 @@ static void reg_requests(S_KEY_CACHE_CB
not linked in the LRU ring.
*/
-static void unreg_request(S_KEY_CACHE_CB *keycache,
+static void unreg_request(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, int at_end)
{
DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
@@ -1683,7 +1674,7 @@ static void remove_reader(BLOCK_LINK *bl
signals on its termination
*/
-static void wait_for_readers(S_KEY_CACHE_CB *keycache,
+static void wait_for_readers(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block)
{
#ifdef THREAD
@@ -1732,7 +1723,7 @@ static inline void link_hash(HASH_LINK *
Remove a hash link from the hash table
*/
-static void unlink_hash(S_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
+static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
{
KEYCACHE_DBUG_PRINT("unlink_hash", ("fd: %u pos_ %lu #requests=%u",
(uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests));
@@ -1788,7 +1779,7 @@ static void unlink_hash(S_KEY_CACHE_CB *
Get the hash link for a page
*/
-static HASH_LINK *get_hash_link(S_KEY_CACHE_CB *keycache,
+static HASH_LINK *get_hash_link(SIMPLE_KEY_CACHE_CB *keycache,
int file, my_off_t filepos)
{
reg1 HASH_LINK *hash_link, **start;
@@ -1909,7 +1900,7 @@ restart:
waits until first of this operations links any block back.
*/
-static BLOCK_LINK *find_key_block(S_KEY_CACHE_CB *keycache,
+static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
File file, my_off_t filepos,
int init_hits_left,
int wrmode, int *page_st)
@@ -2669,7 +2660,7 @@ restart:
portion is less than read_length, but not less than min_length.
*/
-static void read_block(S_KEY_CACHE_CB *keycache,
+static void read_block(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, uint read_length,
uint min_length, my_bool primary)
{
@@ -2761,8 +2752,8 @@ static void read_block(S_KEY_CACHE_CB *k
SYNOPSIS
- s_key_cache_read()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_read()
+ keycache pointer to the control block of a simple key cache
file handler for the file for the block of data to be read
filepos position of the block of data in the file
level determines the weight of the data
@@ -2774,8 +2765,8 @@ static void read_block(S_KEY_CACHE_CB *k
DESCRIPTION
This function is the implementation of the key_cache_read interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
In a general case the function reads a block of data from the key cache
into the buffer buff of the size specified by the parameter length. The
@@ -2799,20 +2790,18 @@ static void read_block(S_KEY_CACHE_CB *k
NOTES
Filepos must be a multiple of 'block_length', but it doesn't
have to be a multiple of key_cache_block_size;
-
*/
-uchar *s_key_cache_read(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+uchar *simple_key_cache_read(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int return_buffer __attribute__((unused)))
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
my_bool locked_and_incremented= FALSE;
int error=0;
uchar *start= buff;
- DBUG_ENTER("s_key_cache_read");
+ DBUG_ENTER("simple_key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
@@ -3010,8 +2999,8 @@ end:
Insert a block of file data from a buffer into a simple key cache
SYNOPSIS
- s_key_cache_insert()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_insert()
+ keycache pointer to the control block of a simple key cache
file handler for the file to insert data from
filepos position of the block of data in the file to insert
level determines the weight of the data
@@ -3021,8 +3010,8 @@ end:
DESCRIPTION
This function is the implementation of the key_cache_insert interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
The function writes a block of file data from a buffer into the key cache.
The buffer is specified with the parameters buff and length - the pointer
@@ -3045,11 +3034,10 @@ end:
*/
static
-int s_key_cache_insert(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length)
+int simple_key_cache_insert(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int error= 0;
DBUG_ENTER("key_cache_insert");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
@@ -3272,8 +3260,8 @@ int s_key_cache_insert(void *keycache_cb
SYNOPSIS
- s_key_cache_write()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_write()
+ keycache pointer to the control block of a simple key cache
file handler for the file to write data to
file_extra maps of key cache partitions containing
dirty pages from file
@@ -3287,8 +3275,8 @@ int s_key_cache_insert(void *keycache_cb
DESCRIPTION
This function is the implementation of the key_cache_write interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
In a general case the function copies data from a buffer into the key
cache. The buffer is specified with the parameters buff and length -
@@ -3304,7 +3292,8 @@ int s_key_cache_insert(void *keycache_cb
The parameter file_extra currently makes sense only for simple key caches
that are elements of a partitioned key cache. It provides a pointer to the
shared bitmap of the partitions that may contains dirty pages for the file.
- This bitmap is used to optimize the function p_flush_key_blocks.
+ This bitmap is used to optimize the function
+ flush_partitioned_key_cache_blocks.
RETURN VALUE
0 if a success, 1 - otherwise.
@@ -3312,21 +3301,19 @@ int s_key_cache_insert(void *keycache_cb
NOTES
This implementation exploits the fact that the function is called only
when a thread has got an exclusive lock for the key file.
-
*/
static
-int s_key_cache_write(void *keycache_cb,
- File file, void *file_extra __attribute__((unused)),
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int dont_write)
+int simple_key_cache_write(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, void *file_extra __attribute__((unused)),
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int dont_write)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
my_bool locked_and_incremented= FALSE;
int error=0;
- DBUG_ENTER("s_key_cache_write");
+ DBUG_ENTER("simple_key_cache_write");
DBUG_PRINT("enter",
("fd: %u pos: %lu length: %u block_length: %u"
" key_block_length: %u",
@@ -3641,7 +3628,7 @@ end:
Block must have a request registered on it.
*/
-static void free_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
+static void free_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
{
KEYCACHE_THREAD_TRACE("free block");
KEYCACHE_DBUG_PRINT("free_block",
@@ -3781,7 +3768,7 @@ static int cmp_sec_link(BLOCK_LINK **a,
free used blocks if requested
*/
-static int flush_cached_blocks(S_KEY_CACHE_CB *keycache,
+static int flush_cached_blocks(SIMPLE_KEY_CACHE_CB *keycache,
File file, BLOCK_LINK **cache,
BLOCK_LINK **end,
enum flush_type type)
@@ -3909,7 +3896,7 @@ static int flush_cached_blocks(S_KEY_CAC
1 error
*/
-static int flush_key_blocks_int(S_KEY_CACHE_CB *keycache,
+static int flush_key_blocks_int(SIMPLE_KEY_CACHE_CB *keycache,
File file, enum flush_type type)
{
BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache;
@@ -4349,8 +4336,8 @@ err:
SYNOPSIS
- s_flush_key_blocks()
- keycache_cb pointer to the control block of a simple key cache
+ flush_simple_key_blocks()
+ keycache pointer to the control block of a simple key cache
file handler for the file to flush to
file_extra maps of key cache partitions containing
dirty pages from file (not used)
@@ -4359,7 +4346,7 @@ err:
DESCRIPTION
This function is the implementation of the flush_key_blocks interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
+ The function takes the parameter keycache as a pointer to the
control block structure of the type S_KEY_CACHE_CB for a simple key
cache.
In a general case the function flushes the data from all dirty key
@@ -4378,16 +4365,14 @@ err:
NOTES
This implementation exploits the fact that the function is called only
when a thread has got an exclusive lock for the key file.
-
*/
static
-int s_flush_key_blocks(void *keycache_cb,
- File file,
- void *file_extra __attribute__((unused)),
- enum flush_type type)
+int flush_simple_key_cache_blocks(SIMPLE_KEY_CACHE_CB *keycache,
+ File file,
+ void *file_extra __attribute__((unused)),
+ enum flush_type type)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int res= 0;
DBUG_ENTER("flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
@@ -4440,7 +4425,7 @@ int s_flush_key_blocks(void *keycache_cb
!= 0 Error
*/
-static int flush_all_key_blocks(S_KEY_CACHE_CB *keycache)
+static int flush_all_key_blocks(SIMPLE_KEY_CACHE_CB *keycache)
{
BLOCK_LINK *block;
uint total_found;
@@ -4546,14 +4531,14 @@ static int flush_all_key_blocks(S_KEY_CA
Reset the counters of a simple key cache
SYNOPSIS
- s_reset_key_cache_counters()
+ reset_simple_key_cache_counters()
name the name of a key cache
- keycache_cb pointer to the control block of a simple key cache
+ keycache pointer to the control block of a simple key cache
DESCRIPTION
This function is the implementation of the reset_key_cache_counters
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
+ The function takes the parameter keycache as a pointer to the
control block structure of the type S_KEY_CACHE_CB for a simple key cache.
This function resets the values of all statistical counters for the key
cache to 0.
@@ -4561,15 +4546,13 @@ static int flush_all_key_blocks(S_KEY_CA
RETURN
0 on success (always because it can't fail)
-
*/
static
-int s_reset_key_cache_counters(const char *name __attribute__((unused)),
- void *keycache_cb)
+int reset_simple_key_cache_counters(const char *name __attribute__((unused)),
+ SIMPLE_KEY_CACHE_CB *keycache)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_reset_key_cache_counters");
+ DBUG_ENTER("reset_simple_key_cache_counters");
if (!keycache->key_cache_inited)
{
DBUG_PRINT("info", ("Key cache %s not initialized.", name));
@@ -4590,9 +4573,10 @@ int s_reset_key_cache_counters(const cha
/*
Test if disk-cache is ok
*/
-static void test_key_cache(S_KEY_CACHE_CB *keycache __attribute__((unused)),
- const char *where __attribute__((unused)),
- my_bool lock __attribute__((unused)))
+static
+void test_key_cache(SIMPLE_KEY_CACHE_CB *keycache __attribute__((unused)),
+ const char *where __attribute__((unused)),
+ my_bool lock __attribute__((unused)))
{
/* TODO */
}
@@ -4604,7 +4588,7 @@ static void test_key_cache(S_KEY_CACHE_C
#define MAX_QUEUE_LEN 100
-static void keycache_dump(S_KEY_CACHE_CB *keycache)
+static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache)
{
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
struct st_my_thread_var *last;
@@ -4844,7 +4828,7 @@ static int fail_hlink(HASH_LINK *hlink)
return 0; /* Let the assert fail. */
}
-static int cache_empty(S_KEY_CACHE_CB *keycache)
+static int cache_empty(SIMPLE_KEY_CACHE_CB *keycache)
{
int errcnt= 0;
int idx;
@@ -4887,54 +4871,57 @@ static int cache_empty(S_KEY_CACHE_CB *k
Get statistics for a simple key cache
SYNOPSIS
- get_key_cache_statistics()
- keycache_cb pointer to the control block of a simple key cache
+ get_simple_key_cache_statistics()
+ keycache pointer to the control block of a simple key cache
partition_no partition number (not used)
key_cache_stats OUT pointer to the structure for the returned statistics
DESCRIPTION
This function is the implementation of the get_key_cache_statistics
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key cache.
- This function returns the statistical data for the key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
+ cache. This function returns the statistical data for the key cache.
The parameter partition_no is not used by this function.
RETURN
none
-
*/
static
-void s_get_key_cache_statistics(void *keycache_cb,
- uint partition_no __attribute__((unused)),
- KEY_CACHE_STATISTICS *key_cache_stats)
-{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_get_key_cache_statistics");
-
- key_cache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
- key_cache_stats->block_size= (longlong) keycache->key_cache_block_size;
- key_cache_stats->blocks_used= keycache->blocks_used;
- key_cache_stats->blocks_unused= keycache->blocks_unused;
- key_cache_stats->blocks_changed= keycache->global_blocks_changed;
- key_cache_stats->read_requests= keycache->global_cache_r_requests;
- key_cache_stats->reads= keycache->global_cache_read;
- key_cache_stats->write_requests= keycache->global_cache_w_requests;
- key_cache_stats->writes= keycache->global_cache_write;
+void get_simple_key_cache_statistics(SIMPLE_KEY_CACHE_CB *keycache,
+ uint partition_no __attribute__((unused)),
+ KEY_CACHE_STATISTICS *keycache_stats)
+{
+ DBUG_ENTER("simple_get_key_cache_statistics");
+
+ keycache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
+ keycache_stats->block_size= (longlong) keycache->key_cache_block_size;
+ keycache_stats->blocks_used= keycache->blocks_used;
+ keycache_stats->blocks_unused= keycache->blocks_unused;
+ keycache_stats->blocks_changed= keycache->global_blocks_changed;
+ keycache_stats->read_requests= keycache->global_cache_r_requests;
+ keycache_stats->reads= keycache->global_cache_read;
+ keycache_stats->write_requests= keycache->global_cache_w_requests;
+ keycache_stats->writes= keycache->global_cache_write;
DBUG_VOID_RETURN;
}
-static size_t s_key_cache_stat_var_offsets[]=
+/*
+ Offsets of the statistical values in the control block for a simple key cache
+ The first NO_LONG_KEY_CACHE_STAT_VARIABLES=3 are of the ulong type while the
+ remaining are of the ulonglong type.
+ */
+static size_t simple_key_cache_stat_var_offsets[]=
{
- offsetof(S_KEY_CACHE_CB, blocks_used),
- offsetof(S_KEY_CACHE_CB, blocks_unused),
- offsetof(S_KEY_CACHE_CB, global_blocks_changed),
- offsetof(S_KEY_CACHE_CB, global_cache_w_requests),
- offsetof(S_KEY_CACHE_CB, global_cache_write),
- offsetof(S_KEY_CACHE_CB, global_cache_r_requests),
- offsetof(S_KEY_CACHE_CB, global_cache_read)
+ offsetof(SIMPLE_KEY_CACHE_CB, blocks_used),
+ offsetof(SIMPLE_KEY_CACHE_CB, blocks_unused),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_blocks_changed),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_w_requests),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_write),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_r_requests),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_read)
};
@@ -4942,16 +4929,16 @@ static size_t s_key_cache_stat_var_offse
Get the value of a statistical variable for a simple key cache
SYNOPSIS
- s_get_key_cache_stat_value()
- keycache_cb pointer to the control block of a simple key cache
+ get_simple_key_cache_stat_value()
+ keycache pointer to the control block of a simple key cache
var_no the ordered number of a statistical variable
DESCRIPTION
- This function is the implementation of the s_get_key_cache_stat_value
+ This function is the implementation of the get_simple_key_cache_stat_value
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key cache.
- This function returns the value of the statistical variable var_no
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
+ cache. This function returns the value of the statistical variable var_no
for this key cache. The variables are numbered starting from 0 to 6.
RETURN
@@ -4960,12 +4947,12 @@ static size_t s_key_cache_stat_var_offse
*/
static
-ulonglong s_get_key_cache_stat_value(void *keycache_cb, uint var_no)
+ulonglong get_simple_key_cache_stat_value(SIMPLE_KEY_CACHE_CB *keycache,
+ uint var_no)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- size_t var_ofs= s_key_cache_stat_var_offsets[var_no];
+ size_t var_ofs= simple_key_cache_stat_var_offsets[var_no];
ulonglong res= 0;
- DBUG_ENTER("s_get_key_cache_stat_value");
+ DBUG_ENTER("get_simple_key_cache_stat_value");
if (var_no < 3)
res= (ulonglong) (*(long *) ((char *) keycache + var_ofs));
@@ -4985,19 +4972,19 @@ ulonglong s_get_key_cache_stat_value(voi
the MySQL server code directly. We don't do it though.
*/
-static KEY_CACHE_FUNCS s_key_cache_funcs =
+static KEY_CACHE_FUNCS simple_key_cache_funcs =
{
- s_init_key_cache,
- s_resize_key_cache,
- s_change_key_cache_param,
- s_key_cache_read,
- s_key_cache_insert,
- s_key_cache_write,
- s_flush_key_blocks,
- s_reset_key_cache_counters,
- s_end_key_cache,
- s_get_key_cache_statistics,
- s_get_key_cache_stat_value
+ (INIT_KEY_CACHE) init_simple_key_cache,
+ (RESIZE_KEY_CACHE) resize_simple_key_cache,
+ (CHANGE_KEY_CACHE_PARAM) change_simple_key_cache_param,
+ (KEY_CACHE_READ) simple_key_cache_read,
+ (KEY_CACHE_INSERT) simple_key_cache_insert,
+ (KEY_CACHE_WRITE) simple_key_cache_write,
+ (FLUSH_KEY_BLOCKS) flush_simple_key_cache_blocks,
+ (RESET_KEY_CACHE_COUNTERS) reset_simple_key_cache_counters,
+ (END_KEY_CACHE) end_simple_key_cache,
+ (GET_KEY_CACHE_STATISTICS) get_simple_key_cache_statistics,
+ (GET_KEY_CACHE_STAT_VALUE) get_simple_key_cache_stat_value
};
@@ -5038,17 +5025,22 @@ static KEY_CACHE_FUNCS s_key_cache_funcs
/* Control block for a partitioned key cache */
-typedef struct st_p_key_cache_cb
+typedef struct st_partitioned_key_cache_cb
{
my_bool key_cache_inited; /*<=> control block is allocated */
- S_KEY_CACHE_CB **partition_array; /* array of the key cache partitions */
- uint partitions; /* number of partitions in the key cache */
+ SIMPLE_KEY_CACHE_CB **partition_array; /* the key cache partitions */
size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
-} P_KEY_CACHE_CB;
+ uint partitions; /* number of partitions in the key cache */
+} PARTITIONED_KEY_CACHE_CB;
static
-void p_end_key_cache(void *keycache_cb, my_bool cleanup);
+void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ my_bool cleanup);
+
+static int
+reset_partitioned_key_cache_counters(const char *name,
+ PARTITIONED_KEY_CACHE_CB *keycache);
/*
Determine the partition to which the index block to read is ascribed
@@ -5070,11 +5062,12 @@ void p_end_key_cache(void *keycache_cb,
file block is ascribed.
*/
-static
-S_KEY_CACHE_CB *get_key_cache_partition(P_KEY_CACHE_CB *keycache,
- File file, my_off_t filepos)
+static
+SIMPLE_KEY_CACHE_CB *
+get_key_cache_partition(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos)
{
- uint i= KEYCACHE_BASE_EXPR( file, filepos) % keycache->partitions;
+ uint i= KEYCACHE_BASE_EXPR(file, filepos) % keycache->partitions;
return keycache->partition_array[i];
}
@@ -5101,10 +5094,10 @@ S_KEY_CACHE_CB *get_key_cache_partition(
file block is ascribed.
*/
-static
-S_KEY_CACHE_CB *get_key_cache_partition_for_write(P_KEY_CACHE_CB *keycache,
- File file, my_off_t filepos,
- ulonglong* dirty_part_map)
+static SIMPLE_KEY_CACHE_CB
+*get_key_cache_partition_for_write(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos,
+ ulonglong* dirty_part_map)
{
uint i= KEYCACHE_BASE_EXPR( file, filepos) % keycache->partitions;
*dirty_part_map|= 1<<i;
@@ -5116,8 +5109,8 @@ S_KEY_CACHE_CB *get_key_cache_partition_
Initialize a partitioned key cache
SYNOPSIS
- p_init_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ init_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for all key cache partitions
division_limit division limit (may be zero)
@@ -5127,17 +5120,17 @@ S_KEY_CACHE_CB *get_key_cache_partition_
This function is the implementation of the init_key_cache interface function
that is employed by partitioned key caches.
The function builds and initializes an array of simple key caches, and then
- initializes the control block structure of the type P_KEY_CACHE_CB that is
- used for a partitioned key cache. The parameter keycache_cb is supposed to
- point to this structure. The number of partitions in the partitioned key
- cache to be built must be passed through the field 'partitions' of this
- structure. The parameter key_cache_block_size specifies the size of the
- blocks in the the simple key caches to be built. The parameters
- division_limit and age_threshold determine the initial values of those
- characteristics of the simple key caches that are used for midpoint
- insertion strategy. The parameter use_mem specifies the total amount of
- memory to be allocated for the key cache blocks in all simple key caches
- and for all auxiliary structures.
+ initializes the control block structure of the type PARTITIONED_KEY_CACHE_CB
+ that is used for a partitioned key cache. The parameter keycache is
+ supposed to point to this structure. The number of partitions in the
+ partitioned key cache to be built must be passed through the field
+ 'partitions' of this structure. The parameter key_cache_block_size specifies
+ the size of the blocks in the the simple key caches to be built.
+ The parameters division_limit and age_threshold determine the initial
+ values of those characteristics of the simple key caches that are used for
+ midpoint insertion strategy. The parameter use_mem specifies the total
+ amount of memory to be allocated for the key cache blocks in all simple key
+ caches and for all auxiliary structures.
RETURN VALUE
total number of blocks in key cache partitions, if successful,
@@ -5152,19 +5145,19 @@ S_KEY_CACHE_CB *get_key_cache_partition_
*/
static
-int p_init_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int init_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
int i;
size_t mem_per_cache;
int cnt;
- S_KEY_CACHE_CB *partition;
- S_KEY_CACHE_CB **partition_ptr;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
+ SIMPLE_KEY_CACHE_CB *partition;
+ SIMPLE_KEY_CACHE_CB **partition_ptr;
uint partitions= keycache->partitions;
- int blocks= -1;
- DBUG_ENTER("p_init_key_cache");
+ int blocks= 0;
+ DBUG_ENTER("partitioned_init_key_cache");
keycache->key_cache_block_size = key_cache_block_size;
@@ -5173,9 +5166,9 @@ int p_init_key_cache(void *keycache_cb,
else
{
if(!(partition_ptr=
- (S_KEY_CACHE_CB **) my_malloc(sizeof(S_KEY_CACHE_CB *) * partitions,
- MYF(0))))
- DBUG_RETURN(blocks);
+ (SIMPLE_KEY_CACHE_CB **) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB *) *
+ partitions, MYF(MY_WME))))
+ DBUG_RETURN(-1);
keycache->partition_array= partition_ptr;
}
@@ -5188,36 +5181,35 @@ int p_init_key_cache(void *keycache_cb,
partition= *partition_ptr;
else
{
- if (!(partition= (S_KEY_CACHE_CB *) my_malloc(sizeof(S_KEY_CACHE_CB),
- MYF(0))))
+ if (!(partition=
+ (SIMPLE_KEY_CACHE_CB *) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB),
+ MYF(MY_WME))))
continue;
partition->key_cache_inited= 0;
}
- if ((cnt= s_init_key_cache(partition,
- key_cache_block_size, mem_per_cache,
- division_limit, age_threshold)) <= 0)
+ if ((cnt= init_simple_key_cache(partition,
+ key_cache_block_size, mem_per_cache,
+ division_limit, age_threshold)) <= 0)
{
- s_end_key_cache(partition, 1);
- my_free((uchar *) partition, MYF(0));
+ end_simple_key_cache(partition, 1);
+ my_free(partition, MYF(0));
partition= 0;
if (key_cache_inited)
{
memmove(partition_ptr, partition_ptr+1,
sizeof(partition_ptr)*(partitions-i-1));
}
+ if (!--partitions)
+ break;
if (i == 0)
{
i--;
- partitions--;
- if (partitions)
- mem_per_cache = use_mem / partitions;
+ mem_per_cache = use_mem / partitions;
+ continue;
}
- continue;
}
- if (blocks < 0)
- blocks= 0;
blocks+= cnt;
*partition_ptr++= partition;
}
@@ -5229,6 +5221,9 @@ int p_init_key_cache(void *keycache_cb,
keycache->key_cache_inited= 1;
+ if (!partitions)
+ blocks= -1;
+
DBUG_RETURN(blocks);
}
@@ -5237,8 +5232,8 @@ int p_init_key_cache(void *keycache_cb,
Resize a partitioned key cache
SYNOPSIS
- p_resize_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ resize_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for the new key cache
division_limit new division limit (if not zero)
@@ -5247,9 +5242,9 @@ int p_init_key_cache(void *keycache_cb,
DESCRIPTION
This function is the implementation of the resize_key_cache interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the partitioned
- key cache to be resized.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the
+ partitioned key cache to be resized.
The parameter key_cache_block_size specifies the new size of the blocks in
the simple key caches that comprise the partitioned key cache.
The parameters division_limit and age_threshold determine the new initial
@@ -5263,48 +5258,47 @@ int p_init_key_cache(void *keycache_cb,
0 - otherwise.
NOTES.
- The function first calls s_prepare_resize_key_cache for each simple
+ The function first calls prepare_resize_simple_key_cache for each simple
key cache effectively flushing all dirty pages from it and destroying
- the key cache. Then p_init_key cache is called. This call builds all
- the new array of simple key caches containing the same number of
- elements as the old one. After this the function calls the function
- s_finish_resize_key_cache for each simple key cache from this array.
+ the key cache. Then init_partitioned_key_cache is called. This call builds
+ a new array of simple key caches containing the same number of elements
+ as the old one. After this the function calls the function
+ finish_resize_simple_key_cache for each simple key cache from this array.
This implementation doesn't block the calls and executions of other
functions from the key cache interface. However it assumes that the
- calls of s_resize_key_cache itself are serialized.
-
+ calls of resize_partitioned_key_cache itself are serialized.
*/
static
-int p_resize_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int resize_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
my_bool cleanup= use_mem == 0;
int blocks= -1;
int err= 0;
- DBUG_ENTER("p_resize_key_cache");
- if (use_mem == 0)
+ DBUG_ENTER("partitioned_resize_key_cache");
+ if (cleanup)
{
- p_end_key_cache(keycache_cb, 0);
- DBUG_RETURN(blocks);
+ end_partitioned_key_cache(keycache, 0);
+ DBUG_RETURN(-1);
}
for (i= 0; i < partitions; i++)
{
- err|= s_prepare_resize_key_cache(keycache->partition_array[i], 0, 1);
+ err|= prepare_resize_simple_key_cache(keycache->partition_array[i], 0, 1);
}
- if (!err && use_mem)
- blocks= p_init_key_cache(keycache_cb, key_cache_block_size, use_mem,
- division_limit, age_threshold);
- if (blocks > 0 && !cleanup)
+ if (!err)
+ blocks= init_partitioned_key_cache(keycache, key_cache_block_size,
+ use_mem, division_limit, age_threshold);
+ if (blocks > 0)
{
for (i= 0; i < partitions; i++)
{
- s_finish_resize_key_cache(keycache->partition_array[i], 0, 1);
+ finish_resize_simple_key_cache(keycache->partition_array[i], 0, 1);
}
}
DBUG_RETURN(blocks);
@@ -5315,17 +5309,17 @@ int p_resize_key_cache(void *keycache_cb
Change key cache parameters of a partitioned key cache
SYNOPSIS
- p_change_key_cache_param()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_change_key_cache_param()
+ keycache pointer to the control block of a partitioned key cache
division_limit new division limit (if not zero)
age_threshold new age threshold (if not zero)
DESCRIPTION
This function is the implementation of the change_key_cache_param interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the simple key
- cache where new values of the division limit and the age threshold used
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the simple
+ key cache where new values of the division limit and the age threshold used
for midpoint insertion strategy are to be set. The parameters
division_limit and age_threshold provide these new values.
@@ -5333,23 +5327,22 @@ int p_resize_key_cache(void *keycache_cb
none
NOTES
- The function just calls s_change_key_cache_param for each element from the
- array of simple caches that comprise the partitioned key cache.
-
+ The function just calls change_simple_key_cache_param for each element from
+ the array of simple caches that comprise the partitioned key cache.
*/
static
-void p_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold)
+void change_partitioned_key_cache_param(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint division_limit,
+ uint age_threshold)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_change_key_cache_param");
+ DBUG_ENTER("partitioned_change_key_cache_param");
for (i= 0; i < partitions; i++)
{
- s_change_key_cache_param(keycache->partition_array[i], division_limit,
- age_threshold);
+ change_simple_key_cache_param(keycache->partition_array[i], division_limit,
+ age_threshold);
}
DBUG_VOID_RETURN;
}
@@ -5359,17 +5352,17 @@ void p_change_key_cache_param(void *keyc
Destroy a partitioned key cache
SYNOPSIS
- p_end_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ end_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
cleanup <=> complete free (free also control block structures
for all simple key caches)
DESCRIPTION
This function is the implementation of the end_key_cache interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the partitioned
- key cache to be destroyed.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the
+ partitioned key cache to be destroyed.
The function frees the memory allocated for the cache blocks and
auxiliary structures used by simple key caches that comprise the
partitioned key cache. If the value of the parameter cleanup is TRUE
@@ -5378,23 +5371,23 @@ void p_change_key_cache_param(void *keyc
RETURN VALUE
none
-
*/
static
-void p_end_key_cache(void *keycache_cb, my_bool cleanup)
+void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ my_bool cleanup)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_end_key_cache");
+ DBUG_ENTER("partitioned_end_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
for (i= 0; i < partitions; i++)
{
- s_end_key_cache(keycache->partition_array[i], cleanup);
+ end_simple_key_cache(keycache->partition_array[i], cleanup);
}
- if (cleanup) {
+ if (cleanup)
+ {
for (i= 0; i < partitions; i++)
my_free((uchar*) keycache->partition_array[i], MYF(0));
my_free((uchar*) keycache->partition_array, MYF(0));
@@ -5409,8 +5402,8 @@ void p_end_key_cache(void *keycache_cb,
SYNOPSIS
- p_key_cache_read()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_read()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file for the block of data to be read
filepos position of the block of data in the file
level determines the weight of the data
@@ -5422,9 +5415,9 @@ void p_end_key_cache(void *keycache_cb,
DESCRIPTION
This function is the implementation of the key_cache_read interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function reads a block of data from the key cache
into the buffer buff of the size specified by the parameter length. The
beginning of the block of data to be read is specified by the parameters
@@ -5432,7 +5425,7 @@ void p_end_key_cache(void *keycache_cb,
of the buffer. The data is read into the buffer in key_cache_block_size
increments. To read each portion the function first finds out in what
partition of the key cache this portion(page) is to be saved, and calls
- s_key_cache_read with the pointer to the corresponding simple key as
+ simple_key_cache_read with the pointer to the corresponding simple key as
its first parameter.
If the parameter return_buffer is not ignored and its value is TRUE, and
the data to be read of the specified size block_length can be read from one
@@ -5445,21 +5438,19 @@ void p_end_key_cache(void *keycache_cb,
RETURN VALUE
Returns address from where the data is placed if successful, 0 - otherwise.
-
*/
static
-uchar *p_key_cache_read(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+uchar *partitioned_key_cache_read(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int return_buffer __attribute__((unused)))
{
uint r_length;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
uchar *start= buff;
- DBUG_ENTER("p_key_cache_read");
+ DBUG_ENTER("partitioned_key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
@@ -5471,15 +5462,15 @@ uchar *p_key_cache_read(void *keycache_c
/* Read data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
- file, filepos);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
+ file, filepos);
uchar *ret_buff= 0;
r_length= length;
set_if_smaller(r_length, keycache->key_cache_block_size - offset);
- ret_buff= s_key_cache_read((void *) partition,
- file, filepos, level,
- buff, r_length,
- block_length, return_buffer);
+ ret_buff= simple_key_cache_read((void *) partition,
+ file, filepos, level,
+ buff, r_length,
+ block_length, return_buffer);
if (ret_buff == 0)
DBUG_RETURN(0);
#ifndef THREAD
@@ -5500,8 +5491,8 @@ uchar *p_key_cache_read(void *keycache_c
Insert a block of file data from a buffer into a partitioned key cache
SYNOPSIS
- p_key_cache_insert()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_insert()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to insert data from
filepos position of the block of data in the file to insert
level determines the weight of the data
@@ -5511,9 +5502,9 @@ uchar *p_key_cache_read(void *keycache_c
DESCRIPTION
This function is the implementation of the key_cache_insert interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned key
- cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
The function writes a block of file data from a buffer into the key cache.
The buffer is specified with the parameters buff and length - the pointer
to the beginning of the buffer and its size respectively. It's assumed
@@ -5521,8 +5512,8 @@ uchar *p_key_cache_read(void *keycache_c
filepos. The data is copied from the buffer in key_cache_block_size
increments. For every portion of data the function finds out in what simple
key cache from the array of partitions the data must be stored, and after
- this calls s_key_cache_insert to copy the data into a key buffer of this
- simple key cache.
+ this calls simple_key_cache_insert to copy the data into a key buffer of
+ this simple key cache.
The parameter level is used to set one characteristic for the key buffers
loaded with the data from buff. The characteristic is used only by the
midpoint insertion strategy.
@@ -5534,18 +5525,16 @@ uchar *p_key_cache_read(void *keycache_c
The function is used by MyISAM to move all blocks from a index file to
the key cache. It can be performed in parallel with reading the file data
from the key buffers by other threads.
-
*/
static
-int p_key_cache_insert(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length)
+int partitioned_key_cache_insert(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length)
{
uint w_length;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
- DBUG_ENTER("p_key_cache_insert");
+ DBUG_ENTER("partitioned_key_cache_insert");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file,(ulong) filepos, length));
@@ -5553,13 +5542,13 @@ int p_key_cache_insert(void *keycache_cb
/* Write data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
- file, filepos);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
+ file, filepos);
w_length= length;
- set_if_smaller(w_length, keycache->key_cache_block_size);
- if (s_key_cache_insert((void *) partition,
- file, filepos, level,
- buff, w_length))
+ set_if_smaller(w_length, keycache->key_cache_block_size - offset);
+ if (simple_key_cache_insert((void *) partition,
+ file, filepos, level,
+ buff, w_length))
DBUG_RETURN(1);
filepos+= w_length;
@@ -5576,8 +5565,8 @@ int p_key_cache_insert(void *keycache_cb
SYNOPSIS
- p_key_cache_write()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_write()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to write data to
filepos position in the file to write data to
level determines the weight of the data
@@ -5591,9 +5580,9 @@ int p_key_cache_insert(void *keycache_cb
DESCRIPTION
This function is the implementation of the key_cache_write interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function copies data from a buffer into the key
cache. The buffer is specified with the parameters buff and length -
the pointer to the beginning of the buffer and its size respectively.
@@ -5601,8 +5590,8 @@ int p_key_cache_insert(void *keycache_cb
starting from the position filepos. The data is copied from the buffer
in key_cache_block_size increments. For every portion of data the
function finds out in what simple key cache from the array of partitions
- the data must be stored, and after this calls s_key_cache_write to copy
- the data into a key buffer of this simple key cache.
+ the data must be stored, and after this calls simple_key_cache_write to
+ copy the data into a key buffer of this simple key cache.
If the value of the parameter dont_write is FALSE then the function
also writes the data into file.
The parameter level is used to set one characteristic for the key buffers
@@ -5610,7 +5599,7 @@ int p_key_cache_insert(void *keycache_cb
the midpoint insertion strategy.
The parameter file_expra provides a pointer to the shared bitmap of
the partitions that may contains dirty pages for the file. This bitmap
- is used to optimize the function p_flush_key_blocks.
+ is used to optimize the function flush_partitioned_key_cache_blocks.
RETURN VALUE
0 if a success, 1 - otherwise.
@@ -5618,22 +5607,20 @@ int p_key_cache_insert(void *keycache_cb
NOTES
This implementation exploits the fact that the function is called only
when a thread has got an exclusive lock for the key file.
-
*/
static
-int p_key_cache_write(void *keycache_cb,
- File file, void *file_extra,
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int dont_write)
+int partitioned_key_cache_write(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int dont_write)
{
uint w_length;
ulonglong *part_map= (ulonglong *) file_extra;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
- DBUG_ENTER("p_key_cache_write");
+ DBUG_ENTER("partitioned_key_cache_write");
DBUG_PRINT("enter",
("fd: %u pos: %lu length: %u block_length: %u"
" key_block_length: %u",
@@ -5644,15 +5631,16 @@ int p_key_cache_write(void *keycache_cb,
/* Write data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition_for_write(keycache,
- file, filepos,
- part_map);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition_for_write(keycache,
+ file,
+ filepos,
+ part_map);
w_length = length;
- set_if_smaller(w_length, keycache->key_cache_block_size );
- if (s_key_cache_write(partition,
- file, 0, filepos, level,
- buff, w_length, block_length,
- dont_write))
+ set_if_smaller(w_length, keycache->key_cache_block_size - offset );
+ if (simple_key_cache_write(partition,
+ file, 0, filepos, level,
+ buff, w_length, block_length,
+ dont_write))
DBUG_RETURN(1);
filepos+= w_length;
@@ -5669,8 +5657,8 @@ int p_key_cache_write(void *keycache_cb,
SYNOPSIS
- p_flush_key_blocks()
- keycache_cb pointer to the control block of a partitioned key cache
+ flush_partitioned_key_cache_blocks()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to flush to
file_extra maps of key cache partitions containing
dirty pages from file (not used)
@@ -5679,9 +5667,9 @@ int p_key_cache_write(void *keycache_cb,
DESCRIPTION
This function is the implementation of the flush_key_blocks interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function flushes the data from all dirty key
buffers related to the file 'file' into this file. The function does
exactly this if the value of the parameter type is FLUSH_KEEP. If the
@@ -5689,12 +5677,12 @@ int p_key_cache_write(void *keycache_cb,
releases the key buffers containing data from 'file' for new usage.
If the value of the parameter type is FLUSH_IGNORE_CHANGED the function
just releases the key buffers containing data from 'file'.
- The function performs the operation by calling s_flush_key_blocks
- for the elements of the array of the simple key caches that comprise
- the partitioned key_cache. If the value of the parameter type is
- FLUSH_KEEP s_flush_key_blocks is called only for the partitions with
- possibly dirty pages marked in the bitmap pointed to by the parameter
- file_extra.
+ The function performs the operation by calling the function
+ flush_simple_key_cache_blocks for the elements of the array of the
+ simple key caches that comprise the partitioned key_cache. If the value
+ of the parameter type is FLUSH_KEEP s_flush_key_blocks is called only
+ for the partitions with possibly dirty pages marked in the bitmap
+ pointed to by the parameter file_extra.
RETURN
0 ok
@@ -5703,35 +5691,30 @@ int p_key_cache_write(void *keycache_cb,
NOTES
This implementation exploits the fact that the function is called only
when a thread has got an exclusive lock for the key file.
-
*/
static
-int p_flush_key_blocks(void *keycache_cb,
- File file, void *file_extra,
- enum flush_type type)
+int flush_partitioned_key_cache_blocks(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, void *file_extra,
+ enum flush_type type)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
int err= 0;
ulonglong *dirty_part_map= (ulonglong *) file_extra;
- DBUG_ENTER("p_flush_key_blocks");
+ DBUG_ENTER("partitioned_flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
for (i= 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
if ((type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE) &&
- !((*dirty_part_map) & (1<<i)))
+ !((*dirty_part_map) & ((ulonglong) 1 << i)))
continue;
- err+= test(s_flush_key_blocks(partition, file, 0, type));
+ err|= test(flush_simple_key_cache_blocks(partition, file, 0, type));
}
*dirty_part_map= 0;
- if (err > 0)
- err= 1;
-
DBUG_RETURN(err);
}
@@ -5740,38 +5723,36 @@ int p_flush_key_blocks(void *keycache_cb
Reset the counters of a partitioned key cache
SYNOPSIS
- p_reset_key_cache_counters()
+ reset_partitioned_key_cache_counters()
name the name of a key cache
- keycache_cb pointer to the control block of a partitioned key cache
+ keycache pointer to the control block of a partitioned key cache
DESCRIPTION
This function is the implementation of the reset_key_cache_counters
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a partitioned
key cache.
This function resets the values of the statistical counters of the simple
key caches comprising partitioned key cache to 0. It does it by calling
- s_reset_key_cache_counters for each key cache partition.
+ reset_simple_key_cache_counters for each key cache partition.
The parameter name is currently not used.
RETURN
0 on success (always because it can't fail)
-
*/
-static
-int p_reset_key_cache_counters(const char *name __attribute__((unused)),
- void *keycache_cb)
+static int
+reset_partitioned_key_cache_counters(const char *name __attribute__((unused)),
+ PARTITIONED_KEY_CACHE_CB *keycache)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_reset_key_cache_counters");
+ DBUG_ENTER("partitioned_reset_key_cache_counters");
for (i = 0; i < partitions; i++)
{
- s_reset_key_cache_counters(name, keycache->partition_array[i]);
+ reset_simple_key_cache_counters(name, keycache->partition_array[i]);
}
DBUG_RETURN(0);
}
@@ -5781,17 +5762,17 @@ int p_reset_key_cache_counters(const cha
Get statistics for a partition key cache
SYNOPSIS
- p_get_key_cache_statistics()
- keycache_cb pointer to the control block of a partitioned key cache
+ get_partitioned_key_cache_statistics()
+ keycache pointer to the control block of a partitioned key cache
partition_no partition number to get statistics for
key_cache_stats OUT pointer to the structure for the returned statistics
DESCRIPTION
This function is the implementation of the get_key_cache_statistics
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for
+ a partitioned key cache.
If the value of the parameter partition_no is equal to 0 then aggregated
statistics for all partitions is returned in the fields of the
structure key_cache_stat of the type KEY_CACHE_STATISTICS . Otherwise
@@ -5801,37 +5782,38 @@ int p_reset_key_cache_counters(const cha
RETURN
none
-
*/
static
-void p_get_key_cache_statistics(void *keycache_cb, uint partition_no,
- KEY_CACHE_STATISTICS *key_cache_stats)
+void
+get_partitioned_key_cache_statistics(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint partition_no,
+ KEY_CACHE_STATISTICS *keycache_stats)
{
uint i;
- S_KEY_CACHE_CB *partition;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
+ SIMPLE_KEY_CACHE_CB *partition;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_get_key_cache_statistics_");
+ DBUG_ENTER("get_partitioned_key_cache_statistics");
if (partition_no != 0)
{
partition= keycache->partition_array[partition_no-1];
- s_get_key_cache_statistics((void *) partition, 0, key_cache_stats);
+ get_simple_key_cache_statistics((void *) partition, 0, keycache_stats);
DBUG_VOID_RETURN;
}
- key_cache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
- key_cache_stats->block_size= (longlong) keycache->key_cache_block_size;
+ bzero(keycache_stats, sizeof(KEY_CACHE_STATISTICS));
+ keycache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
+ keycache_stats->block_size= (longlong) keycache->key_cache_block_size;
for (i = 0; i < partitions; i++)
{
partition= keycache->partition_array[i];
- key_cache_stats->blocks_used+= partition->blocks_used;
- key_cache_stats->blocks_unused+= partition->blocks_unused;
- key_cache_stats->blocks_changed+= partition->global_blocks_changed;
- key_cache_stats->read_requests+= partition->global_cache_r_requests;
- key_cache_stats->reads+= partition->global_cache_read;
- key_cache_stats->write_requests+= partition->global_cache_w_requests;
- key_cache_stats->writes+= partition->global_cache_write;
+ keycache_stats->blocks_used+= partition->blocks_used;
+ keycache_stats->blocks_unused+= partition->blocks_unused;
+ keycache_stats->blocks_changed+= partition->global_blocks_changed;
+ keycache_stats->read_requests+= partition->global_cache_r_requests;
+ keycache_stats->reads+= partition->global_cache_read;
+ keycache_stats->write_requests+= partition->global_cache_w_requests;
+ keycache_stats->writes+= partition->global_cache_write;
}
DBUG_VOID_RETURN;
}
@@ -5840,16 +5822,16 @@ void p_get_key_cache_statistics(void *ke
Get the value of a statistical variable for a partitioned key cache
SYNOPSIS
- p_get_key_cache_stat_value()
- keycache_cb pointer to the control block of a partitioned key cache
+ get_partitioned_key_cache_stat_value()
+ keycache pointer to the control block of a partitioned key cache
var_no the ordered number of a statistical variable
DESCRIPTION
This function is the implementation of the get_key_cache_stat_value
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
This function returns the value of the statistical variable var_no
for this key cache. The variables are numbered starting from 0 to 6.
The returned value is calculated as the sum of the values of the
@@ -5858,24 +5840,24 @@ void p_get_key_cache_statistics(void *ke
RETURN
The value of the specified statistical variable
-
*/
static
-ulonglong p_get_key_cache_stat_value(void *keycache_cb, uint var_no)
+ulonglong
+get_partitioned_key_cache_stat_value(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint var_no)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- size_t var_ofs= s_key_cache_stat_var_offsets[var_no];
+ size_t var_ofs= simple_key_cache_stat_var_offsets[var_no];
ulonglong res= 0;
- DBUG_ENTER("p_get_key_cache_stat_value");
+ DBUG_ENTER("get_partitioned_key_cache_stat_value");
- if (var_no < 3)
+ if (var_no < NO_LONG_KEY_CACHE_STAT_VARIABLES)
{
for (i = 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
res+= (ulonglong) (*(long *) ((char *) partition + var_ofs));
}
}
@@ -5883,7 +5865,7 @@ ulonglong p_get_key_cache_stat_value(voi
{
for (i = 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
res+= *(ulonglong *) ((char *) partition + var_ofs);
}
}
@@ -5901,19 +5883,19 @@ ulonglong p_get_key_cache_stat_value(voi
wrappers must be used for this purpose.
*/
-static KEY_CACHE_FUNCS p_key_cache_funcs =
+static KEY_CACHE_FUNCS partitioned_key_cache_funcs =
{
- p_init_key_cache,
- p_resize_key_cache,
- p_change_key_cache_param,
- p_key_cache_read,
- p_key_cache_insert,
- p_key_cache_write,
- p_flush_key_blocks,
- p_reset_key_cache_counters,
- p_end_key_cache,
- p_get_key_cache_statistics,
- p_get_key_cache_stat_value
+ (INIT_KEY_CACHE) init_partitioned_key_cache,
+ (RESIZE_KEY_CACHE) resize_partitioned_key_cache,
+ (CHANGE_KEY_CACHE_PARAM) change_partitioned_key_cache_param,
+ (KEY_CACHE_READ) partitioned_key_cache_read,
+ (KEY_CACHE_INSERT) partitioned_key_cache_insert,
+ (KEY_CACHE_WRITE) partitioned_key_cache_write,
+ (FLUSH_KEY_BLOCKS) flush_partitioned_key_cache_blocks,
+ (RESET_KEY_CACHE_COUNTERS) reset_partitioned_key_cache_counters,
+ (END_KEY_CACHE) end_partitioned_key_cache,
+ (GET_KEY_CACHE_STATISTICS) get_partitioned_key_cache_statistics,
+ (GET_KEY_CACHE_STAT_VALUE) get_partitioned_key_cache_stat_value
};
@@ -5926,12 +5908,12 @@ static KEY_CACHE_FUNCS p_key_cache_funcs
partitioned key caches. Each type (class) has its own implementation of the
basic key cache operations used the MyISAM storage engine. The pointers
to the implementation functions are stored in two static structures of the
- type KEY_CACHE_FUNC: s_key_cache_funcs - for simple key caches, and
- p_key_cache_funcs - for partitioned key caches. When a key cache object is
- created the constructor procedure init_key_cache places a pointer to the
- corresponding table into one of its fields. The procedure also initializes
- a control block for the key cache oject and saves the pointer to this
- block in another field of the key cache object.
+ type KEY_CACHE_FUNC: simple_key_cache_funcs - for simple key caches, and
+ partitioned_key_cache_funcs - for partitioned key caches. When a key cache
+ object is created the constructor procedure init_key_cache places a pointer
+ to the corresponding table into one of its fields. The procedure also
+ initializes a control block for the key cache oject and saves the pointer
+ to this block in another field of the key cache object.
When a key cache wrapper function is invoked for a key cache object to
perform a basic key cache operation it looks into the interface table
associated with the key cache oject and calls the corresponding
@@ -5982,7 +5964,6 @@ static KEY_CACHE_FUNCS p_key_cache_funcs
It's assumed that no two threads call this function simultaneously
referring to the same key cache handle.
-
*/
int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
@@ -5997,19 +5978,21 @@ int init_key_cache(KEY_CACHE *keycache,
{
if (partitions == 0)
{
- if (!(keycache_cb= (void *) my_malloc(sizeof(S_KEY_CACHE_CB), MYF(0))))
+ if (!(keycache_cb= (void *) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB),
+ MYF(0))))
return 0;
- ((S_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
+ ((SIMPLE_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
keycache->key_cache_type= SIMPLE_KEY_CACHE;
- keycache->interface_funcs= &s_key_cache_funcs;
+ keycache->interface_funcs= &simple_key_cache_funcs;
}
else
{
- if (!(keycache_cb= (void *) my_malloc(sizeof(P_KEY_CACHE_CB), MYF(0))))
+ if (!(keycache_cb= (void *) my_malloc(sizeof(PARTITIONED_KEY_CACHE_CB),
+ MYF(0))))
return 0;
- ((P_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
keycache->key_cache_type= PARTITIONED_KEY_CACHE;
- keycache->interface_funcs= &p_key_cache_funcs;
+ keycache->interface_funcs= &partitioned_key_cache_funcs;
}
keycache->keycache_cb= keycache_cb;
keycache->key_cache_inited= 1;
@@ -6017,14 +6000,15 @@ int init_key_cache(KEY_CACHE *keycache,
if (partitions != 0)
{
- ((P_KEY_CACHE_CB *) keycache_cb)->partitions= partitions;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->partitions= partitions;
}
keycache->can_be_used= 0;
blocks= keycache->interface_funcs->init(keycache_cb, key_cache_block_size,
use_mem, division_limit,
age_threshold);
keycache->partitions= partitions ?
- ((P_KEY_CACHE_CB *) keycache_cb)->partitions : 0;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->partitions :
+ 0;
DBUG_ASSERT(partitions <= MAX_KEY_CACHE_PARTITIONS);
if (blocks > 0)
keycache->can_be_used= 1;
@@ -6037,7 +6021,7 @@ int init_key_cache(KEY_CACHE *keycache,
SYNOPSIS
resize_key_cache()
- keycache pointer to the key cache to be resized
+ keycache pointer to the key cache to be resized
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for the new key cache
division_limit new division limit (if not zero)
@@ -6064,7 +6048,6 @@ int init_key_cache(KEY_CACHE *keycache,
Currently the function is called when the values of the variables
key_buffer_size and/or key_cache_block_size are being reset for
the key cache keycache.
-
*/
int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
@@ -6074,10 +6057,10 @@ int resize_key_cache(KEY_CACHE *keycache
if (keycache->key_cache_inited)
{
if ((uint) keycache->param_partitions != keycache->partitions && use_mem)
- blocks= repartition_key_cache (keycache,
- key_cache_block_size, use_mem,
- division_limit, age_threshold,
- (uint) keycache->param_partitions);
+ blocks= repartition_key_cache(keycache,
+ key_cache_block_size, use_mem,
+ division_limit, age_threshold,
+ (uint) keycache->param_partitions);
else
{
blocks= keycache->interface_funcs->resize(keycache->keycache_cb,
@@ -6087,10 +6070,10 @@ int resize_key_cache(KEY_CACHE *keycache
if (keycache->partitions)
keycache->partitions=
- ((P_KEY_CACHE_CB *)(keycache->keycache_cb))->partitions;
+ ((PARTITIONED_KEY_CACHE_CB *)(keycache->keycache_cb))->partitions;
}
- if (blocks <= 0)
- keycache->can_be_used= 0;
+
+ keycache->can_be_used= (blocks >= 0);
}
return blocks;
}
@@ -6117,7 +6100,6 @@ int resize_key_cache(KEY_CACHE *keycache
Currently the function is called when the values of the variables
key_cache_division_limit and/or key_cache_age_threshold are being reset
for the key cache keycache.
-
*/
void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
@@ -6262,7 +6244,6 @@ uchar *key_cache_read(KEY_CACHE *keycach
the key cache.
It is assumed that it may be performed in parallel with reading the file
data from the key buffers by other threads.
-
*/
int key_cache_insert(KEY_CACHE *keycache,
@@ -6316,7 +6297,6 @@ int key_cache_insert(KEY_CACHE *keycache
NOTES
This implementation may exploit the fact that the function is called only
when a thread has got an exclusive lock for the key file.
-
*/
int key_cache_write(KEY_CACHE *keycache,
@@ -6373,7 +6353,6 @@ int key_cache_write(KEY_CACHE *keycache,
NOTES
Any implementation of the function may exploit the fact that the function
is called only when a thread has got an exclusive lock for the key file.
-
*/
int flush_key_blocks(KEY_CACHE *keycache,
@@ -6406,7 +6385,6 @@ int flush_key_blocks(KEY_CACHE *keycache
NOTES
This procedure is used by process_key_caches() to reset the counters of all
currently used key caches, both the default one and the named ones.
-
*/
int reset_key_cache_counters(const char *name __attribute__((unused)),
@@ -6441,13 +6419,11 @@ int reset_key_cache_counters(const char
RETURN
none
-
*/
void get_key_cache_statistics(KEY_CACHE *keycache, uint partition_no,
KEY_CACHE_STATISTICS *key_cache_stats)
{
- bzero(key_cache_stats, sizeof(KEY_CACHE_STATISTICS));
if (keycache->key_cache_inited)
{
keycache->interface_funcs->get_stats(keycache->keycache_cb,
@@ -6484,7 +6460,6 @@ void get_key_cache_statistics(KEY_CACHE
reads 4
write_requests 5
writes 6
-
*/
ulonglong get_key_cache_stat_value(KEY_CACHE *keycache, uint var_no)
@@ -6534,7 +6509,6 @@ ulonglong get_key_cache_stat_value(KEY_C
Currently the function is called when the value of the variable
key_cache_partitions is being reset for the key cache keycache.
-
*/
int repartition_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-03-29 21:16:12 +0000
+++ b/sql/sql_show.cc 2010-04-01 21:42:40 +0000
@@ -2235,8 +2235,9 @@ static void update_key_cache_stat_var(KE
case offsetof(KEY_CACHE, global_cache_read):
case offsetof(KEY_CACHE, global_cache_w_requests):
case offsetof(KEY_CACHE, global_cache_write):
- var_no= 3+(ofs-offsetof(KEY_CACHE, global_cache_w_requests))/
- sizeof(ulonglong);
+ var_no= NO_LONG_KEY_CACHE_STAT_VARIABLES +
+ (ofs-offsetof(KEY_CACHE, global_cache_w_requests))/
+ sizeof(ulonglong);
*(ulonglong *)((char *) key_cache + ofs)=
get_key_cache_stat_value(key_cache, var_no);
break;
@@ -6643,13 +6644,13 @@ int store_key_cache_table_record(THD *th
KEY_CACHE *key_cache,
uint partitions, uint partition_no)
{
- KEY_CACHE_STATISTICS key_cache_stats;
+ KEY_CACHE_STATISTICS keycache_stats;
uint err;
DBUG_ENTER("store_key_cache_table_record");
- get_key_cache_statistics(key_cache, partition_no, &key_cache_stats);
+ get_key_cache_statistics(key_cache, partition_no, &keycache_stats);
- if (key_cache_stats.mem_size == 0)
+ if (!key_cache->key_cache_inited || keycache_stats.mem_size == 0)
DBUG_RETURN(0);
restore_record(table, s->default_values);
@@ -6669,15 +6670,15 @@ int store_key_cache_table_record(THD *th
table->field[2]->set_notnull();
table->field[2]->store((long) partition_no, TRUE);
}
- table->field[3]->store(key_cache_stats.mem_size, TRUE);
- table->field[4]->store(key_cache_stats.block_size, TRUE);
- table->field[5]->store(key_cache_stats.blocks_used, TRUE);
- table->field[6]->store(key_cache_stats.blocks_unused, TRUE);
- table->field[7]->store(key_cache_stats.blocks_changed, TRUE);
- table->field[8]->store(key_cache_stats.read_requests, TRUE);
- table->field[9]->store(key_cache_stats.reads, TRUE);
- table->field[10]->store(key_cache_stats.write_requests, TRUE);
- table->field[11]->store(key_cache_stats.writes, TRUE);
+ table->field[3]->store(keycache_stats.mem_size, TRUE);
+ table->field[4]->store(keycache_stats.block_size, TRUE);
+ table->field[5]->store(keycache_stats.blocks_used, TRUE);
+ table->field[6]->store(keycache_stats.blocks_unused, TRUE);
+ table->field[7]->store(keycache_stats.blocks_changed, TRUE);
+ table->field[8]->store(keycache_stats.read_requests, TRUE);
+ table->field[9]->store(keycache_stats.reads, TRUE);
+ table->field[10]->store(keycache_stats.write_requests, TRUE);
+ table->field[11]->store(keycache_stats.writes, TRUE);
err= schema_table_store_record(thd, table);
DBUG_RETURN(err);
1
0
[Maria-developers] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (igor:2747)
by Igor Babaev 01 Apr '10
by Igor Babaev 01 Apr '10
01 Apr '10
#At lp:maria/5.2 based on revid:igor@askmonty.org-20100331233728-obczp1ecrffnaa2s
2747 Igor Babaev 2010-04-01
Post-review fixes.
modified:
include/keycache.h
mysql-test/r/key_cache.result
mysql-test/t/key_cache.test
mysys/mf_keycache.c
sql/sql_show.cc
=== modified file 'include/keycache.h'
--- a/include/keycache.h 2010-02-16 16:41:11 +0000
+++ b/include/keycache.h 2010-04-01 21:26:08 +0000
@@ -37,7 +37,6 @@ C_MODE_START
#define MAX_KEY_CACHE_PARTITIONS 64
-
/* The structure to get statistical data about a key cache */
typedef struct st_key_cache_statistics
@@ -53,6 +52,8 @@ typedef struct st_key_cache_statistics
ulonglong writes; /* number of actual writes from buffers into files */
} KEY_CACHE_STATISTICS;
+#define NO_LONG_KEY_CACHE_STAT_VARIABLES 3
+
/* The type of a key cache object */
typedef enum key_cache_type
{
@@ -61,6 +62,55 @@ typedef enum key_cache_type
} KEY_CACHE_TYPE;
+typedef
+ int (*INIT_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ int (*RESIZE_KEY_CACHE)
+ (void *, uint key_cache_block_size,
+ size_t use_mem, uint division_limit, uint age_threshold);
+typedef
+ void (*CHANGE_KEY_CACHE_PARAM)
+ (void *keycache_cb,
+ uint division_limit, uint age_threshold);
+typedef
+ uchar* (*KEY_CACHE_READ)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int return_buffer);
+typedef
+ int (*KEY_CACHE_INSERT)
+ (void *keycache_cb,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length);
+typedef
+ int (*KEY_CACHE_WRITE)
+ (void *keycache_cb,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length, int force_write);
+typedef
+ int (*FLUSH_KEY_BLOCKS)
+ (void *keycache_cb,
+ int file, void *file_extra,
+ enum flush_type type);
+typedef
+ int (*RESET_KEY_CACHE_COUNTERS)
+ (const char *name, void *keycache_cb);
+typedef
+ void (*END_KEY_CACHE)
+ (void *keycache_cb, my_bool cleanup);
+typedef
+ void (*GET_KEY_CACHE_STATISTICS)
+ (void *keycache_cb, uint partition_no,
+ KEY_CACHE_STATISTICS *key_cache_stats);
+typedef
+ ulonglong (*GET_KEY_CACHE_STAT_VALUE)
+ (void *keycache_cb, uint var_no);
+
/*
An object of the type KEY_CACHE_FUNCS contains pointers to all functions
from the key cache interface.
@@ -74,32 +124,17 @@ typedef enum key_cache_type
typedef struct st_key_cache_funcs
{
- int (*init) (void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
- int (*resize) (void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
- void (*change_param) (void *keycache_cb,
- uint division_limit, uint age_threshold);
- uchar* (*read) (void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length, int return_buffer);
- int (*insert) (void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length);
- int (*write) (void *keycache_cb,
- File file, void *file_extra,
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length, int force_write);
- int (*flush) (void *keycache_cb,
- int file, void *file_extra,
- enum flush_type type);
- int (*reset_counters) (const char *name, void *keycache_cb);
- void (*end) (void *keycache_cb, my_bool cleanup);
- void (*get_stats) (void *keycache_cb, uint partition_no,
- KEY_CACHE_STATISTICS *key_cache_stats);
- ulonglong (*get_stat_val) (void *keycache_cb, uint var_no);
+ INIT_KEY_CACHE init;
+ RESIZE_KEY_CACHE resize;
+ CHANGE_KEY_CACHE_PARAM change_param;
+ KEY_CACHE_READ read;
+ KEY_CACHE_INSERT insert;
+ KEY_CACHE_WRITE write;
+ FLUSH_KEY_BLOCKS flush;
+ RESET_KEY_CACHE_COUNTERS reset_counters;
+ END_KEY_CACHE end;
+ GET_KEY_CACHE_STATISTICS get_stats;
+ GET_KEY_CACHE_STAT_VALUE get_stat_val;
} KEY_CACHE_FUNCS;
=== modified file 'mysql-test/r/key_cache.result'
--- a/mysql-test/r/key_cache.result 2010-03-31 23:37:28 +0000
+++ b/mysql-test/r/key_cache.result 2010-04-01 21:26:08 +0000
@@ -672,12 +672,12 @@ insert into t2 values (2000, 3, 'yyyy');
select * from information_schema.key_caches where key_cache_name like "keycache2"
and partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
-keycache2 NULL NULL 1048576 1024 0 # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
-keycache2 NULL NULL 1048576 1024 0 # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
cache index t2 in keycache1;
Table Op Msg_type Msg_text
test.t2 assign_to_keycache status OK
@@ -718,7 +718,7 @@ KEY_CACHE_NAME PARTITIONS PARTITION_NUMB
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 3201 43 1594 30
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024;
insert into t2 values (7000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
@@ -726,66 +726,72 @@ KEY_CACHE_NAME PARTITIONS PARTITION_NUMB
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 6 6 3 3
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
+select * from information_schema.key_caches where partition_number is null;
+KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
+default 2 NULL 32768 1024 # # 0 3172 24 1552 18
+small NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache1 3 NULL 262143 8192 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
insert into t2 values (8000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 262143 8192 # # 0 6 5 3 3
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=64*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 65535 2048 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=128*1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 1 NULL 131072 8192 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=1024;
select * from information_schema.key_caches where partition_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 131068 1024 # # 0 0 0 0 0
-keycache2 NULL NULL 1048576 1024 # # 0 0 0 0 0
+keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
drop table t1,t2;
set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0;
=== modified file 'mysql-test/t/key_cache.test'
--- a/mysql-test/t/key_cache.test 2010-03-31 23:37:28 +0000
+++ b/mysql-test/t/key_cache.test 2010-04-01 21:26:08 +0000
@@ -469,6 +469,8 @@ insert into t2 values (7000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null;
set global keycache1.key_cache_block_size=8*1024;
+--replace_column 6 # 7 #
+select * from information_schema.key_caches where partition_number is null;
insert into t2 values (8000, 3, 'yyyy');
--replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null;
=== modified file 'mysys/mf_keycache.c'
--- a/mysys/mf_keycache.c 2010-02-16 16:41:11 +0000
+++ b/mysys/mf_keycache.c 2010-04-01 21:26:08 +0000
@@ -49,6 +49,7 @@
One cache can handle many files.
It must contain buffers of the same blocksize.
+
init_key_cache() should be used to init cache handler.
The free list (free_block_list) is a stack like structure.
@@ -151,7 +152,7 @@ typedef struct st_keycache_wqueue
/* Control block for a simple (non-partitioned) key cache */
-typedef struct st_s_key_cache_cb
+typedef struct st_simple_key_cache_cb
{
my_bool key_cache_inited; /* <=> control block is allocated */
my_bool in_resize; /* true during resize operation */
@@ -202,7 +203,7 @@ typedef struct st_s_key_cache_cb
int blocks; /* max number of blocks in the cache */
uint hash_factor; /* factor used to calculate hash function */
my_bool in_init; /* Set to 1 in MySQL during init/resize */
-} S_KEY_CACHE_CB;
+} SIMPLE_KEY_CACHE_CB;
/*
Some compilation flags have been added specifically for this module
@@ -314,12 +315,8 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cac
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
-static int flush_all_key_blocks(S_KEY_CACHE_CB *keycache);
-/*
-static void s_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold);
-*/
-static void s_end_key_cache(void *keycache_cb, my_bool cleanup);
+static int flush_all_key_blocks(SIMPLE_KEY_CACHE_CB *keycache);
+static void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup);
#ifdef THREAD
static void wait_on_queue(KEYCACHE_WQUEUE *wqueue,
pthread_mutex_t *mutex);
@@ -328,9 +325,9 @@ static void release_whole_queue(KEYCACHE
#define wait_on_queue(wqueue, mutex) do {} while (0)
#define release_whole_queue(wqueue) do {} while (0)
#endif
-static void free_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block);
+static void free_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block);
#if !defined(DBUG_OFF)
-static void test_key_cache(S_KEY_CACHE_CB *keycache,
+static void test_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
const char *where, my_bool lock);
#endif
#define KEYCACHE_BASE_EXPR(f, pos) \
@@ -433,7 +430,7 @@ static int keycache_pthread_cond_signal(
#define inline /* disabled inline for easier debugging */
static int fail_block(BLOCK_LINK *block);
static int fail_hlink(HASH_LINK *hlink);
-static int cache_empty(S_KEY_CACHE_CB *keycache);
+static int cache_empty(SIMPLE_KEY_CACHE_CB *keycache);
#endif
@@ -447,8 +444,8 @@ static inline uint next_power(uint value
Initialize a simple key cache
SYNOPSIS
- s_init_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ init_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
key_cache_block_size size of blocks to keep cached data
use_mem memory to use for the key cache buferrs/structures
division_limit division limit (may be zero)
@@ -458,8 +455,8 @@ static inline uint next_power(uint value
This function is the implementation of the init_key_cache interface
function that is employed by simple (non-partitioned) key caches.
The function builds a simple key cache and initializes the control block
- structure of the type S_KEY_CACHE_CB that is used for this key cache.
- The parameter keycache_cb is supposed to point to this structure.
+ structure of the type SIMPLE_KEY_CACHE_CB that is used for this key cache.
+ The parameter keycache is supposed to point to this structure.
The parameter key_cache_block_size specifies the size of the blocks in
the key cache to be built. The parameters division_limit and age_threshhold
determine the initial values of those characteristics of the key cache
@@ -478,19 +475,17 @@ static inline uint next_power(uint value
It's assumed that no two threads call this function simultaneously
referring to the same key cache handle.
-
*/
static
-int s_init_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int init_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
ulong blocks, hash_links;
size_t length;
int error;
- DBUG_ENTER("init_key_cache");
+ DBUG_ENTER("init_simple_key_cache");
DBUG_ASSERT(key_cache_block_size >= 512);
KEYCACHE_DEBUG_OPEN;
@@ -653,16 +648,16 @@ err:
Prepare for resizing a simple key cache
SYNOPSIS
- s_prepare_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ prepare_resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
with_resize_queue <=> resize queue is used
release_lock <=> release the key cache lock before return
DESCRIPTION
This function flushes all dirty pages from a simple key cache and after
- this it destroys the key cache calling s_end_key_cache. The function
- considers the parameter keycache_cb as a pointer to the control block
- structure of the type S_KEY_CACHE_CB for this key cache.
+ this it destroys the key cache calling end_simple_key_cache. The function
+ takes the parameter keycache as a pointer to the control block
+ structure of the type SIMPLE_KEY_CACHE_CB for this key cache.
The parameter with_resize_queue determines weather the resize queue is
involved (MySQL server never uses this queue). The parameter release_lock
says weather the key cache lock must be released before return from
@@ -673,19 +668,18 @@ err:
1 - otherwise.
NOTES
- This function is the called by s_resize_key_cache and p_resize_key_cache
- that resize simple and partitioned key caches respectively.
-
+ This function is the called by resize_simple_key_cache and
+ resize_partitioned_key_cache that resize simple and partitioned key caches
+ respectively.
*/
static
-int s_prepare_resize_key_cache(void *keycache_cb,
- my_bool with_resize_queue,
- my_bool release_lock)
+int prepare_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
+ my_bool with_resize_queue,
+ my_bool release_lock)
{
int res= 0;
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_prepare_resize_key_cache");
+ DBUG_ENTER("prepare_resize_simple_key_cache");
keycache_pthread_mutex_lock(&keycache->cache_lock);
@@ -749,7 +743,7 @@ int s_prepare_resize_key_cache(void *key
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
#endif
- s_end_key_cache(keycache_cb, 0);
+ end_simple_key_cache(keycache, 0);
finish:
if (release_lock)
@@ -762,16 +756,16 @@ finish:
Finalize resizing a simple key cache
SYNOPSIS
- s_finish_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ finish_resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
with_resize_queue <=> resize queue is used
acquire_lock <=> acquire the key cache lock at start
DESCRIPTION
This function performs finalizing actions for the operation of
- resizing a simple key cache. The function considers the parameter
- keycache_cb as a pointer to the control block structure of the type
- S_KEY_CACHE_CB for this key cache. The function sets the flag
+ resizing a simple key cache. The function takes the parameter
+ keycache as a pointer to the control block structure of the type
+ SIMPLE_KEY_CACHE_CB for this key cache. The function sets the flag
in_resize in this structure to FALSE.
The parameter with_resize_queue determines weather the resize queue
is involved (MySQL server never uses this queue).
@@ -782,22 +776,24 @@ finish:
none
NOTES
- This function is the called by s_resize_key_cache and p_resize_key_cache
- that resize simple and partitioned key caches respectively.
+ This function is the called by resize_simple_key_cache and
+ resize_partitioned_key_cache that resize simple and partitioned key caches
+ respectively.
*/
static
-void s_finish_resize_key_cache(void *keycache_cb,
- my_bool with_resize_queue,
- my_bool acquire_lock)
+void finish_resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache,
+ my_bool with_resize_queue,
+ my_bool acquire_lock)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_finish_resize_key_cache");
+ DBUG_ENTER("finish_resize_simple_key_cache");
if (acquire_lock)
keycache_pthread_mutex_lock(&keycache->cache_lock);
-
+
+ safe_mutex_assert_owner(&keycache->cache_lock);
+
/*
Mark the resize finished. This allows other threads to start a
resize or to request new cache blocks.
@@ -820,8 +816,8 @@ void s_finish_resize_key_cache(void *key
Resize a simple key cache
SYNOPSIS
- s_resize_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ resize_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
key_cache_block_size size of blocks to keep cached data
use_mem memory to use for the key cache buffers/structures
division_limit new division limit (if not zero)
@@ -830,8 +826,8 @@ void s_finish_resize_key_cache(void *key
DESCRIPTION
This function is the implementation of the resize_key_cache interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache to be resized.
The parameter key_cache_block_size specifies the new size of the blocks in
the key cache. The parameters division_limit and age_threshold
@@ -845,14 +841,14 @@ void s_finish_resize_key_cache(void *key
0 - otherwise.
NOTES.
- The function first calls the function s_prepare_resize_key_cache
+ The function first calls the function prepare_resize_simple_key_cache
to flush all dirty blocks from key cache, to free memory used
for key cache blocks and auxiliary structures. After this the
function builds a new key cache with new parameters.
This implementation doesn't block the calls and executions of other
functions from the key cache interface. However it assumes that the
- calls of s_resize_key_cache itself are serialized.
+ calls of resize_simple_key_cache itself are serialized.
The function starts the operation only when all other threads
performing operations with the key cache let her to proceed
@@ -861,31 +857,30 @@ void s_finish_resize_key_cache(void *key
*/
static
-int s_resize_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int resize_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int blocks= 0;
- DBUG_ENTER("s_resize_key_cache");
+ DBUG_ENTER("resize_simple_key_cache");
if (!keycache->key_cache_inited)
- DBUG_RETURN(keycache->disk_blocks);
+ DBUG_RETURN(blocks);
/*
Note that the cache_lock mutex and the resize_queue are left untouched.
We do not lose the cache_lock and will release it only at the end of
this function.
*/
- if (s_prepare_resize_key_cache(keycache_cb, 1, 0))
+ if (prepare_resize_simple_key_cache(keycache, 1, 0))
goto finish;
/* The following will work even if use_mem is 0 */
- blocks= s_init_key_cache(keycache, key_cache_block_size, use_mem,
- division_limit, age_threshold);
+ blocks= init_simple_key_cache(keycache, key_cache_block_size, use_mem,
+ division_limit, age_threshold);
finish:
- s_finish_resize_key_cache(keycache_cb, 1, 0);
+ finish_resize_simple_key_cache(keycache, 1, 0);
DBUG_RETURN(blocks);
}
@@ -894,7 +889,7 @@ finish:
/*
Increment counter blocking resize key cache operation
*/
-static inline void inc_counter_for_resize_op(S_KEY_CACHE_CB *keycache)
+static inline void inc_counter_for_resize_op(SIMPLE_KEY_CACHE_CB *keycache)
{
keycache->cnt_for_resize_op++;
}
@@ -904,7 +899,7 @@ static inline void inc_counter_for_resiz
Decrement counter blocking resize key cache operation;
Signal the operation to proceed when counter becomes equal zero
*/
-static inline void dec_counter_for_resize_op(S_KEY_CACHE_CB *keycache)
+static inline void dec_counter_for_resize_op(SIMPLE_KEY_CACHE_CB *keycache)
{
if (!--keycache->cnt_for_resize_op)
release_whole_queue(&keycache->waiting_for_resize_cnt);
@@ -915,16 +910,16 @@ static inline void dec_counter_for_resiz
Change key cache parameters of a simple key cache
SYNOPSIS
- s_change_key_cache_param()
- keycache_cb pointer to the control block of a simple key cache
+ change_simple_key_cache_param()
+ keycache pointer to the control block of a simple key cache
division_limit new division limit (if not zero)
age_threshold new age threshold (if not zero)
DESCRIPTION
This function is the implementation of the change_key_cache_param interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache where new values of the division limit and the age threshold used
for midpoint insertion strategy are to be set. The parameters
division_limit and age_threshold provide these new values.
@@ -942,11 +937,10 @@ static inline void dec_counter_for_resiz
*/
static
-void s_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold)
+void change_simple_key_cache_param(SIMPLE_KEY_CACHE_CB *keycache, uint division_limit,
+ uint age_threshold)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_change_key_cache_param");
+ DBUG_ENTER("change_simple_key_cache_param");
keycache_pthread_mutex_lock(&keycache->cache_lock);
if (division_limit)
keycache->min_warm_blocks= (keycache->disk_blocks *
@@ -963,15 +957,15 @@ void s_change_key_cache_param(void *keyc
Destroy a simple key cache
SYNOPSIS
- s_end_key_cache()
- keycache_cb pointer to the control block of a simple key cache
+ end_simple_key_cache()
+ keycache pointer to the control block of a simple key cache
cleanup <=> complete free (free also mutex for key cache)
DESCRIPTION
This function is the implementation of the end_key_cache interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for the simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for the simple key
cache to be destroyed.
The function frees the memory allocated for the key cache blocks and
auxiliary structures. If the value of the parameter cleanup is TRUE
@@ -982,10 +976,9 @@ void s_change_key_cache_param(void *keyc
*/
static
-void s_end_key_cache(void *keycache_cb, my_bool cleanup)
+void end_simple_key_cache(SIMPLE_KEY_CACHE_CB *keycache, my_bool cleanup)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_end_key_cache");
+ DBUG_ENTER("end_simple_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
if (!keycache->key_cache_inited)
@@ -1276,7 +1269,7 @@ static inline void link_changed(BLOCK_LI
void
*/
-static void link_to_file_list(S_KEY_CACHE_CB *keycache,
+static void link_to_file_list(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, int file,
my_bool unlink_block)
{
@@ -1317,7 +1310,7 @@ static void link_to_file_list(S_KEY_CACH
void
*/
-static void link_to_changed_list(S_KEY_CACHE_CB *keycache,
+static void link_to_changed_list(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block)
{
DBUG_ASSERT(block->status & BLOCK_IN_USE);
@@ -1372,8 +1365,8 @@ static void link_to_changed_list(S_KEY_C
not linked in the LRU ring.
*/
-static void link_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block, my_bool hot,
- my_bool at_end)
+static void link_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block,
+ my_bool hot, my_bool at_end)
{
BLOCK_LINK *ins;
BLOCK_LINK **pins;
@@ -1493,7 +1486,7 @@ static void link_block(S_KEY_CACHE_CB *k
See NOTES for link_block
*/
-static void unlink_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
+static void unlink_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
{
DBUG_ASSERT((block->status & ~BLOCK_CHANGED) == (BLOCK_READ | BLOCK_IN_USE));
DBUG_ASSERT(block->hash_link); /*backptr to block NULL from free_block()*/
@@ -1551,7 +1544,8 @@ static void unlink_block(S_KEY_CACHE_CB
RETURN
void
*/
-static void reg_requests(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block, int count)
+static void reg_requests(SIMPLE_KEY_CACHE_CB *keycache,
+ BLOCK_LINK *block, int count)
{
DBUG_ASSERT(block->status & BLOCK_IN_USE);
DBUG_ASSERT(block->hash_link);
@@ -1594,7 +1588,7 @@ static void reg_requests(S_KEY_CACHE_CB
not linked in the LRU ring.
*/
-static void unreg_request(S_KEY_CACHE_CB *keycache,
+static void unreg_request(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, int at_end)
{
DBUG_ASSERT(block->status & (BLOCK_READ | BLOCK_IN_USE));
@@ -1683,7 +1677,7 @@ static void remove_reader(BLOCK_LINK *bl
signals on its termination
*/
-static void wait_for_readers(S_KEY_CACHE_CB *keycache,
+static void wait_for_readers(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block)
{
#ifdef THREAD
@@ -1732,7 +1726,7 @@ static inline void link_hash(HASH_LINK *
Remove a hash link from the hash table
*/
-static void unlink_hash(S_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
+static void unlink_hash(SIMPLE_KEY_CACHE_CB *keycache, HASH_LINK *hash_link)
{
KEYCACHE_DBUG_PRINT("unlink_hash", ("fd: %u pos_ %lu #requests=%u",
(uint) hash_link->file,(ulong) hash_link->diskpos, hash_link->requests));
@@ -1788,7 +1782,7 @@ static void unlink_hash(S_KEY_CACHE_CB *
Get the hash link for a page
*/
-static HASH_LINK *get_hash_link(S_KEY_CACHE_CB *keycache,
+static HASH_LINK *get_hash_link(SIMPLE_KEY_CACHE_CB *keycache,
int file, my_off_t filepos)
{
reg1 HASH_LINK *hash_link, **start;
@@ -1909,7 +1903,7 @@ restart:
waits until first of this operations links any block back.
*/
-static BLOCK_LINK *find_key_block(S_KEY_CACHE_CB *keycache,
+static BLOCK_LINK *find_key_block(SIMPLE_KEY_CACHE_CB *keycache,
File file, my_off_t filepos,
int init_hits_left,
int wrmode, int *page_st)
@@ -2669,7 +2663,7 @@ restart:
portion is less than read_length, but not less than min_length.
*/
-static void read_block(S_KEY_CACHE_CB *keycache,
+static void read_block(SIMPLE_KEY_CACHE_CB *keycache,
BLOCK_LINK *block, uint read_length,
uint min_length, my_bool primary)
{
@@ -2761,8 +2755,8 @@ static void read_block(S_KEY_CACHE_CB *k
SYNOPSIS
- s_key_cache_read()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_read()
+ keycache pointer to the control block of a simple key cache
file handler for the file for the block of data to be read
filepos position of the block of data in the file
level determines the weight of the data
@@ -2774,8 +2768,8 @@ static void read_block(S_KEY_CACHE_CB *k
DESCRIPTION
This function is the implementation of the key_cache_read interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
In a general case the function reads a block of data from the key cache
into the buffer buff of the size specified by the parameter length. The
@@ -2802,17 +2796,16 @@ static void read_block(S_KEY_CACHE_CB *k
*/
-uchar *s_key_cache_read(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+uchar *simple_key_cache_read(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int return_buffer __attribute__((unused)))
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
my_bool locked_and_incremented= FALSE;
int error=0;
uchar *start= buff;
- DBUG_ENTER("s_key_cache_read");
+ DBUG_ENTER("simple_key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
@@ -3010,8 +3003,8 @@ end:
Insert a block of file data from a buffer into a simple key cache
SYNOPSIS
- s_key_cache_insert()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_insert()
+ keycache pointer to the control block of a simple key cache
file handler for the file to insert data from
filepos position of the block of data in the file to insert
level determines the weight of the data
@@ -3021,8 +3014,8 @@ end:
DESCRIPTION
This function is the implementation of the key_cache_insert interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
The function writes a block of file data from a buffer into the key cache.
The buffer is specified with the parameters buff and length - the pointer
@@ -3045,11 +3038,10 @@ end:
*/
static
-int s_key_cache_insert(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length)
+int simple_key_cache_insert(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int error= 0;
DBUG_ENTER("key_cache_insert");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
@@ -3272,8 +3264,8 @@ int s_key_cache_insert(void *keycache_cb
SYNOPSIS
- s_key_cache_write()
- keycache_cb pointer to the control block of a simple key cache
+ simple_key_cache_write()
+ keycache pointer to the control block of a simple key cache
file handler for the file to write data to
file_extra maps of key cache partitions containing
dirty pages from file
@@ -3287,8 +3279,8 @@ int s_key_cache_insert(void *keycache_cb
DESCRIPTION
This function is the implementation of the key_cache_write interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
cache.
In a general case the function copies data from a buffer into the key
cache. The buffer is specified with the parameters buff and length -
@@ -3304,7 +3296,8 @@ int s_key_cache_insert(void *keycache_cb
The parameter file_extra currently makes sense only for simple key caches
that are elements of a partitioned key cache. It provides a pointer to the
shared bitmap of the partitions that may contains dirty pages for the file.
- This bitmap is used to optimize the function p_flush_key_blocks.
+ This bitmap is used to optimize the function
+ flush_partitioned_key_cache_blocks.
RETURN VALUE
0 if a success, 1 - otherwise.
@@ -3316,17 +3309,16 @@ int s_key_cache_insert(void *keycache_cb
*/
static
-int s_key_cache_write(void *keycache_cb,
- File file, void *file_extra __attribute__((unused)),
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int dont_write)
+int simple_key_cache_write(SIMPLE_KEY_CACHE_CB *keycache,
+ File file, void *file_extra __attribute__((unused)),
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int dont_write)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
my_bool locked_and_incremented= FALSE;
int error=0;
- DBUG_ENTER("s_key_cache_write");
+ DBUG_ENTER("simple_key_cache_write");
DBUG_PRINT("enter",
("fd: %u pos: %lu length: %u block_length: %u"
" key_block_length: %u",
@@ -3641,7 +3633,7 @@ end:
Block must have a request registered on it.
*/
-static void free_block(S_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
+static void free_block(SIMPLE_KEY_CACHE_CB *keycache, BLOCK_LINK *block)
{
KEYCACHE_THREAD_TRACE("free block");
KEYCACHE_DBUG_PRINT("free_block",
@@ -3781,7 +3773,7 @@ static int cmp_sec_link(BLOCK_LINK **a,
free used blocks if requested
*/
-static int flush_cached_blocks(S_KEY_CACHE_CB *keycache,
+static int flush_cached_blocks(SIMPLE_KEY_CACHE_CB *keycache,
File file, BLOCK_LINK **cache,
BLOCK_LINK **end,
enum flush_type type)
@@ -3909,7 +3901,7 @@ static int flush_cached_blocks(S_KEY_CAC
1 error
*/
-static int flush_key_blocks_int(S_KEY_CACHE_CB *keycache,
+static int flush_key_blocks_int(SIMPLE_KEY_CACHE_CB *keycache,
File file, enum flush_type type)
{
BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache;
@@ -4349,8 +4341,8 @@ err:
SYNOPSIS
- s_flush_key_blocks()
- keycache_cb pointer to the control block of a simple key cache
+ flush_simple_key_blocks()
+ keycache pointer to the control block of a simple key cache
file handler for the file to flush to
file_extra maps of key cache partitions containing
dirty pages from file (not used)
@@ -4359,7 +4351,7 @@ err:
DESCRIPTION
This function is the implementation of the flush_key_blocks interface
function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
+ The function takes the parameter keycache as a pointer to the
control block structure of the type S_KEY_CACHE_CB for a simple key
cache.
In a general case the function flushes the data from all dirty key
@@ -4382,12 +4374,11 @@ err:
*/
static
-int s_flush_key_blocks(void *keycache_cb,
- File file,
- void *file_extra __attribute__((unused)),
- enum flush_type type)
+int flush_simple_key_cache_blocks(SIMPLE_KEY_CACHE_CB *keycache,
+ File file,
+ void *file_extra __attribute__((unused)),
+ enum flush_type type)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
int res= 0;
DBUG_ENTER("flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
@@ -4440,7 +4431,7 @@ int s_flush_key_blocks(void *keycache_cb
!= 0 Error
*/
-static int flush_all_key_blocks(S_KEY_CACHE_CB *keycache)
+static int flush_all_key_blocks(SIMPLE_KEY_CACHE_CB *keycache)
{
BLOCK_LINK *block;
uint total_found;
@@ -4546,14 +4537,14 @@ static int flush_all_key_blocks(S_KEY_CA
Reset the counters of a simple key cache
SYNOPSIS
- s_reset_key_cache_counters()
+ reset_simple_key_cache_counters()
name the name of a key cache
- keycache_cb pointer to the control block of a simple key cache
+ keycache pointer to the control block of a simple key cache
DESCRIPTION
This function is the implementation of the reset_key_cache_counters
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
+ The function takes the parameter keycache as a pointer to the
control block structure of the type S_KEY_CACHE_CB for a simple key cache.
This function resets the values of all statistical counters for the key
cache to 0.
@@ -4565,11 +4556,10 @@ static int flush_all_key_blocks(S_KEY_CA
*/
static
-int s_reset_key_cache_counters(const char *name __attribute__((unused)),
- void *keycache_cb)
+int reset_simple_key_cache_counters(const char *name __attribute__((unused)),
+ SIMPLE_KEY_CACHE_CB *keycache)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_reset_key_cache_counters");
+ DBUG_ENTER("reset_simple_key_cache_counters");
if (!keycache->key_cache_inited)
{
DBUG_PRINT("info", ("Key cache %s not initialized.", name));
@@ -4590,9 +4580,10 @@ int s_reset_key_cache_counters(const cha
/*
Test if disk-cache is ok
*/
-static void test_key_cache(S_KEY_CACHE_CB *keycache __attribute__((unused)),
- const char *where __attribute__((unused)),
- my_bool lock __attribute__((unused)))
+static
+void test_key_cache(SIMPLE_KEY_CACHE_CB *keycache __attribute__((unused)),
+ const char *where __attribute__((unused)),
+ my_bool lock __attribute__((unused)))
{
/* TODO */
}
@@ -4604,7 +4595,7 @@ static void test_key_cache(S_KEY_CACHE_C
#define MAX_QUEUE_LEN 100
-static void keycache_dump(S_KEY_CACHE_CB *keycache)
+static void keycache_dump(SIMPLE_KEY_CACHE_CB *keycache)
{
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
struct st_my_thread_var *last;
@@ -4844,7 +4835,7 @@ static int fail_hlink(HASH_LINK *hlink)
return 0; /* Let the assert fail. */
}
-static int cache_empty(S_KEY_CACHE_CB *keycache)
+static int cache_empty(SIMPLE_KEY_CACHE_CB *keycache)
{
int errcnt= 0;
int idx;
@@ -4887,54 +4878,57 @@ static int cache_empty(S_KEY_CACHE_CB *k
Get statistics for a simple key cache
SYNOPSIS
- get_key_cache_statistics()
- keycache_cb pointer to the control block of a simple key cache
+ get_simple_key_cache_statistics()
+ keycache pointer to the control block of a simple key cache
partition_no partition number (not used)
key_cache_stats OUT pointer to the structure for the returned statistics
DESCRIPTION
This function is the implementation of the get_key_cache_statistics
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key cache.
- This function returns the statistical data for the key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
+ cache. This function returns the statistical data for the key cache.
The parameter partition_no is not used by this function.
RETURN
none
-
*/
static
-void s_get_key_cache_statistics(void *keycache_cb,
- uint partition_no __attribute__((unused)),
- KEY_CACHE_STATISTICS *key_cache_stats)
-{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- DBUG_ENTER("s_get_key_cache_statistics");
-
- key_cache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
- key_cache_stats->block_size= (longlong) keycache->key_cache_block_size;
- key_cache_stats->blocks_used= keycache->blocks_used;
- key_cache_stats->blocks_unused= keycache->blocks_unused;
- key_cache_stats->blocks_changed= keycache->global_blocks_changed;
- key_cache_stats->read_requests= keycache->global_cache_r_requests;
- key_cache_stats->reads= keycache->global_cache_read;
- key_cache_stats->write_requests= keycache->global_cache_w_requests;
- key_cache_stats->writes= keycache->global_cache_write;
+void get_simple_key_cache_statistics(SIMPLE_KEY_CACHE_CB *keycache,
+ uint partition_no __attribute__((unused)),
+ KEY_CACHE_STATISTICS *keycache_stats)
+{
+ DBUG_ENTER("simple_get_key_cache_statistics");
+
+ keycache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
+ keycache_stats->block_size= (longlong) keycache->key_cache_block_size;
+ keycache_stats->blocks_used= keycache->blocks_used;
+ keycache_stats->blocks_unused= keycache->blocks_unused;
+ keycache_stats->blocks_changed= keycache->global_blocks_changed;
+ keycache_stats->read_requests= keycache->global_cache_r_requests;
+ keycache_stats->reads= keycache->global_cache_read;
+ keycache_stats->write_requests= keycache->global_cache_w_requests;
+ keycache_stats->writes= keycache->global_cache_write;
DBUG_VOID_RETURN;
}
-static size_t s_key_cache_stat_var_offsets[]=
+/*
+ Offsets of the statistical values in the control block for a simple key cache
+ The first NO_LONG_KEY_CACHE_STAT_VARIABLES=3 are of the ulong type while the
+ remaining are of the ulonglong type.
+ */
+static size_t simple_key_cache_stat_var_offsets[]=
{
- offsetof(S_KEY_CACHE_CB, blocks_used),
- offsetof(S_KEY_CACHE_CB, blocks_unused),
- offsetof(S_KEY_CACHE_CB, global_blocks_changed),
- offsetof(S_KEY_CACHE_CB, global_cache_w_requests),
- offsetof(S_KEY_CACHE_CB, global_cache_write),
- offsetof(S_KEY_CACHE_CB, global_cache_r_requests),
- offsetof(S_KEY_CACHE_CB, global_cache_read)
+ offsetof(SIMPLE_KEY_CACHE_CB, blocks_used),
+ offsetof(SIMPLE_KEY_CACHE_CB, blocks_unused),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_blocks_changed),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_w_requests),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_write),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_r_requests),
+ offsetof(SIMPLE_KEY_CACHE_CB, global_cache_read)
};
@@ -4942,16 +4936,16 @@ static size_t s_key_cache_stat_var_offse
Get the value of a statistical variable for a simple key cache
SYNOPSIS
- s_get_key_cache_stat_value()
- keycache_cb pointer to the control block of a simple key cache
+ get_simple_key_cache_stat_value()
+ keycache pointer to the control block of a simple key cache
var_no the ordered number of a statistical variable
DESCRIPTION
- This function is the implementation of the s_get_key_cache_stat_value
+ This function is the implementation of the get_simple_key_cache_stat_value
interface function that is employed by simple (non-partitioned) key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type S_KEY_CACHE_CB for a simple key cache.
- This function returns the value of the statistical variable var_no
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type SIMPLE_KEY_CACHE_CB for a simple key
+ cache. This function returns the value of the statistical variable var_no
for this key cache. The variables are numbered starting from 0 to 6.
RETURN
@@ -4960,12 +4954,12 @@ static size_t s_key_cache_stat_var_offse
*/
static
-ulonglong s_get_key_cache_stat_value(void *keycache_cb, uint var_no)
+ulonglong get_simple_key_cache_stat_value(SIMPLE_KEY_CACHE_CB *keycache,
+ uint var_no)
{
- S_KEY_CACHE_CB *keycache= (S_KEY_CACHE_CB *) keycache_cb;
- size_t var_ofs= s_key_cache_stat_var_offsets[var_no];
+ size_t var_ofs= simple_key_cache_stat_var_offsets[var_no];
ulonglong res= 0;
- DBUG_ENTER("s_get_key_cache_stat_value");
+ DBUG_ENTER("get_simple_key_cache_stat_value");
if (var_no < 3)
res= (ulonglong) (*(long *) ((char *) keycache + var_ofs));
@@ -4985,19 +4979,19 @@ ulonglong s_get_key_cache_stat_value(voi
the MySQL server code directly. We don't do it though.
*/
-static KEY_CACHE_FUNCS s_key_cache_funcs =
+static KEY_CACHE_FUNCS simple_key_cache_funcs =
{
- s_init_key_cache,
- s_resize_key_cache,
- s_change_key_cache_param,
- s_key_cache_read,
- s_key_cache_insert,
- s_key_cache_write,
- s_flush_key_blocks,
- s_reset_key_cache_counters,
- s_end_key_cache,
- s_get_key_cache_statistics,
- s_get_key_cache_stat_value
+ (INIT_KEY_CACHE) init_simple_key_cache,
+ (RESIZE_KEY_CACHE) resize_simple_key_cache,
+ (CHANGE_KEY_CACHE_PARAM) change_simple_key_cache_param,
+ (KEY_CACHE_READ) simple_key_cache_read,
+ (KEY_CACHE_INSERT) simple_key_cache_insert,
+ (KEY_CACHE_WRITE) simple_key_cache_write,
+ (FLUSH_KEY_BLOCKS) flush_simple_key_cache_blocks,
+ (RESET_KEY_CACHE_COUNTERS) reset_simple_key_cache_counters,
+ (END_KEY_CACHE) end_simple_key_cache,
+ (GET_KEY_CACHE_STATISTICS) get_simple_key_cache_statistics,
+ (GET_KEY_CACHE_STAT_VALUE) get_simple_key_cache_stat_value
};
@@ -5038,17 +5032,22 @@ static KEY_CACHE_FUNCS s_key_cache_funcs
/* Control block for a partitioned key cache */
-typedef struct st_p_key_cache_cb
+typedef struct st_partitioned_key_cache_cb
{
my_bool key_cache_inited; /*<=> control block is allocated */
- S_KEY_CACHE_CB **partition_array; /* array of the key cache partitions */
- uint partitions; /* number of partitions in the key cache */
+ SIMPLE_KEY_CACHE_CB **partition_array; /* the key cache partitions */
size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
-} P_KEY_CACHE_CB;
+ uint partitions; /* number of partitions in the key cache */
+} PARTITIONED_KEY_CACHE_CB;
static
-void p_end_key_cache(void *keycache_cb, my_bool cleanup);
+void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ my_bool cleanup);
+
+static int
+reset_partitioned_key_cache_counters(const char *name,
+ PARTITIONED_KEY_CACHE_CB *keycache);
/*
Determine the partition to which the index block to read is ascribed
@@ -5070,11 +5069,12 @@ void p_end_key_cache(void *keycache_cb,
file block is ascribed.
*/
-static
-S_KEY_CACHE_CB *get_key_cache_partition(P_KEY_CACHE_CB *keycache,
- File file, my_off_t filepos)
+static
+SIMPLE_KEY_CACHE_CB *
+get_key_cache_partition(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos)
{
- uint i= KEYCACHE_BASE_EXPR( file, filepos) % keycache->partitions;
+ uint i= KEYCACHE_BASE_EXPR(file, filepos) % keycache->partitions;
return keycache->partition_array[i];
}
@@ -5101,10 +5101,10 @@ S_KEY_CACHE_CB *get_key_cache_partition(
file block is ascribed.
*/
-static
-S_KEY_CACHE_CB *get_key_cache_partition_for_write(P_KEY_CACHE_CB *keycache,
- File file, my_off_t filepos,
- ulonglong* dirty_part_map)
+static SIMPLE_KEY_CACHE_CB
+*get_key_cache_partition_for_write(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos,
+ ulonglong* dirty_part_map)
{
uint i= KEYCACHE_BASE_EXPR( file, filepos) % keycache->partitions;
*dirty_part_map|= 1<<i;
@@ -5116,8 +5116,8 @@ S_KEY_CACHE_CB *get_key_cache_partition_
Initialize a partitioned key cache
SYNOPSIS
- p_init_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ init_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for all key cache partitions
division_limit division limit (may be zero)
@@ -5127,17 +5127,17 @@ S_KEY_CACHE_CB *get_key_cache_partition_
This function is the implementation of the init_key_cache interface function
that is employed by partitioned key caches.
The function builds and initializes an array of simple key caches, and then
- initializes the control block structure of the type P_KEY_CACHE_CB that is
- used for a partitioned key cache. The parameter keycache_cb is supposed to
- point to this structure. The number of partitions in the partitioned key
- cache to be built must be passed through the field 'partitions' of this
- structure. The parameter key_cache_block_size specifies the size of the
- blocks in the the simple key caches to be built. The parameters
- division_limit and age_threshold determine the initial values of those
- characteristics of the simple key caches that are used for midpoint
- insertion strategy. The parameter use_mem specifies the total amount of
- memory to be allocated for the key cache blocks in all simple key caches
- and for all auxiliary structures.
+ initializes the control block structure of the type PARTITIONED_KEY_CACHE_CB
+ that is used for a partitioned key cache. The parameter keycache is
+ supposed to point to this structure. The number of partitions in the
+ partitioned key cache to be built must be passed through the field
+ 'partitions' of this structure. The parameter key_cache_block_size specifies
+ the size of the blocks in the the simple key caches to be built.
+ The parameters division_limit and age_threshold determine the initial
+ values of those characteristics of the simple key caches that are used for
+ midpoint insertion strategy. The parameter use_mem specifies the total
+ amount of memory to be allocated for the key cache blocks in all simple key
+ caches and for all auxiliary structures.
RETURN VALUE
total number of blocks in key cache partitions, if successful,
@@ -5152,19 +5152,19 @@ S_KEY_CACHE_CB *get_key_cache_partition_
*/
static
-int p_init_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int init_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
int i;
size_t mem_per_cache;
int cnt;
- S_KEY_CACHE_CB *partition;
- S_KEY_CACHE_CB **partition_ptr;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
+ SIMPLE_KEY_CACHE_CB *partition;
+ SIMPLE_KEY_CACHE_CB **partition_ptr;
uint partitions= keycache->partitions;
- int blocks= -1;
- DBUG_ENTER("p_init_key_cache");
+ int blocks= 0;
+ DBUG_ENTER("partitioned_init_key_cache");
keycache->key_cache_block_size = key_cache_block_size;
@@ -5173,9 +5173,9 @@ int p_init_key_cache(void *keycache_cb,
else
{
if(!(partition_ptr=
- (S_KEY_CACHE_CB **) my_malloc(sizeof(S_KEY_CACHE_CB *) * partitions,
- MYF(0))))
- DBUG_RETURN(blocks);
+ (SIMPLE_KEY_CACHE_CB **) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB *) *
+ partitions, MYF(MY_WME))))
+ DBUG_RETURN(-1);
keycache->partition_array= partition_ptr;
}
@@ -5188,36 +5188,35 @@ int p_init_key_cache(void *keycache_cb,
partition= *partition_ptr;
else
{
- if (!(partition= (S_KEY_CACHE_CB *) my_malloc(sizeof(S_KEY_CACHE_CB),
- MYF(0))))
+ if (!(partition=
+ (SIMPLE_KEY_CACHE_CB *) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB),
+ MYF(MY_WME))))
continue;
partition->key_cache_inited= 0;
}
- if ((cnt= s_init_key_cache(partition,
- key_cache_block_size, mem_per_cache,
- division_limit, age_threshold)) <= 0)
+ if ((cnt= init_simple_key_cache(partition,
+ key_cache_block_size, mem_per_cache,
+ division_limit, age_threshold)) <= 0)
{
- s_end_key_cache(partition, 1);
- my_free((uchar *) partition, MYF(0));
+ end_simple_key_cache(partition, 1);
+ my_free(partition, MYF(0));
partition= 0;
if (key_cache_inited)
{
memmove(partition_ptr, partition_ptr+1,
sizeof(partition_ptr)*(partitions-i-1));
}
+ if (!--partitions)
+ break;
if (i == 0)
{
i--;
- partitions--;
- if (partitions)
- mem_per_cache = use_mem / partitions;
+ mem_per_cache = use_mem / partitions;
+ continue;
}
- continue;
}
- if (blocks < 0)
- blocks= 0;
blocks+= cnt;
*partition_ptr++= partition;
}
@@ -5229,6 +5228,9 @@ int p_init_key_cache(void *keycache_cb,
keycache->key_cache_inited= 1;
+ if (!partitions)
+ blocks= -1;
+
DBUG_RETURN(blocks);
}
@@ -5237,8 +5239,8 @@ int p_init_key_cache(void *keycache_cb,
Resize a partitioned key cache
SYNOPSIS
- p_resize_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ resize_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for the new key cache
division_limit new division limit (if not zero)
@@ -5247,9 +5249,9 @@ int p_init_key_cache(void *keycache_cb,
DESCRIPTION
This function is the implementation of the resize_key_cache interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the partitioned
- key cache to be resized.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the
+ partitioned key cache to be resized.
The parameter key_cache_block_size specifies the new size of the blocks in
the simple key caches that comprise the partitioned key cache.
The parameters division_limit and age_threshold determine the new initial
@@ -5263,48 +5265,48 @@ int p_init_key_cache(void *keycache_cb,
0 - otherwise.
NOTES.
- The function first calls s_prepare_resize_key_cache for each simple
+ The function first calls prepare_resize_simple_key_cache for each simple
key cache effectively flushing all dirty pages from it and destroying
- the key cache. Then p_init_key cache is called. This call builds all
- the new array of simple key caches containing the same number of
- elements as the old one. After this the function calls the function
- s_finish_resize_key_cache for each simple key cache from this array.
+ the key cache. Then init_partitioned_key_cache is called. This call builds
+ a new array of simple key caches containing the same number of elements
+ as the old one. After this the function calls the function
+ finish_resize_simple_key_cache for each simple key cache from this array.
This implementation doesn't block the calls and executions of other
functions from the key cache interface. However it assumes that the
- calls of s_resize_key_cache itself are serialized.
+ calls of resize_partitioned_key_cache itself are serialized.
*/
static
-int p_resize_key_cache(void *keycache_cb, uint key_cache_block_size,
- size_t use_mem, uint division_limit,
- uint age_threshold)
+int resize_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint key_cache_block_size,
+ size_t use_mem, uint division_limit,
+ uint age_threshold)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
my_bool cleanup= use_mem == 0;
int blocks= -1;
int err= 0;
- DBUG_ENTER("p_resize_key_cache");
- if (use_mem == 0)
+ DBUG_ENTER("partitioned_resize_key_cache");
+ if (cleanup)
{
- p_end_key_cache(keycache_cb, 0);
- DBUG_RETURN(blocks);
+ end_partitioned_key_cache(keycache, 0);
+ DBUG_RETURN(-1);
}
for (i= 0; i < partitions; i++)
{
- err|= s_prepare_resize_key_cache(keycache->partition_array[i], 0, 1);
+ err|= prepare_resize_simple_key_cache(keycache->partition_array[i], 0, 1);
}
- if (!err && use_mem)
- blocks= p_init_key_cache(keycache_cb, key_cache_block_size, use_mem,
- division_limit, age_threshold);
- if (blocks > 0 && !cleanup)
+ if (!err)
+ blocks= init_partitioned_key_cache(keycache, key_cache_block_size,
+ use_mem, division_limit, age_threshold);
+ if (blocks > 0)
{
for (i= 0; i < partitions; i++)
{
- s_finish_resize_key_cache(keycache->partition_array[i], 0, 1);
+ finish_resize_simple_key_cache(keycache->partition_array[i], 0, 1);
}
}
DBUG_RETURN(blocks);
@@ -5315,17 +5317,17 @@ int p_resize_key_cache(void *keycache_cb
Change key cache parameters of a partitioned key cache
SYNOPSIS
- p_change_key_cache_param()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_change_key_cache_param()
+ keycache pointer to the control block of a partitioned key cache
division_limit new division limit (if not zero)
age_threshold new age threshold (if not zero)
DESCRIPTION
This function is the implementation of the change_key_cache_param interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the simple key
- cache where new values of the division limit and the age threshold used
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the simple
+ key cache where new values of the division limit and the age threshold used
for midpoint insertion strategy are to be set. The parameters
division_limit and age_threshold provide these new values.
@@ -5333,23 +5335,23 @@ int p_resize_key_cache(void *keycache_cb
none
NOTES
- The function just calls s_change_key_cache_param for each element from the
- array of simple caches that comprise the partitioned key cache.
+ The function just calls change_simple_key_cache_param for each element from
+ the array of simple caches that comprise the partitioned key cache.
*/
static
-void p_change_key_cache_param(void *keycache_cb, uint division_limit,
- uint age_threshold)
+void change_partitioned_key_cache_param(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint division_limit,
+ uint age_threshold)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_change_key_cache_param");
+ DBUG_ENTER("partitioned_change_key_cache_param");
for (i= 0; i < partitions; i++)
{
- s_change_key_cache_param(keycache->partition_array[i], division_limit,
- age_threshold);
+ change_simple_key_cache_param(keycache->partition_array[i], division_limit,
+ age_threshold);
}
DBUG_VOID_RETURN;
}
@@ -5359,17 +5361,17 @@ void p_change_key_cache_param(void *keyc
Destroy a partitioned key cache
SYNOPSIS
- p_end_key_cache()
- keycache_cb pointer to the control block of a partitioned key cache
+ end_partitioned_key_cache()
+ keycache pointer to the control block of a partitioned key cache
cleanup <=> complete free (free also control block structures
for all simple key caches)
DESCRIPTION
This function is the implementation of the end_key_cache interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for the partitioned
- key cache to be destroyed.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for the
+ partitioned key cache to be destroyed.
The function frees the memory allocated for the cache blocks and
auxiliary structures used by simple key caches that comprise the
partitioned key cache. If the value of the parameter cleanup is TRUE
@@ -5382,19 +5384,20 @@ void p_change_key_cache_param(void *keyc
*/
static
-void p_end_key_cache(void *keycache_cb, my_bool cleanup)
+void end_partitioned_key_cache(PARTITIONED_KEY_CACHE_CB *keycache,
+ my_bool cleanup)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_end_key_cache");
+ DBUG_ENTER("partitioned_end_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
for (i= 0; i < partitions; i++)
{
- s_end_key_cache(keycache->partition_array[i], cleanup);
+ end_simple_key_cache(keycache->partition_array[i], cleanup);
}
- if (cleanup) {
+ if (cleanup)
+ {
for (i= 0; i < partitions; i++)
my_free((uchar*) keycache->partition_array[i], MYF(0));
my_free((uchar*) keycache->partition_array, MYF(0));
@@ -5409,8 +5412,8 @@ void p_end_key_cache(void *keycache_cb,
SYNOPSIS
- p_key_cache_read()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_read()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file for the block of data to be read
filepos position of the block of data in the file
level determines the weight of the data
@@ -5422,9 +5425,9 @@ void p_end_key_cache(void *keycache_cb,
DESCRIPTION
This function is the implementation of the key_cache_read interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function reads a block of data from the key cache
into the buffer buff of the size specified by the parameter length. The
beginning of the block of data to be read is specified by the parameters
@@ -5432,7 +5435,7 @@ void p_end_key_cache(void *keycache_cb,
of the buffer. The data is read into the buffer in key_cache_block_size
increments. To read each portion the function first finds out in what
partition of the key cache this portion(page) is to be saved, and calls
- s_key_cache_read with the pointer to the corresponding simple key as
+ simple_key_cache_read with the pointer to the corresponding simple key as
its first parameter.
If the parameter return_buffer is not ignored and its value is TRUE, and
the data to be read of the specified size block_length can be read from one
@@ -5449,17 +5452,16 @@ void p_end_key_cache(void *keycache_cb,
*/
static
-uchar *p_key_cache_read(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int return_buffer __attribute__((unused)))
+uchar *partitioned_key_cache_read(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int return_buffer __attribute__((unused)))
{
uint r_length;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
uchar *start= buff;
- DBUG_ENTER("p_key_cache_read");
+ DBUG_ENTER("partitioned_key_cache_read");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file, (ulong) filepos, length));
@@ -5471,15 +5473,15 @@ uchar *p_key_cache_read(void *keycache_c
/* Read data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
- file, filepos);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
+ file, filepos);
uchar *ret_buff= 0;
r_length= length;
set_if_smaller(r_length, keycache->key_cache_block_size - offset);
- ret_buff= s_key_cache_read((void *) partition,
- file, filepos, level,
- buff, r_length,
- block_length, return_buffer);
+ ret_buff= simple_key_cache_read((void *) partition,
+ file, filepos, level,
+ buff, r_length,
+ block_length, return_buffer);
if (ret_buff == 0)
DBUG_RETURN(0);
#ifndef THREAD
@@ -5500,8 +5502,8 @@ uchar *p_key_cache_read(void *keycache_c
Insert a block of file data from a buffer into a partitioned key cache
SYNOPSIS
- p_key_cache_insert()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_insert()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to insert data from
filepos position of the block of data in the file to insert
level determines the weight of the data
@@ -5511,9 +5513,9 @@ uchar *p_key_cache_read(void *keycache_c
DESCRIPTION
This function is the implementation of the key_cache_insert interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned key
- cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
The function writes a block of file data from a buffer into the key cache.
The buffer is specified with the parameters buff and length - the pointer
to the beginning of the buffer and its size respectively. It's assumed
@@ -5521,8 +5523,8 @@ uchar *p_key_cache_read(void *keycache_c
filepos. The data is copied from the buffer in key_cache_block_size
increments. For every portion of data the function finds out in what simple
key cache from the array of partitions the data must be stored, and after
- this calls s_key_cache_insert to copy the data into a key buffer of this
- simple key cache.
+ this calls simple_key_cache_insert to copy the data into a key buffer of
+ this simple key cache.
The parameter level is used to set one characteristic for the key buffers
loaded with the data from buff. The characteristic is used only by the
midpoint insertion strategy.
@@ -5538,14 +5540,13 @@ uchar *p_key_cache_read(void *keycache_c
*/
static
-int p_key_cache_insert(void *keycache_cb,
- File file, my_off_t filepos, int level,
- uchar *buff, uint length)
+int partitioned_key_cache_insert(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, my_off_t filepos, int level,
+ uchar *buff, uint length)
{
uint w_length;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
- DBUG_ENTER("p_key_cache_insert");
+ DBUG_ENTER("partitioned_key_cache_insert");
DBUG_PRINT("enter", ("fd: %u pos: %lu length: %u",
(uint) file,(ulong) filepos, length));
@@ -5553,13 +5554,13 @@ int p_key_cache_insert(void *keycache_cb
/* Write data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
- file, filepos);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition(keycache,
+ file, filepos);
w_length= length;
- set_if_smaller(w_length, keycache->key_cache_block_size);
- if (s_key_cache_insert((void *) partition,
- file, filepos, level,
- buff, w_length))
+ set_if_smaller(w_length, keycache->key_cache_block_size - offset);
+ if (simple_key_cache_insert((void *) partition,
+ file, filepos, level,
+ buff, w_length))
DBUG_RETURN(1);
filepos+= w_length;
@@ -5576,8 +5577,8 @@ int p_key_cache_insert(void *keycache_cb
SYNOPSIS
- p_key_cache_write()
- keycache_cb pointer to the control block of a partitioned key cache
+ partitioned_key_cache_write()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to write data to
filepos position in the file to write data to
level determines the weight of the data
@@ -5591,9 +5592,9 @@ int p_key_cache_insert(void *keycache_cb
DESCRIPTION
This function is the implementation of the key_cache_write interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function copies data from a buffer into the key
cache. The buffer is specified with the parameters buff and length -
the pointer to the beginning of the buffer and its size respectively.
@@ -5601,8 +5602,8 @@ int p_key_cache_insert(void *keycache_cb
starting from the position filepos. The data is copied from the buffer
in key_cache_block_size increments. For every portion of data the
function finds out in what simple key cache from the array of partitions
- the data must be stored, and after this calls s_key_cache_write to copy
- the data into a key buffer of this simple key cache.
+ the data must be stored, and after this calls simple_key_cache_write to
+ copy the data into a key buffer of this simple key cache.
If the value of the parameter dont_write is FALSE then the function
also writes the data into file.
The parameter level is used to set one characteristic for the key buffers
@@ -5610,7 +5611,7 @@ int p_key_cache_insert(void *keycache_cb
the midpoint insertion strategy.
The parameter file_expra provides a pointer to the shared bitmap of
the partitions that may contains dirty pages for the file. This bitmap
- is used to optimize the function p_flush_key_blocks.
+ is used to optimize the function flush_partitioned_key_cache_blocks.
RETURN VALUE
0 if a success, 1 - otherwise.
@@ -5622,18 +5623,17 @@ int p_key_cache_insert(void *keycache_cb
*/
static
-int p_key_cache_write(void *keycache_cb,
- File file, void *file_extra,
- my_off_t filepos, int level,
- uchar *buff, uint length,
- uint block_length __attribute__((unused)),
- int dont_write)
+int partitioned_key_cache_write(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, void *file_extra,
+ my_off_t filepos, int level,
+ uchar *buff, uint length,
+ uint block_length __attribute__((unused)),
+ int dont_write)
{
uint w_length;
ulonglong *part_map= (ulonglong *) file_extra;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint offset= (uint) (filepos % keycache->key_cache_block_size);
- DBUG_ENTER("p_key_cache_write");
+ DBUG_ENTER("partitioned_key_cache_write");
DBUG_PRINT("enter",
("fd: %u pos: %lu length: %u block_length: %u"
" key_block_length: %u",
@@ -5644,15 +5644,16 @@ int p_key_cache_write(void *keycache_cb,
/* Write data in key_cache_block_size increments */
do
{
- S_KEY_CACHE_CB *partition= get_key_cache_partition_for_write(keycache,
- file, filepos,
- part_map);
+ SIMPLE_KEY_CACHE_CB *partition= get_key_cache_partition_for_write(keycache,
+ file,
+ filepos,
+ part_map);
w_length = length;
- set_if_smaller(w_length, keycache->key_cache_block_size );
- if (s_key_cache_write(partition,
- file, 0, filepos, level,
- buff, w_length, block_length,
- dont_write))
+ set_if_smaller(w_length, keycache->key_cache_block_size - offset );
+ if (simple_key_cache_write(partition,
+ file, 0, filepos, level,
+ buff, w_length, block_length,
+ dont_write))
DBUG_RETURN(1);
filepos+= w_length;
@@ -5669,8 +5670,8 @@ int p_key_cache_write(void *keycache_cb,
SYNOPSIS
- p_flush_key_blocks()
- keycache_cb pointer to the control block of a partitioned key cache
+ flush_partitioned_key_cache_blocks()
+ keycache pointer to the control block of a partitioned key cache
file handler for the file to flush to
file_extra maps of key cache partitions containing
dirty pages from file (not used)
@@ -5679,9 +5680,9 @@ int p_key_cache_write(void *keycache_cb,
DESCRIPTION
This function is the implementation of the flush_key_blocks interface
function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
In a general case the function flushes the data from all dirty key
buffers related to the file 'file' into this file. The function does
exactly this if the value of the parameter type is FLUSH_KEEP. If the
@@ -5689,12 +5690,12 @@ int p_key_cache_write(void *keycache_cb,
releases the key buffers containing data from 'file' for new usage.
If the value of the parameter type is FLUSH_IGNORE_CHANGED the function
just releases the key buffers containing data from 'file'.
- The function performs the operation by calling s_flush_key_blocks
- for the elements of the array of the simple key caches that comprise
- the partitioned key_cache. If the value of the parameter type is
- FLUSH_KEEP s_flush_key_blocks is called only for the partitions with
- possibly dirty pages marked in the bitmap pointed to by the parameter
- file_extra.
+ The function performs the operation by calling the function
+ flush_simple_key_cache_blocks for the elements of the array of the
+ simple key caches that comprise the partitioned key_cache. If the value
+ of the parameter type is FLUSH_KEEP s_flush_key_blocks is called only
+ for the partitions with possibly dirty pages marked in the bitmap
+ pointed to by the parameter file_extra.
RETURN
0 ok
@@ -5707,31 +5708,27 @@ int p_key_cache_write(void *keycache_cb,
*/
static
-int p_flush_key_blocks(void *keycache_cb,
- File file, void *file_extra,
- enum flush_type type)
+int flush_partitioned_key_cache_blocks(PARTITIONED_KEY_CACHE_CB *keycache,
+ File file, void *file_extra,
+ enum flush_type type)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
int err= 0;
ulonglong *dirty_part_map= (ulonglong *) file_extra;
- DBUG_ENTER("p_flush_key_blocks");
+ DBUG_ENTER("partitioned_flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
for (i= 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
if ((type == FLUSH_KEEP || type == FLUSH_FORCE_WRITE) &&
- !((*dirty_part_map) & (1<<i)))
+ !((*dirty_part_map) & ((ulonglong) 1 << i)))
continue;
- err+= test(s_flush_key_blocks(partition, file, 0, type));
+ err|= test(flush_simple_key_cache_blocks(partition, file, 0, type));
}
*dirty_part_map= 0;
- if (err > 0)
- err= 1;
-
DBUG_RETURN(err);
}
@@ -5740,19 +5737,19 @@ int p_flush_key_blocks(void *keycache_cb
Reset the counters of a partitioned key cache
SYNOPSIS
- p_reset_key_cache_counters()
+ reset_partitioned_key_cache_counters()
name the name of a key cache
- keycache_cb pointer to the control block of a partitioned key cache
+ keycache pointer to the control block of a partitioned key cache
DESCRIPTION
This function is the implementation of the reset_key_cache_counters
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a partitioned
key cache.
This function resets the values of the statistical counters of the simple
key caches comprising partitioned key cache to 0. It does it by calling
- s_reset_key_cache_counters for each key cache partition.
+ reset_simple_key_cache_counters for each key cache partition.
The parameter name is currently not used.
RETURN
@@ -5760,18 +5757,17 @@ int p_flush_key_blocks(void *keycache_cb
*/
-static
-int p_reset_key_cache_counters(const char *name __attribute__((unused)),
- void *keycache_cb)
+static int
+reset_partitioned_key_cache_counters(const char *name __attribute__((unused)),
+ PARTITIONED_KEY_CACHE_CB *keycache)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_reset_key_cache_counters");
+ DBUG_ENTER("partitioned_reset_key_cache_counters");
for (i = 0; i < partitions; i++)
{
- s_reset_key_cache_counters(name, keycache->partition_array[i]);
+ reset_simple_key_cache_counters(name, keycache->partition_array[i]);
}
DBUG_RETURN(0);
}
@@ -5781,17 +5777,17 @@ int p_reset_key_cache_counters(const cha
Get statistics for a partition key cache
SYNOPSIS
- p_get_key_cache_statistics()
- keycache_cb pointer to the control block of a partitioned key cache
+ get_partitioned_key_cache_statistics()
+ keycache pointer to the control block of a partitioned key cache
partition_no partition number to get statistics for
key_cache_stats OUT pointer to the structure for the returned statistics
DESCRIPTION
This function is the implementation of the get_key_cache_statistics
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for
+ a partitioned key cache.
If the value of the parameter partition_no is equal to 0 then aggregated
statistics for all partitions is returned in the fields of the
structure key_cache_stat of the type KEY_CACHE_STATISTICS . Otherwise
@@ -5805,33 +5801,35 @@ int p_reset_key_cache_counters(const cha
*/
static
-void p_get_key_cache_statistics(void *keycache_cb, uint partition_no,
- KEY_CACHE_STATISTICS *key_cache_stats)
+void
+get_partitioned_key_cache_statistics(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint partition_no,
+ KEY_CACHE_STATISTICS *keycache_stats)
{
uint i;
- S_KEY_CACHE_CB *partition;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
+ SIMPLE_KEY_CACHE_CB *partition;
uint partitions= keycache->partitions;
- DBUG_ENTER("p_get_key_cache_statistics_");
+ DBUG_ENTER("get_partitioned_key_cache_statistics");
if (partition_no != 0)
{
partition= keycache->partition_array[partition_no-1];
- s_get_key_cache_statistics((void *) partition, 0, key_cache_stats);
+ get_simple_key_cache_statistics((void *) partition, 0, keycache_stats);
DBUG_VOID_RETURN;
}
- key_cache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
- key_cache_stats->block_size= (longlong) keycache->key_cache_block_size;
+ bzero(keycache_stats, sizeof(KEY_CACHE_STATISTICS));
+ keycache_stats->mem_size= (longlong) keycache->key_cache_mem_size;
+ keycache_stats->block_size= (longlong) keycache->key_cache_block_size;
for (i = 0; i < partitions; i++)
{
partition= keycache->partition_array[i];
- key_cache_stats->blocks_used+= partition->blocks_used;
- key_cache_stats->blocks_unused+= partition->blocks_unused;
- key_cache_stats->blocks_changed+= partition->global_blocks_changed;
- key_cache_stats->read_requests+= partition->global_cache_r_requests;
- key_cache_stats->reads+= partition->global_cache_read;
- key_cache_stats->write_requests+= partition->global_cache_w_requests;
- key_cache_stats->writes+= partition->global_cache_write;
+ keycache_stats->blocks_used+= partition->blocks_used;
+ keycache_stats->blocks_unused+= partition->blocks_unused;
+ keycache_stats->blocks_changed+= partition->global_blocks_changed;
+ keycache_stats->read_requests+= partition->global_cache_r_requests;
+ keycache_stats->reads+= partition->global_cache_read;
+ keycache_stats->write_requests+= partition->global_cache_w_requests;
+ keycache_stats->writes+= partition->global_cache_write;
}
DBUG_VOID_RETURN;
}
@@ -5840,16 +5838,16 @@ void p_get_key_cache_statistics(void *ke
Get the value of a statistical variable for a partitioned key cache
SYNOPSIS
- p_get_key_cache_stat_value()
- keycache_cb pointer to the control block of a partitioned key cache
+ get_partitioned_key_cache_stat_value()
+ keycache pointer to the control block of a partitioned key cache
var_no the ordered number of a statistical variable
DESCRIPTION
This function is the implementation of the get_key_cache_stat_value
interface function that is employed by partitioned key caches.
- The function considers the parameter keycache_cb as a pointer to the
- control block structure of the type P_KEY_CACHE_CB for a partitioned
- key cache.
+ The function takes the parameter keycache as a pointer to the
+ control block structure of the type PARTITIONED_KEY_CACHE_CB for a
+ partitioned key cache.
This function returns the value of the statistical variable var_no
for this key cache. The variables are numbered starting from 0 to 6.
The returned value is calculated as the sum of the values of the
@@ -5862,20 +5860,21 @@ void p_get_key_cache_statistics(void *ke
*/
static
-ulonglong p_get_key_cache_stat_value(void *keycache_cb, uint var_no)
+ulonglong
+get_partitioned_key_cache_stat_value(PARTITIONED_KEY_CACHE_CB *keycache,
+ uint var_no)
{
uint i;
- P_KEY_CACHE_CB *keycache= (P_KEY_CACHE_CB *) keycache_cb;
uint partitions= keycache->partitions;
- size_t var_ofs= s_key_cache_stat_var_offsets[var_no];
+ size_t var_ofs= simple_key_cache_stat_var_offsets[var_no];
ulonglong res= 0;
- DBUG_ENTER("p_get_key_cache_stat_value");
+ DBUG_ENTER("get_partitioned_key_cache_stat_value");
- if (var_no < 3)
+ if (var_no < NO_LONG_KEY_CACHE_STAT_VARIABLES)
{
for (i = 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
res+= (ulonglong) (*(long *) ((char *) partition + var_ofs));
}
}
@@ -5883,7 +5882,7 @@ ulonglong p_get_key_cache_stat_value(voi
{
for (i = 0; i < partitions; i++)
{
- S_KEY_CACHE_CB *partition= keycache->partition_array[i];
+ SIMPLE_KEY_CACHE_CB *partition= keycache->partition_array[i];
res+= *(ulonglong *) ((char *) partition + var_ofs);
}
}
@@ -5901,19 +5900,19 @@ ulonglong p_get_key_cache_stat_value(voi
wrappers must be used for this purpose.
*/
-static KEY_CACHE_FUNCS p_key_cache_funcs =
+static KEY_CACHE_FUNCS partitioned_key_cache_funcs =
{
- p_init_key_cache,
- p_resize_key_cache,
- p_change_key_cache_param,
- p_key_cache_read,
- p_key_cache_insert,
- p_key_cache_write,
- p_flush_key_blocks,
- p_reset_key_cache_counters,
- p_end_key_cache,
- p_get_key_cache_statistics,
- p_get_key_cache_stat_value
+ (INIT_KEY_CACHE) init_partitioned_key_cache,
+ (RESIZE_KEY_CACHE) resize_partitioned_key_cache,
+ (CHANGE_KEY_CACHE_PARAM) change_partitioned_key_cache_param,
+ (KEY_CACHE_READ) partitioned_key_cache_read,
+ (KEY_CACHE_INSERT) partitioned_key_cache_insert,
+ (KEY_CACHE_WRITE) partitioned_key_cache_write,
+ (FLUSH_KEY_BLOCKS) flush_partitioned_key_cache_blocks,
+ (RESET_KEY_CACHE_COUNTERS) reset_partitioned_key_cache_counters,
+ (END_KEY_CACHE) end_partitioned_key_cache,
+ (GET_KEY_CACHE_STATISTICS) get_partitioned_key_cache_statistics,
+ (GET_KEY_CACHE_STAT_VALUE) get_partitioned_key_cache_stat_value
};
@@ -5926,12 +5925,12 @@ static KEY_CACHE_FUNCS p_key_cache_funcs
partitioned key caches. Each type (class) has its own implementation of the
basic key cache operations used the MyISAM storage engine. The pointers
to the implementation functions are stored in two static structures of the
- type KEY_CACHE_FUNC: s_key_cache_funcs - for simple key caches, and
- p_key_cache_funcs - for partitioned key caches. When a key cache object is
- created the constructor procedure init_key_cache places a pointer to the
- corresponding table into one of its fields. The procedure also initializes
- a control block for the key cache oject and saves the pointer to this
- block in another field of the key cache object.
+ type KEY_CACHE_FUNC: simple_key_cache_funcs - for simple key caches, and
+ partitioned_key_cache_funcs - for partitioned key caches. When a key cache
+ object is created the constructor procedure init_key_cache places a pointer
+ to the corresponding table into one of its fields. The procedure also
+ initializes a control block for the key cache oject and saves the pointer
+ to this block in another field of the key cache object.
When a key cache wrapper function is invoked for a key cache object to
perform a basic key cache operation it looks into the interface table
associated with the key cache oject and calls the corresponding
@@ -5997,19 +5996,21 @@ int init_key_cache(KEY_CACHE *keycache,
{
if (partitions == 0)
{
- if (!(keycache_cb= (void *) my_malloc(sizeof(S_KEY_CACHE_CB), MYF(0))))
+ if (!(keycache_cb= (void *) my_malloc(sizeof(SIMPLE_KEY_CACHE_CB),
+ MYF(0))))
return 0;
- ((S_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
+ ((SIMPLE_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
keycache->key_cache_type= SIMPLE_KEY_CACHE;
- keycache->interface_funcs= &s_key_cache_funcs;
+ keycache->interface_funcs= &simple_key_cache_funcs;
}
else
{
- if (!(keycache_cb= (void *) my_malloc(sizeof(P_KEY_CACHE_CB), MYF(0))))
+ if (!(keycache_cb= (void *) my_malloc(sizeof(PARTITIONED_KEY_CACHE_CB),
+ MYF(0))))
return 0;
- ((P_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->key_cache_inited= 0;
keycache->key_cache_type= PARTITIONED_KEY_CACHE;
- keycache->interface_funcs= &p_key_cache_funcs;
+ keycache->interface_funcs= &partitioned_key_cache_funcs;
}
keycache->keycache_cb= keycache_cb;
keycache->key_cache_inited= 1;
@@ -6017,14 +6018,15 @@ int init_key_cache(KEY_CACHE *keycache,
if (partitions != 0)
{
- ((P_KEY_CACHE_CB *) keycache_cb)->partitions= partitions;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->partitions= partitions;
}
keycache->can_be_used= 0;
blocks= keycache->interface_funcs->init(keycache_cb, key_cache_block_size,
use_mem, division_limit,
age_threshold);
keycache->partitions= partitions ?
- ((P_KEY_CACHE_CB *) keycache_cb)->partitions : 0;
+ ((PARTITIONED_KEY_CACHE_CB *) keycache_cb)->partitions :
+ 0;
DBUG_ASSERT(partitions <= MAX_KEY_CACHE_PARTITIONS);
if (blocks > 0)
keycache->can_be_used= 1;
@@ -6037,7 +6039,7 @@ int init_key_cache(KEY_CACHE *keycache,
SYNOPSIS
resize_key_cache()
- keycache pointer to the key cache to be resized
+ keycache pointer to the key cache to be resized
key_cache_block_size size of blocks to keep cached data
use_mem total memory to use for the new key cache
division_limit new division limit (if not zero)
@@ -6074,10 +6076,10 @@ int resize_key_cache(KEY_CACHE *keycache
if (keycache->key_cache_inited)
{
if ((uint) keycache->param_partitions != keycache->partitions && use_mem)
- blocks= repartition_key_cache (keycache,
- key_cache_block_size, use_mem,
- division_limit, age_threshold,
- (uint) keycache->param_partitions);
+ blocks= repartition_key_cache(keycache,
+ key_cache_block_size, use_mem,
+ division_limit, age_threshold,
+ (uint) keycache->param_partitions);
else
{
blocks= keycache->interface_funcs->resize(keycache->keycache_cb,
@@ -6087,10 +6089,10 @@ int resize_key_cache(KEY_CACHE *keycache
if (keycache->partitions)
keycache->partitions=
- ((P_KEY_CACHE_CB *)(keycache->keycache_cb))->partitions;
+ ((PARTITIONED_KEY_CACHE_CB *)(keycache->keycache_cb))->partitions;
}
- if (blocks <= 0)
- keycache->can_be_used= 0;
+
+ keycache->can_be_used= (blocks >= 0);
}
return blocks;
}
@@ -6447,7 +6449,6 @@ int reset_key_cache_counters(const char
void get_key_cache_statistics(KEY_CACHE *keycache, uint partition_no,
KEY_CACHE_STATISTICS *key_cache_stats)
{
- bzero(key_cache_stats, sizeof(KEY_CACHE_STATISTICS));
if (keycache->key_cache_inited)
{
keycache->interface_funcs->get_stats(keycache->keycache_cb,
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-03-29 21:16:12 +0000
+++ b/sql/sql_show.cc 2010-04-01 21:26:08 +0000
@@ -2235,8 +2235,9 @@ static void update_key_cache_stat_var(KE
case offsetof(KEY_CACHE, global_cache_read):
case offsetof(KEY_CACHE, global_cache_w_requests):
case offsetof(KEY_CACHE, global_cache_write):
- var_no= 3+(ofs-offsetof(KEY_CACHE, global_cache_w_requests))/
- sizeof(ulonglong);
+ var_no= NO_LONG_KEY_CACHE_STAT_VARIABLES +
+ (ofs-offsetof(KEY_CACHE, global_cache_w_requests))/
+ sizeof(ulonglong);
*(ulonglong *)((char *) key_cache + ofs)=
get_key_cache_stat_value(key_cache, var_no);
break;
@@ -6643,13 +6644,13 @@ int store_key_cache_table_record(THD *th
KEY_CACHE *key_cache,
uint partitions, uint partition_no)
{
- KEY_CACHE_STATISTICS key_cache_stats;
+ KEY_CACHE_STATISTICS keycache_stats;
uint err;
DBUG_ENTER("store_key_cache_table_record");
- get_key_cache_statistics(key_cache, partition_no, &key_cache_stats);
+ get_key_cache_statistics(key_cache, partition_no, &keycache_stats);
- if (key_cache_stats.mem_size == 0)
+ if (!key_cache->key_cache_inited || keycache_stats.mem_size == 0)
DBUG_RETURN(0);
restore_record(table, s->default_values);
@@ -6669,15 +6670,15 @@ int store_key_cache_table_record(THD *th
table->field[2]->set_notnull();
table->field[2]->store((long) partition_no, TRUE);
}
- table->field[3]->store(key_cache_stats.mem_size, TRUE);
- table->field[4]->store(key_cache_stats.block_size, TRUE);
- table->field[5]->store(key_cache_stats.blocks_used, TRUE);
- table->field[6]->store(key_cache_stats.blocks_unused, TRUE);
- table->field[7]->store(key_cache_stats.blocks_changed, TRUE);
- table->field[8]->store(key_cache_stats.read_requests, TRUE);
- table->field[9]->store(key_cache_stats.reads, TRUE);
- table->field[10]->store(key_cache_stats.write_requests, TRUE);
- table->field[11]->store(key_cache_stats.writes, TRUE);
+ table->field[3]->store(keycache_stats.mem_size, TRUE);
+ table->field[4]->store(keycache_stats.block_size, TRUE);
+ table->field[5]->store(keycache_stats.blocks_used, TRUE);
+ table->field[6]->store(keycache_stats.blocks_unused, TRUE);
+ table->field[7]->store(keycache_stats.blocks_changed, TRUE);
+ table->field[8]->store(keycache_stats.read_requests, TRUE);
+ table->field[9]->store(keycache_stats.reads, TRUE);
+ table->field[10]->store(keycache_stats.write_requests, TRUE);
+ table->field[11]->store(keycache_stats.writes, TRUE);
err= schema_table_store_record(thd, table);
DBUG_RETURN(err);
1
0
[Maria-developers] Rev 2767: Fied problem with of compilation without dynamic plugin loading. in file:///Users/bell/maria/bzr/work-maria-5.2-plugin/
by sanja@askmonty.org 01 Apr '10
by sanja@askmonty.org 01 Apr '10
01 Apr '10
At file:///Users/bell/maria/bzr/work-maria-5.2-plugin/
------------------------------------------------------------
revno: 2767
revision-id: sanja(a)askmonty.org-20100401200509-o67qhkcgzv5s9oai
parent: sanja(a)askmonty.org-20100401143451-z7dyg1mj84zf8ue5
committer: sanja(a)askmonty.org
branch nick: work-maria-5.2-plugin
timestamp: Thu 2010-04-01 23:05:09 +0300
message:
Fied problem with of compilation without dynamic plugin loading.
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2010-04-01 14:34:51 +0000
+++ b/sql/sql_plugin.cc 2010-04-01 20:05:09 +0000
@@ -388,6 +388,7 @@ static inline void free_plugin_mem(struc
@retval TRUE ERROR
*/
+#ifdef HAVE_DLOPEN
static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
void *sym, char *dlpath,
int report)
@@ -592,6 +593,7 @@ static my_bool read_maria_plugin_info(st
DBUG_RETURN(FALSE);
}
+#endif HAVE_DLOPEN
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
1
0
Re: [Maria-developers] [Fwd: WorkLog sends out too many mail-copies to maria-developers]
by Kristian Nielsen 01 Apr '10
by Kristian Nielsen 01 Apr '10
01 Apr '10
Bryan Alsdorf <bryan(a)askmonty.org> writes:
> Here is a message from Arjen regarding worklog. I haven't messed with
> it and I believe you are currently maintaining it.
>
> Thoughts?
I agree that Worklog mail sending is annoying/broken as it is now.
Unfortunately I don't know how to fix it, and I don't have the time currently
to investigate.
One thing we could do is disable the worklog-db(a)askmonty.org alias (eg. send
it to /dev/null). This should disable sending the mails to the mailing list at
least.
- Kristian.
> -------- Original Message --------
> Subject: WorkLog sends out too many mail-copies to maria-developers
> Date: Thu, 11 Mar 2010 08:59:22 +1000
> From: Arjen Lentz <arjen(a)openquery.com>
> To: Bryan Alsdorf <bryan(a)askmonty.org>
>
> Hi Bryan
>
> I think worklog is doing fail on mailouts. it sends to maria-
> developers list as well as a direct addressee. as a result is sends
> out multiples to maria-developers. it seems...
> archivist confirms this, for one item he also got 6 identical emails.
>
> Cheers,
> Arjen.
4
3
[Maria-developers] Rev 2766: Maria WL#61 in file:///home/bell/maria/bzr/work-maria-5.2-plugin/
by sanja@askmonty.org 01 Apr '10
by sanja@askmonty.org 01 Apr '10
01 Apr '10
At file:///home/bell/maria/bzr/work-maria-5.2-plugin/
------------------------------------------------------------
revno: 2766
revision-id: sanja(a)askmonty.org-20100401143451-z7dyg1mj84zf8ue5
parent: monty(a)askmonty.org-20100401100115-iz32pn7zhx2e237e
committer: sanja(a)askmonty.org
branch nick: work-maria-5.2-plugin
timestamp: Thu 2010-04-01 17:34:51 +0300
message:
Maria WL#61
Interface for maria extensions.
Alternative plugin interface with additional info (maturity and string version).
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2010-03-15 11:51:23 +0000
+++ b/CMakeLists.txt 2010-04-01 14:34:51 +0000
@@ -260,7 +260,7 @@
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${PLUGIN_NAME}_plugin")
+ SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_${PLUGIN_NAME}_plugin")
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${PLUGIN_NAME})
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
@@ -279,7 +279,7 @@
# Special handling for partition(not really pluggable)
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
+ SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_partition_plugin")
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
# Special handling for tmp tables with the maria engine
=== modified file 'config/ac-macros/plugins.m4'
--- a/config/ac-macros/plugins.m4 2010-03-29 15:14:28 +0000
+++ b/config/ac-macros/plugins.m4 2010-04-01 14:34:51 +0000
@@ -460,7 +460,7 @@
])
])
])
- mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
+ maria_plugin_defs="$maria_plugin_defs, [builtin_maria_]$2[_plugin]"
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
m4_ifdef([$11], [
=== modified file 'configure.in'
--- a/configure.in 2010-03-29 15:13:53 +0000
+++ b/configure.in 2010-04-01 14:34:51 +0000
@@ -2872,7 +2872,7 @@
AC_SUBST(mysql_plugin_dirs)
AC_SUBST(mysql_plugin_libs)
-AC_SUBST(mysql_plugin_defs)
+AC_SUBST(maria_plugin_defs)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h 2010-03-29 15:13:53 +0000
+++ b/include/mysql/plugin.h 2010-04-01 14:34:51 +0000
@@ -57,7 +57,10 @@
Plugin API. Common for all plugin types.
*/
+/* MySQL plugin interface version */
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101
+/* MariaDB plugin interface version */
+#define MARIA_PLUGIN_INTERFACE_VERSION 0x0100
/*
The allowable types of plugins
@@ -81,6 +84,14 @@
#define PLUGIN_LICENSE_GPL_STRING "GPL"
#define PLUGIN_LICENSE_BSD_STRING "BSD"
+/* 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
+
/*
Macros for beginning and ending plugin declarations. Between
mysql_declare_plugin and mysql_declare_plugin_end there should
@@ -93,11 +104,24 @@
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
int PSIZE= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin DECLS[]= {
+
+#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
+int VERSION= MARIA_PLUGIN_INTERFACE_VERSION; \
+int PSIZE= sizeof(struct st_maria_plugin); \
+struct st_maria_plugin DECLS[]= {
+
#else
+
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
+
+#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
+MYSQL_PLUGIN_EXPORT int _maria_plugin_interface_version_= MARIA_PLUGIN_INTERFACE_VERSION; \
+MYSQL_PLUGIN_EXPORT int _maria_sizeof_struct_st_plugin_= sizeof(struct st_maria_plugin); \
+MYSQL_PLUGIN_EXPORT struct st_maria_plugin _maria_plugin_declarations_[]= {
+
#endif
#define mysql_declare_plugin(NAME) \
@@ -106,7 +130,14 @@
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_ ## NAME ## _plugin)
+#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)
+
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
+#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
/*
declarations for SHOW STATUS support in plugins
@@ -403,6 +434,30 @@
void * __reserved1; /* reserved for dependency checking */
};
+/*
+ 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) */
+ int (*init)(void *); /* the function to invoke when plugin is loaded */
+ 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 */
+ int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
+};
+
/*************************************************************************
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
*/
=== modified file 'include/mysql/plugin_auth.h.pp'
--- a/include/mysql/plugin_auth.h.pp 2010-03-29 15:13:53 +0000
+++ b/include/mysql/plugin_auth.h.pp 2010-04-01 14:34:51 +0000
@@ -77,6 +77,22 @@
struct st_mysql_sys_var **system_vars;
void * __reserved1;
};
+struct st_maria_plugin
+{
+ int type;
+ void *info;
+ const char *name;
+ const char *author;
+ const char *descr;
+ int license;
+ int (*init)(void *);
+ int (*deinit)(void *);
+ unsigned int version;
+ struct st_mysql_show_var *status_vars;
+ struct st_mysql_sys_var **system_vars;
+ const char *version_info;
+ int maturity;
+};
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
=== modified file 'plugin/auth/auth_socket.c'
--- a/plugin/auth/auth_socket.c 2010-03-29 15:13:53 +0000
+++ b/plugin/auth/auth_socket.c 2010-04-01 14:34:51 +0000
@@ -99,4 +99,21 @@
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(socket_auth)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &socket_auth_handler,
+ "socket_peercred",
+ "Sergei Golubchik",
+ "Unix Socket based authentication",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+}
+mysql_declare_plugin_end;
=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c 2010-03-31 18:37:45 +0000
+++ b/plugin/auth/dialog.c 2010-04-01 14:34:51 +0000
@@ -171,6 +171,38 @@
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(dialog)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &two_handler,
+ "two_questions",
+ "Sergei Golubchik",
+ "Dialog plugin demo 1",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+},
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &three_handler,
+ "three_attempts",
+ "Sergei Golubchik",
+ "Dialog plugin demo 2",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+}
+maria_declare_plugin_end;
/********************* CLIENT SIDE ***************************************/
/*
=== modified file 'plugin/daemon_example/daemon_example.cc'
--- a/plugin/daemon_example/daemon_example.cc 2007-06-27 14:49:12 +0000
+++ b/plugin/daemon_example/daemon_example.cc 2010-04-01 14:34:51 +0000
@@ -200,3 +200,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_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 */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'plugin/fulltext/plugin_example.c'
--- a/plugin/fulltext/plugin_example.c 2010-01-04 17:54:42 +0000
+++ b/plugin/fulltext/plugin_example.c 2010-04-01 14:34:51 +0000
@@ -270,4 +270,21 @@
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(ftexample)
+{
+ MYSQL_FTPARSER_PLUGIN, /* type */
+ &simple_parser_descriptor, /* descriptor */
+ "simple_parser", /* name */
+ "MySQL AB", /* 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 */
+ "0.01", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2010-03-29 15:13:53 +0000
+++ b/sql/ha_ndbcluster.cc 2010-04-01 14:34:51 +0000
@@ -10564,6 +10564,23 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(ndbcluster)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &ndbcluster_storage_engine,
+ ndbcluster_hton_name,
+ "MySQL AB",
+ "Clustered, fault-tolerant tables",
+ PLUGIN_LICENSE_GPL,
+ ndbcluster_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ ndb_status_variables_export,/* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
#else
int Sun_ar_require_a_symbol_here= 0;
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2010-03-15 11:51:23 +0000
+++ b/sql/ha_partition.cc 2010-04-01 14:34:51 +0000
@@ -6715,5 +6715,22 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(partition)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &partition_storage_engine,
+ "partition",
+ "Mikael Ronstrom, MySQL AB",
+ "Partition Storage Engine Helper",
+ PLUGIN_LICENSE_GPL,
+ partition_initialize, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
#endif
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2010-04-01 09:04:26 +0000
+++ b/sql/log.cc 2010-04-01 14:34:51 +0000
@@ -6036,3 +6036,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(binlog)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &binlog_storage_engine,
+ "binlog",
+ "MySQL AB",
+ "This is a pseudo storage engine to represent the binlog in a transaction",
+ PLUGIN_LICENSE_GPL,
+ binlog_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2010-04-01 09:04:26 +0000
+++ b/sql/sql_acl.cc 2010-04-01 14:34:51 +0000
@@ -8260,3 +8260,35 @@
}
mysql_declare_plugin_end;
+maria_declare_plugin(mysql_password)
+{
+ MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
+ &native_password_handler, /* type descriptor */
+ native_password_plugin_name.str, /* Name */
+ "R.J.Silk, Sergei Golubchik", /* Author */
+ "Native MySQL authentication", /* Description */
+ PLUGIN_LICENSE_GPL, /* License */
+ NULL, /* Init function */
+ NULL, /* Deinit function */
+ 0x0100, /* Version (1.0) */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* String version */
+ MariaDB_PLUGIN_MATURITY_BETA /* Maturity */
+},
+{
+ MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
+ &old_password_handler, /* type descriptor */
+ old_password_plugin_name.str, /* Name */
+ "R.J.Silk, Sergei Golubchik", /* Author */
+ "Old MySQL-4.0 authentication", /* Description */
+ PLUGIN_LICENSE_GPL, /* License */
+ NULL, /* Init function */
+ NULL, /* Deinit function */
+ 0x0100, /* Version (1.0) */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* String version */
+ MariaDB_PLUGIN_MATURITY_BETA /* Maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/sql_builtin.cc.in'
--- a/sql/sql_builtin.cc.in 2010-03-29 15:13:53 +0000
+++ b/sql/sql_builtin.cc.in 2010-04-01 14:34:51 +0000
@@ -16,13 +16,12 @@
#include <my_global.h>
#include <mysql/plugin.h>
-typedef struct st_mysql_plugin builtin_plugin[];
-
-extern builtin_plugin
- builtin_binlog_plugin, builtin_mysql_password_plugin@mysql_plugin_defs@;
-
-struct st_mysql_plugin *mysqld_builtins[]=
+typedef struct st_maria_plugin builtin_maria_plugin[];
+
+extern builtin_maria_plugin
+ builtin_maria_binlog_plugin, builtin_maria_mysql_password_plugin@maria_plugin_defs@;
+
+struct st_maria_plugin *mariadb_builtins[]=
{
- builtin_binlog_plugin, builtin_mysql_password_plugin@mysql_plugin_defs@,(struct st_mysql_plugin *)0
+ builtin_maria_binlog_plugin, builtin_maria_mysql_password_plugin@maria_plugin_defs@,(struct st_maria_plugin *)0
};
-
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2010-03-29 15:13:53 +0000
+++ b/sql/sql_plugin.cc 2010-04-01 14:34:51 +0000
@@ -20,7 +20,7 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
-extern struct st_mysql_plugin *mysqld_builtins[];
+extern struct st_maria_plugin *mariadb_builtins[];
/**
@note The order of the enumeration is critical.
@@ -78,6 +78,14 @@
"_mysql_sizeof_struct_st_plugin_";
static const char *plugin_declarations_sym= "_mysql_plugin_declarations_";
static int min_plugin_interface_version= MYSQL_PLUGIN_INTERFACE_VERSION & ~0xFF;
+static const char *maria_plugin_interface_version_sym=
+ "_maria_plugin_interface_version_";
+static const char *maria_sizeof_st_plugin_sym=
+ "_maria_sizeof_struct_st_plugin_";
+static const char *maria_plugin_declarations_sym=
+ "_maria_plugin_declarations_";
+static int min_maria_plugin_interface_version=
+ MARIA_PLUGIN_INTERFACE_VERSION & ~0xFF;
#endif
/* Note that 'int version' must be the first field of every plugin
@@ -211,7 +219,7 @@
const char *list);
static int test_plugin_options(MEM_ROOT *, struct st_plugin_int *,
int *, char **);
-static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *,
+static bool register_builtin(struct st_maria_plugin *, struct st_plugin_int *,
struct st_plugin_int **);
static void unlock_variables(THD *thd, struct system_variables *vars);
static void cleanup_variables(THD *thd, struct system_variables *vars);
@@ -368,6 +376,223 @@
}
+/**
+ Reads data from mysql plugin interface
+
+ @param plugin_dl Structure where the data should be put
+ @param sym Reverence on version info
+ @param dlpath Path to the module
+ @param report What errors should be reported
+
+ @retval FALSE OK
+ @retval TRUE ERROR
+*/
+
+static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
+ void *sym, char *dlpath,
+ int report)
+{
+ DBUG_ENTER("read_maria_plugin_info");
+ /* Determine interface version */
+ if (!sym)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
+ DBUG_RETURN(TRUE);
+ }
+ plugin_dl->mariaversion= 0;
+ plugin_dl->mysqlversion= *(int *)sym;
+ /* Versioning */
+ if (plugin_dl->mysqlversion < min_plugin_interface_version ||
+ (plugin_dl->mysqlversion >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+ "plugin interface version mismatch");
+ DBUG_RETURN(TRUE);
+ }
+ /* Find plugin declarations */
+ if (!(sym= dlsym(plugin_dl->handle, plugin_declarations_sym)))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
+ DBUG_RETURN(TRUE);
+ }
+
+ /* convert mysql declaration to maria one */
+ {
+ int i;
+ uint sizeof_st_plugin;
+ struct st_mysql_plugin *old;
+ struct st_maria_plugin *cur;
+ char *ptr= (char *)sym;
+
+ if ((sym= dlsym(plugin_dl->handle, sizeof_st_plugin_sym)))
+ sizeof_st_plugin= *(int *)sym;
+ else
+ {
+ DBUG_ASSERT(min_plugin_interface_version == 0);
+ sizeof_st_plugin= (int)offsetof(struct st_mysql_plugin, version);
+ }
+
+ for (i= 0;
+ ((struct st_mysql_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ /* no op */;
+
+ cur= (struct st_maria_plugin*)
+ my_malloc((i + 1) * sizeof(struct st_maria_plugin),
+ MYF(MY_ZEROFILL|MY_WME));
+ if (!cur)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ All st_plugin fields not initialized in the plugin explicitly, are
+ set to 0. It matches C standard behaviour for struct initializers that
+ have less values than the struct definition.
+ */
+ for (i=0;
+ (old= (struct st_mysql_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ {
+
+ cur->type= old->type;
+ cur->info= old->info;
+ cur->name= old->name;
+ cur->author= old->author;
+ cur->descr= old->descr;
+ cur->license= old->license;
+ cur->init= old->init;
+ cur->deinit= old->deinit;
+ cur->version= old->version;
+ cur->status_vars= old->status_vars;
+ cur->system_vars= old->system_vars;
+ /*
+ Something like this should be added to process
+ new mysql plugin versions:
+ if (plugin_dl->mysqlversion > 0x0101)
+ {
+ cur->newfield= CONSTANT_MEANS_UNKNOWN;
+ }
+ else
+ {
+ cur->newfield= old->newfield;
+ }
+ */
+ /* Maria only fields */
+ cur->version_info= "Unknown";
+ cur->maturity= MariaDB_PLUGIN_MATURITY_UNKNOWN;
+ }
+ plugin_dl->allocated= true;
+ plugin_dl->plugins= (struct st_maria_plugin *)cur;
+ }
+
+ DBUG_RETURN(FALSE);
+}
+
+
+/**
+ Reads data from maria plugin interface
+
+ @param plugin_dl Structure where the data should be put
+ @param sym Reverence on version info
+ @param dlpath Path to the module
+ @param report what errors should be reported
+
+ @retval FALSE OK
+ @retval TRUE ERROR
+*/
+
+static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
+ void *sym, char *dlpath,
+ int report)
+{
+ DBUG_ENTER("read_maria_plugin_info");
+
+ /* Determine interface version */
+ if (!(sym))
+ {
+ /*
+ Actually this branch impossible because in case of absence of maria
+ version we try mysql version.
+ */
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY,
+ maria_plugin_interface_version_sym);
+ DBUG_RETURN(TRUE);
+ }
+ plugin_dl->mariaversion= *(int *)sym;
+ plugin_dl->mysqlversion= 0;
+ /* Versioning */
+ if (plugin_dl->mariaversion < min_maria_plugin_interface_version ||
+ (plugin_dl->mariaversion >> 8) > (MARIA_PLUGIN_INTERFACE_VERSION >> 8))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+ "plugin interface version mismatch");
+ DBUG_RETURN(TRUE);
+ }
+ /* Find plugin declarations */
+ if (!(sym= dlsym(plugin_dl->handle, maria_plugin_declarations_sym)))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, maria_plugin_declarations_sym);
+ DBUG_RETURN(TRUE);
+ }
+ if (plugin_dl->mariaversion != MARIA_PLUGIN_INTERFACE_VERSION)
+ {
+ uint sizeof_st_plugin;
+ struct st_maria_plugin *old, *cur;
+ char *ptr= (char *)sym;
+
+ if ((sym= dlsym(plugin_dl->handle, maria_sizeof_st_plugin_sym)))
+ sizeof_st_plugin= *(int *)sym;
+ else
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, maria_sizeof_st_plugin_sym);
+ DBUG_RETURN(TRUE);
+ }
+
+ if (sizeof_st_plugin != sizeof(st_mysql_plugin))
+ {
+ int i;
+ for (i= 0;
+ ((struct st_maria_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ /* no op */;
+
+ cur= (struct st_maria_plugin*)
+ my_malloc((i + 1) * sizeof(struct st_maria_plugin),
+ MYF(MY_ZEROFILL|MY_WME));
+ if (!cur)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ All st_plugin fields not initialized in the plugin explicitly, are
+ set to 0. It matches C standard behaviour for struct initializers that
+ have less values than the struct definition.
+ */
+ for (i=0;
+ (old= (struct st_maria_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ memcpy(cur + i, old, min(sizeof(cur[i]), sizeof_st_plugin));
+
+ sym= cur;
+ plugin_dl->allocated= true;
+ }
+ }
+ plugin_dl->plugins= (struct st_maria_plugin *)sym;
+
+ DBUG_RETURN(FALSE);
+}
+
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
#ifdef HAVE_DLOPEN
@@ -415,22 +640,21 @@
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
DBUG_RETURN(0);
}
- /* Determine interface version */
- if (!(sym= dlsym(plugin_dl.handle, plugin_interface_version_sym)))
+
+ /* Checks which plugin interface present and reads info */
+ if (!(sym= dlsym(plugin_dl.handle, maria_plugin_interface_version_sym)))
{
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
- DBUG_RETURN(0);
+ if (read_mysql_plugin_info(&plugin_dl,
+ dlsym(plugin_dl.handle,
+ plugin_interface_version_sym),
+ dlpath,
+ report))
+ DBUG_RETURN(0);
}
- plugin_dl.version= *(int *)sym;
- /* Versioning */
- if (plugin_dl.version < min_plugin_interface_version ||
- (plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
+ else
{
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
- "plugin interface version mismatch");
- DBUG_RETURN(0);
+ if (read_maria_plugin_info(&plugin_dl, sym, dlpath, report))
+ DBUG_RETURN(0);
}
/* link the services in */
@@ -438,7 +662,7 @@
{
if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
{
- uint ver= (uint)(intptr)*(void**)sym;
+ uint ver= (uint)(intptr) *(void **)sym;
if (ver > list_of_services[i].version ||
(ver >> 8) < (list_of_services[i].version >> 8))
{
@@ -449,72 +673,9 @@
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf);
DBUG_RETURN(0);
}
- *(void**)sym= list_of_services[i].service;
- }
- }
-
- /* Find plugin declarations */
- if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym)))
- {
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
- DBUG_RETURN(0);
- }
-
- if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
- {
- uint sizeof_st_plugin;
- struct st_mysql_plugin *old, *cur;
- char *ptr= (char *)sym;
-
- if ((sym= dlsym(plugin_dl.handle, sizeof_st_plugin_sym)))
- sizeof_st_plugin= *(int *)sym;
- else
- {
-#ifdef ERROR_ON_NO_SIZEOF_PLUGIN_SYMBOL
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, sizeof_st_plugin_sym);
- DBUG_RETURN(0);
-#else
- /*
- When the following assert starts failing, we'll have to switch
- to the upper branch of the #ifdef
- */
- DBUG_ASSERT(min_plugin_interface_version == 0);
- sizeof_st_plugin= (int)offsetof(struct st_mysql_plugin, version);
-#endif
- }
-
- if (sizeof_st_plugin != sizeof(st_mysql_plugin))
- {
- for (i= 0;
- ((struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
- i++)
- /* no op */;
-
- cur= (struct st_mysql_plugin*)
- my_malloc((i+1)*sizeof(struct st_mysql_plugin), MYF(MY_ZEROFILL|MY_WME));
- if (!cur)
- {
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
- DBUG_RETURN(0);
- }
- /*
- All st_plugin fields not initialized in the plugin explicitly, are
- set to 0. It matches C standard behaviour for struct initializers that
- have less values than the struct definition.
- */
- for (i=0;
- (old=(struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
- i++)
- memcpy(cur+i, old, min(sizeof(cur[i]), sizeof_st_plugin));
-
- sym= cur;
- plugin_dl.allocated= true;
- }
- }
- plugin_dl.plugins= (struct st_mysql_plugin *)sym;
+ *(void **)sym= list_of_services[i].service;
+ }
+ }
/* Duplicate and convert dll name */
plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
@@ -756,7 +917,7 @@
int *argc, char **argv, int report)
{
struct st_plugin_int tmp;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
DBUG_ENTER("plugin_add");
if (plugin_find_internal(name, MYSQL_ANY_PLUGIN))
{
@@ -1161,8 +1322,8 @@
{
uint i;
bool is_myisam;
- struct st_mysql_plugin **builtins;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin **builtins;
+ struct st_maria_plugin *plugin;
struct st_plugin_int tmp, *plugin_ptr, **reap;
MEM_ROOT tmp_root;
bool reaped_mandatory_plugin= FALSE;
@@ -1201,7 +1362,7 @@
/*
First we register builtin plugins
*/
- for (builtins= mysqld_builtins; *builtins; builtins++)
+ for (builtins= mariadb_builtins; *builtins; builtins++)
{
for (plugin= *builtins; plugin->info; plugin++)
{
@@ -1316,7 +1477,7 @@
}
-static bool register_builtin(struct st_mysql_plugin *plugin,
+static bool register_builtin(struct st_maria_plugin *plugin,
struct st_plugin_int *tmp,
struct st_plugin_int **ptr)
{
@@ -1352,7 +1513,7 @@
RETURN
false - plugin registered successfully
*/
-bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
+bool plugin_register_builtin(THD *thd, struct st_maria_plugin *plugin)
{
struct st_plugin_int tmp, *ptr;
bool result= true;
@@ -1481,7 +1642,7 @@
char buffer[FN_REFLEN];
LEX_STRING name= {buffer, 0}, dl= {NULL, 0}, *str= &name;
struct st_plugin_dl *plugin_dl;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
char *p= buffer;
DBUG_ENTER("plugin_load_list");
while (list)
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2010-03-15 11:51:23 +0000
+++ b/sql/sql_plugin.h 2010-04-01 14:34:51 +0000
@@ -52,8 +52,9 @@
{
LEX_STRING dl;
void *handle;
- struct st_mysql_plugin *plugins;
- int version;
+ struct st_maria_plugin *plugins;
+ int mysqlversion;
+ int mariaversion;
bool allocated;
uint ref_count; /* number of plugins loaded from the library */
};
@@ -63,7 +64,7 @@
struct st_plugin_int
{
LEX_STRING name;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
struct st_plugin_dl *plugin_dl;
uint state;
uint ref_count; /* number of threads using the plugin */
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-03-15 11:51:23 +0000
+++ b/sql/sql_show.cc 2010-04-01 14:34:51 +0000
@@ -94,11 +94,21 @@
return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff);
}
+
+static const LEX_STRING maturity_name[]={
+ { C_STRING_WITH_LEN("Unknown") },
+ { C_STRING_WITH_LEN("Experimental") },
+ { C_STRING_WITH_LEN("Alpha") },
+ { C_STRING_WITH_LEN("Beta") },
+ { C_STRING_WITH_LEN("Gamma") },
+ { C_STRING_WITH_LEN("Stable") }};
+
+
static my_bool show_plugins(THD *thd, plugin_ref plugin,
void *arg)
{
TABLE *table= (TABLE*) arg;
- struct st_mysql_plugin *plug= plugin_decl(plugin);
+ struct st_maria_plugin *plug= plugin_decl(plugin);
struct st_plugin_dl *plugin_dl= plugin_dlib(plugin);
CHARSET_INFO *cs= system_charset_info;
char version_buf[20];
@@ -143,7 +153,7 @@
table->field[5]->set_notnull();
table->field[6]->store(version_buf,
make_version_string(version_buf, sizeof(version_buf),
- plugin_dl->version),
+ plugin_dl->mariaversion),
cs);
table->field[6]->set_notnull();
}
@@ -186,6 +196,26 @@
}
table->field[9]->set_notnull();
+ if ((uint) plug->maturity <= MariaDB_PLUGIN_MATURITY_STABLE)
+ table->field[10]->store(maturity_name[plug->maturity].str,
+ maturity_name[plug->maturity].length,
+ cs);
+ else
+ {
+ DBUG_ASSERT(0);
+ table->field[10]->store("Unknown", 7, cs);
+ }
+ table->field[10]->set_notnull();
+
+ if (plug->version_info)
+ {
+ table->field[11]->store(plug->version_info,
+ strlen(plug->version_info), cs);
+ table->field[11]->set_notnull();
+ }
+ else
+ table->field[11]->set_null();
+
return schema_table_store_record(thd, table);
}
@@ -4398,7 +4428,7 @@
if (plugin_state(plugin) != PLUGIN_IS_READY)
{
- struct st_mysql_plugin *plug= plugin_decl(plugin);
+ struct st_maria_plugin *plug= plugin_decl(plugin);
if (!(wild && wild[0] &&
wild_case_compare(scs, plug->name,wild)))
{
@@ -7095,6 +7125,8 @@
{"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License", SKIP_OPEN_TABLE},
+ {"PLUGIN_MATURITY", 12, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_AUTH_VERSION", 80, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2010-03-04 08:03:07 +0000
+++ b/storage/archive/ha_archive.cc 2010-04-01 14:34:51 +0000
@@ -1655,4 +1655,21 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(archive)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &archive_storage_engine,
+ "ARCHIVE",
+ "Brian Aker, MySQL AB",
+ "Archive storage engine",
+ PLUGIN_LICENSE_GPL,
+ archive_db_init, /* Plugin Init */
+ archive_db_done, /* Plugin Deinit */
+ 0x0300 /* 3.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc 2009-10-16 10:29:42 +0000
+++ b/storage/blackhole/ha_blackhole.cc 2010-04-01 14:34:51 +0000
@@ -369,3 +369,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(blackhole)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &blackhole_storage_engine,
+ "BLACKHOLE",
+ "MySQL AB",
+ "/dev/null storage engine (anything you write to it disappears)",
+ PLUGIN_LICENSE_GPL,
+ blackhole_init, /* Plugin Init */
+ blackhole_fini, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc 2009-12-03 11:19:05 +0000
+++ b/storage/csv/ha_tina.cc 2010-04-01 14:34:51 +0000
@@ -1636,4 +1636,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
-
+maria_declare_plugin(csv)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &csv_storage_engine,
+ "CSV",
+ "Brian Aker, MySQL AB",
+ "CSV storage engine",
+ PLUGIN_LICENSE_GPL,
+ tina_init_func, /* Plugin Init */
+ tina_done_func, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2010-03-03 14:44:14 +0000
+++ b/storage/example/ha_example.cc 2010-04-01 14:34:51 +0000
@@ -924,3 +924,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(example)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &example_storage_engine,
+ "EXAMPLE",
+ "Brian Aker, MySQL AB",
+ "Example storage engine",
+ PLUGIN_LICENSE_GPL,
+ example_init_func, /* Plugin Init */
+ example_done_func, /* Plugin Deinit */
+ 0x0001 /* 0.1 */,
+ func_status, /* status variables */
+ example_system_variables, /* system variables */
+ "0.1", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2009-09-07 20:50:10 +0000
+++ b/storage/federated/ha_federated.cc 2010-04-01 14:34:51 +0000
@@ -3379,3 +3379,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(federated)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &federated_storage_engine,
+ "FEDERATED",
+ "Patrick Galbraith and Brian Aker, MySQL AB",
+ "Federated MySQL storage engine",
+ PLUGIN_LICENSE_GPL,
+ federated_db_init, /* Plugin Init */
+ federated_done, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/federatedx/ha_federatedx.cc'
--- a/storage/federatedx/ha_federatedx.cc 2010-03-10 10:32:14 +0000
+++ b/storage/federatedx/ha_federatedx.cc 2010-04-01 14:34:51 +0000
@@ -3505,9 +3505,26 @@
PLUGIN_LICENSE_GPL,
federatedx_db_init, /* Plugin Init */
federatedx_done, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
+ 0x0200 /* 2.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(federated)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &federatedx_storage_engine,
+ "FEDERATED",
+ "Patrick Galbraith",
+ "FederatedX pluggable storage engine",
+ PLUGIN_LICENSE_GPL,
+ federatedx_db_init, /* Plugin Init */
+ federatedx_done, /* Plugin Deinit */
+ 0x0200 /* 2.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "2.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc 2009-09-07 20:50:10 +0000
+++ b/storage/heap/ha_heap.cc 2010-04-01 14:34:51 +0000
@@ -767,3 +767,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(heap)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &heap_storage_engine,
+ "MEMORY",
+ "MySQL AB",
+ "Hash based, stored in memory, useful for temporary tables",
+ PLUGIN_LICENSE_GPL,
+ heap_init,
+ NULL,
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/ibmdb2i/ha_ibmdb2i.cc'
--- a/storage/ibmdb2i/ha_ibmdb2i.cc 2009-12-11 07:01:16 +0000
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc 2010-04-01 14:34:51 +0000
@@ -3357,3 +3357,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(ibmdb2i)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &ibmdb2i_storage_engine,
+ "IBMDB2I",
+ "The IBM development team in Rochester, Minnesota",
+ "IBM DB2 for i Storage Engine",
+ PLUGIN_LICENSE_GPL,
+ ibmdb2i_init_func, /* Plugin Init */
+ ibmdb2i_done_func, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ ibmdb2i_system_variables, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_UNKNOWN /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2010-03-15 11:51:23 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2010-04-01 14:34:51 +0000
@@ -8930,6 +8930,23 @@
NULL /* reserved */
}
mysql_declare_plugin_end;
+maria_declare_plugin(innobase)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &innobase_storage_engine,
+ innobase_hton_name,
+ "Innobase OY",
+ "Supports transactions, row-level locking, and foreign keys",
+ PLUGIN_LICENSE_GPL,
+ innobase_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ innodb_status_variables_export, /* status variables */
+ innobase_system_variables, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE, /* maturity */
+}
+maria_declare_plugin_end;
/** @brief Initialize the default value of innodb_commit_concurrency.
=== modified file 'storage/innodb_plugin/handler/i_s.cc'
--- a/storage/innodb_plugin/handler/i_s.cc 2009-10-12 12:00:56 +0000
+++ b/storage/innodb_plugin/handler/i_s.cc 2010-04-01 14:34:51 +0000
@@ -455,6 +455,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_trx_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_TRX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB transactions"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_trx_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
static ST_FIELD_INFO innodb_locks_fields_info[] =
{
@@ -730,6 +783,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_locks_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCKS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB conflicting locks"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_locks_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
{
@@ -913,6 +1019,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Innobase Oy"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_lock_waits_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Common function to fill any of the dynamic tables:
INFORMATION_SCHEMA.innodb_trx
@@ -1245,6 +1404,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1295,6 +1507,60 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
{
@@ -1511,6 +1777,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1561,6 +1880,60 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Unbind a dynamic INFORMATION_SCHEMA table.
@return 0 on success */
=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc 2010-03-15 11:51:23 +0000
+++ b/storage/maria/ha_maria.cc 2010-04-01 14:34:51 +0000
@@ -3471,9 +3471,26 @@
PLUGIN_LICENSE_GPL,
ha_maria_init, /* Plugin Init */
NULL, /* Plugin Deinit */
- 0x0100, /* 1.0 */
+ 0x0105, /* 1.5 */
status_variables, /* status variables */
system_variables, /* system variables */
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(maria)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &maria_storage_engine,
+ "MARIA",
+ "MySQL AB",
+ "Crash-safe tables with MyISAM heritage",
+ PLUGIN_LICENSE_GPL,
+ ha_maria_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0105, /* 1.5 */
+ status_variables, /* status variables */
+ system_variables, /* system variables */
+ "1.5", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2010-01-04 17:54:42 +0000
+++ b/storage/myisam/ha_myisam.cc 2010-04-01 14:34:51 +0000
@@ -2174,6 +2174,23 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(myisam)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &myisam_storage_engine,
+ "MyISAM",
+ "MySQL AB",
+ "Default engine as of MySQL 3.23 with great performance",
+ PLUGIN_LICENSE_GPL,
+ myisam_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
#ifdef HAVE_QUERY_CACHE
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2010-03-30 12:36:49 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2010-04-01 14:34:51 +0000
@@ -1289,3 +1289,20 @@
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(myisammrg)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &myisammrg_storage_engine,
+ "MRG_MYISAM",
+ "MySQL AB",
+ "Collection of identical MyISAM tables",
+ PLUGIN_LICENSE_GPL,
+ myisammrg_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc 2010-03-31 18:37:45 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc 2010-04-01 14:34:51 +0000
@@ -5919,6 +5919,40 @@
drizzle_declare_plugin_end;
#else
mysql_declare_plugin_end;
+#ifdef MARIADB_BASE_VERSION
+maria_declare_plugin(pbxt)
+{ /* PBXT */
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &pbxt_storage_engine,
+ "PBXT",
+ "Paul McCullagh, PrimeBase Technologies GmbH",
+ "High performance, multi-versioning transactional engine",
+ PLUGIN_LICENSE_GPL,
+ pbxt_init, /* Plugin Init */
+ pbxt_end, /* Plugin Deinit */
+ 0x0001 /* 0.1 */,
+ NULL, /* status variables */
+ pbxt_system_variables, /* system variables */
+ "1.0.09g RC3", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+},
+{ /* PBXT_STATISTICS */
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
+ &pbxt_statitics,
+ "PBXT_STATISTICS",
+ "Paul McCullagh, PrimeBase Technologies GmbH",
+ "PBXT internal system statitics",
+ PLUGIN_LICENSE_GPL,
+ pbxt_init_statistics, /* plugin init */
+ pbxt_exit_statistics, /* plugin deinit */
+ 0x0005,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0.09g RC3", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
+#endif
#endif
#if defined(XT_WIN) && defined(XT_COREDUMP)
=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- a/storage/xtradb/handler/ha_innodb.cc 2010-02-01 06:14:12 +0000
+++ b/storage/xtradb/handler/ha_innodb.cc 2010-04-01 14:34:51 +0000
@@ -10818,6 +10818,39 @@
i_s_innodb_admin_command,
i_s_innodb_patches
mysql_declare_plugin_end;
+maria_declare_plugin(innobase)
+{ /* InnoDB */
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &innobase_storage_engine,
+ innobase_hton_name,
+ "Innobase Oy",
+ "Supports transactions, row-level locking, and foreign keys",
+ PLUGIN_LICENSE_GPL,
+ innobase_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ INNODB_VERSION_SHORT,
+ innodb_status_variables_export,/* status variables */
+ innobase_system_variables, /* system variables */
+ INNODB_VERSION_STR, /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+},
+i_s_innodb_rseg_maria,
+i_s_innodb_buffer_pool_pages_maria,
+i_s_innodb_buffer_pool_pages_index_maria,
+i_s_innodb_buffer_pool_pages_blob_maria,
+i_s_innodb_trx_maria,
+i_s_innodb_locks_maria,
+i_s_innodb_lock_waits_maria,
+i_s_innodb_cmp_maria,
+i_s_innodb_cmp_reset_maria,
+i_s_innodb_cmpmem_maria,
+i_s_innodb_cmpmem_reset_maria,
+i_s_innodb_table_stats_maria,
+i_s_innodb_index_stats_maria,
+i_s_innodb_admin_command_maria,
+i_s_innodb_patches_maria
+maria_declare_plugin_end;
+
/** @brief Initialize the default value of innodb_commit_concurrency.
=== modified file 'storage/xtradb/handler/i_s.cc'
--- a/storage/xtradb/handler/i_s.cc 2010-03-31 20:50:54 +0000
+++ b/storage/xtradb/handler/i_s.cc 2010-04-01 14:34:51 +0000
@@ -393,6 +393,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_patches_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "XTRADB_ENHANCEMENTS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Percona"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Enhancements applied to InnoDB plugin"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_patches_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
{
@@ -1040,6 +1093,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1089,6 +1195,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_index_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1138,6 +1297,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_blob_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
static ST_FIELD_INFO innodb_trx_fields_info[] =
@@ -1373,6 +1585,60 @@
STRUCT_FLD(__reserved1, NULL)
};
+
+UNIV_INTERN struct st_maria_plugin i_s_innodb_trx_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_TRX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB transactions"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_trx_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
static ST_FIELD_INFO innodb_locks_fields_info[] =
{
@@ -1648,6 +1914,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_locks_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCKS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB conflicting locks"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_locks_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
{
@@ -1831,6 +2150,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Innobase Oy"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_lock_waits_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Common function to fill any of the dynamic tables:
INFORMATION_SCHEMA.innodb_trx
@@ -2163,6 +2535,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -2213,6 +2638,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
{
@@ -2431,6 +2909,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -2481,6 +3012,60 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Unbind a dynamic INFORMATION_SCHEMA table.
@return 0 on success */
@@ -2660,6 +3245,59 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_rseg_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_RSEG"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB rollback segment information"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_rseg_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/***********************************************************************
*/
static ST_FIELD_INFO i_s_innodb_table_stats_info[] =
@@ -2940,6 +3578,23 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_table_stats_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "INNODB_TABLE_STATS"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "InnoDB table statistics in memory"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_table_stats_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_index_stats =
{
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
@@ -2956,6 +3611,23 @@
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_index_stats_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "INNODB_INDEX_STATS"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "InnoDB index statistics in memory"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_index_stats_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/***********************************************************************
*/
static ST_FIELD_INFO i_s_innodb_admin_command_info[] =
@@ -3121,3 +3793,20 @@
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(__reserved1, NULL)
};
+
+UNIV_INTERN struct st_maria_plugin i_s_innodb_admin_command_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "XTRADB_ADMIN_COMMAND"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "XtraDB specific command acceptor"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_admin_command_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
=== modified file 'storage/xtradb/handler/i_s.h'
--- a/storage/xtradb/handler/i_s.h 2009-11-04 20:11:12 +0000
+++ b/storage/xtradb/handler/i_s.h 2010-04-01 14:34:51 +0000
@@ -42,4 +42,20 @@
extern struct st_mysql_plugin i_s_innodb_index_stats;
extern struct st_mysql_plugin i_s_innodb_admin_command;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_maria;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_index_maria;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_blob_maria;
+extern struct st_maria_plugin i_s_innodb_trx_maria;
+extern struct st_maria_plugin i_s_innodb_locks_maria;
+extern struct st_maria_plugin i_s_innodb_lock_waits_maria;
+extern struct st_maria_plugin i_s_innodb_cmp_maria;
+extern struct st_maria_plugin i_s_innodb_cmp_reset_maria;
+extern struct st_maria_plugin i_s_innodb_cmpmem_maria;
+extern struct st_maria_plugin i_s_innodb_cmpmem_reset_maria;
+extern struct st_maria_plugin i_s_innodb_patches_maria;
+extern struct st_maria_plugin i_s_innodb_rseg_maria;
+extern struct st_maria_plugin i_s_innodb_table_stats_maria;
+extern struct st_maria_plugin i_s_innodb_index_stats_maria;
+extern struct st_maria_plugin i_s_innodb_admin_command_maria;
+
#endif /* i_s_h */
1
0
[Maria-developers] Rev 2761: Maria WL#61 in file:///Users/bell/maria/bzr/work-maria-5.2-engine-backup/
by sanja@askmonty.org 01 Apr '10
by sanja@askmonty.org 01 Apr '10
01 Apr '10
At file:///Users/bell/maria/bzr/work-maria-5.2-engine-backup/
------------------------------------------------------------
revno: 2761
revision-id: sanja(a)askmonty.org-20100401121502-80l92vwisynnoizv
parent: sanja(a)askmonty.org-20100330123515-4p8q03xccl3d6k59
committer: sanja(a)askmonty.org
branch nick: work-maria-5.2-engine-backup
timestamp: Thu 2010-04-01 15:15:02 +0300
message:
Maria WL#61
Interface for maria extensions.
Alternative plugin interface with additional info (maturity and string version).
=== modified file 'CMakeLists.txt'
--- a/CMakeLists.txt 2010-03-15 11:51:23 +0000
+++ b/CMakeLists.txt 2010-04-01 12:15:02 +0000
@@ -260,7 +260,7 @@ FOREACH(SUBDIR ${STORAGE_SUBDIRS})
ENDIF(WITH_${ENGINE}_STORAGE_ENGINE AND MYSQL_PLUGIN_STATIC)
IF (ENGINE_BUILD_TYPE STREQUAL "STATIC")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_${PLUGIN_NAME}_plugin")
+ SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_${PLUGIN_NAME}_plugin")
SET (MYSQLD_STATIC_ENGINE_LIBS ${MYSQLD_STATIC_ENGINE_LIBS} ${PLUGIN_NAME})
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_${ENGINE}_STORAGE_ENGINE")
SET (WITH_${ENGINE}_STORAGE_ENGINE TRUE)
@@ -279,7 +279,7 @@ ENDFOREACH(SUBDIR ${STORAGE_SUBDIRS})
# Special handling for partition(not really pluggable)
IF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
SET (STORAGE_ENGINE_DEFS "${STORAGE_ENGINE_DEFS} -DWITH_PARTITION_STORAGE_ENGINE")
- SET (mysql_plugin_defs "${mysql_plugin_defs},builtin_partition_plugin")
+ SET (maria_plugin_defs "${maria_plugin_defs},builtin_maria_partition_plugin")
ENDIF(NOT WITHOUT_PARTITION_STORAGE_ENGINE)
# Special handling for tmp tables with the maria engine
=== modified file 'config/ac-macros/plugins.m4'
--- a/config/ac-macros/plugins.m4 2010-03-29 15:14:28 +0000
+++ b/config/ac-macros/plugins.m4 2010-04-01 12:15:02 +0000
@@ -460,7 +460,7 @@ dnl Although this is "pretty", it breaks
])
])
])
- mysql_plugin_defs="$mysql_plugin_defs, [builtin_]$2[_plugin]"
+ maria_plugin_defs="$maria_plugin_defs, [builtin_maria_]$2[_plugin]"
[with_plugin_]$2=yes
AC_MSG_RESULT([yes])
m4_ifdef([$11], [
=== modified file 'configure.in'
--- a/configure.in 2010-03-29 15:13:53 +0000
+++ b/configure.in 2010-04-01 12:15:02 +0000
@@ -2872,7 +2872,7 @@ AC_SUBST(server_scripts)
AC_SUBST(mysql_plugin_dirs)
AC_SUBST(mysql_plugin_libs)
-AC_SUBST(mysql_plugin_defs)
+AC_SUBST(maria_plugin_defs)
# Now that sql_client_dirs and sql_server_dirs are stable, determine the union.
=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h 2010-03-29 15:13:53 +0000
+++ b/include/mysql/plugin.h 2010-04-01 12:15:02 +0000
@@ -57,7 +57,10 @@ typedef struct st_mysql_xid MYSQL_XID;
Plugin API. Common for all plugin types.
*/
+/* MySQL plugin interface version */
#define MYSQL_PLUGIN_INTERFACE_VERSION 0x0101
+/* MariaDB plugin interface version */
+#define MARIA_PLUGIN_INTERFACE_VERSION 0x0100
/*
The allowable types of plugins
@@ -81,6 +84,14 @@ typedef struct st_mysql_xid MYSQL_XID;
#define PLUGIN_LICENSE_GPL_STRING "GPL"
#define PLUGIN_LICENSE_BSD_STRING "BSD"
+/* 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
+
/*
Macros for beginning and ending plugin declarations. Between
mysql_declare_plugin and mysql_declare_plugin_end there should
@@ -93,7 +105,14 @@ typedef struct st_mysql_xid MYSQL_XID;
int VERSION= MYSQL_PLUGIN_INTERFACE_VERSION; \
int PSIZE= sizeof(struct st_mysql_plugin); \
struct st_mysql_plugin DECLS[]= {
+
+#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
+int VERSION= MARIA_PLUGIN_INTERFACE_VERSION; \
+int PSIZE= sizeof(struct st_maria_plugin); \
+struct st_maria_plugin DECLS[]= {
+
#else
+
#define __MYSQL_DECLARE_PLUGIN(NAME, VERSION, PSIZE, DECLS) \
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
@@ -98,6 +117,12 @@ struct st_mysql_plugin DECLS[]= {
MYSQL_PLUGIN_EXPORT int _mysql_plugin_interface_version_= MYSQL_PLUGIN_INTERFACE_VERSION; \
MYSQL_PLUGIN_EXPORT int _mysql_sizeof_struct_st_plugin_= sizeof(struct st_mysql_plugin); \
MYSQL_PLUGIN_EXPORT struct st_mysql_plugin _mysql_plugin_declarations_[]= {
+
+#define MARIA_DECLARE_PLUGIN__(NAME, VERSION, PSIZE, DECLS) \
+MYSQL_PLUGIN_EXPORT int _maria_plugin_interface_version_= MARIA_PLUGIN_INTERFACE_VERSION; \
+MYSQL_PLUGIN_EXPORT int _maria_sizeof_struct_st_plugin_= sizeof(struct st_maria_plugin); \
+MYSQL_PLUGIN_EXPORT struct st_maria_plugin _maria_plugin_declarations_[]= {
+
#endif
#define mysql_declare_plugin(NAME) \
@@ -106,7 +131,14 @@ __MYSQL_DECLARE_PLUGIN(NAME, \
builtin_ ## NAME ## _sizeof_struct_st_plugin, \
builtin_ ## NAME ## _plugin)
+#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)
+
#define mysql_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0}}
+#define maria_declare_plugin_end ,{0,0,0,0,0,0,0,0,0,0,0,0,0}}
/*
declarations for SHOW STATUS support in plugins
@@ -403,6 +435,30 @@ struct st_mysql_plugin
void * __reserved1; /* reserved for dependency checking */
};
+/*
+ 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) */
+ int (*init)(void *); /* the function to invoke when plugin is loaded */
+ 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 */
+ int maturity; /* MariaDB_PLUGIN_MATURITY_XXX */
+};
+
/*************************************************************************
API for Full-text parser plugin. (MYSQL_FTPARSER_PLUGIN)
*/
=== modified file 'include/mysql/plugin_auth.h.pp'
--- a/include/mysql/plugin_auth.h.pp 2010-03-29 15:13:53 +0000
+++ b/include/mysql/plugin_auth.h.pp 2010-04-01 12:15:02 +0000
@@ -77,6 +77,22 @@ struct st_mysql_plugin
struct st_mysql_sys_var **system_vars;
void * __reserved1;
};
+struct st_maria_plugin
+{
+ int type;
+ void *info;
+ const char *name;
+ const char *author;
+ const char *descr;
+ int license;
+ int (*init)(void *);
+ int (*deinit)(void *);
+ unsigned int version;
+ struct st_mysql_show_var *status_vars;
+ struct st_mysql_sys_var **system_vars;
+ const char *version_info;
+ int maturity;
+};
enum enum_ftparser_mode
{
MYSQL_FTPARSER_SIMPLE_MODE= 0,
=== modified file 'plugin/auth/auth_socket.c'
--- a/plugin/auth/auth_socket.c 2010-03-29 15:13:53 +0000
+++ b/plugin/auth/auth_socket.c 2010-04-01 12:15:02 +0000
@@ -99,4 +99,21 @@ mysql_declare_plugin(socket_auth)
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(socket_auth)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &socket_auth_handler,
+ "socket_peercred",
+ "Sergei Golubchik",
+ "Unix Socket based authentication",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+}
+mysql_declare_plugin_end;
=== modified file 'plugin/auth/dialog.c'
--- a/plugin/auth/dialog.c 2010-03-29 15:13:53 +0000
+++ b/plugin/auth/dialog.c 2010-04-01 12:15:02 +0000
@@ -165,6 +165,38 @@ mysql_declare_plugin(dialog)
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(dialog)
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &two_handler,
+ "two_questions",
+ "Sergei Golubchik",
+ "Dialog plugin demo 1",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+},
+{
+ MYSQL_AUTHENTICATION_PLUGIN,
+ &three_handler,
+ "three_attempts",
+ "Sergei Golubchik",
+ "Dialog plugin demo 2",
+ PLUGIN_LICENSE_GPL,
+ NULL,
+ NULL,
+ 0x0100,
+ NULL,
+ NULL,
+ "1.0",
+ MariaDB_PLUGIN_MATURITY_BETA
+}
+maria_declare_plugin_end;
/********************* CLIENT SIDE ***************************************/
/*
=== modified file 'plugin/daemon_example/daemon_example.cc'
--- a/plugin/daemon_example/daemon_example.cc 2007-06-27 14:49:12 +0000
+++ b/plugin/daemon_example/daemon_example.cc 2010-04-01 12:15:02 +0000
@@ -200,3 +200,20 @@ mysql_declare_plugin(daemon_example)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_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 */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'plugin/fulltext/plugin_example.c'
--- a/plugin/fulltext/plugin_example.c 2010-01-04 17:54:42 +0000
+++ b/plugin/fulltext/plugin_example.c 2010-04-01 12:15:02 +0000
@@ -270,4 +270,21 @@ mysql_declare_plugin(ftexample)
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(ftexample)
+{
+ MYSQL_FTPARSER_PLUGIN, /* type */
+ &simple_parser_descriptor, /* descriptor */
+ "simple_parser", /* name */
+ "MySQL AB", /* 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 */
+ "0.01", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/ha_ndbcluster.cc'
--- a/sql/ha_ndbcluster.cc 2010-03-29 15:13:53 +0000
+++ b/sql/ha_ndbcluster.cc 2010-04-01 12:15:02 +0000
@@ -10564,6 +10564,23 @@ mysql_declare_plugin(ndbcluster)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(ndbcluster)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &ndbcluster_storage_engine,
+ ndbcluster_hton_name,
+ "MySQL AB",
+ "Clustered, fault-tolerant tables",
+ PLUGIN_LICENSE_GPL,
+ ndbcluster_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ ndb_status_variables_export,/* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
#else
int Sun_ar_require_a_symbol_here= 0;
=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc 2010-03-15 11:51:23 +0000
+++ b/sql/ha_partition.cc 2010-04-01 12:15:02 +0000
@@ -6715,5 +6715,22 @@ mysql_declare_plugin(partition)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(partition)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &partition_storage_engine,
+ "partition",
+ "Mikael Ronstrom, MySQL AB",
+ "Partition Storage Engine Helper",
+ PLUGIN_LICENSE_GPL,
+ partition_initialize, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
#endif
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2010-03-15 11:51:23 +0000
+++ b/sql/log.cc 2010-04-01 12:15:02 +0000
@@ -6028,3 +6028,20 @@ mysql_declare_plugin(binlog)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(binlog)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &binlog_storage_engine,
+ "binlog",
+ "MySQL AB",
+ "This is a pseudo storage engine to represent the binlog in a transaction",
+ PLUGIN_LICENSE_GPL,
+ binlog_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc 2010-03-29 15:13:53 +0000
+++ b/sql/sql_acl.cc 2010-04-01 12:15:02 +0000
@@ -8254,3 +8254,35 @@ mysql_declare_plugin(mysql_password)
}
mysql_declare_plugin_end;
+maria_declare_plugin(mysql_password)
+{
+ MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
+ &native_password_handler, /* type descriptor */
+ native_password_plugin_name.str, /* Name */
+ "R.J.Silk, Sergei Golubchik", /* Author */
+ "Native MySQL authentication", /* Description */
+ PLUGIN_LICENSE_GPL, /* License */
+ NULL, /* Init function */
+ NULL, /* Deinit function */
+ 0x0100, /* Version (1.0) */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* String version */
+ MariaDB_PLUGIN_MATURITY_BETA /* Maturity */
+},
+{
+ MYSQL_AUTHENTICATION_PLUGIN, /* type constant */
+ &old_password_handler, /* type descriptor */
+ old_password_plugin_name.str, /* Name */
+ "R.J.Silk, Sergei Golubchik", /* Author */
+ "Old MySQL-4.0 authentication", /* Description */
+ PLUGIN_LICENSE_GPL, /* License */
+ NULL, /* Init function */
+ NULL, /* Deinit function */
+ 0x0100, /* Version (1.0) */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* String version */
+ MariaDB_PLUGIN_MATURITY_BETA /* Maturity */
+}
+maria_declare_plugin_end;
=== modified file 'sql/sql_builtin.cc.in'
--- a/sql/sql_builtin.cc.in 2010-03-29 15:13:53 +0000
+++ b/sql/sql_builtin.cc.in 2010-04-01 12:15:02 +0000
@@ -16,13 +16,12 @@
#include <my_global.h>
#include <mysql/plugin.h>
-typedef struct st_mysql_plugin builtin_plugin[];
+typedef struct st_maria_plugin builtin_maria_plugin[];
-extern builtin_plugin
- builtin_binlog_plugin, builtin_mysql_password_plugin@mysql_plugin_defs@;
+extern builtin_maria_plugin
+ builtin_maria_binlog_plugin, builtin_maria_mysql_password_plugin@maria_plugin_defs@;
-struct st_mysql_plugin *mysqld_builtins[]=
+struct st_maria_plugin *mariadb_builtins[]=
{
- builtin_binlog_plugin, builtin_mysql_password_plugin@mysql_plugin_defs@,(struct st_mysql_plugin *)0
+ builtin_maria_binlog_plugin, builtin_maria_mysql_password_plugin@maria_plugin_defs@,(struct st_maria_plugin *)0
};
-
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc 2010-03-29 15:13:53 +0000
+++ b/sql/sql_plugin.cc 2010-04-01 12:15:02 +0000
@@ -20,7 +20,7 @@
#define REPORT_TO_LOG 1
#define REPORT_TO_USER 2
-extern struct st_mysql_plugin *mysqld_builtins[];
+extern struct st_maria_plugin *mariadb_builtins[];
/**
@note The order of the enumeration is critical.
@@ -78,6 +78,14 @@ static const char *sizeof_st_plugin_sym=
"_mysql_sizeof_struct_st_plugin_";
static const char *plugin_declarations_sym= "_mysql_plugin_declarations_";
static int min_plugin_interface_version= MYSQL_PLUGIN_INTERFACE_VERSION & ~0xFF;
+static const char *maria_plugin_interface_version_sym=
+ "_maria_plugin_interface_version_";
+static const char *maria_sizeof_st_plugin_sym=
+ "_maria_sizeof_struct_st_plugin_";
+static const char *maria_plugin_declarations_sym=
+ "_maria_plugin_declarations_";
+static int min_maria_plugin_interface_version=
+ MARIA_PLUGIN_INTERFACE_VERSION & ~0xFF;
#endif
/* Note that 'int version' must be the first field of every plugin
@@ -211,7 +219,7 @@ static bool plugin_load_list(MEM_ROOT *t
const char *list);
static int test_plugin_options(MEM_ROOT *, struct st_plugin_int *,
int *, char **);
-static bool register_builtin(struct st_mysql_plugin *, struct st_plugin_int *,
+static bool register_builtin(struct st_maria_plugin *, struct st_plugin_int *,
struct st_plugin_int **);
static void unlock_variables(THD *thd, struct system_variables *vars);
static void cleanup_variables(THD *thd, struct system_variables *vars);
@@ -368,6 +376,223 @@ static inline void free_plugin_mem(struc
}
+/**
+ Reads data from mysql plugin interface
+
+ @param plugin_dl Structure where the data should be put
+ @param sym Reverence on version info
+ @param dlpath Path to the module
+ @param report What errors should be reported
+
+ @retval FALSE OK
+ @retval TRUE ERROR
+*/
+
+static my_bool read_mysql_plugin_info(struct st_plugin_dl *plugin_dl,
+ void *sym, char *dlpath,
+ int report)
+{
+ DBUG_ENTER("read_maria_plugin_info");
+ /* Determine interface version */
+ if (!sym)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
+ DBUG_RETURN(TRUE);
+ }
+ plugin_dl->mariaversion= 0;
+ plugin_dl->mysqlversion= *(int *)sym;
+ /* Versioning */
+ if (plugin_dl->mysqlversion < min_plugin_interface_version ||
+ (plugin_dl->mysqlversion >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+ "plugin interface version mismatch");
+ DBUG_RETURN(TRUE);
+ }
+ /* Find plugin declarations */
+ if (!(sym= dlsym(plugin_dl->handle, plugin_declarations_sym)))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
+ DBUG_RETURN(TRUE);
+ }
+
+ /* convert mysql declaration to maria one */
+ {
+ int i;
+ uint sizeof_st_plugin;
+ struct st_mysql_plugin *old;
+ struct st_maria_plugin *cur;
+ char *ptr= (char *)sym;
+
+ if ((sym= dlsym(plugin_dl->handle, sizeof_st_plugin_sym)))
+ sizeof_st_plugin= *(int *)sym;
+ else
+ {
+ DBUG_ASSERT(min_plugin_interface_version == 0);
+ sizeof_st_plugin= (int)offsetof(struct st_mysql_plugin, version);
+ }
+
+ for (i= 0;
+ ((struct st_mysql_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ /* no op */;
+
+ cur= (struct st_maria_plugin*)
+ my_malloc((i + 1) * sizeof(struct st_maria_plugin),
+ MYF(MY_ZEROFILL|MY_WME));
+ if (!cur)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ All st_plugin fields not initialized in the plugin explicitly, are
+ set to 0. It matches C standard behaviour for struct initializers that
+ have less values than the struct definition.
+ */
+ for (i=0;
+ (old= (struct st_mysql_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ {
+
+ cur->type= old->type;
+ cur->info= old->info;
+ cur->name= old->name;
+ cur->author= old->author;
+ cur->descr= old->descr;
+ cur->license= old->license;
+ cur->init= old->init;
+ cur->deinit= old->deinit;
+ cur->version= old->version;
+ cur->status_vars= old->status_vars;
+ cur->system_vars= old->system_vars;
+ /*
+ Something like this should be added to process
+ new mysql plugin versions:
+ if (plugin_dl->mysqlversion > 0x0101)
+ {
+ cur->newfield= CONSTANT_MEANS_UNKNOWN;
+ }
+ else
+ {
+ cur->newfield= old->newfield;
+ }
+ */
+ /* Maria only fields */
+ cur->version_info= "Unknown";
+ cur->maturity= MariaDB_PLUGIN_MATURITY_UNKNOWN;
+ }
+ plugin_dl->allocated= true;
+ plugin_dl->plugins= (struct st_maria_plugin *)cur;
+ }
+
+ DBUG_RETURN(FALSE);
+}
+
+
+/**
+ Reads data from maria plugin interface
+
+ @param plugin_dl Structure where the data should be put
+ @param sym Reverence on version info
+ @param dlpath Path to the module
+ @param report what errors should be reported
+
+ @retval FALSE OK
+ @retval TRUE ERROR
+*/
+
+static my_bool read_maria_plugin_info(struct st_plugin_dl *plugin_dl,
+ void *sym, char *dlpath,
+ int report)
+{
+ DBUG_ENTER("read_maria_plugin_info");
+
+ /* Determine interface version */
+ if (!(sym))
+ {
+ /*
+ Actually this branch impossible because in case of absence of maria
+ version we try mysql version.
+ */
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY,
+ maria_plugin_interface_version_sym);
+ DBUG_RETURN(TRUE);
+ }
+ plugin_dl->mariaversion= *(int *)sym;
+ plugin_dl->mysqlversion= 0;
+ /* Versioning */
+ if (plugin_dl->mariaversion < min_maria_plugin_interface_version ||
+ (plugin_dl->mariaversion >> 8) > (MARIA_PLUGIN_INTERFACE_VERSION >> 8))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
+ "plugin interface version mismatch");
+ DBUG_RETURN(TRUE);
+ }
+ /* Find plugin declarations */
+ if (!(sym= dlsym(plugin_dl->handle, maria_plugin_declarations_sym)))
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, maria_plugin_declarations_sym);
+ DBUG_RETURN(TRUE);
+ }
+ if (plugin_dl->mariaversion != MARIA_PLUGIN_INTERFACE_VERSION)
+ {
+ uint sizeof_st_plugin;
+ struct st_maria_plugin *old, *cur;
+ char *ptr= (char *)sym;
+
+ if ((sym= dlsym(plugin_dl->handle, maria_sizeof_st_plugin_sym)))
+ sizeof_st_plugin= *(int *)sym;
+ else
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_CANT_FIND_DL_ENTRY, maria_sizeof_st_plugin_sym);
+ DBUG_RETURN(TRUE);
+ }
+
+ if (sizeof_st_plugin != sizeof(st_mysql_plugin))
+ {
+ int i;
+ for (i= 0;
+ ((struct st_maria_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ /* no op */;
+
+ cur= (struct st_maria_plugin*)
+ my_malloc((i + 1) * sizeof(struct st_maria_plugin),
+ MYF(MY_ZEROFILL|MY_WME));
+ if (!cur)
+ {
+ free_plugin_mem(plugin_dl);
+ report_error(report, ER_OUTOFMEMORY, plugin_dl->dl.length);
+ DBUG_RETURN(TRUE);
+ }
+ /*
+ All st_plugin fields not initialized in the plugin explicitly, are
+ set to 0. It matches C standard behaviour for struct initializers that
+ have less values than the struct definition.
+ */
+ for (i=0;
+ (old= (struct st_maria_plugin *)(ptr + i * sizeof_st_plugin))->info;
+ i++)
+ memcpy(cur + i, old, min(sizeof(cur[i]), sizeof_st_plugin));
+
+ sym= cur;
+ plugin_dl->allocated= true;
+ }
+ }
+ plugin_dl->plugins= (struct st_maria_plugin *)sym;
+
+ DBUG_RETURN(FALSE);
+}
+
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
{
#ifdef HAVE_DLOPEN
@@ -415,22 +640,21 @@ static st_plugin_dl *plugin_dl_add(const
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, errno, errmsg);
DBUG_RETURN(0);
}
- /* Determine interface version */
- if (!(sym= dlsym(plugin_dl.handle, plugin_interface_version_sym)))
+
+ /* Checks which plugin interface present and reads info */
+ if (!(sym= dlsym(plugin_dl.handle, maria_plugin_interface_version_sym)))
{
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_interface_version_sym);
- DBUG_RETURN(0);
+ if (read_mysql_plugin_info(&plugin_dl,
+ dlsym(plugin_dl.handle,
+ plugin_interface_version_sym),
+ dlpath,
+ report))
+ DBUG_RETURN(0);
}
- plugin_dl.version= *(int *)sym;
- /* Versioning */
- if (plugin_dl.version < min_plugin_interface_version ||
- (plugin_dl.version >> 8) > (MYSQL_PLUGIN_INTERFACE_VERSION >> 8))
+ else
{
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0,
- "plugin interface version mismatch");
- DBUG_RETURN(0);
+ if (read_maria_plugin_info(&plugin_dl, sym, dlpath, report))
+ DBUG_RETURN(0);
}
/* link the services in */
@@ -438,7 +662,7 @@ static st_plugin_dl *plugin_dl_add(const
{
if ((sym= dlsym(plugin_dl.handle, list_of_services[i].name)))
{
- uint ver= (uint)(intptr)*(void**)sym;
+ uint ver= (uint)(intptr) *(void **)sym;
if (ver > list_of_services[i].version ||
(ver >> 8) < (list_of_services[i].version >> 8))
{
@@ -449,72 +673,9 @@ static st_plugin_dl *plugin_dl_add(const
report_error(report, ER_CANT_OPEN_LIBRARY, dlpath, 0, buf);
DBUG_RETURN(0);
}
- *(void**)sym= list_of_services[i].service;
- }
- }
-
- /* Find plugin declarations */
- if (!(sym= dlsym(plugin_dl.handle, plugin_declarations_sym)))
- {
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, plugin_declarations_sym);
- DBUG_RETURN(0);
- }
-
- if (plugin_dl.version != MYSQL_PLUGIN_INTERFACE_VERSION)
- {
- uint sizeof_st_plugin;
- struct st_mysql_plugin *old, *cur;
- char *ptr= (char *)sym;
-
- if ((sym= dlsym(plugin_dl.handle, sizeof_st_plugin_sym)))
- sizeof_st_plugin= *(int *)sym;
- else
- {
-#ifdef ERROR_ON_NO_SIZEOF_PLUGIN_SYMBOL
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_CANT_FIND_DL_ENTRY, sizeof_st_plugin_sym);
- DBUG_RETURN(0);
-#else
- /*
- When the following assert starts failing, we'll have to switch
- to the upper branch of the #ifdef
- */
- DBUG_ASSERT(min_plugin_interface_version == 0);
- sizeof_st_plugin= (int)offsetof(struct st_mysql_plugin, version);
-#endif
- }
-
- if (sizeof_st_plugin != sizeof(st_mysql_plugin))
- {
- for (i= 0;
- ((struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
- i++)
- /* no op */;
-
- cur= (struct st_mysql_plugin*)
- my_malloc((i+1)*sizeof(struct st_mysql_plugin), MYF(MY_ZEROFILL|MY_WME));
- if (!cur)
- {
- free_plugin_mem(&plugin_dl);
- report_error(report, ER_OUTOFMEMORY, plugin_dl.dl.length);
- DBUG_RETURN(0);
- }
- /*
- All st_plugin fields not initialized in the plugin explicitly, are
- set to 0. It matches C standard behaviour for struct initializers that
- have less values than the struct definition.
- */
- for (i=0;
- (old=(struct st_mysql_plugin *)(ptr+i*sizeof_st_plugin))->info;
- i++)
- memcpy(cur+i, old, min(sizeof(cur[i]), sizeof_st_plugin));
-
- sym= cur;
- plugin_dl.allocated= true;
+ *(void **)sym= list_of_services[i].service;
}
}
- plugin_dl.plugins= (struct st_mysql_plugin *)sym;
/* Duplicate and convert dll name */
plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
@@ -756,7 +917,7 @@ static bool plugin_add(MEM_ROOT *tmp_roo
int *argc, char **argv, int report)
{
struct st_plugin_int tmp;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
DBUG_ENTER("plugin_add");
if (plugin_find_internal(name, MYSQL_ANY_PLUGIN))
{
@@ -1161,8 +1322,8 @@ int plugin_init(int *argc, char **argv,
{
uint i;
bool is_myisam;
- struct st_mysql_plugin **builtins;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin **builtins;
+ struct st_maria_plugin *plugin;
struct st_plugin_int tmp, *plugin_ptr, **reap;
MEM_ROOT tmp_root;
bool reaped_mandatory_plugin= FALSE;
@@ -1201,7 +1362,7 @@ int plugin_init(int *argc, char **argv,
/*
First we register builtin plugins
*/
- for (builtins= mysqld_builtins; *builtins; builtins++)
+ for (builtins= mariadb_builtins; *builtins; builtins++)
{
for (plugin= *builtins; plugin->info; plugin++)
{
@@ -1316,7 +1477,7 @@ err:
}
-static bool register_builtin(struct st_mysql_plugin *plugin,
+static bool register_builtin(struct st_maria_plugin *plugin,
struct st_plugin_int *tmp,
struct st_plugin_int **ptr)
{
@@ -1352,7 +1513,7 @@ static bool register_builtin(struct st_m
RETURN
false - plugin registered successfully
*/
-bool plugin_register_builtin(THD *thd, struct st_mysql_plugin *plugin)
+bool plugin_register_builtin(THD *thd, struct st_maria_plugin *plugin)
{
struct st_plugin_int tmp, *ptr;
bool result= true;
@@ -1481,7 +1642,7 @@ static bool plugin_load_list(MEM_ROOT *t
char buffer[FN_REFLEN];
LEX_STRING name= {buffer, 0}, dl= {NULL, 0}, *str= &name;
struct st_plugin_dl *plugin_dl;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
char *p= buffer;
DBUG_ENTER("plugin_load_list");
while (list)
=== modified file 'sql/sql_plugin.h'
--- a/sql/sql_plugin.h 2010-03-15 11:51:23 +0000
+++ b/sql/sql_plugin.h 2010-04-01 12:15:02 +0000
@@ -52,8 +52,9 @@ struct st_plugin_dl
{
LEX_STRING dl;
void *handle;
- struct st_mysql_plugin *plugins;
- int version;
+ struct st_maria_plugin *plugins;
+ int mysqlversion;
+ int mariaversion;
bool allocated;
uint ref_count; /* number of plugins loaded from the library */
};
@@ -63,7 +64,7 @@ struct st_plugin_dl
struct st_plugin_int
{
LEX_STRING name;
- struct st_mysql_plugin *plugin;
+ struct st_maria_plugin *plugin;
struct st_plugin_dl *plugin_dl;
uint state;
uint ref_count; /* number of threads using the plugin */
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2010-03-15 11:51:23 +0000
+++ b/sql/sql_show.cc 2010-04-01 12:15:02 +0000
@@ -94,11 +94,21 @@ static int make_version_string(char *buf
return my_snprintf(buf, buf_length, "%d.%d", version>>8,version&0xff);
}
+
+static const LEX_STRING maturity_name[]={
+ { C_STRING_WITH_LEN("Unknown") },
+ { C_STRING_WITH_LEN("Experimental") },
+ { C_STRING_WITH_LEN("Alpha") },
+ { C_STRING_WITH_LEN("Beta") },
+ { C_STRING_WITH_LEN("Gamma") },
+ { C_STRING_WITH_LEN("Stable") }};
+
+
static my_bool show_plugins(THD *thd, plugin_ref plugin,
void *arg)
{
TABLE *table= (TABLE*) arg;
- struct st_mysql_plugin *plug= plugin_decl(plugin);
+ struct st_maria_plugin *plug= plugin_decl(plugin);
struct st_plugin_dl *plugin_dl= plugin_dlib(plugin);
CHARSET_INFO *cs= system_charset_info;
char version_buf[20];
@@ -143,7 +153,7 @@ static my_bool show_plugins(THD *thd, pl
table->field[5]->set_notnull();
table->field[6]->store(version_buf,
make_version_string(version_buf, sizeof(version_buf),
- plugin_dl->version),
+ plugin_dl->mariaversion),
cs);
table->field[6]->set_notnull();
}
@@ -186,6 +196,26 @@ static my_bool show_plugins(THD *thd, pl
}
table->field[9]->set_notnull();
+ if ((uint) plug->maturity <= MariaDB_PLUGIN_MATURITY_STABLE)
+ table->field[10]->store(maturity_name[plug->maturity].str,
+ maturity_name[plug->maturity].length,
+ cs);
+ else
+ {
+ DBUG_ASSERT(0);
+ table->field[10]->store("Unknown", 7, cs);
+ }
+ table->field[10]->set_notnull();
+
+ if (plug->version_info)
+ {
+ table->field[11]->store(plug->version_info,
+ strlen(plug->version_info), cs);
+ table->field[11]->set_notnull();
+ }
+ else
+ table->field[11]->set_null();
+
return schema_table_store_record(thd, table);
}
@@ -4398,7 +4428,7 @@ static my_bool iter_schema_engines(THD *
if (plugin_state(plugin) != PLUGIN_IS_READY)
{
- struct st_mysql_plugin *plug= plugin_decl(plugin);
+ struct st_maria_plugin *plug= plugin_decl(plugin);
if (!(wild && wild[0] &&
wild_case_compare(scs, plug->name,wild)))
{
@@ -7095,6 +7125,8 @@ ST_FIELD_INFO plugin_fields_info[]=
{"PLUGIN_AUTHOR", NAME_CHAR_LEN, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"PLUGIN_DESCRIPTION", 65535, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{"PLUGIN_LICENSE", 80, MYSQL_TYPE_STRING, 0, 1, "License", SKIP_OPEN_TABLE},
+ {"PLUGIN_MATURITY", 12, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
+ {"PLUGIN_AUTH_VERSION", 80, MYSQL_TYPE_STRING, 0, 1, 0, SKIP_OPEN_TABLE},
{0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
};
=== modified file 'storage/archive/ha_archive.cc'
--- a/storage/archive/ha_archive.cc 2010-03-04 08:03:07 +0000
+++ b/storage/archive/ha_archive.cc 2010-04-01 12:15:02 +0000
@@ -1655,4 +1655,21 @@ mysql_declare_plugin(archive)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(archive)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &archive_storage_engine,
+ "ARCHIVE",
+ "Brian Aker, MySQL AB",
+ "Archive storage engine",
+ PLUGIN_LICENSE_GPL,
+ archive_db_init, /* Plugin Init */
+ archive_db_done, /* Plugin Deinit */
+ 0x0300 /* 3.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/blackhole/ha_blackhole.cc'
--- a/storage/blackhole/ha_blackhole.cc 2009-10-16 10:29:42 +0000
+++ b/storage/blackhole/ha_blackhole.cc 2010-04-01 12:15:02 +0000
@@ -369,3 +369,20 @@ mysql_declare_plugin(blackhole)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(blackhole)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &blackhole_storage_engine,
+ "BLACKHOLE",
+ "MySQL AB",
+ "/dev/null storage engine (anything you write to it disappears)",
+ PLUGIN_LICENSE_GPL,
+ blackhole_init, /* Plugin Init */
+ blackhole_fini, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/csv/ha_tina.cc'
--- a/storage/csv/ha_tina.cc 2009-12-03 11:19:05 +0000
+++ b/storage/csv/ha_tina.cc 2010-04-01 12:15:02 +0000
@@ -1636,4 +1636,20 @@ mysql_declare_plugin(csv)
NULL /* config options */
}
mysql_declare_plugin_end;
-
+maria_declare_plugin(csv)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &csv_storage_engine,
+ "CSV",
+ "Brian Aker, MySQL AB",
+ "CSV storage engine",
+ PLUGIN_LICENSE_GPL,
+ tina_init_func, /* Plugin Init */
+ tina_done_func, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/example/ha_example.cc'
--- a/storage/example/ha_example.cc 2010-03-03 14:44:14 +0000
+++ b/storage/example/ha_example.cc 2010-04-01 12:15:02 +0000
@@ -924,3 +924,20 @@ mysql_declare_plugin(example)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(example)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &example_storage_engine,
+ "EXAMPLE",
+ "Brian Aker, MySQL AB",
+ "Example storage engine",
+ PLUGIN_LICENSE_GPL,
+ example_init_func, /* Plugin Init */
+ example_done_func, /* Plugin Deinit */
+ 0x0001 /* 0.1 */,
+ func_status, /* status variables */
+ example_system_variables, /* system variables */
+ "0.1", /* string version */
+ MariaDB_PLUGIN_MATURITY_EXPERIMENTAL /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/federated/ha_federated.cc'
--- a/storage/federated/ha_federated.cc 2009-09-07 20:50:10 +0000
+++ b/storage/federated/ha_federated.cc 2010-04-01 12:15:02 +0000
@@ -3379,3 +3379,20 @@ mysql_declare_plugin(federated)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(federated)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &federated_storage_engine,
+ "FEDERATED",
+ "Patrick Galbraith and Brian Aker, MySQL AB",
+ "Federated MySQL storage engine",
+ PLUGIN_LICENSE_GPL,
+ federated_db_init, /* Plugin Init */
+ federated_done, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/federatedx/ha_federatedx.cc'
--- a/storage/federatedx/ha_federatedx.cc 2010-03-10 10:32:14 +0000
+++ b/storage/federatedx/ha_federatedx.cc 2010-04-01 12:15:02 +0000
@@ -3505,9 +3505,26 @@ mysql_declare_plugin(federated)
PLUGIN_LICENSE_GPL,
federatedx_db_init, /* Plugin Init */
federatedx_done, /* Plugin Deinit */
- 0x0100 /* 1.0 */,
+ 0x0200 /* 2.0 */,
NULL, /* status variables */
NULL, /* system variables */
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(federated)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &federatedx_storage_engine,
+ "FEDERATED",
+ "Patrick Galbraith",
+ "FederatedX pluggable storage engine",
+ PLUGIN_LICENSE_GPL,
+ federatedx_db_init, /* Plugin Init */
+ federatedx_done, /* Plugin Deinit */
+ 0x0200 /* 2.0 */,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "2.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_BETA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/heap/ha_heap.cc'
--- a/storage/heap/ha_heap.cc 2009-09-07 20:50:10 +0000
+++ b/storage/heap/ha_heap.cc 2010-04-01 12:15:02 +0000
@@ -767,3 +767,20 @@ mysql_declare_plugin(heap)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(heap)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &heap_storage_engine,
+ "MEMORY",
+ "MySQL AB",
+ "Hash based, stored in memory, useful for temporary tables",
+ PLUGIN_LICENSE_GPL,
+ heap_init,
+ NULL,
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/ibmdb2i/ha_ibmdb2i.cc'
--- a/storage/ibmdb2i/ha_ibmdb2i.cc 2009-12-11 07:01:16 +0000
+++ b/storage/ibmdb2i/ha_ibmdb2i.cc 2010-04-01 12:15:02 +0000
@@ -3357,3 +3357,20 @@ mysql_declare_plugin(ibmdb2i)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(ibmdb2i)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &ibmdb2i_storage_engine,
+ "IBMDB2I",
+ "The IBM development team in Rochester, Minnesota",
+ "IBM DB2 for i Storage Engine",
+ PLUGIN_LICENSE_GPL,
+ ibmdb2i_init_func, /* Plugin Init */
+ ibmdb2i_done_func, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ NULL, /* status variables */
+ ibmdb2i_system_variables, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_UNKNOWN /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/innobase/handler/ha_innodb.cc'
--- a/storage/innobase/handler/ha_innodb.cc 2010-03-15 11:51:23 +0000
+++ b/storage/innobase/handler/ha_innodb.cc 2010-04-01 12:15:02 +0000
@@ -8930,6 +8930,23 @@ mysql_declare_plugin(innobase)
NULL /* reserved */
}
mysql_declare_plugin_end;
+maria_declare_plugin(innobase)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &innobase_storage_engine,
+ innobase_hton_name,
+ "Innobase OY",
+ "Supports transactions, row-level locking, and foreign keys",
+ PLUGIN_LICENSE_GPL,
+ innobase_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100 /* 1.0 */,
+ innodb_status_variables_export, /* status variables */
+ innobase_system_variables, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE, /* maturity */
+}
+maria_declare_plugin_end;
/** @brief Initialize the default value of innodb_commit_concurrency.
=== modified file 'storage/innodb_plugin/handler/i_s.cc'
--- a/storage/innodb_plugin/handler/i_s.cc 2009-10-12 12:00:56 +0000
+++ b/storage/innodb_plugin/handler/i_s.cc 2010-04-01 12:15:02 +0000
@@ -455,6 +455,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_trx_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_TRX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB transactions"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_trx_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
static ST_FIELD_INFO innodb_locks_fields_info[] =
{
@@ -730,6 +783,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_locks_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCKS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB conflicting locks"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_locks_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
{
@@ -913,6 +1019,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Innobase Oy"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_lock_waits_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Common function to fill any of the dynamic tables:
INFORMATION_SCHEMA.innodb_trx
@@ -1245,6 +1404,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1295,6 +1507,60 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
{
@@ -1511,6 +1777,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1561,6 +1880,60 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Unbind a dynamic INFORMATION_SCHEMA table.
@return 0 on success */
=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc 2010-03-15 11:51:23 +0000
+++ b/storage/maria/ha_maria.cc 2010-04-01 12:15:02 +0000
@@ -3471,9 +3471,26 @@ mysql_declare_plugin(maria)
PLUGIN_LICENSE_GPL,
ha_maria_init, /* Plugin Init */
NULL, /* Plugin Deinit */
- 0x0100, /* 1.0 */
+ 0x0105, /* 1.5 */
status_variables, /* status variables */
system_variables, /* system variables */
NULL
}
mysql_declare_plugin_end;
+maria_declare_plugin(maria)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &maria_storage_engine,
+ "MARIA",
+ "MySQL AB",
+ "Crash-safe tables with MyISAM heritage",
+ PLUGIN_LICENSE_GPL,
+ ha_maria_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0105, /* 1.5 */
+ status_variables, /* status variables */
+ system_variables, /* system variables */
+ "1.5", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/myisam/ha_myisam.cc'
--- a/storage/myisam/ha_myisam.cc 2010-01-04 17:54:42 +0000
+++ b/storage/myisam/ha_myisam.cc 2010-04-01 12:15:02 +0000
@@ -2174,6 +2174,23 @@ mysql_declare_plugin(myisam)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(myisam)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &myisam_storage_engine,
+ "MyISAM",
+ "MySQL AB",
+ "Default engine as of MySQL 3.23 with great performance",
+ PLUGIN_LICENSE_GPL,
+ myisam_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
#ifdef HAVE_QUERY_CACHE
=== modified file 'storage/myisammrg/ha_myisammrg.cc'
--- a/storage/myisammrg/ha_myisammrg.cc 2010-03-04 08:03:07 +0000
+++ b/storage/myisammrg/ha_myisammrg.cc 2010-04-01 12:15:02 +0000
@@ -1289,3 +1289,20 @@ mysql_declare_plugin(myisammrg)
NULL /* config options */
}
mysql_declare_plugin_end;
+maria_declare_plugin(myisammrg)
+{
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &myisammrg_storage_engine,
+ "MRG_MYISAM",
+ "MySQL AB",
+ "Collection of identical MyISAM tables",
+ PLUGIN_LICENSE_GPL,
+ myisammrg_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ 0x0100, /* 1.0 */
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0", /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+}
+maria_declare_plugin_end;
=== modified file 'storage/pbxt/src/ha_pbxt.cc'
--- a/storage/pbxt/src/ha_pbxt.cc 2010-03-03 14:44:14 +0000
+++ b/storage/pbxt/src/ha_pbxt.cc 2010-04-01 12:15:02 +0000
@@ -5921,6 +5921,40 @@ mysql_declare_plugin(pbxt)
drizzle_declare_plugin_end;
#else
mysql_declare_plugin_end;
+#ifdef MARIADB_BASE_VERSION
+maria_declare_plugin(pbxt)
+{ /* PBXT */
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &pbxt_storage_engine,
+ "PBXT",
+ "Paul McCullagh, PrimeBase Technologies GmbH",
+ "High performance, multi-versioning transactional engine",
+ PLUGIN_LICENSE_GPL,
+ pbxt_init, /* Plugin Init */
+ pbxt_end, /* Plugin Deinit */
+ 0x0001 /* 0.1 */,
+ NULL, /* status variables */
+ pbxt_system_variables, /* system variables */
+ "1.0.09g RC3", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+},
+{ /* PBXT_STATISTICS */
+ MYSQL_INFORMATION_SCHEMA_PLUGIN,
+ &pbxt_statitics,
+ "PBXT_STATISTICS",
+ "Paul McCullagh, PrimeBase Technologies GmbH",
+ "PBXT internal system statitics",
+ PLUGIN_LICENSE_GPL,
+ pbxt_init_statistics, /* plugin init */
+ pbxt_exit_statistics, /* plugin deinit */
+ 0x0005,
+ NULL, /* status variables */
+ NULL, /* system variables */
+ "1.0.09g RC3", /* string version */
+ MariaDB_PLUGIN_MATURITY_GAMMA /* maturity */
+}
+maria_declare_plugin_end;
+#endif
#endif
#if defined(XT_WIN) && defined(XT_COREDUMP)
=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- a/storage/xtradb/handler/ha_innodb.cc 2010-02-01 06:14:12 +0000
+++ b/storage/xtradb/handler/ha_innodb.cc 2010-04-01 12:15:02 +0000
@@ -10818,6 +10818,39 @@ i_s_innodb_index_stats,
i_s_innodb_admin_command,
i_s_innodb_patches
mysql_declare_plugin_end;
+maria_declare_plugin(innobase)
+{ /* InnoDB */
+ MYSQL_STORAGE_ENGINE_PLUGIN,
+ &innobase_storage_engine,
+ innobase_hton_name,
+ "Innobase Oy",
+ "Supports transactions, row-level locking, and foreign keys",
+ PLUGIN_LICENSE_GPL,
+ innobase_init, /* Plugin Init */
+ NULL, /* Plugin Deinit */
+ INNODB_VERSION_SHORT,
+ innodb_status_variables_export,/* status variables */
+ innobase_system_variables, /* system variables */
+ INNODB_VERSION_STR, /* string version */
+ MariaDB_PLUGIN_MATURITY_STABLE /* maturity */
+},
+i_s_innodb_rseg_maria,
+i_s_innodb_buffer_pool_pages_maria,
+i_s_innodb_buffer_pool_pages_index_maria,
+i_s_innodb_buffer_pool_pages_blob_maria,
+i_s_innodb_trx_maria,
+i_s_innodb_locks_maria,
+i_s_innodb_lock_waits_maria,
+i_s_innodb_cmp_maria,
+i_s_innodb_cmp_reset_maria,
+i_s_innodb_cmpmem_maria,
+i_s_innodb_cmpmem_reset_maria,
+i_s_innodb_table_stats_maria,
+i_s_innodb_index_stats_maria,
+i_s_innodb_admin_command_maria,
+i_s_innodb_patches_maria
+maria_declare_plugin_end;
+
/** @brief Initialize the default value of innodb_commit_concurrency.
=== modified file 'storage/xtradb/handler/i_s.cc'
--- a/storage/xtradb/handler/i_s.cc 2010-01-28 11:35:10 +0000
+++ b/storage/xtradb/handler/i_s.cc 2010-04-01 12:15:02 +0000
@@ -393,6 +393,59 @@ UNIV_INTERN struct st_mysql_plugin
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_patches_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "XTRADB_ENHANCEMENTS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Percona"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Enhancements applied to InnoDB plugin"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_patches_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
static ST_FIELD_INFO i_s_innodb_buffer_pool_pages_fields_info[] =
{
@@ -1040,6 +1093,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_index =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1089,6 +1195,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_index_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_INDEX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool index pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_index_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_buffer_pool_pages_blob =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -1138,6 +1297,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_buffer_pool_pages_blob_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_BUFFER_POOL_PAGES_BLOB"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB buffer pool blob pages"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_buffer_pool_pages_blob_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_trx */
static ST_FIELD_INFO innodb_trx_fields_info[] =
@@ -1373,6 +1585,60 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+
+UNIV_INTERN struct st_maria_plugin i_s_innodb_trx_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_TRX"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB transactions"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_trx_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_locks */
static ST_FIELD_INFO innodb_locks_fields_info[] =
{
@@ -1648,6 +1914,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_locks_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCKS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB conflicting locks"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_locks_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/* Fields of the dynamic table INFORMATION_SCHEMA.innodb_lock_waits */
static ST_FIELD_INFO innodb_lock_waits_fields_info[] =
{
@@ -1831,22 +2150,75 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
-/*******************************************************************//**
-Common function to fill any of the dynamic tables:
-INFORMATION_SCHEMA.innodb_trx
-INFORMATION_SCHEMA.innodb_locks
-INFORMATION_SCHEMA.innodb_lock_waits
-@return 0 on success */
-static
-int
-trx_i_s_common_fill_table(
-/*======================*/
- THD* thd, /*!< in: thread */
- TABLE_LIST* tables, /*!< in/out: tables to fill */
- COND* cond) /*!< in: condition (not used) */
+UNIV_INTERN struct st_maria_plugin i_s_innodb_lock_waits_maria =
{
- const char* table_name;
- int ret;
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_LOCK_WAITS"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, "Innobase Oy"),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB which lock is blocking which"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, innodb_lock_waits_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
+/*******************************************************************//**
+Common function to fill any of the dynamic tables:
+INFORMATION_SCHEMA.innodb_trx
+INFORMATION_SCHEMA.innodb_locks
+INFORMATION_SCHEMA.innodb_lock_waits
+@return 0 on success */
+static
+int
+trx_i_s_common_fill_table(
+/*======================*/
+ THD* thd, /*!< in: thread */
+ TABLE_LIST* tables, /*!< in/out: tables to fill */
+ COND* cond) /*!< in: condition (not used) */
+{
+ const char* table_name;
+ int ret;
trx_i_s_cache_t* cache;
DBUG_ENTER("trx_i_s_common_fill_table");
@@ -2163,6 +2535,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmp_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -2213,6 +2638,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmp_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMP_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compression;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmp_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
/* Fields of the dynamic table information_schema.innodb_cmpmem. */
static ST_FIELD_INFO i_s_cmpmem_fields_info[] =
{
@@ -2431,6 +2909,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_cmpmem_reset =
{
/* the plugin type (a MYSQL_XXX_PLUGIN value) */
@@ -2481,6 +3012,60 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_cmpmem_reset_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_CMPMEM_RESET"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "Statistics for the InnoDB compressed buffer pool;"
+ " reset cumulated counts"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_cmpmem_reset_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, INNODB_VERSION_SHORT),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/*******************************************************************//**
Unbind a dynamic INFORMATION_SCHEMA table.
@return 0 on success */
@@ -2660,6 +3245,59 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_rseg_maria =
+{
+ /* the plugin type (a MYSQL_XXX_PLUGIN value) */
+ /* int */
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+
+ /* pointer to type-specific plugin descriptor */
+ /* void* */
+ STRUCT_FLD(info, &i_s_info),
+
+ /* plugin name */
+ /* const char* */
+ STRUCT_FLD(name, "INNODB_RSEG"),
+
+ /* plugin author (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(author, plugin_author),
+
+ /* general descriptive text (for SHOW PLUGINS) */
+ /* const char* */
+ STRUCT_FLD(descr, "InnoDB rollback segment information"),
+
+ /* the plugin license (PLUGIN_LICENSE_XXX) */
+ /* int */
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+
+ /* the function to invoke when plugin is loaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(init, i_s_innodb_rseg_init),
+
+ /* the function to invoke when plugin is unloaded */
+ /* int (*)(void*); */
+ STRUCT_FLD(deinit, i_s_common_deinit),
+
+ /* plugin version (for SHOW PLUGINS) */
+ /* unsigned int */
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+
+ /* struct st_mysql_show_var* */
+ STRUCT_FLD(status_vars, NULL),
+
+ /* struct st_mysql_sys_var** */
+ STRUCT_FLD(system_vars, NULL),
+
+ /* string version */
+ /* const char * */
+ STRUCT_FLD(version_info, "1.0"),
+
+ /* Maturity */
+ /* int */
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/***********************************************************************
*/
static ST_FIELD_INFO i_s_innodb_table_stats_info[] =
@@ -2940,6 +3578,23 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_table_stats_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "INNODB_TABLE_STATS"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "InnoDB table statistics in memory"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_table_stats_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
UNIV_INTERN struct st_mysql_plugin i_s_innodb_index_stats =
{
STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
@@ -2956,6 +3611,23 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(__reserved1, NULL)
};
+UNIV_INTERN struct st_maria_plugin i_s_innodb_index_stats_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "INNODB_INDEX_STATS"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "InnoDB index statistics in memory"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_index_stats_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
+
/***********************************************************************
*/
static ST_FIELD_INFO i_s_innodb_admin_command_info[] =
@@ -3122,3 +3794,20 @@ UNIV_INTERN struct st_mysql_plugin i_s_i
STRUCT_FLD(system_vars, NULL),
STRUCT_FLD(__reserved1, NULL)
};
+
+UNIV_INTERN struct st_maria_plugin i_s_innodb_admin_command_maria =
+{
+ STRUCT_FLD(type, MYSQL_INFORMATION_SCHEMA_PLUGIN),
+ STRUCT_FLD(info, &i_s_info),
+ STRUCT_FLD(name, "XTRADB_ADMIN_COMMAND"),
+ STRUCT_FLD(author, plugin_author),
+ STRUCT_FLD(descr, "XtraDB specific command acceptor"),
+ STRUCT_FLD(license, PLUGIN_LICENSE_GPL),
+ STRUCT_FLD(init, i_s_innodb_admin_command_init),
+ STRUCT_FLD(deinit, i_s_common_deinit),
+ STRUCT_FLD(version, 0x0100 /* 1.0 */),
+ STRUCT_FLD(status_vars, NULL),
+ STRUCT_FLD(system_vars, NULL),
+ STRUCT_FLD(version_info, "1.0"),
+ STRUCT_FLD(maturity, MariaDB_PLUGIN_MATURITY_STABLE)
+};
=== modified file 'storage/xtradb/handler/i_s.h'
--- a/storage/xtradb/handler/i_s.h 2009-11-04 20:11:12 +0000
+++ b/storage/xtradb/handler/i_s.h 2010-04-01 12:15:02 +0000
@@ -42,4 +42,20 @@ extern struct st_mysql_plugin i_s_innodb
extern struct st_mysql_plugin i_s_innodb_index_stats;
extern struct st_mysql_plugin i_s_innodb_admin_command;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_maria;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_index_maria;
+extern struct st_maria_plugin i_s_innodb_buffer_pool_pages_blob_maria;
+extern struct st_maria_plugin i_s_innodb_trx_maria;
+extern struct st_maria_plugin i_s_innodb_locks_maria;
+extern struct st_maria_plugin i_s_innodb_lock_waits_maria;
+extern struct st_maria_plugin i_s_innodb_cmp_maria;
+extern struct st_maria_plugin i_s_innodb_cmp_reset_maria;
+extern struct st_maria_plugin i_s_innodb_cmpmem_maria;
+extern struct st_maria_plugin i_s_innodb_cmpmem_reset_maria;
+extern struct st_maria_plugin i_s_innodb_patches_maria;
+extern struct st_maria_plugin i_s_innodb_rseg_maria;
+extern struct st_maria_plugin i_s_innodb_table_stats_maria;
+extern struct st_maria_plugin i_s_innodb_index_stats_maria;
+extern struct st_maria_plugin i_s_innodb_admin_command_maria;
+
#endif /* i_s_h */
1
0
[Maria-developers] New (by Shinguz): Index usage tracker (103)
by worklog-noreply@askmonty.org 01 Apr '10
by worklog-noreply@askmonty.org 01 Apr '10
01 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Index usage tracker
CREATION DATE..: Wed, 10 Mar 2010, 11:29
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....:
COPIES TO......:
CATEGORY.......: Client-BackLog
TASK ID........: 103 (http://askmonty.org/worklog/?tid=103)
VERSION........: Benchmarks-3.0
STATUS.........: Un-Assigned
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 0 (hours remain)
ORIG. ESTIMATE.: 0
PROGRESS NOTES:
DESCRIPTION:
What indexes are needed is often easy to find. What is more difficult is to find
which indexes are not used at all.
Thus some statistics about the index usage would be nice.
I think Percona has already something like this done some time ago. And big O
has similar functionality.
I could imagine something like this:
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
| table_name | index_name | index_length | create_time | update_time
| use_time | read_first | read_key | read_next | full_scan |
range_scan |
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
| test_table | idx1 | 1234567890 | 2010-01-01 00:00:00 | 2010-01-01
00:00:00 | 2010-03-10 11:34:56 | 1234 | 42560 | 2468 | 234 |
321 |
| test_table | idx2 | 123456 | 2010-01-01 00:00:00 | NULL
| NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx3 | 234561 | 2010-01-01 00:00:00 | 2010-03-10
11:12:34 | 2010-03-10 11:34:56 | 7890 | 89890 | 15780 | 678 |
321 |
| test_table | idx4 | 345612 | 2010-01-01 00:00:00 | 2010-03-10
11:34:56 | NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx5 | 456123 | 2010-01-01 00:00:00 | 2010-03-10
06:56:12 | NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx6 | 561234 | 2010-01-01 00:00:00 | 2010-03-10
01:12:34 | 2010-03-10 11:34:42 | 3456 | 12356 | 6912 | 123 |
12 |
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
Possibly this could/should be implemented on the handler interface level because
there we know what we are touching? But I am not familiar with the code.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
3
2
[Maria-developers] Updated (by Monty): Index usage tracker (103)
by worklog-noreply@askmonty.org 01 Apr '10
by worklog-noreply@askmonty.org 01 Apr '10
01 Apr '10
-----------------------------------------------------------------------
WORKLOG TASK
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
TASK...........: Index usage tracker
CREATION DATE..: Wed, 10 Mar 2010, 11:29
SUPERVISOR.....: Bothorsen
IMPLEMENTOR....:
COPIES TO......:
CATEGORY.......: Client-BackLog
TASK ID........: 103 (http://askmonty.org/worklog/?tid=103)
VERSION........: Server-9.x
STATUS.........: Complete
PRIORITY.......: 60
WORKED HOURS...: 0
ESTIMATE.......: 0 (hours remain)
ORIG. ESTIMATE.: 0
PROGRESS NOTES:
-=-=(Monty - Thu, 01 Apr 2010, 12:00)=-=-
Version updated.
--- /tmp/wklog.103.old.21119 2010-04-01 12:00:42.000000000 +0000
+++ /tmp/wklog.103.new.21119 2010-04-01 12:00:42.000000000 +0000
@@ -1 +1 @@
-Benchmarks-3.0
+Server-9.x
-=-=(Monty - Thu, 01 Apr 2010, 12:00)=-=-
Status updated.
--- /tmp/wklog.103.old.21119 2010-04-01 12:00:42.000000000 +0000
+++ /tmp/wklog.103.new.21119 2010-04-01 12:00:42.000000000 +0000
@@ -1 +1 @@
-Un-Assigned
+Complete
-=-=(Monty - Thu, 01 Apr 2010, 12:00)=-=-
High Level Description modified.
--- /tmp/wklog.103.old.21108 2010-04-01 12:00:33.000000000 +0000
+++ /tmp/wklog.103.new.21108 2010-04-01 12:00:33.000000000 +0000
@@ -1,3 +1,7 @@
+Update: We have already in MariaDB 5.2 SHOW INDEX STATISTICS that provides the
+requested information.
+
+
What indexes are needed is often easy to find. What is more difficult is to find
which indexes are not used at all.
@@ -33,6 +37,7 @@
12 |
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
+
Possibly this could/should be implemented on the handler interface level because
there we know what we are touching? But I am not familiar with the code.
-=-=(Shinguz - Wed, 10 Mar 2010, 11:30)=-=-
High Level Description modified.
--- /tmp/wklog.103.old.30875 2010-03-10 11:30:45.000000000 +0000
+++ /tmp/wklog.103.new.30875 2010-03-10 11:30:45.000000000 +0000
@@ -35,3 +35,6 @@
Possibly this could/should be implemented on the handler interface level because
there we know what we are touching? But I am not familiar with the code.
+
+If some more specification is need for implementation let me know and I will
+collect the stuff from the sources mentioned above.
DESCRIPTION:
Update: We have already in MariaDB 5.2 SHOW INDEX STATISTICS that provides the
requested information.
What indexes are needed is often easy to find. What is more difficult is to find
which indexes are not used at all.
Thus some statistics about the index usage would be nice.
I think Percona has already something like this done some time ago. And big O
has similar functionality.
I could imagine something like this:
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
| table_name | index_name | index_length | create_time | update_time
| use_time | read_first | read_key | read_next | full_scan |
range_scan |
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
| test_table | idx1 | 1234567890 | 2010-01-01 00:00:00 | 2010-01-01
00:00:00 | 2010-03-10 11:34:56 | 1234 | 42560 | 2468 | 234 |
321 |
| test_table | idx2 | 123456 | 2010-01-01 00:00:00 | NULL
| NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx3 | 234561 | 2010-01-01 00:00:00 | 2010-03-10
11:12:34 | 2010-03-10 11:34:56 | 7890 | 89890 | 15780 | 678 |
321 |
| test_table | idx4 | 345612 | 2010-01-01 00:00:00 | 2010-03-10
11:34:56 | NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx5 | 456123 | 2010-01-01 00:00:00 | 2010-03-10
06:56:12 | NULL | 0 | 0 | 0 | 0 |
0 |
| test_table | idx6 | 561234 | 2010-01-01 00:00:00 | 2010-03-10
01:12:34 | 2010-03-10 11:34:42 | 3456 | 12356 | 6912 | 123 |
12 |
+------------+------------+--------------+---------------------+---------------------+---------------------+------------+----------+-----------+-----------+------------+
Possibly this could/should be implemented on the handler interface level because
there we know what we are touching? But I am not familiar with the code.
If some more specification is need for implementation let me know and I will
collect the stuff from the sources mentioned above.
ESTIMATED WORK TIME
ESTIMATED COMPLETION DATE
-----------------------------------------------------------------------
WorkLog (v3.5.9)
1
0