~ubuntu-branches/ubuntu/trusty/drizzle/trusty

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2012-06-19 10:46:49 UTC
  • mfrom: (1.1.6)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20120619104649-e2l0ggd4oz3um0f4
Tags: upstream-7.1.36-stable
ImportĀ upstreamĀ versionĀ 7.1.36-stable

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
Copyright (C) 2000, 2010, MySQL AB & Innobase Oy. All Rights Reserved.
4
4
Copyright (C) 2008, 2009 Google Inc.
5
5
Copyright (C) 2009, Percona Inc.
 
6
Copyright (C) 2011, Stewart Smith
6
7
 
7
8
Portions of this file contain modifications contributed and copyrighted by
8
9
Google, Inc. Those modifications are gratefully acknowledged and are described
45
46
 
46
47
#include <drizzled/error.h>
47
48
#include <drizzled/errmsg_print.h>
48
 
#include <drizzled/charset_info.h>
49
49
#include <drizzled/internal/m_string.h>
50
50
#include <drizzled/internal/my_sys.h>
51
51
#include <drizzled/plugin.h>
52
52
#include <drizzled/show.h>
53
53
#include <drizzled/data_home.h>
 
54
#include <drizzled/catalog/local.h>
54
55
#include <drizzled/error.h>
55
56
#include <drizzled/field.h>
56
57
#include <drizzled/charset.h>
64
65
#include <drizzled/memory/multi_malloc.h>
65
66
#include <drizzled/pthread_globals.h>
66
67
#include <drizzled/named_savepoint.h>
67
 
 
 
68
#include <drizzled/session/table_messages.h>
68
69
#include <drizzled/transaction_services.h>
69
70
#include <drizzled/message/statement_transform.h>
 
71
#include <drizzled/cached_directory.h>
 
72
#include <drizzled/statistics_variables.h>
 
73
#include <drizzled/system_variables.h>
 
74
#include <drizzled/session/times.h>
 
75
#include <drizzled/session/transactions.h>
 
76
#include <drizzled/typelib.h>
70
77
 
71
78
#include <boost/algorithm/string.hpp>
72
79
#include <boost/program_options.hpp>
174
181
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
175
182
typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint;
176
183
static autoextend_constraint innodb_auto_extend_increment;
177
 
typedef constrained_check<size_t, SIZE_MAX, 5242880, 1048576> buffer_pool_constraint;
 
184
typedef constrained_check<size_t, SIZE_MAX, 33554432, 1048576> buffer_pool_constraint;
178
185
static buffer_pool_constraint innobase_buffer_pool_size;
179
186
typedef constrained_check<uint32_t, MAX_BUFFER_POOLS, 1> buffer_pool_instances_constraint;
180
187
static buffer_pool_instances_constraint innobase_buffer_pool_instances;
 
188
typedef constrained_check<uint32_t,
 
189
                          (1 << UNIV_PAGE_SIZE_SHIFT_MAX),
 
190
                                (1 << 12)> page_size_constraint;
 
191
static page_size_constraint innobase_page_size;
 
192
typedef constrained_check<uint32_t,
 
193
                          (1 << UNIV_PAGE_SIZE_SHIFT_MAX),
 
194
                                (1 << 9)> log_block_size_constraint;
 
195
static log_block_size_constraint innobase_log_block_size;
181
196
typedef constrained_check<uint32_t, UINT32_MAX, 100> io_capacity_constraint;
182
197
static io_capacity_constraint innodb_io_capacity;
183
198
typedef constrained_check<uint32_t, 5000, 1> purge_batch_constraint;
204
219
 
205
220
static uint64_constraint innodb_replication_delay;
206
221
 
 
222
static uint32_constraint buffer_pool_restore_at_startup;
 
223
 
207
224
/** Percentage of the buffer pool to reserve for 'old' blocks.
208
225
Connected to buf_LRU_old_ratio. */
209
226
typedef constrained_check<uint32_t, 95, 5> old_blocks_constraint;
216
233
typedef constrained_check<uint32_t, 64, 0> read_ahead_threshold_constraint;
217
234
static read_ahead_threshold_constraint innodb_read_ahead_threshold;
218
235
 
 
236
static uint64_constraint ibuf_max_size;
 
237
 
 
238
typedef constrained_check<uint32_t, 1, 0> binary_constraint;
 
239
static binary_constraint ibuf_active_contract;
 
240
 
 
241
typedef constrained_check<uint32_t, 999999999, 100> ibuf_accel_rate_constraint;
 
242
static ibuf_accel_rate_constraint ibuf_accel_rate;
 
243
static uint32_constraint checkpoint_age_target;
 
244
static binary_constraint flush_neighbor_pages;
 
245
 
 
246
static string sysvar_transaction_log_use_replicator;
 
247
 
219
248
/* The default values for the following char* start-up parameters
220
249
are determined in innobase_init below: */
221
250
 
225
254
static string innobase_file_format_name;
226
255
static string innobase_change_buffering;
227
256
 
 
257
static string read_ahead;
 
258
static string adaptive_flushing_method;
 
259
 
228
260
/* The highest file format being used in the database. The value can be
229
261
set by user, however, it will be adjusted to the newer file format if
230
262
a table of such format is created/opened. */
233
265
/* Below we have boolean-valued start-up parameters, and their default
234
266
values */
235
267
 
236
 
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
237
268
static trinary_constraint innobase_fast_shutdown;
238
269
 
239
270
/* "innobase_file_format_check" decides whether we would continue
285
316
  "all"         /* IBUF_USE_ALL */
286
317
};
287
318
 
 
319
/** Allowed values of read_ahead */
 
320
static const char* read_ahead_names[] = {
 
321
  "none",       /* 0 */
 
322
  "random",
 
323
  "linear",
 
324
  "both",       /* 3 */
 
325
  /* For compatibility with the older Percona patch */
 
326
  "0",          /* 4 ("none" + 4) */
 
327
  "1",
 
328
  "2",
 
329
  "3",          /* 7 ("both" + 4) */
 
330
  NULL
 
331
};
 
332
 
 
333
static TYPELIB read_ahead_typelib = {
 
334
  array_elements(read_ahead_names) - 1, "read_ahead_typelib",
 
335
  read_ahead_names, NULL
 
336
};
 
337
 
 
338
/** Allowed values of adaptive_flushing_method */
 
339
static const char* adaptive_flushing_method_names[] = {
 
340
    "native",           /* 0 */
 
341
    "estimate",         /* 1 */
 
342
    "keep_average",     /* 2 */
 
343
    /* For compatibility with the older Percona patch */
 
344
    "0",                /* 3 ("native" + 3) */
 
345
    "1",                /* 4 ("estimate" + 3) */
 
346
    "2",                /* 5 ("keep_average" + 3) */
 
347
    NULL
 
348
};
 
