diff --git a/doc/sql.extensions/README.regr_functions.txt b/doc/sql.extensions/README.regr_functions.txt index 94ee227c11..e85bf7811f 100644 --- a/doc/sql.extensions/README.regr_functions.txt +++ b/doc/sql.extensions/README.regr_functions.txt @@ -2,7 +2,7 @@ Linear Regression Functions --------------------------- -REGR_* functions analyze relationshitp of the 2 numeric set of data. +REGR_* functions analyze relationship of the 2 numeric set of data. These functions calculate with records that both of 2 set are not NULL. Syntax: diff --git a/src/dsql/AggNodes.cpp b/src/dsql/AggNodes.cpp index 18ed042289..7df7981fb2 100644 --- a/src/dsql/AggNodes.cpp +++ b/src/dsql/AggNodes.cpp @@ -2237,16 +2237,15 @@ void RegrCountAggNode::aggInit(thread_db* tdbb, jrd_req* request) const bool RegrCountAggNode::aggPass(thread_db* tdbb, jrd_req* request) const { + EVL_expr(tdbb, request, arg); + if (request->req_flags & req_null) + return false; + + EVL_expr(tdbb, request, arg2); + if (request->req_flags & req_null) + return false; + impure_value_ex* impure = request->getImpure(impureOffset); - - dsc* desc = EVL_expr(tdbb, request, arg); - if (request->req_flags & req_null) - return false; - - dsc* desc2 = EVL_expr(tdbb, request, arg2); - if (request->req_flags & req_null) - return false; - ++impure->vlu_misc.vlu_int64; return true; diff --git a/src/dsql/StmtNodes.cpp b/src/dsql/StmtNodes.cpp index 80aba70926..8580cd0050 100644 --- a/src/dsql/StmtNodes.cpp +++ b/src/dsql/StmtNodes.cpp @@ -2007,7 +2007,6 @@ DeclareSubProcNode* DeclareSubProcNode::dsqlPass(DsqlCompilerScratch* dsqlScratc for (NestConst* i = paramArray.begin(); i != paramArray.end(); ++i) { ParameterClause* param = *i; - const unsigned paramIndex = i - paramArray.begin(); SignatureParameter sigParam(pool); sigParam.type = 1; // output diff --git a/src/dsql/WinNodes.cpp b/src/dsql/WinNodes.cpp index 9551f58f0c..5caaca0190 100644 --- a/src/dsql/WinNodes.cpp +++ b/src/dsql/WinNodes.cpp @@ -256,7 +256,6 @@ dsc* PercentRankWinNode::aggExecute(thread_db* /*tdbb*/, jrd_req* request) const dsc* PercentRankWinNode::winPass(thread_db* /*tdbb*/, jrd_req* request, SlidingWindow* window) const { - impure_value_ex* impure = request->getImpure(impureOffset); impure_value_ex* impureTemp = request->getImpure(tempImpure); double partitionSize = window->getPartitionSize(); @@ -433,8 +432,6 @@ void FirstValueWinNode::aggInit(thread_db* tdbb, jrd_req* request) const dsc* FirstValueWinNode::winPass(thread_db* tdbb, jrd_req* request, SlidingWindow* window) const { - impure_value_ex* impure = request->getImpure(impureOffset); - if (!window->moveWithinFrame(-(window->getRecordPosition() - window->getFrameStart()))) return NULL; @@ -496,8 +493,6 @@ void LastValueWinNode::aggInit(thread_db* tdbb, jrd_req* request) const dsc* LastValueWinNode::winPass(thread_db* tdbb, jrd_req* request, SlidingWindow* window) const { - impure_value_ex* impure = request->getImpure(impureOffset); - if (!window->moveWithinFrame(window->getFrameEnd() - window->getRecordPosition())) return NULL; @@ -573,8 +568,6 @@ void NthValueWinNode::aggInit(thread_db* tdbb, jrd_req* request) const dsc* NthValueWinNode::winPass(thread_db* tdbb, jrd_req* request, SlidingWindow* window) const { - impure_value_ex* impure = request->getImpure(impureOffset); - dsc* desc = EVL_expr(tdbb, request, row); if (!desc || (request->req_flags & req_null)) return NULL; diff --git a/src/gpre/boot/gpre_meta_boot.cpp b/src/gpre/boot/gpre_meta_boot.cpp index a153cc6d74..67f13f4011 100644 --- a/src/gpre/boot/gpre_meta_boot.cpp +++ b/src/gpre/boot/gpre_meta_boot.cpp @@ -41,13 +41,6 @@ #include "../gpre/par_proto.h" #include "../yvalve/gds_proto.h" -static const UCHAR blr_bpb[] = -{ - isc_bpb_version1, - isc_bpb_source_type, 1, isc_blob_blr, - isc_bpb_target_type, 1, isc_blob_blr -}; - /*____________________________________________________________ * * Lookup a field by name in a context. diff --git a/src/intl/charsets/cs_koi8r.h b/src/intl/charsets/cs_koi8r.h index 21d928a174..0c9d1e68bd 100644 --- a/src/intl/charsets/cs_koi8r.h +++ b/src/intl/charsets/cs_koi8r.h @@ -263,7 +263,6 @@ -------------------------------------------- */ -static const int UNICODE_REPLACEMENT_CHARACTER = 0xFFFD; static const int CANT_MAP_CHARACTER = 0; static const USHORT to_unicode_map[256] = { diff --git a/src/jrd/exe.cpp b/src/jrd/exe.cpp index 2722c25b32..3ab19c6d2a 100644 --- a/src/jrd/exe.cpp +++ b/src/jrd/exe.cpp @@ -670,8 +670,6 @@ void EXE_receive(thread_db* tdbb, } } - const auto statement = request->getStatement(); - try { if (nodeIs(request->req_message)) @@ -818,7 +816,6 @@ void EXE_send(thread_db* tdbb, jrd_req* request, USHORT msg, ULONG length, const node = request->req_message; jrd_tra* transaction = request->req_transaction; - const JrdStatement* statement = request->getStatement(); const SelectNode* selectNode; @@ -881,7 +878,6 @@ void EXE_start(thread_db* tdbb, jrd_req* request, jrd_tra* transaction) ERR_post(Arg::Gds(isc_req_no_trans)); JrdStatement* statement = request->getStatement(); - const jrd_prc* proc = statement->procedure; /* Post resources to transaction block. In particular, the interest locks on relations/indices are copied to the transaction, which is very @@ -1348,8 +1344,6 @@ const StmtNode* EXE_looper(thread_db* tdbb, jrd_req* request, const StmtNode* no // Execute stuff until we drop - const JrdStatement* statement = request->getStatement(); - while (node && !(request->req_flags & req_stall)) { try diff --git a/src/jrd/extds/InternalDS.cpp b/src/jrd/extds/InternalDS.cpp index 65bea36491..2f92d71725 100644 --- a/src/jrd/extds/InternalDS.cpp +++ b/src/jrd/extds/InternalDS.cpp @@ -73,7 +73,6 @@ void InternalProvider::jrdAttachmentEnd(thread_db* tdbb, Attachment* att, bool f return; { // scope - Database* dbb = tdbb->getDatabase(); MutexLockGuard guard(m_mutex, FB_FUNCTION); AttToConnMap::Accessor acc(&m_connections); diff --git a/src/jrd/ini.epp b/src/jrd/ini.epp index 126c6d830f..2054ad85f5 100644 --- a/src/jrd/ini.epp +++ b/src/jrd/ini.epp @@ -1435,7 +1435,6 @@ static void store_global_field(thread_db* tdbb, const gfld* gfield, AutoRequest& * **************************************/ SET_TDBB(tdbb); - Database* dbb = tdbb->getDatabase(); Jrd::Attachment* attachment = tdbb->getAttachment(); STORE(REQUEST_HANDLE handle) X IN RDB$FIELDS diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index a58ef1a743..943232e654 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -1517,9 +1517,6 @@ void JRD_transliterate(thread_db* tdbb, Firebird::IStatus* vector) throw() const ULONG SWEEP_INTERVAL = 20000; -const char DBL_QUOTE = '\042'; -const char SINGLE_QUOTE = '\''; - static void trace_warning(thread_db* tdbb, FbStatusVector* userStatus, const char* func) { @@ -7460,7 +7457,6 @@ static void init_database_lock(thread_db* tdbb) **************************************/ SET_TDBB(tdbb); Database* const dbb = tdbb->getDatabase(); - Jrd::Attachment* const attachment = tdbb->getAttachment(); // Main database lock @@ -8039,7 +8035,6 @@ static void purge_transactions(thread_db* tdbb, Jrd::Attachment* attachment, con * from an attachment * **************************************/ - Database* const dbb = attachment->att_database; jrd_tra* const trans_dbk = attachment->att_dbkey_trans; if (force_flag) diff --git a/src/jrd/opt.cpp b/src/jrd/opt.cpp index 72acb6439d..7199c7b03f 100644 --- a/src/jrd/opt.cpp +++ b/src/jrd/opt.cpp @@ -363,11 +363,11 @@ static void sort_indices_by_selectivity(CompilerScratch::csb_repeat* csbTail); // macro definitions #ifdef OPT_DEBUG -const int DEBUG_PUNT = 5; -const int DEBUG_RELATIONSHIPS = 4; -const int DEBUG_ALL = 3; -const int DEBUG_CANDIDATE = 2; -const int DEBUG_BEST = 1; +//const int DEBUG_PUNT = 5; +//const int DEBUG_RELATIONSHIPS = 4; +//const int DEBUG_ALL = 3; +//const int DEBUG_CANDIDATE = 2; +//const int DEBUG_BEST = 1; const int DEBUG_NONE = 0; FILE *opt_debug_file = 0; diff --git a/src/jrd/recsrc/RecordSource.cpp b/src/jrd/recsrc/RecordSource.cpp index 484d9bc897..a9740f3f0f 100644 --- a/src/jrd/recsrc/RecordSource.cpp +++ b/src/jrd/recsrc/RecordSource.cpp @@ -119,7 +119,6 @@ void RecordSource::printInversion(thread_db* tdbb, const InversionNode* inversio case InversionNode::TYPE_INDEX: { const IndexRetrieval* const retrieval = inversion->retrieval; - const jrd_rel* const relation = retrieval->irb_relation; MetaName indexName; if (retrieval->irb_name && retrieval->irb_name->hasData()) diff --git a/src/jrd/vio.cpp b/src/jrd/vio.cpp index 4bab00dc26..98ea16e6d0 100644 --- a/src/jrd/vio.cpp +++ b/src/jrd/vio.cpp @@ -1462,7 +1462,7 @@ static bool check_prepare_result(int prepare_result, jrd_tra* transaction, jrd_r ************************************** * * Functional description - * Called by VIO_modify and VIO_erase. Raise update conflict error if not in + * Called by VIO_modify and VIO_erase. Raise update conflict error if not in * read consistency transaction or lock error happens or if request is already * in update conflict mode. In latter case set TRA_ex_restart flag to correctly * handle request restart. @@ -1473,17 +1473,17 @@ static bool check_prepare_result(int prepare_result, jrd_tra* transaction, jrd_r jrd_req* top_request = request->req_snapshot.m_owner; - const bool restart_ready = top_request && + const bool restart_ready = top_request && (top_request->req_flags & req_restart_ready); // Second update conflict when request is already in update conflict mode - // means we have some (indirect) UPDATE\DELETE in WHERE clause of primary + // means we have some (indirect) UPDATE\DELETE in WHERE clause of primary // cursor. In this case all we can do is restart whole request immediately. - const bool secondary = top_request && - (top_request->req_flags & req_update_conflict) && + const bool secondary = top_request && + (top_request->req_flags & req_update_conflict) && (prepare_result != PREPARE_LOCKERR); - if (!(transaction->tra_flags & TRA_read_consistency) || prepare_result == PREPARE_LOCKERR || + if (!(transaction->tra_flags & TRA_read_consistency) || prepare_result == PREPARE_LOCKERR || secondary || !restart_ready) { if (secondary) @@ -1898,7 +1898,7 @@ bool VIO_erase(thread_db* tdbb, record_param* rpb, jrd_tra* transaction) verb_post(tdbb, transaction, rpb, rpb->rpb_undo); // We have INSERT + DELETE or UPDATE + DELETE in the same transaction. - // UPDATE has already notified GC, while INSERT has not. Check for + // UPDATE has already notified GC, while INSERT has not. Check for // backversion allows to avoid second notification in case of UPDATE. if ((dbb->dbb_flags & DBB_gc_background) && !rpb->rpb_relation->isTemporary() && !backVersion) @@ -3219,7 +3219,7 @@ bool VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb, j const bool backVersion = (org_rpb->rpb_b_page != 0); record_param temp; PageStack stack; - int prepare_result = prepare_update(tdbb, transaction, org_rpb->rpb_transaction_nr, org_rpb, + int prepare_result = prepare_update(tdbb, transaction, org_rpb->rpb_transaction_nr, org_rpb, &temp, new_rpb, stack, false); if (!check_prepare_result(prepare_result, transaction, tdbb->getRequest(), org_rpb)) return false; @@ -5533,7 +5533,6 @@ static int prepare_update( thread_db* tdbb, **************************************/ SET_TDBB(tdbb); - Attachment* const attachment = tdbb->getAttachment(); jrd_rel* const relation = rpb->rpb_relation; #ifdef VIO_DEBUG