Skip to content

Commit 3ba867b

Browse files
committed
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.
1 parent 1adc3fa commit 3ba867b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

sql/sql_window.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,15 +647,15 @@ class Table_read_cursor : public Rowid_seq_cursor
647647
end, and it needs an explicit command to move to the next partition.
648648
*/
649649

650-
class Partition_read_cursor
650+
class Partition_read_cursor : public Table_read_cursor
651651
{
652652
public:
653653
Partition_read_cursor(THD *thd, SQL_I_List<ORDER> *partition_list) :
654654
bound_tracker(thd, partition_list) {}
655655

656656
void init(READ_RECORD *info)
657657
{
658-
tbl_cursor.init(info);
658+
Table_read_cursor::init(info);
659659
bound_tracker.init();
660660
end_of_partition= false;
661661
}
@@ -676,7 +676,7 @@ class Partition_read_cursor
676676
/*
677677
Moves to a new row. The row is assumed to be within the current partition.
678678
*/
679-
void move_to(ha_rows rownum) { tbl_cursor.move_to(rownum); }
679+
void move_to(ha_rows rownum) { Table_read_cursor::move_to(rownum); }
680680

681681
/*
682682
This returns -1 when end of partition was reached.
@@ -686,7 +686,7 @@ class Partition_read_cursor
686686
int res;
687687
if (end_of_partition)
688688
return -1;
689-
if ((res= tbl_cursor.get_next()))
689+
if ((res= Table_read_cursor::get_next()))
690690
return res;
691691

692692
if (bound_tracker.compare_with_cache())
@@ -699,11 +699,10 @@ class Partition_read_cursor
699699

700700
bool restore_last_row()
701701
{
702-
return tbl_cursor.restore_last_row();
702+
return Table_read_cursor::restore_last_row();
703703
}
704704

705705
private:
706-
Table_read_cursor tbl_cursor;
707706
Group_bound_tracker bound_tracker;
708707
bool end_of_partition;
709708
};

0 commit comments

Comments
 (0)