diff options
author | Arun Kuruvila <arun.kuruvila@oracle.com> | 2014-04-10 11:10:31 +0530 |
---|---|---|
committer | Arun Kuruvila <arun.kuruvila@oracle.com> | 2014-04-10 11:10:31 +0530 |
commit | e12156e7b68e72affbfbf95969ac2bcd4ede000d (patch) | |
tree | e5d2fe315fccb57c204563cec1c6176aa245a0a5 | |
parent | 38fefa02dd32d6b8e36eac8d95b5bc603106c22c (diff) | |
download | mariadb-git-e12156e7b68e72affbfbf95969ac2bcd4ede000d.tar.gz |
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.
-rw-r--r-- | storage/archive/ha_archive.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index 164c59f2426..aafbedf6a07 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -1,5 +1,6 @@ /* - 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); } |