~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Mark Atwood
  • Date: 2011-08-12 04:08:33 UTC
  • mfrom: (2385.2.17 refactor5)
  • Revision ID: me@mark.atwood.name-20110812040833-u6j85nc6ahuc0dtz
merge lp:~olafvdspek/drizzle/refactor5

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    in Windows?
39
39
*/
40
40
 
41
 
#include "config.h"
 
41
#include <config.h>
42
42
 
43
43
#include <limits.h>
44
44
#include <fcntl.h>
45
45
 
46
 
#include "drizzled/error.h"
47
 
#include "drizzled/errmsg_print.h"
48
 
#include "drizzled/charset_info.h"
49
 
#include "drizzled/internal/m_string.h"
50
 
#include "drizzled/internal/my_sys.h"
51
 
#include "drizzled/my_hash.h"
52
 
#include "drizzled/plugin.h"
53
 
#include "drizzled/show.h"
54
 
#include "drizzled/data_home.h"
55
 
#include "drizzled/error.h"
56
 
#include "drizzled/field.h"
57
 
#include "drizzled/charset.h"
58
 
#include "drizzled/session.h"
59
 
#include "drizzled/current_session.h"
60
 
#include "drizzled/table.h"
61
 
#include "drizzled/field/blob.h"
62
 
#include "drizzled/field/varstring.h"
63
 
#include "drizzled/plugin/xa_storage_engine.h"
64
 
#include "drizzled/plugin/daemon.h"
65
 
#include "drizzled/memory/multi_malloc.h"
66
 
#include "drizzled/pthread_globals.h"
67
 
#include "drizzled/named_savepoint.h"
68
 
 
 
46
#include <drizzled/error.h>
 
47
#include <drizzled/errmsg_print.h>
 
48
#include <drizzled/internal/m_string.h>
 
49
#include <drizzled/internal/my_sys.h>
 
50
#include <drizzled/plugin.h>
 
51
#include <drizzled/show.h>
 
52
#include <drizzled/data_home.h>
 
53
#include <drizzled/error.h>
 
54
#include <drizzled/field.h>
 
55
#include <drizzled/charset.h>
 
56
#include <drizzled/session.h>
 
57
#include <drizzled/current_session.h>
 
58
#include <drizzled/table.h>
 
59
#include <drizzled/field/blob.h>
 
60
#include <drizzled/field/varstring.h>
 
61
#include <drizzled/plugin/xa_storage_engine.h>
 
62
#include <drizzled/plugin/daemon.h>
 
63
#include <drizzled/memory/multi_malloc.h>
 
64
#include <drizzled/pthread_globals.h>
 
65
#include <drizzled/named_savepoint.h>
 
66
#include <drizzled/session/table_messages.h>
69
67
#include <drizzled/transaction_services.h>
70
 
#include "drizzled/message/statement_transform.h"
 
68
#include <drizzled/message/statement_transform.h>
 
69
#include <drizzled/cached_directory.h>
 
70
#include <drizzled/statistics_variables.h>
 
71
#include <drizzled/system_variables.h>
 
72
#include <drizzled/session/times.h>
 
73
#include <drizzled/session/transactions.h>
 
74
#include <drizzled/typelib.h>
71
75
 
72
76
#include <boost/algorithm/string.hpp>
73
77
#include <boost/program_options.hpp>
125
129
#include <sstream>
126
130
#include <string>
127
131
 
128
 
#include "plugin/innobase/handler/status_function.h"
129
 
#include "plugin/innobase/handler/replication_log.h"
 
132
#include <plugin/innobase/handler/status_function.h>
 
133
#include <plugin/innobase/handler/replication_log.h>
130
134
 
131
135
#include <google/protobuf/io/zero_copy_stream.h>
132
136
#include <google/protobuf/io/zero_copy_stream_impl.h>
175
179
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
176
180
typedef constrained_check<unsigned int, 1000, 1> autoextend_constraint;
177
181
static autoextend_constraint innodb_auto_extend_increment;
178
 
typedef constrained_check<size_t, SIZE_MAX, 5242880, 1048576> buffer_pool_constraint;
 
182
typedef constrained_check<size_t, SIZE_MAX, 33554432, 1048576> buffer_pool_constraint;
179
183
static buffer_pool_constraint innobase_buffer_pool_size;
180
184
typedef constrained_check<uint32_t, MAX_BUFFER_POOLS, 1> buffer_pool_instances_constraint;
181
185
static buffer_pool_instances_constraint innobase_buffer_pool_instances;
 
186
typedef constrained_check<uint32_t,
 
187
                          (1 << UNIV_PAGE_SIZE_SHIFT_MAX),
 
188
                                (1 << 12)> page_size_constraint;
 
189
static page_size_constraint innobase_page_size;
 
190
typedef constrained_check<uint32_t,
 
191
                          (1 << UNIV_PAGE_SIZE_SHIFT_MAX),
 
192
                                (1 << 9)> log_block_size_constraint;
 
193
static log_block_size_constraint innobase_log_block_size;
182
194
typedef constrained_check<uint32_t, UINT32_MAX, 100> io_capacity_constraint;
183
195
static io_capacity_constraint innodb_io_capacity;
184
196
typedef constrained_check<uint32_t, 5000, 1> purge_batch_constraint;
205
217
 
206
218
static uint64_constraint innodb_replication_delay;
207
219
 
 
220
static uint32_constraint buffer_pool_restore_at_startup;
 
221
 
208
222
/** Percentage of the buffer pool to reserve for 'old' blocks.
209
223
Connected to buf_LRU_old_ratio. */
210
224
typedef constrained_check<uint32_t, 95, 5> old_blocks_constraint;
217
231
typedef constrained_check<uint32_t, 64, 0> read_ahead_threshold_constraint;
218
232
static read_ahead_threshold_constraint innodb_read_ahead_threshold;
219
233
 
 
234
static uint64_constraint ibuf_max_size;
 
235
 
 
236
typedef constrained_check<uint32_t, 1, 0> binary_constraint;
 
237
static binary_constraint ibuf_active_contract;
 
238
 
 
239
typedef constrained_check<uint32_t, 999999999, 100> ibuf_accel_rate_constraint;
 
240
static ibuf_accel_rate_constraint ibuf_accel_rate;
 
241
static uint32_constraint checkpoint_age_target;
 
242
static binary_constraint flush_neighbor_pages;
 
243
 
