[Commits] 18107a5: Convert Partition_read_cursor to inherit from Table_read_cursor

vicentiu vicentiu at mariadb.org
Wed Sep 7 22:38:54 EEST 2016


revision-id: 18107a59dd82823b10df05671b5a4584ffd0acc2 (mariadb-10.2.1-23-g18107a5)
parent(s): b03d3dddf48dcc888c62fb13476f419d2bf05fb2
author: Vicențiu Ciorbaru
committer: Vicențiu Ciorbaru
timestamp: 2016-09-07 21:35:56 +0300
message:

Convert Partition_read_cursor to inherit from Table_read_cursor

The 'IS A' relation is more appropriate for Partition_read_cursor. This
also helps with accessing methods available only to Table_read_cursor.

---
 sql/sql_window.cc | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sql/sql_window.cc b/sql/sql_window.cc
index 7dec391..c970b13 100644
--- a/sql/sql_window.cc
+++ b/sql/sql_window.cc
@@ -647,7 +647,7 @@ class Table_read_cursor : public Rowid_seq_cursor
   end, and it needs an explicit command to move to the next partition.
 */
 
-class Partition_read_cursor
+class Partition_read_cursor : public Table_read_cursor
 {
 public:
   Partition_read_cursor(THD *thd, SQL_I_List<ORDER> *partition_list) :
@@ -655,7 +655,7 @@ class Partition_read_cursor
 
   void init(READ_RECORD *info)
   {
-    tbl_cursor.init(info);
+    Table_read_cursor::init(info);
     bound_tracker.init();
     end_of_partition= false;
   }
@@ -676,7 +676,7 @@ class Partition_read_cursor
   /*
     Moves to a new row. The row is assumed to be within the current partition.
   */
-  void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); }
+  void move_to(ha_rows rownum) { Table_read_cursor::move_to(rownum); }
 
   /*
     This returns -1 when end of partition was reached.
@@ -686,7 +686,7 @@ class Partition_read_cursor
     int res;
     if (end_of_partition)
       return -1;
-    if ((res= tbl_cursor.get_next()))
+    if ((res= Table_read_cursor::get_next()))
       return res;
 
     if (bound_tracker.compare_with_cache())
@@ -699,11 +699,10 @@ class Partition_read_cursor
 
   bool restore_last_row()
   {
-    return tbl_cursor.restore_last_row();
+    return Table_read_cursor::restore_last_row();
   }
 
 private:
-  Table_read_cursor tbl_cursor;
   Group_bound_tracker bound_tracker;
   bool end_of_partition;
 };


More information about the commits mailing list