In-Portal Issue Tracker

Welcome to the In-Portal Open Source CMS Issue Tracker! This is a central management / tracking tool for all types of tasks / issues / bugs for the In-Portal Project. Before reporting any issues, please make sure to read the Guide into Issue Tracker and How to Properly Test and Report Bugs!

Relationship Graph View Issue ] Dependency Graph ]
related to child of duplicate of

Viewing Issue Simple Details
ID Category Type Reproducibility Date Submitted Last Update
0000316 [In-Portal CMS] Front End bug report always 2009-09-22 15:44 2009-09-23 11:15
Reporter alex View Status public  
Assigned To
Priority normal Resolution open  
Status active      
Summary 0000316: MySQL error "Got a packet bigger than 'max_allowed_packet'" during st_CachedMenu call with 3000 categories
Description I got MySQL error "Got a packet bigger than 'max_allowed_packet'", when site menu is printed on Front-End via st_CacheMenu tag.

Problem happens because serialized value of "cms_menu" variable in Cache table is larger, then allowed packet size in MySQL and that was 2MB in my case. To solve this I propose to do the following:

1. Add DataType (with index) column to Cache table.
2. Define DataType for each record in table and use it in future when writing data to this table.
3. Instead of writing one "cms_menu" variable we should write a set of variables named "cms_menu_1", "cms_menu_2", "cms_menu_3" and so on with common DataType of "cms_menu".
4. each of "cms_menu_*" variables will contain part of total value of former "cms_menu" variable.

When used, then instead of:
FROM Cache
WHERE VarName = 'cms_menu';

we should use:
SELECT Data, VarName
FROM Cache
WHERE DataType = 'cms_menu';

Then in PHP sort retrieved data by VarName, join them into one string and then unserialize.
Additional Information Also we could develop central methods for writing/reading to Cache table, that will automatically perform data splitting by multiple variable in case of strings larger, when max_allowed_packet limit is reached.

Because of Cache table is used for storing unit config cache, then moving these methods outside kApplication class will be near to impossible to implement, so they will stay in kApplication class. We could use setCache and getCache and add additional parameter $storage_type (default to memory) to help us.

Web Development by Intechnic
In-Portal Open Source CMS
In-Portal Open Source CMS
Copyright © 2000 - 2009 MantisBT Group

Powered by Mantis Bugtracker