349
 
 
350
static TYPELIB adaptive_flushing_method_typelib = {
 
351
  array_elements(adaptive_flushing_method_names) - 1,
 
352
  "adaptive_flushing_method_typelib",
 
353
  adaptive_flushing_method_names, NULL
 
354
};
 
355
 
288
356
/* "GEN_CLUST_INDEX" is the name reserved for Innodb default
289
357
system primary index. */
290
358
static const char innobase_index_reserve_name[]= "GEN_CLUST_INDEX";
320
388
 
321
389
  virtual ~InnobaseEngine()
322
390
  {
323
 
    int err= 0;
324
391
    if (innodb_inited) {
325
392
      srv_fast_shutdown = (ulint) innobase_fast_shutdown;
326
393
      innodb_inited = 0;
327
394
      hash_table_free(innobase_open_tables);
328
395
      innobase_open_tables = NULL;
329
396
      if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
330
 
        err = 1;
 
397
        // Throw here?
331
398
      }
332
399
      srv_free_paths_and_sizes();
333
 
      if (internal_innobase_data_file_path)
334
 
        free(internal_innobase_data_file_path);
 
400
      free(internal_innobase_data_file_path);
335
401
    }
336
402
    
337
403
    /* These get strdup'd from vm variables */
489
555
 
490
556
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
491
557
                             const drizzled::identifier::Schema &schema_identifier,
492
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
558
                             drizzled::identifier::table::vector &set_of_identifiers);
493
559
  bool validateCreateTableOption(const std::string &key, const std::string &state);
494
560
  void dropTemporarySchema();
495
561
 
518
584
 
519
585
void InnobaseEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
520
586
                                           const drizzled::identifier::Schema &schema_identifier,
521
 
                                           drizzled::identifier::Table::vector &set_of_identifiers)
 
587
                                           drizzled::identifier::table::vector &set_of_identifiers)
522
588
{
523
589
  CachedDirectory::Entries entries= directory.getEntries();
524
590
 
541
607
 
542
608
    const char *ext= strchr(filename->c_str(), '.');
543
609
 
544
 
    if (ext == NULL || my_strcasecmp(system_charset_info, ext, DEFAULT_FILE_EXTENSION) ||
 
610
    if (ext == NULL || system_charset_info->strcasecmp(ext, DEFAULT_FILE_EXTENSION) ||
545
611
        (filename->compare(0, strlen(TMP_FILE_PREFIX), TMP_FILE_PREFIX) == 0))
546
612
    { }
547
613
    else
933
999
        ulint   value)  /*!< in: time waited for the lock */
934
1000
{
935
1001
  if (in_session)
936
 
    in_session->utime_after_lock+= value;
 
1002
    in_session->times.utime_after_lock+= value;
937
1003
}
938
1004
 
939
1005
/********************************************************************//**
963
1029
  uint64_t end_timestamp= message.transaction_context().end_timestamp();
964
1030
  bool is_end_segment= message.end_segment();
965
1031
  trx->log_commit_id= TRUE;
 
1032
 
 
1033
  string server_uuid= session.getServerUUID();
 
1034
  string originating_server_uuid= session.getOriginatingServerUUID();
 
1035
  uint64_t originating_commit_id= session.getOriginatingCommitID();
 
1036
  bool use_originating_server_uuid= session.isOriginatingServerUUIDSet();
 
1037
 
966
1038
  ulint error= insert_replication_message(data, message.ByteSize(), trx, trx_id,
967
 
               end_timestamp, is_end_segment, seg_id);
 
1039
               end_timestamp, is_end_segment, seg_id, server_uuid.c_str(),
 
1040
               use_originating_server_uuid, originating_server_uuid.c_str(),
 
1041
               originating_commit_id);
 
1042
 
968
1043
  (void)error;
969
1044
 
970
1045
  delete[] data;
1174
1249
  uint  )   /*!< in: max query length to print, or 0 to
1175
1250
           use the default max length */
1176
1251
{
1177
 
  drizzled::identifier::User::const_shared_ptr user_identifier(in_session->user());
 
1252
  drizzled::identifier::user::ptr user_identifier(in_session->user());
1178
1253
 
1179
1254
  fprintf(f,
1180
1255
          "Drizzle thread %"PRIu64", query id %"PRIu64", %s, %s, %s ",
1198
1273
  ulint*  mbminlen, /*!< out: minimum length of a char (in bytes) */
1199
1274
  ulint*  mbmaxlen) /*!< out: maximum length of a char (in bytes) */
1200
1275
{
1201
 
  CHARSET_INFO* cs;
 
1276
  charset_info_st* cs;
1202
1277
  ut_ad(cset < 256);
1203
1278
  ut_ad(mbminlen);
1204
1279
  ut_ad(mbmaxlen);
1253
1328
  const char* a,  /*!< in: first string to compare */
1254
1329
  const char* b)  /*!< in: second string to compare */
1255
1330
{
1256
 
  return(my_strcasecmp(system_charset_info, a, b));
 
1331
  return(system_charset_info->strcasecmp(a, b));
1257
1332
}
1258
1333
 
1259
1334
/******************************************************************//**
1264
1339
/*================*/
1265
1340
  char* a)  /*!< in/out: string to put in lower case */
1266
1341
{
1267
 
  my_casedn_str(system_charset_info, a);
 
1342
  system_charset_info->casedn_str(a);
1268
1343
}
1269
1344
 
1270
1345
UNIV_INTERN
1271
1346
bool
1272
1347
innobase_isspace(
1273
 
  const void *cs,
 
1348
  const void* cs,
1274
1349
  char char_to_test)
1275
1350
{
1276
 
  return my_isspace(static_cast<const CHARSET_INFO *>(cs), char_to_test);
 
1351
  return static_cast<const charset_info_st*>(cs)->isspace(char_to_test);
1277
1352
}
1278
1353
 
1279
1354
#if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN)
1865
1940
  srv_read_ahead_threshold= innodb_read_ahead_threshold.get();
1866
1941
}
1867
1942
 
 
1943
static void auto_lru_dump_update(Session *, sql_var_t)
 
1944
{
 
1945
  srv_auto_lru_dump= buffer_pool_restore_at_startup.get();
 
1946
}
 
1947
 
 
1948
static void ibuf_active_contract_update(Session *, sql_var_t)
 
