diff options
author | unknown <svoj@june.mysql.com> | 2007-10-01 14:23:16 +0500 |
---|---|---|
committer | unknown <svoj@june.mysql.com> | 2007-10-01 14:23:16 +0500 |
commit | 82e6e6fb665e8f1c6d60559ebed0c9ecf115fecd (patch) | |
tree | cfaaa96a7906a5b231f4b40dc7f80561ff5e7658 /sql/ha_partition.cc | |
parent | f0266eae8eaf9ce0247e2919c69835bf8fb151fc (diff) | |
parent | fc7a9058f1759fbc574ee1eefb4b892da49a1afb (diff) | |
download | mariadb-git-82e6e6fb665e8f1c6d60559ebed0c9ecf115fecd.tar.gz |
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into mysql.com:/home/svoj/devel/mysql/BUG30583/mysql-5.1-engines
sql/ha_partition.cc:
Auto merged
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index ac105855c02..1ea3bb34514 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3381,6 +3381,22 @@ 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) + { + /* + 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). + + TODO: handle COUNT(*) queries via unordered scan. + */ + uint i; + for (i= 0; i < m_curr_key_info->key_parts; i++) + bitmap_set_bit(table->read_set, + m_curr_key_info->key_part[i].field->field_index); + } file= m_file; do { |