diff options
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 95eae4378c3..3f1634a6ad1 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1606,7 +1606,11 @@ error: void ha_partition::update_create_info(HA_CREATE_INFO *create_info) { - m_file[0]->update_create_info(create_info); + info(HA_STATUS_AUTO); + + if (!(create_info->used_fields & HA_CREATE_USED_AUTO)) + create_info->auto_increment_value= stats.auto_increment_value; + create_info->data_file_name= create_info->index_file_name = NULL; return; } @@ -1761,6 +1765,7 @@ partition_element *ha_partition::find_partition_element(uint part_id) return part_elem; } DBUG_ASSERT(0); + my_error(ER_OUT_OF_RESOURCES, MYF(0)); current_thd->fatal_error(); // Abort return NULL; } @@ -3421,14 +3426,17 @@ int ha_partition::index_init(uint inx, bool sorted) */ if (m_lock_type == F_WRLCK) bitmap_union(table->read_set, &m_part_info->full_part_field_set); - else if (sorted && m_table_flags & HA_PARTIAL_COLUMN_READ) + else if (sorted) { /* - An ordered scan is requested and necessary fields aren't in read_set. - This may happen e.g. with SELECT COUNT(*) FROM t1. We must ensure - that all fields of current key are included into read_set, as - partitioning requires them for sorting - (see ha_partition::handle_ordered_index_scan). + An ordered scan is requested. We must make sure all fields of the + used index are in the read set, as partitioning requires them for + sorting (see ha_partition::handle_ordered_index_scan). + + The SQL layer may request an ordered index scan without having index + fields in the read set when + - it needs to do an ordered scan over an index prefix. + - it evaluates ORDER BY with SELECT COUNT(*) FROM t1. TODO: handle COUNT(*) queries via unordered scan. */ |