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

const correctness and cleanup

This commit is contained in:
robocop 2003-11-10 09:16:38 +00:00
parent 2d110f5239
commit f55c6f6f8c
48 changed files with 8701 additions and 9647 deletions

View File

@ -109,21 +109,21 @@ void ALLD_init()
}
}
void DsqlMemoryPool::ALLD_push(BLK object, DLLS * stack)
void DsqlMemoryPool::ALLD_push(BLK object, dsql_lls** stack)
{
TSQL tdsql = GET_THREAD_DATA;
DsqlMemoryPool* pool = tdsql->tsql_default;
DLLS node = pool->lls_cache.newBlock();
dsql_lls* node = pool->lls_cache.newBlock();
node->lls_object = object;
node->lls_next = *stack;
*stack = node;
}
BLK DsqlMemoryPool::ALLD_pop(DLLS *stack)
BLK DsqlMemoryPool::ALLD_pop(dsql_lls* *stack)
{
DLLS node = *stack;
dsql_lls* node = *stack;
*stack = node->lls_next;
BLK object = node->lls_object;

View File

@ -57,7 +57,7 @@ static void adjust_length(ISC_ARRAY_DESC*);
static void copy_exact_name (const char*, char*, SSHORT);
static ISC_STATUS copy_status(const ISC_STATUS*, ISC_STATUS*);
static ISC_STATUS error(ISC_STATUS*, SSHORT, ...);
static ISC_STATUS gen_sdl(ISC_STATUS*, ISC_ARRAY_DESC*, SSHORT*, UCHAR**,
static ISC_STATUS gen_sdl(ISC_STATUS*, const ISC_ARRAY_DESC*, SSHORT*, UCHAR**,
SSHORT*);
static ISC_STATUS lookup_desc(ISC_STATUS*, FRBRD**, FRBRD**, const SCHAR*,
const SCHAR*, ISC_ARRAY_DESC*, SCHAR*);
@ -88,7 +88,7 @@ ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS* status,
FRBRD** db_handle,
FRBRD** trans_handle,
GDS_QUAD* array_id,
ISC_ARRAY_DESC* desc,
const ISC_ARRAY_DESC* desc,
void* array, SLONG* slice_length)
{
/**************************************
@ -186,7 +186,7 @@ ISC_STATUS API_ROUTINE isc_array_put_slice(ISC_STATUS* status,
FRBRD** db_handle,
FRBRD** trans_handle,
GDS_QUAD* array_id,
ISC_ARRAY_DESC* desc,
const ISC_ARRAY_DESC* desc,
void* array, SLONG* slice_length)
{
/**************************************
@ -389,7 +389,7 @@ static ISC_STATUS error( ISC_STATUS* status, SSHORT count, ...)
static ISC_STATUS gen_sdl(ISC_STATUS* status,
ISC_ARRAY_DESC* desc,
const ISC_ARRAY_DESC* desc,
SSHORT* sdl_buffer_length,
UCHAR** sdl_buffer,
SSHORT* sdl_length)

View File

@ -25,7 +25,7 @@
#define DSQL_ARRAY_PROTO_H
ISC_STATUS API_ROUTINE isc_array_get_slice(ISC_STATUS*, void**, void**,
GDS_QUAD*, ISC_ARRAY_DESC*,
GDS_QUAD*, const ISC_ARRAY_DESC*,
void*, SLONG*);
ISC_STATUS API_ROUTINE isc_array_lookup_bounds(ISC_STATUS*, void**, void**,
SCHAR*, SCHAR*,
@ -34,7 +34,7 @@ ISC_STATUS API_ROUTINE isc_array_lookup_desc(ISC_STATUS*, void**, void**,
SCHAR*, SCHAR*,
ISC_ARRAY_DESC*);
ISC_STATUS API_ROUTINE isc_array_put_slice(ISC_STATUS*, void**, void**,
GDS_QUAD*, ISC_ARRAY_DESC*,
GDS_QUAD*, const ISC_ARRAY_DESC*,
void*, SLONG*);
ISC_STATUS API_ROUTINE isc_array_set_desc(ISC_STATUS*, SCHAR*, SCHAR*,
SSHORT*, SSHORT*, SSHORT*,

File diff suppressed because it is too large Load Diff

View File

@ -30,14 +30,14 @@
class dsql_req;
class dsql_fld;
class dsql_nod;
class str;
class dsql_str;
void DDL_execute(dsql_req*);
void DDL_generate(dsql_req*, dsql_nod*);
bool DDL_ids(const dsql_req*);
void DDL_put_field_dtype(dsql_req*, const dsql_fld*, bool);
void DDL_resolve_intl_type(dsql_req*, dsql_fld*, const str*);
void DDL_resolve_intl_type2(dsql_req*, dsql_fld*, const str*, bool);
void DDL_resolve_intl_type(dsql_req*, dsql_fld*, const dsql_str*);
void DDL_resolve_intl_type2(dsql_req*, dsql_fld*, const dsql_str*, bool);
#endif // DSQL_DDL_PROTO_H

View File

@ -466,7 +466,7 @@ GDS_DSQL_ALLOCATE_CPP( ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -610,7 +610,7 @@ ISC_STATUS GDS_DSQL_EXECUTE_CPP(
catch (const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
RESTORE_THREAD_DATA;
@ -737,7 +737,7 @@ static ISC_STATUS dsql8_execute_immediate_common(ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1140,7 +1140,7 @@ ISC_STATUS GDS_DSQL_FETCH_CPP( ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1198,7 +1198,7 @@ ISC_STATUS GDS_DSQL_FREE_CPP(ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1281,7 +1281,7 @@ ISC_STATUS GDS_DSQL_INSERT_CPP( ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1450,7 +1450,7 @@ ISC_STATUS GDS_DSQL_PREPARE_CPP(ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
}
@ -1550,7 +1550,7 @@ ISC_STATUS GDS_DSQL_SET_CURSOR_CPP( ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1775,7 +1775,7 @@ ISC_STATUS GDS_DSQL_SQL_INFO_CPP( ISC_STATUS* user_status,
catch(const std::exception&)
{
RESTORE_THREAD_DATA;
return tdsql->tsql_status [1];
return tdsql->tsql_status[1];
}
return return_success();
@ -1811,13 +1811,7 @@ static void trace_line(const char* message, ...) {
**/
void DSQL_pretty(const dsql_nod* node, int column)
{
DSQL_MAP map;
DSQL_REL relation;
DSQL_PRC procedure;
DSQL_CTX context;
DSQL_FLD field;
STR string;
var* variable;
const dsql_str* string;
TEXT buffer[1024];
@ -1842,11 +1836,11 @@ void DSQL_pretty(const dsql_nod* node, int column)
switch (MemoryPool::blk_type(node)) {
case (TEXT) dsql_type_str:
trace_line("%sSTRING: \"%s\"\n", buffer, ((STR) node)->str_data);
trace_line("%sSTRING: \"%s\"\n", buffer, ((dsql_str*) node)->str_data);
return;
case (TEXT) dsql_type_fld:
trace_line("%sFIELD: %s\n", buffer, ((DSQL_FLD) node)->fld_name);
trace_line("%sFIELD: %s\n", buffer, ((dsql_fld*) node)->fld_name);
return;
case (TEXT) dsql_type_sym:
@ -2596,7 +2590,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_label:
verb = "label";
DSQL_pretty(node->nod_arg[e_label_name], column+1);
DSQL_pretty(node->nod_arg[e_label_name], column + 1);
trace_line("%s number %d\n", buffer,
(int)(IPTR)node->nod_arg[e_label_number]);
return;
@ -2604,18 +2598,20 @@ void DSQL_pretty(const dsql_nod* node, int column)
case nod_derived_field:
verb = "derived_field";
trace_line("%s%s\n", buffer, verb);
DSQL_pretty(node->nod_arg[e_derived_field_value], column+1);
DSQL_pretty(node->nod_arg[e_derived_field_name], column+1);
DSQL_pretty(node->nod_arg[e_derived_field_value], column + 1);
DSQL_pretty(node->nod_arg[e_derived_field_name], column + 1);
trace_line("%s scope %d\n", buffer,
(USHORT)(U_IPTR)node->nod_arg[e_derived_field_scope]);
return;
case nod_aggregate:
{
verb = "aggregate";
trace_line("%s%s\n", buffer, verb);
context = (DSQL_CTX) node->nod_arg[e_agg_context];
const dsql_ctx* context = (dsql_ctx*) node->nod_arg[e_agg_context];
trace_line("%s context %d\n", buffer, context->ctx_context);
if ((map = context->ctx_map) != NULL)
dsql_map* map = context->ctx_map;
if (map != NULL)
trace_line("%s map\n", buffer);
while (map) {
trace_line("%s position %d\n", buffer, map->map_position);
@ -2625,6 +2621,7 @@ void DSQL_pretty(const dsql_nod* node, int column)
DSQL_pretty(node->nod_arg[e_agg_group], column + 1);
DSQL_pretty(node->nod_arg[e_agg_rse], column + 1);
return;
}
case nod_constant:
verb = "constant";
@ -2639,10 +2636,11 @@ void DSQL_pretty(const dsql_nod* node, int column)
break;
case nod_field:
context = (DSQL_CTX) node->nod_arg[e_fld_context];
relation = context->ctx_relation;
procedure = context->ctx_procedure;
field = (DSQL_FLD) node->nod_arg[e_fld_field];
{
const dsql_ctx* context = (dsql_ctx*) node->nod_arg[e_fld_context];
const dsql_rel* relation = context->ctx_relation;
const dsql_prc* procedure = context->ctx_procedure;
const dsql_fld* field = (dsql_fld*) node->nod_arg[e_fld_field];
trace_line("%sfield %s.%s, context %d\n", buffer,
(relation != NULL ?
relation->rel_name :
@ -2651,13 +2649,14 @@ void DSQL_pretty(const dsql_nod* node, int column)
"unknown_db_object")),
field->fld_name, context->ctx_context);
return;
}
case nod_field_name:
trace_line("%sfield name: \"", buffer);
string = (STR) node->nod_arg[e_fln_context];
string = (dsql_str*) node->nod_arg[e_fln_context];
if (string)
trace_line("%s.", string->str_data);
string = (STR) node->nod_arg[e_fln_name];
string = (dsql_str*) node->nod_arg[e_fln_name];
if (string != 0) {
trace_line("%s\"\n", string->str_data);
}
@ -2667,20 +2666,25 @@ void DSQL_pretty(const dsql_nod* node, int column)
return;
case nod_map:
{
verb = "map";
trace_line("%s%s\n", buffer, verb);
context = (DSQL_CTX) node->nod_arg[e_map_context];
const dsql_ctx* context = (dsql_ctx*) node->nod_arg[e_map_context];
trace_line("%s context %d\n", buffer, context->ctx_context);
for (map = (DSQL_MAP) node->nod_arg[e_map_map]; map; map = map->map_next) {
for (const dsql_map* map = (dsql_map*) node->nod_arg[e_map_map]; map;
map = map->map_next)
{
trace_line("%s position %d\n", buffer, map->map_position);
DSQL_pretty(map->map_node, column + 1);
}
return;
}
case nod_relation:
context = (DSQL_CTX) node->nod_arg[e_rel_context];
relation = context->ctx_relation;
procedure = context->ctx_procedure;
{
const dsql_ctx* context = (dsql_ctx*) node->nod_arg[e_rel_context];
const dsql_rel* relation = context->ctx_relation;
const dsql_prc* procedure = context->ctx_procedure;
if( relation != NULL ) {
trace_line("%srelation %s, context %d\n",
buffer, relation->rel_name, context->ctx_context);
@ -2694,18 +2698,21 @@ void DSQL_pretty(const dsql_nod* node, int column)
buffer, context->ctx_context);
}
return;
}
case nod_variable:
variable = (var*) node->nod_arg[e_var_variable];
{
const var* variable = (var*) node->nod_arg[e_var_variable];
// Adding variable->var_variable_number to display, obviously something
// is missing from the printf, and Im assuming this was it.
// (anyway can't be worse than it was MOD 05-July-2002.
trace_line("%svariable %s %d\n", buffer, variable->var_name, variable->var_variable_number);
return;
}
case nod_var_name:
trace_line("%svariable name: \"", buffer);
string = (STR) node->nod_arg[e_vrn_name];
string = (dsql_str*) node->nod_arg[e_vrn_name];
trace_line("%s\"\n", string->str_data);
return;
@ -2727,13 +2734,13 @@ void DSQL_pretty(const dsql_nod* node, int column)
/* CVC: The answer is that nod_arg[0] can be either the udf name or the
pointer to udf struct returned by METD_get_function, so we should resort
to the block type. The replacement happens in pass1_udf(). */
// switch (node->nod_arg [e_udf_name]->nod_header.blk_type) {
switch (MemoryPool::blk_type(node->nod_arg [e_udf_name])) {
// switch (node->nod_arg[e_udf_name]->nod_header.blk_type) {
switch (MemoryPool::blk_type(node->nod_arg[e_udf_name])) {
case dsql_type_udf:
trace_line ("%s\"\n", ((UDF) node->nod_arg [e_udf_name])->udf_name);
trace_line ("%s\"\n", ((dsql_udf*) node->nod_arg[e_udf_name])->udf_name);
break;
case dsql_type_str:
string = (STR) node->nod_arg [e_udf_name];
string = (dsql_str*) node->nod_arg[e_udf_name];
trace_line ("%s\"\n", string->str_data);
break;
default:
@ -3048,7 +3055,7 @@ static void execute_blob( dsql_req* request,
TSQL tdsql = GET_THREAD_DATA;
blb* blob = request->req_blob;
dsql_blb* blob = request->req_blob;
map_in_out(request, blob->blb_open_in_msg, in_blr_length, in_blr,
in_msg_length, in_msg);
@ -3087,7 +3094,7 @@ static void execute_blob( dsql_req* request,
&request->req_dbb->dbb_database_handle,
&request->req_trans, &request->req_handle,
blob_id, bpb_length,
reinterpret_cast<const UCHAR*>(bpb));
bpb);
THREAD_ENTER;
if (s) {
punt();
@ -4684,13 +4691,13 @@ static dsql_req* prepare(
{
/* Allocate persistent blr string from request's pool. */
request->req_blr_string = FB_NEW_RPT(*tdsql->tsql_default, 980) str;
request->req_blr_string = FB_NEW_RPT(*tdsql->tsql_default, 980) dsql_str;
}
else {
/* Allocate transient blr string from permanent pool so
as not to unnecessarily bloat the request's pool. */
request->req_blr_string = FB_NEW_RPT(*DSQL_permanent_pool, 980) str;
request->req_blr_string = FB_NEW_RPT(*DSQL_permanent_pool, 980) dsql_str;
}
request->req_blr_string->str_length = 980;
request->req_blr = reinterpret_cast<BLOB_PTR*>(request->req_blr_string->str_data);

View File

@ -64,7 +64,7 @@ typedef err* ERR;
#include "../dsql/sym.h"
//! generic data type used to store strings
class str : public pool_alloc_rpt<char, dsql_type_str>
class dsql_str : public pool_alloc_rpt<char, dsql_type_str>
{
public:
const char* str_charset; //!< ASCIIZ Character set identifier for string
@ -72,7 +72,6 @@ public:
ULONG str_length; //!< length of string in BYTES
char str_data[2]; //!< one for ALLOC and one for the NULL
};
typedef str* STR;
// values used in str_flags
@ -85,7 +84,6 @@ public:
blk* lls_object;
dsql_lls* lls_next;
};
typedef dsql_lls* DLLS;
inline void LLS_PUSH(blk* object, dsql_lls** stack)
{
@ -140,11 +138,11 @@ public:
dbb* dbb_next;
class dsql_rel* dbb_relations; //!< known relations in database
class dsql_prc* dbb_procedures; //!< known procedures in database
class udf* dbb_functions; //!< known functions in database
class dsql_udf* dbb_functions; //!< known functions in database
DsqlMemoryPool* dbb_pool; //!< The current pool for the dbb
FRBRD* dbb_database_handle;
FRBRD* dbb_requests[irq_MAX];
str* dbb_dfl_charset;
dsql_str* dbb_dfl_charset;
USHORT dbb_base_level; //!< indicates the version of the engine code itself
USHORT dbb_flags;
USHORT dbb_db_SQL_dialect;
@ -175,7 +173,6 @@ public:
USHORT rel_flags;
TEXT rel_data[3];
};
typedef dsql_rel* DSQL_REL;
// rel_flags bits
enum rel_flags_vals {
@ -211,7 +208,6 @@ public:
SSHORT fld_ttype; //!< ID of field's language_driver
TEXT fld_name[2];
};
typedef dsql_fld* DSQL_FLD;
// values used in fld_flags
@ -226,19 +222,18 @@ enum fld_flags_vals {
const int MAX_ARRAY_DIMENSIONS = 16; //!< max array dimensions
//! database/log/cache file block
class fil : public pool_alloc<dsql_type_fil>
class dsql_fil : public pool_alloc<dsql_type_fil>
{
public:
SLONG fil_length; //!< File length in pages
SLONG fil_start; //!< Starting page
str* fil_name; //!< File name
fil* fil_next; //!< next file
dsql_str* fil_name; //!< File name
dsql_fil* fil_next; //!< next file
SSHORT fil_shadow_number; //!< shadow number if part of shadow
SSHORT fil_manual; //!< flag to indicate manual shadow
SSHORT fil_partitions; //!< number of log file partitions
USHORT fil_flags;
};
typedef fil* FIL;
//! Stored Procedure block
class dsql_prc : public pool_alloc_rpt<SCHAR, dsql_type_prc>
@ -256,7 +251,6 @@ public:
USHORT prc_flags;
TEXT prc_data[3];
};
typedef dsql_prc* DSQL_PRC;
// prc_flags bits
@ -266,10 +260,10 @@ enum prc_flags_vals {
};
//! User defined function block
class udf : public pool_alloc_rpt<SCHAR, dsql_type_udf>
class dsql_udf : public pool_alloc_rpt<SCHAR, dsql_type_udf>
{
public:
udf* udf_next;
dsql_udf* udf_next;
dsql_sym* udf_symbol; //!< Hash symbol for udf
USHORT udf_dtype;
SSHORT udf_scale;
@ -282,7 +276,6 @@ public:
TEXT udf_name[2];
};
typedef udf* UDF;
//! these values are multiplied by -1 to indicate that server frees them
//! on return from the udf
@ -392,18 +385,18 @@ public:
dsql_req* req_sibling; //!< Next sibling request, if cursor update
dsql_req* req_offspring; //!< Cursor update requests
DsqlMemoryPool* req_pool;
DLLS req_context;
DLLS req_union_context; //!< Save contexts for views of unions
DLLS req_dt_context; //!< Save contexts for views of derived tables
dsql_lls* req_context;
dsql_lls* req_union_context; //!< Save contexts for views of unions
dsql_lls* req_dt_context; //!< Save contexts for views of derived tables
dsql_sym* req_name; //!< Name of request
dsql_sym* req_cursor; //!< Cursor symbol, if any
dbb* req_dbb; //!< Database handle
FRBRD* req_trans; //!< Database transaction handle
class opn* req_open_cursor;
dsql_nod* req_ddl_node; //!< Store metadata request
class blb* req_blob; //!< Blob info for blob requests
class dsql_blb* req_blob; //!< Blob info for blob requests
FRBRD* req_handle; //!< OSRI request handle
str* req_blr_string; //!< String block during BLR generation
dsql_str* req_blr_string; //!< String block during BLR generation
class dsql_msg* req_send; //!< Message to be sent to start request
class dsql_msg* req_receive; //!< Per record message to be received
class dsql_msg* req_async; //!< Message for sending scrolling information
@ -427,9 +420,9 @@ public:
USHORT req_scope_level; //!< Scope level for parsing aliases in subqueries
USHORT req_message_number; //!< Next available message number
USHORT req_loop_level; //!< Loop level
DLLS req_labels; //!< Loop labels
dsql_lls* req_labels; //!< Loop labels
USHORT req_cursor_number; //!< Cursor number
DLLS req_cursors; //!< Cursors
dsql_lls* req_cursors; //!< Cursors
USHORT req_in_select_list; //!< now processing "select list"
USHORT req_in_where_clause; //!< processing "where clause"
USHORT req_in_group_by_clause; //!< processing "group by clause"
@ -439,9 +432,8 @@ public:
USHORT req_flags; //!< generic flag
USHORT req_client_dialect; //!< dialect passed into the API call
USHORT req_in_outer_join; //!< processing inside outer-join part
STR req_alias_relation_prefix; //!< prefix for every relation-alias.
dsql_str* req_alias_relation_prefix; //!< prefix for every relation-alias.
};
typedef dsql_req* DSQL_REQ;
// values used in req_flags
@ -461,7 +453,7 @@ enum req_flags_vals {
};
//! Blob
class blb : public pool_alloc<dsql_type_blb>
class dsql_blb : public pool_alloc<dsql_type_blb>
{
public:
dsql_nod* blb_field; //!< Related blob field
@ -473,7 +465,6 @@ public:
class dsql_msg* blb_open_out_msg; //!< Output message from open cursor
class dsql_msg* blb_segment_msg; //!< Segment message
};
typedef blb* BLB;
//! List of open cursors
class opn : public pool_alloc<dsql_type_opn>
@ -491,7 +482,6 @@ class dsql_tra : public pool_alloc<dsql_type_tra>
public:
dsql_tra* tra_next; //!< Next open transaction
};
typedef dsql_tra* DSQL_TRA;
//! Context block used to create an instance of a relation reference
@ -509,9 +499,8 @@ public:
USHORT ctx_context; //!< Context id
USHORT ctx_scope_level; //!< Subquery level within this request
USHORT ctx_flags; //!< Various flag values
DLLS ctx_childs_derived_table; //!< Childs derived table context
dsql_lls* ctx_childs_derived_table; //!< Childs derived table context
};
typedef dsql_ctx* DSQL_CTX;
// Flag values for ctx_flags
@ -526,7 +515,6 @@ public:
dsql_nod* map_node; //!< Value for map item
USHORT map_position; //!< Position in map
};
typedef dsql_map* DSQL_MAP;
//! Message block used in communicating with a running request
class dsql_msg : public pool_alloc<dsql_type_msg>
@ -540,7 +528,6 @@ public:
USHORT msg_parameter; //!< Next parameter number
USHORT msg_index; //!< Next index into SQLDA
};
typedef dsql_msg* DSQL_MSG;
//! Parameter block used to describe a parameter of a message
class par : public pool_alloc<dsql_type_par>

View File

@ -1,265 +1,277 @@
#define ACTIVE 257
#define ADD 258
#define AFTER 259
#define ALL 260
#define ALTER 261
#define AND 262
#define ANY 263
#define AS 264
#define ASC 265
#define AT 266
#define AVG 267
#define AUTO 268
#define BASENAME 269
#define BEFORE 270
#define BEGIN 271
#define BETWEEN 272
#define BLOB 273
#define BY 274
#define CACHE 275
#define CAST 276
#define CHARACTER 277
#define CHECK 278
#define CHECK_POINT_LEN 279
#define COLLATE 280
#define COMMA 281
#define COMMIT 282
#define COMMITTED 283
#define COMPUTED 284
#define CONCATENATE 285
#define CONDITIONAL 286
#define CONSTRAINT 287
#define CONTAINING 288
#define COUNT 289
#define CREATE 290
#define CSTRING 291
#define CURRENT 292
#define CURSOR 293
#define DATABASE 294
#define DATE 295
#define DB_KEY 296
#define KW_DEBUG 297
#define DECIMAL 298
#define DECLARE 299
#define DEFAULT 300
#define KW_DELETE 301
#define DESC 302
#define DISTINCT 303
#define DO 304
#define DOMAIN 305
#define DROP 306
#define ELSE 307
#define END 308
#define ENTRY_POINT 309
#define EQL 310
#define ESCAPE 311
#define EXCEPTION 312
#define EXECUTE 313
#define EXISTS 314
#define EXIT 315
#define EXTERNAL 316
#define FILTER 317
#define FOR 318
#define FOREIGN 319
#define FROM 320
#define FULL 321
#define FUNCTION 322
#define GDSCODE 323
#define GEQ 324
#define GENERATOR 325
#define GEN_ID 326
#define GRANT 327
#define GROUP 328
#define GROUP_COMMIT_WAIT 329
#define GTR 330
#define HAVING 331
#define IF 332
#define KW_IN 333
#define INACTIVE 334
#define INNER 335
#define INPUT_TYPE 336
#define INDEX 337
#define INSERT 338
#define INTEGER 339
#define INTO 340
#define IS 341
#define ISOLATION 342
#define JOIN 343
#define KEY 344
#define KW_CHAR 345
#define KW_DEC 346
#define KW_DOUBLE 347
#define KW_FILE 348
#define KW_FLOAT 349
#define KW_INT 350
#define KW_LONG 351
#define KW_NULL 352
#define KW_NUMERIC 353
#define KW_UPPER 354
#define KW_VALUE 355
#define LENGTH 356
#define LOGFILE 357
#define LPAREN 358
#define LEFT 359
#define LEQ 360
#define LEVEL 361
#define LIKE 362
#define LOG_BUF_SIZE 363
#define LSS 364
#define MANUAL 365
#define MAXIMUM 366
#define MAX_SEGMENT 367
#define MERGE 368
#define MESSAGE 369
#define MINIMUM 370
#define MODULE_NAME 371
#define NAMES 372
#define NATIONAL 373
#define NATURAL 374
#define NCHAR 375
#define NEQ 376
#define NO 377
#define NOT 378
#define NOT_GTR 379
#define NOT_LSS 380
#define NUM_LOG_BUFS 381
#define OF 382
#define ON 383
#define ONLY 384
#define OPTION 385
#define OR 386
#define ORDER 387
#define OUTER 388
#define OUTPUT_TYPE 389
#define OVERFLOW 390
#define PAGE 391
#define PAGES 392
#define PAGE_SIZE 393
#define PARAMETER 394
#define PASSWORD 395
#define PLAN 396
#define POSITION 397
#define POST_EVENT 398
#define PRECISION 399
#define PRIMARY 400
#define PRIVILEGES 401
#define PROCEDURE 402
#define PROTECTED 403
#define RAW_PARTITIONS 404
#define READ 405
#define REAL 406
#define REFERENCES 407
#define RESERVING 408
#define RETAIN 409
#define RETURNING_VALUES 410
#define RETURNS 411
#define REVOKE 412
#define RIGHT 413
#define RPAREN 414
#define ROLLBACK 415
#define SEGMENT 416
#define SELECT 417
#define SET 418
#define SHADOW 419
#define KW_SHARED 420
#define SINGULAR 421
#define KW_SIZE 422
#define SMALLINT 423
#define SNAPSHOT 424
#define SOME 425
#define SORT 426
#define SQLCODE 427
#define STABILITY 428
#define STARTING 429
#define STATISTICS 430
#define SUB_TYPE 431
#define SUSPEND 432
#define SUM 433
#define TABLE 434
#define THEN 435
#define TO 436
#define TRANSACTION 437
#define TRIGGER 438
#define UNCOMMITTED 439
#define UNION 440
#define UNIQUE 441
#define UPDATE 442
#define USER 443
#define VALUES 444
#define VARCHAR 445
#define VARIABLE 446
#define VARYING 447
#define VERSION 448
#define VIEW 449
#define WAIT 450
#define WHEN 451
#define WHERE 452
#define WHILE 453
#define WITH 454
#define WORK 455
#define WRITE 456
#define FLOAT_NUMBER 457
#define NUMBER 458
#define NUMERIC 459
#define SYMBOL 460
#define STRING 461
#define INTRODUCER 462
#define ACTION 463
#define ADMIN 464
#define CASCADE 465
#define FREE_IT 466
#define RESTRICT 467
#define ROLE 468
#define COLUMN 469
#define TYPE 470
#define EXTRACT 471
#define YEAR 472
#define MONTH 473
#define DAY 474
#define HOUR 475
#define MINUTE 476
#define SECOND 477
#define WEEKDAY 478
#define YEARDAY 479
#define TIME 480
#define TIMESTAMP 481
#define CURRENT_DATE 482
#define CURRENT_TIME 483
#define CURRENT_TIMESTAMP 484
#define NUMBER64BIT 485
#define SCALEDINT 486
#define CURRENT_USER 487
#define CURRENT_ROLE 488
#define KW_BREAK 489
#define SUBSTRING 490
#define RECREATE 491
#define KW_DESCRIPTOR 492
#define FIRST 493
#define SKIP 494
#define CURRENT_CONNECTION 495
#define CURRENT_TRANSACTION 496
#define BIGINT 497
#define CASE 498
#define NULLIF 499
#define COALESCE 500
#define USING 501
#define NULLS 502
#define LAST 503
#define ROW_COUNT 504
#define LOCK 505
#define SAVEPOINT 506
#define RELEASE 507
#define STATEMENT 508
#define LEAVE 509
#define INSERTING 510
#define UPDATING 511
#define DELETING 512
#define KW_INSERTING 513
#define KW_UPDATING 514
#define KW_DELETING 515
#define BACKUP 516
#define KW_DIFFERENCE 517
#define OPEN 518
#define CLOSE 519
#define FETCH 520
#define ROWS 521
#ifndef BISON_DSQL_TAB_H
# define BISON_DSQL_TAB_H
# ifndef YYSTYPE
# define YYSTYPE int
# define YYSTYPE_IS_TRIVIAL 1
# endif
# define ACTIVE 257
# define ADD 258
# define AFTER 259
# define ALL 260
# define ALTER 261
# define AND 262
# define ANY 263
# define AS 264
# define ASC 265
# define AT 266
# define AVG 267
# define AUTO 268
# define BASENAME 269
# define BEFORE 270
# define BEGIN 271
# define BETWEEN 272
# define BLOB 273
# define BY 274
# define CACHE 275
# define CAST 276
# define CHARACTER 277
# define CHECK 278
# define CHECK_POINT_LEN 279
# define COLLATE 280
# define COMMA 281
# define COMMIT 282
# define COMMITTED 283
# define COMPUTED 284
# define CONCATENATE 285
# define CONDITIONAL 286
# define CONSTRAINT 287
# define CONTAINING 288
# define COUNT 289
# define CREATE 290
# define CSTRING 291
# define CURRENT 292
# define CURSOR 293
# define DATABASE 294
# define DATE 295
# define DB_KEY 296
# define KW_DEBUG 297
# define DECIMAL 298
# define DECLARE 299
# define DEFAULT 300
# define KW_DELETE 301
# define DESC 302
# define DISTINCT 303
# define DO 304
# define DOMAIN 305
# define DROP 306
# define ELSE 307
# define END 308
# define ENTRY_POINT 309
# define EQL 310
# define ESCAPE 311
# define EXCEPTION 312
# define EXECUTE 313
# define EXISTS 314
# define EXIT 315
# define EXTERNAL 316
# define FILTER 317
# define FOR 318
# define FOREIGN 319
# define FROM 320
# define FULL 321
# define FUNCTION 322
# define GDSCODE 323
# define GEQ 324
# define GENERATOR 325
# define GEN_ID 326
# define GRANT 327
# define GROUP 328
# define GROUP_COMMIT_WAIT 329
# define GTR 330
# define HAVING 331
# define IF 332
# define KW_IN 333
# define INACTIVE 334
# define INNER 335
# define INPUT_TYPE 336
# define INDEX 337
# define INSERT 338
# define INTEGER 339
# define INTO 340
# define IS 341
# define ISOLATION 342
# define JOIN 343
# define KEY 344
# define KW_CHAR 345
# define KW_DEC 346
# define KW_DOUBLE 347
# define KW_FILE 348
# define KW_FLOAT 349
# define KW_INT 350
# define KW_LONG 351
# define KW_NULL 352
# define KW_NUMERIC 353
# define KW_UPPER 354
# define KW_VALUE 355
# define LENGTH 356
# define LOGFILE 357
# define LPAREN 358
# define LEFT 359
# define LEQ 360
# define LEVEL 361
# define LIKE 362
# define LOG_BUF_SIZE 363
# define LSS 364
# define MANUAL 365
# define MAXIMUM 366
# define MAX_SEGMENT 367
# define MERGE 368
# define MESSAGE 369
# define MINIMUM 370
# define MODULE_NAME 371
# define NAMES 372
# define NATIONAL 373
# define NATURAL 374
# define NCHAR 375
# define NEQ 376
# define NO 377
# define NOT 378
# define NOT_GTR 379
# define NOT_LSS 380
# define NUM_LOG_BUFS 381
# define OF 382
# define ON 383
# define ONLY 384
# define OPTION 385
# define OR 386
# define ORDER 387
# define OUTER 388
# define OUTPUT_TYPE 389
# define OVERFLOW 390
# define PAGE 391
# define PAGES 392
# define PAGE_SIZE 393
# define PARAMETER 394
# define PASSWORD 395
# define PLAN 396
# define POSITION 397
# define POST_EVENT 398
# define PRECISION 399
# define PRIMARY 400
# define PRIVILEGES 401
# define PROCEDURE 402
# define PROTECTED 403
# define RAW_PARTITIONS 404
# define READ 405
# define REAL 406
# define REFERENCES 407
# define RESERVING 408
# define RETAIN 409
# define RETURNING_VALUES 410
# define RETURNS 411
# define REVOKE 412
# define RIGHT 413
# define RPAREN 414
# define ROLLBACK 415
# define SEGMENT 416
# define SELECT 417
# define SET 418
# define SHADOW 419
# define KW_SHARED 420
# define SINGULAR 421
# define KW_SIZE 422
# define SMALLINT 423
# define SNAPSHOT 424
# define SOME 425
# define SORT 426
# define SQLCODE 427
# define STABILITY 428
# define STARTING 429
# define STATISTICS 430
# define SUB_TYPE 431
# define SUSPEND 432
# define SUM 433
# define TABLE 434
# define THEN 435
# define TO 436
# define TRANSACTION 437
# define TRIGGER 438
# define UNCOMMITTED 439
# define UNION 440
# define UNIQUE 441
# define UPDATE 442
# define USER 443
# define VALUES 444
# define VARCHAR 445
# define VARIABLE 446
# define VARYING 447
# define VERSION 448
# define VIEW 449
# define WAIT 450
# define WHEN 451
# define WHERE 452
# define WHILE 453
# define WITH 454
# define WORK 455
# define WRITE 456
# define FLOAT_NUMBER 457
# define NUMBER 458
# define NUMERIC 459
# define SYMBOL 460
# define STRING 461
# define INTRODUCER 462
# define ACTION 463
# define ADMIN 464
# define CASCADE 465
# define FREE_IT 466
# define RESTRICT 467
# define ROLE 468
# define COLUMN 469
# define TYPE 470
# define EXTRACT 471
# define YEAR 472
# define MONTH 473
# define DAY 474
# define HOUR 475
# define MINUTE 476
# define SECOND 477
# define WEEKDAY 478
# define YEARDAY 479
# define TIME 480
# define TIMESTAMP 481
# define CURRENT_DATE 482
# define CURRENT_TIME 483
# define CURRENT_TIMESTAMP 484
# define NUMBER64BIT 485
# define SCALEDINT 486
# define CURRENT_USER 487
# define CURRENT_ROLE 488
# define KW_BREAK 489
# define SUBSTRING 490
# define RECREATE 491
# define KW_DESCRIPTOR 492
# define FIRST 493
# define SKIP 494
# define CURRENT_CONNECTION 495
# define CURRENT_TRANSACTION 496
# define BIGINT 497
# define CASE 498
# define NULLIF 499
# define COALESCE 500
# define USING 501
# define NULLS 502
# define LAST 503
# define ROW_COUNT 504
# define LOCK 505
# define SAVEPOINT 506
# define RELEASE 507
# define STATEMENT 508
# define LEAVE 509
# define INSERTING 510
# define UPDATING 511
# define DELETING 512
# define KW_INSERTING 513
# define KW_UPDATING 514
# define KW_DELETING 515
# define BACKUP 516
# define KW_DIFFERENCE 517
# define OPEN 518
# define CLOSE 519
# define FETCH 520
# define ROWS 521
extern YYSTYPE yylval;
#endif /* not BISON_DSQL_TAB_H */

View File

@ -104,7 +104,7 @@ UCHAR GEN_expand_buffer( dsql_req* request, UCHAR byte)
const bool bIsPermanentPool = MemoryPool::blk_pool(request->req_blr_string) == DSQL_permanent_pool;
DsqlMemoryPool* pool = bIsPermanentPool ? DSQL_permanent_pool : tdsql->tsql_default;
str* new_buffer = FB_NEW_RPT(*pool, length) str;
dsql_str* new_buffer = FB_NEW_RPT(*pool, length) dsql_str;
new_buffer->str_length = length;
// one huge pointer per line for LIBS
@ -476,7 +476,7 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
case nod_count:
blr_operator = blr_count;
/* count2
blr_operator = node->nod_arg [0]->nod_arg [e_rse_items] ? blr_count2 : blr_count;
blr_operator = node->nod_arg[0]->nod_arg[e_rse_items] ? blr_count2 : blr_count;
*/
break;
case nod_from:
@ -637,7 +637,7 @@ void GEN_port( dsql_req* request, dsql_msg* message)
/* Allocate buffer for message */
// CVC: again, final possibility of having overflow! Should be < 64K
const USHORT new_len = message->msg_length + DOUBLE_ALIGN - 1;
str* buffer = FB_NEW_RPT(*tdsql->tsql_default, new_len) str;
dsql_str* buffer = FB_NEW_RPT(*tdsql->tsql_default, new_len) dsql_str;
message->msg_buffer =
(UCHAR *) FB_ALIGN((U_IPTR) buffer->str_data, DOUBLE_ALIGN);
@ -873,8 +873,8 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
const dsql_nod* const* end;
dsql_ctx* context;
dsql_msg* message;
str* name;
str* string;
dsql_str* name;
dsql_str* string;
ULONG id_length;
switch (node->nod_type) {
@ -926,7 +926,7 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
else
message = NULL;
stuff(request, blr_exec_proc);
name = (str*) node->nod_arg[e_exe_procedure];
name = (dsql_str*) node->nod_arg[e_exe_procedure];
stuff_cstring(request, name->str_data);
if (temp = node->nod_arg[e_exe_inputs]) {
stuff_word(request, temp->nod_count);
@ -959,7 +959,7 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
case nod_set_generator:
case nod_set_generator2:
stuff(request, blr_set_generator);
string = (str*) node->nod_arg[e_gen_id_name];
string = (dsql_str*) node->nod_arg[e_gen_id_name];
stuff_cstring(request, string->str_data);
GEN_expr(request, node->nod_arg[e_gen_id_value]);
return;
@ -1100,7 +1100,7 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
case nod_user_savepoint:
stuff(request, blr_user_savepoint);
stuff(request, blr_savepoint_set);
stuff_cstring(request, ((str*)node->nod_arg[e_sav_name])->str_data);
stuff_cstring(request, ((dsql_str*)node->nod_arg[e_sav_name])->str_data);
return;
case nod_release_savepoint:
@ -1111,18 +1111,18 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
else {
stuff(request, blr_savepoint_release);
}
stuff_cstring(request, ((str*)node->nod_arg[e_sav_name])->str_data);
stuff_cstring(request, ((dsql_str*)node->nod_arg[e_sav_name])->str_data);
return;
case nod_undo_savepoint:
stuff(request, blr_user_savepoint);
stuff(request, blr_savepoint_undo);
stuff_cstring(request, ((str*)node->nod_arg[e_sav_name])->str_data);
stuff_cstring(request, ((dsql_str*)node->nod_arg[e_sav_name])->str_data);
return;
case nod_exception_stmt:
stuff(request, blr_abort);
string = (str*) node->nod_arg[e_xcps_name];
string = (dsql_str*) node->nod_arg[e_xcps_name];
temp = node->nod_arg[e_xcps_msg];
/* if exception name is undefined,
it means we have re-initiate semantics here,
@ -1616,7 +1616,7 @@ static void gen_descriptor( dsql_req* request, const dsc* desc, bool texttype)
**/
static void gen_error_condition( dsql_req* request, const dsql_nod* node)
{
const str* string;
const dsql_str* string;
switch (node->nod_type) {
case nod_sqlcode:
@ -1626,13 +1626,13 @@ static void gen_error_condition( dsql_req* request, const dsql_nod* node)
case nod_gdscode:
stuff(request, blr_gds_code);
string = (str*) node->nod_arg[0];
string = (dsql_str*) node->nod_arg[0];
stuff_cstring(request, string->str_data);
return;
case nod_exception:
stuff(request, blr_exception);
string = (str*) node->nod_arg[0];
string = (dsql_str*) node->nod_arg[0];
stuff_cstring(request, string->str_data);
return;
@ -1791,7 +1791,7 @@ static void gen_for_select( dsql_req* request, dsql_nod* for_select)
static void gen_gen_id( dsql_req* request, const dsql_nod* node)
{
stuff(request, blr_gen_id);
const str* string = (str*) node->nod_arg[e_gen_id_name];
const dsql_str* string = (dsql_str*) node->nod_arg[e_gen_id_name];
stuff_cstring(request, string->str_data);
GEN_expr(request, node->nod_arg[e_gen_id_value]);
}
@ -1941,7 +1941,7 @@ static void gen_plan( dsql_req* request, const dsql_nod* plan_expression)
gen_relation(request, (dsql_ctx*) arg->nod_arg[e_rel_context]);
/* now stuff the access method for this stream */
const str* index_string;
const dsql_str* index_string;
arg = node->nod_arg[1];
switch (arg->nod_type) {
@ -1951,7 +1951,7 @@ static void gen_plan( dsql_req* request, const dsql_nod* plan_expression)
case nod_index_order:
stuff(request, blr_navigational);
index_string = (str*) arg->nod_arg[0];
index_string = (dsql_str*) arg->nod_arg[0];
stuff_cstring(request, index_string->str_data);
if (!arg->nod_arg[1])
break;
@ -1967,7 +1967,7 @@ static void gen_plan( dsql_req* request, const dsql_nod* plan_expression)
for (const dsql_nod* const* const end2 = ptr2 + arg->nod_count;
ptr2 < end2; ptr2++)
{
index_string = (str*) * ptr2;
index_string = (dsql_str*) * ptr2;
stuff_cstring(request, index_string->str_data);
}
break;
@ -2166,7 +2166,7 @@ static void gen_rse( dsql_req* request, const dsql_nod* rse)
GEN_expr(request, node);
}
if ((node = rse->nod_arg [e_rse_skip]) != NULL) {
if ((node = rse->nod_arg[e_rse_skip]) != NULL) {
stuff(request, blr_skip);
GEN_expr (request, node);
}
@ -2316,7 +2316,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
break;
}
case nod_alias: {
const str* string = (str*) item->nod_arg[e_alias_alias];
const dsql_str* string = (dsql_str*) item->nod_arg[e_alias_alias];
parameter->par_alias = reinterpret_cast<const TEXT*>(string->str_data);
dsql_nod* alias = item->nod_arg[e_alias_value];
if (alias->nod_type == nod_field) {
@ -2344,7 +2344,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
break;
}
case nod_derived_field: {
const str* string = (str*) item->nod_arg[e_derived_field_name];
const dsql_str* string = (dsql_str*) item->nod_arg[e_derived_field_name];
parameter->par_alias = reinterpret_cast<const TEXT*>(string->str_data);
dsql_nod* alias = item->nod_arg[e_derived_field_value];
if (alias->nod_type == nod_field) {
@ -2386,7 +2386,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
break;
}
case nod_alias: {
const str* string = (str*) map_node->nod_arg[e_alias_alias];
const dsql_str* string = (dsql_str*) map_node->nod_arg[e_alias_alias];
parameter->par_alias = reinterpret_cast<const TEXT*>(string->str_data);
dsql_nod* alias = map_node->nod_arg[e_alias_value];
if (alias->nod_type == nod_field) {
@ -2396,7 +2396,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
break;
}
case nod_derived_field: {
const str* string = (str*) map_node->nod_arg[e_derived_field_name];
const dsql_str* string = (dsql_str*) map_node->nod_arg[e_derived_field_name];
parameter->par_alias = reinterpret_cast<const TEXT*>(string->str_data);
dsql_nod* alias = map_node->nod_arg[e_derived_field_value];
if (alias->nod_type == nod_field) {
@ -2432,7 +2432,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
} // case nod_map
case nod_udf:
{
udf* userFunc = (UDF) item->nod_arg[0];
dsql_udf* userFunc = (dsql_udf*) item->nod_arg[0];
name_alias = userFunc->udf_name;
break;
}
@ -2748,7 +2748,7 @@ static void gen_table_lock( dsql_req* request, const dsql_nod* tbl_lock,
stuff(request, lock_mode);
/* stuff table name */
const str* temp = (str*) ((*ptr)->nod_arg[e_rln_name]);
const dsql_str* temp = (dsql_str*) ((*ptr)->nod_arg[e_rln_name]);
stuff_cstring(request, reinterpret_cast<const char*>(temp->str_data));
stuff(request, lock_level);
@ -2769,7 +2769,7 @@ static void gen_table_lock( dsql_req* request, const dsql_nod* tbl_lock,
**/
static void gen_udf( dsql_req* request, const dsql_nod* node)
{
const udf* userFunc = (UDF) node->nod_arg[0];
const dsql_udf* userFunc = (dsql_udf*) node->nod_arg[0];
stuff(request, blr_function);
stuff_cstring(request, userFunc->udf_name);
@ -2803,7 +2803,7 @@ static void gen_union( dsql_req* request, const dsql_nod* union_node)
{
stuff(request, blr_union);
// Obtain the context for UNION from the first DSQL_MAP node
// Obtain the context for UNION from the first dsql_map* node
dsql_nod* items = union_node->nod_arg[e_rse_items];
dsql_nod* map_item = items->nod_arg[0];
// AB: First item could be a virtual field generated by derived table.

View File

@ -28,7 +28,7 @@ UCHAR GEN_expand_buffer(dsql_req*, UCHAR);
void GEN_expr(dsql_req*, dsql_nod*);
void GEN_port(dsql_req*, dsql_msg*);
void GEN_request(dsql_req*, dsql_nod*);
void GEN_return(DSQL_REQ, const dsql_nod*, bool);
void GEN_return(dsql_req*, const dsql_nod*, bool);
void GEN_start_transaction(dsql_req*, const dsql_nod*);
void GEN_statement(dsql_req*, dsql_nod*);

View File

@ -396,14 +396,14 @@ void HSHD_set_flag(
switch (type) {
case SYM_relation:
{
DSQL_REL sym_rel = (DSQL_REL) homonym->sym_object;
dsql_rel* sym_rel = (dsql_rel*) homonym->sym_object;
sym_rel->rel_flags |= flag;
break;
}
case SYM_procedure:
{
DSQL_PRC sym_prc = (DSQL_PRC) homonym->sym_object;
dsql_prc* sym_prc = (dsql_prc*) homonym->sym_object;
sym_prc->prc_flags |= flag;
break;
}

View File

@ -85,7 +85,7 @@ static inline bool is_date_and_time(const dsc& d1, const dsc& d2)
@param numeric_flag
**/
dsql_nod* MAKE_constant(str* constant, dsql_constant_type numeric_flag)
dsql_nod* MAKE_constant(dsql_str* constant, dsql_constant_type numeric_flag)
{
TSQL tdsql = GET_THREAD_DATA;
@ -232,7 +232,7 @@ dsql_nod* MAKE_constant(str* constant, dsql_constant_type numeric_flag)
@param character_set
**/
dsql_nod* MAKE_str_constant(str* constant, SSHORT character_set)
dsql_nod* MAKE_str_constant(dsql_str* constant, SSHORT character_set)
{
TSQL tdsql = GET_THREAD_DATA;
@ -265,7 +265,7 @@ dsql_nod* MAKE_str_constant(str* constant, SSHORT character_set)
@param str
**/
str* MAKE_cstring(const char* str)
dsql_str* MAKE_cstring(const char* str)
{
return MAKE_string(str, strlen(str));
@ -288,8 +288,8 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
dsc desc1, desc2;
USHORT dtype, dtype1, dtype2;
dsql_map* map;
DSQL_CTX context;
DSQL_REL relation;
dsql_ctx* context;
dsql_rel* relation;
dsql_fld* field;
DEV_BLKCHK(node, dsql_type_nod);
@ -420,7 +420,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
/* Beware that JRD treats substring() always as returning CHAR
instead of VARCHAR for historical reasons. */
if (node->nod_type == nod_substr && desc1.dsc_dtype == dtype_blob) {
dsql_nod* for_node = node->nod_arg [e_substr_length];
dsql_nod* for_node = node->nod_arg[e_substr_length];
fb_assert (for_node->nod_desc.dsc_dtype == dtype_long);
/* Migrate the charset from the blob to the string. */
desc->dsc_ttype = desc1.dsc_scale;
@ -888,7 +888,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
case nod_dbkey:
/* Fix for bug 10072 check that the target is a relation */
context = (DSQL_CTX) node->nod_arg[0]->nod_arg[0];
context = (dsql_ctx*) node->nod_arg[0]->nod_arg[0];
relation = context->ctx_relation;
if (relation != 0) {
desc->dsc_dtype = dtype_text;
@ -904,7 +904,7 @@ void MAKE_desc(dsc* desc, dsql_nod* node)
case nod_udf:
{
const udf* userFunc = (UDF) node->nod_arg[0];
const dsql_udf* userFunc = (dsql_udf*) node->nod_arg[0];
desc->dsc_dtype = static_cast<UCHAR>(userFunc->udf_dtype);
desc->dsc_length = userFunc->udf_length;
desc->dsc_scale = static_cast<SCHAR>(userFunc->udf_scale);
@ -1419,7 +1419,7 @@ void MAKE_desc_from_list(dsc* desc, dsql_nod* node, const TEXT* expression_name)
@param indices
**/
dsql_nod* MAKE_field(DSQL_CTX context, dsql_fld* field, dsql_nod* indices)
dsql_nod* MAKE_field(dsql_ctx* context, dsql_fld* field, dsql_nod* indices)
{
DEV_BLKCHK(context, dsql_type_ctx);
DEV_BLKCHK(field, dsql_type_fld);
@ -1454,7 +1454,8 @@ dsql_nod* MAKE_field(DSQL_CTX context, dsql_fld* field, dsql_nod* indices)
}
if ((field->fld_flags & FLD_nullable) ||
(context->ctx_flags & CTX_outer_join)) {
(context->ctx_flags & CTX_outer_join))
{
node->nod_desc.dsc_flags = DSC_nullable;
}
@ -1472,12 +1473,12 @@ dsql_nod* MAKE_field(DSQL_CTX context, dsql_fld* field, dsql_nod* indices)
@param stack
**/
dsql_nod* MAKE_list(DLLS stack)
dsql_nod* MAKE_list(dsql_lls* stack)
{
DEV_BLKCHK(stack, dsql_type_lls);
USHORT count = 0;
for (DLLS temp = stack; temp; temp = temp->lls_next)
for (dsql_lls* temp = stack; temp; temp = temp->lls_next)
++count;
dsql_nod* node = MAKE_node(nod_list, count);
@ -1590,7 +1591,7 @@ par* MAKE_parameter(dsql_msg* message, bool sqlda_flag, bool null_flag,
@param length
**/
str* MAKE_string(const char* str, int length)
dsql_str* MAKE_string(const char* str, int length)
{
return MAKE_tagged_string(str, length, NULL);
}
@ -1650,11 +1651,11 @@ dsql_sym* MAKE_symbol(DBB database,
@param charset
**/
str* MAKE_tagged_string(const char* str_, size_t length, const char* charset)
dsql_str* MAKE_tagged_string(const char* str_, size_t length, const char* charset)
{
TSQL tdsql = GET_THREAD_DATA;
str* string = FB_NEW_RPT(*tdsql->tsql_default, length) str;
dsql_str* string = FB_NEW_RPT(*tdsql->tsql_default, length) dsql_str;
string->str_charset = charset;
string->str_length = length;
memcpy(string->str_data, str_, length);
@ -1680,7 +1681,7 @@ dsql_nod* MAKE_trigger_type(dsql_nod* prefix_node, dsql_nod* suffix_node)
const long suffix = (long) suffix_node->nod_arg[0];
delete prefix_node;
delete suffix_node;
return MAKE_constant((str*) (prefix + suffix - 1), CONSTANT_SLONG);
return MAKE_constant((dsql_str*) (prefix + suffix - 1), CONSTANT_SLONG);
}

View File

@ -28,9 +28,9 @@
#include "../dsql/sym.h"
dsql_nod* MAKE_constant(class str*, dsql_constant_type);
dsql_nod* MAKE_str_constant(class str*, SSHORT);
class str* MAKE_cstring(const char*);
dsql_nod* MAKE_constant(class dsql_str*, dsql_constant_type);
dsql_nod* MAKE_str_constant(class dsql_str*, SSHORT);
class dsql_str* MAKE_cstring(const char*);
void MAKE_desc(dsc*, dsql_nod*);
void MAKE_desc_from_field(dsc*, const class dsql_fld*);
void MAKE_desc_from_list(dsc*, dsql_nod*, const TEXT*);
@ -38,10 +38,10 @@ dsql_nod* MAKE_field(class dsql_ctx*, class dsql_fld*, dsql_nod*);
dsql_nod* MAKE_list(class dsql_lls*);
dsql_nod* MAKE_node(enum nod_t, int);
class par* MAKE_parameter(class dsql_msg* , bool, bool, USHORT);
class str* MAKE_string(const char* , int);
class dsql_str* MAKE_string(const char* , int);
dsql_sym* MAKE_symbol(class dbb*, const TEXT*, USHORT,
enum sym_type, class dsql_req*);
class str* MAKE_tagged_string(const char* str, size_t length, const char* charset);
class dsql_str* MAKE_tagged_string(const char* str, size_t length, const char* charset);
dsql_nod* MAKE_trigger_type(dsql_nod*, dsql_nod*);
dsql_nod* MAKE_variable(class dsql_fld*, const TEXT*, USHORT, USHORT,
USHORT, USHORT);

View File

@ -82,14 +82,15 @@ nested FOR loops are added.
DATABASE DB = STATIC "yachts.lnk";
static const UCHAR blr_bpb[] = { isc_bpb_version1,
static const UCHAR blr_bpb[] = {
isc_bpb_version1,
isc_bpb_source_type, 1, BLOB_blr,
isc_bpb_target_type, 1, BLOB_blr
};
static void check_array(DSQL_REQ, const SCHAR*, DSQL_FLD);
static void convert_dtype(DSQL_FLD, SSHORT);
static void free_function (udf*);
static void check_array(dsql_req*, const SCHAR*, dsql_fld*);
static void convert_dtype(dsql_fld*, SSHORT);
static void free_function (dsql_udf*);
static void free_procedure(dsql_prc*);
static void free_relation(dsql_rel*);
static TEXT* metd_exact_name(TEXT*);
@ -124,7 +125,7 @@ static inline void metd_rec_unlock()
}
#endif
void METD_drop_function (DSQL_REQ request, const str* name)
void METD_drop_function (dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -142,7 +143,7 @@ void METD_drop_function (DSQL_REQ request, const str* name)
* accessing it.
*
**************************************/
udf* userFunc;
dsql_udf* userFunc;
dsql_sym* symbol;
metd_rec_lock();
@ -154,7 +155,7 @@ void METD_drop_function (DSQL_REQ request, const str* name)
name->str_length, SYM_udf, 0);
for (; symbol; symbol = symbol->sym_homonym) {
if ((symbol->sym_type == SYM_udf) &&
((userFunc = (udf*) symbol->sym_object) &&
((userFunc = (dsql_udf*) symbol->sym_object) &&
(!(userFunc->udf_flags & UDF_dropped))))
{
break;
@ -162,7 +163,7 @@ void METD_drop_function (DSQL_REQ request, const str* name)
}
if (symbol) {
userFunc = (udf*) symbol->sym_object;
userFunc = (dsql_udf*) symbol->sym_object;
userFunc->udf_flags |= UDF_dropped;
}
@ -176,7 +177,7 @@ void METD_drop_function (DSQL_REQ request, const str* name)
}
void METD_drop_procedure( DSQL_REQ request, const str* name)
void METD_drop_procedure( dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -223,7 +224,7 @@ void METD_drop_procedure( DSQL_REQ request, const str* name)
}
void METD_drop_relation( DSQL_REQ request, const str* name)
void METD_drop_relation( dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -271,7 +272,7 @@ void METD_drop_relation( DSQL_REQ request, const str* name)
}
INTLSYM METD_get_collation(DSQL_REQ request, const str* name)
INTLSYM METD_get_collation(dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -351,7 +352,7 @@ INTLSYM METD_get_collation(DSQL_REQ request, const str* name)
}
void METD_get_col_default(DSQL_REQ request,
void METD_get_col_default(dsql_req* request,
const char* for_rel_name,
const char* for_col_name,
bool* has_default,
@ -472,7 +473,7 @@ void METD_get_col_default(DSQL_REQ request,
}
INTLSYM METD_get_charset(DSQL_REQ request, USHORT length, const char* name /* UTF-8 */)
INTLSYM METD_get_charset(dsql_req* request, USHORT length, const char* name /* UTF-8 */)
{
/**************************************
*
@ -557,7 +558,7 @@ INTLSYM METD_get_charset(DSQL_REQ request, USHORT length, const char* name /* UT
}
USHORT METD_get_charset_bpc (DSQL_REQ request,
USHORT METD_get_charset_bpc (dsql_req* request,
SSHORT charset_id)
{
/**************************************
@ -615,7 +616,7 @@ USHORT METD_get_charset_bpc (DSQL_REQ request,
return bpc;
}
STR METD_get_default_charset(DSQL_REQ request)
dsql_str* METD_get_default_charset(dsql_req* request)
{
/**************************************
*
@ -658,7 +659,7 @@ STR METD_get_default_charset(DSQL_REQ request)
/* Terminate ASCIIZ string on first trailing blank */
metd_exact_name(DBB.RDB$CHARACTER_SET_NAME);
length = strlen(DBB.RDB$CHARACTER_SET_NAME);
dbb->dbb_dfl_charset = FB_NEW_RPT(*dbb->dbb_pool, length) str;
dbb->dbb_dfl_charset = FB_NEW_RPT(*dbb->dbb_pool, length) dsql_str;
dbb->dbb_dfl_charset->str_length = length;
dbb->dbb_dfl_charset->str_charset = NULL;
str_ = (UCHAR*) DBB.RDB$CHARACTER_SET_NAME;
@ -691,7 +692,7 @@ THREAD_EXIT;
}
USHORT METD_get_domain(DSQL_REQ request, DSQL_FLD field, const char* name /* UTF-8 */)
USHORT METD_get_domain(dsql_req* request, dsql_fld* field, const char* name /* UTF-8 */)
{
/**************************************
*
@ -753,7 +754,7 @@ USHORT METD_get_domain(DSQL_REQ request, DSQL_FLD field, const char* name /* UTF
}
void METD_get_domain_default(DSQL_REQ request,
void METD_get_domain_default(dsql_req* request,
const TEXT* domain_name,
bool* has_default,
TEXT* buffer, USHORT buff_length)
@ -856,7 +857,7 @@ void METD_get_domain_default(DSQL_REQ request,
}
udf* METD_get_function(DSQL_REQ request, const str* name)
dsql_udf* METD_get_function(dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -870,8 +871,8 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
*
**************************************/
FRBRD *DB, *gds_trans;
udf* userFunc;
udf* temp;
dsql_udf* userFunc;
dsql_udf* temp;
DSQL_NOD udf_param_node, *ptr;
@ -883,18 +884,18 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
reinterpret_cast<const TEXT*>(name->str_data),
name->str_length, SYM_udf, 0);
if (symbol && (symbol->sym_type == SYM_udf) &&
((userFunc = (udf*) symbol->sym_object) &&
((userFunc = (dsql_udf*) symbol->sym_object) &&
(!(userFunc->udf_flags & UDF_dropped))))
{
metd_rec_unlock();
return (udf*) symbol->sym_object;
return (dsql_udf*) symbol->sym_object;
}
/* This was the old code that didn't do the loop above to check for the flag.
if (symbol) {
metd_rec_unlock();
return (udf*) symbol->sym_object;
return (dsql_udf*) symbol->sym_object;
}
*/
@ -904,7 +905,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
DB = dbb->dbb_database_handle;
gds_trans = request->req_trans;
userFunc = NULL;
DLLS stack = 0;
dsql_lls* stack = 0;
USHORT return_arg;
THREAD_EXIT;
@ -915,7 +916,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
THREAD_ENTER;
userFunc = FB_NEW_RPT(*dbb->dbb_pool, name->str_length) udf;
userFunc = FB_NEW_RPT(*dbb->dbb_pool, name->str_length) dsql_udf;
/* Moved below as still can't say for sure it will be stored.
Following the same logic for MET_get_procedure and MET_get_relation
userFunc->udf_next = dbb->dbb_functions;
@ -941,7 +942,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
/* Note: The following two requests differ in the fields which are
* new since ODS7 (DBB_v3 flag). One of the two requests
* here will be cached in dbb_requests [ird_func_return],
* here will be cached in dbb_requests[ird_func_return],
* the one that is appropriate for the database we are
* working against.
*/
@ -1005,7 +1006,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
udf_param_node = FB_NEW_RPT(*dbb->dbb_pool, 0) dsql_nod;
d = &udf_param_node->nod_desc;
d->dsc_dtype = (X.RDB$FIELD_TYPE != blr_blob) ?
gds_cvt_blr_dtype [X.RDB$FIELD_TYPE] : dtype_blob;
gds_cvt_blr_dtype[X.RDB$FIELD_TYPE] : dtype_blob;
d->dsc_scale = X.RDB$FIELD_SCALE;
if (!X.RDB$FIELD_SUB_TYPE.NULL) {
d->dsc_sub_type = X.RDB$FIELD_SUB_TYPE;
@ -1060,7 +1061,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
/* Can't call MAKE_list because it allocates an initial list node
in the default pool. */
USHORT arg_count = 0;
for (DLLS stack_temp = stack; stack_temp; stack_temp = stack_temp->lls_next)
for (dsql_lls* stack_temp = stack; stack_temp; stack_temp = stack_temp->lls_next)
{
++arg_count;
}
@ -1086,14 +1087,14 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
for (; symbol; symbol = symbol->sym_homonym) {
if ((symbol->sym_type == SYM_udf) &&
((temp = (udf*) symbol->sym_object) &&
((temp = (dsql_udf*) symbol->sym_object) &&
(!(temp->udf_flags & UDF_dropped))))
{
/* Get rid of all the stuff we just read in. Use existing one */
free_function (userFunc);
metd_rec_unlock();
return (udf*) symbol->sym_object;
return (dsql_udf*) symbol->sym_object;
}
}
@ -1118,7 +1119,7 @@ udf* METD_get_function(DSQL_REQ request, const str* name)
}
DSQL_NOD METD_get_primary_key(DSQL_REQ request, const str* relation_name)
DSQL_NOD METD_get_primary_key(dsql_req* request, const dsql_str* relation_name)
{
/**************************************
*
@ -1157,7 +1158,7 @@ DSQL_NOD METD_get_primary_key(DSQL_REQ request, const str* relation_name)
if (!list)
list = MAKE_node(nod_list, (int) X.RDB$SEGMENT_COUNT);
str* field_name = MAKE_cstring(Y.RDB$FIELD_NAME);
dsql_str* field_name = MAKE_cstring(Y.RDB$FIELD_NAME);
dsql_nod* field_node = MAKE_node(nod_field_name, (int) e_fln_count);
field_node->nod_arg[e_fln_name] = (DSQL_NOD) field_name;
list->nod_arg[count] = field_node;
@ -1175,7 +1176,7 @@ DSQL_NOD METD_get_primary_key(DSQL_REQ request, const str* relation_name)
}
dsql_prc* METD_get_procedure(DSQL_REQ request, const str* name)
dsql_prc* METD_get_procedure(dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -1191,7 +1192,8 @@ dsql_prc* METD_get_procedure(DSQL_REQ request, const str* name)
**************************************/
FRBRD *DB, *gds_trans;
DBB dbb;
DSQL_FLD parameter, *ptr;
dsql_fld* parameter;
dsql_fld** ptr;
dsql_prc* procedure;
dsql_prc* temp;
SSHORT type, count;
@ -1369,7 +1371,7 @@ dsql_prc* METD_get_procedure(DSQL_REQ request, const str* name)
}
dsql_rel* METD_get_relation(DSQL_REQ request, const str* name)
dsql_rel* METD_get_relation(dsql_req* request, const dsql_str* name)
{
/**************************************
*
@ -1384,7 +1386,8 @@ dsql_rel* METD_get_relation(DSQL_REQ request, const str* name)
**************************************/
FRBRD *DB, *gds_trans;
DBB dbb;
DSQL_FLD field, *ptr;
dsql_fld* field;
dsql_fld** ptr;
dsql_rel* relation;
dsql_rel* temp;
dsql_sym* symbol;
@ -1646,7 +1649,7 @@ dsql_rel* METD_get_relation(DSQL_REQ request, const str* name)
}
STR METD_get_trigger_relation(DSQL_REQ request, const str* name, USHORT* trig_type)
dsql_str* METD_get_trigger_relation(dsql_req* request, const dsql_str* name, USHORT* trig_type)
{
/**************************************
*
@ -1660,7 +1663,7 @@ STR METD_get_trigger_relation(DSQL_REQ request, const str* name, USHORT* trig_ty
**************************************/
FRBRD *DB, *gds_trans;
DBB dbb;
STR relation;
dsql_str* relation;
dbb = request->req_dbb;
DB = dbb->dbb_database_handle;
@ -1692,7 +1695,7 @@ STR METD_get_trigger_relation(DSQL_REQ request, const str* name, USHORT* trig_ty
}
USHORT METD_get_type(DSQL_REQ request, const str* name, char* field, SSHORT* value)
USHORT METD_get_type(dsql_req* request, const dsql_str* name, char* field, SSHORT* value)
{
/**************************************
*
@ -1737,7 +1740,7 @@ USHORT METD_get_type(DSQL_REQ request, const str* name, char* field, SSHORT* val
}
dsql_rel* METD_get_view_relation(DSQL_REQ request,
dsql_rel* METD_get_view_relation(dsql_req* request,
const char* view_name /* UTF-8 */,
const char* relation_or_alias /* UTF-8 */,
USHORT level)
@ -1774,7 +1777,7 @@ dsql_rel* METD_get_view_relation(DSQL_REQ request,
if (!strcmp(X.RDB$RELATION_NAME, relation_or_alias) ||
!strcmp(X.RDB$CONTEXT_NAME, relation_or_alias))
{
STR relation_name = MAKE_string(X.RDB$RELATION_NAME,
dsql_str* relation_name = MAKE_string(X.RDB$RELATION_NAME,
strlen(X.RDB$RELATION_NAME));
relation = METD_get_relation(request, relation_name);
delete relation_name;
@ -1800,7 +1803,7 @@ dsql_rel* METD_get_view_relation(DSQL_REQ request,
}
static void check_array( DSQL_REQ request, const TEXT* field_name, DSQL_FLD field)
static void check_array( dsql_req* request, const TEXT* field_name, dsql_fld* field)
{
/**************************************
*
@ -1847,7 +1850,7 @@ static void check_array( DSQL_REQ request, const TEXT* field_name, DSQL_FLD fiel
}
static void convert_dtype( DSQL_FLD field, SSHORT field_type)
static void convert_dtype( dsql_fld* field, SSHORT field_type)
{
/**************************************
*
@ -1884,7 +1887,7 @@ static void convert_dtype( DSQL_FLD field, SSHORT field_type)
}
static void free_function (udf* userFunc)
static void free_function (dsql_udf* userFunc)
{
/**************************************
*
@ -1902,7 +1905,7 @@ static void free_function (udf* userFunc)
if (userFunc->udf_arguments) {
dsql_nod* args = userFunc->udf_arguments;
for (USHORT arg_count = 0; arg_count < args->nod_count; ++arg_count) {
dsql_nod* udf_argument = args->nod_arg [arg_count];
dsql_nod* udf_argument = args->nod_arg[arg_count];
delete udf_argument;
}
}
@ -1924,7 +1927,8 @@ static void free_procedure( dsql_prc* procedure)
* Free memory allocated for a procedure block and params
*
**************************************/
DSQL_FLD param, temp;
dsql_fld* param;
dsql_fld* temp;
/* release the input & output parameter blocks */
@ -1958,7 +1962,8 @@ static void free_relation( dsql_rel* relation)
* Free memory allocated for a relation block and fields
*
**************************************/
DSQL_FLD field, temp;
dsql_fld* field;
dsql_fld* temp;
/* release the field blocks */

View File

@ -32,26 +32,26 @@
// forward declarations
class dsql_req;
class str;
class dsql_str;
void METD_drop_function(dsql_req*, const str*);
void METD_drop_procedure(dsql_req*, const str*);
void METD_drop_relation(dsql_req*, const str*);
void METD_drop_function(dsql_req*, const dsql_str*);
void METD_drop_procedure(dsql_req*, const dsql_str*);
void METD_drop_relation(dsql_req*, const dsql_str*);
INTLSYM METD_get_charset(dsql_req*, USHORT, const char* name /* UTF-8 */);
USHORT METD_get_charset_bpc(dsql_req*, SSHORT);
INTLSYM METD_get_collation(dsql_req*, const str*);
void METD_get_col_default(DSQL_REQ, const char*, const char*, bool*, TEXT*, USHORT);
STR METD_get_default_charset(dsql_req*);
INTLSYM METD_get_collation(dsql_req*, const dsql_str*);
void METD_get_col_default(dsql_req*, const char*, const char*, bool*, TEXT*, USHORT);
dsql_str* METD_get_default_charset(dsql_req*);
USHORT METD_get_domain(dsql_req*, class dsql_fld*, const char* name /* UTF-8 */);
void METD_get_domain_default(dsql_req*, const TEXT*, bool*, TEXT*, USHORT);
UDF METD_get_function(dsql_req*, const str*);
DSQL_NOD METD_get_primary_key(dsql_req*, const str*);
DSQL_PRC METD_get_procedure(dsql_req*, const str*);
DSQL_REL METD_get_relation(dsql_req*, const str*);
STR METD_get_trigger_relation(dsql_req*, const str*, USHORT*);
USHORT METD_get_type(dsql_req*, const str*, char*, SSHORT*);
DSQL_REL METD_get_view_relation(dsql_req* request,
dsql_udf* METD_get_function(dsql_req*, const dsql_str*);
DSQL_NOD METD_get_primary_key(dsql_req*, const dsql_str*);
dsql_prc* METD_get_procedure(dsql_req*, const dsql_str*);
dsql_rel* METD_get_relation(dsql_req*, const dsql_str*);
dsql_str* METD_get_trigger_relation(dsql_req*, const dsql_str*, USHORT*);
USHORT METD_get_type(dsql_req*, const dsql_str*, char*, SSHORT*);
dsql_rel* METD_get_view_relation(dsql_req* request,
const char* view_name /* UTF-8 */,
const char* relation_or_alias /* UTF-8 */,
USHORT level);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Dynamic SQL runtime support
* MODULE: user_dsql.c
* MODULE: user_dsql.cpp
* DESCRIPTION: Above the Y-valve entrypoints for DSQL
*
*

View File

@ -1780,7 +1780,7 @@ static void print_blob(SLONG* blob_id, TEXT type)
if (isc_open_blob2(status_vector, &DB, &gds_trans, &blob,
(GDS_QUAD*) blob_id, (USHORT) (r - bpb),
reinterpret_cast<const UCHAR*>(bpb)))
bpb))
{
gds__print_status(status_vector);
DDL_err(269, NULL, NULL, NULL, NULL, NULL);

View File

@ -20,7 +20,7 @@
//
// All Rights Reserved.
// Contributor(s): ______________________________________.
// $Id: gpre.cpp,v 1.44 2003-11-03 23:51:47 brodsom Exp $
// $Id: gpre.cpp,v 1.45 2003-11-10 09:16:02 robocop Exp $
// Revision 1.2 2000/11/16 15:54:29 fsg
// Added new switch -verbose to gpre that will dump
// parsed lines to stderr
@ -94,7 +94,8 @@ static bool file_rename(TEXT*, const TEXT*, const TEXT*);
static void finish_based(ACT);
#endif
static int get_char(IB_FILE*);
static bool get_switches(int, TEXT**, const in_sw_tab_t*, SW_TAB, TEXT**);
static bool get_switches(int, TEXT**, const in_sw_tab_t*, SW_TAB,
TEXT**);
static TOK get_token();
static int nextchar();
static SLONG pass1(const TEXT*);
@ -108,7 +109,7 @@ static SSHORT skip_white();
/* Program wide globals */
IB_FILE *input_file, *trace_file;
TEXT* file_name;
const TEXT* file_name;
TEXT* out_file_name;
SLONG position, last_position, line_position, first_position,
prior_line_position;
@ -341,7 +342,7 @@ int main(int argc, char* argv[])
// Call a subroutine to process the input line
//
TEXT* filename_array[4] = { 0 };
TEXT* filename_array[4] = { 0, 0, 0, 0 };
if (!get_switches(argc, argv, gpre_in_sw_table, sw_table, filename_array)) {
CPR_exit(FINI_ERROR);
@ -350,8 +351,8 @@ int main(int argc, char* argv[])
file_name = filename_array[0];
out_file_name = filename_array[1];
TEXT* db_filename = filename_array[2];
TEXT* db_base_directory = filename_array[3];
const TEXT* db_filename = filename_array[2];
//TEXT* db_base_directory = filename_array[3];
if (!file_name) {
ib_fprintf(ib_stderr, "gpre: no source file named.\n");
@ -368,7 +369,8 @@ int main(int argc, char* argv[])
if (sw_language == lang_undef)
for (ext_tab = dml_ext_table; sw_language = ext_tab->ext_language;
ext_tab++) {
ext_tab++)
{
strcpy(spare_file_name, file_name);
if (!(file_rename(spare_file_name, ext_tab->in, NULL)))
break;
@ -381,7 +383,8 @@ int main(int argc, char* argv[])
if (sw_language == lang_undef)
for (ext_tab = dml_ext_table; sw_language = ext_tab->ext_language;
ext_tab++) {
ext_tab++)
{
strcpy(spare_file_name, file_name);
if (file_rename(spare_file_name, ext_tab->in, NULL) &&
(input_file = ib_fopen(spare_file_name, FOPEN_READ_TYPE))) {
@ -1647,9 +1650,6 @@ static bool get_switches(int argc,
SW_TAB sw_table,
TEXT** file_array)
{
TEXT *p, *q, *string;
const in_sw_tab_t* in_sw_table_iterator;
SW_TAB sw_table_iterator;
USHORT in_sw;
//
@ -1658,11 +1658,11 @@ static bool get_switches(int argc,
// we try to open the file.
//
sw_table_iterator = sw_table;
SW_TAB sw_table_iterator = sw_table;
for (--argc; argc; argc--)
{
string = *++argv;
TEXT* string = *++argv;
if (*string != '?')
{
if (*string != '-')
@ -1689,11 +1689,12 @@ static bool get_switches(int argc,
sw_table_iterator++;
sw_table_iterator->sw_in_sw = IN_SW_GPRE_0;
for (in_sw_table_iterator = in_sw_table;
const TEXT* q;
for (const in_sw_tab_t* in_sw_table_iterator = in_sw_table;
q = in_sw_table_iterator->in_sw_name;
in_sw_table_iterator++)
{
p = string + 1;
const TEXT* p = string + 1;
/* handle orphaned hyphen case */

View File

@ -19,7 +19,7 @@
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
* $Id: gpre.h,v 1.53 2003-11-03 23:51:47 brodsom Exp $
* $Id: gpre.h,v 1.54 2003-11-10 09:16:03 robocop Exp $
* Revision 1.3 2000/11/27 09:26:13 fsg
* Fixed bugs in gpre to handle PYXIS forms
* and allow edit.e and fred.e to go through
@ -761,7 +761,7 @@ typedef struct dbb {
FRBRD *dbb_transaction; /* default transaction */
rrl* dbb_rrls; /* temporary list of relation locks */
tpb* dbb_tpbs; /* real tpbs for this db */
TEXT *dbb_filename;
const TEXT* dbb_filename;
TEXT *dbb_runtime;
TEXT *dbb_c_user; /* compiletime user name */
TEXT *dbb_c_password; /* compiletime password */

View File

@ -26,14 +26,6 @@
#ifndef MEMORY_ROUTINES_H
#define MEMORY_ROUTINES_H
/* SD: I didn't find a way to make external functions inline
except including their bodies into header. FIX ME, please */
/*
inline short get_short(const char*);
inline long get_long(const char*);
inline short gather_short(char* &);
inline long gather_long(char* &);
*/
inline SSHORT get_short(const SCHAR* p)
{
@ -52,7 +44,7 @@ inline SSHORT get_short(const SCHAR* p)
#if defined(i386) || defined(I386) || defined(_M_IX86) || defined(VMS)
// For IA32 (little-endian) this optimization is a _very_ large speed-up!
// According to CTO32L definition in common.h this trick work for VAX/VMS
// According to CTO32L definition in common.h this trick works for VAX/VMS
return *reinterpret_cast<const SSHORT*>(p);
#else
// Non-IA32
@ -133,7 +125,7 @@ inline SLONG get_long(const UCHAR* p)
#endif
}
inline SSHORT gather_short(SCHAR* &p)
inline SSHORT gather_short(const SCHAR*& p)
{
/**************************************
*
@ -151,8 +143,7 @@ inline SSHORT gather_short(SCHAR* &p)
#if defined(i386) || defined(I386) || defined(_M_IX86) || defined(VMS)
// For IA32 (little-endian) this optimization is a _very_ large speed-up!
SSHORT value;
value = *reinterpret_cast<const SSHORT*>(p);
const SSHORT value = *reinterpret_cast<const SSHORT*>(p);
p += 2;
return value;
#else
@ -170,7 +161,7 @@ union {
#endif // endianness
}
inline SLONG gather_long(SCHAR* &p)
inline SLONG gather_long(const SCHAR*& p)
{
/**************************************
*
@ -188,8 +179,7 @@ inline SLONG gather_long(SCHAR* &p)
#if defined(i386) || defined(I386) || defined(_M_IX86) || defined(VMS)
// For IA32 (little-endian) this optimization is a _very_ large speed-up!
SLONG value;
value = *reinterpret_cast<const SLONG*>(p);
const SLONG value = *reinterpret_cast<const SLONG*>(p);
p += 4;
return value;
#else

View File

@ -1345,7 +1345,8 @@ static int error(const TEXT* filename,
ISC_STATUS_ARRAY status_vector;
ISC_STATUS* s = status_vector;
*s++ = isc_arg_gds;
*s++ = isc_io_error, *s++ = isc_arg_string;
*s++ = isc_io_error;
*s++ = isc_arg_string;
*s++ = (ISC_STATUS) string;
*s++ = isc_arg_string;
*s++ = (ISC_STATUS) filename;

View File

@ -425,15 +425,15 @@ ISC_STATUS API_ROUTINE gds__get_segment(ISC_STATUS * status_vector,
}
ISC_STATUS API_ROUTINE gds__get_slice(ISC_STATUS * status_vector,
FRBRD **db_handle,
FRBRD **tra_handle,
GDS_QUAD * array_id,
FRBRD** db_handle,
FRBRD** tra_handle,
GDS_QUAD* array_id,
SSHORT sdl_length,
SCHAR * sdl,
SCHAR* sdl,
SSHORT parameters_leng,
SLONG * parameters,
SLONG* parameters,
SLONG slice_length,
void *slice, SLONG * return_length)
void* slice, SLONG* return_length)
{
return isc_get_slice(status_vector, db_handle, tra_handle, array_id,
sdl_length, sdl, parameters_leng, parameters,
@ -482,15 +482,15 @@ ISC_STATUS API_ROUTINE gds__put_segment(ISC_STATUS* status_vector,
return isc_put_segment(status_vector, blob_handle, segment_length, segment);
}
ISC_STATUS API_ROUTINE gds__put_slice(ISC_STATUS * status_vector,
FRBRD **db_handle,
FRBRD **tra_handle,
GDS_QUAD * array_id,
ISC_STATUS API_ROUTINE gds__put_slice(ISC_STATUS* status_vector,
FRBRD** db_handle,
FRBRD** tra_handle,
GDS_QUAD* array_id,
SSHORT sdl_length,
SCHAR * sdl,
SCHAR* sdl,
SSHORT parameters_leng,
SLONG * parameters,
SLONG slice_length, void *slice)
SLONG* parameters,
SLONG slice_length, void* slice)
{
return isc_put_slice(status_vector, db_handle, tra_handle, array_id,
sdl_length, sdl, parameters_leng, parameters,

View File

@ -1368,7 +1368,7 @@ void CMP_get_desc(TDBB tdbb, CSB csb, JRD_NOD node, DSC * desc)
rc_len += DSC_string_length (&desc2);
else
rc_len += DSC_convert_to_text_length(desc2.dsc_dtype);
// error() is a local routine in par.c, so we use plain ERR_post
// error() is a local routine in par.cpp, so we use plain ERR_post
if (rc_len > MAX_FORMAT_SIZE)
ERR_post(isc_imp_exc, isc_arg_gds, isc_blktoobig, 0);
desc->dsc_length = static_cast<USHORT>(rc_len);
@ -2222,7 +2222,7 @@ static UCHAR* alloc_map(TDBB tdbb, CSB csb, USHORT stream)
str* string = FB_NEW_RPT(*tdbb->tdbb_default, MAP_LENGTH) str;
string->str_length = MAP_LENGTH;
csb->csb_rpt[stream].csb_map = (UCHAR *) string->str_data;
fb_assert(stream <= MAX_STREAMS);
fb_assert(stream <= MAX_STREAMS); // CVC: MAX_UCHAR maybe?
string->str_data[0] = (UCHAR) stream;
return (UCHAR*) string->str_data;
@ -2614,6 +2614,7 @@ static JRD_NOD copy(TDBB tdbb,
new_stream = csb->csb_n_stream++;
fb_assert(new_stream <= MAX_STREAMS);
node->nod_arg[e_agg_stream] = (JRD_NOD) (SLONG) new_stream;
// fb_assert(new_stream <= MAX_UCHAR);
remap[stream] = (UCHAR) new_stream;
CMP_csb_element(csb, new_stream);
@ -2817,7 +2818,7 @@ static JRD_NOD make_defaults(TDBB tdbb, CSB csb, USHORT stream, JRD_NOD statemen
if (!(map = csb->csb_rpt[stream].csb_map)) {
map = local_map;
fb_assert(stream <= MAX_STREAMS);
fb_assert(stream <= MAX_STREAMS); // CVC: MAX_UCHAR relevant, too?
map[0] = (UCHAR) stream;
map[1] = 1;
map[2] = 2;
@ -2880,7 +2881,7 @@ static JRD_NOD make_validation(TDBB tdbb, CSB csb, USHORT stream)
if (!(map = csb->csb_rpt[stream].csb_map)) {
map = local_map;
fb_assert(stream <= MAX_STREAMS);
fb_assert(stream <= MAX_STREAMS); // CVC: MAX_UCHAR still relevant for the bitmap?
map[0] = (UCHAR) stream;
}
@ -3130,6 +3131,7 @@ static JRD_NOD pass1(TDBB tdbb,
tail = &csb->csb_rpt[stream];
tail->csb_flags |= csb_modify;
pass1_modify(tdbb, csb, node);
// fb_assert(node->nod_arg [e_mod_new_stream] <= MAX_USHORT);
if ( (node->nod_arg[e_mod_validate] = make_validation(tdbb, csb,
(USHORT)(ULONG) node->
nod_arg[e_mod_new_stream])) ) node->nod_count =

View File

@ -33,7 +33,7 @@
*
*/
/*
$Id: ibase.h,v 1.56 2003-11-08 16:36:07 brodsom Exp $
$Id: ibase.h,v 1.57 2003-11-10 09:16:13 robocop Exp $
*/
#ifndef JRD_IBASE_H
@ -366,13 +366,13 @@ ISC_STATUS ISC_EXPORT isc_attach_database(ISC_STATUS*,
short,
const char*);
ISC_STATUS ISC_EXPORT isc_array_get_slice(ISC_STATUS *,
isc_db_handle *,
isc_tr_handle *,
ISC_QUAD *,
ISC_ARRAY_DESC *,
void *,
ISC_LONG *);
ISC_STATUS ISC_EXPORT isc_array_get_slice(ISC_STATUS*,
isc_db_handle*,
isc_tr_handle*,
ISC_QUAD*,
const ISC_ARRAY_DESC*,
void*,
ISC_LONG*);
ISC_STATUS ISC_EXPORT isc_array_lookup_bounds(ISC_STATUS*,
isc_db_handle*,
@ -396,12 +396,12 @@ ISC_STATUS ISC_EXPORT isc_array_set_desc(ISC_STATUS *,
const short*,
ISC_ARRAY_DESC*);
ISC_STATUS ISC_EXPORT isc_array_put_slice(ISC_STATUS *,
isc_db_handle *,
isc_tr_handle *,
ISC_QUAD *,
ISC_ARRAY_DESC *,
void *,
ISC_STATUS ISC_EXPORT isc_array_put_slice(ISC_STATUS*,
isc_db_handle*,
isc_tr_handle*,
ISC_QUAD*,
const ISC_ARRAY_DESC*,
void*,
ISC_LONG *);
void ISC_EXPORT isc_blob_default_desc(ISC_BLOB_DESC *,

View File

@ -2704,7 +2704,7 @@ ISC_STATUS GDS_GET_SLICE(ISC_STATUS * user_status,
reinterpret_cast<BID>(array_id),
sdl,
param_length,
reinterpret_cast<long*>(param),
reinterpret_cast<const long*>(param),
slice_length, slice);
}
catch (const std::exception&)
@ -2899,7 +2899,7 @@ ISC_STATUS GDS_PUT_SLICE(ISC_STATUS * user_status,
reinterpret_cast<BID>(array_id),
sdl,
param_length,
reinterpret_cast<long*>(param), slice_length, slice);
reinterpret_cast<const long*>(param), slice_length, slice);
}
catch (const std::exception&)
{
@ -6539,8 +6539,10 @@ static void purge_attachment(TDBB tdbb,
{
if (dbb->dbb_attachments || (dbb->dbb_flags & DBB_being_opened))
{
/* There are still attachments so do a partial shutdown */
// There are still attachments so do a partial shutdown
// Both CMP_release() and SCL_release() do advance the pointer
// before the deallocation.
jrd_req* request;
while ( (request = attachment->att_requests) ) {
CMP_release(tdbb, request);

View File

@ -1861,7 +1861,7 @@ BSTREAM* API_ROUTINE Bopen(GDS_QUAD* blob_id,
else if (*mode == 'r' || *mode == 'R') {
if (isc_open_blob2(status_vector, &database, &transaction, &blob,
blob_id, bpb_length,
reinterpret_cast<const UCHAR*>(bpb)))
bpb))
{
return NULL;
}
@ -2057,7 +2057,7 @@ static int dump(
blob = NULL;
if (isc_open_blob2(status_vector, &database, &transaction, &blob, blob_id,
bpb_length, reinterpret_cast<const UCHAR*>(bpb))) {
bpb_length, bpb)) {
isc_print_status(status_vector);
return FALSE;
}

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Lock Manager
* MODULE: driver.c
* MODULE: driver.cpp
* DESCRIPTION: Stand alone test driver
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Access Method
* MODULE: blrtable.c
* MODULE: blrtable.cpp
* DESCRIPTION: blr to internal conversion table generator
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Interbase Message file edit program
* MODULE: change_msgs.e
* MODULE: change_msgs.epp
* DESCRIPTION: Allow limited change of messages in database
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Interbase Message Facility
* MODULE: check_messages.e
* MODULE: check_messages.epp
* DESCRIPTION: Check whether any messages have been updated
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Interbase Message file entry program
* MODULE: enter_messages.e
* MODULE: enter_messages.epp
* DESCRIPTION: Allow entry of messages to database
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Interbase Message file modify for escape chars
* MODULE: modify_messages.e
* MODULE: modify_messages.epp
* DESCRIPTION: Allow modification of messages with translatation of escape sequences
*
* The contents of this file are subject to the Interbase Public

View File

@ -246,7 +246,7 @@ FRBRD *EXEC_open_blob( QLI_NOD node)
ISC_STATUS_ARRAY status_vector;
if (isc_open_blob2(status_vector, &dbb->dbb_handle, &dbb->dbb_transaction,
&blob, (GDS_QUAD*) desc->dsc_address, bpb_length,
reinterpret_cast<const UCHAR*>(bpb)))
bpb))
{
ERRQ_database_error(dbb, status_vector);
}
@ -696,7 +696,7 @@ static bool copy_blob( QLI_NOD value, PAR parameter)
if (isc_open_blob2(status_vector, &from_dbb->dbb_handle,
&from_dbb->dbb_transaction, &from_blob,
(GDS_QUAD*) from_desc->dsc_address, bpb_length,
reinterpret_cast<const UCHAR*>(bpb)))
bpb))
{
ERRQ_database_error(from_dbb, status_vector);
}

View File

@ -447,7 +447,7 @@ FRBRD *PRO_open_blob( DBB database, SLONG * blob_id)
if (isc_open_blob2(status_vector, &database->dbb_handle,
&database->dbb_proc_trans, &blob, (GDS_QUAD*) blob_id,
bpb_length, reinterpret_cast<const UCHAR*>(bpb)))
bpb_length, bpb))
ERRQ_database_error(database, status_vector);
return blob;

View File

@ -258,7 +258,7 @@ int WINAPI WinMain(HINSTANCE hThisInst,
// BRS There is a error in MinGW (3.1.0) headers
// the parameter of StartServiceCtrlDispatcher is declared const in msvc headers
//
#ifdef MINGW
#if defined(MINGW)
if (!StartServiceCtrlDispatcher(const_cast<SERVICE_TABLE_ENTRY*>(service_table))) {
#else
if (!StartServiceCtrlDispatcher(service_table)) {

View File

@ -41,11 +41,11 @@
// It will return big strange value in case of invalid define
#if defined(i386) || defined(I386) || defined(_M_IX86)
#define SWAP_DOUBLE
#elif defined(sparc) || defined(PowerPC)
#undef SWAP_DOUBLE
#else
#if !defined(sparc) && !defined(DARWIN)
#error "Define SWAP_DOUBLE for your platform correctly !"
#endif
#endif
#ifdef VMS
double MTH$CVT_D_G(), MTH$CVT_G_D();

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Command line utilities
* MODULE: cmd_util.c
* MODULE: cmd_util.cpp
* DESCRIPTION: Common functions
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Access Method
* MODULE: dba.e
* MODULE: dba_full.epp
* DESCRIPTION: Database analysis tool
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Access Method
* MODULE: ppg.c
* MODULE: ppg.cpp
* DESCRIPTION: Database page print module
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,7 +1,7 @@
/*
*
* PROGRAM: InterBase server manager
* MODULE: ibmgr.c
* MODULE: ibmgr.cpp
* DESCRIPTION: Main routine and parser
*
* The contents of this file are subject to the Interbase Public
@ -23,7 +23,7 @@
*
* 2002.10.29 Sean Leyne - Removed obsolete "Netware" port
*
* $Id: ibmgr.cpp,v 1.8 2003-11-08 16:33:47 brodsom Exp $
* $Id: ibmgr.cpp,v 1.9 2003-11-10 09:16:33 robocop Exp $
*/
#include "firebird.h"

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: Windows NT service control panel installation program
* MODULE: services.c
* MODULE: services.cpp
* DESCRIPTION: Functions which update the Windows service manager for IB
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Rebuild scrambled database
* MODULE: rebuild.c
* MODULE: rebuild.cpp
* DESCRIPTION: Main routine for analyzing and rebuilding database
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Rebuild scrambled database
* MODULE: rmet.e
* MODULE: rmet.epp
* DESCRIPTION: Crawl around the guts of a database
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Rebuild scrambled database
* MODULE: rstore.e
* MODULE: rstore.epp
* DESCRIPTION: Store page headers for analysis
*
* The contents of this file are subject to the Interbase Public

View File

@ -1,6 +1,6 @@
/*
* PROGRAM: JRD Write Ahead Log File utilitles
* MODULE: walf.c
* MODULE: walf.cpp
* DESCRIPTION: Write Ahead Log File utilities
*
* The contents of this file are subject to the Interbase Public