summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-06-17 01:58:36 +0400
committerunknown <konstantin@mysql.com>2005-06-17 01:58:36 +0400
commitdb10586e809862f90e42932f61a421f2ca1dc46b (patch)
treed3c1644c8d7d4122ebe98e56e79ce6b3adf2319f /sql
parent574f6c8dccb7d0e56cfb6ebbbbfeaa115bd247e0 (diff)
downloadmariadb-git-db10586e809862f90e42932f61a421f2ca1dc46b.tar.gz
Post-merge fixes.
Diffstat (limited to 'sql')
-rw-r--r--sql/mysql_priv.h2
-rw-r--r--sql/mysqld.cc12
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/sql_parse.cc2
-rw-r--r--sql/sql_prepare.cc15
5 files changed, 17 insertions, 16 deletions
diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h
index b6f4b963393..336d493d669 100644
--- a/sql/mysql_priv.h
+++ b/sql/mysql_priv.h
@@ -599,6 +599,7 @@ bool mysql_execute_command(THD *thd);
bool do_command(THD *thd);
bool dispatch_command(enum enum_server_command command, THD *thd,
char* packet, uint packet_length);
+void log_slow_statement(THD *thd);
bool check_dup(const char *db, const char *name, TABLE_LIST *tables);
bool table_cache_init(void);
@@ -1116,6 +1117,7 @@ extern my_bool opt_slave_compressed_protocol, use_temp_pool;
extern my_bool opt_readonly, lower_case_file_system;
extern my_bool opt_enable_named_pipe, opt_sync_frm, opt_allow_suspicious_udfs;
extern my_bool opt_secure_auth;
+extern my_bool opt_log_slow_admin_statements;
extern my_bool sp_automatic_privileges, opt_noacl;
extern my_bool opt_old_style_user_limits, trust_routine_creators;
extern uint opt_crash_binlog_innodb;
diff --git a/sql/mysqld.cc b/sql/mysqld.cc
index 810ac1254c0..9c5f33f849d 100644
--- a/sql/mysqld.cc
+++ b/sql/mysqld.cc
@@ -5725,12 +5725,12 @@ struct show_var_st status_vars[]= {
{"Com_show_warnings", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SHOW_WARNS]), SHOW_LONG_STATUS},
{"Com_slave_start", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_START]), SHOW_LONG_STATUS},
{"Com_slave_stop", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_SLAVE_STOP]), SHOW_LONG_STATUS},
- {"Com_stmt_prepare", (char*) offsetof(STATUS_VAR, com_stmt_prepare), SHOW_LONG},
- {"Com_stmt_execute", (char*) offsetof(STATUS_VAR, com_stmt_execute), SHOW_LONG},
- {"Com_stmt_fetch", (char*) offsetof(STATUS_VAR, com_stmt_fetch), SHOW_LONG},
- {"Com_stmt_send_long_data", (char*) offsetof(STATUS_VAR, com_stmt_send_long_data), SHOW_LONG},
- {"Com_stmt_reset", (char*) offsetof(STATUS_VAR, com_stmt_reset), SHOW_LONG},
- {"Com_stmt_close", (char*) offsetof(STATUS_VAR, com_stmt_close), SHOW_LONG},
+ {"Com_stmt_prepare", (char*) offsetof(STATUS_VAR, com_stmt_prepare), SHOW_LONG_STATUS},
+ {"Com_stmt_execute", (char*) offsetof(STATUS_VAR, com_stmt_execute), SHOW_LONG_STATUS},
+ {"Com_stmt_fetch", (char*) offsetof(STATUS_VAR, com_stmt_fetch), SHOW_LONG_STATUS},
+ {"Com_stmt_send_long_data", (char*) offsetof(STATUS_VAR, com_stmt_send_long_data), SHOW_LONG_STATUS},
+ {"Com_stmt_reset", (char*) offsetof(STATUS_VAR, com_stmt_reset), SHOW_LONG_STATUS},
+ {"Com_stmt_close", (char*) offsetof(STATUS_VAR, com_stmt_close), SHOW_LONG_STATUS},
{"Com_truncate", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_TRUNCATE]), SHOW_LONG_STATUS},
{"Com_unlock_tables", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_UNLOCK_TABLES]), SHOW_LONG_STATUS},
{"Com_update", (char*) offsetof(STATUS_VAR, com_stat[(uint) SQLCOM_UPDATE]), SHOW_LONG_STATUS},
diff --git a/sql/sql_class.h b/sql/sql_class.h
index d0f926f8006..6097fb1d4ed 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -647,7 +647,7 @@ typedef struct system_status_var
variable in system_status_var
*/
-#define last_system_status_var filesort_scan_count
+#define last_system_status_var com_stmt_close
void free_tmp_table(THD *thd, TABLE *entry);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 14504a0623f..91bccd4dd11 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -2523,7 +2523,7 @@ mysql_execute_command(THD *thd)
lex->prepared_stmt_name.length,
lex->prepared_stmt_name.str));
/* We account deallocate in the same manner as mysql_stmt_close */
- statistic_increment(com_stmt_close, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_close, &LOCK_status);
if ((stmt= thd->stmt_map.find_by_name(&lex->prepared_stmt_name)))
{
thd->stmt_map.erase(stmt);
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index cd2ed4094c0..7af881790eb 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1716,7 +1716,7 @@ bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
However, it seems handy if com_stmt_prepare is increased always,
no matter what kind of prepare is processed.
*/
- statistic_increment(com_stmt_prepare, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_prepare, &LOCK_status);
if (stmt == 0)
DBUG_RETURN(TRUE);
@@ -1962,7 +1962,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
packet+= 9; /* stmt_id + 5 bytes of flags */
- statistic_increment(com_stmt_execute, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_execute")))
DBUG_VOID_RETURN;
@@ -2092,7 +2092,7 @@ void mysql_sql_stmt_execute(THD *thd, LEX_STRING *stmt_name)
DBUG_ASSERT(thd->free_list == NULL);
/* See comment for statistic_increment in mysql_stmt_prepare */
- statistic_increment(com_stmt_execute, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_execute, &LOCK_status);
if (!(stmt= (Prepared_statement*)thd->stmt_map.find_by_name(stmt_name)))
{
@@ -2202,7 +2202,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_fetch");
- statistic_increment(com_stmt_fetch, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_fetch, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_fetch")))
DBUG_VOID_RETURN;
@@ -2263,7 +2263,7 @@ void mysql_stmt_reset(THD *thd, char *packet)
Prepared_statement *stmt;
DBUG_ENTER("mysql_stmt_reset");
- statistic_increment(com_stmt_reset, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_reset, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_reset")))
DBUG_VOID_RETURN;
@@ -2298,7 +2298,7 @@ void mysql_stmt_free(THD *thd, char *packet)
DBUG_ENTER("mysql_stmt_free");
- statistic_increment(com_stmt_close, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_close, &LOCK_status);
if (!(stmt= find_prepared_statement(thd, stmt_id, "mysql_stmt_close")))
DBUG_VOID_RETURN;
@@ -2337,7 +2337,7 @@ void mysql_stmt_get_longdata(THD *thd, char *packet, ulong packet_length)
DBUG_ENTER("mysql_stmt_get_longdata");
- statistic_increment(com_stmt_send_long_data, &LOCK_status);
+ statistic_increment(thd->status_var.com_stmt_send_long_data, &LOCK_status);
#ifndef EMBEDDED_LIBRARY
/* Minimal size of long data packet is 6 bytes */
if ((ulong) (packet_end - packet) < MYSQL_LONG_DATA_HEADER)
@@ -2420,7 +2420,6 @@ void Prepared_statement::setup_set_params()
}
-
Prepared_statement::~Prepared_statement()
{
if (cursor)