diff options
author | bell@sanja.is.com.ua <> | 2004-05-19 17:09:40 +0300 |
---|---|---|
committer | bell@sanja.is.com.ua <> | 2004-05-19 17:09:40 +0300 |
commit | bd010b1ec33189a4578c0fd61ee76dc090b86120 (patch) | |
tree | cc719f08c9901d8cb4614a46901eb4e6adc9c3fe /sql/sql_union.cc | |
parent | d42d709171cae604dba0c6216a0d0d1878ae16c3 (diff) | |
parent | ba749627ae3eef81fb0365d8d71f5371eaa8d0a2 (diff) | |
download | mariadb-git-bd010b1ec33189a4578c0fd61ee76dc090b86120.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-explain-4.1
Diffstat (limited to 'sql/sql_union.cc')
-rw-r--r-- | sql/sql_union.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_union.cc b/sql/sql_union.cc index 003ff2d95f5..ec1abc57a51 100644 --- a/sql/sql_union.cc +++ b/sql/sql_union.cc @@ -361,8 +361,8 @@ int st_select_lex_unit::exec() item->reset(); table->file->delete_all_rows(); } - if (union_distinct) // for subselects - table->file->extra(HA_EXTRA_CHANGE_KEY_TO_UNIQUE); + if (union_distinct && table->file->enable_indexes(HA_KEY_SWITCH_ALL)) + DBUG_RETURN(1); // For sub-selects for (SELECT_LEX *sl= select_cursor; sl; sl= sl->next_select()) { ha_rows records_at_start= 0; @@ -414,7 +414,11 @@ int st_select_lex_unit::exec() records_at_start= table->file->records; sl->join->exec(); if (sl == union_distinct) - table->file->extra(HA_EXTRA_CHANGE_KEY_TO_DUP); + { + if (table->file->disable_indexes(HA_KEY_SWITCH_ALL)) + DBUG_RETURN(1); + table->no_keyread=1; + } res= sl->join->error; offset_limit_cnt= sl->offset_limit; if (!res && union_result->flush()) |