Changeset: ff7d5cb5122a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff7d5cb5122a
Added 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.stable.err
        
sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.out
Modified Files:
        sql/test/BugTracker-2018/Tests/All
Branch: Aug2018
Log Message:

Add test and desired output for bug 6639


diffs (245 lines):

diff --git a/sql/test/BugTracker-2018/Tests/All 
b/sql/test/BugTracker-2018/Tests/All
--- a/sql/test/BugTracker-2018/Tests/All
+++ b/sql/test/BugTracker-2018/Tests/All
@@ -79,3 +79,4 @@ create_table_if_not_exists_returns_42000
 sqlitelogictest-cast-null-add.Bug-6630
 ilike-foreign-characters.Bug-6633
 multi-column-hash-wrongly-NIL.Bug-6638
+comment-on-table-is-null.Bug-6639
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
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.sql
@@ -0,0 +1,38 @@
+select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+-- shows 0 rows, initially there are no comments set
+
+create table abc_6639 (nr int);
+comment on table abc_6639 is 'abc_rem';
+select remark from comments where id in (select id from _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 _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
+
+-- show that the comment column id and remark are both set to NOT NULL
+select number, name, type, type_digits, "null" from _columns where table_id in 
(select id from _tables where name = 'comments' and system);
+\dt comments
+
+comment on table abc_6639 is '';
+select remark from comments where id in (select id from _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 _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 _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 _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.stable.err 
b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.err
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.err
@@ -0,0 +1,38 @@
+stderr of test 'comment-on-table-is-null.Bug-6639` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 16:01:00 >  
+# 16:01:00 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39586" "--set" 
"mapi_usock=/var/tmp/mtest-7661/.s.monetdb.39586" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_r=yes" "--set" "embedded_py=true" "--set" "embedded_c=true"
+# 16:01:00 >  
+
+# builtin opt  gdk_dbpath = 
/export/scratch1/dinther/INSTALL/var/monetdb5/dbfarm/demo
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = no
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 39586
+# cmdline opt  mapi_usock = /var/tmp/mtest-7661/.s.monetdb.39586
+# cmdline opt  monet_prompt = 
+# cmdline opt  gdk_dbpath = 
/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2018
+# cmdline opt  embedded_r = yes
+# cmdline opt  embedded_py = true
+# cmdline opt  embedded_c = true
+# cmdline opt  gdk_debug = 553648138
+
+# 16:01:01 >  
+# 16:01:01 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7661" "--port=39586"
+# 16:01:01 >  
+
+table sys.abc_6639 does not exist
+
+# 16:01:01 >  
+# 16:01:01 >  "Done."
+# 16:01:01 >  
+
diff --git 
a/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.out 
b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.out
new file mode 100644
--- /dev/null
+++ 
b/sql/test/BugTracker-2018/Tests/comment-on-table-is-null.Bug-6639.stable.out
@@ -0,0 +1,146 @@
+stdout of test 'comment-on-table-is-null.Bug-6639` in directory 
'sql/test/BugTracker-2018` itself:
+
+
+# 16:01:00 >  
+# 16:01:00 >  "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" 
"mapi_open=true" "--set" "mapi_port=39586" "--set" 
"mapi_usock=/var/tmp/mtest-7661/.s.monetdb.39586" "--set" "monet_prompt=" 
"--forcemito" 
"--dbpath=/export/scratch1/dinther/INSTALL/var/MonetDB/mTests_sql_test_BugTracker-2018"
 "--set" "embedded_r=yes" "--set" "embedded_py=true" "--set" "embedded_c=true"
+# 16:01:00 >  
+
+# MonetDB 5 server v11.31.4
+# This is an unreleased version
+# Serving database 'mTests_sql_test_BugTracker-2018', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 128bit integers
+# Found 31.306 GiB available main-memory.
+# Copyright (c) 1993 - July 2008 CWI.
+# Copyright (c) August 2008 - 2018 MonetDB B.V., all rights reserved
+# Visit https://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://catskill.da.cwi.nl:39586/
+# Listening for UNIX domain connection requests on 
mapi:monetdb:///var/tmp/mtest-7661/.s.monetdb.39586
+# MonetDB/GIS module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_querylog.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_temporal.sql
+# loading sql script: 18_index.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_views.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 26_sysmon.sql
+# loading sql script: 27_rejects.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 39_analytics_hge.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 40_json.sql
+# loading sql script: 40_json_hge.sql
+# loading sql script: 41_md5sum.sql
+# loading sql script: 45_uuid.sql
+# loading sql script: 46_profiler.sql
+# loading sql script: 51_sys_schema_extension.sql
+# loading sql script: 60_wlcr.sql
+# loading sql script: 72_fits.sql
+# loading sql script: 74_netcdf.sql
+# loading sql script: 75_lidar.sql
+# loading sql script: 75_shp.sql
+# loading sql script: 75_storagemodel.sql
+# loading sql script: 80_statistics.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 80_udf_hge.sql
+# loading sql script: 85_bam.sql
+# loading sql script: 90_generator.sql
+# loading sql script: 90_generator_hge.sql
+# loading sql script: 99_system.sql
+# MonetDB/SQL module loaded
+# MonetDB/Python2 module loaded
+# MonetDB/R   module loaded
+
+Ready.
+
+# 16:01:01 >  
+# 16:01:01 >  "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" 
"--host=/var/tmp/mtest-7661" "--port=39586"
+# 16:01:01 >  
+
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 0 # length
+#create table abc_6639 (nr int);
+#comment on table abc_6639 is 'abc_rem';
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 7 # length
+[ "abc_rem"    ]
+CREATE TABLE "sys"."abc_6639" (
+       "nr" INTEGER
+);
+COMMENT ON TABLE "sys"."abc_6639" IS 'abc_rem';
+#comment on table abc_6639 is null;
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 0 # length
+CREATE TABLE "sys"."abc_6639" (
+       "nr" INTEGER
+);
+#select number, name, type, type_digits, "null" from _columns where table_id 
in (select id from _tables where name = 'comments' and system);
+% sys._columns,        sys._columns,   sys._columns,   sys._columns,   
sys._columns # table_name
+% number,      name,   type,   type_digits,    null # name
+% int, varchar,        varchar,        int,    boolean # type
+% 1,   6,      7,      5,      5 # length
+[ 0,   "id",   "int",  32,     false   ]
+[ 1,   "remark",       "varchar",      65000,  false   ]
+CREATE TABLE "sys"."comments" (
+       "id"     INTEGER       NOT NULL,
+       "remark" VARCHAR(65000) NOT NULL,
+       CONSTRAINT "comments_id_pkey" PRIMARY KEY ("id")
+);
+#comment on table abc_6639 is '';
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 0 # length
+CREATE TABLE "sys"."abc_6639" (
+       "nr" INTEGER
+);
+#comment on table abc_6639 is null;
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 0 # length
+CREATE TABLE "sys"."abc_6639" (
+       "nr" INTEGER
+);
+#comment on table abc_6639 is 'abc_rem2';
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 8 # length
+[ "abc_rem2"   ]
+CREATE TABLE "sys"."abc_6639" (
+       "nr" INTEGER
+);
+COMMENT ON TABLE "sys"."abc_6639" IS 'abc_rem2';
+#drop table abc_6639;
+#select remark from comments where id in (select id from _tables where name = 
'abc_6639');
+% sys.comments # table_name
+% remark # name
+% varchar # type
+% 0 # length
+
+# 16:01:01 >  
+# 16:01:01 >  "Done."
+# 16:01:01 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to