http://www.icyphoenix.com/viewtopic.php?f=4&t=155&p=1083#p1083
-----------------------------------
z3d0
Wed 23 Aug, 2006 11:18

DEBUG - Error Creating New Session
-----------------------------------
Often I'm told that the phpbb_session table is full and I must empty it manually to make the site work again. I don't know if you have my same problem, anyway here is the patch (that will be included in phpbb 3)

[b]OPEN:[/b]

[code]include/sessions.php[/code]

[b]FIND:[/b]

[code]			message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);[/code]

[b]REPLACE WITH:[/b]

[code]$error = TRUE;
if (SQL_LAYER == "mysql" || SQL_LAYER == "mysql4")
{
   $sql_error = $db->sql_error($result);
   if ($sql_error["code"] == 1114)
   {
      $result = $db->sql_query('SHOW TABLE STATUS LIKE "'.SESSIONS_TABLE.'"');
      $row = $db->sql_fetchrow($result);
      if ($row["Type"] == "HEAP")
      {
         if ($row["Rows"] > 550)
         {
            $delete_order = (SQL_LAYER=="mysql4") ? " ORDER BY session_time ASC" : "";
            $db->sql_query("DELETE QUICK FROM ".SESSIONS_TABLE."$delete_order LIMIT 50");
         }
         else
         {
            $db->sql_query("ALTER TABLE ".SESSIONS_TABLE." MAX_ROWS=".($row["Rows"]+50));
         }
         if ($db->sql_query($sql))
         {
            $error = FALSE;
         }                    
      }
   }
}
if ($error)
{
   message_die(CRITICAL_ERROR, "Error creating new session", "", __LINE__, __FILE__, $sql);
}[/code]


