summaryrefslogtreecommitdiff
path: root/sql/sql_handler.cc
diff options
context:
space:
mode:
authorunknown <serg@serg.mysql.com>2003-02-22 18:00:34 +0100
committerunknown <serg@serg.mysql.com>2003-02-22 18:00:34 +0100
commitfeb8dc9ee5f114c2a4eb7756e92b7c4d9eedbf1c (patch)
tree671767109b997b1b5d896fbe8f314a5e775872ea /sql/sql_handler.cc
parent850daeea33e71c82a56907994221af8474f9f651 (diff)
downloadmariadb-git-feb8dc9ee5f114c2a4eb7756e92b7c4d9eedbf1c.tar.gz
ALTER TABLE closes all open HANDLER's for the table in question
fixed error handling in HANDLER ... READ FIRST sql/sql_handler.cc: fix error handling in HANDLER ... READ FIRST sql/sql_table.cc: ALTER TABLE closes all open HANDLER's for the table in question
Diffstat (limited to 'sql/sql_handler.cc')
-rw-r--r--sql/sql_handler.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/sql/sql_handler.cc b/sql/sql_handler.cc
index 12e8c9e227a..a98b6c13a00 100644
--- a/sql/sql_handler.cc
+++ b/sql/sql_handler.cc
@@ -153,10 +153,13 @@ int mysql_ha_read(THD *thd, TABLE_LIST *tables,
{
switch(mode) {
case RFIRST:
- err=keyname ?
- table->file->index_first(table->record[0]) :
- table->file->rnd_init(1) ||
- table->file->rnd_next(table->record[0]);
+ if (keyname)
+ err=table->file->index_first(table->record[0]);
+ else
+ {
+ if (!(err=table->file->rnd_init(1)))
+ err=table->file->rnd_next(table->record[0]);
+ }
mode=RNEXT;
break;
case RLAST: