Guest Posted February 9, 2004 Share Posted February 9, 2004 We were copying one store to another and got the dreaded "Fatal error: Allowed memory size of 8388608 bytes exhausted at (null):0 (tried to allocate 35 bytes) in..." error message. After beating our heads against the wall for a couple of days on this we discovered that our "categories" table was allowing a category_id of "0". I'm not sure if all installs of oscommerce don't want this or if it's just ours. I suspect the error is involved with having a category ID of 0 with a parent of 0 and causing a loop or hitting some other "0" id error checking. Here's an explanation and our solution. Assume new store's tables are prefixed with "z_": We created our tables using statements like the following: "create z_categories select * from categories;" There was no problem until we tried to add a category. The new category inserted with the "0" record Id causing the error. Clearing the table got rid of the error until we tried to add a new category. (note we also cleared the description table and other tables like products etc). Fix: Creating the table from scratch using: CREATE TABLE z_categories ( categories_id int(11) NOT NULL auto_increment, categories_image varchar(64) default NULL, parent_id int(11) NOT NULL default '0', sort_order int(3) default NULL, date_added datetime default NULL, last_modified datetime default NULL, categories_root int(11) NOT NULL default '0', PRIMARY KEY (categories_id), KEY idx_categories_parent_id (parent_id) ) TYPE=MyISAM; Then doing an insert with the select to retrieve the other categories from the old store solved the problem. I think this is only a problem with "categories". FYI, I've seen suggstions of "ALTER TABLE `z_categories` AUTO_INCREMENT = 1;" but that just sets the incrementing value and not the start value. There may be a "start value" command that would have also solved our problem. Anyway, I hope this helps someone down the road from making head shaped dents in their walls. --q Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.