List:Commits« Previous MessageNext Message »
From:Shivji Kumar Jha Date:July 10 2013 5:29am
Subject:bzr push into mysql-trunk-wl3656 branch (shivji.jha:5507 to 5508) WL#3656
View as plain text  
 5508 Shivji Kumar Jha	2013-07-10
      WL#3656- PERFORMANCE SCHEMA table for SHOW SLAVE STATUS
                        
      Addressed review comments from Rith.
      - All the tables return an empty set on master.
      - In non-MTS mode, worker table returns an empty set.
      - The rpl tests have been modified to assert on count(*)=0
        in the above two scenarios.

    modified:
      mysql-test/r/mysqld--help-win.result
      mysql-test/suite/perfschema/t/ddl_replication_execute_status_by_worker-slave.opt
      mysql-test/suite/perfschema/t/dml_replication_execute_status_by_worker-slave.opt
      mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result
      mysql-test/suite/rpl/r/rpl_perfschema_connect_status.result
      mysql-test/suite/rpl/r/rpl_perfschema_execute_config.result
      mysql-test/suite/rpl/r/rpl_perfschema_execute_status.result
      mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_coordinator.result
      mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_worker.result
      mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test
      mysql-test/suite/rpl/t/rpl_perfschema_connect_status.test
      mysql-test/suite/rpl/t/rpl_perfschema_execute_config.test
      mysql-test/suite/rpl/t/rpl_perfschema_execute_status.test
      mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_coordinator.test
      mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_worker.test
      sql/rpl_rli_pdb.cc
      storage/perfschema/table_replication_connection_configuration.cc
      storage/perfschema/table_replication_connection_configuration.h
      storage/perfschema/table_replication_connection_status.cc
      storage/perfschema/table_replication_connection_status.h
      storage/perfschema/table_replication_execute_configuration.cc
      storage/perfschema/table_replication_execute_configuration.h
      storage/perfschema/table_replication_execute_status.cc
      storage/perfschema/table_replication_execute_status.h
      storage/perfschema/table_replication_execute_status_by_coordinator.cc
      storage/perfschema/table_replication_execute_status_by_coordinator.h
 5507 Shivji Kumar Jha	2013-07-10
       WL#3656- PERFORMANCE SCHEMA table for SHOW SLAVE STATUS
                  
       Fix to handle failures in WL branch(mysql-trunk-wl3656)

    modified:
      mysql-test/r/mysqld--help-notwin.result
=== modified file 'mysql-test/r/mysqld--help-win.result'
--- a/mysql-test/r/mysqld--help-win.result	revid:shivji.jha@stripped
+++ b/mysql-test/r/mysqld--help-win.result	revid:shivji.jha@stripped
@@ -522,6 +522,10 @@ The following options may be given as th
  --performance-schema 
  Enable the performance schema.
  (Defaults to on; use --skip-performance-schema to disable.)
+ --performance-schema[=name] 
+ Enable or disable PERFORMANCE_SCHEMA plugin. Possible
+ values are ON, OFF, FORCE (don't start if the plugin
+ fails to load).
  --performance-schema-accounts-size=# 
  Maximum number of instrumented user@host accounts. Use 0
  to disable, -1 for automated sizing.
@@ -1150,6 +1154,7 @@ optimizer-trace-limit 1
 optimizer-trace-max-mem-size 16384
 optimizer-trace-offset -1
 performance-schema TRUE
+performance-schema ON
 performance-schema-accounts-size -1
 performance-schema-consumer-events-stages-current FALSE
 performance-schema-consumer-events-stages-history FALSE

=== modified file 'mysql-test/suite/perfschema/t/ddl_replication_execute_status_by_worker-slave.opt'
--- a/mysql-test/suite/perfschema/t/ddl_replication_execute_status_by_worker-slave.opt	revid:shivji.jha@stripped
+++ b/mysql-test/suite/perfschema/t/ddl_replication_execute_status_by_worker-slave.opt	revid:shivji.jha@stripped
@@ -1 +1 @@
---slave-transaction-retries=0
+--force-restart --slave-transaction-retries=0

=== modified file 'mysql-test/suite/perfschema/t/dml_replication_execute_status_by_worker-slave.opt'
--- a/mysql-test/suite/perfschema/t/dml_replication_execute_status_by_worker-slave.opt	revid:shivji.jha@stripped
+++ b/mysql-test/suite/perfschema/t/dml_replication_execute_status_by_worker-slave.opt	revid:shivji.jha@stripped
@@ -1 +1 @@
---slave-transaction-retries=0
+--force-restart --slave-transaction-retries=0

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_connect_config.result	revid:shivji.jha@stripped
@@ -4,6 +4,7 @@ Note	####	Sending passwords in plain tex
 Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 [connection master]
 call mtr.add_suppression("Master command COM_REGISTER_SLAVE failed.");
+include/assert.inc [On master, the table should return an empty set.]
 
 # Verify that SELECT works for every field and produces an output
 # similar to the corresponding field in SHOW SLAVE STATUS(SSS).

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_connect_status.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_connect_status.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_connect_status.result	revid:shivji.jha@stripped
@@ -3,6 +3,7 @@ Warnings:
 Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
 Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 [connection master]
+include/assert.inc [On master, the table should return an empty set.]
 
 # Verify that SELECT works for every field and produces an output similar
 # to the corresponding field in SHOW SLAVE STATUS(SSS). For thread_id

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_execute_config.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_execute_config.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_execute_config.result	revid:shivji.jha@stripped
@@ -3,6 +3,7 @@ Warnings:
 Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
 Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 [connection master]
+include/assert.inc [On master, the table should return an empty set.]
 
 # Verify that SELECT works and produces an output similar to
 # the corresponding field in SHOW SLAVE STATUS(SSS) in all scenarios.

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_execute_status.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_execute_status.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_execute_status.result	revid:shivji.jha@stripped
@@ -3,6 +3,7 @@ Warnings:
 Note	####	Sending passwords in plain text without SSL/TLS is extremely insecure.
 Note	####	Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information.
 [connection master]
+include/assert.inc [On master, the table should return an empty set.]
 
 # Verify that SELECT works and produces an output similar to
 # the corresponding field in SHOW SLAVE STATUS(SSS) in all scenarios.

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_coordinator.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_coordinator.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_coordinator.result	revid:shivji.jha@stripped
@@ -5,6 +5,7 @@ Note	####	Storing MySQL user name or pas
 [connection master]
 call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query.");
 call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*");
+include/assert.inc [On master, the table should return an empty set.]
 
 # Testing on fresh slave.
 

=== modified file 'mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_worker.result'
--- a/mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_worker.result	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/r/rpl_perfschema_execute_status_by_worker.result	revid:shivji.jha@stripped
@@ -6,9 +6,11 @@ Note	####	Storing MySQL user name or pas
 call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query.");
 call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
 call mtr.add_suppression("Request to stop slave SQL Thread received while applying a group that has non-transactional changes;");
+include/assert.inc [On master, the table should return an empty set.]
 
 # Setup MTS and performa testing on a fresh slave.
 
+include/assert.inc [In non-MTS mode(SQL thread), the table should return an empty set.]
 include/stop_slave.inc
 SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
 SET @@global.slave_parallel_workers=1;

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_connect_config.test	revid:shivji.jha@stripped
@@ -40,6 +40,10 @@ source include/have_binlog_format_mixed.
 
 call mtr.add_suppression("Master command COM_REGISTER_SLAVE failed.");
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_connection_configuration] = 0;
+source include/assert.inc;
+
 --connection slave
 
 --echo

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_connect_status.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_connect_status.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_connect_status.test	revid:shivji.jha@stripped
@@ -39,6 +39,10 @@ source include/master-slave.inc;
 source include/have_ssl_communication.inc;
 source include/have_binlog_format_mixed.inc;
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_connection_status] = 0;
+source include/assert.inc;
+
 --connection slave
 
 --echo

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_execute_config.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_execute_config.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_execute_config.test	revid:shivji.jha@stripped
@@ -26,6 +26,10 @@
 source include/master-slave.inc;
 source include/have_binlog_format_mixed.inc;
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_execute_configuration] = 0;
+source include/assert.inc;
+
 --connection slave
 
 --echo

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_execute_status.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_execute_status.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_execute_status.test	revid:shivji.jha@stripped
@@ -24,6 +24,10 @@
 source include/master-slave.inc;
 source include/have_binlog_format_mixed.inc;
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_execute_status] = 0;
+source include/assert.inc;
+
 --connection slave
 
 --echo

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_coordinator.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_coordinator.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_coordinator.test	revid:shivji.jha@stripped
@@ -51,6 +51,10 @@ source include/have_binlog_format_mixed.
 call mtr.add_suppression("Error 'Table 'test.t' doesn't exist' on query.");
 call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.*");
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_execute_status_by_coordinator] = 0;
+source include/assert.inc;
+
 --connection slave
 
 --echo

