Icy Phoenix

     
 


Post new topic  Reply to topic 
Page 1 of 1
 
 
Reply with quote Download Post 
Post DEBUG - Error Creating New Session 
 
If you are told that phpbb_session table is full and must be empty manually.

Untill you don't have problem with sessions, you shoudn't touch anything but if you want to prevent any problem, apply it

OPEN:

Code: [Download] [Hide] [Select]
include/sessions.php


FIND:

Code: [Download] [Hide] [Select]
message_die(CRITICAL_ERROR, 'Error creating new session', '', __LINE__, __FILE__, $sql);


REPLACE WITH:

Code: [Download] [Hide] [Select]
$error = TRUE;
$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);
}

 




____________
? Zuker - EDDB - LPM - Sharefields
 
Edited by Mighty Gorgon, Sun 08 Apr, 2007 11:25: Adapted the code to Icy Phoenix
ZukerSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post Re: Error Creating New Session 
 
I've edited the code to Icy Phoenix.

Anyway you may even decide to convert the table from HEAP to MyISAM.

HEAP type has the advantage to remain loaded in memory, so SQL are a bit faster, but MyISAM should not have the problem listed above.

I use MyISAM...
 




____________
Luca
SEARCH is the quickest way to get support.
Icy Phoenix ColorizeIt - CustomIcy - HON
 
Mighty GorgonSend private messageSend e-mail to userVisit poster's website  
Back to topPage bottom
Post new topic  Reply to topic  Page 1 of 1
 


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events


  

 

  cron