summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSatya B <satya.bn@sun.com>2009-08-06 17:01:26 +0530
committerSatya B <satya.bn@sun.com>2009-08-06 17:01:26 +0530
commitd933cb1669141c87632fddca25baf8aca3bb06ba (patch)
tree404a6846b3d04bc82adf9c5127b6aee99f403dbf /sql
parent70cd97722d3f9cf8e2e6f3def2ac7f63cf55c5eb (diff)
downloadmariadb-git-d933cb1669141c87632fddca25baf8aca3bb06ba.tar.gz
Fix for BUG#45816 - assertion failure with index containing double
column on partitioned table An assertion 'ASSERT_COULUMN_MARKED_FOR_READ' is failed if the query is executed with index containing double column on partitioned table. The problem is that assertion expects all the fields which are read, to be in the read_set. In this query only the field 'a' is in the readset as the tables in the query are joined by the field 'a' and so the assertion fails expecting other field 'b'. Since the function cmp() is just comparison of two parameters passed, the assertion is not required. Fixed by removing the assertion in the double fields comparision function and also fixed the index initialization to do ordered index scan with RW LOCK which ensures all the fields from a key are in the read_set. Note: this bug is not reproducible with other datatypes because the assertion doesn't exist in comparision function for other datatypes. mysql-test/r/partition.result: Testcase for BUG#45816 mysql-test/t/partition.test: Testcase for BUG#45816 sql/field.cc: Removed the assertion ASSERT_COLUMN_MARED_FOR_READ in Field_double::cmp() function sql/ha_partition.cc: Fixed index_int() method to make it initialize the read_set properly if ordered index scan with RW lock is requested.
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc1
-rw-r--r--sql/ha_partition.cc2
2 files changed, 1 insertions, 2 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 452dfc3ae55..3bfb54fbd15 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -4598,7 +4598,6 @@ bool Field_double::send_binary(Protocol *protocol)
int Field_double::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
- ASSERT_COLUMN_MARKED_FOR_READ;
double a,b;
#ifdef WORDS_BIGENDIAN
if (table->s->db_low_byte_first)
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc
index 562716a7db7..b345648260c 100644
--- a/sql/ha_partition.cc
+++ b/sql/ha_partition.cc
@@ -3730,7 +3730,7 @@ 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)
+ if (sorted)
{
/*
An ordered scan is requested. We must make sure all fields of the