Commit e12156e7 authored by Arun Kuruvila's avatar Arun Kuruvila

Description: When we execute a correlated subquery on an

archive table which is using an auto increment column, the
server hangs. In order to recover the mysqld process, it
has to be terminated abnormally using SIGKILL. The problem
is observed in mysql-5.5.
Bug #18065452 "PREPARING" STATE HOGS CPU WITH ARCHIVE
               + SUBQUERY

Analysis: This happens because the server is trapped inside
an infinite loop in the function,
"subselect_indexsubquery_engine::exec()". This function
resolves the correlated suquery by doing an index lookup
for the appropriate engine. In  case of archive engine,
after reaching the end of records, "table->status" is not
set to STATUS_NOT_FOUND. As a result the loop is not 
terminated.

Fix: The "table->status" is set to STATUS_NOT_FOUND when
the end of records is reached.
parent 38fefa02
/*
Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights
reserved.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
......@@ -1078,6 +1079,7 @@ int ha_archive::index_next(uchar * buf)
}
rc= found ? 0 : HA_ERR_END_OF_FILE;
table->status= rc ? STATUS_NOT_FOUND : 0;
MYSQL_INDEX_READ_ROW_DONE(rc);
DBUG_RETURN(rc);
}
......
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