Update of /cvsroot/monetdb/sql/src/test/Dependencies
In directory sc8-pr-cvs16:/tmp/cvs-serv17518

Added Files:
        dependency_functions.sql 
Log Message:
Modifications to see if the dependencies are detected byb the name or the 
signature.
Looking to the result of the test it seems that dependencies were following the 
correct approach
(dependencies on functions is done with full signature).

 


--- NEW FILE: dependency_functions.sql ---
CREATE FUNCTION f1(num int)
RETURNS int
BEGIN 
        IF num >0
                THEN RETURN 1;
                ELSE RETURN 0;
        END IF;
END;

CREATE FUNCTION f1()
RETURNS int
BEGIN 
        RETURN 0;
END;

CREATE FUNCTION f2(x int)
RETURNS int
BEGIN
        IF f1(x) > 0
                THEN RETURN 1;
        END IF;

        IF f1() < 0
                THEN RETURN 2;
        END IF;

END;

CREATE FUNCTION f3()
RETURNS int
BEGIN
        IF f1() < 0
                THEN RETURN 1;
        END IF;
END;

--Function f1 has a dependency on function f2
--SELECT f1.id, f1.func, f2.id, 'DEP_FUNC' from functions as f1, functions as 
f2, dependencies as dep where f1.id = dep.id AND f2.id = dep.depend_id AND 
dep.depend_type = 7 order by f2.name, f1.name;
SELECT f1.name, f2.name, 'DEP_FUNC' from functions as f1, functions as f2, 
dependencies as dep where f1.id = dep.id AND f2.id = dep.depend_id AND 
dep.depend_type = 7 order by f2.name, f1.name;



DROP FUNCTION f2;

DROP FUNCTION f3;

DROP ALL FUNCTION f1;

SELECT f1.name, f2.name, 'DEP_FUNC' from functions as f1, functions as f2, 
dependencies as dep where f1.id = dep.id AND f2.id = dep.depend_id AND 
dep.depend_type = 7 order by f2.name, f1.name;


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to