Update of /cvsroot/monetdb/sql/src/test
In directory sc8-pr-cvs16:/tmp/cvs-serv23132
Added Files:
function_syntax.sql
Log Message:
Test (it is green) to cover the new drop function syntax because no test
existed before
Each new feature should always have a test to cover the syntax and the
semantics of it.
The DROP function was modified.
DROP FUNCTION f_name;
It will drop the function f_name if there is only one function with such name.
If there are more function and error message is sent to ask you for the complete
signature.
DROP FUNCTION f_name();
It will drop the function f_name which does not have parameters.
DROP FUNCTION f_name(int, varchar(1024));
It will drop the function with this signature.
Note: The number bits for varchar it is only checked by the parser,
semantically only the type is checked not the size.
The parser need to be fixed (maybe by Niels) to avoid this inconvenient.
DROP ALL FUNCTION f_name;
It will drop all the functions with the name f_name.
Note: In all the previous case the drop can be cascade.
Syntax:
DROP FUNCTION f_name [(type_list)] [CASCADE | RESTRICT];
DROP ALL FUNCTION f_name [CASCADE | RESTRICT]
--- NEW FILE: function_syntax.sql ---
create function f1()
RETURNS int
BEGIN
return 0;
END;
create function f1(id int)
RETURNS int
BEGIN
return 0;
END;
create function f2(id int)
RETURNS int
BEGIN
return 0;
END;
create function f3(id int, name varchar(1024))
RETURNS int
BEGIN
return 0;
END;
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
DROP FUNCTION f1;
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
DROP FUNCTION f1();
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
DROP FUNCTION f2 (int, varchar(1024));
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
DROP FUNCTION f2 (int);
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
DROP FUNCTION f3 (int, varchar(1024));
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
create function f1()
RETURNS int
BEGIN
return f1(3);
END;
DROP ALL FUNCTION f1;
DROP ALL FUNCTION f1 CASCADE;
select name from functions where name = 'f1' or name = 'f2' or name = 'f3';
-------------------------------------------------------------------------
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