Skip to content

Commit

Permalink
More changes related to CORE-5167.
Browse files Browse the repository at this point in the history
  • Loading branch information
asfernandes committed Apr 13, 2016
1 parent f29f550 commit 251ec1c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/sql.extensions/README.data_types
Expand Up @@ -68,8 +68,8 @@ BOOLEAN (FB 3.0)

3. The value TRUE is greater than the value FALSE.

4. Booleans are not implicitly convertible to any other datatype. But it's convertible to/from
strings with CAST.
4. Non-booleans values are not implicitly convertible to boolean in boolean-specific expressions
like predicates and arguments for operators NOT, AND, OR and IS.

5. It's allowed to test booleans without compare with TRUE or FALSE. For example,
"field1 OR field2" and "NOT field1" are valid expressions. It's also allowed to compare with
Expand Down
12 changes: 10 additions & 2 deletions src/dsql/parse.y
Expand Up @@ -6012,9 +6012,17 @@ boolean_value_expression
| '(' boolean_value_expression ')'
{ $$ = $2; }
| value IS boolean_literal
{ $$ = newNode<ComparativeBoolNode>(blr_eql, $1, $3); }
{
ComparativeBoolNode* node = newNode<ComparativeBoolNode>(blr_eql, $1, $3);
node->dsqlCheckBoolean = true;
$$ = node;
}
| value IS NOT boolean_literal
{ $$ = newNode<NotBoolNode>(newNode<ComparativeBoolNode>(blr_eql, $1, $4)); }
{
ComparativeBoolNode* node = newNode<ComparativeBoolNode>(blr_eql, $1, $4);
node->dsqlCheckBoolean = true;
$$ = newNode<NotBoolNode>(node);
}
;

%type <boolExprNode> predicate
Expand Down

0 comments on commit 251ec1c

Please sign in to comment.