summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <ramil/ram@myoffice.izhnet.ru>2006-10-23 10:32:39 +0500
committerunknown <ramil/ram@myoffice.izhnet.ru>2006-10-23 10:32:39 +0500
commite1a142961e0ae2adcea2cfb4d399b93581a8a6eb (patch)
treeada943515dde566ac1e6dd09b5972639f87a622e /sql/opt_range.cc
parentc055efba90fc5a9e0bf15d559f0fd7679dd9be36 (diff)
parent68c2a008a1e5fc305a735cf90bd994230729a68d (diff)
downloadmariadb-git-e1a142961e0ae2adcea2cfb4d399b93581a8a6eb.tar.gz
Merge mysql.com:/usr/home/ram/work/bug20732/my50-bug20732
into mysql.com:/usr/home/ram/work/bug20732/my51-bug20732 mysql-test/r/range.result: Auto merged mysql-test/t/range.test: Auto merged sql/opt_range.cc: Auto merged sql/opt_range.h: Auto merged sql/sql_select.cc: Auto merged sql/table.cc: manual merging.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index 0abb37b5345..95b3d50adba 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2101,6 +2101,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
key_parts->null_bit= key_part_info->null_bit;
key_parts->image_type =
(key_info->flags & HA_SPATIAL) ? Field::itMBR : Field::itRAW;
+ key_parts->flag= key_part_info->key_part_flag;
}
param.real_keynr[param.keys++]=idx;
}
@@ -5655,7 +5656,9 @@ get_mm_leaf(RANGE_OPT_PARAM *param, COND *conf_func, Field *field,
}
break;
case Item_func::GT_FUNC:
- if (field_is_equal_to_item(field,value))
+ /* Don't use open ranges for partial key_segments */
+ if (field_is_equal_to_item(field,value) &&
+ !(key_part->flag & HA_PART_KEY_SEG))
tree->min_flag=NEAR_MIN;
/* fall through */
case Item_func::GE_FUNC:
@@ -7644,6 +7647,7 @@ QUICK_RANGE_SELECT *get_quick_select_for_ref(THD *thd, TABLE *table,
key_part->length= key_info->key_part[part].length;
key_part->store_length= key_info->key_part[part].store_length;
key_part->null_bit= key_info->key_part[part].null_bit;
+ key_part->flag= key_info->key_part[part].key_part_flag;
}
if (insert_dynamic(&quick->ranges,(gptr)&range))
goto err;