Board footer

0.15013 sec
  • Not logged in

Views: 923



2008-05-27 10:36:48 (25 weeks 1 day 18 hours 12 minutes 53 seconds) #1763558 | | view posts since this          #1 

gurov
Administrator

gennady gurov

v--- russian chicken
Russia
From: Freehold, NJ
Registered: 2006-03-08
Reads: 13419
Posts: 6264
Thanks given: 14
Thanks received: 20
Vehicle: '04 SE-R Spec V
Member #1
Modifications : 58
Awards : 4
Showoff page
Feedback page
Website

finally fixed the freaking white screen after editing the post

this has been driving me freaking nuts. really pisses me off i missed it
old code:

Code::

/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `edit_capture` AFTER UPDATE ON `rev_posts` FOR EACH ROW begin
                if (OLD.message != NEW.message) then
                        insert into post_edits (post_id, poster_id, topic_id, posted, edited, old_message, new_message)
                                values (OLD.id, OLD.poster_id, OLD.topic_id, OLD.posted, unix_timestamp(), OLD.message, NEW.message);
                        insert into fti_update(id) values (OLD.id);
                end if;
        end */;;
DELIMITER ;

new code

Code::

/*!50003 CREATE */ /*!50017 DEFINER=`root`@`localhost` */ /*!50003 TRIGGER `edit_capture` AFTER UPDATE ON `rev_posts` FOR EACH ROW begin
                if (OLD.message != NEW.message) then
                        insert into post_edits (post_id, poster_id, topic_id, posted, edited, old_message, new_message)
                                values (OLD.id, OLD.poster_id, OLD.topic_id, OLD.posted, unix_timestamp(), OLD.message, NEW.message);
                        replace into fti_update(id) values (OLD.id);
                end if;
        end */;;
DELIMITER ;

fti_update is defined with id as primary key. and fti_update is cleaned out every 5 minutes. this trigger would bail out if you tried to edit the same post within 5 minutes of it clearing out (fti_update drives the full text search engine that's being used by the new search feature.

changing insert to a replace fixed the white screen of failure after edit.

woops


http://gurov.us/sig1.png
04 turbo @ 14 psi -
MegaSquirt-I standalone - unit #0 (fuel only mode), gsquirt board v1.0, Pivot 3 Drive Throttle Controller,
J&S UltraSafeguard individual cylinder knock suppression system, Autosport Wiring Engine Harness
660cc msd injectors, 255 walbro fuel pump, JGY fuel rail,  t3/t4 57trim, Coolingmist Varicool Progressive Alky controller,
Shurtank with 150psi alky pump.

05 automatic se-r: upcoming turbo project
04 BMW 325xi - daily driver

Offline

 

Views: 923