Bugs item #2075243, was opened at 2008-08-26 07:23
Message generated for change (Comment added) made by nielsnes
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2075243&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: MonetDB5 5.6
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Qian Qiao (drizzlerain)
Assigned to: Niels Nes (nielsnes)
Summary: the result of the account columns selected is wrong

Initial Comment:
OS: RedHat Linux AS 4
GCC:3.4.6

1.setup:
CREATE TABLE A (
          COL1   INTEGER,
          COL2   INTEGER,
          COL3   INTEGER
);

2.insert:
INSERT INTO A VALUES(1000,-2000,NULL);

3.execute:
SELECT (-COL2+COL1)
            FROM A
            WHERE COL3 IS NULL;

4.result:
+----------------------+
| sql_add_sql_neg_col2 |
+======================+
|                 6866 |
+----------------------+

5.question:
The result is wrong.

----------------------------------------------------------------------

>Comment By: Niels Nes (nielsnes)
Date: 2008-09-09 12:55

Message:
handling of is NULL was wrong

----------------------------------------------------------------------

Comment By: Niels Nes (nielsnes)
Date: 2008-08-26 13:53

Message:
Logged In: YES 
user_id=43556
Originator: NO

related to bug #2075157. Test included in to the
auto_coersion_bug.SF-2075157.sql 
                                        

----------------------------------------------------------------------

Comment By: Stefan Manegold (stmane)
Date: 2008-08-26 07:44

Message:
Logged In: YES 
user_id=572415
Originator: NO

This might help debugging:

sql>CREATE TABLE A (
more>COL1 INTEGER,
more>COL2 INTEGER,
more>COL3 INTEGER
more>);
sql>INSERT INTO A VALUES(1000,-2000,NULL);
Rows affected 1
sql>select * from A;
+------+------+-----+
| col1 |col2  |col3 |
+======+======+=====+
| 1000 |-2000 |null |
+------+------+-----+
sql>SELECT (-COL2+COL1)
more>FROM A;
+----------------------+
| sql_add_sql_neg_col2 |
+======================+
|                 3000 |
+----------------------+
sql>SELECT (-COL2+COL1)
more>FROM A
more>WHERE COL3 IS NULL;
+----------------------+
| sql_add_sql_neg_col2 |
+======================+
|                 6000 |
+----------------------+
sql>SELECT (-COL2+COL1)
more>FROM A
more>WHERE COL3 IS NULL;
+----------------------+
| sql_add_sql_neg_col2 |
+======================+
|                 9000 |
+----------------------+
sql>SELECT (-COL2+COL1)
more>FROM A
more>WHERE COL3 IS NULL;
+----------------------+
| sql_add_sql_neg_col2 |
+======================+
|                12000 |
+----------------------+


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=2075243&group_id=56967

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to