Skip to content

Commit

Permalink
1) Fixed CORE-831.
Browse files Browse the repository at this point in the history
2) Solved CORE-779 (partially intermixed with another changes that will be committed tomorrow).
  • Loading branch information
dyemanov committed Jul 17, 2006
1 parent 8700d8a commit d5b27fd
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 34 deletions.
25 changes: 19 additions & 6 deletions src/dsql/ddl.cpp
Expand Up @@ -2624,6 +2624,10 @@ static void define_procedure( dsql_req* request, NOD_TYPE op)
request->append_uchar(blr_end);
request->end_blr();

const UCHAR prc_type = (request->req_flags & REQ_selectable) ?
isc_dyn_prc_t_selectable : isc_dyn_prc_t_executable;
request->append_number(isc_dyn_prc_type, prc_type);

request->append_uchar(isc_dyn_end);
}

Expand Down Expand Up @@ -3738,8 +3742,10 @@ static void define_view( dsql_req* request, NOD_TYPE op)
i_ptr < i_end; i_ptr++, position++)
{
dsql_nod* field_node = *i_ptr;
const dsql_str* alias_name = NULL;

if (field_node->nod_type == nod_alias) {
alias_name = (dsql_str*) field_node->nod_arg[e_alias_alias];
field_node = field_node->nod_arg[e_alias_value];
}

Expand All @@ -3754,9 +3760,21 @@ static void define_view( dsql_req* request, NOD_TYPE op)
else
updatable = false;

// determine the proper field name, replacing the default if necessary

if (alias_name) {
field_string = (TEXT*) alias_name->str_data;
}
else if (field) {
field_string = field->fld_name;
}
else {
field_string = NULL;
}

// if this is an expression, check to make sure there is a name specified

if (!ptr && !field)
if (!ptr && !field_string)
{
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) -607,
isc_arg_gds, isc_dsql_command_err,
Expand All @@ -3765,11 +3783,6 @@ static void define_view( dsql_req* request, NOD_TYPE op)
0);
}

// determine the proper field name, replacing the default if necessary

if (field) {
field_string = field->fld_name;
}
/* CVC: Small modification here to catch any mismatch between number of
explicit field names in a view and number of fields in the select expression,
see comment below. This closes Firebird Bug #223059. */
Expand Down
3 changes: 2 additions & 1 deletion src/dsql/dsql.h
Expand Up @@ -473,7 +473,8 @@ enum req_flags_vals {
REQ_backwards = 512,
REQ_blr_version4 = 1024,
REQ_blr_version5 = 2048,
REQ_block = 4096
REQ_block = 4096,
REQ_selectable = 8192
};

//! Blob
Expand Down
1 change: 1 addition & 0 deletions src/dsql/pass1.cpp
Expand Up @@ -1576,6 +1576,7 @@ dsql_nod* PASS1_statement(dsql_req* request, dsql_nod* input, bool proc_flag)
ERRD_post(isc_sqlerr, isc_arg_number, (SLONG) - 104,
isc_arg_gds, isc_token_err, // Token unknown
isc_arg_gds, isc_random, isc_arg_string, "SUSPEND", 0);
request->req_flags |= REQ_selectable;

input->nod_arg[e_rtn_procedure] =
request->req_ddl_node ? request->req_ddl_node : request->req_blk_node;
Expand Down
58 changes: 31 additions & 27 deletions src/jrd/ibase.h
Expand Up @@ -1733,7 +1733,7 @@ int ISC_EXPORT isc_get_client_minor_version ();
#define isc_dyn_idx_type 103
#define isc_dyn_idx_foreign_key 104
#define isc_dyn_idx_ref_column 105
#define isc_dyn_idx_statistic 204
#define isc_dyn_idx_statistic 204

/*******************************/
/* Trigger specific attributes */
Expand Down Expand Up @@ -1789,7 +1789,7 @@ int ISC_EXPORT isc_get_client_minor_version ();
#define isc_dyn_log_file_partitions 178
#define isc_dyn_log_file_serial 179
#define isc_dyn_log_file_overflow 200
#define isc_dyn_log_file_raw 201
#define isc_dyn_log_file_raw 201
*/

/***************************/
Expand Down Expand Up @@ -1817,15 +1817,15 @@ int ISC_EXPORT isc_get_client_minor_version ();
#define isc_dyn_filter_out_subtype 153


#define isc_dyn_description2 154
#define isc_dyn_fld_computed_source2 155
#define isc_dyn_fld_edit_string2 156
#define isc_dyn_fld_query_header2 157
#define isc_dyn_fld_validation_source2 158
#define isc_dyn_trg_msg2 159
#define isc_dyn_trg_source2 160
#define isc_dyn_view_source2 161
#define isc_dyn_xcp_msg2 184
#define isc_dyn_description2 154
#define isc_dyn_fld_computed_source2 155
#define isc_dyn_fld_edit_string2 156
#define isc_dyn_fld_query_header2 157
#define isc_dyn_fld_validation_source2 158
#define isc_dyn_trg_msg2 159
#define isc_dyn_trg_source2 160
#define isc_dyn_view_source2 161
#define isc_dyn_xcp_msg2 184

/*********************************/
/* Generator specific attributes */
Expand All @@ -1843,6 +1843,10 @@ int ISC_EXPORT isc_get_client_minor_version ();
#define isc_dyn_prc_source 169
#define isc_dyn_prc_blr 170
#define isc_dyn_prc_source2 171
#define isc_dyn_prc_type 239

#define isc_dyn_prc_t_selectable 1
#define isc_dyn_prc_t_executable 2

/*********************************/
/* Parameter specific attributes */
Expand Down Expand Up @@ -1906,7 +1910,7 @@ int ISC_EXPORT isc_get_client_minor_version ();
/* Last $dyn value assigned */
/****************************/

#define isc_dyn_last_dyn_value 238
#define isc_dyn_last_dyn_value 239

/******************************************/
/* Array slice description language (SDL) */
Expand Down Expand Up @@ -1964,27 +1968,27 @@ int ISC_EXPORT isc_get_client_minor_version ();

/* types less than zero are reserved for customer use */

#define isc_blob_untyped 0
#define isc_blob_untyped 0

/* internal subtypes */

#define isc_blob_text 1
#define isc_blob_blr 2
#define isc_blob_acl 3
#define isc_blob_ranges 4
#define isc_blob_summary 5
#define isc_blob_format 6
#define isc_blob_tra 7
#define isc_blob_extfile 8
#define isc_blob_max_predefined_subtype 9
#define isc_blob_text 1
#define isc_blob_blr 2
#define isc_blob_acl 3
#define isc_blob_ranges 4
#define isc_blob_summary 5
#define isc_blob_format 6
#define isc_blob_tra 7
#define isc_blob_extfile 8
#define isc_blob_max_predefined_subtype 9

/* the range 20-30 is reserved for dBASE and Paradox types */

#define isc_blob_formatted_memo 20
#define isc_blob_paradox_ole 21
#define isc_blob_graphic 22
#define isc_blob_dbase_ole 23
#define isc_blob_typed_binary 24
#define isc_blob_formatted_memo 20
#define isc_blob_paradox_ole 21
#define isc_blob_graphic 22
#define isc_blob_dbase_ole 23
#define isc_blob_typed_binary 24

/* Deprecated definitions maintained for compatibility only */

Expand Down

0 comments on commit d5b27fd

Please sign in to comment.