mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 01:23:03 +01:00
Revert files back after wrong commit
This commit is contained in:
parent
fe6e4fe457
commit
2b47bbe55b
@ -1623,22 +1623,15 @@ ISC_STATUS GDS_DSQL_SQL_INFO_CPP( ISC_STATUS* user_status,
|
||||
}
|
||||
*info++ = item;
|
||||
}
|
||||
else if (item == isc_info_sql_stmt_type || item == isc_info_sql_stmt_selectable)
|
||||
else if (item == isc_info_sql_stmt_type)
|
||||
{
|
||||
// selectable : 0 if statement have no cursor, 1 else.
|
||||
// note: when insert\update\delete returning will be able to
|
||||
// return set of recods, don't forget to mark such statements
|
||||
// as selectable
|
||||
SLONG selectable = 0;
|
||||
switch (request->req_type) {
|
||||
case REQ_SELECT:
|
||||
case REQ_EMBED_SELECT:
|
||||
number = isc_info_sql_stmt_select;
|
||||
selectable = 1;
|
||||
break;
|
||||
case REQ_SELECT_UPD:
|
||||
number = isc_info_sql_stmt_select_for_upd;
|
||||
selectable = 1;
|
||||
break;
|
||||
case REQ_DDL:
|
||||
number = isc_info_sql_stmt_ddl;
|
||||
@ -1685,14 +1678,12 @@ ISC_STATUS GDS_DSQL_SQL_INFO_CPP( ISC_STATUS* user_status,
|
||||
break;
|
||||
case REQ_SELECT_BLOCK:
|
||||
number = isc_info_sql_stmt_select;
|
||||
selectable = 1;
|
||||
break;
|
||||
default:
|
||||
number = 0;
|
||||
break;
|
||||
}
|
||||
length = convert(
|
||||
(item == isc_info_sql_stmt_type ? (SLONG) number : selectable), buffer);
|
||||
length = convert((SLONG) number, buffer);
|
||||
info = put_item(item, length, buffer, info, end_info);
|
||||
if (!info) {
|
||||
return return_success();
|
||||
|
@ -1081,57 +1081,6 @@ void GEN_statement( dsql_req* request, dsql_nod* node)
|
||||
}
|
||||
return;
|
||||
|
||||
case nod_exec_stmt:
|
||||
if (node->nod_arg[e_exec_stmt_proc_block]) {
|
||||
stuff(request, blr_label);
|
||||
stuff(request, (int) (IPTR) node->nod_arg[e_exec_stmt_label]->nod_arg[e_label_number]);
|
||||
}
|
||||
stuff(request, blr_exec_stmt);
|
||||
|
||||
// count of input and output parameters
|
||||
temp = node->nod_arg[e_exec_stmt_inputs];
|
||||
stuff_word(request, temp ? temp->nod_count : 0);
|
||||
|
||||
temp = node->nod_arg[e_exec_stmt_outputs];
|
||||
stuff_word(request, temp ? temp->nod_count : 0);
|
||||
|
||||
// query expression
|
||||
GEN_expr(request, node->nod_arg[e_exec_stmt_sql]);
|
||||
|
||||
// external data source, user and password
|
||||
GEN_expr(request, node->nod_arg[e_exec_stmt_data_src]);
|
||||
GEN_expr(request, node->nod_arg[e_exec_stmt_user]);
|
||||
GEN_expr(request, node->nod_arg[e_exec_stmt_pwd]);
|
||||
|
||||
// statement's transaction behavior
|
||||
stuff_word(request, (USHORT) (IPTR) node->nod_arg[e_exec_stmt_tran]);
|
||||
|
||||
// singleton flag and proc block body
|
||||
if (node->nod_arg[e_exec_stmt_proc_block]) {
|
||||
stuff(request, 0); // non-singleton
|
||||
GEN_statement(request, node->nod_arg[e_exec_stmt_proc_block]);
|
||||
}
|
||||
else {
|
||||
stuff(request, 1); // singleton
|
||||
}
|
||||
|
||||
// inputs
|
||||
temp = node->nod_arg[e_exec_stmt_inputs];
|
||||
if (temp) {
|
||||
for (ptr = temp->nod_arg, end = ptr + temp->nod_count; ptr < end; ptr++) {
|
||||
GEN_expr(request, *ptr);
|
||||
}
|
||||
}
|
||||
|
||||
// outputs
|
||||
temp = node->nod_arg[e_exec_stmt_outputs];
|
||||
if (temp) {
|
||||
for (ptr = temp->nod_arg, end = ptr + temp->nod_count; ptr < end; ptr++) {
|
||||
GEN_expr(request, *ptr);
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
case nod_return:
|
||||
if ( (temp = node->nod_arg[e_rtn_procedure]) )
|
||||
{
|
||||
|
@ -75,7 +75,6 @@ static const TOK tokens[] =
|
||||
{ATAN, "ATAN", 2, false},
|
||||
{ATAN2, "ATAN2", 2, false},
|
||||
{AUTO, "AUTO", 1, false},
|
||||
{AUTONOMOUS, "AUTONOMOUS", 2, true},
|
||||
{AVG, "AVG", 1, false},
|
||||
{BACKUP, "BACKUP", 2, true},
|
||||
{BEFORE, "BEFORE", 1, false},
|
||||
@ -111,7 +110,6 @@ static const TOK tokens[] =
|
||||
{COMMENT, "COMMENT", 2, true},
|
||||
{COMMIT, "COMMIT", 1, false},
|
||||
{COMMITTED, "COMMITTED", 1, false},
|
||||
{COMMON, "COMMON", 2, true},
|
||||
{COMPUTED, "COMPUTED", 1, false},
|
||||
{CONDITIONAL, "CONDITIONAL", 1, false},
|
||||
{CONNECT, "CONNECT", 2, false},
|
||||
@ -134,7 +132,6 @@ static const TOK tokens[] =
|
||||
{CURRENT_USER, "CURRENT_USER", 2, false},
|
||||
{CURSOR, "CURSOR", 1, false},
|
||||
{DATABASE, "DATABASE", 1, false},
|
||||
{DATA, "DATA", 2, true},
|
||||
{DATE, "DATE", 1, false},
|
||||
{DATEADD, "DATEADD", 2, false},
|
||||
{DATEDIFF, "DATEDIFF", 2, false},
|
||||
@ -329,7 +326,6 @@ static const TOK tokens[] =
|
||||
{SNAPSHOT, "SNAPSHOT", 1, false},
|
||||
{SOME, "SOME", 1, false},
|
||||
{SORT, "SORT", 1, false},
|
||||
{SOURCE, "SOURCE", 2, true},
|
||||
{SPACE, "SPACE", 2, true},
|
||||
{SQLCODE, "SQLCODE", 1, false},
|
||||
{SQRT, "SQRT", 2, false},
|
||||
@ -357,7 +353,6 @@ static const TOK tokens[] =
|
||||
{TRIGGER, "TRIGGER", 1, false},
|
||||
{TRIM, "TRIM", 2, false},
|
||||
{TRUNC, "TRUNC", 2, false},
|
||||
{TWO_PHASE, "TWO_PHASE", 2, true},
|
||||
{TYPE, "TYPE", 2, true},
|
||||
{UNCOMMITTED, "UNCOMMITTED", 1, false},
|
||||
{UNDO, "UNDO", 2, true},
|
||||
|
@ -353,9 +353,7 @@ enum nod_t
|
||||
nod_merge_when, // 280
|
||||
nod_merge_update,
|
||||
nod_merge_insert,
|
||||
nod_sys_function,
|
||||
nod_exec_stmt,
|
||||
nod_exec_stmt_inputs
|
||||
nod_sys_function
|
||||
};
|
||||
|
||||
typedef nod_t NOD_TYPE;
|
||||
@ -438,11 +436,7 @@ enum nod_flags_vals {
|
||||
NOD_GLOBAL_TEMP_TABLE_PRESERVE_ROWS = 2,
|
||||
NOD_GLOBAL_TEMP_TABLE_DELETE_ROWS = 3,
|
||||
|
||||
NOD_SPECIAL_SYNTAX = 1, // nod_sys_function
|
||||
|
||||
NOD_TRAN_AUTONOMOUS = 1, // nod_exec_rem_stmt
|
||||
NOD_TRAN_COMMON = 2,
|
||||
NOD_TRAN_2PC = 3
|
||||
NOD_SPECIAL_SYNTAX = 1 // nod_sys_function
|
||||
};
|
||||
|
||||
// Parameters to MAKE_constant
|
||||
@ -516,21 +510,6 @@ enum node_args {
|
||||
e_exec_into_label,
|
||||
e_exec_into_count,
|
||||
|
||||
e_exec_stmt_sql = 0, // nod_exec_rem_stmt
|
||||
e_exec_stmt_inputs,
|
||||
e_exec_stmt_outputs,
|
||||
e_exec_stmt_proc_block,
|
||||
e_exec_stmt_data_src,
|
||||
e_exec_stmt_user,
|
||||
e_exec_stmt_pwd,
|
||||
e_exec_stmt_tran,
|
||||
e_exec_stmt_label,
|
||||
e_exec_stmt_count,
|
||||
|
||||
e_exec_stmt_inputs_sql = 0, // nod_exec_stmt_inputs
|
||||
e_exec_stmt_inputs_params,
|
||||
e_exec_stmt_inputs_count,
|
||||
|
||||
e_internal_info = 0, // nod_internal_info
|
||||
e_internal_info_count,
|
||||
|
||||
|
@ -1680,38 +1680,6 @@ dsql_nod* PASS1_statement(dsql_req* request, dsql_nod* input, bool proc_flag)
|
||||
PASS1_node(request, input->nod_arg[e_exec_into_list], proc_flag);
|
||||
return pass1_savepoint(request, node);
|
||||
|
||||
case nod_exec_stmt:
|
||||
node = MAKE_node(input->nod_type, input->nod_count);
|
||||
node->nod_arg[e_exec_stmt_sql] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_sql], proc_flag);
|
||||
node->nod_arg[e_exec_stmt_inputs] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_inputs], proc_flag);
|
||||
node->nod_arg[e_exec_stmt_outputs] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_outputs], proc_flag);
|
||||
|
||||
if (input->nod_arg[e_exec_stmt_proc_block])
|
||||
{
|
||||
request->req_loop_level++;
|
||||
node->nod_arg[e_exec_stmt_label] = pass1_label(request, input);
|
||||
node->nod_arg[e_exec_stmt_proc_block] =
|
||||
PASS1_statement(request, input->nod_arg[e_exec_stmt_proc_block], proc_flag);
|
||||
request->req_loop_level--;
|
||||
request->req_labels.pop();
|
||||
}
|
||||
|
||||
node->nod_arg[e_exec_stmt_data_src] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_data_src], proc_flag);
|
||||
|
||||
node->nod_arg[e_exec_stmt_user] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_user], proc_flag);
|
||||
|
||||
node->nod_arg[e_exec_stmt_pwd] =
|
||||
PASS1_node(request, input->nod_arg[e_exec_stmt_pwd], proc_flag);
|
||||
|
||||
node->nod_arg[e_exec_stmt_tran] = input->nod_arg[e_exec_stmt_tran];
|
||||
|
||||
return pass1_savepoint(request, node);
|
||||
|
||||
case nod_exit:
|
||||
return input;
|
||||
|
||||
@ -5112,7 +5080,7 @@ static dsql_nod* pass1_field( dsql_req* request, dsql_nod* input,
|
||||
// resolve_context() checks the type of the
|
||||
// given context, so the cast to dsql_ctx* is safe.
|
||||
|
||||
dsql_ctx* context = stack.object();
|
||||
dsql_ctx* context = stack.object();
|
||||
|
||||
if (context->ctx_scope_level != (current_scope_level - 1)) {
|
||||
continue;
|
||||
@ -6436,9 +6404,6 @@ static dsql_nod* pass1_label(dsql_req* request, dsql_nod* input)
|
||||
case nod_exec_into:
|
||||
label = input->nod_arg[e_exec_into_label];
|
||||
break;
|
||||
case nod_exec_stmt:
|
||||
label = input->nod_arg[e_exec_stmt_label];
|
||||
break;
|
||||
case nod_while:
|
||||
label = input->nod_arg[e_while_label];
|
||||
break;
|
||||
|
@ -105,7 +105,6 @@
|
||||
#define isc_dpb_no_db_triggers 72
|
||||
#define isc_dpb_trusted_auth 73
|
||||
#define isc_dpb_process_name 74
|
||||
#define isc_dpb_current_attachment 75
|
||||
|
||||
/**************************************************/
|
||||
/* clumplet tags used inside isc_dpb_address_path */
|
||||
@ -215,7 +214,6 @@
|
||||
#define isc_tpb_restart_requests 19
|
||||
#define isc_tpb_no_auto_undo 20
|
||||
#define isc_tpb_lock_timeout 21
|
||||
#define isc_tpb_current_transaction 22
|
||||
|
||||
|
||||
/************************/
|
||||
|
@ -220,7 +220,6 @@ static const struct
|
||||
{"init_variable", variable},
|
||||
{"recurse", union_ops},
|
||||
{"sys_function", function},
|
||||
{"exec_stmt", exec_into2},
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
|
@ -349,7 +349,4 @@
|
||||
#define blr_recurse (unsigned char)185
|
||||
#define blr_sys_function (unsigned char)186
|
||||
|
||||
/* FB 2.1+ specific BLR */
|
||||
#define blr_exec_stmt (unsigned char)187
|
||||
|
||||
#endif // JRD_BLR_H
|
||||
|
@ -82,7 +82,6 @@
|
||||
#include "../jrd/dsc_proto.h"
|
||||
#include "../jrd/dbg_proto.h" // DBG_supervisor
|
||||
#include "../jrd/execute_statement.h"
|
||||
#include "../jrd/ExtDS.h"
|
||||
|
||||
#include "../jrd/DataTypeUtil.h"
|
||||
#include "../jrd/SysFunction.h"
|
||||
@ -2408,14 +2407,6 @@ void CMP_release(thread_db* tdbb, jrd_req* request)
|
||||
}
|
||||
}
|
||||
|
||||
//ExtStatement *stmt = request->req_ext_stmt;
|
||||
//while (stmt)
|
||||
//{
|
||||
// ExtStatement *next = stmt->m_nextStmt;
|
||||
// stmt->getConnection().deleteStatement(stmt);
|
||||
// stmt = next;
|
||||
//}
|
||||
|
||||
JrdMemoryPool::deletePool(request->req_pool);
|
||||
}
|
||||
|
||||
@ -5299,10 +5290,6 @@ static jrd_nod* pass2(thread_db* tdbb, CompilerScratch* csb, jrd_nod* const node
|
||||
csb->csb_exec_sta.push(node);
|
||||
break;
|
||||
|
||||
case nod_exec_stmt:
|
||||
csb->csb_impure += sizeof(ExtStatement**);
|
||||
break;
|
||||
|
||||
default:
|
||||
// note: no fb_assert(false); here as too many nodes are missing
|
||||
break;
|
||||
|
@ -1485,30 +1485,6 @@ ENTRYPOINT( "gds_internal_compile_request",
|
||||
/*** "_jrd8_internal_compile_request" ***/ NULL,
|
||||
/*** IPI_internal_compile_request ***/ no_entrypoint)
|
||||
|
||||
ENTRYPOINT( "gds_set_public_handle",
|
||||
jrd8_set_public_handle,
|
||||
/*** "jrd5_set_public_handle" ***/ NULL,
|
||||
/*** REM_set_public_handle ***/ no_entrypoint,
|
||||
/*** "REM_set_public_handle" ***/ NULL,
|
||||
/*** CSI_set_public_handle ***/ no_entrypoint,
|
||||
/*** RDB_set_public_handle ***/ no_entrypoint,
|
||||
/*** PSI_set_public_handle ***/ no_entrypoint,
|
||||
/*** PSI5_set_public_handle ***/ no_entrypoint,
|
||||
/*** "_jrd8_set_public_handle" ***/ NULL,
|
||||
/*** IPI_set_public_handle ***/ no_entrypoint)
|
||||
|
||||
ENTRYPOINT( "gds_get_public_handle",
|
||||
jrd8_get_public_handle,
|
||||
/*** "jrd5_get_public_handle" ***/ NULL,
|
||||
/*** REM_get_public_handle ***/ no_entrypoint,
|
||||
/*** "REM_get_public_handle" ***/ NULL,
|
||||
/*** CSI_get_public_handle ***/ no_entrypoint,
|
||||
/*** RDB_get_public_handle ***/ no_entrypoint,
|
||||
/*** PSI_get_public_handle ***/ no_entrypoint,
|
||||
/*** PSI5_get_public_handle ***/ no_entrypoint,
|
||||
/*** "_jrd8_get_public_handle" ***/ NULL,
|
||||
/*** IPI_get_public_handle ***/ no_entrypoint)
|
||||
|
||||
#undef ENTRYPOINT
|
||||
#endif // 0/1
|
||||
|
||||
|
144
src/jrd/exe.cpp
144
src/jrd/exe.cpp
@ -62,7 +62,6 @@
|
||||
#include "../jrd/req.h"
|
||||
#include "../jrd/val.h"
|
||||
#include "../jrd/exe.h"
|
||||
#include "../jrd/ExtDS.h"
|
||||
#include "../jrd/tra.h"
|
||||
#include "gen/iberror.h"
|
||||
#include "../jrd/ods.h"
|
||||
@ -195,7 +194,6 @@ static jrd_nod* erase(thread_db*, jrd_nod*, SSHORT);
|
||||
static void execute_looper(thread_db*, jrd_req*, jrd_tra*, enum jrd_req::req_s);
|
||||
static void exec_sql(thread_db*, jrd_req*, DSC *);
|
||||
static void execute_procedure(thread_db*, jrd_nod*);
|
||||
static jrd_nod* execute_statement(thread_db*, jrd_req*, jrd_nod*);
|
||||
static jrd_req* execute_triggers(thread_db*, trig_vec**, Record*, Record*,
|
||||
enum jrd_req::req_ta);
|
||||
static jrd_nod* looper(thread_db*, jrd_req*, jrd_nod*);
|
||||
@ -1159,7 +1157,7 @@ void EXE_unwind(thread_db* tdbb, jrd_req* request)
|
||||
tdbb->tdbb_request = old_request;
|
||||
tdbb->tdbb_transaction = old_transaction;
|
||||
}
|
||||
if (request->req_exec_sta.getCount() /*|| request->req_ext_stmt*/) {
|
||||
if (request->req_exec_sta.getCount()) {
|
||||
Jrd::ContextPoolHolder context(tdbb, request->req_pool);
|
||||
jrd_req* old_request = tdbb->tdbb_request;
|
||||
tdbb->tdbb_request = request;
|
||||
@ -1173,14 +1171,6 @@ void EXE_unwind(thread_db* tdbb, jrd_req* request)
|
||||
(ExecuteStatement*) ((char *) request + node->nod_impure);
|
||||
impure->Close(tdbb);
|
||||
}
|
||||
|
||||
//ExtStatement* stmt = request->req_ext_stmt;
|
||||
//while (stmt)
|
||||
//{
|
||||
// stmt->close(tdbb);
|
||||
// stmt = stmt->m_nextStmt;
|
||||
//}
|
||||
|
||||
tdbb->tdbb_request = old_request;
|
||||
tdbb->tdbb_transaction = old_transaction;
|
||||
}
|
||||
@ -1641,134 +1631,6 @@ static void execute_procedure(thread_db* tdbb, jrd_nod* node)
|
||||
}
|
||||
|
||||
|
||||
static jrd_nod* execute_statement(thread_db* tdbb, jrd_req* request, jrd_nod* node)
|
||||
{
|
||||
SET_TDBB(tdbb);
|
||||
BLKCHK(node, type_nod);
|
||||
|
||||
ExtStatement** stmt_ptr = (ExtStatement**) ((char*) request + node->nod_impure);
|
||||
ExtStatement* stmt = *stmt_ptr;
|
||||
|
||||
int inputs = (SHORT) (IPTR) node->nod_arg[node->nod_count + e_exec_stmt_extra_inputs];
|
||||
int outputs = (SHORT) (IPTR) node->nod_arg[node->nod_count + e_exec_stmt_extra_outputs];
|
||||
TraScope tra_scope = (TraScope) (IPTR) node->nod_arg[node->nod_count + e_exec_stmt_extra_tran];
|
||||
jrd_nod **node_inputs = node->nod_arg + e_exec_stmt_fixed_count;
|
||||
jrd_nod **node_outputs = node->nod_arg + e_exec_stmt_fixed_count + inputs;
|
||||
jrd_nod *node_proc_block = node->nod_arg[e_exec_stmt_proc_block];
|
||||
|
||||
if (request->req_operation == jrd_req::req_evaluate)
|
||||
{
|
||||
dsc *dsc_sql = EVL_expr(tdbb, node->nod_arg[e_exec_stmt_stmt_sql]);
|
||||
dsc *dsc_dataSrc = EVL_expr(tdbb, node->nod_arg[e_exec_stmt_data_src]);
|
||||
dsc *dsc_user = EVL_expr(tdbb, node->nod_arg[e_exec_stmt_user]);
|
||||
dsc *dsc_pwd = EVL_expr(tdbb, node->nod_arg[e_exec_stmt_password]);
|
||||
|
||||
Firebird::MemoryPool *pool = tdbb->getDefaultPool();
|
||||
|
||||
MoveBuffer buffer;
|
||||
UCHAR *p = 0;
|
||||
SSHORT len = 0;
|
||||
if (dsc_sql) {
|
||||
len = MOV_make_string2(tdbb, dsc_sql, dsc_sql->getTextType(), &p, buffer);
|
||||
}
|
||||
Firebird::string sSql((char*) p, len);
|
||||
sSql.trim();
|
||||
|
||||
// sDataSrc : registered data source name
|
||||
// or connection string : provider::database
|
||||
p = 0; len = 0; buffer.clear();
|
||||
if (dsc_dataSrc) {
|
||||
len = MOV_make_string2(tdbb, dsc_dataSrc, dsc_dataSrc->getTextType(), &p, buffer);
|
||||
}
|
||||
Firebird::string sDataSrc((char*) p, len);
|
||||
sDataSrc.trim();
|
||||
|
||||
p = 0; len = 0; buffer.clear();
|
||||
if (dsc_user) {
|
||||
len = MOV_make_string2(tdbb, dsc_user, dsc_user->getTextType(), &p, buffer);
|
||||
}
|
||||
Firebird::string sUser((char*) p, len);
|
||||
|
||||
if (!dsc_user || dsc_user->dsc_flags & DSC_null) {
|
||||
sUser = tdbb->tdbb_attachment->att_user->usr_user_name;
|
||||
}
|
||||
sUser.trim();
|
||||
|
||||
p = 0; len = 0; buffer.clear();
|
||||
if (dsc_pwd) {
|
||||
len = MOV_make_string2(tdbb, dsc_pwd, dsc_pwd->getTextType(), &p, buffer);
|
||||
}
|
||||
Firebird::string sPwd((char*) p, len);
|
||||
sPwd.trim();
|
||||
|
||||
Firebird::string sPrvName, sDBName;
|
||||
|
||||
if (sDataSrc.isEmpty()) {
|
||||
sPrvName = NATIVE_PROVIDER_NAME;
|
||||
}
|
||||
else
|
||||
{
|
||||
size_t pos = sDataSrc.find("::");
|
||||
if (pos != Firebird::string::npos)
|
||||
{
|
||||
sPrvName = sDataSrc.substr(0, pos);
|
||||
sDBName = sDataSrc.substr(pos + 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
sPrvName = NATIVE_PROVIDER_NAME;
|
||||
sDBName = sDataSrc;
|
||||
}
|
||||
// hvlad, todo: get user\password from data source reg info
|
||||
}
|
||||
|
||||
fb_assert(*stmt_ptr == 0);
|
||||
|
||||
ExtProvider &provider = ExtProvManager::extProvManager().getProvider(sPrvName);
|
||||
ExtConnection &conn = provider.getConnection(tdbb, sDBName, sUser, sPwd, tra_scope);
|
||||
|
||||
*stmt_ptr = stmt = &conn.createStatement(sSql);
|
||||
|
||||
ExtTransaction &tran = ExtTransaction::getTransaction(tdbb,
|
||||
stmt->getConnection(), tra_scope);
|
||||
|
||||
// store pointer to the statement into impure area
|
||||
*stmt_ptr = stmt;
|
||||
|
||||
stmt->prepare(tdbb, tran, sSql);
|
||||
if (stmt->getSelectable())
|
||||
stmt->open(tdbb, tran, inputs, node_inputs, !node_proc_block);
|
||||
else
|
||||
stmt->execute(tdbb, tran, inputs, node_inputs, outputs, node_outputs);
|
||||
|
||||
request->req_operation = jrd_req::req_return;
|
||||
} // jrd_req::req_evaluate
|
||||
|
||||
if (request->req_operation == jrd_req::req_return ||
|
||||
request->req_operation == jrd_req::req_sync)
|
||||
{
|
||||
fb_assert(stmt);
|
||||
if (stmt->getSelectable())
|
||||
{
|
||||
if (stmt->fetch(tdbb, outputs, node_outputs))
|
||||
{
|
||||
request->req_operation = jrd_req::req_evaluate;
|
||||
return node_proc_block;
|
||||
}
|
||||
request->req_operation = jrd_req::req_return;
|
||||
}
|
||||
}
|
||||
|
||||
if (stmt)
|
||||
{
|
||||
*stmt_ptr = NULL;
|
||||
stmt->close(tdbb);
|
||||
}
|
||||
|
||||
return node->nod_parent;
|
||||
}
|
||||
|
||||
|
||||
static jrd_req* execute_triggers(thread_db* tdbb,
|
||||
trig_vec** triggers,
|
||||
Record* old_rec,
|
||||
@ -2708,10 +2570,6 @@ static jrd_nod* looper(thread_db* tdbb, jrd_req* request, jrd_nod* in_node)
|
||||
}
|
||||
break;
|
||||
|
||||
case nod_exec_stmt:
|
||||
node = execute_statement(tdbb, request, node);
|
||||
break;
|
||||
|
||||
case nod_post:
|
||||
{
|
||||
DeferredWork* work = DFW_post_work(transaction, dfw_post_event,
|
||||
|
@ -506,19 +506,6 @@ const int e_sysfun_function = 1;
|
||||
const int e_sysfun_count = 1;
|
||||
const int e_sysfun_length = 2;
|
||||
|
||||
// nod_exec_stmt
|
||||
const int e_exec_stmt_stmt_sql = 0;
|
||||
const int e_exec_stmt_data_src = 1;
|
||||
const int e_exec_stmt_user = 2;
|
||||
const int e_exec_stmt_password = 3;
|
||||
const int e_exec_stmt_proc_block = 4;
|
||||
const int e_exec_stmt_fixed_count = 5;
|
||||
|
||||
const int e_exec_stmt_extra_inputs = 0;
|
||||
const int e_exec_stmt_extra_outputs = 1;
|
||||
const int e_exec_stmt_extra_tran = 2;
|
||||
const int e_exec_stmt_extra_count = 3;
|
||||
|
||||
// Request resources
|
||||
|
||||
struct Resource
|
||||
|
@ -302,7 +302,6 @@ const int op_literals = 18;
|
||||
const int op_relation = 20;
|
||||
const int op_exec_into = 21;
|
||||
const int op_cursor_stmt = 22;
|
||||
const int op_exec_into2 = 23;
|
||||
|
||||
static const UCHAR
|
||||
/* generic print formats */
|
||||
@ -359,8 +358,7 @@ static const UCHAR
|
||||
cursor_stmt[] = { op_cursor_stmt, 0 },
|
||||
strlength[] = { op_byte, op_line, op_verb, 0},
|
||||
trim[] = { op_byte, op_byte, op_line, op_verb, 0},
|
||||
modify2[] = { op_byte, op_byte, op_line, op_verb, op_verb, 0},
|
||||
exec_into2[] = { op_word, op_word, op_line, /*op_indent, */op_exec_into2, 0};
|
||||
modify2[] = { op_byte, op_byte, op_line, op_verb, op_verb, 0};
|
||||
|
||||
#include "../jrd/blp.h"
|
||||
|
||||
@ -3422,22 +3420,6 @@ static void blr_print_verb(gds_ctl* control, SSHORT level)
|
||||
break;
|
||||
}
|
||||
|
||||
case op_exec_into2: {
|
||||
blr_print_verb(control, level); // query expression
|
||||
blr_print_verb(control, level); // external data source
|
||||
blr_print_verb(control, level); // user
|
||||
blr_print_verb(control, level); // password
|
||||
blr_print_word(control); // transaction behavior
|
||||
|
||||
if (! blr_print_byte(control)) {
|
||||
blr_print_verb(control, level);
|
||||
}
|
||||
while (n-- > 0) {
|
||||
blr_print_verb(control, level);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case op_cursor_stmt: {
|
||||
blr_operator = blr_print_byte(control);
|
||||
blr_print_word(control);
|
||||
|
@ -373,7 +373,6 @@ enum info_db_provider
|
||||
#define isc_info_sql_records 23
|
||||
#define isc_info_sql_batch_fetch 24
|
||||
#define isc_info_sql_relation_alias 25
|
||||
#define isc_info_sql_stmt_selectable 26
|
||||
|
||||
/*********************************/
|
||||
/* SQL information return values */
|
||||
|
@ -131,7 +131,6 @@
|
||||
#include "../common/classes/fb_tls.h"
|
||||
#include "../common/classes/ClumpletReader.h"
|
||||
#include "../jrd/DebugInterface.h"
|
||||
#include "../jrd/ExtDS.h"
|
||||
|
||||
using namespace Jrd;
|
||||
|
||||
@ -571,82 +570,8 @@ bool invalid_client_SQL_dialect = false;
|
||||
#define GDS_TRANSACT_REQUEST jrd8_transact_request
|
||||
#define GDS_TRANSACTION_INFO jrd8_transaction_info
|
||||
#define GDS_UNWIND jrd8_unwind_request
|
||||
#define GDS_SET_PUBLIC_HANDLE jrd8_set_public_handle
|
||||
#define GDS_GET_PUBLIC_HANDLE jrd8_get_public_handle
|
||||
|
||||
|
||||
ISC_STATUS GDS_SET_PUBLIC_HANDLE(ISC_STATUS *user_status, UCHAR h_type,
|
||||
FB_API_HANDLE handle, FB_API_HANDLE public_handle)
|
||||
{
|
||||
api_entry_point_init(user_status);
|
||||
|
||||
thread_db thd_context;
|
||||
thread_db* tdbb = JRD_MAIN_set_thread_data(thd_context);
|
||||
tdbb->tdbb_status_vector = user_status;
|
||||
|
||||
switch (h_type)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Jrd::Attachment* attachment = (Jrd::Attachment*) handle;
|
||||
if (check_database(tdbb, attachment, user_status))
|
||||
return user_status[1];
|
||||
|
||||
attachment->att_public_handle = public_handle;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
Jrd::jrd_tra* transaction = (Jrd::jrd_tra*) handle;
|
||||
if (check_transaction(tdbb, transaction, user_status))
|
||||
return user_status[1];
|
||||
|
||||
transaction->tra_public_handle = public_handle;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return handle_error(user_status, isc_bad_db_handle, tdbb);
|
||||
}
|
||||
return return_success(tdbb);
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS GDS_GET_PUBLIC_HANDLE(ISC_STATUS *user_status, UCHAR h_type,
|
||||
FB_API_HANDLE *public_handle)
|
||||
{
|
||||
api_entry_point_init(user_status);
|
||||
thread_db* tdbb = JRD_get_thread_data();
|
||||
|
||||
switch (h_type)
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
Jrd::Attachment* attachment = tdbb->tdbb_attachment;
|
||||
if (!public_handle || !attachment || !attachment->att_public_handle)
|
||||
return handle_error(user_status, isc_bad_db_handle, 0);
|
||||
|
||||
*public_handle = attachment->att_public_handle;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
{
|
||||
Jrd::jrd_tra* transaction = tdbb->tdbb_transaction;
|
||||
if (!public_handle || !transaction || !transaction->tra_public_handle)
|
||||
return handle_error(user_status, isc_bad_trans_handle, 0);
|
||||
|
||||
*public_handle = transaction->tra_public_handle;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return handle_error(user_status, isc_bad_db_handle, 0);
|
||||
}
|
||||
return user_status[1];
|
||||
}
|
||||
|
||||
// External hook definitions
|
||||
|
||||
/* dimitr: just uncomment the following line to use this feature.
|
||||
@ -7005,9 +6930,7 @@ void JRD_shutdown_all(bool asyncMode)
|
||||
if (!initialized)
|
||||
{
|
||||
// see comments in shutdown_all
|
||||
#ifndef EMBEDDED
|
||||
THREAD_ENTER();
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
@ -7219,11 +7142,6 @@ static void purge_attachment(thread_db* tdbb,
|
||||
const ULONG att_flags = attachment->att_flags;
|
||||
attachment->att_flags |= ATT_shutdown;
|
||||
|
||||
ExtProvider &native =
|
||||
ExtProvManager::extProvManager().getProvider(NATIVE_PROVIDER_NAME);
|
||||
native.attachmentReleased(tdbb, attachment);
|
||||
|
||||
|
||||
if (!(dbb->dbb_flags & DBB_bugcheck))
|
||||
{
|
||||
// Check for any pending transactions
|
||||
|
@ -588,7 +588,6 @@ public:
|
||||
Firebird::GenericMap<Firebird::Pair<Firebird::Left<
|
||||
Firebird::string, DSqlCacheItem> > > att_dsql_cache; // DSQL cache locks
|
||||
#endif
|
||||
FB_API_HANDLE att_public_handle;
|
||||
|
||||
bool locksmith() const;
|
||||
};
|
||||
|
@ -143,8 +143,6 @@ ISC_STATUS jrd8_transact_request(ISC_STATUS*, Jrd::Attachment**,
|
||||
USHORT, SCHAR*, USHORT,
|
||||
SCHAR*);
|
||||
ISC_STATUS jrd8_unwind_request(ISC_STATUS *, Jrd::jrd_req**, SSHORT);
|
||||
ISC_STATUS jrd8_set_public_handle(ISC_STATUS *, UCHAR, FB_API_HANDLE, FB_API_HANDLE);
|
||||
ISC_STATUS jrd8_get_public_handle(ISC_STATUS *, UCHAR, FB_API_HANDLE*);
|
||||
|
||||
} // extern "C"
|
||||
|
||||
|
@ -184,7 +184,6 @@ NODE(nod_asn_list, asn_list, "")
|
||||
|
||||
/* EXECUTE VARCHAR INTO ...*/
|
||||
NODE(nod_exec_into, exec_sql_into, "EXECUTE VARCHAR INTO")
|
||||
NODE(nod_exec_stmt, exec_stmt, "EXECUTE STATEMENT REM")
|
||||
|
||||
NODE(nod_dcl_cursor, declare_cursor, "DECLARE CURSOR")
|
||||
NODE(nod_cursor_stmt, cursor_stmt, "CURSOR STATEMENT")
|
||||
|
@ -2741,36 +2741,6 @@ static jrd_nod* parse(thread_db* tdbb, CompilerScratch* csb, USHORT expected,
|
||||
*arg++ = parse(tdbb, csb, VALUE);
|
||||
break;
|
||||
|
||||
case blr_exec_stmt:
|
||||
{
|
||||
const USHORT inputs = BLR_WORD;
|
||||
const USHORT outputs = BLR_WORD;
|
||||
n = inputs + outputs + e_exec_stmt_fixed_count;
|
||||
|
||||
node = PAR_make_node(tdbb, n + e_exec_stmt_extra_count);
|
||||
node->nod_count = n;
|
||||
arg = node->nod_arg;
|
||||
*arg++ = parse(tdbb, csb, VALUE); // e_exec_stmt_stmt_sql
|
||||
*arg++ = parse(tdbb, csb, VALUE); // e_exec_stmt_data_src
|
||||
*arg++ = parse(tdbb, csb, VALUE); // e_exec_stmt_user
|
||||
*arg++ = parse(tdbb, csb, VALUE); // e_exec_stmt_password
|
||||
const USHORT tra_mode = BLR_WORD; // e_exec_stmt_tran
|
||||
|
||||
if (BLR_BYTE) // singleton flag
|
||||
*arg++ = 0; // e_exec_stmt_proc_block
|
||||
else
|
||||
*arg++ = parse(tdbb, csb, STATEMENT); // e_exec_stmt_proc_block
|
||||
|
||||
// input and output parameters
|
||||
for (n = e_exec_stmt_fixed_count; n < node->nod_count; n++)
|
||||
*arg++ = parse(tdbb, csb, VALUE);
|
||||
|
||||
*arg++ = (jrd_nod*) (IPTR) inputs; // e_exec_stmt_inputs
|
||||
*arg++ = (jrd_nod*) (IPTR) outputs; // e_exec_stmt_outputs
|
||||
*arg++ = (jrd_nod*) (IPTR) tra_mode; // e_exec_stmt_tran
|
||||
}
|
||||
break;
|
||||
|
||||
case blr_post_arg:
|
||||
*arg++ = parse(tdbb, csb, sub_type);
|
||||
*arg++ = parse(tdbb, csb, sub_type);
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "../jrd/btr.h"
|
||||
#include "../jrd/req.h"
|
||||
#include "../jrd/exe.h"
|
||||
#include "../jrd/ExtDS.h"
|
||||
#include "../jrd/rse.h"
|
||||
#include "../jrd/intl_classes.h"
|
||||
#include "../jrd/jrd_pwd.h"
|
||||
@ -415,8 +414,6 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
|
||||
**************************************/
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
ExtTransaction::endTransaction(tdbb, transaction, true, retaining_flag, false);
|
||||
|
||||
/* If this is a commit retaining, and no updates have been performed,
|
||||
and no events have been posted (via stored procedures etc)
|
||||
no-op the operation */
|
||||
@ -1179,8 +1176,6 @@ void TRA_rollback(thread_db* tdbb, jrd_tra* transaction, const bool retaining_fl
|
||||
**************************************/
|
||||
SET_TDBB(tdbb);
|
||||
|
||||
ExtTransaction::endTransaction(tdbb, transaction, false, retaining_flag, false);
|
||||
|
||||
Jrd::ContextPoolHolder context(tdbb, transaction->tra_pool);
|
||||
|
||||
/* Check in with external file system */
|
||||
|
@ -54,7 +54,6 @@ class Record;
|
||||
class VerbAction;
|
||||
class ArrayField;
|
||||
class Attachment;
|
||||
class ExtTransaction;
|
||||
|
||||
// Blobs active in transaction identified by bli_temp_id. Please keep this
|
||||
// structure small as there can be huge amount of them floating in memory.
|
||||
@ -131,11 +130,6 @@ class jrd_tra : public pool_alloc_rpt<SCHAR, type_tra>
|
||||
jrd_req* tra_requests; // Doubly linked list of requests active in this transaction
|
||||
DatabaseSnapshot* tra_db_snapshot; // Database state snapshot (for monitoring purposes)
|
||||
RuntimeStatistics tra_stats;
|
||||
|
||||
FB_API_HANDLE tra_public_handle;
|
||||
ExtTransaction *tra_ext_common;
|
||||
//ExtTransaction *tra_ext_two_phase;
|
||||
|
||||
UCHAR tra_transactions[1];
|
||||
|
||||
SSHORT getLockWait() const
|
||||
|
@ -109,8 +109,7 @@ using namespace YValve;
|
||||
// Taking into account that given y-valve lives it's last version,
|
||||
// in which dpb version is not likely to change, define it here.
|
||||
// #include "../jrd/ibase.h"
|
||||
//const UCHAR isc_dpb_version1 = 1;
|
||||
#include "consts_pub.h"
|
||||
const UCHAR isc_dpb_version1 = 1;
|
||||
|
||||
#ifdef HAVE_ERRNO_H
|
||||
#include <errno.h>
|
||||
@ -211,7 +210,7 @@ namespace YValve
|
||||
|
||||
BaseHandle::BaseHandle(UCHAR t, FB_API_HANDLE* pub, Attachment* par, USHORT imp)
|
||||
: type(t), flags(0), implementation(par ? par->implementation : imp),
|
||||
parent(par), user_handle(0), engine_handle(0)
|
||||
parent(par), user_handle(0)
|
||||
{
|
||||
fb_assert(par || (imp != USHORT(~0)));
|
||||
|
||||
@ -319,7 +318,6 @@ namespace YValve
|
||||
{
|
||||
toParent<Attachment>(attachments(), this);
|
||||
parent = this;
|
||||
engine_handle = h;
|
||||
}
|
||||
|
||||
Attachment::~Attachment()
|
||||
@ -768,8 +766,6 @@ namespace
|
||||
#define GDS_TRANSACT_REQUEST isc_transact_request
|
||||
#define GDS_TRANSACTION_INFO isc_transaction_info
|
||||
#define GDS_UNWIND isc_unwind_request
|
||||
#define GDS_SET_PUBLIC_HANDLE gds__set_public_handle
|
||||
#define GDS_GET_PUBLIC_HANDLE gds__get_public_handle
|
||||
|
||||
#define GDS_DSQL_ALLOCATE isc_dsql_allocate_statement
|
||||
#define GDS_DSQL_ALLOC isc_dsql_alloc_statement
|
||||
@ -871,10 +867,8 @@ const int PROC_CANCEL_OPERATION = 53;
|
||||
const int PROC_INTL_FUNCTION = 54; // internal call
|
||||
const int PROC_DSQL_CACHE = 55; // internal call
|
||||
const int PROC_INTERNAL_COMPILE = 56; // internal call
|
||||
const int PROC_SET_PUBLIC_HANDLE = 57; // internal call
|
||||
const int PROC_GET_PUBLIC_HANDLE = 58; // internal call
|
||||
|
||||
const int PROC_count = 59;
|
||||
const int PROC_count = 57;
|
||||
|
||||
struct ENTRY
|
||||
{
|
||||
@ -1088,14 +1082,6 @@ ISC_STATUS API_ROUTINE GDS_ATTACH_DATABASE(ISC_STATUS* user_status,
|
||||
{
|
||||
nullCheck(public_handle, isc_bad_db_handle);
|
||||
|
||||
const SCHAR dpb_internal[] = {isc_dpb_version1, isc_dpb_current_attachment};
|
||||
if (!file_length && !file_name && dpb_length == sizeof(dpb_internal) &&
|
||||
memcmp(dpb, dpb_internal, sizeof(dpb_internal)) == 0)
|
||||
{
|
||||
CALL(PROC_GET_PUBLIC_HANDLE, SUBSYSTEMS-1) (status, 1, public_handle);
|
||||
return status[1];
|
||||
}
|
||||
|
||||
if (!file_name)
|
||||
{
|
||||
Firebird::status_exception::raise(isc_bad_db_format,
|
||||
@ -1190,9 +1176,6 @@ ISC_STATUS API_ROUTINE GDS_ATTACH_DATABASE(ISC_STATUS* user_status,
|
||||
status[2] = isc_arg_end;
|
||||
}
|
||||
|
||||
ISC_STATUS_ARRAY temp_status = {0};
|
||||
GDS_SET_PUBLIC_HANDLE(temp_status, *public_handle);
|
||||
|
||||
return status[1];
|
||||
}
|
||||
if (ptr[1] != isc_unavailable)
|
||||
@ -4992,15 +4975,6 @@ ISC_STATUS API_ROUTINE GDS_START_MULTIPLE(ISC_STATUS * user_status,
|
||||
/* Do we need new error code here ? */ isc_arg_end);
|
||||
}
|
||||
|
||||
const UCHAR tpb_internal[] = {isc_tpb_version3, isc_tpb_current_transaction};
|
||||
if (count == 1 && vector->teb_tpb_length == sizeof(tpb_internal) &&
|
||||
memcmp(vector->teb_tpb, tpb_internal, sizeof(tpb_internal)) == 0)
|
||||
{
|
||||
dbb = translate<Attachment>(vector->teb_database);
|
||||
CALL(PROC_GET_PUBLIC_HANDLE, dbb->implementation) (status, 2, tra_handle);
|
||||
return status[1];
|
||||
}
|
||||
|
||||
Transaction** ptr;
|
||||
USHORT n;
|
||||
for (n = 0, ptr = &transaction; n < count;
|
||||
@ -5027,12 +5001,8 @@ ISC_STATUS API_ROUTINE GDS_START_MULTIPLE(ISC_STATUS * user_status,
|
||||
Transaction *sub = new Transaction(tra_handle, SUBSYSTEMS);
|
||||
sub->next = transaction;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
*tra_handle = transaction->public_handle;
|
||||
|
||||
ISC_STATUS_ARRAY temp_status = {0};
|
||||
GDS_SET_PUBLIC_HANDLE(temp_status, *tra_handle);
|
||||
}
|
||||
}
|
||||
catch (const Firebird::Exception& e)
|
||||
@ -5289,25 +5259,6 @@ ISC_STATUS API_ROUTINE GDS_UNWIND(ISC_STATUS * user_status,
|
||||
return status[1];
|
||||
}
|
||||
|
||||
|
||||
ISC_STATUS API_ROUTINE GDS_SET_PUBLIC_HANDLE(ISC_STATUS *user_status, FB_API_HANDLE public_handle)
|
||||
{
|
||||
try
|
||||
{
|
||||
BaseHandle *y_handle = BaseHandle::translate(public_handle);
|
||||
|
||||
CALL(PROC_SET_PUBLIC_HANDLE, y_handle->implementation)
|
||||
(user_status, y_handle->type, y_handle->engine_handle, y_handle->public_handle);
|
||||
}
|
||||
catch (const Firebird::Exception& e)
|
||||
{
|
||||
e.stuff_exception(user_status);
|
||||
}
|
||||
|
||||
return user_status[1];
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_GDS_ALLOC
|
||||
static SCHAR *alloc_debug(SLONG length, const char* file, int line)
|
||||
#else
|
||||
|
@ -282,8 +282,6 @@ ISC_STATUS API_ROUTINE gds__internal_compile_request(
|
||||
ISC_STATUS*, FB_API_HANDLE*, FB_API_HANDLE*, USHORT,
|
||||
const SCHAR*, USHORT, const char*, USHORT, const UCHAR*);
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__set_public_handle(ISC_STATUS *user_status, FB_API_HANDLE public_handle);
|
||||
|
||||
ISC_STATUS API_ROUTINE gds__transaction_cleanup(ISC_STATUS*, FB_API_HANDLE*,
|
||||
TransactionCleanupRoutine*, void*);
|
||||
void WHY_cleanup_transaction(struct why_hndl* transaction);
|
||||
|
@ -137,7 +137,6 @@ namespace YValve
|
||||
FB_API_HANDLE public_handle;
|
||||
Attachment* parent;
|
||||
FB_API_HANDLE* user_handle;
|
||||
FB_API_HANDLE engine_handle;
|
||||
|
||||
protected:
|
||||
BaseHandle(UCHAR t, FB_API_HANDLE* pub, Attachment* par, USHORT imp = ~0);
|
||||
@ -247,7 +246,6 @@ namespace YValve
|
||||
next(0), handle(h)
|
||||
{
|
||||
toParent<Transaction>(parent->transactions, this);
|
||||
engine_handle = h;
|
||||
}
|
||||
|
||||
Transaction(FB_API_HANDLE* pub, USHORT a_implementation)
|
||||
|
@ -95,7 +95,6 @@ static const VERB verbs[] =
|
||||
PAIR(nod_post, blr_post_arg, 2, 2, STATEMENT, VALUE),
|
||||
PAIR(nod_exec_sql, blr_exec_sql, 1, 1, STATEMENT, VALUE),
|
||||
PAIR(nod_exec_into, blr_exec_into, 0, 0, STATEMENT, OTHER),
|
||||
PAIR(nod_exec_stmt, blr_exec_stmt, 0, 0, STATEMENT, OTHER),
|
||||
PAIR(nod_internal_info, blr_internal_info, 1, 1, VALUE, VALUE),
|
||||
PAIR2(nod_add, blr_add, 2, 2, VALUE, VALUE),
|
||||
PAIR(nod_agg_count, blr_agg_count, 1, 0, VALUE, VALUE),
|
||||
|
@ -301,10 +301,9 @@ static void copy_p_cnct_repeat_array( p_cnct::p_cnct_repeat* pDest,
|
||||
static void inet_copy(const void*, UCHAR*, int);
|
||||
static int inet_destroy(XDR *);
|
||||
static void inet_gen_error(rem_port*, ISC_STATUS, ...);
|
||||
#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
static bool_t inet_getbytes(XDR *, SCHAR *, u_int);
|
||||
//#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
static bool_t inet_getbytes_as_client(XDR *, SCHAR *, u_int);
|
||||
//#endif
|
||||
#endif
|
||||
static bool_t inet_getlong(XDR *, SLONG *);
|
||||
static u_int inet_getpostn(XDR *);
|
||||
#if !(defined WIN_NT)
|
||||
@ -358,11 +357,11 @@ static XDR::xdr_ops inet_ops =
|
||||
{
|
||||
inet_getlong,
|
||||
inet_putlong,
|
||||
//#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
inet_getbytes,
|
||||
//#else
|
||||
// REMOTE_getbytes,
|
||||
//#endif
|
||||
#else
|
||||
REMOTE_getbytes,
|
||||
#endif
|
||||
inet_putbytes,
|
||||
inet_getpostn,
|
||||
inet_setpostn,
|
||||
@ -657,9 +656,6 @@ rem_port* INET_connect(const TEXT* name,
|
||||
#endif
|
||||
|
||||
rem_port* port = alloc_port(0);
|
||||
if (packet) { // client connection
|
||||
port->port_flags |= PORT_client;
|
||||
}
|
||||
port->port_status_vector = status_vector;
|
||||
REMOTE_get_timeout_params(port, dpb, dpb_length);
|
||||
status_vector[0] = isc_arg_gds;
|
||||
@ -2901,8 +2897,8 @@ static void inet_gen_error( rem_port* port, ISC_STATUS status, ...)
|
||||
}
|
||||
}
|
||||
|
||||
//#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
static bool_t inet_getbytes_as_client( XDR * xdrs, SCHAR * buff, u_int count)
|
||||
#if !defined(SUPERSERVER) || defined(EMBEDDED)
|
||||
static bool_t inet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
|
||||
{
|
||||
/**************************************
|
||||
*
|
||||
@ -2961,22 +2957,7 @@ static bool_t inet_getbytes_as_client( XDR * xdrs, SCHAR * buff, u_int count)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
//#endif
|
||||
|
||||
|
||||
static bool_t inet_getbytes( XDR * xdrs, SCHAR * buff, u_int count)
|
||||
{
|
||||
#ifdef SUPERSERVER
|
||||
rem_port* port = (rem_port*) xdrs->x_public;
|
||||
if (port->port_flags & PORT_client)
|
||||
return inet_getbytes_as_client(xdrs, buff, count);
|
||||
else
|
||||
return REMOTE_getbytes(xdrs, buff, count);
|
||||
#else
|
||||
return inet_getbytes_as_client(xdrs, buff, count);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static bool_t inet_getlong( XDR * xdrs, SLONG * lp)
|
||||
{
|
||||
|
@ -887,12 +887,6 @@ bool_t REMOTE_getbytes (XDR * xdrs, SCHAR * buff, u_int count)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
bool_t REMOTE_getbytes (XDR * xdrs, SCHAR * buff, u_int count)
|
||||
{
|
||||
fb_assert(false);
|
||||
return 0;
|
||||
}
|
||||
#endif //SUPERSERVER
|
||||
|
||||
#ifdef TRUSTED_AUTH
|
||||
|
@ -304,7 +304,7 @@ const USHORT RSR_no_batch = 8; /* Do not batch fetch rows */
|
||||
const USHORT RSR_stream_err = 16; /* There is an error pending in the batched rows */
|
||||
const USHORT RSR_lazy = 32; /* To be allocated at the first reference */
|
||||
const USHORT RSR_defer_execute = 64; // op_execute can be deferred
|
||||
const USHORT RSR_past_eof = 128; // EOF was returned by fetch from this statement
|
||||
const USHORT RSR_past_eof = 128; // EOF was returned by fetch from this statement
|
||||
|
||||
// will be methods of remote statement class
|
||||
inline void stmt_save_exception(RSR statement, const ISC_STATUS* status, bool overwrite)
|
||||
@ -636,7 +636,6 @@ const USHORT PORT_dummy_pckt_set= 1024; /* A dummy packet interval is set */
|
||||
const USHORT PORT_partial_data = 2048; /* Physical packet doesn't contain all API packet */
|
||||
const USHORT PORT_lazy = 4096; /* Deferred operations are allowed */
|
||||
const USHORT PORT_busy = 8192; // disable receive - port is busy now
|
||||
const USHORT PORT_client = 16384;
|
||||
|
||||
|
||||
/* Misc declarations */
|
||||
|
Loading…
Reference in New Issue
Block a user