summaryrefslogtreecommitdiff
path: root/sql/ha_partition.h
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2014-03-11 16:45:08 +0100
committerSergey Petrunya <psergey@askmonty.org>2014-03-11 16:45:08 +0100
commitcb5b6c7e3902f28bf1108cbf86734e78a1c1336c (patch)
tree35100361bfc7f09cbf71ef3732454fc3c58c573c /sql/ha_partition.h
parent525c00c682bc536757b336ff5f3aee7725a5a852 (diff)
downloadmariadb-git-cb5b6c7e3902f28bf1108cbf86734e78a1c1336c.tar.gz
MDEV-5177: ha_partition and innodb index intersection produce fewer rows (MySQL Bug#70703)
(This is attempt at fix #2) (re-commit with fixed typo) - Moved the testcase from partition_test to partition_innodb.test where it can really work. - Made ordered index scans over ha_partition tables to satisfy ROR property for the case where underlying table uses extended keys.
Diffstat (limited to 'sql/ha_partition.h')
-rw-r--r--sql/ha_partition.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h
index cec377b9e29..e8e3858d076 100644
--- a/sql/ha_partition.h
+++ b/sql/ha_partition.h
@@ -49,6 +49,8 @@ enum partition_keywords
/* offset to the engines array */
#define PAR_ENGINES_OFFSET 12
+extern "C" int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2);
+
class ha_partition :public handler
{
private:
@@ -88,6 +90,22 @@ private:
uchar *m_rec0; // table->record[0]
const uchar *m_err_rec; // record which gave error
QUEUE m_queue; // Prio queue used by sorted read
+
+ /*
+ Length of an element in m_ordered_rec_buffer. The elements are composed of
+
+ [part_no] [table->record copy] [underlying_table_rowid]
+
+ underlying_table_rowid is only stored when the table has no extended keys.
+ */
+ uint m_priority_queue_rec_len;
+
+ /*
+ If true, then sorting records by key value also sorts them by their
+ underlying_table_rowid.
+ */
+ bool m_using_extended_keys;
+
/*
Since the partition handler is a handler on top of other handlers, it
is necessary to keep information about what the underlying handler
@@ -1172,6 +1190,9 @@ public:
DBUG_ASSERT(h == m_file[i]->ht);
return h;
}
+
+
+ friend int cmp_key_rowid_part_id(void *ptr, uchar *ref1, uchar *ref2);
};
#endif /* HA_PARTITION_INCLUDED */