From: Marc Alff Date: November 5 2011 5:01pm Subject: bzr push into mysql-trunk-marc branch (marc.alff:3562 to 3563) List-Archive: http://lists.mysql.com/commits/141749 Message-Id: <201111051701.pA5H1L1s023178@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3563 Marc Alff 2011-11-05 Investigate embedded break modified: include/mysql/psi/psi.h sql/mysqld.cc sql/sql_class.h sql/sql_parse.cc 3562 Marc Alff 2011-11-05 benchmark tests modified: storage/perfschema/unittest/pfs_benchmark-t.cc === modified file 'include/mysql/psi/psi.h' --- a/include/mysql/psi/psi.h 2011-11-03 16:03:34 +0000 +++ b/include/mysql/psi/psi.h 2011-11-05 17:00:31 +0000 @@ -16,6 +16,18 @@ #ifndef MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H #define MYSQL_PERFORMANCE_SCHEMA_INTERFACE_H +#ifdef EMBEDDED_LIBRARY +#define DISABLE_PSI_MUTEX +#define DISABLE_PSI_RWLOCK +#define DISABLE_PSI_COND +#define DISABLE_PSI_FILE +#define DISABLE_PSI_TABLE +#define DISABLE_PSI_SOCKET +#define DISABLE_PSI_STAGE +#define DISABLE_PSI_STATEMENT +#define DISABLE_PSI_IDLE +#endif /* EMBEDDED_LIBRARY */ + #ifndef MY_GLOBAL_INCLUDED /* Make sure a .c or .cc file contains an include to my_global.h first. === modified file 'sql/mysqld.cc' --- a/sql/mysqld.cc 2011-11-03 16:03:34 +0000 +++ b/sql/mysqld.cc 2011-11-05 17:00:31 +0000 @@ -708,6 +708,7 @@ void set_remaining_args(int argc, char * PSI_statement_info stmt_info_new_packet; #endif +#ifndef EMBEDDED_LIBRARY void net_before_header_psi(struct st_net *net, void *user_data, size_t /* unused: count */) { THD *thd; @@ -783,6 +784,7 @@ void init_net_server_extension(THD *thd) thd->net.extension= NULL; #endif } +#endif /* EMBEDDED_LIBRARY */ /* Since buffered_option_error_reporter is only used currently === modified file 'sql/sql_class.h' --- a/sql/sql_class.h 2011-11-02 23:29:01 +0000 +++ b/sql/sql_class.h 2011-11-05 17:00:31 +0000 @@ -2362,20 +2362,19 @@ public: /** Current statement instrumentation. */ PSI_statement_locker *m_statement_psi; -#ifdef HAVE_PSI_STATEMENT_INTERFACE +#ifndef EMBEDDED_LIBRARY /** Current statement instrumentation state. */ PSI_statement_locker_state m_statement_state; -#endif +#endif /* EMBEDDED_LIBRARY */ /** Idle instrumentation. */ PSI_idle_locker *m_idle_psi; -#ifdef HAVE_PSI_IDLE_INTERFACE +#ifndef EMBEDDED_LIBRARY /** Idle instrumentation state. */ PSI_idle_locker_state m_idle_state; -#endif +#endif /* EMBEDDED_LIBRARY */ /** True if the server code is IDLE for this connection. */ bool m_server_idle; - /* Id of current query. Statement can be reused to execute several queries query_id is global in context of the whole MySQL server. === modified file 'sql/sql_parse.cc' --- a/sql/sql_parse.cc 2011-11-03 16:03:34 +0000 +++ b/sql/sql_parse.cc 2011-11-05 17:00:31 +0000 @@ -870,7 +870,6 @@ bool do_command(THD *thd) /* Mark the statement completed. */ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); - thd->m_statement_psi= NULL; if (net->error != 3) { @@ -918,8 +917,6 @@ bool do_command(THD *thd) return_value= dispatch_command(command, thd, packet+1, (uint) (packet_length-1)); out: - /* The statement instrumentation must be closed in all cases. */ - DBUG_ASSERT(thd->m_statement_psi == NULL); DBUG_RETURN(return_value); } #endif /* EMBEDDED_LIBRARY */ @@ -1219,7 +1216,6 @@ bool dispatch_command(enum enum_server_c /* PSI end */ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); - thd->m_statement_psi= NULL; /* DTRACE end */ if (MYSQL_QUERY_DONE_ENABLED()) @@ -1597,13 +1593,16 @@ bool dispatch_command(enum enum_server_c thd->reset_query(); thd->set_command(COM_SLEEP); - dec_thread_running(); - thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory - free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); /* Performance Schema Interface instrumentation, end */ MYSQL_END_STATEMENT(thd->m_statement_psi, thd->get_stmt_da()); - thd->m_statement_psi= NULL; + + dec_thread_running(); + thd->packet.shrink(thd->variables.net_buffer_length); // Reclaim some memory + + thd->m_statement_psi= (PSI_statement_locker*) 0xDEADBEEF; + free_root(thd->mem_root,MYF(MY_KEEP_PREALLOC)); + DBUG_ASSERT(thd->m_statement_psi == (PSI_statement_locker*) 0xDEADBEEF); /* DTRACE instrumentation, end */ if (MYSQL_QUERY_DONE_ENABLED() || MYSQL_COMMAND_DONE_ENABLED()) No bundle (reason: useless for push emails).