1949
{
 
1950
  srv_ibuf_active_contract= ibuf_active_contract.get();
 
1951
}
 
1952
 
 
1953
static void ibuf_accel_rate_update(Session *, sql_var_t)
 
1954
{
 
1955
  srv_ibuf_accel_rate= ibuf_accel_rate.get();
 
1956
}
 
1957
 
 
1958
static void checkpoint_age_target_update(Session *, sql_var_t)
 
1959
{
 
1960
  srv_checkpoint_age_target= checkpoint_age_target.get();
 
1961
}
 
1962
 
 
1963
static void flush_neighbor_pages_update(Session *, sql_var_t)
 
1964
{
 
1965
  srv_flush_neighbor_pages= flush_neighbor_pages.get();
 
1966
}
1868
1967
 
1869
1968
static int innodb_commit_concurrency_validate(Session *session, set_var *var)
1870
1969
{
2002
2101
  return(1);
2003
2102
}
2004
2103
 
 
2104
/*********************************************************************//**
 
2105
Check if argument is a valid value for srv_read_ahead and set it.  This
 
2106
function is registered as a callback with MySQL.
 
2107
@return 0 for valid read_ahead value */
 
2108
static
 
2109
int
 
2110
read_ahead_validate(
 
2111
/*================*/
 
2112
  Session*,             /*!< in: thread handle */
 
2113
  set_var*    var)
 
2114
{
 
2115
  const char *read_ahead_input = var->value->str_value.ptr();
 
2116
  int res = read_ahead_typelib.find_type(read_ahead_input, TYPELIB::e_none); // e_none is wrong
 
2117
 
 
2118
  if (res > 0) {
 
2119
    srv_read_ahead = res - 1;
 
2120
    return 0;
 
2121
  }
 
2122
 
 
2123
  return 1;
 
2124
}
 
2125
 
 
2126
/*********************************************************************//**
 
2127
Check if argument is a valid value for srv_adaptive_flushing_method and
 
2128
set it.  This function is registered as a callback with MySQL.
 
2129
@return 0 for valid read_ahead value */
 
2130
static
 
2131
int
 
2132
adaptive_flushing_method_validate(
 
2133
/*==============================*/
 
2134
  Session*,             /*!< in: thread handle */
 
2135
  set_var*    var)
 
2136
{
 
2137
  const char *adaptive_flushing_method_input = var->value->str_value.ptr();
 
2138
  int res = adaptive_flushing_method_typelib.find_type(adaptive_flushing_method_input, TYPELIB::e_none); // e_none is wrong
 
2139
 
 
2140
  if (res > 0) {
 
2141
    srv_adaptive_flushing_method = res - 1;
 
2142
    return 0;
 
2143
  }
 
2144
  return 1;
 
2145
}
 
2146
 
2005
2147
 
2006
2148
/*********************************************************************//**
2007
2149
Opens an InnoDB database.
2033
2175
  srv_spin_wait_delay= innodb_spin_wait_delay.get();
2034
2176
  srv_thread_sleep_delay= innodb_thread_sleep_delay.get();
2035
2177
  srv_read_ahead_threshold= innodb_read_ahead_threshold.get();
 
2178
  srv_auto_lru_dump= buffer_pool_restore_at_startup.get();
 
2179
  srv_ibuf_max_size= ibuf_max_size.get();
 
2180
  srv_ibuf_active_contract= ibuf_active_contract.get();
 
2181
  srv_ibuf_accel_rate= ibuf_accel_rate.get();
 
2182
  srv_checkpoint_age_target= checkpoint_age_target.get();
 
2183
  srv_flush_neighbor_pages= flush_neighbor_pages.get();
 
2184
 
 
2185
  srv_read_ahead = read_ahead_typelib.find_type_or_exit(vm["read-ahead"].as<string>().c_str(),
 
2186
                                                        "read_ahead_typelib") + 1;
 
2187
 
 
2188
  srv_adaptive_flushing_method = adaptive_flushing_method_typelib.find_type_or_exit(vm["adaptive-flushing-method"].as<string>().c_str(),
 
2189
                                                                                    "adaptive_flushing_method_typelib") + 1;
2036
2190
 
2037
2191
  /* Inverted Booleans */
2038
2192
 
2039
 
  innobase_use_checksums= (vm.count("disable-checksums")) ? false : true;
2040
 
  innobase_use_doublewrite= (vm.count("disable-doublewrite")) ? false : true;
2041
 
  srv_adaptive_flushing= (vm.count("disable-adaptive-flushing")) ? false : true;
2042
 
  srv_use_sys_malloc= (vm.count("use-internal-malloc")) ? false : true;
2043
 
  srv_use_native_aio= (vm.count("disable-native-aio")) ? false : true;
2044
 
  support_xa= (vm.count("disable-xa")) ? false : true;
2045
 
  btr_search_enabled= (vm.count("disable-adaptive-hash-index")) ? false : true;
2046
 
 
 
2193
  innobase_use_checksums= not vm.count("disable-checksums");
 
2194
  innobase_use_doublewrite= not vm.count("disable-doublewrite");
 
2195
  srv_adaptive_flushing= not vm.count("disable-adaptive-flushing");
 
2196
  srv_use_sys_malloc= not vm.count("use-internal-malloc");
 
2197
  srv_use_native_aio= not vm.count("disable-native-aio");
 
2198
  support_xa= not vm.count("disable-xa");
 
2199
  btr_search_enabled= not vm.count("disable-adaptive-hash-index");
2047
2200
 
2048
2201
  /* Hafta do this here because we need to late-bind the default value */
2049
 
  if (vm.count("data-home-dir"))
2050
 
  {
2051
 
    innobase_data_home_dir= vm["data-home-dir"].as<string>();
2052
 
  }
2053
 
  else
2054
 
  {
2055
 
    innobase_data_home_dir= getDataHome().file_string();
2056
 
  }
2057
 
 
 
2202
  innobase_data_home_dir= vm.count("data-home-dir") ? vm["data-home-dir"].as<string>() : getDataHome().file_string();
2058
2203
 
2059
2204
  if (vm.count("data-file-path"))
2060
2205
  {
2085
2230
  }
2086
2231
#endif /* UNIV_DEBUG */
2087
2232
 
 
2233
  srv_page_size = 0;
 
2234
  srv_page_size_shift = 0;
 
2235
 
 
2236
  uint32_t page_size = innobase_page_size.get();
 
2237
  uint32_t log_block_size = innobase_log_block_size.get();
 
2238
 
 
2239
  if (innobase_page_size != (1 << 14)) {
 
2240
    uint n_shift;
 
2241
 
 
2242
    errmsg_printf(error::WARN,
 
2243
                  "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
 
2244
    for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
 
2245
      if (innobase_page_size == (1UL << n_shift)) {
 
2246
        srv_page_size_shift = n_shift;
 
2247
        srv_page_size = (1 << srv_page_size_shift);
 
2248
        errmsg_printf(error::WARN,
 
2249
                      "InnoDB: The universal page size of the database is set to %lu.\n",
 
2250
                      srv_page_size);
 
2251
        break;
 
2252
      }
 
2253
    }
 
2254
  } else {
 
2255
    srv_page_size_shift = 14;
 
2256
    srv_page_size = (1 << srv_page_size_shift);
 
2257
  }
 
2258
 
 
2259
  if (!srv_page_size_shift) {
 
2260
    errmsg_printf(error::ERROR,
 
2261
                  "InnoDB: Error: %"PRIu32" is not a valid value for innodb_page_size.\n"
 
2262
                  "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n",
 
2263
                  page_size);
 
2264
    goto error;
 
2265
  }
 
2266
 
 
2267
  srv_log_block_size = 0;
 
2268
  if (log_block_size != (1 << 9)) { /*!=512*/
 
2269
    uint        n_shift;
 
2270
 
 
2271
    errmsg_printf(error::WARN,
 
2272
                  "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
 
2273
    for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
 
2274
      if (log_block_size == (1UL << n_shift)) {
 
2275
        srv_log_block_size = (1 << n_shift);
 
2276
        errmsg_printf(error::WARN, "InnoDB: The log block size is set to %"PRIu32".\n",
 
2277
                      srv_log_block_size);
 
2278
        break;
 
2279
      }
 
2280
    }
 
2281
  } else {
 
2282
    srv_log_block_size = 512;
 
2283
  }
 
2284
 
 
2285
  if (!srv_log_block_size) {
 
2286
    errmsg_printf(error::ERROR,
 
2287
                  "InnoDB: Error: %"PRIu32" is not a valid value for innodb_log_block_size.\n"
 
2288
                  "InnoDB: Error: A valid value for innodb_log_block_size is\n"
 
2289
                  "InnoDB: Error: a power of 2 from 512 to 16384.\n",
 
2290
                  log_block_size);
 
2291
    goto error;
 
2292
  }
 
2293
 
2088
2294
  os_innodb_umask = (ulint)internal::my_umask;
2089
2295
 
2090
2296
 
2118
2324
 
2119
2325
mem_free_and_error:
2120
2326
    srv_free_paths_and_sizes();
2121
 
    if (internal_innobase_data_file_path)
2122
 
      free(internal_innobase_data_file_path);
 
2327
    free(internal_innobase_data_file_path);
2123
2328
    goto error;
2124
2329
  }
2125
2330
 
2235
2440
  srv_n_read_io_threads = (ulint) innobase_read_io_threads;
2236
2441
  srv_n_write_io_threads = (ulint) innobase_write_io_threads;
2237
2442
 
 
2443
  srv_read_ahead &= 3;
 
2444
  srv_adaptive_flushing_method %= 3;
 
2445
 
2238
2446
  srv_force_recovery = (ulint) innobase_force_recovery;
2239
2447
 
2240
2448
  srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
2288
2496
  actuall_engine_ptr->dropTemporarySchema();
2289
2497
 
2290
2498
  context.add(new InnodbStatusTool);
2291
 
 
2292
2499
  context.add(innodb_engine_ptr);
2293
 
 
2294
 
  context.add(new(std::nothrow)CmpTool(false));
2295
 
 
2296
 
  context.add(new(std::nothrow)CmpTool(true));
2297
 
 
2298
 
  context.add(new(std::nothrow)CmpmemTool(false));
2299
 
 
2300
 
  context.add(new(std::nothrow)CmpmemTool(true));
2301
 
 
2302
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_TRX"));
2303
 
 
2304
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCKS"));
2305
 
 
2306
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCK_WAITS"));
2307
 
 
2308
 
  context.add(new(std::nothrow)InnodbSysTablesTool());
2309
 
 
2310
 
  context.add(new(std::nothrow)InnodbSysTableStatsTool());
2311
 
 
2312
 
  context.add(new(std::nothrow)InnodbSysIndexesTool());
2313
 
 
2314
 
  context.add(new(std::nothrow)InnodbSysColumnsTool());
2315
 
 
2316
 
  context.add(new(std::nothrow)InnodbSysFieldsTool());
2317
 
 
2318
 
  context.add(new(std::nothrow)InnodbSysForeignTool());
2319
 
 
2320
 
  context.add(new(std::nothrow)InnodbSysForeignColsTool());
2321
 
 
2322
 
  context.add(new(std::nothrow)InnodbInternalTables());
2323
 
  context.add(new(std::nothrow)InnodbReplicationTable());
 
2500
  context.add(new CmpTool(false));
 
2501
  context.add(new CmpTool(true));
 
2502
  context.add(new CmpmemTool(false));
 
2503
  context.add(new CmpmemTool(true));
 
2504
  context.add(new InnodbTrxTool("INNODB_TRX"));
 
2505
  context.add(new InnodbTrxTool("INNODB_LOCKS"));
 
2506
  context.add(new InnodbTrxTool("INNODB_LOCK_WAITS"));
 
2507
  context.add(new InnodbSysTablesTool());
 
2508
  context.add(new InnodbSysTableStatsTool());
 
2509
  context.add(new InnodbSysIndexesTool());
 
2510
  context.add(new InnodbSysColumnsTool());
 
2511
  context.add(new InnodbSysFieldsTool());
 
2512
  context.add(new InnodbSysForeignTool());
 
2513
  context.add(new InnodbSysForeignColsTool());
 
2514
  context.add(new InnodbInternalTables());
 
2515
  context.add(new InnodbReplicationTable());
2324
2516
 
2325
2517
  if (innobase_use_replication_log)
2326
2518
  {
2327
 
    ReplicationLog *replication_logger= new(std::nothrow)ReplicationLog();
 
2519
    ReplicationLog *replication_logger= new ReplicationLog();
2328
2520
    context.add(replication_logger);
2329
 
    ReplicationLog::setup(replication_logger);
 
2521
    ReplicationLog::setup(replication_logger, sysvar_transaction_log_use_replicator);
2330
2522
  }
2331
2523
 
2332
2524
  context.registerVariable(new sys_var_const_string_val("data-home-dir", innobase_data_home_dir));
2376
2568
                                                  innodb_file_format_max_validate));