220
244
/* The default values for the following char* start-up parameters
221
245
are determined in innobase_init below: */
222
246
 
226
250
static string innobase_file_format_name;
227
251
static string innobase_change_buffering;
228
252
 
 
253
static string read_ahead;
 
254
static string adaptive_flushing_method;
 
255
 
229
256
/* The highest file format being used in the database. The value can be
230
257
set by user, however, it will be adjusted to the newer file format if
231
258
a table of such format is created/opened. */
234
261
/* Below we have boolean-valued start-up parameters, and their default
235
262
values */
236
263
 
237
 
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
238
264
static trinary_constraint innobase_fast_shutdown;
239
265
 
240
266
/* "innobase_file_format_check" decides whether we would continue
286
312
  "all"         /* IBUF_USE_ALL */
287
313
};
288
314
 
 
315
/** Allowed values of read_ahead */
 
316
static const char* read_ahead_names[] = {
 
317
  "none",       /* 0 */
 
318
  "random",
 
319
  "linear",
 
320
  "both",       /* 3 */
 
321
  /* For compatibility with the older Percona patch */
 
322
  "0",          /* 4 ("none" + 4) */
 
323
  "1",
 
324
  "2",
 
325
  "3",          /* 7 ("both" + 4) */
 
326
  NULL
 
327
};
 
328
 
 
329
static TYPELIB read_ahead_typelib = {
 
330
  array_elements(read_ahead_names) - 1, "read_ahead_typelib",
 
331
  read_ahead_names, NULL
 
332
};
 
333
 
 
334
/** Allowed values of adaptive_flushing_method */
 
335
static const char* adaptive_flushing_method_names[] = {
 
336
    "native",           /* 0 */
 
337
    "estimate",         /* 1 */
 
338
    "keep_average",     /* 2 */
 
339
    /* For compatibility with the older Percona patch */
 
340
    "0",                /* 3 ("native" + 3) */
 
341
    "1",                /* 4 ("estimate" + 3) */
 
342
    "2",                /* 5 ("keep_average" + 3) */
 
343
    NULL
 
344
};
 
345
 
 
346
static TYPELIB adaptive_flushing_method_typelib = {
 
347
  array_elements(adaptive_flushing_method_names) - 1,
 
348
  "adaptive_flushing_method_typelib",
 
349
  adaptive_flushing_method_names, NULL
 
350
};
 
351
 
289
352
/* "GEN_CLUST_INDEX" is the name reserved for Innodb default
290
353
system primary index. */
291
354
static const char innobase_index_reserve_name[]= "GEN_CLUST_INDEX";
321
384
 
322
385
  virtual ~InnobaseEngine()
323
386
  {
324
 
    int err= 0;
325
387
    if (innodb_inited) {
326
388
      srv_fast_shutdown = (ulint) innobase_fast_shutdown;
327
389
      innodb_inited = 0;
328
390
      hash_table_free(innobase_open_tables);
329
391
      innobase_open_tables = NULL;
330
392
      if (innobase_shutdown_for_mysql() != DB_SUCCESS) {
331
 
        err = 1;
 
393
        // Throw here?
332
394
      }
333
395
      srv_free_paths_and_sizes();
334
 
      if (internal_innobase_data_file_path)
335
 
        free(internal_innobase_data_file_path);
 
396
      free(internal_innobase_data_file_path);
336
397
    }
337
398
    
338
399
    /* These get strdup'd from vm variables */
462
523
  UNIV_INTERN int doCreateTable(Session &session,
463
524
                                Table &form,
464
525
                                const identifier::Table &identifier,
465
 
                                message::Table&);
 
526
                                const message::Table&);
466
527
  UNIV_INTERN int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
467
528
  UNIV_INTERN int doDropTable(Session &session, const identifier::Table &identifier);
468
529
 
490
551
 
491
552
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
492
553
                             const drizzled::identifier::Schema &schema_identifier,
493
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
554
                             drizzled::identifier::table::vector &set_of_identifiers);
494
555
  bool validateCreateTableOption(const std::string &key, const std::string &state);
495
556
  void dropTemporarySchema();
496
557
 
519
580
 
520
581
void InnobaseEngine::doGetTableIdentifiers(drizzled::CachedDirectory &directory,
521
582
                                           const drizzled::identifier::Schema &schema_identifier,
522
 
                                           drizzled::identifier::Table::vector &set_of_identifiers)
 
583
                                           drizzled::identifier::table::vector &set_of_identifiers)
523
584
{
524
585
  CachedDirectory::Entries entries= directory.getEntries();
525
586
 
934
995
        ulint   value)  /*!< in: time waited for the lock */
935
996
{
936
997
  if (in_session)
937
 
    in_session->utime_after_lock+= value;
 
998
    in_session->times.utime_after_lock+= value;
938
999
}
939
1000
 
940
1001
/********************************************************************//**
964
1025
  uint64_t end_timestamp= message.transaction_context().end_timestamp();
965
1026
  bool is_end_segment= message.end_segment();
966
1027
  trx->log_commit_id= TRUE;
 
1028
 
 
1029
  string server_uuid= session.getServerUUID();
 
1030
  string originating_server_uuid= session.getOriginatingServerUUID();
 
1031
  uint64_t originating_commit_id= session.getOriginatingCommitID();
 
1032
  bool use_originating_server_uuid= session.isOriginatingServerUUIDSet();
 
1033
 
967
1034
  ulint error= insert_replication_message(data, message.ByteSize(), trx, trx_id,
968
 
               end_timestamp, is_end_segment, seg_id);
 
1035
               end_timestamp, is_end_segment, seg_id, server_uuid.c_str(),
 
1036
               use_originating_server_uuid, originating_server_uuid.c_str(),
 
1037
               originating_commit_id);
 
1038
 
969
1039
  (void)error;
970
1040
 
971
1041
  delete[] data;
1175
1245
  uint  )   /*!< in: max query length to print, or 0 to
1176
1246
           use the default max length */
1177
1247
{
1178
 
  drizzled::identifier::User::const_shared_ptr user_identifier(in_session->user());
 
1248
  drizzled::identifier::user::ptr user_identifier(in_session->user());
1179
1249
 
1180
1250
  fprintf(f,
1181
1251
          "Drizzle thread %"PRIu64", query id %"PRIu64", %s, %s, %s ",
1182
1252
          static_cast<uint64_t>(in_session->getSessionId()),
1183
1253
          static_cast<uint64_t>(in_session->getQueryId()),
1184
 
          glob_hostname,
 
1254
          getServerHostname().c_str(),
1185
1255
          user_identifier->address().c_str(),
1186
1256
          user_identifier->username().c_str()
1187
1257
  );
1199
1269
  ulint*  mbminlen, /*!< out: minimum length of a char (in bytes) */
1200
1270
  ulint*  mbmaxlen) /*!< out: maximum length of a char (in bytes) */
1201
1271
{
1202
 
  CHARSET_INFO* cs;
 
1272
  charset_info_st* cs;
1203
1273
  ut_ad(cset < 256);
1204
1274
  ut_ad(mbminlen);
1205
1275
  ut_ad(mbmaxlen);
1274
1344
  const void *cs,
1275
1345
  char char_to_test)
1276
1346
{
1277
 
  return my_isspace(static_cast<const CHARSET_INFO *>(cs), char_to_test);
 
1347
  return my_isspace(static_cast<const charset_info_st *>(cs), char_to_test);
1278
1348
}
1279
1349
 
1280
1350
#if defined (__WIN__) && defined (MYSQL_DYNAMIC_PLUGIN)
1866
1936
  srv_read_ahead_threshold= innodb_read_ahead_threshold.get();
1867
1937
}
1868
1938
 
 
1939
static void auto_lru_dump_update(Session *, sql_var_t)
 
1940
{
 
1941
  srv_auto_lru_dump= buffer_pool_restore_at_startup.get();
 
1942
}
 
1943
 
 
1944
static void ibuf_active_contract_update(Session *, sql_var_t)
 
1945
{
 
1946
  srv_ibuf_active_contract= ibuf_active_contract.get();
 
1947
}
 
1948
 
 
1949
static void ibuf_accel_rate_update(Session *, sql_var_t)
 
1950
{
 
1951
  srv_ibuf_accel_rate= ibuf_accel_rate.get();
 
1952
}
 
1953
 
 
1954
static void checkpoint_age_target_update(Session *, sql_var_t)
 
1955
{
 
1956
  srv_checkpoint_age_target= checkpoint_age_target.get();
 
1957
}
 
1958
 
 
1959
static void flush_neighbor_pages_update(Session *, sql_var_t)
 
1960
{
 
1961
  srv_flush_neighbor_pages= flush_neighbor_pages.get();
 
1962
}
1869
1963
 
1870
1964
static int innodb_commit_concurrency_validate(Session *session, set_var *var)
1871
1965
{
2003
2097
  return(1);
2004
2098
}
2005
2099
 
 
2100
/*********************************************************************//**
 
2101
Check if argument is a valid value for srv_read_ahead and set it.  This
 
2102
function is registered as a callback with MySQL.
 
2103
@return 0 for valid read_ahead value */
 
2104
static
 
2105
int
 
2106
read_ahead_validate(
 
2107
/*================*/
 
2108
  Session*,             /*!< in: thread handle */
 
2109
  set_var*    var)
 
2110
{
 
2111
  const char *read_ahead_input = var->value->str_value.ptr();
 
2112
  int res = read_ahead_typelib.find_type(read_ahead_input, TYPELIB::e_none); // e_none is wrong
 
2113
 
 
2114
  if (res > 0) {
 
2115
    srv_read_ahead = res - 1;
 
2116
    return 0;
 
2117
  }
 
2118
 
 
2119
  return 1;
 
2120
}
 
2121
 
 
2122
/*********************************************************************//**
 
2123
Check if argument is a valid value for srv_adaptive_flushing_method and
 
2124
set it.  This function is registered as a callback with MySQL.
 
2125
@return 0 for valid read_ahead value */
 
2126
static
 
2127
int
 
2128
adaptive_flushing_method_validate(
 
2129
/*==============================*/
 
2130
  Session*,             /*!< in: thread handle */
 
2131
  set_var*    var)
 
2132
{
 
2133
  const char *adaptive_flushing_method_input = var->value->str_value.ptr();
 
2134
  int res = adaptive_flushing_method_typelib.find_type(adaptive_flushing_method_input, TYPELIB::e_none); // e_none is wrong
 
2135
 
 
2136
  if (res > 0) {
 
2137
    srv_adaptive_flushing_method = res - 1;
 
2138
    return 0;
 
2139
  }
 
2140
  return 1;
 
2141
}
 
2142
 
2006
2143
 
2007
2144
/*********************************************************************//**
2008
2145
Opens an InnoDB database.
2034
2171
  srv_spin_wait_delay= innodb_spin_wait_delay.get();
2035
2172
  srv_thread_sleep_delay= innodb_thread_sleep_delay.get();
2036
2173
  srv_read_ahead_threshold= innodb_read_ahead_threshold.get();
 
2174
  srv_auto_lru_dump= buffer_pool_restore_at_startup.get();
 
2175
  srv_ibuf_max_size= ibuf_max_size.get();
 
2176
  srv_ibuf_active_contract= ibuf_active_contract.get();
 
2177
  srv_ibuf_accel_rate= ibuf_accel_rate.get();
 
2178
  srv_checkpoint_age_target= checkpoint_age_target.get();
 
2179
  srv_flush_neighbor_pages= flush_neighbor_pages.get();
 
2180
 
 
2181
  srv_read_ahead = read_ahead_typelib.find_type_or_exit(vm["read-ahead"].as<string>().c_str(),
 
2182
                                                        "read_ahead_typelib") + 1;
 
2183
 
 
2184
  srv_adaptive_flushing_method = adaptive_flushing_method_typelib.find_type_or_exit(vm["adaptive-flushing-method"].as<string>().c_str(),
 
2185
                                                                                    "adaptive_flushing_method_typelib") + 1;
2037
2186
 
2038
2187
  /* Inverted Booleans */
2039
2188
 
2040
 
  innobase_use_checksums= (vm.count("disable-checksums")) ? false : true;
2041
 
  innobase_use_doublewrite= (vm.count("disable-doublewrite")) ? false : true;
2042
 
  srv_adaptive_flushing= (vm.count("disable-adaptive-flushing")) ? false : true;
2043
 
  srv_use_sys_malloc= (vm.count("use-internal-malloc")) ? false : true;
2044
 
  srv_use_native_aio= (vm.count("disable-native-aio")) ? false : true;
2045
 
  support_xa= (vm.count("disable-xa")) ? false : true;
