From: Mattias Jonsson Date: July 9 2010 11:15am Subject: bzr commit into mysql-5.1-bugteam branch (mattias.jonsson:3394) Bug#52517 List-Archive: http://lists.mysql.com/commits/113229 X-Bug: 52517 Message-Id: <201007091117.o69BHV9c014638@rcsinet15.oracle.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8105566693352918850==" --===============8105566693352918850== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///Users/mattiasj/mysql-bzr/b52517-51-bugteam/ based on revid:gshchepa@stripped 3394 Mattias Jonsson 2010-07-09 Bug#52517: Regression in ROW level replication performance with partitions In bug-28430 HA_PRIMARY_KEY_REQUIRED_FOR_POSITION was disabled in the partitioning engine in the first patch, That bug was later fixed a second time, but that flag was not removed. No need to disable this flag, as it leads to bad choise in row replication. @ sql/ha_partition.h Not disabling HA_PRIMARY_KEY_REQUIRED_FOR_POSITION flag. Updated comment (has nothing to do with hidden key. @ sql/handler.h Updated comments to about HA_PRIMARY_KEY_REQUIRED_FOR_POSITION. modified: sql/ha_partition.h sql/handler.h === modified file 'sql/ha_partition.h' --- a/sql/ha_partition.h 2009-11-17 19:02:16 +0000 +++ b/sql/ha_partition.h 2010-07-09 11:15:26 +0000 @@ -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: @@ -766,9 +765,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 === modified file 'sql/handler.h' --- a/sql/handler.h 2010-04-14 09:53:59 +0000 +++ b/sql/handler.h 2010-07-09 11:15:26 +0000 @@ -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, --===============8105566693352918850== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/mattias.jonsson@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: mattias.jonsson@stripped\ # 2hcdoe6rjf30l7yo # target_branch: file:///Users/mattiasj/mysql-bzr/b52517-51-bugteam/ # testament_sha1: 136cd5dc3750e28d71a9148ed5cefa7c81e6ae3c # timestamp: 2010-07-09 13:15:43 +0200 # base_revision_id: gshchepa@stripped # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWYtKynoAAs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