2377
2569
  context.registerVariable(new sys_var_constrained_value_readonly<size_t>("buffer_pool_size", innobase_buffer_pool_size));
2378
2570
  context.registerVariable(new sys_var_constrained_value_readonly<int64_t>("log_file_size", innobase_log_file_size));
 
2571
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("page_size", innobase_page_size));
 
2572
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("log_block_size", innobase_log_block_size));
2379
2573
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit",
2380
2574
                                                  innodb_flush_log_at_trx_commit));
2381
2575
  context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("max_dirty_pages_pct",
2410
2604
  context.registerVariable(new sys_var_constrained_value<uint32_t>("read_ahead_threshold",
2411
2605
                                                                   innodb_read_ahead_threshold,
2412
2606
                                                                   innodb_read_ahead_threshold_update));
 
2607
  context.registerVariable(new sys_var_constrained_value<uint32_t>("auto_lru_dump",
 
2608
                                                                   buffer_pool_restore_at_startup,
 
2609
                                                                   auto_lru_dump_update));
 
2610
  context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("ibuf_max_size",
 
2611
                                                                            ibuf_max_size));
 
2612
  context.registerVariable(new sys_var_constrained_value<uint32_t>("ibuf_active_contract",
 
2613
                                                                   ibuf_active_contract,
 
2614
                                                                   ibuf_active_contract_update));
 
2615
  context.registerVariable(new sys_var_constrained_value<uint32_t>("ibuf_accel_rate",
 
2616
                                                                   ibuf_accel_rate,
 
2617
                                                                   ibuf_accel_rate_update));
 
2618
  context.registerVariable(new sys_var_constrained_value<uint32_t>("checkpoint_age_target",
 
2619
                                                                   checkpoint_age_target,
 
2620
                                                                   checkpoint_age_target_update));
 
2621
  context.registerVariable(new sys_var_constrained_value<uint32_t>("flush_neighbor_pages",
 
2622
                                                                   flush_neighbor_pages,
 
2623
                                                                   flush_neighbor_pages_update));
 
2624
  context.registerVariable(new sys_var_std_string("read_ahead",
 
2625
                                                  read_ahead,
 
2626
                                                  read_ahead_validate));
 
2627
  context.registerVariable(new sys_var_std_string("adaptive_flushing_method",
 
2628
                                                  adaptive_flushing_method,
 
2629
                                                  adaptive_flushing_method_validate));
2413
2630
  /* Get the current high water mark format. */
2414
2631
  innobase_file_format_max = trx_sys_file_format_max_get();
2415
2632
  btr_search_fully_disabled = (!btr_search_enabled);
2416
2633
 
 
2634
  context.registerVariable(new sys_var_const_string("use-replicator",
 
2635
                                                    sysvar_transaction_log_use_replicator));
 
2636
 
2417
2637
  return(FALSE);
2418
2638
 
2419
2639
error:
3638
3858
  const unsigned char* b,   /* in: data field */
3639
3859
  unsigned int  b_length) /* in: data field length, not UNIV_SQL_NULL */
3640
3860
{
3641
 
  const CHARSET_INFO* charset;
 
3861
  const charset_info_st* charset;
3642
3862
  enum_field_types  mysql_tp;
3643
3863
  int     ret;
3644
3864
 
3763
3983
  case DRIZZLE_TYPE_BOOLEAN:
3764
3984
  case DRIZZLE_TYPE_UUID:
3765
3985
    return(DATA_FIXBINARY);
 
3986
  case DRIZZLE_TYPE_IPV6:
 
3987
   return(DATA_FIXBINARY);
3766
3988
  case DRIZZLE_TYPE_NULL:
3767
3989
    ut_error;
3768
3990
  }
3871
4093
      const byte* data;
3872
4094
      ulint   key_len;
3873
4095
      ulint   true_len;
3874
 
      const CHARSET_INFO* cs;
 
4096
      const charset_info_st* cs;
3875
4097
      int   error=0;
3876
4098
 
3877
4099
      key_len = key_part->length;
3897
4119
      the true length of the key */
3898
4120
 
3899
4121
      if (len > 0 && cs->mbmaxlen > 1) {
3900
 
        true_len = (ulint) cs->cset->well_formed_len(cs,
3901
 
            (const char *) data,
3902
 
            (const char *) data + len,
3903
 
                                                (uint) (key_len /
3904
 
                                                        cs->mbmaxlen),
3905
 
            &error);
 
4122
        true_len = (ulint) cs->cset->well_formed_len(*cs, str_ref(data, len), (uint) (key_len / cs->mbmaxlen), &error);
3906
4123
      }
3907
4124
 
3908
4125
      /* In a column prefix index, we may need to truncate
3930
4147
 
3931
4148
    } else if (mysql_type == DRIZZLE_TYPE_BLOB) {
3932
4149
 
3933
 
      const CHARSET_INFO* cs;
 
4150
      const charset_info_st* cs;
3934
4151
      ulint   key_len;
3935
4152
      ulint   true_len;
3936
4153
      int   error=0;
3963
4180
      the true length of the key */
3964
4181
 
3965
4182
      if (blob_len > 0 && cs->mbmaxlen > 1) {
3966
 
        true_len = (ulint) cs->cset->well_formed_len(cs,
3967
 
                                                     (const char *) blob_data,
3968
 
                                                     (const char *) blob_data
3969
 
                                                     + blob_len,
3970
 
                                                     (uint) (key_len /
3971
 
                                                             cs->mbmaxlen),
3972
 
                                                     &error);
 
4183
        true_len = (ulint) cs->cset->well_formed_len(*cs, str_ref(blob_data, blob_len), (uint) (key_len / cs->mbmaxlen), &error);
3973
4184
      }
3974
4185
 
3975
4186
      /* All indexes on BLOB and TEXT are column prefix
4002
4213
      ulint     true_len;
4003
4214
      ulint     key_len;
4004
4215
      const unsigned char*    src_start;
4005
 
      enum_field_types  real_type;
4006
 
      const CHARSET_INFO* cs= field->charset();
 
4216
      const charset_info_st* cs= field->charset();
4007
4217
 
4008
4218
      key_len = key_part->length;
4009
4219
 
4014
4224
      }
4015
4225
 
4016
4226
      src_start = record + key_part->offset;
4017
 
      real_type = field->real_type();
4018
4227
      true_len = key_len;
4019
4228
 
4020
4229
      /* Character set for the field is defined only
6129
6338
      | DICT_TF_COMPACT
6130
6339
      | DICT_TF_FORMAT_ZIP
6131
6340
      << DICT_TF_FORMAT_SHIFT;
6132
 
#if DICT_TF_ZSSIZE_MAX < 1
6133
 
# error "DICT_TF_ZSSIZE_MAX < 1"
6134
 
#endif
6135
6341
 
6136
6342
    if (strict_mode)
6137
6343
    {
6565
6771
  innobase_commit_low(trx);
6566
6772
  trx_free_for_mysql(trx);
6567
6773
 
 
6774
  if (error) {
 
6775
    // What do we do here?
 
6776
  }
 
6777
 
6568
6778
  return false; // We are just a listener since we lack control over DDL, so we give no positive acknowledgement. 
6569
6779
}
6570
6780
 
6571
6781
void InnobaseEngine::dropTemporarySchema()
6572
6782
{
6573
 
  identifier::Schema schema_identifier(GLOBAL_TEMPORARY_EXT);
6574
 
  trx_t*  trx= NULL;
6575
6783
  string schema_path(GLOBAL_TEMPORARY_EXT);
6576
 
 
6577
 
  schema_path.append("/");
6578
 
 
6579
 
  trx = trx_allocate_for_mysql();
 
6784
  schema_path += "/";
 
6785
 
 
6786
  trx_t* trx = trx_allocate_for_mysql();
6580
6787
 
6581
6788
  trx->mysql_thd = NULL;
6582
6789
 
6745
6952
 
6746
6953
  ut_a(prebuilt->trx == session_to_trx(getTable()->in_use));
6747
6954
 
6748
 
  prebuilt->trx->op_info = (char*)"estimating records in index range";
 
6955
  prebuilt->trx->op_info = "estimating records in index range";
6749
6956
 
6750
6957
  /* In case MySQL calls this in the middle of a SELECT query, release
6751
6958
  possible adaptive hash latch to avoid deadlocks of threads */
6817
7024
func_exit:
6818
7025
  free(key_val_buff2);
6819
7026
 
6820
 
  prebuilt->trx->op_info = (char*)"";
 
7027
  prebuilt->trx->op_info = "";
6821
7028
 
6822
7029
  /* The MySQL optimizer seems to believe an estimate of 0 rows is
6823
7030
  always accurate and may return the result 'Empty set' based on that.
6878
7085
  estimate = 2 * local_data_file_length /
6879
7086
           dict_index_calc_min_rec_len(index);
6880
7087
 
6881
 
  prebuilt->trx->op_info = (char*)"";
 
7088
  prebuilt->trx->op_info = "";
6882
7089
 
6883
7090
  return((ha_rows) estimate);
6884
7091
}
7068
7275
  /* In case MySQL calls this in the middle of a SELECT query, release
7069
7276
  possible adaptive hash latch to avoid deadlocks of threads */
7070
7277
 
7071
 
  prebuilt->trx->op_info = (char*)"returning various info to MySQL";
 
7278
  prebuilt->trx->op_info = "returning various info to MySQL";
7072
7279
 
7073
7280
  trx_search_latch_release_if_reserved(prebuilt->trx);
7074
7281
 
7087
7294
 
7088
7295
    prebuilt->trx->op_info = "returning various info to MySQL";
7089
7296
 
7090
 
    fs::path get_status_path(getDataHomeCatalog());
 
7297
    fs::path get_status_path(catalog::local_identifier().getPath());
7091
7298
    get_status_path /= ib_table->name;
7092
7299
    fs::change_extension(get_status_path, "dfe");
7093
7300
 
7315
7522
  }
7316
7523
 
7317
7524
func_exit:
7318
 
  prebuilt->trx->op_info = (char*)"";
 
7525
  prebuilt->trx->op_info = "";
7319
7526
 
7320
7527
  return(0);
7321
7528
}
7526
7733
 
7527
7734
  update_session(getTable()->in_use);
7528
7735
 
7529
 
  prebuilt->trx->op_info = (char*)"returning table comment";
 
7736
  prebuilt->trx->op_info = "returning table comment";
7530
7737
 
7531
7738
  /* In case MySQL calls this in the middle of a SELECT query, release
7532
7739
  possible adaptive hash latch to avoid deadlocks of threads */
7571
7778
 
7572
7779
  mutex_exit(&srv_dict_tmpfile_mutex);
7573
7780
 
7574
 
  prebuilt->trx->op_info = (char*)"";
 
7781
  prebuilt->trx->op_info = "";
7575
7782
 
7576
7783
  return(str ? str : (char*) comment);
7577
7784
}
7597
7804
 
7598
7805
  update_session(getTable()->in_use);
7599
7806
 
7600
 
  prebuilt->trx->op_info = (char*)"getting info on foreign keys";
 
7807
  prebuilt->trx->op_info = "getting info on foreign keys";
7601
7808
 
7602
7809
  /* In case MySQL calls this in the middle of a SELECT query,
7603
7810
  release possible adaptive hash latch to avoid
7611
7818
  /* output the data to a temporary file */
7612
7819
  dict_print_info_on_foreign_keys(TRUE, srv_dict_tmpfile,
7613
7820
        prebuilt->trx, prebuilt->table);
7614
 
  prebuilt->trx->op_info = (char*)"";
 
7821
  prebuilt->trx->op_info = "";
7615
7822
 
7616
7823
  flen = ftell(srv_dict_tmpfile);
