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

Added the equivalence operator. The major index optimizations are done.

Notes:
1) Some optimizations will follow after more deep analysis.
2) The syntax "==" is not yet agreed on. I'd prefer it to be changed.
This commit is contained in:
dimitr 2004-10-14 18:54:54 +00:00
parent f896ff358f
commit cd413c9b8a
8 changed files with 3336 additions and 3271 deletions

View File

@ -2039,6 +2039,9 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_eql:
verb = "eql";
break;
case nod_equiv:
verb = "equiv";
break;
case nod_erase:
verb = "erase";
break;

View File

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

View File

@ -296,6 +296,9 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
case nod_eql:
blr_operator = blr_eql;
break;
case nod_equiv:
blr_operator = blr_equiv;
break;
case nod_neq_all:
case nod_neq_any:
case nod_neq:

View File

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

View File

@ -333,7 +333,8 @@ enum nod_t
nod_exec_block, // EXECUTE BLOCK support
nod_param_val, // default value for SP parameters support
nod_rows, // ROWS support
nod_query_spec
nod_query_spec,
nod_equiv
};
typedef nod_t NOD_TYPE;

File diff suppressed because it is too large Load Diff

View File

@ -507,13 +507,14 @@ 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
%left '=' '<' '>' LIKE EQL NEQ GTR LSS GEQ LEQ NOT_GTR NOT_LSS EQUIV
%left '+' '-'
%left '*' '/'
%left CONCATENATE
@ -3473,6 +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); }
;

View File

@ -728,6 +728,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
case nod_udf:
return pass1_udf(request, input, proc_flag);
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -796,6 +797,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
}
else {
switch (input->nod_type) {
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -927,6 +929,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
sub3 = node->nod_arg[2];
// FALLINTO
case nod_assign:
case nod_equiv:
case nod_eql:
case nod_gtr:
case nod_geq:
@ -1806,6 +1809,7 @@ static bool aggregate_found2(const dsql_req* request, const dsql_nod* node,
case nod_or:
case nod_and:
case nod_not:
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -2550,6 +2554,7 @@ static bool invalid_reference(const dsql_ctx* context, const dsql_nod* node,
case nod_subtract2:
case nod_upcase:
case nod_extract:
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -4116,6 +4121,7 @@ static bool pass1_found_aggregate(const dsql_nod* node, USHORT check_scope_level
case nod_divide2:
case nod_multiply2:
case nod_subtract2:
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -4344,6 +4350,7 @@ static bool pass1_found_field(const dsql_nod* node, USHORT check_scope_level,
case nod_divide2:
case nod_multiply2:
case nod_subtract2:
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr:
@ -6854,6 +6861,7 @@ static dsql_nod* remap_field(dsql_req* request, dsql_nod* field,
case nod_or:
case nod_and:
case nod_not:
case nod_equiv:
case nod_eql:
case nod_neq:
case nod_gtr: