summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-09-16 11:01:06 +0200
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-09-16 11:01:06 +0200
commit428f0bdefbf866f0a9939e4153393b1e4b8a1a82 (patch)
tree77b5042328e516b32ec7c1ec3ca46d62c33ceaf0 /sql
parentd695cc864c54222d446ccd50662d8d3ea6cfee60 (diff)
downloadmariadb-git-428f0bdefbf866f0a9939e4153393b1e4b8a1a82.tar.gz
Bug#56287: mysql5.1.50 crash when using Partition datetime in sub in query
When having a sub query in partitioned innodb one could make the partitioning engine to search for a 'index_next_same' on a partition that had not been initialized. Problem was that the subselect function looks at table->status which was not set in the partitioning handler when it skipped scanning due to no matching partitions found. Fixed by setting table->status = STATUS_NOT_FOUND when there was no partitions to scan. (If there are partitions to scan, it will be set in the partitions handler.) mysql-test/r/partition_innodb.result: added result mysql-test/t/partition_innodb.test: added test sql/ha_partition.cc: set table status to not found, if there ar no partitions to scan.
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_partition.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 624ef1aff5b..d3846db42c2 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -4483,6 +4483,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
key not found.
*/
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (m_part_spec.start_part == m_part_spec.end_part)
@@ -4507,6 +4508,7 @@ int ha_partition::partition_scan_set_up(uchar * buf, bool idx_read_flag)
if (start_part == MY_BIT_NONE)
{
DBUG_PRINT("info", ("scan with no partition to scan"));
+ table->status= STATUS_NOT_FOUND;
DBUG_RETURN(HA_ERR_END_OF_FILE);
}
if (start_part > m_part_spec.start_part)