diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2014-07-23 22:48:31 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2014-07-23 22:48:31 +0400 |
commit | 06655a192d7d3216fccc18c1f25601c4ecff09d4 (patch) | |
tree | dc466b9c18ad6e55b2a04fca4671eba283f34c1e /sql/sql_partition.cc | |
parent | 6b353dd1ded71c1abaa4e9c64c152546a44922df (diff) | |
download | mariadb-git-06655a192d7d3216fccc18c1f25601c4ecff09d4.tar.gz |
MDEV-6322: The PARTITION engine can return wrong query results
MySQL Bug#71095: Wrong results with PARTITION BY LIST COLUMNS()
MySQL Bug#72803: Wrong "Impossible where" with LIST partitioning
MDEV-6240: Wrong "Impossible where" with LIST partitioning
- Backprot the fix from MySQL Bug#71095.
Diffstat (limited to 'sql/sql_partition.cc')
-rw-r--r-- | sql/sql_partition.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 357bd8efc27..3eff6ee5cf4 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3261,11 +3261,16 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info, nparts, left_endpoint, include_endpoint))); - if (!left_endpoint) + if (!left_endpoint && list_index < part_info->num_list_values) { - /* Set the end after this list tuple if not already after the last. */ - if (list_index < part_info->num_parts) - list_index++; + /* + Set the end after this list tuple if it is not already after the last + and it matches. ??? + */ + int cmp = cmp_rec_and_tuple_prune(list_col_array + list_index*num_columns, + nparts, left_endpoint, include_endpoint); + if (cmp >= 0) + list_index++; } DBUG_RETURN(list_index); |