1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

New handler::index_flags() definition to make it easy to check the full used key and a specific key part.

Added key part to optimize_range() to fix problems when using fields in key parts.



sql/examples/ha_archive.h:
  New handler::index_flags() definition
sql/examples/ha_example.h:
  New handler::index_flags() definition
sql/field.cc:
  New optimize_range() definition
sql/field.h:
  New optimize_range() definition
sql/ha_berkeley.cc:
  New handler::index_flags() definition
sql/ha_berkeley.h:
  New handler::index_flags() definition
sql/ha_heap.h:
  New handler::index_flags() definition
sql/ha_innodb.h:
  New handler::index_flags() definition
sql/ha_isam.h:
  New handler::index_flags() definition
sql/ha_isammrg.h:
  New handler::index_flags() definition
sql/ha_myisam.h:
  New handler::index_flags() definition
sql/ha_myisammrg.h:
  New handler::index_flags() definition
sql/ha_ndbcluster.cc:
  New handler::index_flags() definition
sql/ha_ndbcluster.h:
  New handler::index_flags() definition
sql/handler.h:
  New handler::index_flags() definition
sql/log.cc:
  Fixed compiler warnings
sql/log_event.cc:
  Fixed compiler warnings (and renamed short variable name)
sql/opt_range.cc:
  New handler::index_flags() definition
sql/opt_sum.cc:
  New handler::index_flags() definition
sql/set_var.cc:
  Removed compiler warnings
sql/sql_db.cc:
  Removed compiler warnings
sql/sql_select.cc:
  New handler::index_flags() definition
sql/sql_show.cc:
  Removed compiler warnings
sql/sql_update.cc:
  Removed compiler warnings
sql/table.cc:
  New handler::index_flags() definition
This commit is contained in:
unknown
2004-07-08 15:45:25 +03:00
parent 5ef15478cd
commit a23fbc060e
25 changed files with 83 additions and 56 deletions

View File

@ -2825,7 +2825,7 @@ find_best(JOIN *join,table_map rest_tables,uint idx,double record_count,
Set tmp to (previous record count) * (records / combination)
*/
if ((found_part & 1) &&
(!(table->file->index_flags(key,0) & HA_ONLY_WHOLE_INDEX) ||
(!(table->file->index_flags(key,0,0) & HA_ONLY_WHOLE_INDEX) ||
found_part == PREV_BITS(uint,keyinfo->key_parts)))
{
max_key_part=max_part_bit(found_part);
@ -7172,7 +7172,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
if (!select->quick->reverse_sorted())
{
// here used_key_parts >0
if (!(table->file->index_flags(ref_key,used_key_parts-1)
if (!(table->file->index_flags(ref_key,used_key_parts-1, 1)
& HA_READ_PREV))
DBUG_RETURN(0); // Use filesort
// ORDER BY range_key DESC
@ -7195,9 +7195,9 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit,
Use a traversal function that starts by reading the last row
with key part (A) and then traverse the index backwards.
*/
if (!(table->file->index_flags(ref_key,used_key_parts-1)
& HA_READ_PREV))
DBUG_RETURN(0); // Use filesort
if (!(table->file->index_flags(ref_key,used_key_parts-1, 1)
& HA_READ_PREV))
DBUG_RETURN(0); // Use filesort
tab->read_first_record= join_read_last_key;
tab->read_record.read_record= join_read_prev_same;
/* fall through */