Changeset ee3bbe783b5e3fcbb1febb6a523e12550d04d90d

Show
Ignore:
Timestamp:
07/10/08 02:51:36 (10 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1215658296 +0000
git-parent:

[5a9b91bc0a14543e0995eba973fbeacc05aaee8b]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1215658296 +0000
Message:

fix bug in update config and revert the out-of-order text metric support as it is just too expensive, closes #45

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/schema.sql

    re0795d0 ree3bbe7  
    230230        END IF; 
    231231        delete from stratcon.current_node_config 
    232               where _address = v_remote_address_in 
     232              where remote_address = v_remote_address_in 
    233233                and node_type = v_node_type_in; 
    234234    END IF; 
     
    304304IF TG_OP = 'INSERT' THEN 
    305305 
    306 SELECT max(whence) FROM stratcon.loading_dock_metric_text_s WHERE whence <> NEW.whence and sid=NEW.sid and name = NEW.name  
    307         INTO v_max_whence; 
    308   
    309  IF NEW.whence < v_max_whence THEN             
    310   
    311     INSERT INTO stratcon.loading_dock_metric_text_s_change_log (sid,whence,name,value) 
    312                  VALUES (NEW.sid,NEW.whence, NEW.name, NEW.value);  
    313                   
    314        SELECT  whence,name,value FROM  stratcon.loading_dock_metric_text_s_change_log WHERE whence > NEW.whence and sid=NEW.sid and name=NEW.name order by whence  limit 1  
    315         INTO v_whence,v_sid,v_name,v_value; 
    316           IF FOUND  THEN 
    317             IF v_value IS  DISTINCT FROM NEW.value THEN 
    318                NULL; 
    319             ELSE 
    320                 DELETE from  stratcon.loading_dock_metric_text_s_change_log  WHERE whence=v_whence and sid=v_sid and name=v_name; 
    321             END IF; 
    322           END IF; 
    323         
    324           
    325        SELECT whence,sid,name,value from stratcon.loading_dock_metric_text_s where whence> NEW.whence and sid=NEW.sid and name=NEW.name and value!=NEW.value order by whence limit 1 
    326          INTO v_whence,v_sid,v_name,v_value; 
    327           IF FOUND  THEN 
    328              SELECT  whence,sid,name,value FROM  stratcon.loading_dock_metric_text_s_change_log WHERE whence =v_whence and sid=v_sid and name=v_name and value=v_value 
    329                  INTO v_old_whence,v_old_sid,v_old_name,v_old_value; 
    330               IF FOUND THEN 
    331                  NULL; 
    332               ELSE 
    333                 INSERT INTO stratcon.loading_dock_metric_text_s_change_log (sid,whence,name,value) 
    334                  VALUES (v_sid,v_whence, v_name, v_value);  
    335                END IF; 
    336         END IF; 
    337  
    338   ELSE 
    339306             SELECT value FROM  stratcon.loading_dock_metric_text_s WHERE sid = NEW.sid AND name = NEW.name  
    340307                 AND WHENCE = (SELECT max(whence) FROM stratcon.loading_dock_metric_text_s_change_log  
     
    347314                            VALUES (NEW.sid, NEW.whence, NEW.name, NEW.value);  
    348315                    END IF; 
    349   END IF;            
    350316 
    351317