Merge bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/my/mysql-5.1


client/client_priv.h:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlslap.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/event_data_objects.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_cache.cc:
  Manual merge
  Removed comment about bug in old code (not relevant)
This commit is contained in:
unknown 2007-08-02 07:55:33 +03:00
commit 926664fe2c
93 changed files with 1114 additions and 483 deletions

View file

@ -250,8 +250,8 @@ static sys_var_bool_ptr
sys_log_queries_not_using_indexes(&vars, "log_queries_not_using_indexes",
&opt_log_queries_not_using_indexes);
static sys_var_thd_ulong sys_log_warnings(&vars, "log_warnings", &SV::log_warnings);
static sys_var_thd_ulong sys_long_query_time(&vars, "long_query_time",
&SV::long_query_time);
static sys_var_microseconds sys_var_long_query_time(&vars, "long_query_time",
&SV::long_query_time);
static sys_var_thd_bool sys_low_priority_updates(&vars, "low_priority_updates",
&SV::low_priority_updates,
fix_low_priority_updates);
@ -315,6 +315,8 @@ static sys_var_thd_ulong sys_max_tmp_tables(&vars, "max_tmp_tables",
&SV::max_tmp_tables);
static sys_var_long_ptr sys_max_write_lock_count(&vars, "max_write_lock_count",
&max_write_lock_count);
static sys_var_thd_ulong sys_min_examined_row_limit(&vars, "min_examined_row_limit",
&SV::min_examined_row_limit);
static sys_var_thd_ulong sys_multi_range_count(&vars, "multi_range_count",
&SV::multi_range_count);
static sys_var_long_ptr sys_myisam_data_pointer_size(&vars, "myisam_data_pointer_size",
@ -1473,6 +1475,15 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base)
pthread_mutex_unlock(&LOCK_global_system_variables);
return new Item_int(value);
}
case SHOW_DOUBLE:
{
double value;
pthread_mutex_lock(&LOCK_global_system_variables);
value= *(double*) value_ptr(thd, var_type, base);
pthread_mutex_unlock(&LOCK_global_system_variables);
/* 6, as this is for now only used with microseconds */
return new Item_float(value, 6);
}
case SHOW_HA_ROWS:
{
ha_rows value;
@ -2526,6 +2537,60 @@ void sys_var_thd_lc_time_names::set_default(THD *thd, enum_var_type type)
thd->variables.lc_time_names= global_system_variables.lc_time_names;
}
/*
Handling of microseoncds given as seconds.part_seconds
NOTES
The argument to long query time is in seconds in decimal
which is converted to ulonglong integer holding microseconds for storage.
This is used for handling long_query_time
*/
bool sys_var_microseconds::update(THD *thd, set_var *var)
{
double num= var->value->val_real();
longlong microseconds;
if (num > (double) option_limits->max_value)
num= (double) option_limits->max_value;
if (num < (double) option_limits->min_value)
num= (double) option_limits->min_value;
microseconds= (longlong) (num * 1000000.0 + 0.5);
if (var->type == OPT_GLOBAL)
{
pthread_mutex_lock(&LOCK_global_system_variables);
(global_system_variables.*offset)= microseconds;
pthread_mutex_unlock(&LOCK_global_system_variables);
}
else
thd->variables.*offset= microseconds;
return 0;
}
void sys_var_microseconds::set_default(THD *thd, enum_var_type type)
{
longlong microseconds= (longlong) (option_limits->def_value * 1000000.0);
if (type == OPT_GLOBAL)
{
pthread_mutex_lock(&LOCK_global_system_variables);
global_system_variables.*offset= microseconds;
pthread_mutex_unlock(&LOCK_global_system_variables);
}
else
thd->variables.*offset= microseconds;
}
uchar *sys_var_microseconds::value_ptr(THD *thd, enum_var_type type,
LEX_STRING *base)
{
thd->tmp_double_value= (double) ((type == OPT_GLOBAL) ?
global_system_variables.*offset :
thd->variables.*offset) / 1000000.0;
return (uchar*) &thd->tmp_double_value;
}
/*
Functions to update thd->options bits
*/