Bugs item #1960253, was opened at 2008-05-08 15:17
Message generated for change (Comment added) made by romulog
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=482468&aid=1960253&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: SQL CVS Head
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Romulo Goncalves (romulog)
Assigned to: Niels Nes (nielsnes)
Summary: comparison with several values

Initial Comment:
The example shows the problem:
sql>select * from tables where id = 0 = 1 = 0 = 1 LIMIT 1;
+-----+--------+----------+------+-----+-------+--------------+----------+
| id  |name    |schema_id |query |type |system |commit_action |temporary |
+=====+========+==========+======+=====+=======+==============+==========+
| 980 |schemas |      979 |null  |   0 |true   |            0 |        0 |
+-----+--------+----------+------+-----+-------+--------------+----------+
sql>

The problem is in the this part of the sql_parser:
predicate:
    comparison_predicate
 |  between_predicate
 |  like_predicate
 |  test_for_null
 |  in_predicate
 |  all_or_any_predicate
 |  existence_test
 |  scalar_exp
 ;

pred_exp:
    predicate
 ;

To compare we have the following cases:

comparison_predicate:
    pred_exp COMPARISON pred_exp
 |  pred_exp '=' pred_exp
 ;

It not only allows infinite comparison using pred_exp, but it also has wrong 
semantics once the comparison is done to more than one value.

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

>Comment By: Romulo Goncalves (romulog)
Date: 2008-05-08 15:24

Message:
Logged In: YES 
user_id=1498628
Originator: YES

Well, 

The semantics might be correct because there is no table with id = 0 (id =
0 false), but if then I do "= 1 = 0 = 1" I make the clause id = 0 (which
was false) true. 
In this case I will get the first row of the table tables (because I used
LIMIT 1).

Is this correct and accepted on SQL?

Romulo

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

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

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to