mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 08:03:04 +01:00
Return relation alias via API. SQLDA stays untouched for the time being.
This commit is contained in:
parent
2bd7934ce3
commit
3f3eb11ba4
@ -5093,6 +5093,15 @@ static UCHAR* var_info(
|
||||
length = 0;
|
||||
break;
|
||||
|
||||
case isc_info_sql_relation_alias:
|
||||
if (name = param->par_rel_alias) {
|
||||
length = strlen(name);
|
||||
buffer = reinterpret_cast<const UCHAR*>(name);
|
||||
}
|
||||
else
|
||||
length = 0;
|
||||
break;
|
||||
|
||||
case isc_info_sql_alias:
|
||||
if (name = param->par_alias) {
|
||||
length = strlen(name);
|
||||
|
@ -595,6 +595,7 @@ public:
|
||||
const TEXT* par_name; //!< Parameter name, if any
|
||||
const TEXT* par_rel_name; //!< Relation name, if any
|
||||
const TEXT* par_owner_name; //!< Owner name, if any
|
||||
const TEXT* par_rel_alias; //!< Relation alias, if any
|
||||
const TEXT* par_alias; //!< Alias, if any
|
||||
DSC par_desc; //!< Field data type
|
||||
DSC par_user_desc; //!< SQLDA data type
|
||||
|
@ -2288,6 +2288,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
|
||||
parameter->par_rel_name = context->ctx_procedure->prc_name;
|
||||
parameter->par_owner_name = context->ctx_procedure->prc_owner;
|
||||
}
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
break;
|
||||
}
|
||||
case nod_dbkey: {
|
||||
@ -2295,6 +2296,7 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
|
||||
context = (dsql_ctx*) item->nod_arg[0]->nod_arg[0];
|
||||
parameter->par_rel_name = context->ctx_relation->rel_name;
|
||||
parameter->par_owner_name = context->ctx_relation->rel_owner;
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
break;
|
||||
}
|
||||
case nod_alias: {
|
||||
@ -2316,12 +2318,14 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
|
||||
parameter->par_owner_name =
|
||||
context->ctx_procedure->prc_owner;
|
||||
}
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
}
|
||||
else if (alias->nod_type == nod_dbkey) {
|
||||
parameter->par_name = db_key_name;
|
||||
context = (dsql_ctx*) alias->nod_arg[0]->nod_arg[0];
|
||||
parameter->par_rel_name = context->ctx_relation->rel_name;
|
||||
parameter->par_owner_name = context->ctx_relation->rel_owner;
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2344,12 +2348,14 @@ static void gen_select( dsql_req* request, dsql_nod* rse)
|
||||
parameter->par_owner_name =
|
||||
context->ctx_procedure->prc_owner;
|
||||
}
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
}
|
||||
else if (alias->nod_type == nod_dbkey) {
|
||||
parameter->par_name = db_key_name;
|
||||
context = (dsql_ctx*) alias->nod_arg[0]->nod_arg[0];
|
||||
parameter->par_rel_name = context->ctx_relation->rel_name;
|
||||
parameter->par_owner_name = context->ctx_relation->rel_owner;
|
||||
parameter->par_rel_alias = context->ctx_alias;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1776,6 +1776,7 @@ dsql_par* MAKE_parameter(dsql_msg* message, bool sqlda_flag, bool null_flag,
|
||||
parameter->par_parameter = message->msg_parameter++;
|
||||
parameter->par_rel_name = NULL;
|
||||
parameter->par_owner_name = NULL;
|
||||
parameter->par_rel_alias = NULL;
|
||||
|
||||
// If the parameter is used declared, set SQLDA index
|
||||
if (sqlda_flag) {
|
||||
|
@ -339,6 +339,7 @@ enum info_db_provider
|
||||
#define isc_info_sql_get_plan 22
|
||||
#define isc_info_sql_records 23
|
||||
#define isc_info_sql_batch_fetch 24
|
||||
#define isc_info_sql_relation_alias 25
|
||||
|
||||
/*********************************/
|
||||
/* SQL information return values */
|
||||
|
Loading…
Reference in New Issue
Block a user