@@ -12321,6 +12321,23 @@ DmlNode* SysFuncCallNode::parse(thread_db* tdbb, MemoryPool& pool, CompilerScrat
12321
12321
12322
12322
node->args = PAR_args (tdbb, csb);
12323
12323
12324
+ if (name == " MAKE_DBKEY" )
12325
+ {
12326
+ // Special handling for system function MAKE_DBKEY:
12327
+ // convert constant relation name into ID at the parsing time
12328
+
12329
+ auto literal = nodeAs<LiteralNode>(node->args ->items [0 ]);
12330
+
12331
+ if (literal && literal->litDesc .isText ())
12332
+ {
12333
+ const MetaName relName = literal->getText ();
12334
+ const jrd_rel* const relation = MET_lookup_relation (tdbb, relName);
12335
+
12336
+ if (relation)
12337
+ node->args ->items [0 ] = MAKE_const_slong (relation->rel_id );
12338
+ }
12339
+ }
12340
+
12324
12341
return node;
12325
12342
}
12326
12343
@@ -12462,32 +12479,6 @@ ValueExprNode* SysFuncCallNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
12462
12479
12463
12480
if (node->function )
12464
12481
{
12465
- if (name == " MAKE_DBKEY" )
12466
- {
12467
- // Special handling for system function MAKE_DBKEY:
12468
- // convert constant relation name into ID at the parsing time
12469
-
12470
- auto literal = nodeAs<LiteralNode>(node->args ->items [0 ]);
12471
-
12472
- if (literal && literal->litDesc .isText ())
12473
- {
12474
- const MetaName relName = literal->getText ();
12475
-
12476
- const dsql_rel* const relation =
12477
- METD_get_relation (dsqlScratch->getTransaction (), dsqlScratch, relName);
12478
-
12479
- if (!relation)
12480
- {
12481
- status_exception::raise (
12482
- Arg::Gds (isc_sqlerr) << Arg::Num (-607 ) <<
12483
- Arg::Gds (isc_dsql_command_err) <<
12484
- Arg::Gds (isc_dsql_table_not_found) << relName);
12485
- }
12486
-
12487
- node->args ->items [0 ] = MAKE_const_slong (relation->rel_id );
12488
- }
12489
- }
12490
-
12491
12482
if (node->function ->setParamsFunc )
12492
12483
{
12493
12484
Array<dsc> tempDescs (node->args ->items .getCount ());
0 commit comments