[Commits] Rev 2859: provide maria* aliases for aria* command-line options, status and system variables. in http://bazaar.launchpad.net/~maria-captains/maria/5.2/

serg at askmonty.org serg at askmonty.org
Mon Sep 13 19:53:56 EEST 2010


At http://bazaar.launchpad.net/~maria-captains/maria/5.2/

------------------------------------------------------------
revno: 2859
revision-id: sergii at pisem.net-20100913165350-qn6zeiqrcheg2eg1
parent: sergii at pisem.net-20100912165103-gxk3te6n29hc52jd
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 5.2
timestamp: Mon 2010-09-13 18:53:50 +0200
message:
  provide maria* aliases for aria* command-line options, status and system variables.
-------------- next part --------------
=== modified file 'include/maria.h'
--- a/include/maria.h	2010-07-23 20:37:21 +0000
+++ b/include/maria.h	2010-09-13 16:53:50 +0000
@@ -21,12 +21,9 @@
 #ifdef  __cplusplus
 extern "C" {
 #endif
-#ifndef _my_base_h
 #include <my_base.h>
-#endif
-#ifndef _m_ctype_h
+#include <my_sys.h>
 #include <m_ctype.h>
-#endif
 #include "../storage/maria/ma_pagecache.h"
 #include "my_handler.h"
 #include "ft_global.h"
@@ -334,6 +331,12 @@ extern int maria_begin(MARIA_HA *info);
 extern void maria_disable_logging(MARIA_HA *info);
 extern void maria_enable_logging(MARIA_HA *info);
 
+#define HA_RECOVER_NONE         0       /* No automatic recover */
+#define HA_RECOVER_DEFAULT      1       /* Automatic recover active */
+#define HA_RECOVER_BACKUP       2       /* Make a backupfile on recover */
+#define HA_RECOVER_FORCE        4       /* Recover even if we loose rows */
+#define HA_RECOVER_QUICK        8       /* Don't check rows in data file */
+
 /* this is used to pass to mysql_mariachk_table */
 
 #define MARIA_CHK_REPAIR 1              /* equivalent to mariachk -r */

=== modified file 'include/mysql/plugin.h'
--- a/include/mysql/plugin.h	2010-06-15 19:12:13 +0000
+++ b/include/mysql/plugin.h	2010-09-13 16:53:50 +0000
@@ -257,7 +257,7 @@ typedef void (*mysql_var_update_func)(MY
 #define DECLARE_MYSQL_SYSVAR_BASIC(name, type) struct { \
   MYSQL_PLUGIN_VAR_HEADER;      \
   type *value;                  \
-  const type def_val;           \
+  type def_val;                 \
 } MYSQL_SYSVAR_NAME(name)
 
 #define DECLARE_MYSQL_SYSVAR_SIMPLE(name, type) struct { \
@@ -279,7 +279,7 @@ typedef void (*mysql_var_update_func)(MY
 #define DECLARE_MYSQL_THDVAR_BASIC(name, type) struct { \
   MYSQL_PLUGIN_VAR_HEADER;      \
   int offset;                   \
-  const type def_val;           \
+  type def_val;                 \
   DECLARE_THDVAR_FUNC(type);    \
 } MYSQL_SYSVAR_NAME(name)
 

=== added file 'mysql-test/suite/maria/r/compat_aliases.result'
--- a/mysql-test/suite/maria/r/compat_aliases.result	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/maria/r/compat_aliases.result	2010-09-13 16:53:50 +0000
@@ -0,0 +1,90 @@
+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  50202.0 NULL    NULL    Monty Program Ab        Compatibility aliases for the Aria engine       GPL     Gamma   1.5
+Aria    1.5     ACTIVE  STORAGE ENGINE  50202.0 NULL    NULL    Monty Program Ab        Crash-safe tables with MyISAM heritage  GPL     Gamma   1.5
+show variables like 'maria%';
+Variable_name   Value
+maria_block_size        8192
+maria_checkpoint_interval       30
+maria_force_start_after_recovery_failures       0
+maria_group_commit      none
+maria_group_commit_interval     0
+maria_log_file_size     1073741824
+maria_log_purge_type    immediate
+maria_max_sort_file_size        104857600
+maria_page_checksum     ON
+maria_pagecache_age_threshold   300
+maria_pagecache_buffer_size     134213632
+maria_pagecache_division_limit  100
+maria_recover   NORMAL
+maria_repair_threads    10000
+maria_sort_buffer_size  134217728
+maria_stats_method      nulls_unequal
+maria_sync_log_dir      NEWFILE
+maria_used_for_temp_tables      ON
+show variables like 'aria%';
+Variable_name   Value
+aria_block_size 8192
+aria_checkpoint_interval        30
+aria_force_start_after_recovery_failures        0
+aria_group_commit       none
+aria_group_commit_interval      0
+aria_log_file_size      1073741824
+aria_log_purge_type     immediate
+aria_max_sort_file_size 104857600
+aria_page_checksum      ON
+aria_pagecache_age_threshold    300
+aria_pagecache_buffer_size      134213632
+aria_pagecache_division_limit   100
+aria_recover    NORMAL
+aria_repair_threads     10000
+aria_sort_buffer_size   134217728
+aria_stats_method       nulls_unequal
+aria_sync_log_dir       NEWFILE
+aria_used_for_temp_tables       ON
+show status like 'maria%';
+Variable_name   Value
+Maria_pagecache_blocks_not_flushed      0
+Maria_pagecache_blocks_unused   15707
+Maria_pagecache_blocks_used     5
+Maria_pagecache_read_requests   468
+Maria_pagecache_reads   2
+Maria_pagecache_write_requests  7
+Maria_pagecache_writes  0
+Maria_transaction_log_syncs     0
+show status like 'aria%';
+Variable_name   Value
+Aria_pagecache_blocks_not_flushed       0
+Aria_pagecache_blocks_unused    15707
+Aria_pagecache_blocks_used      5
+Aria_pagecache_read_requests    468
+Aria_pagecache_reads    2
+Aria_pagecache_write_requests   7
+Aria_pagecache_writes   0
+Aria_transaction_log_syncs      0
+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,
+ at 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;

=== added file 'mysql-test/suite/maria/t/compat_aliases-master.opt'
--- a/mysql-test/suite/maria/t/compat_aliases-master.opt	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/maria/t/compat_aliases-master.opt	2010-09-13 16:53:50 +0000
@@ -0,0 +1 @@
+--maria-max-sort-file-size=100M --aria-repair-threads=10000

=== added file 'mysql-test/suite/maria/t/compat_aliases.test'
--- a/mysql-test/suite/maria/t/compat_aliases.test	1970-01-01 00:00:00 +0000
+++ b/mysql-test/suite/maria/t/compat_aliases.test	2010-09-13 16:53:50 +0000
@@ -0,0 +1,34 @@
+#
+# test for maria* aliases (system variables, status variables,
+#  command-line options). They should match aria* variables.
+#
+
+select * from information_schema.plugins where plugin_name like '%aria';
+
+show variables like 'maria%';
+show variables like 'aria%';
+show status like 'maria%';
+show status like 'aria%';
+
+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;
+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;
+

=== modified file 'storage/maria/Makefile.am'
--- a/storage/maria/Makefile.am	2010-09-12 16:40:01 +0000
+++ b/storage/maria/Makefile.am	2010-09-13 16:53:50 +0000
@@ -77,7 +77,7 @@ noinst_HEADERS =	maria_def.h ma_rt_index
                         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
+                        ma_servicethread.h compat_aliases.h
 ma_test1_DEPENDENCIES=  $(LIBRARIES)
 ma_test1_LDADD=         @CLIENT_EXTRA_LDFLAGS@ libaria.a \
                         $(top_builddir)/storage/myisam/libmyisam.a \
@@ -140,7 +140,7 @@ libaria_a_SOURCES =	ma_init.c ma_open.c 
                         ma_pagecache.c ma_pagecaches.c \
                         ma_checkpoint.c ma_recovery.c ma_commit.c \
                         ma_pagecrc.c ma_recovery_util.c \
-                        ha_maria.cc ma_servicethread.c
+                        ha_maria.cc compat_aliases.cc ma_servicethread.c
 CLEANFILES =            test?.MA? FT?.MA? isam.log ma_test_all ma_rt_test.MA? sp_test.MA? aria_log_control aria_log.0000*
 
 SUFFIXES = .sh

=== added file 'storage/maria/compat_aliases.cc'
--- a/storage/maria/compat_aliases.cc	1970-01-01 00:00:00 +0000
+++ b/storage/maria/compat_aliases.cc	2010-09-13 16:53:50 +0000
@@ -0,0 +1,252 @@
+/* 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_pagecache_blocks_not_flushed", (char*) &maria_pagecache_var.global_blocks_changed, SHOW_LONG},
+  {"Maria_pagecache_blocks_unused",      (char*) &maria_pagecache_var.blocks_unused, SHOW_LONG},
+  {"Maria_pagecache_blocks_used",        (char*) &maria_pagecache_var.blocks_used, SHOW_LONG},
+  {"Maria_pagecache_read_requests",      (char*) &maria_pagecache_var.global_cache_r_requests, SHOW_LONGLONG},
+  {"Maria_pagecache_reads",              (char*) &maria_pagecache_var.global_cache_read, SHOW_LONGLONG},
+  {"Maria_pagecache_write_requests",     (char*) &maria_pagecache_var.global_cache_w_requests, SHOW_LONGLONG},
+  {"Maria_pagecache_writes",             (char*) &maria_pagecache_var.global_cache_write, SHOW_LONGLONG},
+  {"Maria_transaction_log_syncs",        (char*) &translog_syncs, SHOW_LONGLONG},
+  {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
+};
+

=== added file 'storage/maria/compat_aliases.h'
--- a/storage/maria/compat_aliases.h	1970-01-01 00:00:00 +0000
+++ b/storage/maria/compat_aliases.h	2010-09-13 16:53:50 +0000
@@ -0,0 +1,26 @@
+/* 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[];
+void copy_variable_aliases();

=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc	2010-09-12 16:40:01 +0000
+++ b/storage/maria/ha_maria.cc	2010-09-13 16:53:50 +0000
@@ -29,6 +29,7 @@
 #include "ha_maria.h"
 #include "trnman_public.h"
 #include "trnman.h"
+#include "compat_aliases.h"
 
 C_MODE_START
 #include "maria_def.h"
@@ -202,7 +203,7 @@ static MYSQL_SYSVAR_ULONG(group_commit_i
 
 static MYSQL_SYSVAR_ENUM(log_purge_type, log_purge_type,
        PLUGIN_VAR_RQCMDARG,
-       "Specifies how aria transactional log will be purged. "
+       "Specifies how Aria transactional log will be purged. "
        "Possible values of name are \"immediate\", \"external\" "
        "and \"at_flush\"",
        NULL, NULL, TRANSLOG_PURGE_IMMIDIATE,
@@ -212,7 +213,7 @@ static MYSQL_SYSVAR_ULONGLONG(max_sort_f
        maria_max_temp_length, PLUGIN_VAR_RQCMDARG,
        "Don't use the fast sort index method to created index if the "
        "temporary file would get bigger than this.",
-       0, 0, MAX_FILE_SIZE, 0, MAX_FILE_SIZE, 1024*1024);
+       0, 0, MAX_FILE_SIZE & ~(1*MB-1), 0, MAX_FILE_SIZE, 1*MB);
 
 static MYSQL_SYSVAR_ULONG(pagecache_age_threshold,
        pagecache_age_threshold, PLUGIN_VAR_RQCMDARG,
@@ -227,7 +228,7 @@ static MYSQL_SYSVAR_ULONGLONG(pagecache_
        "The size of the buffer used for index blocks for Aria tables. "
        "Increase this to get better index handling (for all reads and "
        "multiple writes) to as much as you can afford.", 0, 0,
-       KEY_CACHE_SIZE, MALLOC_OVERHEAD, ~(ulong) 0, IO_SIZE);
+       KEY_CACHE_SIZE, 0, ~(ulong) 0, 1);
 
 static MYSQL_SYSVAR_ULONG(pagecache_division_limit, pagecache_division_limit,
        PLUGIN_VAR_RQCMDARG,
@@ -262,10 +263,11 @@ static MYSQL_SYSVAR_ENUM(sync_log_dir, s
        &maria_sync_log_dir_typelib);
 
 #ifdef USE_MARIA_FOR_TMP_TABLES
-static my_bool use_maria_for_temp_tables= 1;
+#define USE_MARIA_FOR_TMP_TABLES_VAL 1
 #else
-static my_bool use_maria_for_temp_tables= 0;
+#define USE_MARIA_FOR_TMP_TABLES_VAL 0
 #endif
+my_bool use_maria_for_temp_tables= USE_MARIA_FOR_TMP_TABLES_VAL;
 
 static MYSQL_SYSVAR_BOOL(used_for_temp_tables, 
        use_maria_for_temp_tables, PLUGIN_VAR_READONLY | PLUGIN_VAR_NOCMDOPT,
@@ -3272,6 +3274,7 @@ 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;
@@ -3388,7 +3391,7 @@ my_bool ha_maria::register_query_cache_t
 }
 #endif
 
-static struct st_mysql_sys_var* system_variables[]= {
+struct st_mysql_sys_var* system_variables[]= {
   MYSQL_SYSVAR(block_size),
   MYSQL_SYSVAR(checkpoint_interval),
   MYSQL_SYSVAR(force_start_after_recovery_failures),
@@ -3539,23 +3542,8 @@ static SHOW_VAR status_variables[]= {
 struct st_mysql_storage_engine maria_storage_engine=
 { MYSQL_HANDLERTON_INTERFACE_VERSION };
 
-mysql_declare_plugin(aria)
-{
-  MYSQL_STORAGE_ENGINE_PLUGIN,
-  &maria_storage_engine,
-  "Aria",
-  "Monty Program 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                */
-  NULL
-}
-mysql_declare_plugin_end;
 maria_declare_plugin(aria)
+compat_aliases,
 {
   MYSQL_STORAGE_ENGINE_PLUGIN,
   &maria_storage_engine,
@@ -3563,12 +3551,12 @@ maria_declare_plugin(aria)
   "Monty Program 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 */
+  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/maria/ha_maria.h'
--- a/storage/maria/ha_maria.h	2010-09-12 16:40:01 +0000
+++ b/storage/maria/ha_maria.h	2010-09-13 16:53:50 +0000
@@ -22,12 +22,6 @@
 
 #include <maria.h>
 
-#define HA_RECOVER_NONE         0       /* No automatic recover */
-#define HA_RECOVER_DEFAULT      1       /* Automatic recover active */
-#define HA_RECOVER_BACKUP       2       /* Make a backupfile on recover */
-#define HA_RECOVER_FORCE        4       /* Recover even if we loose rows */
-#define HA_RECOVER_QUICK        8       /* Don't check rows in data file */
-
 extern ulong maria_sort_buffer_size;
 extern TYPELIB maria_recover_typelib;
 extern ulong maria_recover_options;

=== modified file 'storage/maria/ma_loghandler.h'
--- a/storage/maria/ma_loghandler.h	2010-09-11 18:43:48 +0000
+++ b/storage/maria/ma_loghandler.h	2010-09-13 16:53:50 +0000
@@ -16,12 +16,14 @@
 #ifndef _ma_loghandler_h
 #define _ma_loghandler_h
 
+#define MB (1024UL*1024)
+
 /* transaction log default cache size  (TODO: make it global variable) */
-#define TRANSLOG_PAGECACHE_SIZE (1024U*1024*2)
+#define TRANSLOG_PAGECACHE_SIZE (2*MB)
 /* transaction log default file size */
-#define TRANSLOG_FILE_SIZE (1024U*1024*1024)
+#define TRANSLOG_FILE_SIZE (1024U*MB)
 /* minimum possible transaction log size */
-#define TRANSLOG_MIN_FILE_SIZE (1024U*1024*8)
+#define TRANSLOG_MIN_FILE_SIZE (8*MB)
 /* transaction log default flags (TODO: make it global variable) */
 #define TRANSLOG_DEFAULT_FLAGS 0
 



More information about the commits mailing list