summaryrefslogtreecommitdiff
path: root/sql/opt_range.cc
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2003-01-09 02:19:14 +0200
committermonty@mashka.mysql.fi <>2003-01-09 02:19:14 +0200
commit3c08da957e58937ead92a7609e67d2234fe76676 (patch)
treed8a4d338b246396e32745b9fe381fc6de42d5a9d /sql/opt_range.cc
parent23c13c453982c4817831ecc36d06913518c52790 (diff)
downloadmariadb-git-3c08da957e58937ead92a7609e67d2234fe76676.tar.gz
Don't count NULL values in cardinalty for MyISAM tables.
Free row buffer cache after each query for MyISAM tables. Added table join option FORCE INDEX Fixed core dump bug when connecting with hostname that could not be resolved.
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r--sql/opt_range.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index a18c0178b5d..c607e71c01b 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -605,12 +605,14 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables,
records++; /* purecov: inspected */
scan_time=(double) records / TIME_FOR_COMPARE+1;
read_time=(double) head->file->scan_time()+ scan_time + 1.0;
+ if (head->force_index)
+ scan_time= read_time= DBL_MAX;
if (limit < records)
read_time=(double) records+scan_time+1; // Force to use index
else if (read_time <= 2.0 && !force_quick_range)
DBUG_RETURN(0); /* No need for quick select */
- DBUG_PRINT("info",("Time to scan table: %ld",(long) read_time));
+ DBUG_PRINT("info",("Time to scan table: %g", read_time));
keys_to_use&=head->keys_in_use_for_query;
if (keys_to_use)