summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2005-12-26 14:56:15 +0300
committerunknown <sergefp@mysql.com>2005-12-26 14:56:15 +0300
commite6cf611fe2382e2b2679dcbc7fca20f3e718c4d2 (patch)
tree3a28c9b3bd246795cf59f2badf4b64058cbad745 /sql/handler.h
parent66f962d808111c63e4aa03371b5520beb72c3a73 (diff)
parentb3abc9773e9944fb8b0c70c63ff2a6b1d4210366 (diff)
downloadmariadb-git-e6cf611fe2382e2b2679dcbc7fca20f3e718c4d2.tar.gz
Merge newbox:mysql-5.1-ppruning-r4
into pylon.mylan:/home/psergey/mysql-5.1-26dec-merge sql/ha_ndbcluster.cc: Auto merged sql/ha_partition.cc: Auto merged sql/item.h: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_partition.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged sql/handler.h: Merge
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 27b3ed3fab1..eff4ecdc4d2 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -547,19 +547,52 @@ public:
List<char> part_field_list;
List<char> subpart_field_list;
-
+
+ /*
+ If there is no subpartitioning, use only this func to get partition ids.
+ If there is subpartitioning, use the this func to get partition id when
+ you have both partition and subpartition fields.
+ */
get_part_id_func get_partition_id;
+
+ /* Get partition id when we don't have subpartition fields */
get_part_id_func get_part_partition_id;
- get_subpart_id_func get_subpartition_id;
+ /*
+ Get subpartition id when we have don't have partition fields by we do
+ have subpartition ids.
+ Mikael said that for given constant tuple
+ {subpart_field1, ..., subpart_fieldN} the subpartition id will be the
+ same in all subpartitions
+ */
+ get_subpart_id_func get_subpartition_id;
+
+ /* NULL-terminated list of fields used in partitioned expression */
Field **part_field_array;
+ /* NULL-terminated list of fields used in subpartitioned expression */
Field **subpart_field_array;
+
+ /*
+ Array of all fields used in partition and subpartition expression,
+ without duplicates, NULL-terminated.
+ */
Field **full_part_field_array;
Item *part_expr;
Item *subpart_expr;
Item *item_free_list;
+
+ /*
+ A bitmap of partitions used by the current query.
+ Usage pattern:
+ * It is guaranteed that all partitions are set to be unused on query start.
+ * Before index/rnd_init(), partition pruning code sets the bits for used
+ partitions.
+ * The handler->extra(HA_EXTRA_RESET) call at query end sets all partitions
+ to be unused.
+ */
+ MY_BITMAP used_partitions;
union {
longlong *range_int_array;
@@ -760,6 +793,13 @@ void get_full_part_id_from_key(const TABLE *table, byte *buf,
bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
uint part_info_len, TABLE *table,
handlerton *default_db_type);
+void make_used_partitions_str(partition_info *part_info, String *parts_str);
+uint32 get_list_array_idx_for_endpoint(partition_info *part_info,
+ bool left_endpoint,
+ bool include_endpoint);
+uint32 get_partition_id_range_for_endpoint(partition_info *part_info,
+ bool left_endpoint,
+ bool include_endpoint);
#endif