diff options
author | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-07-09 15:00:33 +0200 |
---|---|---|
committer | Mattias Jonsson <mattias.jonsson@oracle.com> | 2010-07-09 15:00:33 +0200 |
commit | 6433a5535662753aedd95759000cd354dd8e3fba (patch) | |
tree | 9b2a8e30b98b39405615175426bb02e5b0c91cb7 | |
parent | 70e490430fad8e11433ecbe3297161e5e11c1e52 (diff) | |
parent | 9414aee2259a9a52c0d104a9b7bdafeaca1ad50f (diff) | |
download | mariadb-git-6433a5535662753aedd95759000cd354dd8e3fba.tar.gz |
merge
-rw-r--r-- | sql/ha_partition.h | 6 | ||||
-rw-r--r-- | sql/handler.h | 18 |
2 files changed, 14 insertions, 10 deletions
diff --git a/sql/ha_partition.h b/sql/ha_partition.h index d8872d37a09..e3dc7d17c6d 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -53,8 +53,7 @@ typedef struct st_ha_data_partition HA_CAN_FULLTEXT | \ HA_DUPLICATE_POS | \ HA_CAN_SQL_HANDLER | \ - HA_CAN_INSERT_DELAYED | \ - HA_PRIMARY_KEY_REQUIRED_FOR_POSITION) + HA_CAN_INSERT_DELAYED) class ha_partition :public handler { private: @@ -775,9 +774,6 @@ public: HA_PRIMARY_KEY_REQUIRED_FOR_POSITION: Does the storage engine need a PK for position? - Used with hidden primary key in InnoDB. - Hidden primary keys cannot be supported by partitioning, since the - partitioning expressions columns must be a part of the primary key. (InnoDB) HA_FILE_BASED is always set for partition handler since we use a diff --git a/sql/handler.h b/sql/handler.h index aa74ca19468..dabc179079a 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -93,7 +93,10 @@ #define HA_PRIMARY_KEY_IN_READ_INDEX (1 << 15) /* If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, it means that to position() - uses a primary key. Without primary key, we can't call position(). + uses a primary key given by the record argument. + Without primary key, we can't call position(). + If not set, the position is returned as the current rows position + regardless of what argument is given. */ #define HA_PRIMARY_KEY_REQUIRED_FOR_POSITION (1 << 16) #define HA_CAN_RTREEKEYS (1 << 17) @@ -1446,10 +1449,9 @@ public: virtual int rnd_next(uchar *buf)=0; virtual int rnd_pos(uchar * buf, uchar *pos)=0; /** - One has to use this method when to find - random position by record as the plain - position() call doesn't work for some - handlers for random position. + This function only works for handlers having + HA_PRIMARY_KEY_REQUIRED_FOR_POSITION set. + It will return the row with the PK given in the record argument. */ virtual int rnd_pos_by_record(uchar *record) { @@ -1467,6 +1469,12 @@ public: { return HA_ERR_WRONG_COMMAND; } virtual ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key) { return (ha_rows) 10; } + /* + If HA_PRIMARY_KEY_REQUIRED_FOR_POSITION is set, then it sets ref + (reference to the row, aka position, with the primary key given in + the record). + Otherwise it set ref to the current row. + */ virtual void position(const uchar *record)=0; virtual int info(uint)=0; // see my_base.h for full description virtual void get_dynamic_partition_info(PARTITION_INFO *stat_info, |