Commit f61dc3c9 authored by unknown's avatar unknown

cleanup


include/my_sys.h:
  sort_dynamic()
mysys/my_once.c:
  MY_ZEROFILL support in my_once_alloc
plugin/fulltext/Makefile.am:
  no lib prefix for modules. really build .so
scripts/mysql_create_system_tables.sh:
  remove obsolete syntax (and warnings)
sql/sql_parse.cc:
  don't call add_to_status/bzero in a loop
parent f062b991
...@@ -755,8 +755,9 @@ extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index); ...@@ -755,8 +755,9 @@ extern void delete_dynamic_element(DYNAMIC_ARRAY *array, uint array_index);
extern void freeze_size(DYNAMIC_ARRAY *array); extern void freeze_size(DYNAMIC_ARRAY *array);
#define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element) #define dynamic_array_ptr(array,array_index) ((array)->buffer+(array_index)*(array)->size_of_element)
#define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index)) #define dynamic_element(array,array_index,type) ((type)((array)->buffer) +(array_index))
#define push_dynamic(A,B) insert_dynamic(A,B) #define push_dynamic(A,B) insert_dynamic((A),(B))
#define reset_dynamic(array) ((array)->elements= 0) #define reset_dynamic(array) ((array)->elements= 0)
#define sort_dynamic(A,cmp) qsort((A)->buffer, (A)->elements, (A)->size_of_element, (cmp))
extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str, extern my_bool init_dynamic_string(DYNAMIC_STRING *str, const char *init_str,
uint init_alloc,uint alloc_increment); uint init_alloc,uint alloc_increment);
......
...@@ -75,6 +75,8 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags) ...@@ -75,6 +75,8 @@ gptr my_once_alloc(unsigned int Size, myf MyFlags)
point= (gptr) ((char*) next+ (next->size-next->left)); point= (gptr) ((char*) next+ (next->size-next->left));
next->left-= Size; next->left-= Size;
if (MyFlags & MY_ZEROFILL)
bzero(point, Size);
return(point); return(point);
} /* my_once_alloc */ } /* my_once_alloc */
......
INCLUDES= -I$(top_builddir)/include INCLUDES= -I$(top_builddir)/include
noinst_LTLIBRARIES= libmypluglib.la noinst_LTLIBRARIES= mypluglib.la
libmypluglib_la_SOURCES= plugin_example.c mypluglib_la_SOURCES= plugin_example.c
libmypluglib_la_LDFLAGS= -module mypluglib_la_LDFLAGS= -module -rpath $(pkglibdir)
...@@ -229,7 +229,7 @@ then ...@@ -229,7 +229,7 @@ then
c_t="$c_t User char(16) binary DEFAULT '' NOT NULL," c_t="$c_t User char(16) binary DEFAULT '' NOT NULL,"
c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL," c_t="$c_t Table_name char(64) binary DEFAULT '' NOT NULL,"
c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL," c_t="$c_t Grantor char(77) DEFAULT '' NOT NULL,"
c_t="$c_t Timestamp timestamp(14)," c_t="$c_t Timestamp timestamp,"
c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_t="$c_t Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name)," c_t="$c_t PRIMARY KEY (Host,Db,User,Table_name),"
...@@ -251,7 +251,7 @@ then ...@@ -251,7 +251,7 @@ then
c_c="$c_c User char(16) binary DEFAULT '' NOT NULL," c_c="$c_c User char(16) binary DEFAULT '' NOT NULL,"
c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Table_name char(64) binary DEFAULT '' NOT NULL,"
c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL," c_c="$c_c Column_name char(64) binary DEFAULT '' NOT NULL,"
c_c="$c_c Timestamp timestamp(14)," c_c="$c_c Timestamp timestamp,"
c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_c="$c_c Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)" c_c="$c_c PRIMARY KEY (Host,Db,User,Table_name,Column_name)"
c_c="$c_c ) engine=MyISAM" c_c="$c_c ) engine=MyISAM"
...@@ -273,7 +273,7 @@ then ...@@ -273,7 +273,7 @@ then
c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL," c_pp="$c_pp Routine_type enum('FUNCTION','PROCEDURE') NOT NULL,"
c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL," c_pp="$c_pp Grantor char(77) DEFAULT '' NOT NULL,"
c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL," c_pp="$c_pp Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL,"
c_pp="$c_pp Timestamp timestamp(14)," c_pp="$c_pp Timestamp timestamp,"
c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type)," c_pp="$c_pp PRIMARY KEY (Host,Db,User,Routine_name,Routine_type),"
c_pp="$c_pp KEY Grantor (Grantor)" c_pp="$c_pp KEY Grantor (Grantor)"
c_pp="$c_pp ) engine=MyISAM" c_pp="$c_pp ) engine=MyISAM"
...@@ -743,7 +743,7 @@ fi ...@@ -743,7 +743,7 @@ fi
cat << END_OF_DATA cat << END_OF_DATA
use mysql; use mysql;
set table_type=myisam; set storage_engine=myisam;
$c_d $c_d
$i_d $i_d
......
...@@ -6642,17 +6642,14 @@ static void refresh_status(void) ...@@ -6642,17 +6642,14 @@ static void refresh_status(void)
{ {
pthread_mutex_lock(&LOCK_status); pthread_mutex_lock(&LOCK_status);
for (struct show_var_st *ptr=status_vars; ptr->name; ptr++) for (struct show_var_st *ptr=status_vars; ptr->name; ptr++)
{ if (ptr->type == SHOW_LONG) // note that SHOW_LONG_NOFLUSH variables are not reset
if (ptr->type == SHOW_LONG)
*(ulong*) ptr->value= 0; *(ulong*) ptr->value= 0;
else if (ptr->type == SHOW_LONG_STATUS)
{
THD *thd= current_thd;
/* We must update the global status before cleaning up the thread */ /* We must update the global status before cleaning up the thread */
THD *thd= current_thd;
add_to_status(&global_status_var, &thd->status_var); add_to_status(&global_status_var, &thd->status_var);
bzero((char*) &thd->status_var, sizeof(thd->status_var)); bzero((char*) &thd->status_var, sizeof(thd->status_var));
}
}
/* Reset the counters of all key caches (default and named). */ /* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters); process_key_caches(reset_key_cache_counters);
pthread_mutex_unlock(&LOCK_status); pthread_mutex_unlock(&LOCK_status);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment