1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

Automatic merge with 5.1

This commit is contained in:
Michael Widenius
2011-01-10 23:42:47 +02:00
26 changed files with 1671 additions and 970 deletions

View File

@@ -548,6 +548,12 @@ retry:
mode= RLAST;
}
}
else if (table->file->inited != handler::RND)
{
/* Convert RNEXT to RFIRST if we haven't started row scan */
if (mode == RNEXT)
mode= RFIRST;
}
if (insert_fields(thd, &thd->lex->select_lex.context,
tables->db, tables->alias, &it, 0))
@@ -569,6 +575,8 @@ retry:
case RNEXT:
if (table->file->inited != handler::NONE)
{
if ((error= table->file->can_continue_handler_scan()))
break;
if (keyname)
{
/* Check if we read from the same index. */
@@ -603,7 +611,9 @@ retry:
DBUG_ASSERT((uint) keyno == table->file->get_index());
if (table->file->inited != handler::NONE)
{
error=table->file->ha_index_prev(table->record[0]);
if ((error= table->file->can_continue_handler_scan()))
break;
error= table->file->ha_index_prev(table->record[0]);
break;
}
/* else fall through */
@@ -673,8 +683,11 @@ retry:
continue;
if (error != HA_ERR_KEY_NOT_FOUND && error != HA_ERR_END_OF_FILE)
{
sql_print_error("mysql_ha_read: Got error %d when reading table '%s'",
error, tables->table_name);
/* Don't give error in the log file for some expected problems */
if (error != HA_ERR_RECORD_CHANGED && error != HA_ERR_WRONG_COMMAND)
sql_print_error("mysql_ha_read: Got error %d when reading "
"table '%s'",
error, tables->table_name);
table->file->print_error(error,MYF(0));
goto err;
}