Changeset: 151c9d0fa78f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=151c9d0fa78f Modified Files: sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.test sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.test sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.test Branch: mtest Log Message:
more fixes on sql/test/BugTracker-2018 diffs (259 lines): diff --git a/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql --- a/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql +++ b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql @@ -4,11 +4,13 @@ select remark from comments where id in create table abc_6639 (nr int); comment on table abc_6639 is 'abc_rem'; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 1 row as expected \dt abc_6639 comment on table abc_6639 is null; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 1 row but with remark column being null. this is not expected and not allowed as the remark column is defined as NOT NULL \dt abc_6639 @@ -18,21 +20,25 @@ select number, name, type, type_digits, comment on table abc_6639 is ''; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 0 rows, the row is now deleted as expected \dt abc_6639 comment on table abc_6639 is null; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 1 row! So it is created again but with remark column being null \dt abc_6639 comment on table abc_6639 is 'abc_rem2'; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 1 row as expected \dt abc_6639 drop table abc_6639; select remark from comments where id in (select id from sys._tables where name = 'abc_6639'); + -- shows 0 rows, the row is deleted as expected (implicitly deleted by the drop table statement) \dt abc_6639 diff --git a/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.test b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.test --- a/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.test +++ b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.test @@ -13,54 +13,103 @@ select remark from comments where id in ---- abc_rem -statement error -\dt abc_6639 +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'abc_6639') +---- +abc_6639 +NULL +TABLE +abc_rem + +statement ok comment on table abc_6639 is null query T rowsort select remark from comments where id in (select id from sys._tables where name = 'abc_6639') ---- -abc_rem -statement error -\dt abc_6639 +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'abc_6639') +---- +abc_6639 +NULL +TABLE +NULL + -- show that the comment column id and remark are both set to NOT NULL +query ITTTT rowsort select number, name, type, type_digits, "null" from sys._columns where table_id in (select id from sys._tables where name = 'comments' and system) +---- +0 +id +int +32 +False +1 +remark +varchar +65000 +False -statement error -\dt comments + +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'comments') +---- +comments +NULL +TABLE +NULL + +statement ok comment on table abc_6639 is '' query T rowsort select remark from comments where id in (select id from sys._tables where name = 'abc_6639') ---- -abc_rem -statement error -\dt abc_6639 +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'abc_6639') +---- +abc_6639 +NULL +TABLE +NULL + +statement ok comment on table abc_6639 is null query T rowsort select remark from comments where id in (select id from sys._tables where name = 'abc_6639') ---- -abc_rem -statement error -\dt abc_6639 +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'abc_6639') +---- +abc_6639 +NULL +TABLE +NULL + +statement ok comment on table abc_6639 is 'abc_rem2' query T rowsort select remark from comments where id in (select id from sys._tables where name = 'abc_6639') ---- -abc_rem +abc_rem2 -statement error -\dt abc_6639 +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'abc_6639') +---- +abc_6639 +NULL +TABLE +abc_rem2 + +statement ok drop table abc_6639 query T rowsort select remark from comments where id in (select id from sys._tables where name = 'abc_6639') ---- -abc_rem - diff --git a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.test b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.test --- a/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.test +++ b/sql/test/BugTracker-2018/Tests/prepared-statement-with-udf.Bug-6650.test @@ -10,34 +10,34 @@ insert into onet values ('a', 'b', 'c') statement ok create function get_onet(d text) returns table (aa text, bb text, cc text) return table(select * from onet where a = d) -statement error +statement ok prepare select * from get_onet(?) -statement error +statement ok exec **('a') -statement error +statement ok prepare select * from get_onet(?) tt where tt.aa = ? -statement error +statement ok exec **('a', 'b') -statement error +statement ok prepare with something as (select a from onet where a = ?) select * from get_onet(?), something -statement error +statement ok exec **('a', 'a') -statement error +statement ok drop function get_onet -statement error +statement ok drop table onet -statement error +statement ok CREATE FUNCTION twoargs(input1 INT, input2 CLOB) RETURNS TABLE (outt CLOB) BEGIN RETURN TABLE(SELECT input1 || input2); END -statement error +statement ok prepare select 1 from twoargs(?,?) statement ok diff --git a/sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.test b/sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.test --- a/sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.test +++ b/sql/test/BugTracker-2018/Tests/procedure-create-table.Bug-6604.test @@ -10,12 +10,18 @@ call test() statement error select i from x limit 1 -statement error -\d x +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'x') +---- + +-- TODO FIX ME +statement ok \df test + +statement ok drop procedure test -statement error +statement ok create procedure test() begin create table x as select name from sys.functions with data; end statement ok @@ -24,9 +30,15 @@ call test() statement error select name from x limit 1 -statement error -\d x +query TTTT rowsort +select "name", "query", "type", "remark" from describe_table('sys', 'x') +---- + +-- TODO FIX ME +statement ok \df test + +statement ok drop procedure test _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list