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

-BOOLEAN cleaning

-Rename rse to gpre_rse (Nickolay's request)
This commit is contained in:
brodsom 2003-09-12 02:21:53 +00:00
parent 0a50e1d10a
commit 882be4631a
15 changed files with 227 additions and 212 deletions

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: cmd.cpp,v 1.13 2003-09-11 02:13:46 brodsom Exp $ // $Id: cmd.cpp,v 1.14 2003-09-12 02:21:53 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -1123,7 +1123,8 @@ static void create_set_default_trg(GPRE_REQ request,
/* search for domain in db system tables */ /* search for domain in db system tables */
if (MET_get_domain_default(relation->rel_database, if (MET_get_domain_default(relation->rel_database,
search_for_domain, search_for_domain,
default_val, sizeof(default_val))) { default_val, sizeof(default_val)))
{
create_default_blr(request, default_val, create_default_blr(request, default_val,
sizeof(default_val)); sizeof(default_val));
} }
@ -1914,7 +1915,7 @@ static bool create_view(GPRE_REQ request,
SYM symbol; SYM symbol;
SSHORT position, non_updateable = 0; SSHORT position, non_updateable = 0;
TEXT *view_source; TEXT *view_source;
RSE select; GPRE_RSE select;
GPRE_TRG trigger; GPRE_TRG trigger;
GPRE_CTX contexts[3]; GPRE_CTX contexts[3];
SSHORT count; SSHORT count;
@ -2904,7 +2905,7 @@ static void put_trigger_blr(
//____________________________________________________________ //____________________________________________________________
// //
// Generate BLR for a trigger for a VIEW WITH CHECK OPTION. // Generate BLR for a trigger for a VIEW WITH CHECK OPTION.
// This is messy, the RSE passed in is mutilated by the end. // This is messy, the GPRE_RSE passed in is mutilated by the end.
// Fields in the where clause and in the VIEW definition, are replaced // Fields in the where clause and in the VIEW definition, are replaced
// by the VIEW fields. // by the VIEW fields.
// For fields in the where clause but not in the VIEW definition, // For fields in the where clause but not in the VIEW definition,
@ -2920,9 +2921,9 @@ static void put_view_trigger_blr(
GPRE_NOD view_boolean, GPRE_CTX * contexts, GPRE_NOD set_list) GPRE_NOD view_boolean, GPRE_CTX * contexts, GPRE_NOD set_list)
{ {
USHORT length, offset; USHORT length, offset;
RSE node; GPRE_RSE node;
node = (RSE) trigger->trg_boolean; node = (GPRE_RSE) trigger->trg_boolean;
STUFF(operator_); STUFF(operator_);
offset = request->req_blr - request->req_base; offset = request->req_blr - request->req_base;
STUFF_WORD(0); STUFF_WORD(0);
@ -2987,7 +2988,7 @@ GPRE_NOD view_boolean, GPRE_CTX * contexts, GPRE_NOD set_list)
//____________________________________________________________ //____________________________________________________________
// //
// Replace fields in given rse by fields referenced in VIEW. // Replace fields in given rse by fields referenced in VIEW.
// if fields in RSE are not part of VIEW definition, then they // if fields in GPRE_RSE are not part of VIEW definition, then they
// are not changed. // are not changed.
// If search list is not specified, then only the context of the fields // If search list is not specified, then only the context of the fields
// in the rse is chaged to contexts[2]. // in the rse is chaged to contexts[2].

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: cme.cpp,v 1.8 2003-09-10 19:48:53 brodsom Exp $ // $Id: cme.cpp,v 1.9 2003-09-12 02:21:53 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -352,7 +352,7 @@ void CME_expr(GPRE_NOD node, GPRE_REQ request)
case nod_unique: case nod_unique:
// count2 next line would be deleted // count2 next line would be deleted
case nod_count: case nod_count:
CME_rse((RSE) node->nod_arg[0], request); CME_rse((GPRE_RSE) node->nod_arg[0], request);
break; break;
case nod_max: case nod_max:
@ -363,12 +363,12 @@ void CME_expr(GPRE_NOD node, GPRE_REQ request)
// //
// case nod_count: // case nod_count:
// //
CME_rse((RSE) node->nod_arg[0], request); CME_rse((GPRE_RSE) node->nod_arg[0], request);
CME_expr(node->nod_arg[1], request); CME_expr(node->nod_arg[1], request);
break; break;
case nod_via: case nod_via:
CME_rse((RSE) node->nod_arg[0], request); CME_rse((GPRE_RSE) node->nod_arg[0], request);
CME_expr(node->nod_arg[1], request); CME_expr(node->nod_arg[1], request);
CME_expr(node->nod_arg[2], request); CME_expr(node->nod_arg[2], request);
} }
@ -988,7 +988,7 @@ void CME_get_dtype( GPRE_NOD node, GPRE_FLD f)
void CME_relation(GPRE_CTX context, GPRE_REQ request) void CME_relation(GPRE_CTX context, GPRE_REQ request)
{ {
RSE rs_stream; GPRE_RSE rs_stream;
GPRE_REL relation; GPRE_REL relation;
GPRE_PRC procedure; GPRE_PRC procedure;
GPRE_NOD inputs, *ptr, *end; GPRE_NOD inputs, *ptr, *end;
@ -1058,10 +1058,10 @@ void CME_relation(GPRE_CTX context, GPRE_REQ request)
// Generate blr for an rse node. // Generate blr for an rse node.
// //
void CME_rse(rse* selection, GPRE_REQ request) void CME_rse(gpre_rse* selection, GPRE_REQ request)
{ {
GPRE_NOD temp, union_node, *ptr, *end, list; GPRE_NOD temp, union_node, *ptr, *end, list;
RSE sub_rse; GPRE_RSE sub_rse;
SSHORT i; SSHORT i;
if (selection->rse_join_type == (NOD_T) 0) if (selection->rse_join_type == (NOD_T) 0)
@ -1087,7 +1087,7 @@ void CME_rse(rse* selection, GPRE_REQ request)
ptr = union_node->nod_arg; ptr = union_node->nod_arg;
for (end = ptr + union_node->nod_count; ptr < end; ptr++) for (end = ptr + union_node->nod_count; ptr < end; ptr++)
{ {
sub_rse = (RSE) * ptr; sub_rse = (GPRE_RSE) * ptr;
CME_rse(sub_rse, request); CME_rse(sub_rse, request);
cmp_map(sub_rse->rse_map, request); cmp_map(sub_rse->rse_map, request);
} }
@ -1285,7 +1285,7 @@ static GPRE_NOD cmp_array( GPRE_NOD node, GPRE_REQ request)
//____________________________________________________________ //____________________________________________________________
// //
// Compile up a subscripted array reference // Compile up a subscripted array reference
// from an RSE and output blr for this reference // from an GPRE_RSE and output blr for this reference
// //
static GPRE_NOD cmp_array_element( GPRE_NOD node, GPRE_REQ request) static GPRE_NOD cmp_array_element( GPRE_NOD node, GPRE_REQ request)

View File

@ -27,6 +27,6 @@
extern void CME_expr(GPRE_NOD, GPRE_REQ); extern void CME_expr(GPRE_NOD, GPRE_REQ);
extern void CME_get_dtype(GPRE_NOD, GPRE_FLD); extern void CME_get_dtype(GPRE_NOD, GPRE_FLD);
extern void CME_relation(GPRE_CTX, GPRE_REQ); extern void CME_relation(GPRE_CTX, GPRE_REQ);
extern void CME_rse(RSE, GPRE_REQ); extern void CME_rse(GPRE_RSE, GPRE_REQ);
#endif /* _GPRE_CME_PROTO_H_ */ #endif /* _GPRE_CME_PROTO_H_ */

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: cmp.cpp,v 1.17 2003-09-11 02:13:46 brodsom Exp $ // $Id: cmp.cpp,v 1.18 2003-09-12 02:21:53 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -164,11 +164,11 @@ void CMP_compile_request( GPRE_REQ request)
// constructed. If not, do so now. // constructed. If not, do so now.
if (!eof_field) { if (!eof_field) {
eof_field = eof_field = MET_make_field(utility_name, dtype_short, sizeof(SSHORT),
MET_make_field(utility_name, dtype_short, sizeof(SSHORT), FALSE); false);
count_field = count_field = MET_make_field(count_name, dtype_long, sizeof(SLONG),
MET_make_field(count_name, dtype_long, sizeof(SLONG), FALSE); false);
slack_byte_field = MET_make_field(slack_name, dtype_text, 1, FALSE); slack_byte_field = MET_make_field(slack_name, dtype_text, 1, false);
reference = (REF) ALLOC(REF_LEN); reference = (REF) ALLOC(REF_LEN);
reference->ref_value = "0"; reference->ref_value = "0";
lit0 = MSC_unary(nod_literal, (GPRE_NOD) reference); lit0 = MSC_unary(nod_literal, (GPRE_NOD) reference);
@ -221,10 +221,10 @@ void CMP_compile_request( GPRE_REQ request)
if (request->req_flags & REQ_sql_cursor && if (request->req_flags & REQ_sql_cursor &&
request->req_database->dbb_base_level >= 5) { request->req_database->dbb_base_level >= 5) {
direction_field = direction_field = MET_make_field("direction", dtype_short,
MET_make_field("direction", dtype_short, sizeof(SSHORT), FALSE); sizeof(SSHORT), false);
offset_field = offset_field = MET_make_field("offset", dtype_long, sizeof(SLONG),
MET_make_field("offset", dtype_long, sizeof(SLONG), FALSE); false);
reference = request->req_avalues; reference = request->req_avalues;
reference->ref_field = direction_field; reference->ref_field = direction_field;
@ -977,7 +977,7 @@ static void cmp_loop( GPRE_REQ request)
GPRE_NOD node, list, *ptr, *end, counter; GPRE_NOD node, list, *ptr, *end, counter;
POR primary; POR primary;
GPRE_CTX for_context, update_context; GPRE_CTX for_context, update_context;
rse* selection; gpre_rse* selection;
REF reference; REF reference;
node = request->req_node; node = request->req_node;

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: exp.cpp,v 1.18 2003-09-11 02:13:45 brodsom Exp $ // $Id: exp.cpp,v 1.19 2003-09-12 02:21:53 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -732,7 +732,7 @@ GPRE_REL EXP_relation(void)
// parsed the <contect> IN part of the expression. // parsed the <contect> IN part of the expression.
// //
RSE EXP_rse(GPRE_REQ request, SYM initial_symbol) GPRE_RSE EXP_rse(GPRE_REQ request, SYM initial_symbol)
{ {
GPRE_NOD first = NULL; GPRE_NOD first = NULL;
GPRE_NOD item; GPRE_NOD item;
@ -740,7 +740,7 @@ RSE EXP_rse(GPRE_REQ request, SYM initial_symbol)
GPRE_NOD sort; GPRE_NOD sort;
GPRE_NOD *ptr; GPRE_NOD *ptr;
GPRE_NOD upcase; GPRE_NOD upcase;
RSE rec_expr; GPRE_RSE rec_expr;
GPRE_CTX context; GPRE_CTX context;
LLS items; LLS items;
LLS directions; LLS directions;
@ -750,7 +750,7 @@ RSE EXP_rse(GPRE_REQ request, SYM initial_symbol)
if (MATCH(KW_FIRST)) { if (MATCH(KW_FIRST)) {
if (!count_field) if (!count_field)
count_field = MET_make_field("jrd_count", dtype_long, 4, FALSE); count_field = MET_make_field("jrd_count", dtype_long, 4, false);
first = par_value(request, count_field); first = par_value(request, count_field);
} }
@ -778,7 +778,7 @@ RSE EXP_rse(GPRE_REQ request, SYM initial_symbol)
// build rse node // build rse node
rec_expr = (RSE) ALLOC(RSE_LEN(count)); rec_expr = (GPRE_RSE) ALLOC(RSE_LEN(count));
rec_expr->rse_count = count; rec_expr->rse_count = count;
rec_expr->rse_first = first; rec_expr->rse_first = first;
rec_expr->rse_boolean = boolean; rec_expr->rse_boolean = boolean;
@ -882,7 +882,7 @@ RSE EXP_rse(GPRE_REQ request, SYM initial_symbol)
// selection expression. // selection expression.
// //
void EXP_rse_cleanup( RSE rs) void EXP_rse_cleanup( GPRE_RSE rs)
{ {
GPRE_NOD node; GPRE_NOD node;
GPRE_CTX *context, *end; GPRE_CTX *context, *end;
@ -906,7 +906,7 @@ void EXP_rse_cleanup( RSE rs)
if (node = rs->rse_union) if (node = rs->rse_union)
for (i = 0; i < node->nod_count; i++) for (i = 0; i < node->nod_count; i++)
EXP_rse_cleanup((RSE) node->nod_arg[i]); EXP_rse_cleanup((GPRE_RSE) node->nod_arg[i]);
} }
@ -1110,7 +1110,7 @@ static GPRE_NOD par_and( GPRE_REQ request)
// //
// Parse a array element reference // Parse a array element reference
// (array name and subscript list) // (array name and subscript list)
// in an RSE. // in an GPRE_RSE.
// //
static GPRE_NOD par_array(GPRE_REQ request, static GPRE_NOD par_array(GPRE_REQ request,
@ -1142,7 +1142,7 @@ static GPRE_NOD par_array(GPRE_REQ request,
if (paren || bracket) { if (paren || bracket) {
if (!subscript_field) if (!subscript_field)
subscript_field = MET_make_field("gds_array_subscript", dtype_long, subscript_field = MET_make_field("gds_array_subscript", dtype_long,
4, FALSE); 4, false);
/* Parse a commalist of subscripts and build a tree of index nodes */ /* Parse a commalist of subscripts and build a tree of index nodes */
@ -1493,7 +1493,7 @@ static GPRE_NOD par_relational( GPRE_REQ request)
expr = MAKE_NODE(nod_any, 1); expr = MAKE_NODE(nod_any, 1);
expr->nod_count = 0; expr->nod_count = 0;
expr->nod_arg[0] = (GPRE_NOD) EXP_rse(request, 0); expr->nod_arg[0] = (GPRE_NOD) EXP_rse(request, 0);
EXP_rse_cleanup((RSE) expr->nod_arg[0]); EXP_rse_cleanup((GPRE_RSE) expr->nod_arg[0]);
return expr; return expr;
} }
@ -1501,7 +1501,7 @@ static GPRE_NOD par_relational( GPRE_REQ request)
expr = MAKE_NODE(nod_unique, 1); expr = MAKE_NODE(nod_unique, 1);
expr->nod_count = 0; expr->nod_count = 0;
expr->nod_arg[0] = (GPRE_NOD) EXP_rse(request, 0); expr->nod_arg[0] = (GPRE_NOD) EXP_rse(request, 0);
EXP_rse_cleanup((RSE) expr->nod_arg[0]); EXP_rse_cleanup((GPRE_RSE) expr->nod_arg[0]);
return expr; return expr;
} }

View File

@ -34,8 +34,8 @@ extern void EXP_post_array(REF);
extern REF EXP_post_field(GPRE_FLD, GPRE_CTX, USHORT); extern REF EXP_post_field(GPRE_FLD, GPRE_CTX, USHORT);
extern bool EXP_match_paren(void); extern bool EXP_match_paren(void);
extern GPRE_REL EXP_relation(void); extern GPRE_REL EXP_relation(void);
extern RSE EXP_rse(GPRE_REQ, SYM); extern GPRE_RSE EXP_rse(GPRE_REQ, SYM);
extern void EXP_rse_cleanup(RSE); extern void EXP_rse_cleanup(GPRE_RSE);
extern GPRE_NOD EXP_subscript(GPRE_REQ); extern GPRE_NOD EXP_subscript(GPRE_REQ);
extern SLONG EXP_SLONG_ordinal(USHORT); extern SLONG EXP_SLONG_ordinal(USHORT);
extern SINT64 EXP_SINT64_ordinal(USHORT); extern SINT64 EXP_SINT64_ordinal(USHORT);

View File

@ -20,7 +20,7 @@
// //
// All Rights Reserved. // All Rights Reserved.
// Contributor(s): ______________________________________. // Contributor(s): ______________________________________.
// $Id: gpre.cpp,v 1.33 2003-09-11 02:13:45 brodsom Exp $ // $Id: gpre.cpp,v 1.34 2003-09-12 02:21:53 brodsom Exp $
// Revision 1.2 2000/11/16 15:54:29 fsg // Revision 1.2 2000/11/16 15:54:29 fsg
// Added new switch -verbose to gpre that will dump // Added new switch -verbose to gpre that will dump
// parsed lines to stderr // parsed lines to stderr
@ -509,7 +509,7 @@ int main(int argc, char* argv[])
/* give it the file name and try to open it */ /* give it the file name and try to open it */
db->dbb_filename = db_filename; db->dbb_filename = db_filename;
if (!MET_database(db, TRUE)) if (!MET_database(db, true))
CPR_exit(FINI_ERROR); CPR_exit(FINI_ERROR);
if (sw_external) if (sw_external)
db->dbb_scope = DBB_EXTERN; db->dbb_scope = DBB_EXTERN;

View File

@ -19,7 +19,7 @@
* *
* All Rights Reserved. * All Rights Reserved.
* Contributor(s): ______________________________________. * Contributor(s): ______________________________________.
* $Id: gpre.h,v 1.41 2003-09-11 10:36:45 aafemt Exp $ * $Id: gpre.h,v 1.42 2003-09-12 02:21:53 brodsom Exp $
* Revision 1.3 2000/11/27 09:26:13 fsg * Revision 1.3 2000/11/27 09:26:13 fsg
* Fixed bugs in gpre to handle PYXIS forms * Fixed bugs in gpre to handle PYXIS forms
* and allow edit.e and fred.e to go through * and allow edit.e and fred.e to go through
@ -894,7 +894,7 @@ typedef struct map {
/* Record selection expresion syntax node */ /* Record selection expresion syntax node */
typedef struct rse { typedef struct gpre_rse {
USHORT rse_type; /* node type */ USHORT rse_type; /* node type */
gpre_nod* rse_boolean; /* boolean expression, if present */ gpre_nod* rse_boolean; /* boolean expression, if present */
gpre_nod* rse_first; /* "first n" clause, if present */ gpre_nod* rse_first; /* "first n" clause, if present */
@ -906,28 +906,28 @@ typedef struct rse {
gpre_nod* rse_group_by; /* list of grouping fields */ gpre_nod* rse_group_by; /* list of grouping fields */
gpre_nod* rse_plan; /* user-specified access plan */ gpre_nod* rse_plan; /* user-specified access plan */
map* rse_map; /* map for aggregates */ map* rse_map; /* map for aggregates */
rse* rse_aggregate; /* Aggregate rse */ gpre_rse* rse_aggregate; /* Aggregate rse */
enum nod_t rse_join_type; /* Join type */ enum nod_t rse_join_type; /* Join type */
USHORT rse_flags; /* flags */ USHORT rse_flags; /* flags */
USHORT rse_count; /* number of relations */ USHORT rse_count; /* number of relations */
gpre_ctx* rse_context[1]; /* context block */ gpre_ctx* rse_context[1]; /* context block */
} *RSE; } *GPRE_RSE;
#ifdef __cplusplus #ifdef __cplusplus
inline size_t RSE_LEN(size_t nItems) inline size_t RSE_LEN(size_t nItems)
{ {
return offsetof(rse, rse_context) + nItems * sizeof(int*); return offsetof(gpre_rse, rse_context) + nItems * sizeof(int*);
} }
#else /* __cplusplus */ #else /* __cplusplus */
#define RSE_LEN(nItems) (offsetof(rse, rse_context) + (nItems) * sizeof(int*)) #define RSE_LEN(nItems) (offsetof(gpre_rse, rse_context) + (nItems) * sizeof(int*))
#endif /* __cplusplus */ #endif /* __cplusplus */
//#define RSE_LEN(cnt) (sizeof(rse) + (cnt - 1) * sizeof (int *)) //#define RSE_LEN(cnt) (sizeof(gpre_rse) + (cnt - 1) * sizeof (int *))
#define RSE_singleton 1 #define RSE_singleton 1
@ -942,7 +942,7 @@ typedef struct gpre_rel {
dbb* rel_database; /* parent database */ dbb* rel_database; /* parent database */
gpre_rel* rel_next; /* next relation in database */ gpre_rel* rel_next; /* next relation in database */
bool rel_meta; /* if true, created for a metadata operation */ bool rel_meta; /* if true, created for a metadata operation */
rse* rel_view_rse; gpre_rse* rel_view_rse;
txt* rel_view_text; /* source for VIEW definition */ txt* rel_view_text; /* source for VIEW definition */
sym* rel_owner; /* owner of relation, if any */ sym* rel_owner; /* owner of relation, if any */
cnstrt* rel_constraints; /* linked list of constraints defined cnstrt* rel_constraints; /* linked list of constraints defined
@ -1144,7 +1144,7 @@ typedef struct gpre_req {
ref* req_index; /* index variable */ ref* req_index; /* index variable */
ref* req_references; /* fields referenced in context */ ref* req_references; /* fields referenced in context */
map* req_map; /* map for aggregates, etc */ map* req_map; /* map for aggregates, etc */
rse* req_rse; /* record selection expression */ gpre_rse* req_rse; /* record selection expression */
por* req_ports; /* linked list of ports */ por* req_ports; /* linked list of ports */
por* req_primary; /* primary input or output port */ por* req_primary; /* primary input or output port */
por* req_sync; /* synchronization port */ por* req_sync; /* synchronization port */
@ -1195,7 +1195,7 @@ typedef struct gpre_ctx {
TEXT *ctx_alias; /* holds SQL alias for passing to engine */ TEXT *ctx_alias; /* holds SQL alias for passing to engine */
gpre_prc* ctx_procedure; /* procedure for context */ gpre_prc* ctx_procedure; /* procedure for context */
gpre_nod* ctx_prc_inputs; /* procedure input parameters */ gpre_nod* ctx_prc_inputs; /* procedure input parameters */
rse* ctx_stream; /* stream for context */ gpre_rse* ctx_stream; /* stream for context */
} *GPRE_CTX; } *GPRE_CTX;
#define CTX_LEN sizeof(gpre_ctx) #define CTX_LEN sizeof(gpre_ctx)

View File

@ -26,7 +26,7 @@
* *
*____________________________________________________________ *____________________________________________________________
* *
* $Id: gpre_meta.epp,v 1.24 2003-09-10 19:48:53 brodsom Exp $ * $Id: gpre_meta.epp,v 1.25 2003-09-12 02:21:53 brodsom Exp $
*/ */
#include "firebird.h" #include "firebird.h"
@ -119,7 +119,7 @@ GPRE_FLD MET_context_field( GPRE_CTX context, char *string)
* database can't be opened, return FALSE. * database can't be opened, return FALSE.
*/ */
BOOLEAN MET_database(dbb* database, BOOLEAN print_version) bool MET_database(dbb* database, bool print_version)
{ {
SCHAR dpb[MAX_PASSWORD_LENGTH + MAX_USER_LENGTH + 5], *d, *p; SCHAR dpb[MAX_PASSWORD_LENGTH + MAX_USER_LENGTH + 5], *d, *p;
static const UCHAR sql_version_info[] = { isc_info_base_level, static const UCHAR sql_version_info[] = { isc_info_base_level,
@ -144,7 +144,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
#ifndef REQUESTER #ifndef REQUESTER
if (sw_language == lang_internal) { if (sw_language == lang_internal) {
JRDMET_init(database); JRDMET_init(database);
return TRUE; return true;
} }
#endif #endif
@ -152,7 +152,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
if (!database->dbb_filename) { if (!database->dbb_filename) {
CPR_error("No database specified"); CPR_error("No database specified");
return FALSE; return false;
} }
/* generate a dpb for the attach from the specified /* generate a dpb for the attach from the specified
@ -188,7 +188,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
(gds_status, 0, database->dbb_filename, &DB, d - &dpb[0], dpb)) { (gds_status, 0, database->dbb_filename, &DB, d - &dpb[0], dpb)) {
*/ */
gds__print_status(gds_status); gds__print_status(gds_status);
return FALSE; return false;
//} //}
} }
@ -204,7 +204,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
if (isc_database_info(isc_status, &DB, sizeof(sql_version_info), if (isc_database_info(isc_status, &DB, sizeof(sql_version_info),
(char*) sql_version_info, sizeof(sql_buffer), (char*) sql_buffer)) { (char*) sql_version_info, sizeof(sql_buffer), (char*) sql_buffer)) {
gds__print_status(isc_status); gds__print_status(isc_status);
return FALSE; return false;
} }
ptr = sql_buffer; ptr = sql_buffer;
@ -284,7 +284,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
if (gds__database_info(gds_status, &DB, sizeof(db_version_info), if (gds__database_info(gds_status, &DB, sizeof(db_version_info),
db_version_info, sizeof(buffer), buffer)) { db_version_info, sizeof(buffer), buffer)) {
gds__print_status(gds_status); gds__print_status(gds_status);
return FALSE; return false;
} }
/* this seems like a lot of rigamarole to read one info item, /* this seems like a lot of rigamarole to read one info item,
@ -326,7 +326,7 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
} }
#endif #endif
return TRUE; return true;
} }
@ -336,13 +336,13 @@ BOOLEAN MET_database(dbb* database, BOOLEAN print_version)
* Initialize the size of the field. * Initialize the size of the field.
*/ */
USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string) bool MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
{ {
SYM symbol; SYM symbol;
dbb* database; dbb* database;
SCHAR name[NAME_SIZE]; SCHAR name[NAME_SIZE];
GPRE_FLD d_field; GPRE_FLD d_field;
SSHORT found = FALSE; bool found = false;
strcpy(name, string); strcpy(name, string);
@ -362,27 +362,27 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
field->fld_charset_id = d_field->fld_charset_id; field->fld_charset_id = d_field->fld_charset_id;
field->fld_collate_id = d_field->fld_collate_id; field->fld_collate_id = d_field->fld_collate_id;
field->fld_char_length = d_field->fld_char_length; field->fld_char_length = d_field->fld_char_length;
return TRUE; return true;
} }
if (!request) if (!request)
return FALSE; return false;
database = request->req_database; database = request->req_database;
if (database->dbb_flags & DBB_sqlca) if (database->dbb_flags & DBB_sqlca)
return FALSE; return false;
DB = database->dbb_handle; DB = database->dbb_handle;
gds_trans = database->dbb_transaction; gds_trans = database->dbb_transaction;
if (!(database->dbb_flags & DBB_v3)) { if (!(database->dbb_flags & DBB_v3)) {
FOR(REQUEST_HANDLE database->dbb_domain_request) FOR(REQUEST_HANDLE database->dbb_domain_request)
F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name found = TRUE; F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name
found = true;
field->fld_length = F.RDB$FIELD_LENGTH; field->fld_length = F.RDB$FIELD_LENGTH;
field->fld_scale = F.RDB$FIELD_SCALE; field->fld_scale = F.RDB$FIELD_SCALE;
field->fld_sub_type = F.RDB$FIELD_SUB_TYPE; field->fld_sub_type = F.RDB$FIELD_SUB_TYPE;
field->fld_dtype = field->fld_dtype = MET_get_dtype(F.RDB$FIELD_TYPE, F.RDB$FIELD_SUB_TYPE,
MET_get_dtype(F.RDB$FIELD_TYPE, F.RDB$FIELD_SUB_TYPE,
&field->fld_length); &field->fld_length);
switch (field->fld_dtype) { switch (field->fld_dtype) {
@ -406,20 +406,19 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
field->fld_collate_id = F.RDB$COLLATION_ID; field->fld_collate_id = F.RDB$COLLATION_ID;
} }
field->fld_ttype = field->fld_ttype = INTL_CS_COLL_TO_TTYPE(field->fld_charset_id,
INTL_CS_COLL_TO_TTYPE(field->fld_charset_id,
field->fld_collate_id); field->fld_collate_id);
END_FOR; END_FOR;
} }
else { else {
FOR(REQUEST_HANDLE database->dbb_domain_request) FOR(REQUEST_HANDLE database->dbb_domain_request)
F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name found = TRUE; F IN RDB$FIELDS WITH F.RDB$FIELD_NAME EQ name
found = true;
field->fld_length = F.RDB$FIELD_LENGTH; field->fld_length = F.RDB$FIELD_LENGTH;
field->fld_scale = F.RDB$FIELD_SCALE; field->fld_scale = F.RDB$FIELD_SCALE;
field->fld_sub_type = F.RDB$FIELD_SUB_TYPE; field->fld_sub_type = F.RDB$FIELD_SUB_TYPE;
field->fld_dtype = field->fld_dtype = MET_get_dtype(F.RDB$FIELD_TYPE, F.RDB$FIELD_SUB_TYPE,
MET_get_dtype(F.RDB$FIELD_TYPE, F.RDB$FIELD_SUB_TYPE,
&field->fld_length); &field->fld_length);
switch (field->fld_dtype) { switch (field->fld_dtype) {
@ -434,8 +433,7 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
break; break;
} }
field->fld_ttype = field->fld_ttype = INTL_CS_COLL_TO_TTYPE(field->fld_charset_id,
INTL_CS_COLL_TO_TTYPE(field->fld_charset_id,
field->fld_collate_id); field->fld_collate_id);
END_FOR; END_FOR;
@ -450,9 +448,10 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
* Gets the default value for a domain of an existing table * Gets the default value for a domain of an existing table
*/ */
BOOLEAN MET_get_domain_default(dbb* database, bool MET_get_domain_default(dbb* database,
TEXT * domain_name, TEXT * domain_name,
TEXT * buffer, USHORT buff_length) TEXT * buffer,
USHORT buff_length)
{ {
FRBRD *DB, *gds_trans; FRBRD *DB, *gds_trans;
SCHAR name[NAME_SIZE]; SCHAR name[NAME_SIZE];
@ -468,9 +467,9 @@ BOOLEAN MET_get_domain_default(dbb* database,
strcpy(name, domain_name); strcpy(name, domain_name);
if (database == NULL) if (database == NULL)
return FALSE; return false;
if ((database->dbb_handle == NULL) && !MET_database(database, FALSE)) if ((database->dbb_handle == NULL) && !MET_database(database, false))
CPR_exit(FINI_ERROR); CPR_exit(FINI_ERROR);
assert(database->dbb_transaction == NULL); assert(database->dbb_transaction == NULL);
@ -531,7 +530,7 @@ BOOLEAN MET_get_domain_default(dbb* database,
buffer[1] = blr_eoc; buffer[1] = blr_eoc;
} }
END_FOR COMMIT; END_FOR COMMIT;
return (has_default? TRUE : FALSE); return has_default;
} }
@ -547,9 +546,10 @@ BOOLEAN MET_get_domain_default(dbb* database,
* Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS. * Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS.
*/ */
BOOLEAN MET_get_column_default(GPRE_REL relation, bool MET_get_column_default(GPRE_REL relation,
TEXT * column_name, TEXT * column_name,
TEXT * buffer, USHORT buff_length) TEXT * buffer,
USHORT buff_length)
{ {
dbb* database; dbb* database;
FRBRD *DB, *gds_trans; FRBRD *DB, *gds_trans;
@ -565,9 +565,9 @@ BOOLEAN MET_get_column_default(GPRE_REL relation,
strcpy(name, column_name); strcpy(name, column_name);
if ((database = relation->rel_database) == NULL) if ((database = relation->rel_database) == NULL)
return FALSE; return false;
if ((database->dbb_handle == NULL) && !MET_database(database, FALSE)) if ((database->dbb_handle == NULL) && !MET_database(database, false))
CPR_exit(FINI_ERROR); CPR_exit(FINI_ERROR);
assert(database->dbb_transaction == NULL); assert(database->dbb_transaction == NULL);
@ -639,7 +639,7 @@ BOOLEAN MET_get_column_default(GPRE_REL relation,
END_FOR; END_FOR;
COMMIT; COMMIT;
return (has_default? TRUE : FALSE); return has_default;
} }
@ -663,7 +663,7 @@ LLS MET_get_primary_key(dbb* database, TEXT * relation_name)
if (database == NULL) if (database == NULL)
return NULL; return NULL;
if ((database->dbb_handle == NULL) && !MET_database(database, FALSE)) if ((database->dbb_handle == NULL) && !MET_database(database, false))
CPR_exit(FINI_ERROR); CPR_exit(FINI_ERROR);
assert(database->dbb_transaction == NULL); assert(database->dbb_transaction == NULL);
@ -1349,14 +1349,15 @@ UDF MET_get_udf(dbb* database, TEXT * string)
/*____________________________________________________________ /*____________________________________________________________
* *
* Return TRUE if the passed view_name represents a * Return relation if the passed view_name represents a
* view with the passed relation as a base table * view with the passed relation as a base table
* (the relation could be an alias). * (the relation could be an alias).
*/ */
GPRE_REL MET_get_view_relation(GPRE_REQ request, GPRE_REL MET_get_view_relation(GPRE_REQ request,
char *view_name, char *view_name,
char *relation_or_alias, USHORT level) char *relation_or_alias,
USHORT level)
{ {
dbb* database; dbb* database;
TEXT *p; TEXT *p;
@ -1379,12 +1380,15 @@ GPRE_REL MET_get_view_relation(GPRE_REQ request,
if (!strcmp(X.RDB$RELATION_NAME, relation_or_alias) || if (!strcmp(X.RDB$RELATION_NAME, relation_or_alias) ||
!strcmp(X.RDB$CONTEXT_NAME, relation_or_alias)) !strcmp(X.RDB$CONTEXT_NAME, relation_or_alias))
{
return MET_get_relation(database, X.RDB$RELATION_NAME, ""); return MET_get_relation(database, X.RDB$RELATION_NAME, "");
}
if (relation = if (relation = MET_get_view_relation(request, X.RDB$RELATION_NAME,
MET_get_view_relation(request, X.RDB$RELATION_NAME, relation_or_alias, relation_or_alias, level + 1))
level + 1)) {
return relation; return relation;
}
END_FOR; END_FOR;
@ -1453,7 +1457,6 @@ void MET_load_hash_table(dbb* database)
udf* an_udf; udf* an_udf;
TEXT *p; TEXT *p;
FRBRD *handle, *handle2; FRBRD *handle, *handle2;
USHORT post_v3_flag;
SLONG length; SLONG length;
INTLSYM iname; INTLSYM iname;
@ -1465,7 +1468,7 @@ void MET_load_hash_table(dbb* database)
return; return;
if (!database->dbb_handle) if (!database->dbb_handle)
if (!MET_database(database, FALSE)) if (!MET_database(database, false))
CPR_exit(FINI_ERROR); CPR_exit(FINI_ERROR);
if (database->dbb_transaction) if (database->dbb_transaction)
@ -1482,12 +1485,12 @@ void MET_load_hash_table(dbb* database)
/* Determine if the database is V3. */ /* Determine if the database is V3. */
post_v3_flag = FALSE; bool post_v3_flag = false;
handle = NULL; handle = NULL;
FOR(REQUEST_HANDLE handle) FOR(REQUEST_HANDLE handle)
X IN RDB$RELATIONS WITH X IN RDB$RELATIONS WITH X.RDB$RELATION_NAME = 'RDB$PROCEDURES' AND
X.RDB$RELATION_NAME = 'RDB$PROCEDURES' AND X.RDB$SYSTEM_FLAG = 1
X.RDB$SYSTEM_FLAG = 1 post_v3_flag = TRUE; post_v3_flag = true;
END_FOR; END_FOR;
gds__release_request(gds_status, &handle); gds__release_request(gds_status, &handle);
@ -1511,7 +1514,7 @@ void MET_load_hash_table(dbb* database)
relation->rel_dbkey = dbkey = MET_make_field("rdb$db_key", dtype_text, relation->rel_dbkey = dbkey = MET_make_field("rdb$db_key", dtype_text,
(X.RDB$DBKEY_LENGTH) ? X. (X.RDB$DBKEY_LENGTH) ? X.
RDB$DBKEY_LENGTH : 8, RDB$DBKEY_LENGTH : 8,
FALSE); false);
dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset; dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset;
dbkey->fld_ttype = ttype_binary; dbkey->fld_ttype = ttype_binary;
@ -1531,7 +1534,7 @@ void MET_load_hash_table(dbb* database)
relation->rel_dbkey = dbkey = MET_make_field("rdb$db_key", dtype_text, relation->rel_dbkey = dbkey = MET_make_field("rdb$db_key", dtype_text,
(X.RDB$DBKEY_LENGTH) ? X. (X.RDB$DBKEY_LENGTH) ? X.
RDB$DBKEY_LENGTH : 8, RDB$DBKEY_LENGTH : 8,
FALSE); false);
dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset; dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset;
dbkey->fld_ttype = ttype_binary; dbkey->fld_ttype = ttype_binary;
@ -1782,7 +1785,7 @@ void MET_load_hash_table(dbb* database)
GPRE_FLD MET_make_field(SCHAR * name, GPRE_FLD MET_make_field(SCHAR * name,
SSHORT dtype, SSHORT dtype,
SSHORT length, SSHORT length,
BOOLEAN insert_flag) bool insert_flag)
{ {
GPRE_FLD field; GPRE_FLD field;
SYM symbol; SYM symbol;
@ -1837,7 +1840,9 @@ GPRE_REL MET_make_relation(SCHAR * name)
* Lookup a type name for a field. * Lookup a type name for a field.
*/ */
BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr) bool MET_type(GPRE_FLD field,
TEXT * string,
SSHORT * ptr)
{ {
GPRE_REL relation; GPRE_REL relation;
dbb* database; dbb* database;
@ -1849,9 +1854,10 @@ BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr)
for (symbol = HSH_lookup(string); symbol; symbol = symbol->sym_homonym) for (symbol = HSH_lookup(string); symbol; symbol = symbol->sym_homonym)
if (symbol->sym_type == SYM_type && if (symbol->sym_type == SYM_type &&
(type = (TYP) symbol->sym_object) && (type = (TYP) symbol->sym_object) &&
(!type->typ_field || type->typ_field == field)) { (!type->typ_field || type->typ_field == field))
{
*ptr = type->typ_value; *ptr = type->typ_value;
return TRUE; return true;
} }
relation = field->fld_relation; relation = field->fld_relation;
@ -1873,10 +1879,10 @@ BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr)
type->typ_symbol = symbol = type->typ_symbol = symbol =
MSC_symbol(SYM_type, string, strlen(string), (GPRE_CTX) type); MSC_symbol(SYM_type, string, strlen(string), (GPRE_CTX) type);
HSH_insert(symbol); HSH_insert(symbol);
return TRUE; return true;
} END_FOR ON_ERROR END_ERROR; } END_FOR ON_ERROR END_ERROR;
return FALSE; return false;
} }
@ -1884,11 +1890,12 @@ BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr)
* *
* Lookup an index for a database. * Lookup an index for a database.
* *
* Return: TRUE if the trigger exists * Return: true if the trigger exists
* FALSE otherwise * false otherwise
*/ */
BOOLEAN MET_trigger_exists(dbb* database, TEXT* trigger_name) bool MET_trigger_exists(dbb* database,
TEXT* trigger_name)
{ {
char name[NAME_SIZE]; char name[NAME_SIZE];
@ -1898,11 +1905,11 @@ BOOLEAN MET_trigger_exists(dbb* database, TEXT* trigger_name)
gds_trans = database->dbb_transaction; gds_trans = database->dbb_transaction;
FOR(REQUEST_HANDLE database->dbb_trigger_request) FOR(REQUEST_HANDLE database->dbb_trigger_request)
TRIG IN RDB$TRIGGERS WITH TRIG.RDB$TRIGGER_NAME EQ name return TRUE; TRIG IN RDB$TRIGGERS WITH TRIG.RDB$TRIGGER_NAME EQ name
return true;
END_FOR; END_FOR;
return FALSE; return false;
} }

View File

@ -25,14 +25,14 @@
#define GPRE_GPRE_META_H #define GPRE_GPRE_META_H
extern GPRE_FLD MET_context_field(GPRE_CTX, char *); extern GPRE_FLD MET_context_field(GPRE_CTX, char *);
extern BOOLEAN MET_database(DBB, BOOLEAN); extern bool MET_database(DBB, bool);
extern USHORT MET_domain_lookup(GPRE_REQ, GPRE_FLD, char *); extern bool MET_domain_lookup(GPRE_REQ, GPRE_FLD, char *);
extern GPRE_FLD MET_field(GPRE_REL, char *); extern GPRE_FLD MET_field(GPRE_REL, char *);
extern GPRE_NOD MET_fields(GPRE_CTX); extern GPRE_NOD MET_fields(GPRE_CTX);
extern void MET_fini(DBB); extern void MET_fini(DBB);
extern SCHAR *MET_generator(TEXT *, DBB); extern SCHAR *MET_generator(TEXT *, DBB);
extern BOOLEAN MET_get_column_default(GPRE_REL, TEXT *, TEXT *, USHORT); extern bool MET_get_column_default(GPRE_REL, TEXT *, TEXT *, USHORT);
extern BOOLEAN MET_get_domain_default(DBB, TEXT *, TEXT *, USHORT); extern bool MET_get_domain_default(DBB, TEXT *, TEXT *, USHORT);
extern USHORT MET_get_dtype(USHORT, USHORT, USHORT *); extern USHORT MET_get_dtype(USHORT, USHORT, USHORT *);
extern LLS MET_get_primary_key(DBB, TEXT *); extern LLS MET_get_primary_key(DBB, TEXT *);
extern GPRE_PRC MET_get_procedure(DBB, TEXT *, TEXT *); extern GPRE_PRC MET_get_procedure(DBB, TEXT *, TEXT *);
@ -42,10 +42,10 @@ extern UDF MET_get_udf(DBB, TEXT *);
extern GPRE_REL MET_get_view_relation(GPRE_REQ, char *, char *, USHORT); extern GPRE_REL MET_get_view_relation(GPRE_REQ, char *, char *, USHORT);
extern IND MET_index(DBB, TEXT *); extern IND MET_index(DBB, TEXT *);
extern void MET_load_hash_table(DBB); extern void MET_load_hash_table(DBB);
extern GPRE_FLD MET_make_field(SCHAR *, SSHORT, SSHORT, BOOLEAN); extern GPRE_FLD MET_make_field(SCHAR *, SSHORT, SSHORT, bool);
extern IND MET_make_index(SCHAR *); extern IND MET_make_index(SCHAR *);
extern GPRE_REL MET_make_relation(SCHAR *); extern GPRE_REL MET_make_relation(SCHAR *);
extern BOOLEAN MET_type(GPRE_FLD, TEXT *, SSHORT *); extern bool MET_type(GPRE_FLD, TEXT *, SSHORT *);
extern BOOLEAN MET_trigger_exists(DBB, TEXT *); extern bool MET_trigger_exists(DBB, TEXT *);
#endif /* GPRE_GPRE_META_H */ #endif /* GPRE_GPRE_META_H */

View File

@ -26,7 +26,7 @@
* *
*____________________________________________________________ *____________________________________________________________
* *
* $Id: gpre_meta_boot.cpp,v 1.20 2003-09-11 10:36:45 aafemt Exp $ * $Id: gpre_meta_boot.cpp,v 1.21 2003-09-12 02:21:53 brodsom Exp $
*/ */
#include "firebird.h" #include "firebird.h"
@ -117,7 +117,8 @@ GPRE_FLD MET_context_field( GPRE_CTX context, char *string)
* database can't be opened, return FALSE. * database can't be opened, return FALSE.
*/ */
BOOLEAN MET_database(DBB db, BOOLEAN print_version) bool MET_database(DBB db,
bool print_version)
{ {
/* /*
** Each info item requested will return ** Each info item requested will return
@ -133,11 +134,11 @@ BOOLEAN MET_database(DBB db, BOOLEAN print_version)
#ifndef REQUESTER #ifndef REQUESTER
if (sw_language == lang_internal) { if (sw_language == lang_internal) {
JRDMET_init(db); JRDMET_init(db);
return TRUE; return true;
} }
#endif #endif
assert(0); assert(0);
return FALSE; return false;
} }
@ -147,7 +148,9 @@ BOOLEAN MET_database(DBB db, BOOLEAN print_version)
* Initialize the size of the field. * Initialize the size of the field.
*/ */
USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string) bool MET_domain_lookup(GPRE_REQ request,
GPRE_FLD field,
char *string)
{ {
SYM symbol; SYM symbol;
SCHAR name[NAME_SIZE]; SCHAR name[NAME_SIZE];
@ -171,14 +174,14 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
field->fld_charset_id = d_field->fld_charset_id; field->fld_charset_id = d_field->fld_charset_id;
field->fld_collate_id = d_field->fld_collate_id; field->fld_collate_id = d_field->fld_collate_id;
field->fld_char_length = d_field->fld_char_length; field->fld_char_length = d_field->fld_char_length;
return TRUE; return true;
} }
if (!request) if (!request)
return FALSE; return false;
assert(0); assert(0);
return FALSE; return false;
} }
@ -187,14 +190,14 @@ USHORT MET_domain_lookup(GPRE_REQ request, GPRE_FLD field, char *string)
* Gets the default value for a domain of an existing table * Gets the default value for a domain of an existing table
*/ */
BOOLEAN MET_get_domain_default(DBB db, bool MET_get_domain_default(DBB db,
TEXT * domain_name, TEXT * domain_name,
TEXT * buffer, TEXT * buffer,
USHORT buff_length) USHORT buff_length)
{ {
assert(0); assert(0);
return FALSE; return false;
} }
@ -210,12 +213,13 @@ BOOLEAN MET_get_domain_default(DBB db,
* Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS. * Reads the system tables RDB$FIELDS and RDB$RELATION_FIELDS.
*/ */
BOOLEAN MET_get_column_default(GPRE_REL relation, bool MET_get_column_default(GPRE_REL relation,
TEXT * column_name, TEXT * column_name,
TEXT * buffer, USHORT buff_length) TEXT * buffer,
USHORT buff_length)
{ {
assert(0); assert(0);
return FALSE; return false;
} }
@ -573,7 +577,7 @@ UDF MET_get_udf(DBB db, TEXT * string)
/*____________________________________________________________ /*____________________________________________________________
* *
* Return TRUE if the passed view_name represents a * Return relation if the passed view_name represents a
* view with the passed relation as a base table * view with the passed relation as a base table
* (the relation could be an alias). * (the relation could be an alias).
*/ */
@ -644,7 +648,9 @@ void MET_load_hash_table( DBB db)
*/ */
GPRE_FLD MET_make_field(SCHAR * name, GPRE_FLD MET_make_field(SCHAR * name,
SSHORT dtype, SSHORT length, BOOLEAN insert_flag) SSHORT dtype,
SSHORT length,
bool insert_flag)
{ {
GPRE_FLD field; GPRE_FLD field;
SYM symbol; SYM symbol;
@ -699,7 +705,9 @@ GPRE_REL MET_make_relation(SCHAR * name)
* Lookup a type name for a field. * Lookup a type name for a field.
*/ */
BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr) bool MET_type(GPRE_FLD field,
TEXT * string,
SSHORT * ptr)
{ {
SYM symbol; SYM symbol;
TYP type; TYP type;
@ -707,13 +715,14 @@ BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr)
for (symbol = HSH_lookup(string); symbol; symbol = symbol->sym_homonym) for (symbol = HSH_lookup(string); symbol; symbol = symbol->sym_homonym)
if (symbol->sym_type == SYM_type && if (symbol->sym_type == SYM_type &&
(type = (TYP) symbol->sym_object) && (type = (TYP) symbol->sym_object) &&
(!type->typ_field || type->typ_field == field)) { (!type->typ_field || type->typ_field == field))
{
*ptr = type->typ_value; *ptr = type->typ_value;
return TRUE; return true;
} }
assert(0); assert(0);
return FALSE; return false;
} }
@ -721,18 +730,19 @@ BOOLEAN MET_type(GPRE_FLD field, TEXT * string, SSHORT * ptr)
* *
* Lookup an index for a database. * Lookup an index for a database.
* *
* Return: TRUE if the trigger exists * Return: true if the trigger exists
* FALSE otherwise * false otherwise
*/ */
BOOLEAN MET_trigger_exists(DBB db, TEXT * trigger_name) bool MET_trigger_exists(DBB db,
TEXT * trigger_name)
{ {
SCHAR name[NAME_SIZE]; SCHAR name[NAME_SIZE];
strcpy(name, trigger_name); strcpy(name, trigger_name);
assert(0); assert(0);
return FALSE; return false;
} }
#ifdef NOT_USED_OR_REPLACED #ifdef NOT_USED_OR_REPLACED
@ -903,9 +913,8 @@ void DLL_EXPORT ERR_bugcheck(int number)
{ {
} }
BOOLEAN DLL_EXPORT ERR_post(ISC_STATUS status, ...) void DLL_EXPORT ERR_post(ISC_STATUS status, ...)
{ {
return TRUE;
} }
} // extern "C" } // extern "C"

View File

@ -20,7 +20,7 @@
// //
// All Rights Reserved. // All Rights Reserved.
// Contributor(s): ______________________________________. // Contributor(s): ______________________________________.
// $Id: par.cpp,v 1.29 2003-09-11 02:13:45 brodsom Exp $ // $Id: par.cpp,v 1.30 2003-09-12 02:21:53 brodsom Exp $
// Revision 1.2 2000/11/27 09:26:13 fsg // Revision 1.2 2000/11/27 09:26:13 fsg
// Fixed bugs in gpre to handle PYXIS forms // Fixed bugs in gpre to handle PYXIS forms
// and allow edit.e and fred.e to go through // and allow edit.e and fred.e to go through
@ -550,7 +550,7 @@ ACT PAR_database(bool sql, const TEXT* base_directory)
if (sw_language != lang_fortran) if (sw_language != lang_fortran)
MATCH(KW_SEMI_COLON); MATCH(KW_SEMI_COLON);
if (!MET_database(db, TRUE)) { if (!MET_database(db, true)) {
sprintf(s, "Couldn't access database %s = '%s'", sprintf(s, "Couldn't access database %s = '%s'",
db->dbb_name->sym_string, db->dbb_filename); db->dbb_name->sym_string, db->dbb_filename);
CPR_error(s); CPR_error(s);
@ -943,7 +943,7 @@ GPRE_FLD PAR_null_field()
return flag_field; return flag_field;
flag_field = MET_make_field("gds__null_flag", dtype_short, sizeof(SSHORT), flag_field = MET_make_field("gds__null_flag", dtype_short, sizeof(SSHORT),
FALSE); false);
return flag_field; return flag_field;
} }
@ -1182,7 +1182,7 @@ static ACT par_any()
SYM symbol; SYM symbol;
ACT action, function; ACT action, function;
GPRE_REQ request; GPRE_REQ request;
RSE rec_expr; GPRE_RSE rec_expr;
GPRE_CTX context; GPRE_CTX context;
GPRE_REL relation; GPRE_REL relation;
@ -2073,7 +2073,7 @@ static ACT par_for()
SYM symbol, temp; SYM symbol, temp;
ACT action; ACT action;
GPRE_REQ request; GPRE_REQ request;
RSE rec_expr; GPRE_RSE rec_expr;
GPRE_CTX context, *ptr, *end; GPRE_CTX context, *ptr, *end;
GPRE_REL relation; GPRE_REL relation;
TEXT s[128]; TEXT s[128];
@ -2838,7 +2838,7 @@ static ACT par_start_stream()
{ {
ACT action; ACT action;
GPRE_REQ request; GPRE_REQ request;
RSE rec_expr; GPRE_RSE rec_expr;
GPRE_CTX context, *ptr, *end; GPRE_CTX context, *ptr, *end;
GPRE_REL relation; GPRE_REL relation;
SYM cursor; SYM cursor;

View File

@ -37,7 +37,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: sqe.cpp,v 1.19 2003-09-11 02:35:15 brodsom Exp $ // $Id: sqe.cpp,v 1.20 2003-09-12 02:21:53 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
#include <stdio.h> #include <stdio.h>
@ -74,8 +74,8 @@ extern tok prior_token;
static bool compare_expr(GPRE_NOD, GPRE_NOD); static bool compare_expr(GPRE_NOD, GPRE_NOD);
static GPRE_NOD copy_fields(GPRE_NOD, map*); static GPRE_NOD copy_fields(GPRE_NOD, map*);
static GPRE_NOD explode_asterisk(GPRE_NOD, int, RSE); static GPRE_NOD explode_asterisk(GPRE_NOD, int, GPRE_RSE);
static GPRE_NOD explode_asterisk_all(GPRE_NOD, int, RSE, bool); static GPRE_NOD explode_asterisk_all(GPRE_NOD, int, GPRE_RSE, bool);
static GPRE_FLD get_ref(GPRE_NOD); static GPRE_FLD get_ref(GPRE_NOD);
static GPRE_NOD implicit_any(GPRE_REQ, GPRE_NOD, enum nod_t, enum nod_t); static GPRE_NOD implicit_any(GPRE_REQ, GPRE_NOD, enum nod_t, enum nod_t);
static GPRE_NOD merge(GPRE_NOD, GPRE_NOD); static GPRE_NOD merge(GPRE_NOD, GPRE_NOD);
@ -93,13 +93,13 @@ static GPRE_CTX par_join_clause(GPRE_REQ, GPRE_CTX);
static NOD_T par_join_type(void); static NOD_T par_join_type(void);
static GPRE_NOD par_multiply(GPRE_REQ, bool, USHORT *, bool *); static GPRE_NOD par_multiply(GPRE_REQ, bool, USHORT *, bool *);
static GPRE_NOD par_not(GPRE_REQ, USHORT *); static GPRE_NOD par_not(GPRE_REQ, USHORT *);
static void par_order(GPRE_REQ, RSE, bool, bool); static void par_order(GPRE_REQ, GPRE_RSE, bool, bool);
static GPRE_NOD par_plan(GPRE_REQ); static GPRE_NOD par_plan(GPRE_REQ);
static GPRE_NOD par_plan_item(GPRE_REQ, bool, USHORT *, bool *); static GPRE_NOD par_plan_item(GPRE_REQ, bool, USHORT *, bool *);
static GPRE_NOD par_primitive_value(GPRE_REQ, bool, USHORT *, bool *); static GPRE_NOD par_primitive_value(GPRE_REQ, bool, USHORT *, bool *);
static GPRE_NOD par_relational(GPRE_REQ, USHORT *); static GPRE_NOD par_relational(GPRE_REQ, USHORT *);
static RSE par_rse(GPRE_REQ, GPRE_NOD, bool); static GPRE_RSE par_rse(GPRE_REQ, GPRE_NOD, bool);
static RSE par_select(GPRE_REQ, RSE); static GPRE_RSE par_select(GPRE_REQ, GPRE_RSE);
static GPRE_NOD par_stat(GPRE_REQ); static GPRE_NOD par_stat(GPRE_REQ);
static GPRE_NOD par_subscript(GPRE_REQ); static GPRE_NOD par_subscript(GPRE_REQ);
static void par_terminating_parens(USHORT *, USHORT *); static void par_terminating_parens(USHORT *, USHORT *);
@ -112,7 +112,7 @@ static GPRE_NOD post_select_list(GPRE_NOD, map*);
static void pop_scope(GPRE_REQ, scope*); static void pop_scope(GPRE_REQ, scope*);
static void push_scope(GPRE_REQ, scope*); static void push_scope(GPRE_REQ, scope*);
static GPRE_FLD resolve(GPRE_NOD, GPRE_CTX, GPRE_CTX *, ACT *); static GPRE_FLD resolve(GPRE_NOD, GPRE_CTX, GPRE_CTX *, ACT *);
static GPRE_CTX resolve_asterisk(TOK, RSE); static GPRE_CTX resolve_asterisk(TOK, GPRE_RSE);
static void set_ref(GPRE_NOD, GPRE_FLD); static void set_ref(GPRE_NOD, GPRE_FLD);
static char *upcase_string(char *); static char *upcase_string(char *);
static bool validate_references(GPRE_NOD, GPRE_NOD); static bool validate_references(GPRE_NOD, GPRE_NOD);
@ -905,7 +905,7 @@ REF SQE_post_reference(GPRE_REQ request, GPRE_FLD field, GPRE_CTX context, GPRE_
bool SQE_resolve(GPRE_NOD node, bool SQE_resolve(GPRE_NOD node,
GPRE_REQ request, GPRE_REQ request,
rse* selection) gpre_rse* selection)
{ {
REF reference; REF reference;
GPRE_CTX context; GPRE_CTX context;
@ -1036,12 +1036,12 @@ bool SQE_resolve(GPRE_NOD node,
// Parse a SELECT (sans keyword) expression. // Parse a SELECT (sans keyword) expression.
// //
RSE SQE_select(GPRE_REQ request, GPRE_RSE SQE_select(GPRE_REQ request,
bool view_flag) bool view_flag)
{ {
RSE select = NULL; GPRE_RSE select = NULL;
RSE rse1 = NULL; GPRE_RSE rse1 = NULL;
RSE rse2 = NULL; GPRE_RSE rse2 = NULL;
GPRE_NOD node; GPRE_NOD node;
LLS context_stack = NULL; LLS context_stack = NULL;
GPRE_CTX context; GPRE_CTX context;
@ -1075,7 +1075,7 @@ RSE SQE_select(GPRE_REQ request,
/* We've got a bona fide union. Make a union node to hold sub-rse /* We've got a bona fide union. Make a union node to hold sub-rse
and then a new rse to point to it. */ and then a new rse to point to it. */
select = (RSE) ALLOC(RSE_LEN(1)); select = (GPRE_RSE) ALLOC(RSE_LEN(1));
select->rse_context[0] = context = MAKE_CONTEXT(request); select->rse_context[0] = context = MAKE_CONTEXT(request);
select->rse_union = node = MAKE_NODE(nod_union, 2); select->rse_union = node = MAKE_NODE(nod_union, 2);
node->nod_arg[0] = (GPRE_NOD) rse1; node->nod_arg[0] = (GPRE_NOD) rse1;
@ -1306,7 +1306,7 @@ static GPRE_NOD copy_fields( GPRE_NOD fields, map* fields_map)
// Expand an '*' in a field list to the corresponding fields. // Expand an '*' in a field list to the corresponding fields.
// //
static GPRE_NOD explode_asterisk( GPRE_NOD fields, int n, rse* selection) static GPRE_NOD explode_asterisk( GPRE_NOD fields, int n, gpre_rse* selection)
{ {
GPRE_CTX context; GPRE_CTX context;
GPRE_NOD node; GPRE_NOD node;
@ -1345,7 +1345,7 @@ static GPRE_NOD explode_asterisk( GPRE_NOD fields, int n, rse* selection)
static GPRE_NOD explode_asterisk_all(GPRE_NOD fields, static GPRE_NOD explode_asterisk_all(GPRE_NOD fields,
int n, int n,
rse* selection, gpre_rse* selection,
bool replace) bool replace)
{ {
GPRE_CTX context; GPRE_CTX context;
@ -1450,8 +1450,8 @@ static GPRE_NOD implicit_any(GPRE_REQ request,
enum nod_t any_all) enum nod_t any_all)
{ {
GPRE_NOD value2, node, node2, field_list; GPRE_NOD value2, node, node2, field_list;
rse* selection; gpre_rse* selection;
rse* sub; gpre_rse* sub;
GPRE_CTX original; GPRE_CTX original;
bool distinct; bool distinct;
scope previous_scope; scope previous_scope;
@ -1978,7 +1978,7 @@ static GPRE_CTX par_join_clause( GPRE_REQ request, GPRE_CTX context1)
GPRE_CTX context2; GPRE_CTX context2;
NOD_T join_type; NOD_T join_type;
GPRE_NOD node; GPRE_NOD node;
rse* selection; gpre_rse* selection;
assert_IS_REQ(request); assert_IS_REQ(request);
@ -1994,7 +1994,7 @@ static GPRE_CTX par_join_clause( GPRE_REQ request, GPRE_CTX context1)
node = SQE_boolean(request, NULL); node = SQE_boolean(request, NULL);
selection = (rse*) ALLOC(RSE_LEN(2)); selection = (gpre_rse*) ALLOC(RSE_LEN(2));
selection->rse_count = 2; selection->rse_count = 2;
selection->rse_context[0] = context1; selection->rse_context[0] = context1;
selection->rse_context[1] = context2; selection->rse_context[1] = context2;
@ -2084,7 +2084,7 @@ static GPRE_NOD par_multiply(GPRE_REQ request,
static GPRE_NOD par_not( GPRE_REQ request, USHORT * paren_count) static GPRE_NOD par_not( GPRE_REQ request, USHORT * paren_count)
{ {
rse* selection; gpre_rse* selection;
GPRE_NOD node, expr, field; GPRE_NOD node, expr, field;
enum nod_t type; enum nod_t type;
scope saved_scope; scope saved_scope;
@ -2123,7 +2123,7 @@ static GPRE_NOD par_not( GPRE_REQ request, USHORT * paren_count)
expr = MSC_unary(nod_missing, field); expr = MSC_unary(nod_missing, field);
selection->rse_boolean = merge(negate(expr), selection->rse_boolean); selection->rse_boolean = merge(negate(expr), selection->rse_boolean);
} }
EXP_rse_cleanup((RSE) node->nod_arg[0]); EXP_rse_cleanup((GPRE_RSE) node->nod_arg[0]);
pop_scope(request, &saved_scope); pop_scope(request, &saved_scope);
EXP_match_paren(); EXP_match_paren();
return node; return node;
@ -2141,7 +2141,7 @@ static GPRE_NOD par_not( GPRE_REQ request, USHORT * paren_count)
// //
static void par_order(GPRE_REQ request, static void par_order(GPRE_REQ request,
RSE select, GPRE_RSE select,
bool union_f, bool union_f,
bool view_flag) bool view_flag)
{ {
@ -2611,9 +2611,8 @@ static GPRE_NOD par_relational(GPRE_REQ request,
node->nod_arg[2] = expr2 = SQE_value(request, false, NULL, NULL); node->nod_arg[2] = expr2 = SQE_value(request, false, NULL, NULL);
if (expr2->nod_type == nod_value) { if (expr2->nod_type == nod_value) {
ref_value = (REF) expr2->nod_arg[0]; ref_value = (REF) expr2->nod_arg[0];
ref_value->ref_field = ref_value->ref_field = MET_make_field("like_escape_character",
MET_make_field("like_escape_character", dtype_text, 2, dtype_text, 2, false);
FALSE);
} }
} }
else else
@ -2681,14 +2680,14 @@ static GPRE_NOD par_relational(GPRE_REQ request,
// be present. // be present.
// //
static RSE par_rse(GPRE_REQ request, static GPRE_RSE par_rse(GPRE_REQ request,
GPRE_NOD fields, GPRE_NOD fields,
bool distinct) bool distinct)
{ {
GPRE_CTX context; GPRE_CTX context;
map* subselect_map; map* subselect_map;
GPRE_NOD *ptr, *end, node; GPRE_NOD *ptr, *end, node;
RSE select, sub_rse; GPRE_RSE select, sub_rse;
int i; int i;
int count = 0; int count = 0;
int old_count; int old_count;
@ -2714,7 +2713,7 @@ static RSE par_rse(GPRE_REQ request,
// Now allocate a record select expression // Now allocate a record select expression
// block for the beast and fill in what we already know. // block for the beast and fill in what we already know.
select = (RSE) ALLOC(RSE_LEN(count)); select = (GPRE_RSE) ALLOC(RSE_LEN(count));
select->rse_count = count; select->rse_count = count;
while (count--) while (count--)
@ -2785,7 +2784,7 @@ static RSE par_rse(GPRE_REQ request,
if (select->rse_group_by) if (select->rse_group_by)
request->req_map = subselect_map; request->req_map = subselect_map;
subselect_map->map_context = MAKE_CONTEXT(request); subselect_map->map_context = MAKE_CONTEXT(request);
select = (RSE) ALLOC(RSE_LEN(0)); select = (GPRE_RSE) ALLOC(RSE_LEN(0));
select->rse_aggregate = sub_rse; select->rse_aggregate = sub_rse;
if (fields) if (fields)
@ -2821,9 +2820,9 @@ PAR_error("simple column reference in HAVING must be referenced in GROUP BY");
// list. // list.
// //
static RSE par_select( GPRE_REQ request, RSE union_rse) static GPRE_RSE par_select( GPRE_REQ request, GPRE_RSE union_rse)
{ {
RSE select; GPRE_RSE select;
GPRE_NOD s_list, into_list; GPRE_NOD s_list, into_list;
bool distinct; bool distinct;
@ -2869,7 +2868,7 @@ static GPRE_NOD par_stat( GPRE_REQ request)
{ {
GPRE_NOD node, field_list; GPRE_NOD node, field_list;
GPRE_NOD item; GPRE_NOD item;
RSE select; GPRE_RSE select;
bool distinct; bool distinct;
scope previous_scope; scope previous_scope;
@ -3362,7 +3361,7 @@ static GPRE_FLD resolve(
SYM symbol, temp_symbol; SYM symbol, temp_symbol;
GPRE_FLD field; GPRE_FLD field;
TOK f_token, q_token; TOK f_token, q_token;
RSE rs_stream; GPRE_RSE rs_stream;
SSHORT i; SSHORT i;
GPRE_REQ slice_req; GPRE_REQ slice_req;
SLC slice; SLC slice;
@ -3485,10 +3484,10 @@ static GPRE_FLD resolve(
// If successful, return the context. Otherwise return NULL. // If successful, return the context. Otherwise return NULL.
// //
static GPRE_CTX resolve_asterisk( TOK q_token, rse* selection) static GPRE_CTX resolve_asterisk( TOK q_token, gpre_rse* selection)
{ {
GPRE_CTX context; GPRE_CTX context;
RSE rs_stream; GPRE_RSE rs_stream;
SYM symbol; SYM symbol;
int i; int i;
@ -3600,7 +3599,7 @@ static bool validate_references(GPRE_NOD fields,
{ {
GPRE_NOD *ptr, *end, node; GPRE_NOD *ptr, *end, node;
REF fref, gref; REF fref, gref;
RSE any; GPRE_RSE any;
bool invalid = false; bool invalid = false;
bool context_match; bool context_match;
MEL element; MEL element;
@ -3642,7 +3641,7 @@ static bool validate_references(GPRE_NOD fields,
if (fields->nod_type == nod_any || fields->nod_type == nod_ansi_any || if (fields->nod_type == nod_any || fields->nod_type == nod_ansi_any ||
fields->nod_type == nod_ansi_all) fields->nod_type == nod_ansi_all)
{ {
any = (RSE) fields->nod_arg[0]; any = (GPRE_RSE) fields->nod_arg[0];
return validate_references(any->rse_boolean, group_by); return validate_references(any->rse_boolean, group_by);
} }

View File

@ -33,8 +33,8 @@ extern GPRE_NOD SQE_list(pfn_SQE_list_cb, GPRE_REQ, bool);
extern REF SQE_parameter(GPRE_REQ, bool); extern REF SQE_parameter(GPRE_REQ, bool);
extern void SQE_post_field(GPRE_NOD, GPRE_FLD); extern void SQE_post_field(GPRE_NOD, GPRE_FLD);
extern REF SQE_post_reference(GPRE_REQ, GPRE_FLD, GPRE_CTX, GPRE_NOD); extern REF SQE_post_reference(GPRE_REQ, GPRE_FLD, GPRE_CTX, GPRE_NOD);
extern bool SQE_resolve(GPRE_NOD, GPRE_REQ, RSE); extern bool SQE_resolve(GPRE_NOD, GPRE_REQ, GPRE_RSE);
extern RSE SQE_select(GPRE_REQ, bool); extern GPRE_RSE SQE_select(GPRE_REQ, bool);
extern GPRE_NOD SQE_value(GPRE_REQ, bool, USHORT *, bool *); extern GPRE_NOD SQE_value(GPRE_REQ, bool, USHORT *, bool *);
extern GPRE_NOD SQE_variable(GPRE_REQ, bool, USHORT *, bool *); extern GPRE_NOD SQE_variable(GPRE_REQ, bool, USHORT *, bool *);

View File

@ -25,7 +25,7 @@
// //
//____________________________________________________________ //____________________________________________________________
// //
// $Id: sql.cpp,v 1.21 2003-09-11 10:36:45 aafemt Exp $ // $Id: sql.cpp,v 1.22 2003-09-12 02:21:52 brodsom Exp $
// //
#include "firebird.h" #include "firebird.h"
@ -2055,7 +2055,7 @@ static ACT act_create_view(void)
// parse the view SELECT // parse the view SELECT
RSE select = SQE_select(request, true); GPRE_RSE select = SQE_select(request, true);
relation->rel_view_rse = select; relation->rel_view_rse = select;
EXP_rse_cleanup(select); EXP_rse_cleanup(select);
@ -2377,7 +2377,7 @@ static ACT act_declare_table( SYM symbol, DBB db)
relation->rel_next = db->dbb_relations; relation->rel_next = db->dbb_relations;
db->dbb_relations = relation; db->dbb_relations = relation;
GPRE_FLD dbkey = MET_make_field("rdb$db_key", dtype_text, 8, FALSE); GPRE_FLD dbkey = MET_make_field("rdb$db_key", dtype_text, 8, false);
relation->rel_dbkey = dbkey; relation->rel_dbkey = dbkey;
dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset; dbkey->fld_flags |= FLD_dbkey | FLD_text | FLD_charset;
dbkey->fld_ttype = ttype_binary; dbkey->fld_ttype = ttype_binary;
@ -2578,7 +2578,7 @@ static ACT act_delete(void)
} }
request->req_trans = transaction; request->req_trans = transaction;
GPRE_REL relation = SQL_relation(request, r_name, db_name, owner_name, true); GPRE_REL relation = SQL_relation(request, r_name, db_name, owner_name, true);
rse* selection = request->req_rse; gpre_rse* selection = request->req_rse;
GPRE_CTX context = NULL; GPRE_CTX context = NULL;
SSHORT i; SSHORT i;
for (i = 0; i < selection->rse_count; i++) { for (i = 0; i < selection->rse_count; i++) {
@ -2605,7 +2605,7 @@ static ACT act_delete(void)
GPRE_REL relation = SQL_relation(request, r_name, db_name, owner_name, true); GPRE_REL relation = SQL_relation(request, r_name, db_name, owner_name, true);
rse* selection = (rse*) ALLOC(RSE_LEN(1)); gpre_rse* selection = (gpre_rse*) ALLOC(RSE_LEN(1));
request->req_rse = selection; request->req_rse = selection;
selection->rse_count = 1; selection->rse_count = 1;
GPRE_CTX context = MAKE_CONTEXT(request); GPRE_CTX context = MAKE_CONTEXT(request);
@ -3108,7 +3108,7 @@ static ACT act_fetch(void)
} }
else if (MATCH(KW_INTO)) { else if (MATCH(KW_INTO)) {
action->act_object = (REF) SQE_list(SQE_variable, request, false); action->act_object = (REF) SQE_list(SQE_variable, request, false);
RSE select = request->req_rse; GPRE_RSE select = request->req_rse;
into(request, select->rse_fields, (GPRE_NOD) action->act_object); into(request, select->rse_fields, (GPRE_NOD) action->act_object);
} }
@ -3483,7 +3483,7 @@ static ACT act_insert(void)
request->req_type = REQ_mass_update; request->req_type = REQ_mass_update;
request->req_contexts = NULL; request->req_contexts = NULL;
request->req_update = context; request->req_update = context;
RSE select = SQE_select(request, false); GPRE_RSE select = SQE_select(request, false);
request->req_rse = select; request->req_rse = select;
context->ctx_next = request->req_contexts; context->ctx_next = request->req_contexts;
request->req_contexts = context; request->req_contexts = context;
@ -3962,7 +3962,7 @@ static ACT act_select(void)
{ {
GPRE_REQ request = MAKE_REQUEST(REQ_for); GPRE_REQ request = MAKE_REQUEST(REQ_for);
par_options(&request->req_trans); par_options(&request->req_trans);
RSE select = SQE_select(request, false); GPRE_RSE select = SQE_select(request, false);
request->req_rse = select; request->req_rse = select;
if (!MATCH(KW_SEMI_COLON)) { if (!MATCH(KW_SEMI_COLON)) {
@ -4421,7 +4421,7 @@ static ACT act_update(void)
/* Given the target relation, find the input context for the modify */ /* Given the target relation, find the input context for the modify */
RSE select = request->req_rse; GPRE_RSE select = request->req_rse;
SSHORT i; SSHORT i;
for (i = 0; i < select->rse_count; i++) { for (i = 0; i < select->rse_count; i++) {
input_context = select->rse_context[i]; input_context = select->rse_context[i];
@ -4519,7 +4519,7 @@ static ACT act_update(void)
// Generate record select expression, then resolve input values // Generate record select expression, then resolve input values
RSE select = (RSE) ALLOC(RSE_LEN(1)); GPRE_RSE select = (GPRE_RSE) ALLOC(RSE_LEN(1));
request->req_rse = select; request->req_rse = select;
select->rse_count = 1; select->rse_count = 1;
select->rse_context[0] = input_context; select->rse_context[0] = input_context;
@ -4565,8 +4565,7 @@ static ACT act_update(void)
if (SQL_DIALECT_V5 == sw_sql_dialect) { if (SQL_DIALECT_V5 == sw_sql_dialect) {
for (int arg_num = 0; arg_num <= 1; arg_num++) for (int arg_num = 0; arg_num <= 1; arg_num++)
if (nod_field == set_item->nod_arg[arg_num]->nod_type) { if (nod_field == set_item->nod_arg[arg_num]->nod_type) {
USHORT field_dtype = USHORT field_dtype =((REF)
((REF)
(set_item->nod_arg[arg_num]-> (set_item->nod_arg[arg_num]->
nod_arg[0]))->ref_field->fld_dtype; nod_arg[0]))->ref_field->fld_dtype;
if ((dtype_sql_date == field_dtype) if ((dtype_sql_date == field_dtype)
@ -5047,7 +5046,7 @@ static GPRE_FLD make_field( GPRE_REL relation)
char s[ERROR_LENGTH]; char s[ERROR_LENGTH];
SQL_resolve_identifier("<column name>", s); SQL_resolve_identifier("<column name>", s);
GPRE_FLD field = MET_make_field(s, 0, 0, TRUE); GPRE_FLD field = MET_make_field(s, 0, 0, true);
field->fld_relation = relation; field->fld_relation = relation;
field->fld_flags |= FLD_meta; field->fld_flags |= FLD_meta;
ADVANCE_TOKEN; ADVANCE_TOKEN;