mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 16:03:02 +01:00
Misc
This commit is contained in:
parent
9f57e5112e
commit
13e1546a70
@ -669,7 +669,7 @@ inline void check_copy_incr(char*& to, const char ch, const char* const string)
|
||||
|
||||
%type <legacyNode> data_type data_type_or_domain datetime_value_expression
|
||||
%type <legacyNode> db_alter_clause db_clause db_file db_file_list db_initial_desc db_initial_desc1
|
||||
%type <legacyNode> db_initial_option db_name db_rem_desc db_rem_desc1 db_rem_option ddl_subname
|
||||
%type <legacyNode> db_initial_option db_rem_desc db_rem_desc1 db_rem_option ddl_subname
|
||||
%type <legacyNode> decimal_keyword declare declare_clause
|
||||
%type <legacyNode> decode_pairs def_computed default_par_opt default_value delete delete_positioned
|
||||
%type <legacyNode> delete_rule delete_searched delimiter_opt derived_column_list derived_table
|
||||
@ -678,7 +678,7 @@ inline void check_copy_incr(char*& to, const char ch, const char* const string)
|
||||
%type <legacyNode> domain_default domain_default_opt domain_or_non_array_type
|
||||
%type <legacyNode> domain_or_non_array_type_name domain_type drop drop_behaviour
|
||||
%type <legacyNode> drop_clause drop_user_clause
|
||||
%type <legacyStr> ddl_desc
|
||||
%type <legacyStr> db_name ddl_desc
|
||||
|
||||
%type <legacyNode> end_default err errors event_argument_opt exception_clause
|
||||
%type <legacyNode> excp_hndl_statement excp_hndl_statements excp_statement
|
||||
@ -1464,10 +1464,10 @@ alter_charset_clause
|
||||
// in preparse.cpp. They are interpreted only in the server, using this grammar.
|
||||
|
||||
db_clause
|
||||
: db_name db_initial_desc1 db_rem_desc1
|
||||
: db_name db_initial_desc1 db_rem_desc1
|
||||
{
|
||||
$$ = make_node (nod_def_database, (int) e_cdb_count,
|
||||
$1, make_list($2), make_list ($3));
|
||||
$$ = make_node(nod_def_database, (int) e_cdb_count,
|
||||
$1, make_list($2), make_list($3));
|
||||
}
|
||||
;
|
||||
|
||||
@ -1478,7 +1478,6 @@ equals
|
||||
|
||||
db_name
|
||||
: sql_string
|
||||
{ $$ = (dsql_nod*) $1; }
|
||||
;
|
||||
|
||||
db_initial_desc1
|
||||
@ -1490,20 +1489,20 @@ db_initial_desc1
|
||||
db_initial_desc
|
||||
: db_initial_option
|
||||
| db_initial_desc db_initial_option
|
||||
{ $$ = make_node (nod_list, 2, $1, $2); }
|
||||
{ $$ = make_node(nod_list, 2, $1, $2); }
|
||||
;
|
||||
|
||||
db_initial_option
|
||||
: KW_PAGE_SIZE equals pos_short_integer
|
||||
{ $$ = make_node (nod_page_size, 1, $3); }
|
||||
{ $$ = make_node(nod_page_size, 1, $3); }
|
||||
| LENGTH equals long_integer page_noise
|
||||
{ $$ = make_node (nod_file_length, 1, $3); }
|
||||
{ $$ = make_node(nod_file_length, 1, $3); }
|
||||
| USER sql_string
|
||||
{ $$ = make_node (nod_user_name, 1, $2); }
|
||||
{ $$ = make_node(nod_user_name, 1, $2); }
|
||||
| PASSWORD sql_string
|
||||
{ $$ = make_node (nod_password, 1, $2); }
|
||||
{ $$ = make_node(nod_password, 1, $2); }
|
||||
| SET NAMES sql_string
|
||||
{ $$ = make_node (nod_lc_ctype, 1, $3); }
|
||||
{ $$ = make_node(nod_lc_ctype, 1, $3); }
|
||||
;
|
||||
|
||||
db_rem_desc1
|
||||
@ -1515,35 +1514,34 @@ db_rem_desc1
|
||||
db_rem_desc
|
||||
: db_rem_option
|
||||
| db_rem_desc db_rem_option
|
||||
{ $$ = make_node (nod_list, 2, $1, $2); }
|
||||
{ $$ = make_node(nod_list, 2, $1, $2); }
|
||||
;
|
||||
|
||||
db_rem_option
|
||||
: db_file
|
||||
| DEFAULT CHARACTER SET symbol_character_set_name
|
||||
{ $$ = make_node (nod_dfl_charset, 1, $4); }
|
||||
{ $$ = make_node(nod_dfl_charset, 1, $4); }
|
||||
| DEFAULT CHARACTER SET symbol_character_set_name COLLATION symbol_collation_name
|
||||
{
|
||||
$$ = make_node (nod_list, 2,
|
||||
make_node (nod_dfl_charset, 1, $4),
|
||||
make_node (nod_dfl_collate, 1, $6));
|
||||
$$ = make_node(nod_list, 2,
|
||||
make_node(nod_dfl_charset, 1, $4),
|
||||
make_node(nod_dfl_collate, 1, $6));
|
||||
}
|
||||
| KW_DIFFERENCE KW_FILE sql_string
|
||||
{ $$ = make_node (nod_difference_file, 1, $3); }
|
||||
{ $$ = make_node(nod_difference_file, 1, $3); }
|
||||
;
|
||||
|
||||
db_file
|
||||
: file1 sql_string file_desc1
|
||||
{
|
||||
lex.g_file->fil_name = $2;
|
||||
$$ = (dsql_nod*) make_node (nod_file_desc, (int) 1,
|
||||
(dsql_nod*) lex.g_file);
|
||||
$$ = make_node(nod_file_desc, (int) 1, (dsql_nod*) lex.g_file);
|
||||
}
|
||||
;
|
||||
|
||||
file1
|
||||
: KW_FILE
|
||||
{ lex.g_file = make_file();}
|
||||
{ lex.g_file = make_file();}
|
||||
;
|
||||
|
||||
file_desc1
|
||||
|
@ -68,4 +68,3 @@ void CMP_shutdown_database(Jrd::thread_db*);
|
||||
void CMP_verify_access(Jrd::thread_db* tdbb, Jrd::jrd_req* request);
|
||||
|
||||
#endif // JRD_CMP_PROTO_H
|
||||
|
||||
|
@ -4728,9 +4728,7 @@ static Format* make_format(thread_db* tdbb, jrd_rel* relation, USHORT* version,
|
||||
defRef.vlu_desc.dsc_address = defRef.vlu_string->str_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
defRef.vlu_desc.dsc_address = (UCHAR*) &defRef.vlu_misc;
|
||||
}
|
||||
}
|
||||
|
||||
/* Compute the offsets of the various fields */
|
||||
@ -5089,44 +5087,43 @@ static bool make_version(thread_db* tdbb, SSHORT phase, DeferredWork* work, jrd_
|
||||
jrd_nod* defaultNode = MET_parse_blob(tdbb, relation, defaultValue,
|
||||
NULL, &defaultRequest, false);
|
||||
|
||||
{ // scope
|
||||
AutoSetRestore2<jrd_req*, thread_db> autoRequest(tdbb,
|
||||
&thread_db::getRequest, &thread_db::setRequest, defaultRequest);
|
||||
// Attention: this is scoped to the end of this "try".
|
||||
AutoSetRestore2<jrd_req*, thread_db> autoRequest(tdbb,
|
||||
&thread_db::getRequest, &thread_db::setRequest, defaultRequest);
|
||||
|
||||
defaultRequest->req_timestamp.validate();
|
||||
defaultRequest->req_timestamp.validate();
|
||||
|
||||
TRA_attach_request(transaction, defaultRequest);
|
||||
dsc* result = EVL_expr(tdbb, defaultNode);
|
||||
TRA_detach_request(defaultRequest);
|
||||
TRA_attach_request(transaction, defaultRequest);
|
||||
dsc* result = EVL_expr(tdbb, defaultNode);
|
||||
TRA_detach_request(defaultRequest);
|
||||
|
||||
if (result)
|
||||
if (result)
|
||||
{
|
||||
tfb->tfb_default.vlu_desc = *result;
|
||||
|
||||
if (result->isText() || result->isBlob())
|
||||
{
|
||||
tfb->tfb_default.vlu_desc = *result;
|
||||
UCHAR* ptr = NULL;
|
||||
MoveBuffer buffer;
|
||||
int len = MOV_make_string2(tdbb, result, CS_NONE, &ptr, buffer, true);
|
||||
fb_assert(ULONG(len) < ULONG(MAX_USHORT));
|
||||
|
||||
if (result->isText() || result->isBlob())
|
||||
{
|
||||
UCHAR* ptr = NULL;
|
||||
MoveBuffer buffer;
|
||||
int len = MOV_make_string2(tdbb, result, CS_NONE, &ptr, buffer, true);
|
||||
fb_assert(ULONG(len) < ULONG(MAX_USHORT));
|
||||
VaryingString* newString = FB_NEW_RPT(*dbb->dbb_permanent,
|
||||
len) VaryingString();
|
||||
newString->str_length = USHORT(len);
|
||||
memcpy(newString->str_data, ptr, len);
|
||||
|
||||
VaryingString* newString = FB_NEW_RPT(*dbb->dbb_permanent,
|
||||
len) VaryingString();
|
||||
newString->str_length = USHORT(len);
|
||||
memcpy(newString->str_data, ptr, len);
|
||||
|
||||
tfb->tfb_default.vlu_string = newString;
|
||||
tfb->tfb_default.vlu_desc.dsc_dtype = dtype_text;
|
||||
tfb->tfb_default.vlu_desc.dsc_length = USHORT(len);
|
||||
tfb->tfb_default.vlu_desc.dsc_address = newString->str_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&tfb->tfb_default.vlu_misc, result->dsc_address,
|
||||
result->dsc_length);
|
||||
tfb->tfb_default.vlu_desc.dsc_address =
|
||||
(UCHAR*) &tfb->tfb_default.vlu_misc;
|
||||
}
|
||||
tfb->tfb_default.vlu_string = newString;
|
||||
tfb->tfb_default.vlu_desc.dsc_dtype = dtype_text;
|
||||
tfb->tfb_default.vlu_desc.dsc_length = USHORT(len);
|
||||
tfb->tfb_default.vlu_desc.dsc_address = newString->str_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&tfb->tfb_default.vlu_misc, result->dsc_address,
|
||||
result->dsc_length);
|
||||
tfb->tfb_default.vlu_desc.dsc_address =
|
||||
(UCHAR*) &tfb->tfb_default.vlu_misc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1227,17 +1227,15 @@ SINT64 DPM_gen_id(thread_db* tdbb, SLONG generator, bool initialize, SINT64 val)
|
||||
* decided that the V6 engine would only access an ODS-10 database.
|
||||
* (and uncommented 2000-05-05, also by ChrisJ, when minds changed.)
|
||||
*/
|
||||
SINT64* ptr = 0;
|
||||
SLONG* lptr = 0;
|
||||
if (dbb->dbb_ods_version >= ODS_VERSION12) {
|
||||
ptr = ((SINT64 *) (page->gpg_values)) + offset;
|
||||
}
|
||||
else if (dbb->dbb_ods_version >= ODS_VERSION10) {
|
||||
ptr = ((SINT64 *) (((old_gen_page*) page)->gpg_values)) + offset;
|
||||
}
|
||||
else {
|
||||
SINT64* ptr = NULL;
|
||||
SLONG* lptr = NULL;
|
||||
|
||||
if (dbb->dbb_ods_version >= ODS_VERSION12)
|
||||
ptr = ((SINT64*) (page->gpg_values)) + offset;
|
||||
else if (dbb->dbb_ods_version >= ODS_VERSION10)
|
||||
ptr = ((SINT64*) (((old_gen_page*) page)->gpg_values)) + offset;
|
||||
else
|
||||
lptr = ((SLONG *) (((pointer_page*) page)->ppg_page)) + offset;
|
||||
}
|
||||
|
||||
if (val || initialize)
|
||||
{
|
||||
|
@ -174,12 +174,12 @@ public:
|
||||
|
||||
// Parameter passing mechanism. Also used for returning values, except for scalar_array.
|
||||
enum FUN_T {
|
||||
FUN_value,
|
||||
FUN_reference,
|
||||
FUN_descriptor,
|
||||
FUN_blob_struct,
|
||||
FUN_scalar_array,
|
||||
FUN_ref_with_null
|
||||
FUN_value,
|
||||
FUN_reference,
|
||||
FUN_descriptor,
|
||||
FUN_blob_struct,
|
||||
FUN_scalar_array,
|
||||
FUN_ref_with_null
|
||||
};
|
||||
|
||||
|
||||
@ -263,4 +263,3 @@ public:
|
||||
} //namespace Jrd
|
||||
|
||||
#endif /* JRD_VAL_H */
|
||||
|
||||
|
@ -2720,7 +2720,7 @@ void VIO_store(thread_db* tdbb, record_param* rpb, jrd_tra* transaction)
|
||||
bool check_blr = true;
|
||||
|
||||
if (ENCODE_ODS(tdbb->getDatabase()->dbb_ods_version,
|
||||
tdbb->getDatabase()->dbb_minor_version) >= ODS_11_1)
|
||||
tdbb->getDatabase()->dbb_minor_version) >= ODS_11_1)
|
||||
{
|
||||
if (EVL_field(0, rpb->rpb_record, f_prc_valid_blr, &desc2))
|
||||
check_blr = MOV_get_long(&desc2, 0) != 0;
|
||||
|
@ -561,4 +561,3 @@ static void sanitize( TEXT* locale)
|
||||
locale++;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user