~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/haildb/haildb_engine.cc

  • Committer: Monty Taylor
  • Date: 2010-12-02 22:51:54 UTC
  • mto: (1975.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1976.
  • Revision ID: mordred@inaugust.com-20101202225154-h54ifmga9x6cckgs
Refactored syslog module and changed it to use sys_var directly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
#include <drizzled/error.h>
77
77
#include "drizzled/internal/my_pthread.h"
78
78
#include <drizzled/plugin/transactional_storage_engine.h>
79
 
#include <drizzled/plugin/error_message.h>
80
79
 
81
80
#include <fcntl.h>
82
 
#include <stdarg.h>
83
81
 
84
82
#include <string>
85
83
#include <boost/algorithm/string.hpp>
354
352
  isolation_level= tx_isolation_to_ib_trx_level((enum_tx_isolation)session_tx_isolation(session));
355
353
  *transaction= ib_trx_begin(isolation_level);
356
354
 
357
 
  return *transaction == NULL;
 
355
  return 0;
358
356
}
359
357
 
360
358
void HailDBEngine::doStartStatement(Session *session)
490
488
    nr++;
491
489
  }
492
490
  ib_tuple_delete(tuple);
493
 
  tuple= NULL;
494
491
  err= ib_cursor_reset(cursor);
495
492
  assert(err == DB_SUCCESS);
496
493
  return nr;
821
818
int HailDBCursor::open(const char *name, int, uint32_t)
822
819
{
823
820
  const char* haildb_table_name= table_path_to_haildb_name(name);
824
 
  ib_err_t err= ib_table_get_id(haildb_table_name, &table_id);
 
821
  ib_err_t err= ib_cursor_open_table(haildb_table_name, NULL, &cursor);
825
822
  bool has_hidden_primary_key= false;
826
823
  ib_id_t idx_id;
827
824
 
828
825
  if (err != DB_SUCCESS)
829
826
    return ib_err_t_to_drizzle_error(err);
830
827
 
831
 
  err= ib_cursor_open_table_using_id(table_id, NULL, &cursor);
832
 
  cursor_is_sec_index= false;
833
 
 
834
 
  if (err != DB_SUCCESS)
835
 
    return ib_err_t_to_drizzle_error(err);
836
 
 
837
828
  err= ib_index_get_id(haildb_table_name, "HIDDEN_PRIMARY", &idx_id);
838
829
 
839
830
  if (err == DB_SUCCESS)
1785
1776
  return("BTREE");
1786
1777
}
1787
1778
 
1788
 
static ib_err_t write_row_to_haildb_tuple(const unsigned char* buf,
1789
 
                                          Field **fields, ib_tpl_t tuple)
 
1779
static ib_err_t write_row_to_haildb_tuple(Field **fields, ib_tpl_t tuple)
1790
1780
{
1791
1781
  int colnr= 0;
1792
1782
  ib_err_t err= DB_ERROR;
1793
 
  ptrdiff_t row_offset= buf - (*fields)->getTable()->getInsertRecord();
1794
1783
 
1795
1784
  for (Field **field= fields; *field; field++, colnr++)
1796
1785
  {
1797
 
    (**field).move_field_offset(row_offset);
1798
 
 
1799
1786
    if (! (**field).isWriteSet() && (**field).is_null())
1800
 
    {
1801
 
      (**field).move_field_offset(-row_offset);
1802
1787
      continue;
1803
 
    }
1804
1788
 
1805
1789
    if ((**field).is_null())
1806
1790
    {
1807
1791
      err= ib_col_set_value(tuple, colnr, NULL, IB_SQL_NULL);
1808
1792
      assert(err == DB_SUCCESS);
1809
 
      (**field).move_field_offset(-row_offset);
1810
1793
      continue;
1811
1794
    }
1812
1795
 
1818
1801
      */
1819
1802
      String str;
1820
1803
      (**field).setReadSet();
1821
 
      (**field).val_str_internal(&str);
 
1804
      (**field).val_str(&str);
1822
1805
      err= ib_col_set_value(tuple, colnr, str.ptr(), str.length());
1823
1806
    }
1824
1807
    else if ((**field).type() == DRIZZLE_TYPE_ENUM)
1844
1827
    }
1845
1828
 
1846
1829
    assert (err == DB_SUCCESS);
1847
 
 
1848
 
    (**field).move_field_offset(-row_offset);
1849
1830
  }
1850
1831
 
1851
1832
  return err;
1894
1875
 
1895
1876
  tuple= ib_clust_read_tuple_create(cursor);
1896
1877
 
1897
 
  if (cursor_is_sec_index)
1898
 
  {
1899
 
    err= ib_cursor_close(cursor);
1900
 
    assert(err == DB_SUCCESS);
1901
 
 
1902
 
    err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
1903
 
 
1904
 
    if (err != DB_SUCCESS)
1905
 
      return ib_err_t_to_drizzle_error(err);
1906
 
 
1907
 
    cursor_is_sec_index= false;
1908
 
  }
1909
 
  else
1910
 
  {
1911
 
    ib_cursor_attach_trx(cursor, transaction);
1912
 
  }
 
1878
  ib_cursor_attach_trx(cursor, transaction);
1913
1879
 
1914
1880
  err= ib_cursor_first(cursor);
1915
1881
  if (current_session->lex->sql_command == SQLCOM_CREATE_TABLE
1968
1934
 
1969
1935
  }
1970
1936
 
1971
 
  write_row_to_haildb_tuple(record, getTable()->getFields(), tuple);
 
1937
  write_row_to_haildb_tuple(getTable()->getFields(), tuple);
1972
1938
 
1973
1939
  if (share->has_hidden_primary_key)
1974
1940
  {
2001
1967
      err= ib_cursor_first(cursor);
2002
1968
      assert(err == DB_SUCCESS || err == DB_END_OF_INDEX);
2003
1969
 
2004
 
      write_row_to_haildb_tuple(record, getTable()->getFields(), tuple);
 
1970
      write_row_to_haildb_tuple(getTable()->getFields(), tuple);
2005
1971
 
2006
1972
      err= ib_cursor_insert_row(cursor, tuple);
2007
1973
      assert(err==DB_SUCCESS); // probably be nice and process errors
2014
1980
 
2015
1981
  tuple= ib_tuple_clear(tuple);
2016
1982
  ib_tuple_delete(tuple);
2017
 
  tuple= NULL;
2018
1983
  err= ib_cursor_reset(cursor);
2019
1984
 
2020
1985
  return ret;
2021
1986
}
2022
1987
 
2023
 
int HailDBCursor::doUpdateRecord(const unsigned char *old_data,
2024
 
                                 unsigned char *new_data)
 
1988
int HailDBCursor::doUpdateRecord(const unsigned char *,
 
1989
                                         unsigned char *)
2025
1990
{
2026
1991
  ib_tpl_t update_tuple;
2027
1992
  ib_err_t err;
2028
 
  bool created_tuple= false;
2029
1993
 
2030
1994
  update_tuple= ib_clust_read_tuple_create(cursor);
2031
1995
 
2032
 
  if (tuple == NULL)
2033
 
  {
2034
 
    ib_trx_t transaction= *get_trx(getTable()->in_use);
2035
 
 
2036
 
    if (cursor_is_sec_index)
2037
 
    {
2038
 
      err= ib_cursor_close(cursor);
2039
 
      assert(err == DB_SUCCESS);
2040
 
 
2041
 
      err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2042
 
 
2043
 
      if (err != DB_SUCCESS)
2044
 
        return ib_err_t_to_drizzle_error(err);
2045
 
      cursor_is_sec_index= false;
2046
 
    }
2047
 
    else
2048
 
    {
2049
 
      ib_cursor_attach_trx(cursor, transaction);
2050
 
    }
2051
 
 
2052
 
    store_key_value_from_haildb(getTable()->key_info + getTable()->getShare()->getPrimaryKey(),
2053
 
                                  ref, ref_length, old_data);
2054
 
 
2055
 
    ib_tpl_t search_tuple= ib_clust_search_tuple_create(cursor);
2056
 
 
2057
 
    fill_ib_search_tpl_from_drizzle_key(search_tuple,
2058
 
                                        getTable()->key_info + 0,
2059
 
                                        ref, ref_length);
2060
 
 
2061
 
    err= ib_cursor_set_lock_mode(cursor, IB_LOCK_X);
2062
 
    assert(err == DB_SUCCESS);
2063
 
 
2064
 
    int res;
2065
 
    err= ib_cursor_moveto(cursor, search_tuple, IB_CUR_GE, &res);
2066
 
    assert(err == DB_SUCCESS);
2067
 
 
2068
 
    tuple= ib_clust_read_tuple_create(cursor);
2069
 
 
2070
 
    err= ib_cursor_read_row(cursor, tuple);
2071
 
    assert(err == DB_SUCCESS);// FIXME
2072
 
 
2073
 
    created_tuple= true;
2074
 
  }
2075
 
 
2076
1996
  err= ib_tuple_copy(update_tuple, tuple);
2077
1997
  assert(err == DB_SUCCESS);
2078
1998
 
2079
 
  write_row_to_haildb_tuple(new_data, getTable()->getFields(), update_tuple);
 
1999
  write_row_to_haildb_tuple(getTable()->getFields(), update_tuple);
2080
2000
 
2081
2001
  err= ib_cursor_update_row(cursor, tuple, update_tuple);
2082
2002
 
2083
2003
  ib_tuple_delete(update_tuple);
2084
2004
 
2085
 
  if (created_tuple)
2086
 
  {
2087
 
    ib_err_t ib_err= ib_cursor_reset(cursor); //fixme check error
2088
 
    assert(ib_err == DB_SUCCESS);
2089
 
    tuple= ib_tuple_clear(tuple);
2090
 
    ib_tuple_delete(tuple);
2091
 
    tuple= NULL;
2092
 
  }
2093
 
 
2094
2005
  advance_cursor= true;
2095
2006
 
2096
 
  return ib_err_t_to_drizzle_error(err);
 
2007
  if (err == DB_SUCCESS)
 
2008
    return 0;
 
2009
  else if (err == DB_DUPLICATE_KEY)
 
2010
    return HA_ERR_FOUND_DUPP_KEY;
 
2011
  else
 
2012
    return -1;
2097
2013
}
2098
2014
 
