8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-02-02 10:00:38 +01:00
This commit is contained in:
Adriano dos Santos Fernandes 2018-01-01 12:38:34 -02:00
parent 04462b52db
commit bfcc37e7eb
19 changed files with 44 additions and 35 deletions

View File

@ -18,7 +18,7 @@ Deprecating UDF
fixed in FB 1.5. But even after it incorrectly declared (using SQL statement
DECLARE EXTERNAL FUNCTION) UDF can easily cause various security issues like
server crash or execution of arbitrary code. Therefore UDFs are deprecated
in v.4. That means that UDFs can't be used with default configuration
in v4. That means that UDFs can't be used with default configuration
(parameter "UdfAccess" set to "None") and all sample UDF libraries (ib_udf,
fbudf) are not distributed any more. Most of functions in that libraries
were replaced with builtin analogs in previous versions and therefore
@ -29,4 +29,3 @@ Deprecating UDF
path-list is just UDF and resulting line in firebird.conf should be:
UdfAccess = Restrict UDF
Recommended long-term solution is replacing of UDF with UDR.

View File

@ -717,6 +717,7 @@ SINT64 ClumpletReader::fromVaxInteger(const UCHAR* ptr, FB_SIZE_T length)
value += ((SINT64) *ptr++) << shift;
shift += 8;
}
value += ((SINT64)(SCHAR) *ptr) << shift;
return value;

View File

@ -243,12 +243,12 @@ public:
static void mark(T* const item)
{
*item = MarkValue::getMarkValue();
};
}
static bool isMarked(const T* const item)
{
return *item == MarkValue::getMarkValue();
};
}
};
template <typename T, typename Marker = DefaultMarker<T> >
@ -315,8 +315,6 @@ public:
if (!Marker::isMarked(m_curr))
m_last = m_curr;
return;
}
// Show if current position is valid
@ -328,7 +326,7 @@ public:
// Show if not processed items still exists
bool isEmpty() const
{
return (m_begin >= m_end);
return m_begin >= m_end;
}
private:

View File

@ -612,6 +612,7 @@ void DsqlCompilerScratch::checkUnusedCTEs()
{
bool sqlWarn = false;
FB_SIZE_T i;
for (i = 0; i < ctes.getCount(); ++i)
{
SelectExprNode* cte = ctes[i];
@ -623,6 +624,7 @@ void DsqlCompilerScratch::checkUnusedCTEs()
ERRD_post_warning(Arg::Warning(isc_sqlwarn) << Arg::Num(-104));
sqlWarn = true;
}
ERRD_post_warning(Arg::Warning(isc_dsql_cte_not_used) << cte->alias);
}
}

View File

@ -7722,6 +7722,7 @@ void DerivedFieldNode::setParameterName(dsql_par* parameter) const
const RecordKeyNode* dbKeyNode = NULL;
const DerivedFieldNode* drvField = nodeAs<DerivedFieldNode>(value);
while (drvField)
{
if (fieldNode = nodeAs<FieldNode>(drvField->value))
@ -7731,7 +7732,7 @@ void DerivedFieldNode::setParameterName(dsql_par* parameter) const
break;
drvField = nodeAs<DerivedFieldNode>(drvField->value);
};
}
if (fieldNode || (fieldNode = nodeAs<FieldNode>(value)))
{

View File

@ -340,6 +340,7 @@ FB_UDR_BEGIN_FUNCTION(UC_isLeapYear)
out->resultNull = true;
return;
}
const int ly = in->val.date.getYear(master->getUtilInterface());
out->result = ((ly % 4 == 0 && ly % 100 != 0) || ly % 400 == 0) ? FB_TRUE : FB_FALSE;
out->resultNull = false;

View File

@ -417,12 +417,14 @@ void JrdStatement::verifyAccess(thread_db* tdbb)
else if (item->exa_action == ExternalAccess::exa_function)
{
routine = Function::lookup(tdbb, item->exa_fun_id, false, false, 0);
if (!routine)
{
string name;
name.printf("id %d", item->exa_fun_id);
ERR_post(Arg::Gds(isc_funnotdef) << name);
}
aclType = id_function;
}
else

View File

@ -2254,7 +2254,6 @@ WindowSourceNode* WindowSourceNode::copy(thread_db* tdbb, NodeCopier& copier) co
copyWindow.map = inputWindow->map->copy(tdbb, copier);
copyWindow.exclusion = inputWindow->exclusion;
}
return newSource;

View File

@ -2676,6 +2676,7 @@ static void flushPages(thread_db* tdbb, USHORT flush_flag, BufferDesc** begin, F
iter.rewind();
}
fb_assert(count == written);
}

View File

@ -3559,6 +3559,7 @@ static bool create_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work, j
X.RDB$RELATION_NAME EQ work->dfw_name.c_str()
{
rel_id = X.RDB$RELATION_ID;
if ( (relation = MET_lookup_relation_id(tdbb, rel_id, false)) )
{
RelationPages* const relPages = relation->getBasePages();

View File

@ -370,6 +370,7 @@ void Connection::deleteTransaction(thread_db* tdbb, Transaction* tran)
// Close all active statements in tran context avoiding commit of already
// deleted transaction
Statement** stmt_ptr = m_statements.begin();
while (stmt_ptr < m_statements.end())
{
Statement* stmt = *stmt_ptr;
@ -378,6 +379,7 @@ void Connection::deleteTransaction(thread_db* tdbb, Transaction* tran)
if (stmt->isActive())
stmt->close(tdbb, true);
}
// close() above could destroy statement and remove it from m_statements
if (stmt_ptr < m_statements.end() && *stmt_ptr == stmt)
stmt_ptr++;

View File

@ -47,7 +47,7 @@ class Statement;
class Blob;
enum TraModes {traReadCommited, traReadCommitedRecVersions, traConcurrency, traConsistency};
enum TraScope {traNotSet = 0, traAutonomous = 1, traCommon, traTwoPhase};
enum TraScope {traNotSet = 0, traAutonomous, traCommon, traTwoPhase};
// Known built-in provider's names
extern const char* FIREBIRD_PROVIDER_NAME;

View File

@ -647,6 +647,7 @@ SINT64 API_ROUTINE isc_portable_integer(const UCHAR* ptr, SSHORT length)
value += ((SINT64) *ptr++) << shift;
shift += 8;
}
value += ((SINT64)(SCHAR) *ptr) << shift;
return value;
@ -2556,6 +2557,7 @@ SLONG API_ROUTINE gds__vax_integer(const UCHAR* ptr, SSHORT length)
value += ((SLONG) *ptr++) << shift;
shift += 8;
}
value += ((SLONG)(SCHAR) *ptr) << shift;
return value;