List:Commits« Previous MessageNext Message »
From:Nuno Carvalho Date:February 20 2012 4:56pm
Subject:bzr push into mysql-trunk branch (nuno.carvalho:3615 to 3616) WL#5223
View as plain text  
 3616 Nuno Carvalho	2012-02-20
      WL#5223: Binary Log Group Commit
      
      Had dummy structures, used to declare PSI_statement_locker_state and 
      PSI_idle_locker_state when no instrumentation is available. 
      
      Only made invocations to PSI_server when instrumentation is available.

    modified:
      include/mysql/psi/psi.h
      include/mysql/psi/psi_abi_v0.h.pp
      sql/binlog.cc
 3615 Nuno Carvalho	2012-02-20
      WL#5223: Binary Log Group Commit
      
      Updated commit_1innodb test (commit_inc_row).

    modified:
      mysql-test/include/commit.inc
      mysql-test/r/commit_1innodb.result
=== modified file 'include/mysql/psi/psi.h'
--- a/include/mysql/psi/psi.h	2011-11-08 04:28:05 +0000
+++ b/include/mysql/psi/psi.h	2012-02-20 16:54:30 +0000
@@ -2235,6 +2235,24 @@ typedef struct PSI_socket_locker_state_v
 #else /* HAVE_PSI_INTERFACE */
 
 /**
+  Dummy structures, used to declare PSI_statement_locker_state and
+  PSI_idle_locker_state when no instrumentation is available.
+*/
+#ifndef USE_PSI_1
+#ifndef USE_PSI_2
+struct PSI_statement_locker_state_none
+{
+};
+typedef struct PSI_statement_locker_state_none PSI_statement_locker_state;
+
+struct PSI_idle_locker_state_none
+{
+};
+typedef struct PSI_idle_locker_state_none PSI_idle_locker_state;
+#endif
+#endif
+
+/**
   Dummy structure, used to declare PSI_server when no instrumentation
   is available.
   The content does not matter, since PSI_server will be NULL.

=== modified file 'include/mysql/psi/psi_abi_v0.h.pp'
--- a/include/mysql/psi/psi_abi_v0.h.pp	2011-11-02 23:29:01 +0000
+++ b/include/mysql/psi/psi_abi_v0.h.pp	2012-02-20 16:54:30 +0000
@@ -16,6 +16,14 @@ struct PSI_bootstrap
 {
   void* (*get_interface)(int version);
 };
+struct PSI_statement_locker_state_none
+{
+};
+typedef struct PSI_statement_locker_state_none PSI_statement_locker_state;
+struct PSI_idle_locker_state_none
+{
+};
+typedef struct PSI_idle_locker_state_none PSI_idle_locker_state;
 struct PSI_none
 {
   int opaque;

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2012-02-20 12:15:01 +0000
+++ b/sql/binlog.cc	2012-02-20 16:54:30 +0000
@@ -133,14 +133,18 @@ class Thread_excursion
 {
 public:
   Thread_excursion(THD *thd)
-    : m_saved_psi(PSI_server ? PSI_server->get_thread() : NULL)
-    , m_original_thd(thd)
+    : m_original_thd(thd)
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
+    , m_saved_psi(PSI_server ? PSI_server->get_thread() : NULL)
+#endif
   {
   }
 
   ~Thread_excursion() {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
     if (PSI_server)
       PSI_server->set_thread(m_saved_psi);
+#endif
 #ifndef EMBEDDED_LIBRARY
     if (unlikely(setup_connection_thread_globals(m_original_thd)))
       DBUG_ASSERT(0);                           // Out of memory?!
@@ -149,22 +153,26 @@ public:
 
   int attach_to(THD *thd)
   {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
     if (PSI_server)
       PSI_server->set_thread(thd_get_psi(thd));
+#endif
 #ifndef EMBEDDED_LIBRARY
     if (unlikely(setup_connection_thread_globals(thd)))
     {
+#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE
       if (PSI_server)
         PSI_server->set_thread(m_saved_psi);
+#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */
       return 1;
     }
-#endif
+#endif /* EMBEDDED_LIBRARY */
     return 0;
   }
 
 private:
-  PSI_thread *m_saved_psi;
   THD *m_original_thd;
+  PSI_thread *m_saved_psi;
 };
 
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (nuno.carvalho:3615 to 3616) WL#5223Nuno Carvalho20 Feb