2099
2015
int HailDBCursor::doDeleteRecord(const unsigned char *)
2100
2016
{
2101
2017
  ib_err_t err;
2102
2018
 
2103
 
  assert(ib_cursor_is_positioned(cursor) == IB_TRUE);
2104
2019
  err= ib_cursor_delete_row(cursor);
 
2020
  if (err != DB_SUCCESS)
 
2021
    return -1; // FIXME
2105
2022
 
2106
2023
  advance_cursor= true;
2107
 
 
2108
 
  return ib_err_t_to_drizzle_error(err);
 
2024
  return 0;
2109
2025
}
2110
2026
 
2111
2027
int HailDBCursor::delete_all_rows(void)
2112
2028
{
2113
2029
  /* I *think* ib_truncate is non-transactional....
2114
2030
     so only support TRUNCATE and not DELETE FROM t;
2115
 
     (this is what ha_innodb does)
 
2031
     (this is what ha_haildb does)
2116
2032
  */
2117
2033
  if (session_sql_command(getTable()->in_use) != SQLCOM_TRUNCATE)
2118
2034
    return HA_ERR_WRONG_COMMAND;
2122
2038
 
2123
2039
  ib_trx_t transaction= ib_trx_begin(IB_TRX_REPEATABLE_READ);
2124
2040
 
2125
 
  if (cursor_is_sec_index)
2126
 
  {
2127
 
    err= ib_cursor_close(cursor);
2128
 
    assert(err == DB_SUCCESS);
2129
 
 
2130
 
    err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2131
 
 
2132
 
    if (err != DB_SUCCESS)
2133
 
      return ib_err_t_to_drizzle_error(err);
2134
 
    cursor_is_sec_index= false;
2135
 
  }
2136
 
  else
2137
 
  {
2138
 
    ib_cursor_attach_trx(cursor, transaction);
2139
 
  }
 
2041
  ib_cursor_attach_trx(cursor, transaction);
2140
2042
 
2141
2043
  err= ib_schema_lock_exclusive(transaction);
2142
2044
  if (err != DB_SUCCESS)
2172
2074
  ib_schema_unlock(transaction);
2173
2075
  ib_err_t rollback_err= ib_trx_rollback(transaction);
2174
2076
  assert(rollback_err == DB_SUCCESS);
2175
 
  return ib_err_t_to_drizzle_error(err);
 
2077
  return err;
2176
2078
}
2177
2079
 
2178
2080
int HailDBCursor::doStartTableScan(bool)
2179
2081
{
2180
 
  ib_err_t err= DB_SUCCESS;
 
2082
  ib_err_t err;
2181
2083
  ib_trx_t transaction;
2182
2084
 
2183
2085
  if (in_table_scan)
2188
2090
 
2189
2091
  assert(transaction != NULL);
2190
2092
 
2191
 
  if (cursor_is_sec_index)
2192
 
  {
2193
 
    err= ib_cursor_close(cursor);
2194
 
    assert(err == DB_SUCCESS);
2195
 
 
2196
 
    err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2197
 
    cursor_is_sec_index= false;
2198
 
  }
2199
 
  else
2200
 
  {
2201
 
    ib_cursor_attach_trx(cursor, transaction);
2202
 
  }
2203
 
 
2204
 
  if (err != DB_SUCCESS)
2205
 
    return ib_err_t_to_drizzle_error(err);
 
2093
  ib_cursor_attach_trx(cursor, transaction);
2206
2094
 
2207
2095
  err= ib_cursor_set_lock_mode(cursor, ib_lock_mode);
2208
2096
  assert(err == DB_SUCCESS); // FIXME
2230
2118
 
2231
2119
  err= ib_cursor_read_row(cursor, tuple);
2232
2120
 
2233
 
  if (err == DB_RECORD_NOT_FOUND)
 
2121
  if (err != DB_SUCCESS) // FIXME
2234
2122
    return HA_ERR_END_OF_FILE;
2235
 
  if (err != DB_SUCCESS)
2236
 
    return ib_err_t_to_drizzle_error(err);
2237
2123
 
2238
2124
  int colnr= 0;
2239
2125
 
2244
2130
  for (Field **field= table->getFields() ; *field ; field++, colnr++)
2245
2131
  {
2246
2132
    if (! (**field).isReadSet())
2247
 
      (**field).setReadSet(); /* Fucking broken API screws us royally. */
 
2133
      continue;
2248
2134
 
2249
2135
    (**field).move_field_offset(row_offset);
2250
2136
 
2254
2140
    if (length == IB_SQL_NULL)
2255
2141
    {
2256
2142
      (**field).set_null();
2257
 
      (**field).move_field_offset(-row_offset);
2258
2143
      continue;
2259
2144
    }
2260
2145
    else
2298
2183
 
2299
2184
    (**field).move_field_offset(-row_offset);
2300
2185
 
2301
 
    if (err != DB_SUCCESS)
2302
 
      return ib_err_t_to_drizzle_error(err);
2303
2186
  }
2304
2187
 
2305
2188
  if (has_hidden_primary_key)
2307
2190
    err= ib_tuple_read_u64(tuple, colnr, hidden_pkey);
2308
2191
  }
2309
2192
 
2310
 
  return ib_err_t_to_drizzle_error(err);
 
2193
  return 0;
2311
2194
}
2312
2195
 
2313
2196
int HailDBCursor::rnd_next(unsigned char *buf)
2319
2202
    return previous_error;
2320
2203
 
2321
2204
  if (advance_cursor)
2322
 
  {
2323
2205
    err= ib_cursor_next(cursor);
2324
 
    if (err != DB_SUCCESS)
2325
 
      return ib_err_t_to_drizzle_error(err);
2326
 
  }
2327
2206
 
2328
2207
  tuple= ib_tuple_clear(tuple);
2329
2208
  ret= read_row_from_haildb(buf, cursor, tuple, getTable(),
2339
2218
  ib_err_t err;
2340
2219
 
2341
2220
  ib_tuple_delete(tuple);
2342
 
  tuple= NULL;
2343
2221
  err= ib_cursor_reset(cursor);
2344
2222
  assert(err == DB_SUCCESS);
2345
2223
  in_table_scan= false;
2346
2224
  previous_error= 0;
2347
 
  return ib_err_t_to_drizzle_error(err);
 
2225
  return 0;
2348
2226
}
2349
2227
 
2350
2228
int HailDBCursor::rnd_pos(unsigned char *buf, unsigned char *pos)
2358
2236
  {
2359
2237
    err= ib_col_set_value(search_tuple, 0,
2360
2238
                          ((uint64_t*)(pos)), sizeof(uint64_t));
2361
 
    if (err != DB_SUCCESS)
2362
 
      return ib_err_t_to_drizzle_error(err);
2363
2239
  }
2364
2240
  else
2365
2241
  {
2375
2251
  }
2376
2252
 
2377
2253
  err= ib_cursor_moveto(cursor, search_tuple, IB_CUR_GE, &res);
2378
 
  if (err != DB_SUCCESS)
2379
 
    return ib_err_t_to_drizzle_error(err);
 
2254
  assert(err == DB_SUCCESS);
2380
2255
 
2381
2256
  assert(res==0);
2382
2257
  if (res != 0)
2425
2300
      }
2426
2301
 
2427
2302
      String str;
2428
 
      field->val_str_internal(&str);
 
2303
      field->val_str(&str);
2429
2304
 
2430
2305
      *ref++= (char)(str.length() & 0x000000ff);
2431
2306
      *ref++= (char)((str.length()>>8) & 0x000000ff);
2504
2379
 
2505
2380
  if (flag & HA_STATUS_AUTO)
2506
2381
    stats.auto_increment_value= 1;
2507
 
 
2508
 
  if (flag & HA_STATUS_ERRKEY) {
2509
 
    const char *err_table_name;
2510
 
    const char *err_index_name;
2511
 
 
2512
 
    ib_trx_t transaction= *get_trx(getTable()->in_use);
2513
 
 
2514
 
    err= ib_get_duplicate_key(transaction, &err_table_name, &err_index_name);
2515
 
 
2516
 
    errkey= -1;
2517
 
 
2518
 
    for (unsigned int i = 0; i < getTable()->getShare()->keys; i++)
2519
 
    {
2520
 
      if (strcmp(err_index_name, getTable()->key_info[i].name) == 0)
2521
 
      {
2522
 
        errkey= i;
2523
 
        break;
2524
 
      }
2525
 
    }
2526
 
 
2527
 
  }
2528
 
 
2529
2382
  return(0);
2530
2383
}
2531
2384
 
2532
2385
int HailDBCursor::doStartIndexScan(uint32_t keynr, bool)
2533
2386
{
2534
 
  ib_err_t err;
2535
2387
  ib_trx_t transaction= *get_trx(getTable()->in_use);
2536
2388
 
2537
2389
  active_index= keynr;
2538
2390
 
 
2391
  ib_cursor_attach_trx(cursor, transaction);
 
2392
 
2539
2393
  if (active_index == 0 && ! share->has_hidden_primary_key)
2540
2394
  {
2541
 
    if (cursor_is_sec_index)
2542
 
    {
2543
 
      err= ib_cursor_close(cursor);
2544
 
      assert(err == DB_SUCCESS);
2545
 
 
2546
 
      err= ib_cursor_open_table_using_id(table_id, transaction, &cursor);
2547
 
 
2548
 
      if (err != DB_SUCCESS)
2549
 
        return ib_err_t_to_drizzle_error(err);
2550
 
 
2551
 
    }
2552
 
    else
2553
 
    {
2554
 
      ib_cursor_attach_trx(cursor, transaction);
2555
 
    }
2556
 
 
2557
 
    cursor_is_sec_index= false;
2558
2395
    tuple= ib_clust_read_tuple_create(cursor);
2559
2396
  }
2560
2397
  else
2561
2398
  {
 
2399
    ib_err_t err;
2562
2400
    ib_id_t index_id;
2563
2401
    err= ib_index_get_id(table_path_to_haildb_name(getShare()->getPath()),
2564
2402
                         getShare()->getKeyInfo(keynr).name,
2565
2403
                         &index_id);
2566
2404
    if (err != DB_SUCCESS)
2567
 
      return ib_err_t_to_drizzle_error(err);
 
2405
      return -1;
2568
2406
 
2569
2407
    err= ib_cursor_close(cursor);
2570
2408
    assert(err == DB_SUCCESS);
2571
 
 
2572
2409
    err= ib_cursor_open_index_using_id(index_id, transaction, &cursor);
2573
2410
 
2574
2411
    if (err != DB_SUCCESS)
2575
 
      return ib_err_t_to_drizzle_error(err);
2576
 
 
2577
 
    cursor_is_sec_index= true;
 
2412
      return -1;
2578
2413
 
2579
2414
    tuple= ib_clust_read_tuple_create(cursor);
2580
2415
    ib_cursor_set_cluster_access(cursor);
2581
2416
  }
2582
2417
 
2583
 
  err= ib_cursor_set_lock_mode(cursor, ib_lock_mode);
 
2418
  ib_err_t err= ib_cursor_set_lock_mode(cursor, ib_lock_mode);
2584
2419
  assert(err == DB_SUCCESS);
2585
2420
 
2586
2421
  advance_cursor= false;
2846
2681
      if (err == DB_END_OF_INDEX)
2847
2682
        return HA_ERR_END_OF_FILE;
2848
2683
      else
2849
 
        return ib_err_t_to_drizzle_error(err);
 
2684
        return -1; // FIXME
2850
2685
    }
