summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2011-06-13 11:09:56 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2011-06-13 11:09:56 +0200
commit8f3bb95a4322c6ca84bfaed52e97950c750fa00d (patch)
treef89c82d6f164a551c0e9598626b10b63876f6d12 /sql
parentba6d3a5cd6bd2fe0ffbd94fe9f2e9a9607f5730a (diff)
parentf726c207226805feecbc650bd3f52f607530c844 (diff)
downloadmariadb-git-8f3bb95a4322c6ca84bfaed52e97950c750fa00d.tar.gz
merge
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index b5363f8235c..2cfda663b40 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3407,15 +3407,19 @@ int ha_partition::update_row(const uchar *old_data, uchar *new_data)
exit:
/*
- if updating an auto_increment column, update
+ If updating an auto_increment column, update
table_share->ha_data->next_auto_inc_val if needed.
(not to be used if auto_increment on secondary field in a multi-column
index)
mysql_update does not set table->next_number_field, so we use
table->found_next_number_field instead.
+ Also checking that the field is marked in the write set.
*/
- if (table->found_next_number_field && new_data == table->record[0] &&
- !table->s->next_number_keypart)
+ if (table->found_next_number_field &&
+ new_data == table->record[0] &&
+ !table->s->next_number_keypart &&
+ bitmap_is_set(table->write_set,
+ table->found_next_number_field->field_index))
{
HA_DATA_PARTITION *ha_data= (HA_DATA_PARTITION*) table_share->ha_data;
if (!ha_data->auto_inc_initialized)
@@ -3978,6 +3982,7 @@ void ha_partition::position(const uchar *record)
void ha_partition::column_bitmaps_signal()
{
handler::column_bitmaps_signal();
+ /* Must read all partition fields to make position() call possible */
bitmap_union(table->read_set, &m_part_info->full_part_field_set);
}