Bugs item #2604583, was opened at 2009-02-16 06:35
Message generated for change (Comment added) made by nielsnes
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2604583&group_id=56967
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SQL/Core
Group: None
Status: Open
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: z lh (zlh)
Assigned to: Niels Nes (nielsnes)
Summary: the count() return null while expect 0
Initial Comment:
--the count() return null while expect 0
create table t1( a int , b int ) ;
insert into t1 values ( 3, 1 ) , ( 4, 2 ) , ( 5, 3 ) , ( 6, 4 ) , ( 7, 5 ) ;
select * from t1;
select ( select count( * )+1
from t1 as tt3
where tt3.b < tt2.b )
from t1 as tt2 ;
---------------------------------
--the result : the last SQL should returns 1,2,3,4,5 , not null,2,3,4,5
sql>create table t1( a int , b int ) ;
0 tuples
sql>insert into t1 values ( 3, 1 ) , ( 4, 2 ) , ( 5, 3 ) , ( 6, 4 ) , ( 7, 5 )
;
Rows affected 5
sql>
0 tuples
sql>select * from t1;
+---+---+
| a | b |
+===+===+
| 3 | 1 |
| 4 | 2 |
| 5 | 3 |
| 6 | 4 |
| 7 | 5 |
+---+---+
5 tuples
sql>select ( select count( * )+1
more> from t1 as tt3
more> where tt3.b < tt2.b )
more>from t1 as tt2 ;
+-----------------+
| sql_add_count_b |
+=================+
| null |
| 2 |
| 3 |
| 4 |
| 5 |
+-----------------+
5 tuples
----------------------------------------------------------------------
>Comment By: Niels Nes (nielsnes)
Date: 2009-02-17 12:48
Message:
Added test count_bug.SF-2604583. Fixed we properly count the expressions
result (sql sub-execute-semantics)
----------------------------------------------------------------------
Comment By: Niels Nes (nielsnes)
Date: 2009-02-16 21:09
Message:
on the current stable the results are different (2,2,3,4,5). The first 2
seems wrong (not sure though).
When we change the count(*) into a count(tt3.b), we get the correct
(1,2,3,4,5).
----------------------------------------------------------------------
Comment By: z lh (zlh)
Date: 2009-02-16 13:29
Message:
the version Nov-SP2, and there is also the bug before the version
[...@localhost ~]$ /home/zlh/MonetDB_nov_sp2/MonetDB/bin/mserver5
--dbinit
'include sql;' --dbname test
# MonetDB server v5.8.4, based on kernel v1.26.4
# Serving database 'test', using 2 threads
# Compiled for i686-pc-linux-gnu/32bit with 32bit OIDs dynamically linked
# Copyright (c) 1993-July 2008 CWI.
# Copyright (c) August 2008- MonetDB B.V., all rights reserved
# Visit http://monetdb.cwi.nl/ for further information
#warning: please don't forget to set your vault key!
#(see /home/zlh/MonetDB_nov_sp2/MonetDB/etc/monetdb5.conf)
# Listening for connection requests on mapi:monetdb://127.0.0.1:50000/
# MonetDB/SQL module v2.26.4 loaded
>
----------------------------------------------------------------------
Comment By: Stefan Manegold (stmane)
Date: 2009-02-16 07:08
Message:
zlh,
could you please indicate, which version of MonetDB you are using,
e.g., by selecting either 'SQL CVS Head' or 'SQL "stable"' as 'Group" for
this bug report,
and providing the output of `mserver5 --version`.
Thanks!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2604583&group_id=56967
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs