• Arun Kuruvila's avatar
    Description: When we execute a correlated subquery on an · 92351c83
    Arun Kuruvila authored
    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.
    92351c83
ha_archive.cc 49.4 KB