List:Commits« Previous MessageNext Message »
From:Roy Lyseng Date:August 25 2010 6:43pm
Subject:Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)
Bug#51070
View as plain text  
>> +SELECT * FROM t1 WHERE ( a, b ) IN ( SELECT c, d FROM t2 ) IS NULL;
>> +SELECT * FROM t1 WHERE ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS UNKNOWN;
>> +SELECT * FROM t1 WHERE (( a, b ) NOT IN ( SELECT c, d FROM t2 )) IS UNKNOWN;
>
> as you add (), is it that
> ( a, b ) NOT IN ( SELECT c, d FROM t2 ) IS UNKNOWN
> stands for
> ( a, b ) NOT IN (( SELECT c, d FROM t2 ) IS UNKNOWN)
> ? Mmmm no that wouldn't be parsable, (c,d) can't be compared to UNKNOWN.
> Then maybe the added () are "just for fun"?

They are different, but equivalent, syntactic constructs, so it can have some 
value in checking that the parser does a proper job.

They are both incarnations of:
<boolean test> ::= <boolean primary> [ IS [ NOT ] <truth value> ]

But in the first case, the <boolean primary> is a <predicate>, more precisely
an
<in predicate>.

In the second case, the <boolean primary> is a <boolean predicand>, which 
traslates to a <parenthesized boolean value expression>, which is
<parenthesized boolean value expression>, which again is
<left paren> <boolean value expression> <right paren>.

Finally, the <boolean value expression> is translated to a <predicate>, as
above.

 From your SQL oracle...
Thread
Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)Bug#51070Guilhem Bichot25 Aug
  • Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)Bug#51070Roy Lyseng25 Aug
  • Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)Bug#51070Martin Hansson30 Aug
    • Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)Bug#51070Guilhem Bichot31 Aug
      • Re: bzr commit into mysql-5.1-bugteam branch (martin.hansson:3478)Bug#51070Roy Lyseng31 Aug