Show
Ignore:
Timestamp:
10/19/09 01:14:06 (5 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1255914846 +0000
git-parent:

[2cd270972e428ebdf5cf1e4cf5fc88050238b6f0]

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

add storage_node_id in the return set

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • sql/sprocs/stratcon.map_uuid_to_sid.sql

    rb2014c0 r08e498f  
    1 CREATE OR REPLACE FUNCTION stratcon.map_uuid_to_sid(in v_uuid uuid, in v_noit text, out o_sid int, out o_fqdn text, out o_dsn text)  
     1CREATE OR REPLACE FUNCTION stratcon.map_uuid_to_sid(in v_uuid uuid, in v_noit text, out o_sid int, out o_storage_node_id int, out o_fqdn text, out o_dsn text)  
    22RETURNS RECORD  
    33AS $$ 
    4 DECLARE 
    5     v_new_storage_node_id int;  
    64BEGIN 
    75    -- we don't currently do anything with the noit name,  
    86    -- but I think we had a reason to use it 
    97 
    10     SELECT sid, fqdn, dsn FROM stratcon.map_uuid_to_sid LEFT JOIN stratcon.storage_node USING (storage_node_id) WHERE id = v_uuid INTO o_sid, o_fqdn, o_dsn;  
     8    SELECT sid, storage_node_id, fqdn, dsn 
     9      FROM stratcon.map_uuid_to_sid LEFT JOIN stratcon.storage_node USING (storage_node_id) 
     10     WHERE id = v_uuid INTO o_sid, o_storage_node_id, o_fqdn, o_dsn;  
    1111    IF NOT FOUND THEN 
    1212 
    1313        SELECT nextval('stratcon.map_uuid_to_sid_sid_seq') INTO o_sid;   
    14         SELECT * FROM stratcon.choose_storage_node_for_sid(v_noit) INTO v_new_storage_node_id, o_fqdn, o_dsn;  
     14        SELECT * FROM stratcon.choose_storage_node_for_sid(v_noit) INTO o_storage_node_id, o_fqdn, o_dsn;  
    1515 
    16         INSERT INTO stratcon.map_uuid_to_sid(id,sid,storage_node_id) VALUES (v_uuid, o_sid, v_new_storage_node_id);  
     16        INSERT INTO stratcon.map_uuid_to_sid(id,sid,storage_node_id) VALUES (v_uuid, o_sid, o_storage_node_id);  
    1717 
    1818    END IF;