Changeset: f1da207efb5c for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f1da207efb5c
Modified Files:
        sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.sql
        sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.err
        sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.out
Branch: Apr2011
Log Message:

added test for bug 2807


diffs (247 lines):

diff --git a/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.sql 
b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.sql
@@ -0,0 +1,57 @@
+create table facts (a_id bigint, b_id bigint);
+insert into facts values(1,1);
+insert into facts values(2,1);
+insert into facts values(3,1);
+insert into facts values(4,1);
+insert into facts values(5,1);
+insert into facts values(6,1);
+insert into facts values(1,2);
+insert into facts values(2,2);
+insert into facts values(3,2);
+insert into facts values(4,2);
+insert into facts values(5,2);
+insert into facts values(6,2);
+insert into facts values(1,3);
+insert into facts values(2,3);
+insert into facts values(3,3);
+insert into facts values(4,3);
+insert into facts values(5,3);
+insert into facts values(6,3);
+
+create table a (id bigint not null primary key, c_id bigint);
+insert into a values(1,1);
+insert into a values(2,1);
+insert into a values(3,2);
+insert into a values(4,2);
+insert into a values(5,3);
+insert into a values(6,3);
+
+create table b (id bigint not null primary key, name varchar(20));
+insert into b values(1,'b1');
+insert into b values(2,'b2');
+insert into b values(3,'b3');
+
+create table c (id bigint not null primary key, name varchar(20));
+insert into c values(1,'c1');
+insert into c values(2,'c2');
+insert into c values(3,'c3');
+
+-- produces a wrong result:
+select b.name, c.id, c.name from facts left join a 
+    on a_id = a.id 
+       left join b 
+               on b_id = b.id 
+               left join c 
+               on c_id = c.id 
+group by b.name, c.name, c.id;
+
+alter table c drop constraint c_id_pkey;
+
+-- produces correct result:
+select b.name, c.id, c.name from facts left join a on a_id = a.id left join b
+on b_id = b.id left join c on c_id = c.id group by b.name, c.name, c.id;
+
+drop table facts;
+drop table a;
+drop table b;
+drop table c;
diff --git 
a/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.err 
b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.err
@@ -0,0 +1,39 @@
+stderr of test 'groupby_primary_key.Bug-2807` in directory 
'test/BugTracker-2011` itself:
+
+
+# 13:55:01 >  
+# 13:55:01 >   mserver5  --debug=10 --set gdk_nr_threads=0  --set 
"gdk_dbfarm=/ufs/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB" --set 
mapi_open=true --set mapi_port=31577 --set monet_prompt= --trace --forcemito 
--set mal_listing=2  "--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 
; echo ; echo Over..
+# 13:55:01 >  
+
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = 
/ufs/niels/scratch/rc-clean/Linux-x86_64/var/monetdb5/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# 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  default_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# builtin opt  minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  gdk_dbfarm = 
/ufs/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 31577
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2011
+# cmdline opt  mal_listing = 0
+
+# 13:55:01 >  
+# 13:55:01 >  mclient -lsql -ftest -i -e --host=alf --port=31577 
+# 13:55:01 >  
+
+
+# 13:55:01 >  
+# 13:55:01 >  Done.
+# 13:55:01 >  
+
diff --git 
a/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.out 
b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/groupby_primary_key.Bug-2807.stable.out
@@ -0,0 +1,136 @@
+stdout of test 'groupby_primary_key.Bug-2807` in directory 
'test/BugTracker-2011` itself:
+
+
+# 13:55:01 >  
+# 13:55:01 >   mserver5  --debug=10 --set gdk_nr_threads=0  --set 
"gdk_dbfarm=/ufs/niels/scratch/rc-clean/Linux-x86_64/var/MonetDB" --set 
mapi_open=true --set mapi_port=31577 --set monet_prompt= --trace --forcemito 
--set mal_listing=2  "--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 
; echo ; echo Over..
+# 13:55:01 >  
+
+# MonetDB 5 server v11.3.2
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2011', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 7.752 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved
+# Visit http://monetdb.cwi.nl/ for further information
+# Listening for connection requests on mapi:monetdb://alf.ins.cwi.nl:31577/
+# MonetDB/GIS module loaded
+# MonetDB/SQL module loaded
+
+Ready.
+
+Over..
+
+# 13:55:01 >  
+# 13:55:01 >  mclient -lsql -ftest -i -e --host=alf --port=31577 
+# 13:55:01 >  
+
+#create table facts (a_id bigint, b_id bigint);
+#insert into facts values(1,1);
+[ 1    ]
+#insert into facts values(2,1);
+[ 1    ]
+#insert into facts values(3,1);
+[ 1    ]
+#insert into facts values(4,1);
+[ 1    ]
+#insert into facts values(5,1);
+[ 1    ]
+#insert into facts values(6,1);
+[ 1    ]
+#insert into facts values(1,2);
+[ 1    ]
+#insert into facts values(2,2);
+[ 1    ]
+#insert into facts values(3,2);
+[ 1    ]
+#insert into facts values(4,2);
+[ 1    ]
+#insert into facts values(5,2);
+[ 1    ]
+#insert into facts values(6,2);
+[ 1    ]
+#insert into facts values(1,3);
+[ 1    ]
+#insert into facts values(2,3);
+[ 1    ]
+#insert into facts values(3,3);
+[ 1    ]
+#insert into facts values(4,3);
+[ 1    ]
+#insert into facts values(5,3);
+[ 1    ]
+#insert into facts values(6,3);
+[ 1    ]
+#create table a (id bigint not null primary key, c_id bigint);
+#insert into a values(1,1);
+[ 1    ]
+#insert into a values(2,1);
+[ 1    ]
+#insert into a values(3,2);
+[ 1    ]
+#insert into a values(4,2);
+[ 1    ]
+#insert into a values(5,3);
+[ 1    ]
+#insert into a values(6,3);
+[ 1    ]
+#create table b (id bigint not null primary key, name varchar(20));
+#insert into b values(1,'b1');
+[ 1    ]
+#insert into b values(2,'b2');
+[ 1    ]
+#insert into b values(3,'b3');
+[ 1    ]
+#create table c (id bigint not null primary key, name varchar(20));
+#insert into c values(1,'c1');
+[ 1    ]
+#insert into c values(2,'c2');
+[ 1    ]
+#insert into c values(3,'c3');
+[ 1    ]
+#select b.name, c.id, c.name from facts left join a 
+#    on a_id = a.id 
+#      left join b 
+#              on b_id = b.id 
+#              left join c 
+#              on c_id = c.id 
+#group by b.name, c.name, c.id;
+% .b,  .c,     .c # table_name
+% name,        id,     name # name
+% varchar,     bigint, varchar # type
+% 2,   1,      2 # length
+[ "b1",        1,      "c1"    ]
+[ "b1",        2,      "c2"    ]
+[ "b2",        1,      "c1"    ]
+[ "b1",        3,      "c3"    ]
+[ "b2",        2,      "c2"    ]
+[ "b2",        3,      "c3"    ]
+[ "b3",        1,      "c1"    ]
+[ "b3",        2,      "c2"    ]
+[ "b3",        3,      "c3"    ]
+#alter table c drop constraint c_id_pkey;
+#select b.name, c.id, c.name from facts left join a on a_id = a.id left join b
+#on b_id = b.id left join c on c_id = c.id group by b.name, c.name, c.id;
+% .b,  .c,     .c # table_name
+% name,        id,     name # name
+% varchar,     bigint, varchar # type
+% 2,   1,      2 # length
+[ "b1",        1,      "c1"    ]
+[ "b1",        2,      "c2"    ]
+[ "b2",        1,      "c1"    ]
+[ "b1",        3,      "c3"    ]
+[ "b2",        2,      "c2"    ]
+[ "b2",        3,      "c3"    ]
+[ "b3",        1,      "c1"    ]
+[ "b3",        2,      "c2"    ]
+[ "b3",        3,      "c3"    ]
+#drop table facts;
+#drop table a;
+#drop table b;
+#drop table c;
+
+# 13:55:01 >  
+# 13:55:01 >  Done.
+# 13:55:01 >  
+
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to