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

Backported function name change

This commit is contained in:
alexpeshkoff 2007-11-05 15:03:11 +00:00
parent 547eb36b08
commit 2055dd0955
6 changed files with 33 additions and 33 deletions

View File

@ -1117,7 +1117,7 @@ static void define_constraint_trigger(dsql_req* request, dsql_nod* node)
const dsql_nod* constant = node->nod_arg[e_cnstr_type]; const dsql_nod* constant = node->nod_arg[e_cnstr_type];
if (constant) if (constant)
{ {
const SSHORT type = (SSHORT) constant->getConstant(); const SSHORT type = (SSHORT) constant->getSlong();
request->append_number(isc_dyn_trg_type, type); request->append_number(isc_dyn_trg_type, type);
} }
@ -1549,11 +1549,11 @@ static void define_dimensions( dsql_req* request, const dsql_fld* field)
request->append_number(isc_dyn_def_dimension, position); request->append_number(isc_dyn_def_dimension, position);
const dsql_nod* element = *ptr++; const dsql_nod* element = *ptr++;
request->append_uchar(isc_dyn_dim_lower); request->append_uchar(isc_dyn_dim_lower);
const SLONG lrange = element->getConstant(); const SLONG lrange = element->getSlong();
request->append_ulong_with_length(lrange); request->append_ulong_with_length(lrange);
element = *ptr; element = *ptr;
request->append_uchar(isc_dyn_dim_upper); request->append_uchar(isc_dyn_dim_upper);
const SLONG hrange = element->getConstant(); const SLONG hrange = element->getSlong();
request->append_ulong_with_length(hrange); request->append_ulong_with_length(hrange);
request->append_uchar(isc_dyn_end); request->append_uchar(isc_dyn_end);
if (lrange >= hrange) if (lrange >= hrange)
@ -2007,7 +2007,7 @@ static SSHORT getBlobFilterSubType(dsql_req* request, const dsql_nod* node)
switch (node->nod_desc.dsc_dtype) switch (node->nod_desc.dsc_dtype)
{ {
case dtype_long: case dtype_long:
return (SSHORT) node->getConstant(); return (SSHORT) node->getSlong();
case dtype_text: case dtype_text:
break; break;
default: default:
@ -2936,9 +2936,9 @@ static void define_shadow(dsql_req* request)
request->append_number(isc_dyn_def_shadow, (SSHORT)(IPTR) (ptr[e_shadow_number])); request->append_number(isc_dyn_def_shadow, (SSHORT)(IPTR) (ptr[e_shadow_number]));
request->append_cstring(isc_dyn_def_file, ((dsql_str*) (ptr[e_shadow_name]))->str_data); request->append_cstring(isc_dyn_def_file, ((dsql_str*) (ptr[e_shadow_name]))->str_data);
request->append_number(isc_dyn_shadow_man_auto, request->append_number(isc_dyn_shadow_man_auto,
(SSHORT) ptr[e_shadow_man_auto]->getConstant()); (SSHORT) ptr[e_shadow_man_auto]->getSlong());
request->append_number(isc_dyn_shadow_conditional, request->append_number(isc_dyn_shadow_conditional,
(SSHORT) ptr[e_shadow_conditional]->getConstant()); (SSHORT) ptr[e_shadow_conditional]->getSlong());
request->append_file_start(0); request->append_file_start(0);
@ -3062,14 +3062,14 @@ static void define_trigger(dsql_req* request, NOD_TYPE op)
dsql_nod* constant = trigger_node->nod_arg[e_trg_active]; dsql_nod* constant = trigger_node->nod_arg[e_trg_active];
if (constant) if (constant)
request->append_number(isc_dyn_trg_inactive, (SSHORT) constant->getConstant()); request->append_number(isc_dyn_trg_inactive, (SSHORT) constant->getSlong());
if (constant = trigger_node->nod_arg[e_trg_position]) if (constant = trigger_node->nod_arg[e_trg_position])
request->append_number(isc_dyn_trg_sequence, (SSHORT) constant->getConstant()); request->append_number(isc_dyn_trg_sequence, (SSHORT) constant->getSlong());
if (constant = trigger_node->nod_arg[e_trg_type]) { if (constant = trigger_node->nod_arg[e_trg_type]) {
request->append_number(isc_dyn_trg_type, (SSHORT) constant->getConstant()); request->append_number(isc_dyn_trg_type, (SSHORT) constant->getSlong());
trig_type = (USHORT) constant->getConstant(); trig_type = (USHORT) constant->getSlong();
} }
else { else {
fb_assert(op == nod_mod_trigger); fb_assert(op == nod_mod_trigger);
@ -3181,7 +3181,7 @@ static void define_udf( dsql_req* request)
// CVC: This is case of "returns <type> [by value|reference]" // CVC: This is case of "returns <type> [by value|reference]"
// Some data types can not be returned as value // Some data types can not be returned as value
if (((int) ret_val_ptr[1]->getConstant() == Jrd::FUN_value) && if (((int) ret_val_ptr[1]->getSlong() == Jrd::FUN_value) &&
(field->fld_dtype == dtype_text || (field->fld_dtype == dtype_text ||
field->fld_dtype == dtype_varying || field->fld_dtype == dtype_varying ||
field->fld_dtype == dtype_cstring || field->fld_dtype == dtype_cstring ||
@ -3224,7 +3224,7 @@ static void define_udf( dsql_req* request)
// CVC: This is case of "returns parameter <N>" // CVC: This is case of "returns parameter <N>"
position = (SSHORT) ret_val_ptr[1]->getConstant(); position = (SSHORT) ret_val_ptr[1]->getSlong();
// Function modifies an argument whose value is the function return value // Function modifies an argument whose value is the function return value
if (!arguments || position > arguments->nod_count || position < 1) if (!arguments || position > arguments->nod_count || position < 1)
@ -3246,7 +3246,7 @@ static void define_udf( dsql_req* request)
const dsql_nod* const* param_node = ret_arg->nod_arg; const dsql_nod* const* param_node = ret_arg->nod_arg;
if (param_node[e_udf_param_type]) if (param_node[e_udf_param_type])
{ {
const SSHORT arg_mechanism = (SSHORT) param_node[e_udf_param_type]->getConstant(); const SSHORT arg_mechanism = (SSHORT) param_node[e_udf_param_type]->getSlong();
if (arg_mechanism == Jrd::FUN_scalar_array) if (arg_mechanism == Jrd::FUN_scalar_array)
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -607, ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -607,
isc_arg_gds, isc_random, isc_arg_gds, isc_random,
@ -3266,7 +3266,7 @@ static void define_udf( dsql_req* request)
{ {
/* CVC: I need to test returning blobs by descriptor before allowing the /* CVC: I need to test returning blobs by descriptor before allowing the
change there. For now, I ignore the return type specification. */ change there. For now, I ignore the return type specification. */
const bool free_it = ((SSHORT) ret_val_ptr[1]->getConstant() < 0); const bool free_it = ((SSHORT) ret_val_ptr[1]->getSlong() < 0);
request->append_number(isc_dyn_def_function_arg, blob_position); request->append_number(isc_dyn_def_function_arg, blob_position);
request->append_number(isc_dyn_func_mechanism, request->append_number(isc_dyn_func_mechanism,
(SSHORT)(SLONG) ((free_it ? -1 : 1) * Jrd::FUN_blob_struct)); (SSHORT)(SLONG) ((free_it ? -1 : 1) * Jrd::FUN_blob_struct));
@ -3277,7 +3277,7 @@ static void define_udf( dsql_req* request)
{ {
request->append_number(isc_dyn_def_function_arg, (SSHORT) 0); request->append_number(isc_dyn_def_function_arg, (SSHORT) 0);
request->append_number(isc_dyn_func_mechanism, request->append_number(isc_dyn_func_mechanism,
(SSHORT) ret_val_ptr[1]->getConstant()); (SSHORT) ret_val_ptr[1]->getSlong());
} }
request->append_cstring(isc_dyn_function_name, udf_name); request->append_cstring(isc_dyn_function_name, udf_name);
@ -3313,7 +3313,7 @@ static void define_udf( dsql_req* request)
request->append_number(isc_dyn_def_function_arg, position); request->append_number(isc_dyn_def_function_arg, position);
if (param_node[e_udf_param_type]) { if (param_node[e_udf_param_type]) {
const SSHORT arg_mechanism = (SSHORT) param_node[e_udf_param_type]->getConstant(); const SSHORT arg_mechanism = (SSHORT) param_node[e_udf_param_type]->getSlong();
request->append_number(isc_dyn_func_mechanism, arg_mechanism); request->append_number(isc_dyn_func_mechanism, arg_mechanism);
} }
else if (field->fld_dtype == dtype_blob) { else if (field->fld_dtype == dtype_blob) {
@ -3906,7 +3906,7 @@ static void define_view_trigger( dsql_req* request, dsql_nod* node, dsql_nod* rs
USHORT trig_type; USHORT trig_type;
if (constant) if (constant)
{ {
trig_type = (USHORT) constant->getConstant(); trig_type = (USHORT) constant->getSlong();
request->append_number(isc_dyn_trg_type, trig_type); request->append_number(isc_dyn_trg_type, trig_type);
} }
else else
@ -4616,7 +4616,7 @@ static void make_comment(dsql_req* request)
const dsql_nod* obj_type_node = node->nod_arg[e_comment_obj_type]; const dsql_nod* obj_type_node = node->nod_arg[e_comment_obj_type];
fb_assert(obj_type_node->nod_type == nod_constant fb_assert(obj_type_node->nod_type == nod_constant
&& obj_type_node->nod_desc.dsc_dtype == dtype_long); && obj_type_node->nod_desc.dsc_dtype == dtype_long);
const int obj_type = obj_type_node->getConstant(); const int obj_type = obj_type_node->getSlong();
UCHAR dyn_verb = 0; UCHAR dyn_verb = 0;
switch (obj_type) switch (obj_type)
@ -5471,7 +5471,7 @@ static void modify_relation( dsql_req* request)
const dsql_nod* const_node = element->nod_arg[e_mod_fld_pos_new_position]; const dsql_nod* const_node = element->nod_arg[e_mod_fld_pos_new_position];
// CVC: Since now the parser accepts pos=1..N, let's subtract one here. // CVC: Since now the parser accepts pos=1..N, let's subtract one here.
const SSHORT constant = (SSHORT) const_node->getConstant() - 1; const SSHORT constant = (SSHORT) const_node->getSlong() - 1;
request->append_cstring(isc_dyn_rel_name, request->append_cstring(isc_dyn_rel_name,
relation_name->str_data); relation_name->str_data);

View File

@ -3489,7 +3489,7 @@ static ISC_STATUS execute_request(dsql_req* request,
static SSHORT filter_sub_type( dsql_req* request, const dsql_nod* node) static SSHORT filter_sub_type( dsql_req* request, const dsql_nod* node)
{ {
if (node->nod_type == nod_constant) if (node->nod_type == nod_constant)
return (SSHORT) node->getConstant(); return (SSHORT) node->getSlong();
const dsql_par* parameter = (dsql_par*) node->nod_arg[e_par_parameter]; const dsql_par* parameter = (dsql_par*) node->nod_arg[e_par_parameter];
const dsql_par* null = parameter->par_null; const dsql_par* null = parameter->par_null;

View File

@ -132,7 +132,7 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
case nod_strlen: case nod_strlen:
stuff(request, blr_strlen); stuff(request, blr_strlen);
stuff(request, node->nod_arg[e_strlen_type]->getConstant()); stuff(request, node->nod_arg[e_strlen_type]->getSlong());
GEN_expr(request, node->nod_arg[e_strlen_value]); GEN_expr(request, node->nod_arg[e_strlen_value]);
return; return;
@ -179,7 +179,7 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
if (node->nod_arg[0]) { if (node->nod_arg[0]) {
const dsql_nod* const_node = node->nod_arg[0]; const dsql_nod* const_node = node->nod_arg[0];
fb_assert(const_node->nod_type == nod_constant); fb_assert(const_node->nod_type == nod_constant);
const int precision = (int) const_node->getConstant(); const int precision = (int) const_node->getSlong();
stuff(request, blr_current_time2); stuff(request, blr_current_time2);
stuff(request, precision); stuff(request, precision);
} }
@ -192,7 +192,7 @@ void GEN_expr( dsql_req* request, dsql_nod* node)
if (node->nod_arg[0]) { if (node->nod_arg[0]) {
const dsql_nod* const_node = node->nod_arg[0]; const dsql_nod* const_node = node->nod_arg[0];
fb_assert(const_node->nod_type == nod_constant); fb_assert(const_node->nod_type == nod_constant);
const int precision = (int) const_node->getConstant(); const int precision = (int) const_node->getSlong();
stuff(request, blr_current_timestamp2); stuff(request, blr_current_timestamp2);
stuff(request, precision); stuff(request, precision);
} }
@ -904,7 +904,7 @@ void GEN_start_transaction( dsql_req* request, const dsql_nod* tran_node)
sw_lock_timeout = true; sw_lock_timeout = true;
if (ptr->nod_count == 1 && ptr->nod_arg[0]->nod_type == nod_constant) if (ptr->nod_count == 1 && ptr->nod_arg[0]->nod_type == nod_constant)
{ {
const int lck_timeout = (int) ptr->nod_arg[0]->getConstant(); const int lck_timeout = (int) ptr->nod_arg[0]->getSlong();
stuff(request, isc_tpb_lock_timeout); stuff(request, isc_tpb_lock_timeout);
stuff(request, 2); stuff(request, 2);
stuff_word(request, lck_timeout); stuff_word(request, lck_timeout);
@ -2613,7 +2613,7 @@ static void gen_sort( dsql_req* request, dsql_nod* list)
{ {
dsql_nod* nulls_placement = (*ptr)->nod_arg[e_order_nulls]; dsql_nod* nulls_placement = (*ptr)->nod_arg[e_order_nulls];
if (nulls_placement) { if (nulls_placement) {
switch (nulls_placement->getConstant()) { switch (nulls_placement->getSlong()) {
case NOD_NULLS_FIRST: case NOD_NULLS_FIRST:
stuff(request, blr_nullsfirst); stuff(request, blr_nullsfirst);
break; break;

View File

@ -2060,8 +2060,8 @@ dsql_str* MAKE_tagged_string(const char* strvar, size_t length, const char* char
**/ **/
dsql_nod* MAKE_trigger_type(dsql_nod* prefix_node, dsql_nod* suffix_node) dsql_nod* MAKE_trigger_type(dsql_nod* prefix_node, dsql_nod* suffix_node)
{ {
const SLONG prefix = prefix_node->getConstant(); const SLONG prefix = prefix_node->getSlong();
const SLONG suffix = suffix_node->getConstant(); const SLONG suffix = suffix_node->getSlong();
delete prefix_node; delete prefix_node;
delete suffix_node; delete suffix_node;
return MAKE_const_slong(prefix + suffix - 1); return MAKE_const_slong(prefix + suffix - 1);
@ -2334,7 +2334,7 @@ static void make_parameter_names(dsql_par* parameter, const dsql_nod* item)
break; break;
case nod_strlen: case nod_strlen:
{ {
const ULONG length_type = item->nod_arg[e_strlen_type]->getConstant(); const ULONG length_type = item->nod_arg[e_strlen_type]->getSlong();
switch (length_type) switch (length_type)
{ {

View File

@ -361,7 +361,7 @@ public:
dsql_nod* nod_arg[1]; dsql_nod* nod_arg[1];
dsql_nod() : nod_type(nod_unknown_type), nod_count(0), nod_flags(0) {} dsql_nod() : nod_type(nod_unknown_type), nod_count(0), nod_flags(0) {}
SLONG getConstant() const SLONG getSlong() const
{ {
fb_assert(nod_type == nod_constant); fb_assert(nod_type == nod_constant);
fb_assert(nod_desc.dsc_dtype == dtype_long); fb_assert(nod_desc.dsc_dtype == dtype_long);

View File

@ -942,7 +942,7 @@ dsql_nod* PASS1_node(dsql_req* request, dsql_nod* input, bool proc_flag)
dsql_nod* const_node = input->nod_arg[0]; dsql_nod* const_node = input->nod_arg[0];
if (const_node) { if (const_node) {
fb_assert(const_node->nod_type == nod_constant); fb_assert(const_node->nod_type == nod_constant);
const int precision = (int) const_node->getConstant(); const int precision = (int) const_node->getSlong();
fb_assert(precision >= 0); fb_assert(precision >= 0);
if (precision > MAX_TIME_PRECISION) { if (precision > MAX_TIME_PRECISION) {
ERRD_post(isc_invalid_time_precision, ERRD_post(isc_invalid_time_precision,
@ -5052,7 +5052,7 @@ static dsql_nod* pass1_group_by_list(dsql_req* request, dsql_nod* input, dsql_no
stack.push(frnode); stack.push(frnode);
} }
else if ((sub->nod_type == nod_constant) && (sub->nod_desc.dsc_dtype == dtype_long)) { else if ((sub->nod_type == nod_constant) && (sub->nod_desc.dsc_dtype == dtype_long)) {
const ULONG position = sub->getConstant(); const ULONG position = sub->getSlong();
if ((position < 1) || !selectList || if ((position < 1) || !selectList ||
(position > (ULONG) selectList->nod_count)) (position > (ULONG) selectList->nod_count))
{ {
@ -6813,7 +6813,7 @@ static dsql_nod* pass1_sort( dsql_req* request, dsql_nod* input, dsql_nod* selec
else if (node1->nod_type == nod_constant && else if (node1->nod_type == nod_constant &&
node1->nod_desc.dsc_dtype == dtype_long) node1->nod_desc.dsc_dtype == dtype_long)
{ {
const ULONG position = node1->getConstant(); const ULONG position = node1->getSlong();
if ((position < 1) || !selectList || if ((position < 1) || !selectList ||
(position > (ULONG) selectList->nod_count)) (position > (ULONG) selectList->nod_count))
{ {
@ -7095,7 +7095,7 @@ static dsql_nod* pass1_union( dsql_req* request, dsql_nod* input,
isc_arg_gds, isc_order_by_err, // invalid ORDER BY clause. isc_arg_gds, isc_order_by_err, // invalid ORDER BY clause.
0); 0);
} }
const SLONG number = position->getConstant(); const SLONG number = position->getSlong();
if (number < 1 || number > union_items->nod_count) { if (number < 1 || number > union_items->nod_count) {
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104, ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
isc_arg_gds, isc_dsql_command_err, isc_arg_gds, isc_dsql_command_err,