=== modified file 'mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_worker.test'
--- a/mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_worker.test	revid:shivji.jha@stripped
+++ b/mysql-test/suite/rpl/t/rpl_perfschema_execute_status_by_worker.test	revid:shivji.jha@stripped
@@ -43,11 +43,20 @@ call mtr.add_suppression("Error 'Table '
 call mtr.add_suppression("The slave coordinator and worker threads are stopped, possibly leaving data in inconsistent state.");
 call mtr.add_suppression("Request to stop slave SQL Thread received while applying a group that has non-transactional changes;");
 
+let $assert_text= On master, the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_execute_status_by_worker] = 0;
+source include/assert.inc;
+
 --echo
 --echo # Setup MTS and performa testing on a fresh slave.
 --echo
 
 --connection slave
+
+let $assert_text= In non-MTS mode(SQL thread), the table should return an empty set.;
+let $assert_cond= [select count(*) from performance_schema.replication_execute_status_by_worker] = 0;
+source include/assert.inc;
+
 source include/stop_slave.inc;
 SET @save.slave_parallel_workers=@@global.slave_parallel_workers;
 SET @@global.slave_parallel_workers=1;

=== modified file 'sql/rpl_rli_pdb.cc'
--- a/sql/rpl_rli_pdb.cc	revid:shivji.jha@stripped
+++ b/sql/rpl_rli_pdb.cc	revid:shivji.jha@stripped
@@ -1502,14 +1502,14 @@ void Slave_worker::do_report(loglevel le
 
   va_list args_copy;
   /*
-  The argument 'va_list args' is used twice.
-  1) Error reporting by the coordinator.
-  2) Error reporting by the worker that errored out.
-  C does not allow using the same va_list twice without making a copy.
-  Hence the use of va_copy().
-  Since va_copy() macro is not defined in windows vrsions, added an explicit
-  definition for the same.
-    */
+    The argument 'va_list args' is used twice.
+    1) Error reporting by the coordinator.
+    2) Error reporting by the worker that errored out.
+    C does not allow using the same va_list twice without making a copy.
+    Hence the use of va_copy().
+    Since va_copy() macro is not defined in windows vrsions, added an explicit
+    definition for the same.
+  */
   #ifndef va_copy
   #define va_copy(dst, src) memcpy(&(dst), &(src), sizeof(va_list))
   #endif

=== modified file 'storage/perfschema/table_replication_connection_configuration.cc'
--- a/storage/perfschema/table_replication_connection_configuration.cc	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_connection_configuration.cc	revid:shivji.jha@stripped
@@ -131,7 +131,7 @@ table_replication_connection_configurati
   &table_replication_connection_configuration::create,
   NULL, /* write_row */
   NULL, /* delete_all_rows */
-  NULL, /* get_row_count */
+  table_replication_connection_configuration::get_row_count,
   1, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
@@ -161,8 +161,25 @@ void table_replication_connection_config
   m_next_pos.m_index= 0;
 }
 
+ha_rows table_replication_connection_configuration::get_row_count()
+{
+  uint row_count= 0;
+  mysql_mutex_lock(&LOCK_active_mi);
+
+  DBUG_ASSERT(active_mi != NULL);
+
+  if(active_mi->host[0])
+    row_count= 1;
+
+  mysql_mutex_unlock(&LOCK_active_mi);
+  return row_count;
+}
+
 int table_replication_connection_configuration::rnd_next(void)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   m_pos.set_at(&m_next_pos);
 
   if (m_pos.m_index == 0)
@@ -177,6 +194,9 @@ int table_replication_connection_configu
 
 int table_replication_connection_configuration::rnd_pos(const void *pos)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   set_position(pos);
 
   DBUG_ASSERT(m_pos.m_index < 1);
@@ -195,7 +215,6 @@ void table_replication_connection_config
   mysql_mutex_lock(&LOCK_active_mi);
 
   DBUG_ASSERT(active_mi != NULL);
-  DBUG_ASSERT(active_mi->rli != NULL);
 
   mysql_mutex_lock(&active_mi->data_lock);
   mysql_mutex_lock(&active_mi->rli->data_lock);

=== modified file 'storage/perfschema/table_replication_connection_configuration.h'
--- a/storage/perfschema/table_replication_connection_configuration.h	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_connection_configuration.h	revid:shivji.jha@stripped
@@ -122,7 +122,7 @@ public:
   /** Table share. */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
-
+  static ha_rows get_row_count();
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
   virtual void reset_position(void);

=== modified file 'storage/perfschema/table_replication_connection_status.cc'
--- a/storage/perfschema/table_replication_connection_status.cc	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_connection_status.cc	revid:shivji.jha@stripped
@@ -87,7 +87,7 @@ table_replication_connection_status::m_s
   &table_replication_connection_status::create,
   NULL, /* write_row */
   NULL, /* delete_all_rows */
-  NULL, /* get_row_count */
+  table_replication_connection_status::get_row_count,
   1, /* records */
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
@@ -114,8 +114,26 @@ void table_replication_connection_status
   m_next_pos.m_index= 0;
 }
 
+ha_rows table_replication_connection_status::get_row_count()
+{
+  uint row_count= 0;
+  mysql_mutex_lock(&LOCK_active_mi);
+
+  DBUG_ASSERT(active_mi != NULL);
+  DBUG_ASSERT(active_mi->rli != NULL);
+
+  if(active_mi->host[0])
+    row_count= 1;
+
+  mysql_mutex_unlock(&LOCK_active_mi);
+  return row_count;
+}
+
 int table_replication_connection_status::rnd_next(void)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   m_pos.set_at(&m_next_pos);
 
   if (m_pos.m_index == 0)
@@ -130,6 +148,9 @@ int table_replication_connection_status:
 
 int table_replication_connection_status::rnd_pos(const void *pos)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   set_position(pos);
 
   DBUG_ASSERT(m_pos.m_index < 1);

=== modified file 'storage/perfschema/table_replication_connection_status.h'
--- a/storage/perfschema/table_replication_connection_status.h	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_connection_status.h	revid:shivji.jha@stripped
@@ -106,7 +106,7 @@ public:
   /** Table share. */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
-
+  static ha_rows get_row_count();
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
   virtual void reset_position(void);

=== modified file 'storage/perfschema/table_replication_execute_configuration.cc'
--- a/storage/perfschema/table_replication_execute_configuration.cc	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_configuration.cc	revid:shivji.jha@stripped
@@ -58,7 +58,7 @@ table_replication_execute_configuration:
   &table_replication_execute_configuration::create,
   NULL, /* write_row */
   NULL, /* delete_all_rows */
-  NULL,
+  table_replication_execute_configuration::get_row_count,
   1,
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
@@ -87,9 +87,27 @@ void table_replication_execute_configura
   m_next_pos.m_index= 0;
 }
 
+ha_rows table_replication_execute_configuration::get_row_count()
+{
+  uint row_count= 0;
+  mysql_mutex_lock(&LOCK_active_mi);
+
+  DBUG_ASSERT(active_mi != NULL);
+  DBUG_ASSERT(active_mi->rli != NULL);
+
+  if(active_mi->host[0])
+    row_count= 1;
+
+  mysql_mutex_unlock(&LOCK_active_mi);
+  return row_count;
+}
+
 int table_replication_execute_configuration::rnd_next(void)
 {
-  m_pos.set_at(& m_next_pos);
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
+  m_pos.set_at(&m_next_pos);
 
   if (m_pos.m_index == 0)
   {
@@ -103,6 +121,9 @@ int table_replication_execute_configurat
 
 int table_replication_execute_configuration::rnd_pos(const void *pos)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   set_position(pos);
 
   DBUG_ASSERT(m_pos.m_index < 1);

=== modified file 'storage/perfschema/table_replication_execute_configuration.h'
--- a/storage/perfschema/table_replication_execute_configuration.h	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_configuration.h	revid:shivji.jha@stripped
@@ -80,7 +80,7 @@ public:
   /** Table share. */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
-
+  static ha_rows get_row_count();
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
   virtual void reset_position(void);

=== modified file 'storage/perfschema/table_replication_execute_status.cc'
--- a/storage/perfschema/table_replication_execute_status.cc	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_status.cc	revid:shivji.jha@stripped
@@ -63,7 +63,7 @@ table_replication_execute_status::m_shar
   &table_replication_execute_status::create,
   NULL, /* write_row */
   NULL, /* delete_all_rows */
-  NULL,
+  table_replication_execute_status::get_row_count,
   1,
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
@@ -91,8 +91,26 @@ void table_replication_execute_status::r
   m_next_pos.m_index= 0;
 }
 
+ha_rows table_replication_execute_status::get_row_count()
+{
+  uint row_count= 0;
+  mysql_mutex_lock(&LOCK_active_mi);
+
+  DBUG_ASSERT(active_mi != NULL);
+  DBUG_ASSERT(active_mi->rli != NULL);
+
+  if(active_mi->host[0])
+    row_count= 1;
+
+  mysql_mutex_unlock(&LOCK_active_mi);
+  return row_count;
+}
+
 int table_replication_execute_status::rnd_next(void)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   m_pos.set_at(&m_next_pos);
 
   if (m_pos.m_index == 0)
@@ -108,6 +126,9 @@ int table_replication_execute_status::rn
 
 int table_replication_execute_status::rnd_pos(const void *pos)
 {
+ if(get_row_count() == 0)
+  return HA_ERR_END_OF_FILE;
+
   set_position(pos);
 
   DBUG_ASSERT(m_pos.m_index < 1);

=== modified file 'storage/perfschema/table_replication_execute_status.h'
--- a/storage/perfschema/table_replication_execute_status.h	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_status.h	revid:shivji.jha@stripped
@@ -90,7 +90,7 @@ public:
   /** Table share. */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
-
+  static ha_rows get_row_count();
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
   virtual void reset_position(void);

=== modified file 'storage/perfschema/table_replication_execute_status_by_coordinator.cc'
--- a/storage/perfschema/table_replication_execute_status_by_coordinator.cc	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_status_by_coordinator.cc	revid:shivji.jha@stripped
@@ -78,7 +78,7 @@ table_replication_execute_status_by_coor
   &table_replication_execute_status_by_coordinator::create,
   NULL, /* write_row */
   NULL, /* delete_all_rows */
-  NULL,
+  table_replication_execute_status_by_coordinator::get_row_count,
   1,
   sizeof(PFS_simple_index), /* ref length */
   &m_table_lock,
@@ -107,8 +107,26 @@ void table_replication_execute_status_by
   m_next_pos.m_index= 0;
 }
 
+ha_rows table_replication_execute_status_by_coordinator::get_row_count()
+{
+  uint row_count= 0;
+  mysql_mutex_lock(&LOCK_active_mi);
+
+  DBUG_ASSERT(active_mi != NULL);
+  DBUG_ASSERT(active_mi->rli != NULL);
+
+  if(active_mi->host[0])
+    row_count= 1;
+
+  mysql_mutex_unlock(&LOCK_active_mi);
+  return row_count;
+}
+
 int table_replication_execute_status_by_coordinator::rnd_next(void)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   m_pos.set_at(&m_next_pos);
 
   if (m_pos.m_index == 0)
@@ -123,6 +141,9 @@ int table_replication_execute_status_by_
 
 int table_replication_execute_status_by_coordinator::rnd_pos(const void *pos)
 {
+  if(get_row_count() == 0)
+    return HA_ERR_END_OF_FILE;
+
   set_position(pos);
 
   DBUG_ASSERT(m_pos.m_index < 1);

=== modified file 'storage/perfschema/table_replication_execute_status_by_coordinator.h'
--- a/storage/perfschema/table_replication_execute_status_by_coordinator.h	revid:shivji.jha@stripped
+++ b/storage/perfschema/table_replication_execute_status_by_coordinator.h	revid:shivji.jha@stripped
@@ -97,7 +97,7 @@ public:
   /** Table share. */
   static PFS_engine_table_share m_share;
   static PFS_engine_table* create();
-
+  static ha_rows get_row_count();
   virtual int rnd_next();
   virtual int rnd_pos(const void *pos);
   virtual void reset_position(void);

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl3656 branch (shivji.jha:5507 to 5508) WL#3656Shivji Kumar Jha20 Aug