diff options
author | unknown <mattiasj@witty.> | 2007-12-03 16:12:25 +0100 |
---|---|---|
committer | unknown <mattiasj@witty.> | 2007-12-03 16:12:25 +0100 |
commit | c8969f71565e323022f9013f1ff066304cf84987 (patch) | |
tree | 09c984b42ad4997d7581f0a136fb9f34eb1e4d4e /sql/ha_partition.cc | |
parent | 6257e283b7b2187d27e4c80d5f97fc28213237af (diff) | |
download | mariadb-git-c8969f71565e323022f9013f1ff066304cf84987.tar.gz |
Bug#30480: Falcon: searches fail if LIKE and key partition
(also fixes the bugs: Bug#29320, Bug#29493 and Bug#30536)
Problem: Partitioning did not handle unordered scans correctly
for engines with unordered read order.
Solution: do not stop scanning fi a recored is out of range, since
there can be more records within the range afterwards.
Note: this is the patch that fixes the bug, but since there are no
storage engines shipped with mysql 5.1 (falcon comes in 6.0) there
are no test cases (it is a separate patch that only goes into 6.0)
sql/ha_partition.cc:
Bug#30480: Falcon: searches fail if LIKE and key partition
Problem was that partitioning did not handle unordered scans correctly
for engines with unordered read order.
Solution: do not stop if a recored is out of range, since it can come
more records within the range afterwards
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 1400d9da753..5abdf873c81 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -3983,7 +3983,8 @@ int ha_partition::handle_unordered_next(uchar *buf, bool is_next_same) } else if (!(error= file->index_next(buf))) { - if (compare_key(end_range) <= 0) + if (!(file->table_flags() & HA_READ_ORDER) || + compare_key(end_range) <= 0) { m_last_part= m_part_spec.start_part; DBUG_RETURN(0); // Row was in range @@ -4060,7 +4061,8 @@ int ha_partition::handle_unordered_scan_next_partition(uchar * buf) } if (!error) { - if (compare_key(end_range) <= 0) + if (!(file->table_flags() & HA_READ_ORDER) || + compare_key(end_range) <= 0) { m_last_part= i; DBUG_RETURN(0); |