Commit cca4ea27 authored by unknown's avatar unknown

Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-community

into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1


CMakeLists.txt:
  Auto merged
BitKeeper/deleted/.del-Makefile.am~2:
  Auto merged
BitKeeper/deleted/.del-README~1:
  Auto merged
BitKeeper/deleted/.del-configure.js:
  Auto merged
BitKeeper/deleted/.del-ha_berkeley.cc:
  Auto merged
BitKeeper/triggers/post-commit:
  Auto merged
client/CMakeLists.txt:
  Auto merged
extra/CMakeLists.txt:
  Auto merged
include/config-win.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/r/func_in.result:
  Auto merged
mysql-test/r/information_schema_db.result:
  Auto merged
mysql-test/t/func_in.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
server-tools/instance-manager/CMakeLists.txt:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/lex.h:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/src/ndbapi/DictCache.cpp:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Manual merge.
configure.in:
  Manual merge.
mysql-test/r/information_schema.result:
  Manual merge.
mysql-test/t/profiling.test:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_profile.cc:
  Manual merge.
sql/sql_profile.h:
  Manual merge.
sql/sql_select.cc:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/table.h:
  Manual merge.
storage/ndb/src/common/util/File.cpp:
  Manual merge.
support-files/mysql.spec.sh:
  Manual merge.
parents fc70ac46 4c007885
......@@ -1402,6 +1402,13 @@ TABLE_PRIVILEGES information_schema.TABLE_PRIVILEGES 1
TRIGGERS information_schema.TRIGGERS 1
USER_PRIVILEGES information_schema.USER_PRIVILEGES 1
VIEWS information_schema.VIEWS 1
show global status like "Uptime_%";
Variable_name Value
Uptime_since_flush_status #
flush status;
show global status like "Uptime_%";
Variable_name Value
Uptime_since_flush_status #
create table t1(f1 int);
create view v1 as select f1+1 as a from t1;
create table t2 (f1 int, f2 int);
......
show profiles;
Query_ID Duration Query
show profile all;
Status Duration CPU_user CPU_system Context_voluntary Context_involuntary Block_ops_in Block_ops_out Messages_sent Messages_received Page_faults_major Page_faults_minor Swaps Source_function Source_file Source_line
show session variables like 'profil%';
Variable_name Value
profiling OFF
......
--source include/have_community_features.inc
# Verify that the protocol isn't violated if we ask for profiling info
# before profiling has recorded anything.
show profiles;
show profile all;
# default is OFF
show session variables like 'profil%';
select @@profiling;
......
......@@ -1509,6 +1509,15 @@ int prepare_schema_table(THD *thd, LEX *lex, Table_ident *table_ident,
break;
}
#endif
case SCH_PROFILES:
/*
Mark this current profiling record to be discarded. We don't
wish to have SHOW commands show up in profiling.
*/
#ifdef ENABLED_PROFILING
thd->profiling.discard();
#endif
break;
case SCH_OPEN_TABLES:
case SCH_VARIABLES:
case SCH_STATUS:
......@@ -2008,23 +2017,6 @@ mysql_execute_command(THD *thd)
#else
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILES", "enable-profiling");
goto error;
#endif
break;
}
case SQLCOM_SHOW_PROFILE:
{
#if defined(ENABLED_PROFILING) && defined(COMMUNITY_SERVER)
thd->profiling.store();
thd->profiling.discard(); // will get re-enabled by reset()
if (lex->profile_query_id != 0)
res= thd->profiling.show(lex->profile_options, lex->profile_query_id);
else
res= thd->profiling.show_last(lex->profile_options);
if (res)
goto error;
#else
my_error(ER_FEATURE_DISABLED, MYF(0), "SHOW PROFILE", "enable-profiling");
goto error;
#endif
break;
}
......
This diff is collapsed.
......@@ -39,6 +39,7 @@ extern const char * const _unknown_func_;
extern ST_FIELD_INFO query_profile_statistics_info[];
int fill_query_profile_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
int make_profile_table_for_show(THD *thd, ST_SCHEMA_TABLE *schema_table);
#define PROFILE_NONE 0
......@@ -315,12 +316,6 @@ class PROFILING
/* SHOW PROFILES */
bool show_profiles();
/* SHOW PROFILE FOR QUERY query_id */
bool show(uint options, uint profiling_query_id);
/* SHOW PROFILE */
bool show_last(uint options);
/* ... from INFORMATION_SCHEMA.PROFILING ... */
int fill_statistics_info(THD *thd, TABLE_LIST *tables, Item *cond);
};
......
......@@ -6507,7 +6507,6 @@ ST_SCHEMA_TABLE schema_tables[]=
get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0,
OPEN_TABLE_ONLY},
{"OPEN_TABLES", open_tables_fields_info, create_schema_table,
fill_open_tables, make_old_format, 0, -1, -1, 1, 0},
{"PARTITIONS", partitions_fields_info, create_schema_table,
get_all_tables, 0, get_schema_partitions_record, 1, 2, 0, OPEN_TABLE_ONLY},
{"PLUGINS", plugin_fields_info, create_schema_table,
......
......@@ -8863,11 +8863,11 @@ opt_table_sym:
opt_profile_defs:
/* empty */
| profile_defs
| profile_defs;
profile_defs:
profile_def
| profile_defs ',' profile_def
| profile_defs ',' profile_def;
profile_def:
CPU_SYM
......@@ -9092,7 +9092,13 @@ show_param:
| PROFILES_SYM
{ Lex->sql_command = SQLCOM_SHOW_PROFILES; }
| PROFILE_SYM opt_profile_defs opt_profile_args opt_limit_clause_init
{ Lex->sql_command = SQLCOM_SHOW_PROFILE; }
{
LEX *lex= Lex;
lex->sql_command= SQLCOM_SELECT;
lex->orig_sql_command= SQLCOM_SHOW_PROFILE;
if (prepare_schema_table(YYTHD, lex, NULL, SCH_PROFILES) != 0)
YYABORT;
}
| opt_var_type STATUS_SYM wild_and_where
{
LEX *lex= Lex;
......
......@@ -697,7 +697,7 @@ enum enum_schema_tables
SCH_PARTITIONS,
SCH_PLUGINS,
SCH_PROCESSLIST,
SCH_PROFILING,
SCH_PROFILES,
SCH_REFERENTIAL_CONSTRAINTS,
SCH_PROCEDURES,
SCH_SCHEMATA,
......
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