summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <davi@moksha.local>2007-08-27 10:37:12 -0300
committerunknown <davi@moksha.local>2007-08-27 10:37:12 -0300
commit34ded629086fa8e1ddd3b73ffb3531b10452d46f (patch)
tree0b34b37ca4761d823e2f8eb38d7b23f5bfcad3ba /sql/sql_handler.cc
parent369a5f1cdcd569a02de4a12d64faebc33e9128f0 (diff)
downloadmariadb-git-34ded629086fa8e1ddd3b73ffb3531b10452d46f.tar.gz
Bug#30632 HANDLER read failure causes hang
If, after the tables are locked, one of the conditions to read from a HANDLER table is not met, the handler code wrongly jumps to a error path that won't unlock the tables. The user-visible effect is that after a error in a handler read command, all subsequent handler operations on the same table will hang. The fix is simply to correct the code to jump to the (same) error path that unlocks the tables. mysql-test/r/handler.result: Bug#30632 test case result mysql-test/t/handler.test: Bug#30632 test case sql/sql_handler.cc: Always unlock the internal and external table level locks if any of the conditions (including errors) to read from a HANDLER table are not met.
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 83c141f099f..9aefa71647e 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -440,7 +440,7 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
cond->cleanup(); // File was reopened
if ((!cond->fixed &&
cond->fix_fields(thd, &cond)) || cond->check_cols(1))
- goto err0;
+ goto err;
}
if (keyname)
@@ -448,13 +448,13 @@ bool mysql_ha_read(THD *thd, TABLE_LIST *tables,
if ((keyno=find_type(keyname, &table->s->keynames, 1+2)-1)<0)
{
my_error(ER_KEY_DOES_NOT_EXITS, MYF(0), keyname, tables->alias);
- goto err0;
+ goto err;
}
}
if (insert_fields(thd, &thd->lex->select_lex.context,
tables->db, tables->alias, &it, 0))
- goto err0;
+ goto err;
protocol->send_fields(&list, Protocol::SEND_NUM_ROWS | Protocol::SEND_EOF);