diff options
author | unknown <serg@serg.mylan> | 2003-09-03 22:27:04 +0200 |
---|---|---|
committer | unknown <serg@serg.mylan> | 2003-09-03 22:27:04 +0200 |
commit | f0879fd9a765a996e28408671d957992d53142fd (patch) | |
tree | 80e6e6693078781137ee833b781a230d81dfb390 /sql/opt_range.cc | |
parent | 96757dd788a22be2ee36fe79a97420914f40afa9 (diff) | |
download | mariadb-git-f0879fd9a765a996e28408671d957992d53142fd.tar.gz |
bug #1172 - crash on force index() and SEL_ARG::MAYBE_KEY
Diffstat (limited to 'sql/opt_range.cc')
-rw-r--r-- | sql/opt_range.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 5049700a67f..8dad80d3eba 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -692,7 +692,7 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables, uint keynr= param.real_keynr[idx]; if ((*key)->type == SEL_ARG::MAYBE_KEY || (*key)->maybe_flag) - needed_reg|= (key_map) 1 << keynr; + needed_reg|= (key_map) 1 << keynr; found_records=check_quick_select(¶m, idx, *key); if (found_records != HA_POS_ERROR && found_records > 2 && @@ -716,7 +716,7 @@ int SQL_SELECT::test_quick_select(key_map keys_to_use, table_map prev_tables, param.range_count, found_records)+ (double) found_records / TIME_FOR_COMPARE); - if (read_time > found_read_time) + if (read_time > found_read_time && found_records != HA_POS_ERROR) { read_time=found_read_time; records=found_records; |