1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed crashing bug with alter table when table was in use (Bug #3643)

We didn't use 'only index' for tables of type 'const'. (Bug #3497)
This commit is contained in:
monty@mysql.com
2004-05-05 12:31:17 +03:00
parent 59ddd8c738
commit 7e3cf5958c
11 changed files with 82 additions and 20 deletions

View File

@ -3630,6 +3630,12 @@ make_join_readinfo(JOIN *join, uint options)
table->status=STATUS_NO_RECORD;
tab->read_first_record= join_read_const;
tab->read_record.read_record= join_no_more_records;
if (table->used_keys.is_set(tab->index) &&
!table->no_keyread)
{
table->key_read=1;
table->file->extra(HA_EXTRA_KEYREAD);
}
break;
case JT_EQ_REF:
table->status=STATUS_NO_RECORD;
@ -5951,6 +5957,12 @@ join_read_const_table(JOIN_TAB *tab, POSITION *pos)
}
else
{
if (!table->key_read && table->used_keys.is_set(tab->index) &&
!table->no_keyread)
{
table->key_read=1;
table->file->extra(HA_EXTRA_KEYREAD);
}
if ((error=join_read_const(tab)))
{
tab->info="unique row not found";
@ -9216,7 +9228,8 @@ static void select_describe(JOIN *join, bool need_tmp_table, bool need_order,
join->best_positions[i]. records_read,
21));
my_bool key_read=table->key_read;
if (tab->type == JT_NEXT && table->used_keys.is_set(tab->index))
if ((tab->type == JT_NEXT || tab->type == JT_CONST) &&
table->used_keys.is_set(tab->index))
key_read=1;
if (tab->info)