2851
2686
  }
2852
2687
 
3000
2835
static additional_mem_pool_constraint innobase_additional_mem_pool_size;
3001
2836
static bool  innobase_use_checksums= true;
3002
2837
typedef constrained_check<unsigned int, UINT_MAX, 100> io_capacity_constraint;
3003
 
typedef constrained_check<uint32_t, 2, 0> trinary_constraint;
 
2838
typedef constrained_check<uint16_t, 2, 0> trinary_constraint;
3004
2839
static trinary_constraint innobase_fast_shutdown;
3005
2840
static trinary_constraint srv_flush_log_at_trx_commit;
3006
 
typedef constrained_check<uint32_t, 6, 0> force_recovery_constraint;
 
2841
typedef constrained_check<uint16_t, 6, 0> force_recovery_constraint;
3007
2842
static force_recovery_constraint innobase_force_recovery;
3008
2843
typedef constrained_check<int64_t, INT64_MAX, 1024*1024, 1024*1024> log_file_constraint;
3009
2844
static log_file_constraint haildb_log_file_size;
3073
2908
  (void)err;
3074
2909
}
3075
2910
 
3076
 
extern "C" int haildb_errmsg_callback(ib_msg_stream_t, const char *fmt, ...);
3077
 
namespace drizzled
3078
 
{
3079
 
extern bool volatile shutdown_in_progress;
3080
 
}
3081
 
 
3082
 
extern "C" int haildb_errmsg_callback(ib_msg_stream_t, const char *fmt, ...)
3083
 
{
3084
 
  bool r= false;
3085
 
  va_list args;
3086
 
  va_start(args, fmt);
3087
 
  if (! shutdown_in_progress)
3088
 
    r= plugin::ErrorMessage::vprintf(NULL, ERRMSG_LVL_WARN, fmt, args);
3089
 
  else
3090
 
    vfprintf(stderr, fmt, args);
3091
 
  va_end(args);
3092
 
 
3093
 
  return (! r==true);
3094
 
}
3095
2911
 
3096
2912
static int haildb_init(drizzled::module::Context &context)
3097
2913
{
3120
2936
  if (err != DB_SUCCESS)
3121
2937
    goto haildb_error;
3122
2938
 
3123
 
  ib_logger_set(haildb_errmsg_callback, NULL);
3124
2939
 
3125
2940
  if (not vm["data-home-dir"].as<string>().empty())
3126
2941
  {
3298
3113
  context.registerVariable(new sys_var_const_string_val("data_home_dir",
3299
3114
                                                vm["data-home-dir"].as<string>()));
3300
3115
  context.registerVariable(new sys_var_constrained_value_readonly<unsigned int>("io_capacity", srv_io_capacity));
3301
 
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("fast_shutdown", innobase_fast_shutdown));
 
3116
  context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("fast_shutdown", innobase_fast_shutdown));
3302
3117
  context.registerVariable(new sys_var_bool_ptr_readonly("file_per_table",
3303
3118
                                                         &srv_file_per_table));
3304
3119
  context.registerVariable(new sys_var_bool_ptr_readonly("rollback_on_timeout",
3313
3128
  context.registerVariable(new sys_var_std_string("file_format",
3314
3129
                                                  innobase_file_format_name,
3315
3130
                                                  haildb_file_format_name_validate));
3316
 
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("flush_log_at_trx_commit", srv_flush_log_at_trx_commit));
 
3131
  context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("flush_log_at_trx_commit", srv_flush_log_at_trx_commit));
3317
3132
  context.registerVariable(new sys_var_const_string_val("flush_method",
3318
3133
                                                vm.count("flush-method") ?  vm["flush-method"].as<string>() : ""));
3319
 
  context.registerVariable(new sys_var_constrained_value_readonly<uint32_t>("force_recovery", innobase_force_recovery));
 
3134
  context.registerVariable(new sys_var_constrained_value_readonly<uint16_t>("force_recovery", innobase_force_recovery));
3320
3135
  context.registerVariable(new sys_var_const_string_val("log_group_home_dir",
3321
3136
                                                vm.count("log-group-home-dir") ?  vm["log-group-home-dir"].as<string>() : ""));
3322
3137
  context.registerVariable(new sys_var_constrained_value<int64_t>("log_file_size", haildb_log_file_size));