Commit 9e3570ea authored by Michael Widenius's avatar Michael Widenius

Removed depricated --maria-options from mysqld.

parent 60bd2133
select * from information_schema.plugins where plugin_name like '%aria';
PLUGIN_NAME PLUGIN_VERSION PLUGIN_STATUS PLUGIN_TYPE PLUGIN_TYPE_VERSION PLUGIN_LIBRARY PLUGIN_LIBRARY_VERSION PLUGIN_AUTHOR PLUGIN_DESCRIPTION PLUGIN_LICENSE PLUGIN_MATURITY PLUGIN_AUTH_VERSION
Maria 1.5 ACTIVE DAEMON # NULL NULL Monty Program Ab Compatibility aliases for the Aria engine GPL Gamma 1.5
Aria 1.5 ACTIVE STORAGE ENGINE # NULL NULL Monty Program Ab Crash-safe tables with MyISAM heritage GPL Gamma 1.5
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_variables as maria_vars left join
information_schema.session_variables as aria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where maria_vars.variable_name like 'maria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
variable_name variable_name
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_status as maria_vars left join
information_schema.session_status as aria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where maria_vars.variable_name like 'maria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
variable_name variable_name
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_variables as aria_vars left join
information_schema.session_variables as maria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where aria_vars.variable_name like 'aria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
variable_name variable_name
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_status as aria_vars left join
information_schema.session_status as maria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where aria_vars.variable_name like 'aria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
variable_name variable_name
set @old_checkpoint_interval=@@global.aria_checkpoint_interval;
set global maria_checkpoint_interval=10;
select @@global.aria_checkpoint_interval;
@@global.aria_checkpoint_interval
10
set global maria_checkpoint_interval=@old_checkpoint_interval;
set @old_sort_buffer_size=@@global.maria_sort_buffer_size;
set global aria_sort_buffer_size=1024;
select @@global.maria_sort_buffer_size;
@@global.maria_sort_buffer_size
1024
set global aria_sort_buffer_size=@old_sort_buffer_size;
set @old_sort_buffer_size=@@session.maria_sort_buffer_size;
set session aria_sort_buffer_size=2048;
select @@session.maria_sort_buffer_size;
@@session.maria_sort_buffer_size
2048
set session aria_sort_buffer_size=@old_sort_buffer_size;
set @old_max_sort_file_size=@@global.maria_max_sort_file_size,
@old_repair_threads=@@global.aria_repair_threads;
set @@global.maria_max_sort_file_size=default, @@global.aria_repair_threads=default;
select @@global.maria_max_sort_file_size, @@global.aria_repair_threads;
@@global.maria_max_sort_file_size @@global.aria_repair_threads
9223372036853727232 1
set @@global.aria_max_sort_file_size=@old_max_sort_file_size,
@@global.maria_repair_threads=@old_repair_threads;
......@@ -20,7 +20,7 @@ create table t1 (a varchar(1000), index(a)) engine=aria;
insert into t1 values("ThursdayMorningsMarket");
flush table t1;
insert into t1 select concat(a,'b') from t1 limit 1;
set global maria_checkpoint_interval=1000;
set global aria_checkpoint_interval=1000;
select * from t_corrupted2;
a
ThursdayMorningsMarket
......
......@@ -312,7 +312,7 @@ aria_log_file_size 4294959104
aria_log_purge_type immediate
aria_max_sort_file_size 9223372036853727232
aria_pagecache_age_threshold 300
aria_pagecache_buffer_size 134213632
aria_pagecache_buffer_size 134217720
aria_pagecache_division_limit 100
aria_page_checksum OFF
aria_recover NORMAL
......
--maria-max-sort-file-size=100M --aria-repair-threads=10000
#
# test for maria* aliases (system variables, status variables,
# command-line options). They should match aria* variables.
#
--replace_column 5 #
select * from information_schema.plugins where plugin_name like '%aria';
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_variables as maria_vars left join
information_schema.session_variables as aria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where maria_vars.variable_name like 'maria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_status as maria_vars left join
information_schema.session_status as aria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where maria_vars.variable_name like 'maria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_variables as aria_vars left join
information_schema.session_variables as maria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where aria_vars.variable_name like 'aria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
select maria_vars.variable_name, aria_vars.variable_name from
information_schema.session_status as aria_vars left join
information_schema.session_status as maria_vars
on (maria_vars.variable_name = concat('m', aria_vars.variable_name))
where aria_vars.variable_name like 'aria_%'
and not (maria_vars.variable_value <=> aria_vars.variable_value);
set @old_checkpoint_interval=@@global.aria_checkpoint_interval;
set global maria_checkpoint_interval=10;
select @@global.aria_checkpoint_interval;
set global maria_checkpoint_interval=@old_checkpoint_interval;
set @old_sort_buffer_size=@@global.maria_sort_buffer_size;
set global aria_sort_buffer_size=1024;
select @@global.maria_sort_buffer_size;
set global aria_sort_buffer_size=@old_sort_buffer_size;
set @old_sort_buffer_size=@@session.maria_sort_buffer_size;
set session aria_sort_buffer_size=2048;
select @@session.maria_sort_buffer_size;
set session aria_sort_buffer_size=@old_sort_buffer_size;
set @old_max_sort_file_size=@@global.maria_max_sort_file_size,
@old_repair_threads=@@global.aria_repair_threads;
set @@global.maria_max_sort_file_size=default, @@global.aria_repair_threads=default;
--replace_result 4293918720 9223372036853727232
select @@global.maria_max_sort_file_size, @@global.aria_repair_threads;
set @@global.aria_max_sort_file_size=@old_max_sort_file_size,
@@global.maria_repair_threads=@old_repair_threads;
......@@ -10,7 +10,7 @@ call mtr.add_suppression("Recovering table: '\\..mysqltest.t_corrupted2'");
call mtr.add_suppression("Table '\\..mysqltest.t_corrupted2' is marked as crashed and should be repaired");
call mtr.add_suppression("Table 't_corrupted2' is marked as crashed and should be repaired");
let $def_checkinterval=`select @@global.maria_checkpoint_interval`;
let $def_checkinterval=`select @@global.aria_checkpoint_interval`;
--enable_query_log
......@@ -39,7 +39,7 @@ insert into t1 values("ThursdayMorningsMarket");
flush table t1; # put index page on disk
insert into t1 select concat(a,'b') from t1 limit 1;
# force a checkpoint to get the open count > 0
set global maria_checkpoint_interval=1000;
set global aria_checkpoint_interval=1000;
# Wait for checkpoint to happen
--sleep 1
# now t1 has its open_count>0 and so will t2_corrupted.
......
......@@ -79,7 +79,7 @@ noinst_HEADERS = maria_def.h ma_rt_index.h ma_rt_key.h ma_rt_mbr.h \
ma_checkpoint.h ma_recovery.h ma_commit.h ma_state.h \
trnman_public.h ma_check_standalone.h \
ma_key_recover.h ma_recovery_util.h \
ma_servicethread.h compat_aliases.h
ma_servicethread.h
ma_test1_DEPENDENCIES= $(LIBRARIES)
ma_test1_LDADD= @CLIENT_EXTRA_LDFLAGS@ libaria.a \
$(top_builddir)/storage/myisam/libmyisam.a \
......@@ -142,7 +142,7 @@ libaria_la_SOURCES = ma_init.c ma_open.c ma_extra.c ma_info.c ma_rkey.c \
ma_pagecache.c ma_pagecaches.c \
ma_checkpoint.c ma_recovery.c ma_commit.c \
ma_pagecrc.c ma_recovery_util.c \
compat_aliases.cc ma_servicethread.c
ma_servicethread.c
libaria_s_la_SOURCES = ha_maria.cc
libaria_s_la_CXXFLAGS = $(AM_CXXFLAGS)
......
/* Copyright (C) 2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
compatibility aliases for system and static variables
*/
#include <my_global.h>
#include <maria.h>
#include <mysql/plugin.h>
#include "ma_loghandler.h"
#include "compat_aliases.h"
ulong block_size_alias;
static MYSQL_SYSVAR_ULONG(block_size, block_size_alias,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated, use --aria-block-size instead", 0, 0,
MARIA_KEY_BLOCK_LENGTH, MARIA_MIN_KEY_BLOCK_LENGTH,
MARIA_MAX_KEY_BLOCK_LENGTH, MARIA_MIN_KEY_BLOCK_LENGTH);
ulong checkpoint_interval_alias;
static MYSQL_SYSVAR_ULONG(checkpoint_interval, checkpoint_interval_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-checkpoint-interval instead",
NULL, NULL, 30, 0, UINT_MAX, 1);
ulong force_start_after_recovery_failures_alias;
static MYSQL_SYSVAR_ULONG(force_start_after_recovery_failures, force_start_after_recovery_failures_alias,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated, use --aria-force-start-after-recovery-failures instead",
NULL, NULL, 0, 0, UINT_MAX8, 1);
my_bool page_checksum_alias;
static MYSQL_SYSVAR_BOOL(page_checksum, page_checksum_alias, 0,
"Deprecated, use --aria-page-checksum instead", 0, 0, 1);
char *log_dir_path_alias;
static MYSQL_SYSVAR_STR(log_dir_path, log_dir_path_alias,
PLUGIN_VAR_NOSYSVAR | PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated, use --aria-log-dir-path instead",
NULL, NULL, mysql_real_data_home);
ulong log_file_size_alias;
static MYSQL_SYSVAR_ULONG(log_file_size, log_file_size_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-log-file-size instead",
NULL, NULL, TRANSLOG_FILE_SIZE,
TRANSLOG_MIN_FILE_SIZE, 0xffffffffL, TRANSLOG_PAGE_SIZE);
ulong group_commit_alias;
static MYSQL_SYSVAR_ENUM(group_commit, group_commit_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-group-commit instead",
NULL, NULL,
TRANSLOG_GCOMMIT_NONE, &maria_group_commit_typelib);
ulong group_commit_interval_alias;
static MYSQL_SYSVAR_ULONG(group_commit_interval, group_commit_interval_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-group-commit-interval instead",
NULL, NULL, 0, 0, UINT_MAX, 1);
ulong log_purge_type_alias;
static MYSQL_SYSVAR_ENUM(log_purge_type, log_purge_type_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-log-purge-type instead",
NULL, NULL, TRANSLOG_PURGE_IMMIDIATE,
&maria_translog_purge_type_typelib);
ulonglong max_sort_file_size_alias;
static MYSQL_SYSVAR_ULONGLONG(max_sort_file_size, max_sort_file_size_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-max-temp-length instead",
0, 0, MAX_FILE_SIZE, 0, MAX_FILE_SIZE, 1024*1024);
ulong pagecache_age_threshold_alias;
static MYSQL_SYSVAR_ULONG(pagecache_age_threshold, pagecache_age_threshold_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-pagecache-age-threshold instead",
0, 0, 300, 100, ~0L, 100);
ulonglong pagecache_buffer_size_alias;
static MYSQL_SYSVAR_ULONGLONG(pagecache_buffer_size, pagecache_buffer_size_alias,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Deprecated, use --aria-pagecache-buffer-size instead",
0, 0, KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~0UL, IO_SIZE);
ulong pagecache_division_limit_alias;
static MYSQL_SYSVAR_ULONG(pagecache_division_limit, pagecache_division_limit_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-pagecache-division-limit instead",
0, 0, 100, 1, 100, 1);
ulong recover_alias;
static MYSQL_SYSVAR_ENUM(recover, recover_alias, PLUGIN_VAR_OPCMDARG,
"Deprecated, use --aria-recover instead",
NULL, NULL, HA_RECOVER_DEFAULT, &maria_recover_typelib);
ulong repair_threads_alias;
static MYSQL_THDVAR_ULONG(repair_threads, PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-repair-threads instead",
0, 0, 1, 1, ~0L, 1);
ulong sort_buffer_size_alias;
static MYSQL_THDVAR_ULONG(sort_buffer_size, PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-sort-buffer-size instead",
0, 0, 128L*1024L*1024L, 4, ~0L, 1);
ulong stats_method_alias;
static MYSQL_THDVAR_ENUM(stats_method, PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-stats-method instead",
0, 0, 0, &maria_stats_method_typelib);
ulong sync_log_dir_alias;
static MYSQL_SYSVAR_ENUM(sync_log_dir, sync_log_dir_alias,
PLUGIN_VAR_RQCMDARG,
"Deprecated, use --aria-sync-log-dir instead",
NULL, NULL, TRANSLOG_SYNC_DIR_NEWFILE,
&maria_sync_log_dir_typelib);
my_bool used_for_temp_tables_alias= 1;
static MYSQL_SYSVAR_BOOL(used_for_temp_tables,
used_for_temp_tables_alias, PLUGIN_VAR_READONLY | PLUGIN_VAR_NOCMDOPT,
NULL, 0, 0, 1);
static struct st_mysql_show_var status_variables_aliases[]= {
{"Maria", (char*) &status_variables, SHOW_ARRAY},
{NullS, NullS, SHOW_LONG}
};
/*
There is one problem with aliases for command-line options.
Plugin initialization works like this
for all plugins:
prepare command-line options
initialize command-line option variables to the default values
parse command line, assign values as necessary
for all plugins:
call the plugin initialization function
it means, we cannot have maria* and aria* command-line options to use
the same underlying variables - because after assigning maria* values,
MySQL will put there default values again preparing for parsing aria*
values. So, maria* values will be lost.
So, we create separate set of variables for maria* options,
and take both values into account in ha_maria_init().
When the command line was parsed, we patch maria* options
to use the same variables as aria* options so that
set @@maria_some_var would have the same value as @@aria_some_var
without forcing us to copy the values around all the time.
*/
static struct st_mysql_sys_var* system_variables_aliases[]= {
MYSQL_SYSVAR(block_size),
MYSQL_SYSVAR(checkpoint_interval),
MYSQL_SYSVAR(force_start_after_recovery_failures),
MYSQL_SYSVAR(group_commit),
MYSQL_SYSVAR(group_commit_interval),
MYSQL_SYSVAR(log_dir_path),
MYSQL_SYSVAR(log_file_size),
MYSQL_SYSVAR(log_purge_type),
MYSQL_SYSVAR(max_sort_file_size),
MYSQL_SYSVAR(page_checksum),
MYSQL_SYSVAR(pagecache_age_threshold),
MYSQL_SYSVAR(pagecache_buffer_size),
MYSQL_SYSVAR(pagecache_division_limit),
MYSQL_SYSVAR(recover),
MYSQL_SYSVAR(repair_threads),
MYSQL_SYSVAR(sort_buffer_size),
MYSQL_SYSVAR(stats_method),
MYSQL_SYSVAR(sync_log_dir),
MYSQL_SYSVAR(used_for_temp_tables),
NULL
};
#define COPY_SYSVAR(name) \
memcpy(&MYSQL_SYSVAR_NAME(name), system_variables[i++], \
sizeof(MYSQL_SYSVAR_NAME(name))); \
if (name ## _alias != MYSQL_SYSVAR_NAME(name).def_val && \
*MYSQL_SYSVAR_NAME(name).value == MYSQL_SYSVAR_NAME(name).def_val) \
*MYSQL_SYSVAR_NAME(name).value= name ## _alias;
#define COPY_THDVAR(name) \
name ## _alias= THDVAR(0, name); \
memcpy(&MYSQL_SYSVAR_NAME(name), system_variables[i++], \
sizeof(MYSQL_SYSVAR_NAME(name))); \
if (name ## _alias != MYSQL_SYSVAR_NAME(name).def_val && \
THDVAR(0, name) == MYSQL_SYSVAR_NAME(name).def_val) \
THDVAR(0, name)= name ## _alias;
void copy_variable_aliases()
{
int i= 0;
COPY_SYSVAR(block_size);
COPY_SYSVAR(checkpoint_interval);
COPY_SYSVAR(force_start_after_recovery_failures);
COPY_SYSVAR(group_commit);
COPY_SYSVAR(group_commit_interval);
COPY_SYSVAR(log_dir_path);
COPY_SYSVAR(log_file_size);
COPY_SYSVAR(log_purge_type);
COPY_SYSVAR(max_sort_file_size);
COPY_SYSVAR(page_checksum);
COPY_SYSVAR(pagecache_age_threshold);
COPY_SYSVAR(pagecache_buffer_size);
COPY_SYSVAR(pagecache_division_limit);
COPY_SYSVAR(recover);
COPY_THDVAR(repair_threads);
COPY_THDVAR(sort_buffer_size);
COPY_THDVAR(stats_method);
COPY_SYSVAR(sync_log_dir);
COPY_SYSVAR(used_for_temp_tables);
}
struct st_maria_plugin compat_aliases= {
MYSQL_DAEMON_PLUGIN,
&maria_storage_engine,
"Maria",
"Monty Program Ab",
"Compatibility aliases for the Aria engine",
PLUGIN_LICENSE_GPL,
NULL,
NULL,
0x0105,
status_variables_aliases,
system_variables_aliases,
"1.5",
MariaDB_PLUGIN_MATURITY_GAMMA
};
/* Copyright (C) 2010 Monty Program Ab
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
extern struct st_maria_plugin compat_aliases;
extern char mysql_real_data_home[FN_REFLEN];
extern TYPELIB maria_recover_typelib;
extern TYPELIB maria_stats_method_typelib;
extern TYPELIB maria_translog_purge_type_typelib;
extern TYPELIB maria_sync_log_dir_typelib;
extern TYPELIB maria_group_commit_typelib;
extern struct st_mysql_storage_engine maria_storage_engine;
extern my_bool use_maria_for_temp_tables;
extern struct st_mysql_sys_var* system_variables[];
extern st_mysql_show_var status_variables[];
void copy_variable_aliases();
......@@ -29,7 +29,6 @@
#include "ha_maria.h"
#include "trnman_public.h"
#include "trnman.h"
#include "compat_aliases.h"
C_MODE_START
#include "maria_def.h"
......@@ -3369,7 +3368,6 @@ bool ha_maria::is_changed() const
static int ha_maria_init(void *p)
{
int res;
copy_variable_aliases();
const char *log_dir= maria_data_root;
maria_hton= (handlerton *)p;
maria_hton->state= SHOW_OPTION_YES;
......@@ -3717,7 +3715,6 @@ struct st_mysql_storage_engine maria_storage_engine=
{ MYSQL_HANDLERTON_INTERFACE_VERSION };
maria_declare_plugin(aria)
compat_aliases,
{
MYSQL_STORAGE_ENGINE_PLUGIN,
&maria_storage_engine,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment