summaryrefslogtreecommitdiff
path: root/sql/sql_show.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_show.cc')
-rw-r--r--sql/sql_show.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 36d154181f8..cd5b537996d 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -44,7 +44,7 @@ static void
append_algorithm(TABLE_LIST *table, String *buff);
static int
view_store_create_info(THD *thd, TABLE_LIST *table, String *buff);
-static bool schema_table_store_record(THD *thd, TABLE *table);
+bool schema_table_store_record(THD *thd, TABLE *table);
/***************************************************************************
@@ -1375,7 +1375,7 @@ void mysqld_list_processes(THD *thd,const char *user, bool verbose)
#if !defined(DONT_USE_THR_ALARM) && ! defined(SCO)
if (pthread_kill(tmp->real_id,0))
- tmp->proc_info="*** DEAD ***"; // This shouldn't happen
+ thd_proc_info(tmp, "*** DEAD ***"); // This shouldn't happen
#endif
#ifdef EXTRA_DEBUG
thd_info->start_time= tmp->time_after_lock;
@@ -1520,6 +1520,10 @@ static bool show_status_array(THD *thd, const char *wild,
nr= (long) (thd->query_start() - server_start_time);
end= int10_to_str(nr, buff, 10);
break;
+ case SHOW_FLUSHTIME:
+ nr= (long) (thd->query_start() - flush_status_time);
+ end= int10_to_str(nr, buff, 10);
+ break;
case SHOW_QUESTION:
end= int10_to_str((long) thd->query_id, buff, 10);
break;
@@ -1873,7 +1877,7 @@ typedef struct st_index_field_values
1 error
*/
-static bool schema_table_store_record(THD *thd, TABLE *table)
+bool schema_table_store_record(THD *thd, TABLE *table)
{
int error;
if ((error= table->file->write_row(table->record[0])))
@@ -3662,11 +3666,18 @@ TABLE *create_schema_table(THD *thd, TABLE_LIST *table_list)
fields_info->field_length)) == NULL)
DBUG_RETURN(NULL);
break;
+ case MYSQL_TYPE_DECIMAL:
+ case MYSQL_TYPE_STRING:
default:
/* Don't let unimplemented types pass through. Could be a grave error. */
- DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING);
+ DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING ||
+ fields_info->field_type == MYSQL_TYPE_DECIMAL);
- /* this should be changed when Item_empty_string is fixed(in 4.1) */
+ /**
+ @todo Change when Item_empty_string is fixed (in 4.1). [Presumably,
+ this means removing the first of two steps: setting a useless, bogus
+ value; and then setting the attributes.]
+ */
if (!(item= new Item_empty_string("", 0, cs)))
{
DBUG_RETURN(0);
@@ -4393,6 +4404,9 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
fill_open_tables, make_old_format, 0, -1, -1, 1},
+ {"PROFILING", query_profile_statistics_info, create_schema_table,
+ fill_query_profile_statistics_info, make_profile_table_for_show,
+ NULL, -1, -1, false},
{"ROUTINES", proc_fields_info, create_schema_table,
fill_schema_proc, make_proc_old_format, 0, -1, -1, 0},
{"SCHEMATA", schema_fields_info, create_schema_table,