2046
 
  btr_search_enabled= (vm.count("disable-adaptive-hash-index")) ? false : true;
2047
 
 
 
2189
  innobase_use_checksums= not vm.count("disable-checksums");
 
2190
  innobase_use_doublewrite= not vm.count("disable-doublewrite");
 
2191
  srv_adaptive_flushing= not vm.count("disable-adaptive-flushing");
 
2192
  srv_use_sys_malloc= not vm.count("use-internal-malloc");
 
2193
  srv_use_native_aio= not vm.count("disable-native-aio");
 
2194
  support_xa= not vm.count("disable-xa");
 
2195
  btr_search_enabled= not vm.count("disable-adaptive-hash-index");
2048
2196
 
2049
2197
  /* Hafta do this here because we need to late-bind the default value */
2050
 
  if (vm.count("data-home-dir"))
2051
 
  {
2052
 
    innobase_data_home_dir= vm["data-home-dir"].as<string>();
2053
 
  }
2054
 
  else
2055
 
  {
2056
 
    innobase_data_home_dir= getDataHome().file_string();
2057
 
  }
2058
 
 
 
2198
  innobase_data_home_dir= vm.count("data-home-dir") ? vm["data-home-dir"].as<string>() : getDataHome().file_string();
2059
2199
 
2060
2200
  if (vm.count("data-file-path"))
2061
2201
  {
2086
2226
  }
2087
2227
#endif /* UNIV_DEBUG */
2088
2228
 
 
2229
  srv_page_size = 0;
 
2230
  srv_page_size_shift = 0;
 
2231
 
 
2232
  uint32_t page_size = innobase_page_size.get();
 
2233
  uint32_t log_block_size = innobase_log_block_size.get();
 
2234
 
 
2235
  if (innobase_page_size != (1 << 14)) {
 
2236
    uint n_shift;
 
2237
 
 
2238
    errmsg_printf(error::WARN,
 
2239
                  "InnoDB: Warning: innodb_page_size has been changed from default value 16384. (###EXPERIMENTAL### operation)\n");
 
2240
    for (n_shift = 12; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
 
2241
      if (innobase_page_size == (1UL << n_shift)) {
 
2242
        srv_page_size_shift = n_shift;
 
2243
        srv_page_size = (1 << srv_page_size_shift);
 
2244
        errmsg_printf(error::WARN,
 
2245
                      "InnoDB: The universal page size of the database is set to %lu.\n",
 
2246
                      srv_page_size);
 
2247
        break;
 
2248
      }
 
2249
    }
 
2250
  } else {
 
2251
    srv_page_size_shift = 14;
 
2252
    srv_page_size = (1 << srv_page_size_shift);
 
2253
  }
 
2254
 
 
2255
  if (!srv_page_size_shift) {
 
2256
    errmsg_printf(error::ERROR,
 
2257
                  "InnoDB: Error: %"PRIu32" is not a valid value for innodb_page_size.\n"
 
2258
                  "InnoDB: Error: Valid values are 4096, 8192, and 16384 (default=16384).\n",
 
2259
                  page_size);
 
2260
    goto error;
 
2261
  }
 
2262
 
 
2263
  srv_log_block_size = 0;
 
2264
  if (log_block_size != (1 << 9)) { /*!=512*/
 
2265
    uint        n_shift;
 
2266
 
 
2267
    errmsg_printf(error::WARN,
 
2268
                  "InnoDB: Warning: innodb_log_block_size has been changed from default value 512. (###EXPERIMENTAL### operation)\n");
 
2269
    for (n_shift = 9; n_shift <= UNIV_PAGE_SIZE_SHIFT_MAX; n_shift++) {
 
2270
      if (log_block_size == (1UL << n_shift)) {
 
2271
        srv_log_block_size = (1 << n_shift);
 
2272
        errmsg_printf(error::WARN, "InnoDB: The log block size is set to %"PRIu32".\n",
 
2273
                      srv_log_block_size);
 
2274
        break;
 
2275
      }
 
2276
    }
 
2277
  } else {
 
2278
    srv_log_block_size = 512;
 
2279
  }
 
2280
 
 
2281
  if (!srv_log_block_size) {
 
2282
    errmsg_printf(error::ERROR,
 
2283
                  "InnoDB: Error: %"PRIu32" is not a valid value for innodb_log_block_size.\n"
 
2284
                  "InnoDB: Error: A valid value for innodb_log_block_size is\n"
 
2285
                  "InnoDB: Error: a power of 2 from 512 to 16384.\n",
 
2286
                  log_block_size);
 
2287
    goto error;
 
2288
  }
 
2289
 
2089
2290
  os_innodb_umask = (ulint)internal::my_umask;
2090
2291
 
2091
2292
 
2119
2320
 
2120
2321
mem_free_and_error:
2121
2322
    srv_free_paths_and_sizes();
2122
 
    if (internal_innobase_data_file_path)
2123
 
      free(internal_innobase_data_file_path);
 
2323
    free(internal_innobase_data_file_path);
2124
2324
    goto error;
2125
2325
  }
2126
2326
 
2236
2436
  srv_n_read_io_threads = (ulint) innobase_read_io_threads;
2237
2437
  srv_n_write_io_threads = (ulint) innobase_write_io_threads;
2238
2438
 
 
2439
  srv_read_ahead &= 3;
 
2440
  srv_adaptive_flushing_method %= 3;
 
2441
 
2239
2442
  srv_force_recovery = (ulint) innobase_force_recovery;
2240
2443
 
2241
2444
  srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite;
2289
2492
  actuall_engine_ptr->dropTemporarySchema();
2290
2493
 
2291
2494
  context.add(new InnodbStatusTool);
2292
 
 
2293
2495
  context.add(innodb_engine_ptr);
2294
 
 
2295
 
  context.add(new(std::nothrow)CmpTool(false));
2296
 
 
2297
 
  context.add(new(std::nothrow)CmpTool(true));
2298
 
 
2299
 
  context.add(new(std::nothrow)CmpmemTool(false));
2300
 
 
2301
 
  context.add(new(std::nothrow)CmpmemTool(true));
2302
 
 
2303
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_TRX"));
2304
 
 
2305
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCKS"));
2306
 
 
2307
 
  context.add(new(std::nothrow)InnodbTrxTool("INNODB_LOCK_WAITS"));
