mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
Misc
This commit is contained in:
parent
b0d1ff8403
commit
7c11f5b6b0
@ -2317,10 +2317,8 @@ void GEN_return(CompiledStatement* statement, const Array<dsql_nod*>& variables,
|
|||||||
stuff(statement, 1);
|
stuff(statement, 1);
|
||||||
stuff(statement, blr_begin);
|
stuff(statement, blr_begin);
|
||||||
|
|
||||||
USHORT outputs = 0;
|
|
||||||
for (Array<dsql_nod*>::const_iterator i = variables.begin(); i != variables.end(); ++i)
|
for (Array<dsql_nod*>::const_iterator i = variables.begin(); i != variables.end(); ++i)
|
||||||
{
|
{
|
||||||
outputs++;
|
|
||||||
const dsql_nod* parameter = *i;
|
const dsql_nod* parameter = *i;
|
||||||
const dsql_var* variable = (dsql_var*) parameter->nod_arg[e_var_variable];
|
const dsql_var* variable = (dsql_var*) parameter->nod_arg[e_var_variable];
|
||||||
stuff(statement, blr_assignment);
|
stuff(statement, blr_assignment);
|
||||||
@ -2342,7 +2340,7 @@ void GEN_return(CompiledStatement* statement, const Array<dsql_nod*>& variables,
|
|||||||
stuff_word(statement, 1);
|
stuff_word(statement, 1);
|
||||||
stuff(statement, blr_parameter);
|
stuff(statement, blr_parameter);
|
||||||
stuff(statement, 1);
|
stuff(statement, 1);
|
||||||
stuff_word(statement, 2 * outputs);
|
stuff_word(statement, USHORT(2 * variables.getCount()));
|
||||||
stuff(statement, blr_end);
|
stuff(statement, blr_end);
|
||||||
if (!eos_flag)
|
if (!eos_flag)
|
||||||
{
|
{
|
||||||
|
@ -3519,12 +3519,12 @@ blob_subtype
|
|||||||
;
|
;
|
||||||
|
|
||||||
charset_clause
|
charset_clause
|
||||||
: CHARACTER SET symbol_character_set_name
|
:
|
||||||
|
{ $$ = NULL; }
|
||||||
|
| CHARACTER SET symbol_character_set_name
|
||||||
{
|
{
|
||||||
lex.g_field->fld_character_set = $3;
|
lex.g_field->fld_character_set = $3;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
{ $$ = NULL; }
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
@ -3615,7 +3615,7 @@ prec_scale :
|
|||||||
| '(' signed_long_integer ')'
|
| '(' signed_long_integer ')'
|
||||||
{
|
{
|
||||||
if ($2 < 1 || $2 > 18)
|
if ($2 < 1 || $2 > 18)
|
||||||
yyabandon (-842, isc_precision_err); // Precision most be between 1 and 18.
|
yyabandon(-842, isc_precision_err); // Precision must be between 1 and 18.
|
||||||
if ($2 > 9)
|
if ($2 > 9)
|
||||||
{
|
{
|
||||||
if ( ( (client_dialect <= SQL_DIALECT_V5) &&
|
if ( ( (client_dialect <= SQL_DIALECT_V5) &&
|
||||||
@ -3748,10 +3748,10 @@ float_type
|
|||||||
;
|
;
|
||||||
|
|
||||||
precision_opt
|
precision_opt
|
||||||
: '(' nonneg_short_integer ')'
|
:
|
||||||
{ $$ = $2; }
|
|
||||||
|
|
|
||||||
{ $$ = 0; }
|
{ $$ = 0; }
|
||||||
|
| '(' nonneg_short_integer ')'
|
||||||
|
{ $$ = $2; }
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
@ -9789,6 +9789,8 @@ dsql_nod* PASS1_resolve_variable_name(const Array<dsql_nod*>& variables, const d
|
|||||||
for (Array<dsql_nod*>::const_iterator i = variables.begin(); i != variables.end(); ++i)
|
for (Array<dsql_nod*>::const_iterator i = variables.begin(); i != variables.end(); ++i)
|
||||||
{
|
{
|
||||||
dsql_nod* var_node = *i;
|
dsql_nod* var_node = *i;
|
||||||
|
|
||||||
|
fb_assert(var_node->nod_type == nod_variable);
|
||||||
if (var_node->nod_type == nod_variable)
|
if (var_node->nod_type == nod_variable)
|
||||||
{
|
{
|
||||||
const dsql_var* variable = (dsql_var*) var_node->nod_arg[e_var_variable];
|
const dsql_var* variable = (dsql_var*) var_node->nod_arg[e_var_variable];
|
||||||
|
@ -34,4 +34,3 @@ Jrd::dsql_nod* PASS1_rse(Jrd::CompiledStatement*, Jrd::dsql_nod*, Jrd::dsql_nod*
|
|||||||
Jrd::dsql_nod* PASS1_statement(Jrd::CompiledStatement*, Jrd::dsql_nod*);
|
Jrd::dsql_nod* PASS1_statement(Jrd::CompiledStatement*, Jrd::dsql_nod*);
|
||||||
|
|
||||||
#endif // DSQL_PASS1_PROTO_H
|
#endif // DSQL_PASS1_PROTO_H
|
||||||
|
|
||||||
|
@ -2135,31 +2135,24 @@ void DYN_define_index(Global* gbl,
|
|||||||
// to an index type in order to compute the length
|
// to an index type in order to compute the length
|
||||||
if (!F.RDB$COLLATION_ID.NULL)
|
if (!F.RDB$COLLATION_ID.NULL)
|
||||||
{
|
{
|
||||||
length =
|
length = INTL_key_length(tdbb,
|
||||||
INTL_key_length(tdbb,
|
INTL_TEXT_TO_INDEX(INTL_CS_COLL_TO_TTYPE(
|
||||||
INTL_TEXT_TO_INDEX(
|
GF.RDB$CHARACTER_SET_ID, F.RDB$COLLATION_ID)),
|
||||||
INTL_CS_COLL_TO_TTYPE(GF.RDB$CHARACTER_SET_ID,
|
|
||||||
F.RDB$COLLATION_ID)),
|
|
||||||
GF.RDB$FIELD_LENGTH);
|
GF.RDB$FIELD_LENGTH);
|
||||||
}
|
}
|
||||||
else if (!GF.RDB$COLLATION_ID.NULL)
|
else if (!GF.RDB$COLLATION_ID.NULL)
|
||||||
{
|
{
|
||||||
length =
|
length = INTL_key_length(tdbb,
|
||||||
INTL_key_length(tdbb,
|
INTL_TEXT_TO_INDEX(INTL_CS_COLL_TO_TTYPE(
|
||||||
INTL_TEXT_TO_INDEX(
|
GF.RDB$CHARACTER_SET_ID, GF.RDB$COLLATION_ID)),
|
||||||
INTL_CS_COLL_TO_TTYPE(GF.RDB$CHARACTER_SET_ID,
|
|
||||||
GF.RDB$COLLATION_ID)),
|
|
||||||
GF.RDB$FIELD_LENGTH);
|
GF.RDB$FIELD_LENGTH);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
length = GF.RDB$FIELD_LENGTH;
|
length = GF.RDB$FIELD_LENGTH;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
length = sizeof(double);
|
length = sizeof(double);
|
||||||
}
|
|
||||||
if (key_length)
|
if (key_length)
|
||||||
{
|
{
|
||||||
key_length += ((length + STUFF_COUNT - 1) / (unsigned) STUFF_COUNT) *
|
key_length += ((length + STUFF_COUNT - 1) / (unsigned) STUFF_COUNT) *
|
||||||
|
@ -2099,8 +2099,10 @@ static void modify_lfield_position(thread_db* tdbb,
|
|||||||
// increase the value of RDB$FIELD_POSITION
|
// increase the value of RDB$FIELD_POSITION
|
||||||
if (field_name == FLD.RDB$FIELD_NAME) {
|
if (field_name == FLD.RDB$FIELD_NAME) {
|
||||||
if (new_position > max_position)
|
if (new_position > max_position)
|
||||||
|
{
|
||||||
// This prevents gaps in the position sequence of the fields
|
// This prevents gaps in the position sequence of the fields
|
||||||
FLD.RDB$FIELD_POSITION = max_position;
|
FLD.RDB$FIELD_POSITION = max_position;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
FLD.RDB$FIELD_POSITION = new_position;
|
FLD.RDB$FIELD_POSITION = new_position;
|
||||||
}
|
}
|
||||||
@ -2183,9 +2185,11 @@ static bool check_view_dependency(thread_db* tdbb,
|
|||||||
CMP_release(tdbb, request);
|
CMP_release(tdbb, request);
|
||||||
|
|
||||||
if (retval)
|
if (retval)
|
||||||
|
{
|
||||||
DYN_error_punt(false, 206, SafeArg() << field_name.c_str() <<
|
DYN_error_punt(false, 206, SafeArg() << field_name.c_str() <<
|
||||||
relation_name.c_str() << view_name.c_str());
|
relation_name.c_str() << view_name.c_str());
|
||||||
// msg 206: Column %s from table %s is referenced in %s.
|
// msg 206: Column %s from table %s is referenced in %s.
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
@ -2222,9 +2226,11 @@ static bool check_sptrig_dependency(thread_db* tdbb,
|
|||||||
CMP_release(tdbb, request);
|
CMP_release(tdbb, request);
|
||||||
|
|
||||||
if (retval)
|
if (retval)
|
||||||
|
{
|
||||||
DYN_error_punt(false, 206, SafeArg() << field_name.c_str() <<
|
DYN_error_punt(false, 206, SafeArg() << field_name.c_str() <<
|
||||||
relation_name.c_str() << dep_name.c_str());
|
relation_name.c_str() << dep_name.c_str());
|
||||||
// msg 206: Column %s from table %s is referenced in %s.
|
// msg 206: Column %s from table %s is referenced in %s.
|
||||||
|
}
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user