8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 06:03:02 +01:00

Replaced "==" with a SQL-99 compliant distinct predicate.

This commit is contained in:
dimitr 2004-10-17 08:47:15 +00:00
parent fdcd48734a
commit a9370eefa8
4 changed files with 3524 additions and 3546 deletions

View File

@ -259,4 +259,3 @@
#define IIF 515
#define SCALAR_ARRAY 516
#define CROSS 517
#define EQUIV 518

View File

@ -28,7 +28,7 @@
* Contributor(s):
*
*
* $Id: keywords.cpp,v 1.35 2004-10-14 18:54:48 dimitr Exp $
* $Id: keywords.cpp,v 1.36 2004-10-17 08:47:12 dimitr Exp $
*
*/
@ -55,7 +55,6 @@ static const TOK tokens[] = {
{EQL, "=", 1},
{GTR, ">", 1},
{GEQ, ">=", 1},
{EQUIV, "==", 2},
{ACTION, "ACTION", 1},
{ACTIVE, "ACTIVE", 1},
{ADD, "ADD", 1},

File diff suppressed because it is too large Load Diff

View File

@ -507,14 +507,13 @@ static LexerState lex;
%token IIF
%token SCALAR_ARRAY
%token CROSS
%token EQUIV
/* precedence declarations for expression evaluation */
%left OR
%left AND
%left NOT
%left '=' '<' '>' LIKE EQL NEQ GTR LSS GEQ LEQ NOT_GTR NOT_LSS EQUIV
%left '=' '<' '>' LIKE EQL NEQ GTR LSS GEQ LEQ NOT_GTR NOT_LSS
%left '+' '-'
%left '*' '/'
%left CONCATENATE
@ -3443,8 +3442,9 @@ simple_search_condition : predicate
| NOT simple_search_condition
{ $$ = make_node (nod_not, 1, $2); }
;
predicate : comparison_predicate
| distinct_predicate
| between_predicate
| like_predicate
| in_predicate
@ -3474,11 +3474,8 @@ comparison_predicate : value '=' value
{ $$ = make_node (nod_geq, 2, $1, $3); }
| value NEQ value
{ $$ = make_node (nod_neq, 2, $1, $3); }
| value EQUIV value
{ $$ = make_node (nod_equiv, 2, $1, $3); }
;
/* quantified comparisons */
quantified_predicate : value '=' ALL '(' column_select ')'
@ -3522,6 +3519,12 @@ some : SOME
/* other predicates */
distinct_predicate : value IS DISTINCT FROM value
{ $$ = make_node (nod_not, 1, make_node (nod_equiv, 2, $1, $5)); }
| value IS NOT DISTINCT FROM value
{ $$ = make_node (nod_equiv, 2, $1, $6); }
;
between_predicate : value BETWEEN value AND value
{ $$ = make_node (nod_between, 3, $1, $3, $5); }
| value NOT BETWEEN value AND value