2308
 
 
2309
 
  context.add(new(std::nothrow)InnodbSysTablesTool());
2310
 
 
2311
 
  context.add(new(std::nothrow)InnodbSysTableStatsTool());
2312
 
 
2313
 
  context.add(new(std::nothrow)InnodbSysIndexesTool());
2314
 
 
2315
 
  context.add(new(std::nothrow)InnodbSysColumnsTool());
2316
 
 
2317
 
  context.add(new(std::nothrow)InnodbSysFieldsTool());
2318
 
 
2319
 
  context.add(new(std::nothrow)InnodbSysForeignTool());
2320
 
 
2321
 
  context.add(new(std::nothrow)InnodbSysForeignColsTool());
2322
 
 
2323
 
  context.add(new(std::nothrow)InnodbInternalTables());
2324
 
  context.add(new(std::nothrow)InnodbReplicationTable());
 
2496
  context.add(new CmpTool(false));
 
2497
  context.add(new CmpTool(true));
 
2498
  context.add(new CmpmemTool(false));
 
2499
  context.add(new CmpmemTool(true));
 
2500
  context.add(new InnodbTrxTool("INNODB_TRX"));
 
2501
  context.add(new InnodbTrxTool("INNODB_LOCKS"));
 
2502
  context.add(new InnodbTrxTool("INNODB_LOCK_WAITS"));
 
2503
  context.add(new InnodbSysTablesTool());
 
2504
  context.add(new InnodbSysTableStatsTool());
 
2505
  context.add(new InnodbSysIndexesTool());
 
2506
  context.add(new InnodbSysColumnsTool());
 
2507
  context.add(new InnodbSysFieldsTool());
 
2508
  context.add(new InnodbSysForeignTool());
 
2509
  context.add(new InnodbSysForeignColsTool());
 
2510
  context.add(new InnodbInternalTables());
 
2511
  context.add(new InnodbReplicationTable());
2325
2512
 
2326
2513
  if (innobase_use_replication_log)
2327
2514
  {
2328
 
    ReplicationLog *replication_logger= new(std::nothrow)ReplicationLog();
 
2515
    ReplicationLog *replication_logger= new ReplicationLog();
2329
2516
    context.add(replication_logger);
2330
2517
    ReplicationLog::setup(replication_logger);
2331
2518
  }
2377
2564
                                                  innodb_file_format_max_validate));
2378
2565
  context.registerVariable(new sys_var_constrained_value_readonly<size_t>("buffer_pool_size", innobase_buffer_pool_size));
2379
2566
  context.registerVariable(new sys_var_constrained_value_readonly<int64_t>("log_file_size", innobase_log_file_size));
 
2567
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("page_size", innobase_page_size));
 
2568
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("log_block_size", innobase_log_block_size));
2380
2569
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit",
2381
2570
                                                  innodb_flush_log_at_trx_commit));
2382
2571
  context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("max_dirty_pages_pct",
2411
2600
  context.registerVariable(new sys_var_constrained_value<uint32_t>("read_ahead_threshold",
2412
2601
                                                                   innodb_read_ahead_threshold,
2413
2602
                                                                   innodb_read_ahead_threshold_update));
 
2603
  context.registerVariable(new sys_var_constrained_value<uint32_t>("auto_lru_dump",
 
2604
                                                                   buffer_pool_restore_at_startup,
 
2605
                                                                   auto_lru_dump_update));
 
2606
  context.registerVariable(new sys_var_constrained_value_readonly<uint64_t>("ibuf_max_size",
 
2607
                                                                            ibuf_max_size));
 
2608
  context.registerVariable(new sys_var_constrained_value<uint32_t>("ibuf_active_contract",
 
2609
                                                                   ibuf_active_contract,
 
2610
                                                                   ibuf_active_contract_update));
 
2611
  context.registerVariable(new sys_var_constrained_value<uint32_t>("ibuf_accel_rate",
 
2612
                                                                   ibuf_accel_rate,
 
2613
                                                                   ibuf_accel_rate_update));
 
2614
  context.registerVariable(new sys_var_constrained_value<uint32_t>("checkpoint_age_target",
 
2615
                                                                   checkpoint_age_target,
 
2616
                                                                   checkpoint_age_target_update));
 
2617
  context.registerVariable(new sys_var_constrained_value<uint32_t>("flush_neighbor_pages",
 
2618
                                                                   flush_neighbor_pages,
 
2619
                                                                   flush_neighbor_pages_update));
 
2620
  context.registerVariable(new sys_var_std_string("read_ahead",
 
2621
                                                  read_ahead,
 
2622
                                                  read_ahead_validate));
 
2623
  context.registerVariable(new sys_var_std_string("adaptive_flushing_method",
 
2624
                                                  adaptive_flushing_method,
 
2625
                                                  adaptive_flushing_method_validate));
2414
2626
  /* Get the current high water mark format. */
2415
2627
  innobase_file_format_max = trx_sys_file_format_max_get();
2416
2628
  btr_search_fully_disabled = (!btr_search_enabled);
3639
3851
  const unsigned char* b,   /* in: data field */
3640
3852
  unsigned int  b_length) /* in: data field length, not UNIV_SQL_NULL */
3641
3853
{
3642
 
  const CHARSET_INFO* charset;
 
3854
  const charset_info_st* charset;
3643
3855
  enum_field_types  mysql_tp;
3644
3856
  int     ret;
3645
3857
 
3872
4084
      const byte* data;
3873
4085
      ulint   key_len;
3874
4086
      ulint   true_len;
3875
 
      const CHARSET_INFO* cs;
 
4087
      const charset_info_st* cs;
3876
4088
      int   error=0;
3877
4089
 
3878
4090
      key_len = key_part->length;
3931
4143
 
3932
4144
    } else if (mysql_type == DRIZZLE_TYPE_BLOB) {
3933
4145
 
3934
 
      const CHARSET_INFO* cs;
 
4146
      const charset_info_st* cs;
3935
4147
      ulint   key_len;
3936
4148
      ulint   true_len;
3937
4149
      int   error=0;
4003
4215
      ulint     true_len;
4004
4216
      ulint     key_len;
4005
4217
      const unsigned char*    src_start;
4006
 
      enum_field_types  real_type;
4007
 
      const CHARSET_INFO* cs= field->charset();
 
4218
      const charset_info_st* cs= field->charset();
4008
4219
 
4009
4220
      key_len = key_part->length;
4010
4221
 
4015
4226
      }
4016
4227
 
4017
4228
      src_start = record + key_part->offset;
4018
 
      real_type = field->real_type();
4019
4229
      true_len = key_len;
4020
4230
 
4021
4231
      /* Character set for the field is defined only
6020
6230
UNIV_INTERN
6021
6231
int
6022
6232
InnobaseEngine::doCreateTable(
6023
 
/*================*/
6024
 
  Session         &session, /*!< in: Session */
6025
 
  Table&    form,   /*!< in: information on table columns and indexes */
6026
 
        const identifier::Table &identifier,
6027
 
        message::Table& create_proto)
 
6233
                              /*================*/
 
6234
                              Session         &session, /*!< in: Session */
 
6235
                              Table&    form,   /*!< in: information on table columns and indexes */
 
6236
                              const identifier::Table &identifier,
 
6237
                              const message::Table& create_proto)
6028
6238
{
6029
6239
  int   error;
6030
6240
  dict_table_t* innobase_table;
6130
6340
      | DICT_TF_COMPACT
6131
6341
      | DICT_TF_FORMAT_ZIP
6132
6342
      << DICT_TF_FORMAT_SHIFT;
6133
 
#if DICT_TF_ZSSIZE_MAX < 1
6134
 
# error "DICT_TF_ZSSIZE_MAX < 1"
6135
 
#endif
6136
6343
 
6137
6344
    if (strict_mode)
6138
6345
    {
6566
6773
  innobase_commit_low(trx);
6567
6774
  trx_free_for_mysql(trx);
6568
6775
 
 
6776
  if (error) {
 
6777
    // What do we do here?
 
6778
  }
 
6779
 
6569
6780
  return false; // We are just a listener since we lack control over DDL, so we give no positive acknowledgement. 
6570
6781
}
6571
6782
 
6746
6957
 
6747
6958
  ut_a(prebuilt->trx == session_to_trx(getTable()->in_use));
6748
6959
 
6749
 
  prebuilt->trx->op_info = (char*)"estimating records in index range";
 
6960
  prebuilt->trx->op_info = "estimating records in index range";
6750
6961
 
6751
6962
  /* In case MySQL calls this in the middle of a SELECT query, release
6752
6963
  possible adaptive hash latch to avoid deadlocks of threads */
6818
7029
func_exit:
6819
7030
  free(key_val_buff2);
6820
7031
 
6821
 
  prebuilt->trx->op_info = (char*)"";
 
7032
  prebuilt->trx->op_info = "";
6822
7033
 
6823
7034
  /* The MySQL optimizer seems to believe an estimate of 0 rows is
6824
7035
  always accurate and may return the result 'Empty set' based on that.
6879
7090
  estimate = 2 * local_data_file_length /
6880
7091
           dict_index_calc_min_rec_len(index);
6881
7092
 
6882
 
  prebuilt->trx->op_info = (char*)"";
 
7093
  prebuilt->trx->op_info = "";
6883
7094
 
6884
7095
  return((ha_rows) estimate);
6885
7096
}
7069
7280
  /* In case MySQL calls this in the middle of a SELECT query, release
7070
7281
  possible adaptive hash latch to avoid deadlocks of threads */
7071
7282
 
7072
 
  prebuilt->trx->op_info = (char*)"returning various info to MySQL";
 
7283
  prebuilt->trx->op_info = "returning various info to MySQL";
7073
7284
 
7074
7285
  trx_search_latch_release_if_reserved(prebuilt->trx);
7075
7286
 
7316
7527
  }
7317
7528
 
7318
7529
func_exit:
7319
 
  prebuilt->trx->op_info = (char*)"";
 
7530
  prebuilt->trx->op_info = "";
7320
7531
 
7321
7532
  return(0);
7322
7533
}
7527
7738
 
7528
7739
  update_session(getTable()->in_use);
7529
7740
 
7530
 
  prebuilt->trx->op_info = (char*)"returning table comment";
 
7741
  prebuilt->trx->op_info = "returning table comment";
7531
7742
 
7532
7743
  /* In case MySQL calls this in the middle of a SELECT query, release
7533
7744
  possible adaptive hash latch to avoid deadlocks of threads */
7572
7783
 
7573
7784
  mutex_exit(&srv_dict_tmpfile_mutex);
7574
7785
 
7575
 
  prebuilt->trx->op_info = (char*)"";
 
7786
  prebuilt->trx->op_info = "";
7576
7787
 
7577
7788
  return(str ? str : (char*) comment);
7578
7789
}
7598
7809
 
7599
7810
  update_session(getTable()->in_use);
7600
7811
 
7601
 
  prebuilt->trx->op_info = (char*)"getting info on foreign keys";
 
7812
  prebuilt->trx->op_info = "getting info on foreign keys";
7602
7813
 
7603
7814
  /* In case MySQL calls this in the middle of a SELECT query,
7604
7815
  release possible adaptive hash latch to avoid
7612
7823
  /* output the data to a temporary file */
7613
7824
  dict_print_info_on_foreign_keys(TRUE, srv_dict_tmpfile,
7614
7825
        prebuilt->trx, prebuilt->table);
7615
 
  prebuilt->trx->op_info = (char*)"";
 
7826
  prebuilt->trx->op_info = "";
7616
7827
 
7617
7828
  flen = ftell(srv_dict_tmpfile);