7617
7824
  if (flen < 0) {
7639
7846
int
7640
7847
ha_innobase::get_foreign_key_list(Session *session, List<ForeignKeyInfo> *f_key_list)
7641
7848
{
7642
 
  dict_foreign_t* foreign;
7643
 
 
7644
7849
  ut_a(prebuilt != NULL);
7645
7850
  update_session(getTable()->in_use);
7646
 
  prebuilt->trx->op_info = (char*)"getting list of foreign keys";
 
7851
  prebuilt->trx->op_info = "getting list of foreign keys";
7647
7852
  trx_search_latch_release_if_reserved(prebuilt->trx);
7648
7853
  mutex_enter(&(dict_sys->mutex));
7649
 
  foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
7650
 
 
7651
 
  while (foreign != NULL) {
7652
 
 
7653
 
    uint i;
7654
 
    LEX_STRING *name = 0;
 
7854
  dict_foreign_t* foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
 
7855
 
 
7856
  while (foreign != NULL) 
 
7857
  {
7655
7858
    uint ulen;
7656
7859
    char uname[NAME_LEN + 1];           /* Unencoded name */
7657
7860
    char db_name[NAME_LEN + 1];
7659
7862
 
7660
7863
    /** Foreign id **/
7661
7864
    tmp_buff = foreign->id;
7662
 
    i = 0;
 
7865
    uint i = 0;
7663
7866
    while (tmp_buff[i] != '/')
7664
7867
      i++;
7665
7868
    tmp_buff += i + 1;
7666
 
    LEX_STRING *tmp_foreign_id = session->make_lex_string(NULL, tmp_buff, strlen(tmp_buff), true);
 
7869
    lex_string_t *tmp_foreign_id = session->make_lex_string(NULL, str_ref(tmp_buff));
7667
7870
 
7668
7871
    /* Database name */
7669
7872
    tmp_buff = foreign->referenced_table_name;
7676
7879
    }
7677
7880
    db_name[i] = 0;
7678
7881
    ulen= identifier::Table::filename_to_tablename(db_name, uname, sizeof(uname));
7679
 
    LEX_STRING *tmp_referenced_db = session->make_lex_string(NULL, uname, ulen, true);
 
7882
    lex_string_t *tmp_referenced_db = session->make_lex_string(NULL, str_ref(uname, ulen));
7680
7883
 
7681
7884
    /* Table name */
7682
7885
    tmp_buff += i + 1;
7683
7886
    ulen= identifier::Table::filename_to_tablename(tmp_buff, uname, sizeof(uname));
7684
 
    LEX_STRING *tmp_referenced_table = session->make_lex_string(NULL, uname, ulen, true);
 
7887
    lex_string_t *tmp_referenced_table = session->make_lex_string(NULL, str_ref(uname, ulen));
7685
7888
 
7686
7889
    /** Foreign Fields **/
7687
 
    List<LEX_STRING> tmp_foreign_fields;
7688
 
    List<LEX_STRING> tmp_referenced_fields;
7689
 
    for (i= 0;;) {
7690
 
      tmp_buff= foreign->foreign_col_names[i];
7691
 
      name = session->make_lex_string(name, tmp_buff, strlen(tmp_buff), true);
7692
 
      tmp_foreign_fields.push_back(name);
7693
 
      tmp_buff= foreign->referenced_col_names[i];
7694
 
      name = session->make_lex_string(name, tmp_buff, strlen(tmp_buff), true);
7695
 
      tmp_referenced_fields.push_back(name);
 
7890
    List<lex_string_t> tmp_foreign_fields;
 
7891
    List<lex_string_t> tmp_referenced_fields;
 
7892
    for (i= 0;;) 
 
7893
                {
 
7894
      tmp_foreign_fields.push_back(session->make_lex_string(NULL, str_ref(foreign->foreign_col_names[i])));
 
7895
      tmp_referenced_fields.push_back(session->make_lex_string(NULL, str_ref(foreign->referenced_col_names[i])));
7696
7896
      if (++i >= foreign->n_fields)
7697
7897
        break;
7698
7898
    }
7699
7899
 
7700
 
    ulong length;
7701
7900
    if (foreign->type & DICT_FOREIGN_ON_DELETE_CASCADE)
7702
 
    {
7703
 
      length=7;
7704
7901
      tmp_buff= "CASCADE";
7705
 
    }
7706
7902
    else if (foreign->type & DICT_FOREIGN_ON_DELETE_SET_NULL)
7707
 
    {
7708
 
      length=8;
7709
7903
      tmp_buff= "SET NULL";
7710
 
    }
7711
7904
    else if (foreign->type & DICT_FOREIGN_ON_DELETE_NO_ACTION)
7712
 
    {
7713
 
      length=9;
7714
7905
      tmp_buff= "NO ACTION";
7715
 
    }
7716
7906
    else
7717
 
    {
7718
 
      length=8;
7719
7907
      tmp_buff= "RESTRICT";
7720
 
    }
7721
 
    LEX_STRING *tmp_delete_method = session->make_lex_string(NULL, tmp_buff, length, true);
7722
 
 
 
7908
    lex_string_t *tmp_delete_method = session->make_lex_string(NULL, str_ref(tmp_buff));
7723
7909
 
7724
7910
    if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
7725
 
    {
7726
 
      length=7;
7727
7911
      tmp_buff= "CASCADE";
7728
 
    }
7729
7912
    else if (foreign->type & DICT_FOREIGN_ON_UPDATE_SET_NULL)
7730
 
    {
7731
 
      length=8;
7732
7913
      tmp_buff= "SET NULL";
7733
 
    }
7734
7914
    else if (foreign->type & DICT_FOREIGN_ON_UPDATE_NO_ACTION)
7735
 
    {
7736
 
      length=9;
7737
7915
      tmp_buff= "NO ACTION";
7738
 
    }
7739
7916
    else
7740
 
    {
7741
 
      length=8;
7742
7917
      tmp_buff= "RESTRICT";
7743
 
    }
7744
 
    LEX_STRING *tmp_update_method = session->make_lex_string(NULL, tmp_buff, length, true);
7745
 
 
7746
 
    LEX_STRING *tmp_referenced_key_name = NULL;
7747
 
 
7748
 
    if (foreign->referenced_index &&
7749
 
        foreign->referenced_index->name)
7750
 
    {
7751
 
      tmp_referenced_key_name = session->make_lex_string(NULL,
7752
 
                                                         foreign->referenced_index->name, strlen(foreign->referenced_index->name), true);
7753
 
    }
 
7918
    lex_string_t *tmp_update_method = session->make_lex_string(NULL, str_ref(tmp_buff));
 
7919
 
 
7920
    lex_string_t *tmp_referenced_key_name = foreign->referenced_index && foreign->referenced_index->name
 
7921
      ? session->make_lex_string(NULL, str_ref(foreign->referenced_index->name))
 
7922
      : NULL;
7754
7923
 
7755
7924
    ForeignKeyInfo f_key_info(
7756
 
                              tmp_foreign_id, tmp_referenced_db, tmp_referenced_table,
7757
 
                              tmp_update_method, tmp_delete_method, tmp_referenced_key_name,
7758
 
                              tmp_foreign_fields, tmp_referenced_fields);
 
7925
      tmp_foreign_id, tmp_referenced_db, tmp_referenced_table,
 
7926
      tmp_update_method, tmp_delete_method, tmp_referenced_key_name,
 
7927
      tmp_foreign_fields, tmp_referenced_fields);
7759
7928
 
7760
 
    ForeignKeyInfo *pf_key_info = (ForeignKeyInfo *)
7761
 
      session->getMemRoot()->duplicate(&f_key_info, sizeof(ForeignKeyInfo));
7762
 
    f_key_list->push_back(pf_key_info);
 
7929
    f_key_list->push_back((ForeignKeyInfo*)session->mem.memdup(&f_key_info, sizeof(ForeignKeyInfo)));
7763
7930
    foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
7764
7931
  }
7765
7932
  mutex_exit(&(dict_sys->mutex));
7766
 
  prebuilt->trx->op_info = (char*)"";
 
7933
  prebuilt->trx->op_info = "";
7767
7934
 
7768
 
  return(0);
 
7935
  return 0;
7769
7936
}
7770
7937
 
7771
7938
/*****************************************************************//**
7823
7990
/*======================================*/
7824
7991
  char* str)  /*!< in, own: create info string to free */
