@@ -95,7 +95,7 @@ static void checkFkPairTypes(const rel_t masterType, const QualifiedName& master
9595 const rel_t childType, const QualifiedName& childName);
9696static void modifyLocalFieldPosition(thread_db* tdbb, jrd_tra* transaction,
9797 const QualifiedName& relationName, const MetaName& fieldName, USHORT newPosition);
98- static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType);
98+ static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType) noexcept ;
9999static void saveField(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, const MetaName& fieldName);
100100static void saveRelation(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch,
101101 const QualifiedName& relationName, bool view, bool creating);
@@ -110,7 +110,7 @@ static void updateRdbFields(const TypeClause* type,
110110 SSHORT& collationIdNull, SSHORT& collationId,
111111 SSHORT& segmentLengthNull, SSHORT& segmentLength);
112112
113- static const char* const CHECK_CONSTRAINT_EXCEPTION = "check_constraint";
113+ static constexpr const char* CHECK_CONSTRAINT_EXCEPTION = "check_constraint";
114114
115115DATABASE DB = STATIC "ODS.RDB";
116116
@@ -310,7 +310,7 @@ static void checkViewDependency(thread_db* tdbb, jrd_tra* transaction,
310310 X.RDB$RELATION_NAME EQ Z.RDB$RELATION_NAME AND
311311 Y.RDB$VIEW_CONTEXT EQ Z.RDB$VIEW_CONTEXT
312312 {
313- QualifiedName viewName(Z.RDB$VIEW_NAME, Z.RDB$SCHEMA_NAME);
313+ const QualifiedName viewName(Z.RDB$VIEW_NAME, Z.RDB$SCHEMA_NAME);
314314
315315 // msg 206: Column %s from table %s is referenced in %s.
316316 status_exception::raise(
@@ -711,7 +711,7 @@ static void modifyLocalFieldPosition(thread_db* tdbb, jrd_tra* transaction,
711711 }
712712
713713 // Find the position of the last field in the relation.
714- SLONG maxPosition = SLONG(newPos) - 1;
714+ const SLONG maxPosition = SLONG(newPos) - 1;
715715
716716 // If the existing position of the field is less than the new position of
717717 // the field, subtract 1 to move the fields to their new positions otherwise,
@@ -759,7 +759,7 @@ static void modifyLocalFieldPosition(thread_db* tdbb, jrd_tra* transaction,
759759}
760760
761761// Convert RDB$RELATION_TYPE to rel_t type.
762- static rel_t relationType(SSHORT relationTypeNull, SSHORT relationType)
762+ static inline rel_t relationType(SSHORT relationTypeNull, SSHORT relationType) noexcept
763763{
764764 return relationTypeNull ? rel_persistent : rel_t(relationType);
765765}
@@ -5097,7 +5097,7 @@ void AlterDomainNode::checkUpdate(const dyn_fld& origFld, const dyn_fld& newFld)
50975097//
50985098// This function returns an error code if the conversion can not be made. If the conversion can be
50995099// made, FB_SUCCESS is returned.
5100- ULONG AlterDomainNode::checkUpdateNumericType(const dyn_fld& origFld, const dyn_fld& newFld)
5100+ ULONG AlterDomainNode::checkUpdateNumericType(const dyn_fld& origFld, const dyn_fld& newFld) noexcept
51015101{
51025102 // Since dsc_scale is negative, the sum of precision and scale produces
51035103 // the width of the integral part.
@@ -6896,7 +6896,8 @@ void RelationNode::makeConstraint(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
68966896
68976897 if (clause->constraintType == AddConstraintClause::CTYPE_NOT_NULL)
68986898 break;
6899- // AddConstraintClause::CTYPE_PK falls into
6899+
6900+ [[fallthrough]];
69006901
69016902 case AddConstraintClause::CTYPE_UNIQUE:
69026903 {
@@ -6992,7 +6993,7 @@ void RelationNode::makeConstraint(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
69926993
69936994 default:
69946995 fb_assert(0);
6995- // fall into
6996+ [[fallthrough]];
69966997
69976998 case RefActionClause::ACTION_NONE:
69986999 constraint.create->refUpdateAction = RI_ACTION_NONE;
@@ -7021,7 +7022,7 @@ void RelationNode::makeConstraint(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
70217022
70227023 default:
70237024 fb_assert(0);
7024- // fall into
7025+ [[fallthrough]];
70257026
70267027 case RefActionClause::ACTION_NONE:
70277028 constraint.create->refDeleteAction = RI_ACTION_NONE;
@@ -7883,7 +7884,7 @@ void CreateRelationNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScrat
78837884 }
78847885 END_STORE
78857886
7886- bool replicationEnabled;
7887+ bool replicationEnabled = false ;
78877888
78887889 if (replicationState.isAssigned())
78897890 replicationEnabled = replicationState.asBool();
@@ -8490,7 +8491,7 @@ void AlterRelationNode::modifyField(thread_db* tdbb, DsqlCompilerScratch* dsqlSc
84908491 {
84918492 found = true;
84928493
8493- bool isView = !REL.RDB$VIEW_BLR.NULL;
8494+ const bool isView = !REL.RDB$VIEW_BLR.NULL;
84948495
84958496 if (!isView && (!FLD.RDB$COMPUTED_BLR.NULL != (clause->computed != NULL)))
84968497 {
@@ -9440,7 +9441,7 @@ void CreateAlterViewNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
94409441
94419442 SCL_check_schema(tdbb, PREL.RDB$SCHEMA_NAME, SCL_usage);
94429443
9443- if (auto priv = SCL_get_mask(tdbb, QualifiedName(PREL.RDB$RELATION_NAME, PREL.RDB$SCHEMA_NAME), "");
9444+ if (const auto priv = SCL_get_mask(tdbb, QualifiedName(PREL.RDB$RELATION_NAME, PREL.RDB$SCHEMA_NAME), "");
94449445 !(priv & SCL_select)
94459446 )
94469447 {
@@ -9641,7 +9642,7 @@ void CreateAlterViewNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
96419642 FLD.RDB$SCHEMA_NAME EQ RFL.RDB$FIELD_SOURCE_SCHEMA_NAME AND
96429643 FLD.RDB$FIELD_NAME EQ RFL.RDB$FIELD_SOURCE
96439644 {
9644- bool wasInternalDomain = fb_utils::implicit_domain(FLD.RDB$FIELD_NAME);
9645+ const bool wasInternalDomain = fb_utils::implicit_domain(FLD.RDB$FIELD_NAME);
96459646 fb_assert(wasInternalDomain);
96469647
96479648 if (wasInternalDomain)
@@ -9704,7 +9705,7 @@ void CreateAlterViewNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScra
97049705 FLD.RDB$SCHEMA_NAME EQ RFL.RDB$FIELD_SOURCE_SCHEMA_NAME AND
97059706 FLD.RDB$FIELD_NAME EQ RFL.RDB$FIELD_SOURCE
97069707 {
9707- bool wasInternalDomain = fb_utils::implicit_domain(FLD.RDB$FIELD_NAME);
9708+ const bool wasInternalDomain = fb_utils::implicit_domain(FLD.RDB$FIELD_NAME);
97089709 fb_assert(wasInternalDomain);
97099710
97109711 if (wasInternalDomain)
@@ -9920,7 +9921,6 @@ void CreateAlterViewNode::createCheckTrigger(thread_db* tdbb, DsqlCompilerScratc
99209921 const NestConst<ValueExprNode>* const end = fieldsNode->items.end();
99219922 NestConst<ValueExprNode>* ptr2 = valuesNode->items.begin();
99229923 const NestConst<ValueExprNode>* const end2 = valuesNode->items.end();
9923- int andArg = 0;
99249924
99259925 BinaryBoolNode* andNode = FB_NEW_POOL(pool) BinaryBoolNode(pool, blr_and);
99269926
@@ -11447,13 +11447,11 @@ void MappingNode::execute(thread_db* tdbb, DsqlCompilerScratch* dsqlScratch, jrd
1144711447
1144811448 fb_assert(op == MAP_DROP || op == MAP_COMMENT || fromType);
1144911449
11450- short plugNull = plugin ? FALSE : TRUE;
11451- short dbNull = db ? FALSE : TRUE;
11452- short fromNull = from ? FALSE : TRUE;
11450+ const short plugNull = plugin ? FALSE : TRUE;
11451+ const short dbNull = db ? FALSE : TRUE;
11452+ const short fromNull = from ? FALSE : TRUE;
1145311453
11454- char usingText[2];
11455- usingText[0] = mode;
11456- usingText[1] = '\0';
11454+ const char usingText[2]{ mode, '\0' };
1145711455
1145811456 AutoCacheRequest request1(tdbb, drq_map_mod, DYN_REQUESTS);
1145911457 bool found = false;
@@ -12086,7 +12084,7 @@ void GrantRevokeNode::modifyPrivileges(thread_db* tdbb, jrd_tra* transaction, SS
1208612084 grantRevoke(tdbb, transaction, object, user, "A", NULL, option);
1208712085 else if (i->second)
1208812086 {
12089- char privs0[2] = {i->first, '\0'};
12087+ const char privs0[2] = {i->first, '\0'};
1209012088
1209112089 for (const auto& field : *i->second)
1209212090 grantRevoke(tdbb, transaction, object, user, privs0, field, option);
@@ -12282,7 +12280,7 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G
1228212280 }
1228312281
1228412282 crdb = true;
12285- size_t len = strlen(cPtr);
12283+ const size_t len = strlen(cPtr);
1228612284 memmove(cPtr, cPtr + 1, len);
1228712285 }
1228812286
@@ -12353,7 +12351,7 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G
1235312351
1235412352 case obj_privilege: // Should convert symbolic privilege name to bit number
1235512353 {
12356- USHORT p = convertPrivilegeFromString(tdbb, transaction, user.object);
12354+ const USHORT p = convertPrivilegeFromString(tdbb, transaction, user.object);
1235712355 user.object.printf("%d", p);
1235812356 }
1235912357 break;
@@ -12530,7 +12528,7 @@ void GrantRevokeNode::grantRevoke(thread_db* tdbb, jrd_tra* transaction, const G
1253012528
1253112529 if (crdb)
1253212530 {
12533- CreateDbJob job(userType, user.object);
12531+ const CreateDbJob job(userType, user.object);
1253412532 createDbJobs.push(job);
1253512533
1253612534 if (!privileges[0])
0 commit comments