summaryrefslogtreecommitdiff
path: root/sql
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
commit8512c526ab768c77f0023c9b4d75949a1727acaf (patch)
tree6b83fb56810a9e22b736552033a21cba8af2886c /sql
parent391b984926fdedf1314e4c3fa57a24d709b9dd1b (diff)
downloadmariadb-git-8512c526ab768c77f0023c9b4d75949a1727acaf.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')
-rw-r--r--sql/field.cc2
-rw-r--r--sql/ha_heap.h7
-rw-r--r--sql/mini_client.cc5
-rw-r--r--sql/opt_range.cc6
4 files changed, 11 insertions, 9 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 8d998683bd7..1f1f00b161b 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -363,7 +363,7 @@ void Field::store_time(TIME *ltime,timestamp_type type)
bool Field::optimize_range()
{
- return test(table->file->option_flag() & HA_ONLY_WHOLE_INDEX);
+ return test(table->file->option_flag() & HA_READ_NEXT);
}
/****************************************************************************
diff --git a/sql/ha_heap.h b/sql/ha_heap.h
index d88c28097af..1a6e8d9393c 100644
--- a/sql/ha_heap.h
+++ b/sql/ha_heap.h
@@ -78,10 +78,3 @@ class ha_heap: public handler
enum thr_lock_type lock_type);
};
-
-
-
-
-
-
-
diff --git a/sql/mini_client.cc b/sql/mini_client.cc
index 26bef7194df..fa1b9da38a8 100644
--- a/sql/mini_client.cc
+++ b/sql/mini_client.cc
@@ -384,12 +384,16 @@ my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql)
MYSQL tmp_mysql;
DBUG_ENTER("mc_mysql_reconnect");
+ if (!mysql->reconnect)
+ DBUG_RETURN(1);
+
mc_mysql_init(&tmp_mysql);
tmp_mysql.options=mysql->options;
if (!mc_mysql_connect(&tmp_mysql,mysql->host,mysql->user,mysql->passwd,
mysql->db, mysql->port, mysql->unix_socket,
mysql->client_flag))
{
+ tmp_mysql.reconnect=0;
mc_mysql_close(&tmp_mysql);
DBUG_RETURN(1);
}
@@ -793,6 +797,7 @@ mc_mysql_close(MYSQL *mysql)
{
mc_free_old_query(mysql);
mysql->status=MYSQL_STATUS_READY; /* Force command */
+ mysql->reconnect=0;
mc_simple_command(mysql,COM_QUIT,NullS,0,1);
mc_end_server(mysql);
}
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);
}