~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/set_var.cc

  • Committer: Stewart Smith
  • Date: 2009-03-12 12:27:04 UTC
  • mto: (937.2.1 sparc)
  • mto: This revision was merged to the branch mainline in revision 932.
  • Revision ID: stewart@flamingspork.com-20090312122704-ts5lnnj5qm87g58j
fix alignment of variables (incl key cache). fixes SIGBUS on SPARC64

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
static sys_var_session_uint64_t sys_join_buffer_size(&vars, "join_buffer_size",
172
172
                                                     &SV::join_buff_size);
173
173
static sys_var_key_buffer_size  sys_key_buffer_size(&vars, "key_buffer_size");
174
 
static sys_var_key_cache_long  sys_key_cache_block_size(&vars, "key_cache_block_size",
 
174
static sys_var_key_cache_uint32_t  sys_key_cache_block_size(&vars, "key_cache_block_size",
175
175
                                                        offsetof(KEY_CACHE,
176
176
                                                                 param_block_size));
177
 
static sys_var_key_cache_long   sys_key_cache_division_limit(&vars, "key_cache_division_limit",
 
177
static sys_var_key_cache_uint32_t       sys_key_cache_division_limit(&vars, "key_cache_division_limit",
178
178
                                                           offsetof(KEY_CACHE,
179
179
                                                                    param_division_limit));
180
 
static sys_var_key_cache_long  sys_key_cache_age_threshold(&vars, "key_cache_age_threshold",
 
180
static sys_var_key_cache_uint32_t  sys_key_cache_age_threshold(&vars, "key_cache_age_threshold",
181
181
                                                           offsetof(KEY_CACHE,
182
182
                                                                    param_age_threshold));
183
183
static sys_var_bool_ptr sys_local_infile(&vars, "local_infile",
1529
1529
  This should be changed so that we wait until the previous
1530
1530
  assignment is done and then do the new assign
1531
1531
*/
1532
 
bool sys_var_key_cache_long::update(Session *session, set_var *var)
 
1532
bool sys_var_key_cache_uint32_t::update(Session *session, set_var *var)
1533
1533
{
1534
1534
  uint64_t tmp= (uint64_t) var->value->val_int();
1535
1535
  LEX_STRING *base_name= &var->base;
1556
1556
  if (key_cache->in_init)
1557
1557
    goto end;
1558
1558
 
1559
 
  *((uint64_t*) (((char*) key_cache) + offset))=
1560
 
    (uint64_t) fix_unsigned(session, tmp, option_limits);
 
1559
  *((uint32_t*) (((char*) key_cache) + offset))=
 
1560
    (uint32_t) fix_unsigned(session, tmp, option_limits);
1561
1561
 
1562
1562
  /*
1563
1563
    Don't create a new key cache if it didn't exist