mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
fix line endings
This commit is contained in:
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,148 +1,148 @@
|
|||||||
/* Copyright (C) 2012-2013 Kentoku Shiba
|
/* Copyright (C) 2012-2013 Kentoku Shiba
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; version 2 of the License.
|
the Free Software Foundation; version 2 of the License.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
#define MYSQL_SERVER 1
|
#define MYSQL_SERVER 1
|
||||||
#include "mysql_version.h"
|
#include "mysql_version.h"
|
||||||
#if MYSQL_VERSION_ID < 50500
|
#if MYSQL_VERSION_ID < 50500
|
||||||
#include "mysql_priv.h"
|
#include "mysql_priv.h"
|
||||||
#include <mysql/plugin.h>
|
#include <mysql/plugin.h>
|
||||||
#else
|
#else
|
||||||
#include "sql_priv.h"
|
#include "sql_priv.h"
|
||||||
#include "probes_mysql.h"
|
#include "probes_mysql.h"
|
||||||
#include "sql_class.h"
|
#include "sql_class.h"
|
||||||
#include "sql_partition.h"
|
#include "sql_partition.h"
|
||||||
#include "sql_show.h"
|
#include "sql_show.h"
|
||||||
#endif
|
#endif
|
||||||
#include "spd_db_include.h"
|
#include "spd_db_include.h"
|
||||||
#include "spd_include.h"
|
#include "spd_include.h"
|
||||||
#include "spd_table.h"
|
#include "spd_table.h"
|
||||||
|
|
||||||
extern pthread_mutex_t spider_mem_calc_mutex;
|
extern pthread_mutex_t spider_mem_calc_mutex;
|
||||||
|
|
||||||
extern const char *spider_alloc_func_name[SPIDER_MEM_CALC_LIST_NUM];
|
extern const char *spider_alloc_func_name[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern const char *spider_alloc_file_name[SPIDER_MEM_CALC_LIST_NUM];
|
extern const char *spider_alloc_file_name[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern ulong spider_alloc_line_no[SPIDER_MEM_CALC_LIST_NUM];
|
extern ulong spider_alloc_line_no[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern ulonglong spider_total_alloc_mem[SPIDER_MEM_CALC_LIST_NUM];
|
extern ulonglong spider_total_alloc_mem[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern longlong spider_current_alloc_mem[SPIDER_MEM_CALC_LIST_NUM];
|
extern longlong spider_current_alloc_mem[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern ulonglong spider_alloc_mem_count[SPIDER_MEM_CALC_LIST_NUM];
|
extern ulonglong spider_alloc_mem_count[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM];
|
extern ulonglong spider_free_mem_count[SPIDER_MEM_CALC_LIST_NUM];
|
||||||
|
|
||||||
static struct st_mysql_storage_engine spider_i_s_info =
|
static struct st_mysql_storage_engine spider_i_s_info =
|
||||||
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
|
{ MYSQL_INFORMATION_SCHEMA_INTERFACE_VERSION };
|
||||||
|
|
||||||
static ST_FIELD_INFO spider_i_s_alloc_mem_fields_info[] =
|
static ST_FIELD_INFO spider_i_s_alloc_mem_fields_info[] =
|
||||||
{
|
{
|
||||||
{"ID", 10, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "id", SKIP_OPEN_TABLE},
|
{"ID", 10, MYSQL_TYPE_LONG, 0, MY_I_S_UNSIGNED, "id", SKIP_OPEN_TABLE},
|
||||||
{"FUNC_NAME", 64, MYSQL_TYPE_STRING, 0,
|
{"FUNC_NAME", 64, MYSQL_TYPE_STRING, 0,
|
||||||
MY_I_S_MAYBE_NULL, "func_name", SKIP_OPEN_TABLE},
|
MY_I_S_MAYBE_NULL, "func_name", SKIP_OPEN_TABLE},
|
||||||
{"FILE_NAME", 64, MYSQL_TYPE_STRING, 0,
|
{"FILE_NAME", 64, MYSQL_TYPE_STRING, 0,
|
||||||
MY_I_S_MAYBE_NULL, "file_name", SKIP_OPEN_TABLE},
|
MY_I_S_MAYBE_NULL, "file_name", SKIP_OPEN_TABLE},
|
||||||
{"LINE_NO", 10, MYSQL_TYPE_LONG, 0,
|
{"LINE_NO", 10, MYSQL_TYPE_LONG, 0,
|
||||||
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "line_no", SKIP_OPEN_TABLE},
|
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "line_no", SKIP_OPEN_TABLE},
|
||||||
{"TOTAL_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0,
|
{"TOTAL_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0,
|
||||||
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "total_alloc_mem", SKIP_OPEN_TABLE},
|
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "total_alloc_mem", SKIP_OPEN_TABLE},
|
||||||
{"CURRENT_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0,
|
{"CURRENT_ALLOC_MEM", 20, MYSQL_TYPE_LONGLONG, 0,
|
||||||
MY_I_S_MAYBE_NULL, "current_alloc_mem", SKIP_OPEN_TABLE},
|
MY_I_S_MAYBE_NULL, "current_alloc_mem", SKIP_OPEN_TABLE},
|
||||||
{"ALLOC_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
|
{"ALLOC_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
|
||||||
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "alloc_mem_count", SKIP_OPEN_TABLE},
|
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "alloc_mem_count", SKIP_OPEN_TABLE},
|
||||||
{"FREE_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
|
{"FREE_MEM_COUNT", 20, MYSQL_TYPE_LONGLONG, 0,
|
||||||
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "free_mem_count", SKIP_OPEN_TABLE},
|
MY_I_S_UNSIGNED | MY_I_S_MAYBE_NULL, "free_mem_count", SKIP_OPEN_TABLE},
|
||||||
{NULL, 0, MYSQL_TYPE_STRING, 0, 0, NULL, 0}
|
{NULL, 0, MYSQL_TYPE_STRING, 0, 0, NULL, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static int spider_i_s_alloc_mem_fill_table(
|
static int spider_i_s_alloc_mem_fill_table(
|
||||||
THD *thd,
|
THD *thd,
|
||||||
TABLE_LIST *tables,
|
TABLE_LIST *tables,
|
||||||
COND *cond
|
COND *cond
|
||||||
) {
|
) {
|
||||||
uint roop_count;
|
uint roop_count;
|
||||||
TABLE *table = tables->table;
|
TABLE *table = tables->table;
|
||||||
DBUG_ENTER("spider_i_s_alloc_mem_fill_table");
|
DBUG_ENTER("spider_i_s_alloc_mem_fill_table");
|
||||||
for (roop_count = 0; roop_count < SPIDER_MEM_CALC_LIST_NUM; roop_count++)
|
for (roop_count = 0; roop_count < SPIDER_MEM_CALC_LIST_NUM; roop_count++)
|
||||||
{
|
{
|
||||||
table->field[0]->store(roop_count, TRUE);
|
table->field[0]->store(roop_count, TRUE);
|
||||||
if (spider_alloc_func_name[roop_count])
|
if (spider_alloc_func_name[roop_count])
|
||||||
{
|
{
|
||||||
table->field[1]->set_notnull();
|
table->field[1]->set_notnull();
|
||||||
table->field[2]->set_notnull();
|
table->field[2]->set_notnull();
|
||||||
table->field[3]->set_notnull();
|
table->field[3]->set_notnull();
|
||||||
table->field[4]->set_notnull();
|
table->field[4]->set_notnull();
|
||||||
table->field[5]->set_notnull();
|
table->field[5]->set_notnull();
|
||||||
table->field[6]->set_notnull();
|
table->field[6]->set_notnull();
|
||||||
table->field[7]->set_notnull();
|
table->field[7]->set_notnull();
|
||||||
table->field[1]->store(spider_alloc_func_name[roop_count],
|
table->field[1]->store(spider_alloc_func_name[roop_count],
|
||||||
strlen(spider_alloc_func_name[roop_count]), system_charset_info);
|
strlen(spider_alloc_func_name[roop_count]), system_charset_info);
|
||||||
table->field[2]->store(spider_alloc_file_name[roop_count],
|
table->field[2]->store(spider_alloc_file_name[roop_count],
|
||||||
strlen(spider_alloc_file_name[roop_count]), system_charset_info);
|
strlen(spider_alloc_file_name[roop_count]), system_charset_info);
|
||||||
table->field[3]->store(spider_alloc_line_no[roop_count], TRUE);
|
table->field[3]->store(spider_alloc_line_no[roop_count], TRUE);
|
||||||
pthread_mutex_lock(&spider_mem_calc_mutex);
|
pthread_mutex_lock(&spider_mem_calc_mutex);
|
||||||
table->field[4]->store(spider_total_alloc_mem[roop_count], TRUE);
|
table->field[4]->store(spider_total_alloc_mem[roop_count], TRUE);
|
||||||
table->field[5]->store(spider_current_alloc_mem[roop_count], FALSE);
|
table->field[5]->store(spider_current_alloc_mem[roop_count], FALSE);
|
||||||
table->field[6]->store(spider_alloc_mem_count[roop_count], TRUE);
|
table->field[6]->store(spider_alloc_mem_count[roop_count], TRUE);
|
||||||
table->field[7]->store(spider_free_mem_count[roop_count], TRUE);
|
table->field[7]->store(spider_free_mem_count[roop_count], TRUE);
|
||||||
pthread_mutex_unlock(&spider_mem_calc_mutex);
|
pthread_mutex_unlock(&spider_mem_calc_mutex);
|
||||||
} else {
|
} else {
|
||||||
table->field[1]->set_null();
|
table->field[1]->set_null();
|
||||||
table->field[2]->set_null();
|
table->field[2]->set_null();
|
||||||
table->field[3]->set_null();
|
table->field[3]->set_null();
|
||||||
table->field[4]->set_null();
|
table->field[4]->set_null();
|
||||||
table->field[5]->set_null();
|
table->field[5]->set_null();
|
||||||
table->field[6]->set_null();
|
table->field[6]->set_null();
|
||||||
table->field[7]->set_null();
|
table->field[7]->set_null();
|
||||||
}
|
}
|
||||||
if (schema_table_store_record(thd, table))
|
if (schema_table_store_record(thd, table))
|
||||||
{
|
{
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int spider_i_s_alloc_mem_init(
|
static int spider_i_s_alloc_mem_init(
|
||||||
void *p
|
void *p
|
||||||
) {
|
) {
|
||||||
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p;
|
ST_SCHEMA_TABLE *schema = (ST_SCHEMA_TABLE *) p;
|
||||||
DBUG_ENTER("spider_i_s_alloc_mem_init");
|
DBUG_ENTER("spider_i_s_alloc_mem_init");
|
||||||
schema->fields_info = spider_i_s_alloc_mem_fields_info;
|
schema->fields_info = spider_i_s_alloc_mem_fields_info;
|
||||||
schema->fill_table = spider_i_s_alloc_mem_fill_table;
|
schema->fill_table = spider_i_s_alloc_mem_fill_table;
|
||||||
schema->idx_field1 = 0;
|
schema->idx_field1 = 0;
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int spider_i_s_alloc_mem_deinit(
|
static int spider_i_s_alloc_mem_deinit(
|
||||||
void *p
|
void *p
|
||||||
) {
|
) {
|
||||||
DBUG_ENTER("spider_i_s_alloc_mem_deinit");
|
DBUG_ENTER("spider_i_s_alloc_mem_deinit");
|
||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct st_mysql_plugin spider_i_s_alloc_mem =
|
struct st_mysql_plugin spider_i_s_alloc_mem =
|
||||||
{
|
{
|
||||||
MYSQL_INFORMATION_SCHEMA_PLUGIN,
|
MYSQL_INFORMATION_SCHEMA_PLUGIN,
|
||||||
&spider_i_s_info,
|
&spider_i_s_info,
|
||||||
"SPIDER_ALLOC_MEM",
|
"SPIDER_ALLOC_MEM",
|
||||||
"Kentoku Shiba",
|
"Kentoku Shiba",
|
||||||
"Spider memory allocating viewer",
|
"Spider memory allocating viewer",
|
||||||
PLUGIN_LICENSE_GPL,
|
PLUGIN_LICENSE_GPL,
|
||||||
spider_i_s_alloc_mem_init,
|
spider_i_s_alloc_mem_init,
|
||||||
spider_i_s_alloc_mem_deinit,
|
spider_i_s_alloc_mem_deinit,
|
||||||
0x0001,
|
0x0001,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
#if MYSQL_VERSION_ID >= 50600
|
#if MYSQL_VERSION_ID >= 50600
|
||||||
0,
|
0,
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,102 +1,102 @@
|
|||||||
/* Copyright (C) 2009-2013 Kentoku Shiba
|
/* Copyright (C) 2009-2013 Kentoku Shiba
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation; version 2 of the License.
|
the Free Software Foundation; version 2 of the License.
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
This program is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
|
||||||
|
|
||||||
SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
|
SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
|
||||||
SPIDER_TRX *trx,
|
SPIDER_TRX *trx,
|
||||||
THD *thd,
|
THD *thd,
|
||||||
spider_string *str,
|
spider_string *str,
|
||||||
uint conv_name_length,
|
uint conv_name_length,
|
||||||
int link_idx,
|
int link_idx,
|
||||||
uint32 server_id,
|
uint32 server_id,
|
||||||
bool need_lock,
|
bool need_lock,
|
||||||
int *error_num
|
int *error_num
|
||||||
);
|
);
|
||||||
|
|
||||||
void spider_free_ping_table_mon_list(
|
void spider_free_ping_table_mon_list(
|
||||||
SPIDER_TABLE_MON_LIST *table_mon_list
|
SPIDER_TABLE_MON_LIST *table_mon_list
|
||||||
);
|
);
|
||||||
|
|
||||||
void spider_release_ping_table_mon_list_loop(
|
void spider_release_ping_table_mon_list_loop(
|
||||||
uint mutex_hash,
|
uint mutex_hash,
|
||||||
SPIDER_TABLE_MON_LIST *table_mon_list
|
SPIDER_TABLE_MON_LIST *table_mon_list
|
||||||
);
|
);
|
||||||
|
|
||||||
void spider_release_ping_table_mon_list(
|
void spider_release_ping_table_mon_list(
|
||||||
const char *conv_name,
|
const char *conv_name,
|
||||||
uint conv_name_length,
|
uint conv_name_length,
|
||||||
int link_idx
|
int link_idx
|
||||||
);
|
);
|
||||||
|
|
||||||
int spider_get_ping_table_mon(
|
int spider_get_ping_table_mon(
|
||||||
THD *thd,
|
THD *thd,
|
||||||
SPIDER_TABLE_MON_LIST *table_mon_list,
|
SPIDER_TABLE_MON_LIST *table_mon_list,
|
||||||
char *name,
|
char *name,
|
||||||
uint name_length,
|
uint name_length,
|
||||||
int link_idx,
|
int link_idx,
|
||||||
uint32 server_id,
|
uint32 server_id,
|
||||||
MEM_ROOT *mem_root,
|
MEM_ROOT *mem_root,
|
||||||
bool need_lock
|
bool need_lock
|
||||||
);
|
);
|
||||||
|
|
||||||
SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
|
SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
|
||||||
THD *thd,
|
THD *thd,
|
||||||
char *name,
|
char *name,
|
||||||
uint name_length,
|
uint name_length,
|
||||||
int link_idx,
|
int link_idx,
|
||||||
uint32 server_id,
|
uint32 server_id,
|
||||||
spider_string *str,
|
spider_string *str,
|
||||||
bool need_lock,
|
bool need_lock,
|
||||||
int *error_num
|
int *error_num
|
||||||
);
|
);
|
||||||
|
|
||||||
SPIDER_CONN *spider_get_ping_table_tgt_conn(
|
SPIDER_CONN *spider_get_ping_table_tgt_conn(
|
||||||
SPIDER_TRX *trx,
|
SPIDER_TRX *trx,
|
||||||
SPIDER_SHARE *share,
|
SPIDER_SHARE *share,
|
||||||
int *error_num
|
int *error_num
|
||||||
);
|
);
|
||||||
|
|
||||||
int spider_init_ping_table_mon_cache(
|
int spider_init_ping_table_mon_cache(
|
||||||
THD *thd,
|
THD *thd,
|
||||||
MEM_ROOT *mem_root,
|
MEM_ROOT *mem_root,
|
||||||
bool need_lock
|
bool need_lock
|
||||||
);
|
);
|
||||||
|
|
||||||
int spider_ping_table_cache_compare(
|
int spider_ping_table_cache_compare(
|
||||||
TABLE *table,
|
TABLE *table,
|
||||||
MEM_ROOT *mem_root
|
MEM_ROOT *mem_root
|
||||||
);
|
);
|
||||||
|
|
||||||
void spider_ping_table_free_mon_list(
|
void spider_ping_table_free_mon_list(
|
||||||
SPIDER_TABLE_MON_LIST *table_mon_list
|
SPIDER_TABLE_MON_LIST *table_mon_list
|
||||||
);
|
);
|
||||||
|
|
||||||
void spider_ping_table_free_mon(
|
void spider_ping_table_free_mon(
|
||||||
SPIDER_TABLE_MON *table_mon
|
SPIDER_TABLE_MON *table_mon
|
||||||
);
|
);
|
||||||
|
|
||||||
int spider_ping_table_mon_from_table(
|
int spider_ping_table_mon_from_table(
|
||||||
SPIDER_TRX *trx,
|
SPIDER_TRX *trx,
|
||||||
THD *thd,
|
THD *thd,
|
||||||
SPIDER_SHARE *share,
|
SPIDER_SHARE *share,
|
||||||
uint32 server_id,
|
uint32 server_id,
|
||||||
char *conv_name,
|
char *conv_name,
|
||||||
uint conv_name_length,
|
uint conv_name_length,
|
||||||
int link_idx,
|
int link_idx,
|
||||||
char *where_clause,
|
char *where_clause,
|
||||||
uint where_clause_length,
|
uint where_clause_length,
|
||||||
long monitoring_kind,
|
long monitoring_kind,
|
||||||
longlong monitoring_limit,
|
longlong monitoring_limit,
|
||||||
bool need_lock
|
bool need_lock
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user