7618
7829
  if (flen < 0) {
7640
7851
int
7641
7852
ha_innobase::get_foreign_key_list(Session *session, List<ForeignKeyInfo> *f_key_list)
7642
7853
{
7643
 
  dict_foreign_t* foreign;
7644
 
 
7645
7854
  ut_a(prebuilt != NULL);
7646
7855
  update_session(getTable()->in_use);
7647
 
  prebuilt->trx->op_info = (char*)"getting list of foreign keys";
 
7856
  prebuilt->trx->op_info = "getting list of foreign keys";
7648
7857
  trx_search_latch_release_if_reserved(prebuilt->trx);
7649
7858
  mutex_enter(&(dict_sys->mutex));
7650
 
  foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
 
7859
  dict_foreign_t* foreign = UT_LIST_GET_FIRST(prebuilt->table->foreign_list);
7651
7860
 
7652
7861
  while (foreign != NULL) {
7653
7862
 
7654
 
    uint i;
7655
 
    LEX_STRING *name = 0;
7656
7863
    uint ulen;
7657
7864
    char uname[NAME_LEN + 1];           /* Unencoded name */
7658
7865
    char db_name[NAME_LEN + 1];
7660
7867
 
7661
7868
    /** Foreign id **/
7662
7869
    tmp_buff = foreign->id;
7663
 
    i = 0;
 
7870
    uint i = 0;
7664
7871
    while (tmp_buff[i] != '/')
7665
7872
      i++;
7666
7873
    tmp_buff += i + 1;
7667
 
    LEX_STRING *tmp_foreign_id = session->make_lex_string(NULL, tmp_buff, strlen(tmp_buff), true);
 
7874
    lex_string_t *tmp_foreign_id = session->make_lex_string(NULL, str_ref(tmp_buff));
7668
7875
 
7669
7876
    /* Database name */
7670
7877
    tmp_buff = foreign->referenced_table_name;
7677
7884
    }
7678
7885
    db_name[i] = 0;
7679
7886
    ulen= identifier::Table::filename_to_tablename(db_name, uname, sizeof(uname));
7680
 
    LEX_STRING *tmp_referenced_db = session->make_lex_string(NULL, uname, ulen, true);
 
7887
    lex_string_t *tmp_referenced_db = session->make_lex_string(NULL, str_ref(uname, ulen));
7681
7888
 
7682
7889
    /* Table name */
7683
7890
    tmp_buff += i + 1;
7684
7891
    ulen= identifier::Table::filename_to_tablename(tmp_buff, uname, sizeof(uname));
7685
 
    LEX_STRING *tmp_referenced_table = session->make_lex_string(NULL, uname, ulen, true);
 
7892
    lex_string_t *tmp_referenced_table = session->make_lex_string(NULL, str_ref(uname, ulen));
7686
7893
 
7687
7894
    /** Foreign Fields **/
7688
 
    List<LEX_STRING> tmp_foreign_fields;
7689
 
    List<LEX_STRING> tmp_referenced_fields;
7690
 
    for (i= 0;;) {
7691
 
      tmp_buff= foreign->foreign_col_names[i];
7692
 
      name = session->make_lex_string(name, tmp_buff, strlen(tmp_buff), true);
7693
 
      tmp_foreign_fields.push_back(name);
7694
 
      tmp_buff= foreign->referenced_col_names[i];
7695
 
      name = session->make_lex_string(name, tmp_buff, strlen(tmp_buff), true);
7696
 
      tmp_referenced_fields.push_back(name);
 
7895
    List<lex_string_t> tmp_foreign_fields;
 
7896
    List<lex_string_t> tmp_referenced_fields;
 
7897
    for (i= 0;;) 
 
7898
                {
 
7899
      tmp_foreign_fields.push_back(session->make_lex_string(NULL, str_ref(foreign->foreign_col_names[i])));
 
7900
      tmp_referenced_fields.push_back(session->make_lex_string(NULL, str_ref(foreign->referenced_col_names[i])));
7697
7901
      if (++i >= foreign->n_fields)
7698
7902
        break;
7699
7903
    }
7719
7923
      length=8;
7720
7924
      tmp_buff= "RESTRICT";
7721
7925
    }
7722
 
    LEX_STRING *tmp_delete_method = session->make_lex_string(NULL, tmp_buff, length, true);
 
7926
    lex_string_t *tmp_delete_method = session->make_lex_string(NULL, str_ref(tmp_buff, length));
7723
7927
 
7724
7928
 
7725
7929
    if (foreign->type & DICT_FOREIGN_ON_UPDATE_CASCADE)
7742
7946
      length=8;
7743
7947
      tmp_buff= "RESTRICT";
7744
7948
    }
7745
 
    LEX_STRING *tmp_update_method = session->make_lex_string(NULL, tmp_buff, length, true);
7746
 
 
7747
 
    LEX_STRING *tmp_referenced_key_name = NULL;
7748
 
 
7749
 
    if (foreign->referenced_index &&
7750
 
        foreign->referenced_index->name)
 
7949
    lex_string_t *tmp_update_method = session->make_lex_string(NULL, str_ref(tmp_buff, length));
 
7950
 
 
7951
    lex_string_t *tmp_referenced_key_name = NULL;
 
7952
 
 
7953
    if (foreign->referenced_index && foreign->referenced_index->name)
7751
7954
    {
7752
 
      tmp_referenced_key_name = session->make_lex_string(NULL,
7753
 
                                                         foreign->referenced_index->name, strlen(foreign->referenced_index->name), true);
 
7955
      tmp_referenced_key_name = session->make_lex_string(NULL, str_ref(foreign->referenced_index->name));
7754
7956
    }
7755
7957
 
7756
7958
    ForeignKeyInfo f_key_info(
7758
7960
                              tmp_update_method, tmp_delete_method, tmp_referenced_key_name,
7759
7961
                              tmp_foreign_fields, tmp_referenced_fields);
7760
7962
 
7761
 
    ForeignKeyInfo *pf_key_info = (ForeignKeyInfo *)
7762
 
      session->getMemRoot()->duplicate(&f_key_info, sizeof(ForeignKeyInfo));
7763
 
    f_key_list->push_back(pf_key_info);
 
7963
    f_key_list->push_back((ForeignKeyInfo*)session->mem.memdup(&f_key_info, sizeof(ForeignKeyInfo)));
7764
7964
    foreign = UT_LIST_GET_NEXT(foreign_list, foreign);
7765
7965
  }
7766
7966
  mutex_exit(&(dict_sys->mutex));
7767
 
  prebuilt->trx->op_info = (char*)"";
 
7967
  prebuilt->trx->op_info = "";
7768
7968
 
7769
7969
  return(0);
7770
7970
}
7824
8024
/*======================================*/
7825
8025
  char* str)  /*!< in, own: create info string to free */
7826
8026
{
7827
 
  if (str) {
7828
 
    free(str);
7829
 
  }
 
8027
  free(str);
7830
8028
}
7831
8029
 
7832
8030
/*******************************************************************//**
8341
8539
 
8342
8540
    HASH_DELETE(INNOBASE_SHARE, table_name_hash,
8343
8541
          innobase_open_tables, fold, share);
8344
 
    share->lock.deinit();
8345
8542
 
8346
8543
    /* Free any memory from index translation table */
8347
8544
    free(share->idx_trans_tbl.index_mapping);
8787
8984
finds charset information and returns length of prefix_len characters in the
8788
8985
index field in bytes.
8789
8986
@return number of bytes occupied by the first n characters */
8790
 
UNIV_INTERN
8791
 
ulint
8792
 
innobase_get_at_most_n_mbchars(
8793
 
/*===========================*/
8794
 
  ulint charset_id, /*!< in: character set id */
8795
 
  ulint prefix_len, /*!< in: prefix length in bytes of the index
8796
 
        (this has to be divided by mbmaxlen to get the
8797
 
        number of CHARACTERS n in the prefix) */
8798
 
  ulint data_len,   /*!< in: length of the string in bytes */
8799
 
  const char* str); /*!< in: character string */
8800
8987
 
8801
8988
ulint
8802
8989
innobase_get_at_most_n_mbchars(
8810
8997
{
8811
8998
  ulint char_length;    /*!< character length in bytes */
8812
8999
  ulint n_chars;      /*!< number of characters in prefix */
8813
 
  const CHARSET_INFO* charset;  /*!< charset used in the field */
 
9000
  const charset_info_st* charset;  /*!< charset used in the field */
8814
9001
 
8815
9002
  charset = get_charset((uint) charset_id);
8816
9003
 
8923
9110
    return(0);
8924
9111
  }
8925
9112
 
8926
 
  session->get_xid(reinterpret_cast<DRIZZLE_XID*>(&trx->xid));
 
9113
  session->get_xid(reinterpret_cast<DrizzleXid*>(&trx->xid));
8927
9114
 
8928
9115
  /* Release a possible FIFO ticket and search latch. Since we will
8929
9116
  reserve the kernel mutex, we have to release the search system latch
9144
9331
          "Number of UNDO logs to purge in one batch from the history list. "
9145
9332
          "Default is 20.");
9146
9333
  context("purge-threads",
9147
 
          po::value<purge_threads_constraint>(&innodb_n_purge_threads)->default_value(0),
9148
 
          "Purge threads can be either 0 or 1. Defalut is 0.");
 
9334
          po::value<purge_threads_constraint>(&innodb_n_purge_threads)->default_value(1),
 
9335
          "Purge threads can be either 0 or 1. Default is 1.");
9149
9336
  context("file-per-table",
9150
9337
          po::value<bool>(&srv_file_per_table)->default_value(false)->zero_tokens(),
9151
9338
           "Stores each InnoDB table to an .ibd file in the database dir.");
9222
9409
  context("log-file-size",
9223
9410
          po::value<log_file_constraint>(&innobase_log_file_size)->default_value(20*1024*1024L),
9224
9411
          "The size of the buffer which InnoDB uses to write log to the log files on disk.");
 
9412
  context("page-size",
 
9413
          po::value<page_size_constraint>(&innobase_page_size)->default_value(1 << 14),
 
9414
          "###EXPERIMENTAL###: The universal page size of the database. Changing for created database is not supported. Use on your own risk!");
 
9415
  context("log-block-size",
 
9416
          po::value<log_block_size_constraint>(&innobase_log_block_size)->default_value(1 << 9),
 
9417
          "###EXPERIMENTAL###: The log block size of the transaction log file. Changing for created log file is not supported. Use on your own risk!");
9225
9418
  context("log-files-in-group",
9226
9419
          po::value<log_files_in_group_constraint>(&innobase_log_files_in_group)->default_value(2),
9227
9420
          "Number of log files in the log group. InnoDB writes to the files in a circular fashion.");
9259
9452
  context("read-ahead-threshold",
9260
9453
          po::value<read_ahead_threshold_constraint>(&innodb_read_ahead_threshold)->default_value(56),
9261
9454
          "Number of pages that must be accessed sequentially for InnoDB to trigger a readahead.");
 
9455
  context("auto-lru-dump",
 
9456
          po::value<uint32_constraint>(&buffer_pool_restore_at_startup)->default_value(0),
 
9457
          "Time in seconds between automatic buffer pool dumps. "
 
9458
          "0 (the default) disables automatic dumps.");
 
9459
  context("ibuf-max-size",
 
9460
          po::value<uint64_constraint>(&ibuf_max_size)->default_value(UINT64_MAX),
 
9461
          "The maximum size of the insert buffer (in bytes).");
 
9462
  context("ibuf-active-contract",
 
9463
          po::value<binary_constraint>(&ibuf_active_contract)->default_value(1),
 
9464
          "Enable/Disable active_contract of insert buffer. 0:disable 1:enable");
 
9465
  context("ibuf-accel-rate",
 
9466
          po::value<ibuf_accel_rate_constraint>(&ibuf_accel_rate)->default_value(100),
 
9467
          "Tunes amount of insert buffer processing of background, in addition to innodb_io_capacity. (in percentage)");
 
9468
  context("checkpoint-age-target",
 
9469
          po::value<uint32_constraint>(&checkpoint_age_target)->default_value(0),
 
9470
          "Control soft limit of checkpoint age. (0 : not control)");
 
9471
  context("flush-neighbor-pages",
 
9472
          po::value<binary_constraint>(&flush_neighbor_pages)->default_value(1),
 
9473
          "Enable/Disable flushing also neighbor pages. 0:disable 1:enable");
 
9474
  context("read-ahead",
 
9475
          po::value<string>(&read_ahead)->default_value("linear"),
 
9476
          "Control read ahead activity (none, random, [linear], both). [from 1.0.5: random read ahead is ignored]");
 
9477
  context("adaptive-flushing-method",
 
9478
          po::value<string>(&adaptive_flushing_method)->default_value("estimate"),
 
9479
          "Choose method of innodb_adaptive_flushing. (native, [estimate], keep_average)");
9262
9480
  context("disable-xa",
9263
9481
          "Disable InnoDB support for the XA two-phase commit");
9264
9482
  context("disable-table-locks",
9267
9485
          po::value<bool>(&strict_mode)->default_value(false)->zero_tokens(),
9268
9486
          "Use strict mode when evaluating create options.");
9269
9487
  context("replication-log",
9270
 
          po::value<bool>(&innobase_use_replication_log)->default_value(false),
 
9488
          po::value<bool>(&innobase_use_replication_log)->default_value(false)->zero_tokens(),
9271
9489
          _("Enable internal replication log."));
9272
9490
  context("lock-wait-timeout",
9273
9491
          po::value<lock_wait_constraint>(&lock_wait_timeout)->default_value(50),