1528
1535
return mi_panic(HA_PANIC_CLOSE);
1531
static DRIZZLE_SYSVAR_UINT(block_size, block_size,
1532
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
1533
N_("Block size to be used for MyISAM index pages."),
1534
NULL, NULL, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH,
1535
MI_MAX_KEY_BLOCK_LENGTH, 0);
1538
static void sys_var_key_cache_size_update(Session *session, drizzle_sys_var *var, void *, const void *save)
1540
uint32_t tmp= *static_cast<const uint32_t *>(save);
1543
struct my_option option_limits;
1544
plugin_opt_set_limits(&option_limits, var);
1545
option_limits.name= "myisam_key_cache_size";
1547
if (dflt_key_cache->in_init)
1550
myisam_key_cache_size= static_cast<uint32_t>(fix_unsigned(session, static_cast<uint64_t>(tmp), &option_limits));
1552
/* If key cache didn't existed initialize it, else resize it */
1553
dflt_key_cache->in_init= 1;
1555
error= ! resize_key_cache(dflt_key_cache,
1556
myisam_key_cache_block_size,
1557
myisam_key_cache_size,
1558
myisam_key_cache_division_limit,
1559
myisam_key_cache_age_threshold);
1560
dflt_key_cache->in_init= 0;
1563
static void sys_var_key_cache_block_size_update(Session *session, drizzle_sys_var *var, void *, const void *save)
1565
uint32_t tmp= *static_cast<const uint32_t *>(save);
1568
struct my_option option_limits;
1569
plugin_opt_set_limits(&option_limits, var);
1570
option_limits.name= "myisam_key_cache_block_size";
1572
if (dflt_key_cache->in_init)
1575
myisam_key_cache_block_size= static_cast<uint32_t>(fix_unsigned(session, static_cast<uint64_t>(tmp), &option_limits));
1577
dflt_key_cache->in_init= 1;
1579
error= ! resize_key_cache(dflt_key_cache,
1580
myisam_key_cache_block_size,
1581
myisam_key_cache_size,
1582
myisam_key_cache_division_limit,
1583
myisam_key_cache_age_threshold);
1585
dflt_key_cache->in_init= 0;
1588
static void sys_var_key_cache_division_limit_update(Session *session, drizzle_sys_var *var, void *, const void *save)
1590
uint32_t tmp= *static_cast<const uint32_t *>(save);
1593
struct my_option option_limits;
1594
plugin_opt_set_limits(&option_limits, var);
1595
option_limits.name= "myisam_key_cache_division_limit";
1597
if (dflt_key_cache->in_init)
1600
myisam_key_cache_division_limit= static_cast<uint32_t>(fix_unsigned(session, static_cast<uint64_t>(tmp), &option_limits));
1602
dflt_key_cache->in_init= 1;
1604
error= ! resize_key_cache(dflt_key_cache,
1605
myisam_key_cache_block_size,
1606
myisam_key_cache_size,
1607
myisam_key_cache_division_limit,
1608
myisam_key_cache_age_threshold);
1610
dflt_key_cache->in_init= 0;
1613
static void sys_var_key_cache_age_threshold_update(Session *session, drizzle_sys_var *var, void *, const void *save)
1615
uint32_t tmp= *static_cast<const uint32_t *>(save);
1618
struct my_option option_limits;
1619
plugin_opt_set_limits(&option_limits, var);
1620
option_limits.name= "myisam_key_cache_age_threshold";
1622
if (dflt_key_cache->in_init)
1625
myisam_key_cache_age_threshold= static_cast<uint32_t>(fix_unsigned(session, static_cast<uint64_t>(tmp), &option_limits));
1627
dflt_key_cache->in_init= 1;
1629
error= ! resize_key_cache(dflt_key_cache,
1630
myisam_key_cache_block_size,
1631
myisam_key_cache_size,
1632
myisam_key_cache_division_limit,
1633
myisam_key_cache_age_threshold);
1635
dflt_key_cache->in_init= 0;
1638
static DRIZZLE_SYSVAR_UINT(key_cache_block_size,
1639
myisam_key_cache_block_size,
1640
PLUGIN_VAR_RQCMDARG,
1641
N_("Block size to be used for MyISAM index pages."),
1643
sys_var_key_cache_block_size_update,
1644
KEY_CACHE_BLOCK_SIZE,
1649
static DRIZZLE_SYSVAR_UINT(key_cache_age_threshold, myisam_key_cache_age_threshold,
1650
PLUGIN_VAR_RQCMDARG,
1651
N_("This characterizes the number of hits a hot block has to be untouched "
1652
"until it is considered aged enough to be downgraded to a warm block. "
1653
"This specifies the percentage ratio of that number of hits to the "
1654
"total number of blocks in key cache"),
1656
sys_var_key_cache_age_threshold_update,
1662
static DRIZZLE_SYSVAR_UINT(key_cache_division_limit, myisam_key_cache_division_limit,
1663
PLUGIN_VAR_RQCMDARG,
1664
N_("The minimum percentage of warm blocks in key cache"),
1666
sys_var_key_cache_division_limit_update,
1672
static DRIZZLE_SYSVAR_UINT(key_cache_size,
1673
myisam_key_cache_size,
1674
PLUGIN_VAR_RQCMDARG,
1675
N_("The size of the buffer used for index blocks for MyISAM tables. "
1676
"Increase this to get better index handling (for all reads and multiple "
1677
"writes) to as much as you can afford;"),
1679
sys_var_key_cache_size_update,
1537
1685
static DRIZZLE_SYSVAR_UINT(repair_threads, repair_threads,
1538
PLUGIN_VAR_RQCMDARG,
1539
N_("Number of threads to use when repairing MyISAM tables. The value of "
1540
"1 disables parallel repair."),
1541
NULL, NULL, 1, 1, UINT32_MAX, 0);
1686
PLUGIN_VAR_RQCMDARG,
1687
N_("Number of threads to use when repairing MyISAM tables. The value of "
1688
"1 disables parallel repair."),
1689
NULL, NULL, 1, 1, UINT32_MAX, 0);
1543
1691
static DRIZZLE_SYSVAR_ULONGLONG(max_sort_file_size, max_sort_file_size,
1544
1692
PLUGIN_VAR_RQCMDARG,