summaryrefslogtreecommitdiff
path: root/sql/partition_info.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@sun.com>2009-08-26 12:59:49 +0200
committerMattias Jonsson <mattias.jonsson@sun.com>2009-08-26 12:59:49 +0200
commit401fb7c6fb84d1fe255fd490a0d3eb6ccb216507 (patch)
tree6186de73376dc384682a6b1c1f575d8e214c8c02 /sql/partition_info.h
parent43851cb81186084f7a144fc0b47db87d3b32c4a6 (diff)
downloadmariadb-git-401fb7c6fb84d1fe255fd490a0d3eb6ccb216507.tar.gz
Bug#20577: Partitions: use of to_days() function leads to selection failures
Problem was that the partition containing NULL values was pruned away, since '2001-01-01' < '2001-02-00' but TO_DAYS('2001-02-00') is NULL. Added the NULL partition for RANGE/LIST partitioning on TO_DAYS() function to be scanned too. Also fixed a bug that added ALLOW_INVALID_DATES to sql_mode (SELECT * FROM t WHERE date_col < '1999-99-99' on a RANGE/LIST partitioned table would add it).
Diffstat (limited to 'sql/partition_info.h')
-rw-r--r--sql/partition_info.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/partition_info.h b/sql/partition_info.h
index 415f955d5d4..8832b6ee409 100644
--- a/sql/partition_info.h
+++ b/sql/partition_info.h
@@ -300,6 +300,7 @@ static inline void init_single_partition_iterator(uint32 part_id,
{
part_iter->part_nums.start= part_iter->part_nums.cur= part_id;
part_iter->part_nums.end= part_id+1;
+ part_iter->ret_null_part= part_iter->ret_null_part_orig= FALSE;
part_iter->get_next= get_next_partition_id_range;
}