7825
7992
{
7826
 
  if (str) {
7827
 
    free(str);
7828
 
  }
 
7993
  free(str);
7829
7994
}
7830
7995
 
7831
7996
/*******************************************************************//**
8340
8505
 
8341
8506
    HASH_DELETE(INNOBASE_SHARE, table_name_hash,
8342
8507
          innobase_open_tables, fold, share);
8343
 
    share->lock.deinit();
8344
8508
 
8345
8509
    /* Free any memory from index translation table */
8346
8510
    free(share->idx_trans_tbl.index_mapping);
8799
8963
{
8800
8964
  ulint char_length;    /*!< character length in bytes */
8801
8965
  ulint n_chars;      /*!< number of characters in prefix */
8802
 
  const CHARSET_INFO* charset;  /*!< charset used in the field */
 
8966
  const charset_info_st* charset;  /*!< charset used in the field */
8803
8967
 
8804
8968
  charset = get_charset((uint) charset_id);
8805
8969
 
9133
9297
          "Number of UNDO logs to purge in one batch from the history list. "
9134
9298
          "Default is 20.");
9135
9299
  context("purge-threads",
9136
 
          po::value<purge_threads_constraint>(&innodb_n_purge_threads)->default_value(0),
9137
 
          "Purge threads can be either 0 or 1. Defalut is 0.");
 
9300
          po::value<purge_threads_constraint>(&innodb_n_purge_threads)->default_value(1),
 
9301
          "Purge threads can be either 0 or 1. Default is 1.");
9138
9302
  context("file-per-table",
9139
9303
          po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),
9140
9304
           "Stores each InnoDB table to an .ibd file in the database dir.");
9211
9375
  context("log-file-size",
9212
9376
          po::value<log_file_constraint>(&innobase_log_file_size)->default_value(20*1024*1024L),
9213
9377
          "The size of the buffer which InnoDB uses to write log to the log files on disk.");
 
9378
  context("page-size",
 
9379
          po::value<page_size_constraint>(&innobase_page_size)->default_value(1 << 14),
 
9380
          "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!");
 
9381
  context("log-block-size",
 
9382
          po::value<log_block_size_constraint>(&innobase_log_block_size)->default_value(1 << 9),
 
9383
          "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!");
9214
9384
  context("log-files-in-group",
9215
9385
          po::value<log_files_in_group_constraint>(&innobase_log_files_in_group)->default_value(2),
9216
9386
          "Number of log files in the log group. InnoDB writes to the files in a circular fashion.");
9248
9418
  context("read-ahead-threshold",
9249
9419
          po::value<read_ahead_threshold_constraint>(&innodb_read_ahead_threshold)->default_value(56),
9250
9420
          "Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.");
 
9421
  context("auto-lru-dump",
 
9422
          po::value<uint32_constraint>(&buffer_pool_restore_at_startup)->default_value(0),
 
9423
          "Time in seconds between automatic buffer pool dumps. "
 
9424
          "0 (the default) disables automatic dumps.");
 
9425
  context("ibuf-max-size",
 
9426
          po::value<uint64_constraint>(&ibuf_max_size)->default_value(UINT64_MAX),
 
9427
          "The maximum size of the insert buffer (in bytes).");
 
9428
  context("ibuf-active-contract",
 
9429
          po::value<binary_constraint>(&ibuf_active_contract)->default_value(1),
 
9430
          "Enable/Disable active_contract of insert buffer. 0:disable 1:enable");
 
9431
  context("ibuf-accel-rate",
 
9432
          po::value<ibuf_accel_rate_constraint>(&ibuf_accel_rate)->default_value(100),
 
9433
          "Tunes amount of insert buffer processing of background, in addition to innodb_io_capacity. (in percentage)");
 
9434
  context("checkpoint-age-target",
 
9435
          po::value<uint32_constraint>(&checkpoint_age_target)->default_value(0),
 
9436
          "Control soft limit of checkpoint age. (0 : not control)");
 
9437
  context("flush-neighbor-pages",
 
9438
          po::value<binary_constraint>(&flush_neighbor_pages)->default_value(1),
 
9439
          "Enable/Disable flushing also neighbor pages. 0:disable 1:enable");
 
9440
  context("read-ahead",
 
9441
          po::value<string>(&read_ahead)->default_value("linear"),
 
9442
          "Control read ahead activity (none, random, [linear], both). [from 1.0.5: random read ahead is ignored]");
 
9443
  context("adaptive-flushing-method",
 
9444
          po::value<string>(&adaptive_flushing_method)->default_value("estimate"),
 
9445
          "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)");
9251
9446
  context("disable-xa",
9252
9447
          "Disable InnoDB support for the XA two-phase commit");
9253
9448
  context("disable-table-locks",
9258
9453
  context("replication-log",
9259
9454
          po::value<bool>(&innobase_use_replication_log)->default_value(false)->zero_tokens(),
9260
9455
          _("Enable internal replication log."));
 
9456
  context("use-replicator",
 
9457
          po::value<string>(&sysvar_transaction_log_use_replicator)->default_value(DEFAULT_USE_REPLICATOR),
 
9458
          _("Name of the replicator plugin to use (default='default_replicator')")); 
9261
9459
  context("lock-wait-timeout",
9262
9460
          po::value<lock_wait_constraint>(&lock_wait_timeout)->default_value(50),
9263
9461
          _("Timeout in seconds an InnoDB transaction may wait for a lock before being rolled back. Values above 100000000 disable the timeout."));
9276
9474
DRIZZLE_DECLARE_PLUGIN
9277
9475
{
9278
9476
  DRIZZLE_VERSION_ID,
9279
 
  innobase_engine_name,
 
9477
  "innodb",
9280
9478
  INNODB_VERSION_STR,
9281
9479
  "Innobase Oy",
9282
 
  "Supports transactions, row-level locking, and foreign keys",
 
9480
  "InnoDB storage engine: transactional, row-level locking, foreign keys",
9283
9481
  PLUGIN_LICENSE_GPL,
9284
9482
  innobase_init, /* Plugin Init */
9285
9483
  NULL, /* depends */