summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-04-17 03:55:25 +0300
committerunknown <monty@donna.mysql.fi>2001-04-17 03:55:25 +0300
commit56614e1d19f36846a27501fb29282e70b248e06e (patch)
tree6b83fb56810a9e22b736552033a21cba8af2886c /sql/opt_range.cc
parent24771fddf7be59dd621f6ffe91263bf634cfcf1f (diff)
downloadmariadb-git-56614e1d19f36846a27501fb29282e70b248e06e.tar.gz
Don't use ranges on HEAP tables with LIKE
Don't reconnect client on close libmysql/libmysql.c: Don't reconnect on close mysql-test/r/heap.result: Fixed heap table test sql/field.cc: Backed out wrong HEAP table bug fix sql/ha_heap.h: cleanup sql/mini_client.cc: Don't reconnect on close sql/opt_range.cc: Don't use ranges on HEAP tables with LIKE
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 eedae87719d..5354803e6ab 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -919,6 +919,9 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
if (type == Item_func::LIKE_FUNC)
{
+ if (!field->optimize_range())
+ DBUG_RETURN(0); // Can't optimize this
+
bool like_error;
char buff1[MAX_FIELD_WIDTH],*min_str,*max_str;
String tmp(buff1,sizeof(buff1)),*res;
@@ -971,7 +974,8 @@ get_mm_leaf(Field *field,KEY_PART *key_part,
max_str+maybe_null,&min_length,&max_length);
else
#endif
- like_error=like_range(res->ptr(),res->length(),wild_prefix,field_length,
+ like_error=like_range(res->ptr(),res->length(),wild_prefix,
+ field_length,
min_str+offset,max_str+offset,
max_sort_char,&min_length,&max_length);
}