Commit e7715445 authored by serg@serg.mysql.com's avatar serg@serg.mysql.com

ALTER TABLE closes all open HANDLER's for the table in question

fixed error handling in HANDLER ... READ FIRST
parent 55ae7d26
...@@ -153,10 +153,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables, ...@@ -153,10 +153,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
{ {
switch(mode) { switch(mode) {
case RFIRST: case RFIRST:
err=keyname ? if (keyname)
table->file->index_first(table->record[0]) : err=table->file->index_first(table->record[0]);
table->file->rnd_init(1) || else
table->file->rnd_next(table->record[0]); {
if (!(err=table->file->rnd_init(1)))
err=table->file->rnd_next(table->record[0]);
}
mode=RNEXT; mode=RNEXT;
break; break;
case RLAST: case RLAST:
......
...@@ -1374,6 +1374,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name, ...@@ -1374,6 +1374,7 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
new_db=db; new_db=db;
used_fields=create_info->used_fields; used_fields=create_info->used_fields;
mysql_ha_closeall(thd, table_list);
if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ))) if (!(table=open_ltable(thd,table_list,TL_WRITE_ALLOW_READ)))
DBUG_RETURN(-1); DBUG_RETURN(-1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment