Changeset: bdcf9e0e99ea for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bdcf9e0e99ea Branch: mtest Log Message:
merge diffs (truncated from 1745 to 300 lines): diff --git a/sql/test/Dependencies/Tests/dependency_loop.test b/sql/test/Dependencies/Tests/dependency_loop.test new file mode 100644 --- /dev/null +++ b/sql/test/Dependencies/Tests/dependency_loop.test @@ -0,0 +1,179 @@ +statement ok +CREATE TABLE Dictionary (ID INTEGER,val VARCHAR(20000),PRIMARY KEY (ID)) + +statement ok +CREATE TABLE +bench_booktitle + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +bench_cdrom + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_pages + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +foaf_homepage + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_editor + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_number + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dc_creator + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +rdfs_seeAlso + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dcterms_partOf + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dcterms_references + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dcterms_issued + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_volume + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dc_publisher + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_note + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_chapter + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_address + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_series + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_month + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +foaf_name + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +rdf_type + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +dc_title + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_journal + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +bench_abstract + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE TABLE +swrc_isbn + (subject INTEGER,object INTEGER,FOREIGN KEY (subject) REFERENCES Dictionary(ID),FOREIGN KEY (object) REFERENCES Dictionary(ID)) + +statement ok +CREATE VIEW Triples AS +( SELECT subject,'bench:booktitle' AS predicate,object FROM bench_booktitle ) +UNION +( SELECT subject,'bench:cdrom' AS predicate,object FROM bench_cdrom ) +UNION +( SELECT subject,'swrc:pages' AS predicate,object FROM swrc_pages ) +UNION +( SELECT subject,'foaf:homepage' AS predicate,object FROM foaf_homepage ) +UNION +( SELECT subject,'swrc:editor' AS predicate,object FROM swrc_editor ) +UNION +( SELECT subject,'swrc:number' AS predicate,object FROM swrc_number ) +UNION +( SELECT subject,'dc:creator' AS predicate,object FROM dc_creator ) +UNION +( SELECT subject,'rdfs:seeAlso' AS predicate,object FROM rdfs_seeAlso ) +UNION +( SELECT subject,'dcterms:partOf' AS predicate,object FROM dcterms_partOf ) +UNION +( SELECT subject,'dcterms:references' AS predicate,object FROM dcterms_references ) +UNION +( SELECT subject,'dcterms:issued' AS predicate,object FROM dcterms_issued ) +UNION +( SELECT subject,'swrc:volume' AS predicate,object FROM swrc_volume ) +UNION +( SELECT subject,'dc:publisher' AS predicate,object FROM dc_publisher ) +UNION +( SELECT subject,'swrc:note' AS predicate,object FROM swrc_note ) +UNION +( SELECT subject,'swrc:chapter' AS predicate,object FROM swrc_chapter ) +UNION +( SELECT subject,'swrc:address' AS predicate,object FROM swrc_address ) +UNION +( SELECT subject,'swrc:series' AS predicate,object FROM swrc_series ) +UNION +( SELECT subject,'swrc:month' AS predicate,object FROM swrc_month ) +UNION +( SELECT subject,'foaf:name' AS predicate,object FROM foaf_name ) +UNION +( SELECT subject,'rdf:type' AS predicate,object FROM rdf_type ) +UNION +( SELECT subject,'dc:title' AS predicate,object FROM dc_title ) +UNION +( SELECT subject,'swrc:journal' AS predicate,object FROM swrc_journal ) +UNION +( SELECT subject,'bench:abstract' AS predicate,object FROM bench_abstract ) +UNION +( SELECT subject,'swrc:isbn' AS predicate,object FROM swrc_isbn ) + +query I rowsort +select count(*) from dependencies where depend_type = 5 +---- +565 + + diff --git a/sql/test/Dependencies/Tests/view_table_udf.test b/sql/test/Dependencies/Tests/view_table_udf.test new file mode 100644 --- /dev/null +++ b/sql/test/Dependencies/Tests/view_table_udf.test @@ -0,0 +1,55 @@ +statement ok +CREATE FUNCTION "sys"."test1"() RETURNS TABLE ("col1" int, "col2" int) BEGIN RETURN SELECT 1, 2; END + +statement ok +CREATE VIEW "sys"."test1" ("col1", "col2") AS SELECT "col1", "col2" FROM "sys"."test1"() + +query I rowsort +select count(*) from dependencies inner join tables on dependencies.id = tables.id where tables.name = 'test1' +---- +0 + +query I rowsort +select count(*) from dependencies inner join functions on dependencies.id = functions.id where functions.name = 'test1' +---- +1 + +statement error +DROP FUNCTION "test1"() + +statement ok +CREATE FUNCTION "sys"."test2"() RETURNS TABLE ("col1" int, "col2" int) BEGIN RETURN SELECT "col1", "col2" FROM "sys"."test1"; END + +statement error +DROP VIEW "test1" + +query I rowsort +select count(*) from dependencies inner join tables on dependencies.id = tables.id where tables.name = 'test1' +---- +1 + +query I rowsort +select count(*) from dependencies inner join functions on dependencies.id = functions.id where functions.name = 'test1' +---- +1 + +statement ok +DROP FUNCTION "test2"() + +statement ok +DROP VIEW "test1" + +statement ok +DROP FUNCTION "test1"() + +query I rowsort +select count(*) from dependencies inner join tables on dependencies.id = tables.id where tables.name = 'test1' +---- +0 + +query I rowsort +select count(*) from dependencies inner join functions on dependencies.id = functions.id where functions.name = 'test1' +---- +0 + + diff --git a/sql/test/DropCascade/Tests/drop_columns_cascade.test b/sql/test/DropCascade/Tests/drop_columns_cascade.test new file mode 100644 --- /dev/null +++ b/sql/test/DropCascade/Tests/drop_columns_cascade.test @@ -0,0 +1,116 @@ +statement ok +create table t1 (id int, name varchar(1024), age int, PRIMARY KEY(id)) + +statement ok +create table t2 (id int, age int, PRIMARY KEY (ID), FOREIGN KEY(id) REFERENCES t1(id)) + +statement ok +create view v1 as select * from t1 + +statement ok +create trigger test1 after insert on t2 + insert into t1 values(0, 'after', 23) + +statement error +CREATE FUNCTION f1(num int) +RETURNS int +BEGIN + IF num >0 + THEN RETURN 1 + +statement error + ELSE RETURN 0 + +statement error + END IF + +statement error +END + +statement error +CREATE FUNCTION f2() +RETURNS TABLE(id int) +BEGIN + DECLARE TABLE f1_t1(id int) + +statement error + DECLARE x int + +statement error + SET x = 3 + +statement error + IF f1(x) > 0 + THEN RETURN f1_t1 + +statement error + END IF + +statement error + INSERT INTO f1_t1 VALUES(1) + _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list