~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/ha_myisam.cc

merge with latest from the trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
ulong myisam_recover_options= HA_RECOVER_NONE;
32
32
pthread_mutex_t THR_LOCK_myisam= PTHREAD_MUTEX_INITIALIZER;
33
33
 
 
34
static uint32_t repair_threads;
 
35
static uint32_t block_size;
 
36
 
34
37
/* bits in myisam_recover_options */
35
38
const char *myisam_recover_names[] =
36
39
{ "DEFAULT", "BACKUP", "FORCE", "QUICK", NULL};
875
878
      local_testflag|= T_STATISTICS;
876
879
      param.testflag|= T_STATISTICS;            // We get this for free
877
880
      statistics_done=1;
878
 
      if (session->variables.myisam_repair_threads>1)
 
881
      if (repair_threads > 1)
879
882
      {
880
883
        char buf[40];
881
884
        /* TODO: respect myisam_repair_threads variable */
1516
1519
    stats.create_time= misam_info.create_time;
1517
1520
    ref_length= misam_info.reflength;
1518
1521
    share->db_options_in_use= misam_info.options;
1519
 
    stats.block_size= myisam_block_size;        /* record block size */
 
1522
    stats.block_size= block_size;        /* record block size */
1520
1523
 
1521
1524
    /* Update share */
1522
1525
    if (share->tmp_table == NO_TMP_TABLE)
1859
1862
  return NULL;
1860
1863
}
1861
1864
 
 
1865
static DRIZZLE_SYSVAR_UINT(block_size, block_size,
 
1866
                           PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
 
1867
                           N_("Block size to be used for MyISAM index pages."),
 
1868
                           NULL, NULL, MI_KEY_BLOCK_LENGTH, MI_MIN_KEY_BLOCK_LENGTH, 
 
1869
                           MI_MAX_KEY_BLOCK_LENGTH, 0);
 
1870
 
 
1871
static DRIZZLE_SYSVAR_UINT(repair_threads, repair_threads,
 
1872
                           PLUGIN_VAR_RQCMDARG,
 
1873
                           N_("Number of threads to use when repairing MyISAM tables. The value of "
 
1874
                              "1 disables parallel repair."),
 
1875
                           NULL, NULL, 1, 1, UINT32_MAX, 0);
 
1876
 
 
1877
static struct st_mysql_sys_var* system_variables[]= {
 
1878
  DRIZZLE_SYSVAR(block_size),
 
1879
  DRIZZLE_SYSVAR(repair_threads),
 
1880
  NULL
 
1881
};
 
1882
 
1862
1883
 
1863
1884
mysql_declare_plugin(myisam)
1864
1885
{
1871
1892
  myisam_init, /* Plugin Init */
1872
1893
  myisam_deinit, /* Plugin Deinit */
1873
1894
  NULL,                       /* status variables                */
1874
 
  NULL,                       /* system variables                */
 
1895
  system_variables,           /* system variables */
1875
1896
  NULL                        /* config options                  */
1876
1897
}
1877
1898
mysql_declare_plugin_end;