8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 21:23:04 +01:00
This commit is contained in:
robocop 2010-09-23 09:53:50 +00:00
parent bca99bc9f0
commit 25b691353e
4 changed files with 16 additions and 14 deletions

View File

@ -45,7 +45,7 @@ typedef Firebird::Array<NestConst<jrd_nod> > LegacyNodeArray;
class SortNode : public Firebird::PermanentStorage
{
public:
SortNode(MemoryPool& pool)
explicit SortNode(MemoryPool& pool)
: PermanentStorage(pool),
unique(false),
expressions(pool),
@ -69,7 +69,7 @@ public:
class MapNode : public Firebird::PermanentStorage
{
public:
MapNode(MemoryPool& pool)
explicit MapNode(MemoryPool& pool)
: PermanentStorage(pool),
items(pool)
{
@ -93,7 +93,7 @@ public:
struct AccessItem
{
AccessItem(MemoryPool& pool)
explicit AccessItem(MemoryPool& pool)
: relationId(0),
indexId(0),
indexName(pool)
@ -162,7 +162,7 @@ public:
{
}
InversionNode(IndexRetrieval* aRetrieval)
explicit InversionNode(IndexRetrieval* aRetrieval)
: type(TYPE_INDEX),
impure(0),
retrieval(aRetrieval),
@ -224,7 +224,7 @@ public:
stream = value;
}
// Identify the streams that make up a RseNode.
// Identify the streams that make up an RseNode.
virtual void getStreams(StreamsArray& list) const
{
list.add(getStream());

View File

@ -1214,9 +1214,9 @@ static dsc* eval_statistical(thread_db* tdbb, const jrd_nod* node, impure_value*
continue;
}
// Note: if the field being SUMed or AVERAGEd is short or long,
// impure will stay long, and the first add will
// impure will stay long, and the first add() will
// set the correct scale; if it is approximate numeric,
// the first add will convert impure to double.
// the first add() will convert impure to double.
ArithmeticNode::add(desc, impure, node, blr_add);
count++;
@ -1244,9 +1244,9 @@ static dsc* eval_statistical(thread_db* tdbb, const jrd_nod* node, impure_value*
if (request->req_flags & req_null)
continue;
// Note: if the field being SUMed or AVERAGEd is exact
// numeric, impure will stay int64, and the first add will
// numeric, impure will stay int64, and the first add() will
// set the correct scale; if it is approximate numeric,
// the first add will convert impure to double.
// the first add() will convert impure to double.
ArithmeticNode::add(desc, impure, node, blr_add);
count++;
}

View File

@ -3379,7 +3379,7 @@ static const jrd_nod* store(thread_db* tdbb, const jrd_nod* node, SSHORT which_t
node->nod_arg[e_sto_relation]->nod_arg[0]);
fb_assert(recSource->type == RelationSourceNode::TYPE);
SSHORT stream = recSource->getStream();
const SSHORT stream = recSource->getStream();
record_param* rpb = &request->req_rpb[stream];
jrd_rel* relation = rpb->rpb_relation;

View File

@ -3711,13 +3711,15 @@ static void set_direction(SortNode* fromClause, SortNode* toClause)
* for the nulls placement flag.
*
**************************************/
fb_assert(fromClause->expressions.getCount() <= toClause->expressions.getCount());
fb_assert(fromClause->expressions.getCount() == fromClause->descending.getCount() &&
fromClause->expressions.getCount() == fromClause->nullOrder.getCount());
const size_t fromCount = fromClause->expressions.getCount();
fb_assert(fromCount <= toClause->expressions.getCount());
fb_assert(fromCount == fromClause->descending.getCount() &&
fromCount == fromClause->nullOrder.getCount());
fb_assert(toClause->expressions.getCount() == toClause->descending.getCount() &&
toClause->expressions.getCount() == toClause->nullOrder.getCount());
for (size_t i = 0; i < fromClause->expressions.getCount(); ++i)
for (size_t i = 0; i < fromCount; ++i)
{
toClause->descending[i] = fromClause->descending[i];
toClause->nullOrder[i] = fromClause->nullOrder[i];