Skip to content

Commit 33384b2

Browse files
committed
Fix "Packaged temporary tables. Only INSERT is allowed for them in the package body units" reported by Pavel Zotov
1 parent eead264 commit 33384b2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/dsql/StmtNodes.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2641,12 +2641,13 @@ StmtNode* EraseNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
26412641
{
26422642
auto relation = dsqlRelation;
26432643

2644-
dsqlScratch->qualifyExistingName(relation->dsqlName, obj_relation);
2645-
26462644
const auto node = FB_NEW_POOL(dsqlScratch->getPool()) EraseNode(dsqlScratch->getPool());
26472645
node->dsqlCursorName = dsqlCursorName;
26482646
node->dsqlSkipLocked = dsqlSkipLocked;
26492647

2648+
if (dsqlCursorName.hasData())
2649+
dsqlScratch->qualifyExistingName(relation->dsqlName, obj_relation);
2650+
26502651
if (dsqlCursorName.hasData() && dsqlScratch->isPsql())
26512652
{
26522653
node->dsqlContext = dsqlPassCursorContext(dsqlScratch, dsqlCursorName, relation);
@@ -8136,7 +8137,9 @@ StmtNode* ModifyNode::internalDsqlPass(DsqlCompilerScratch* dsqlScratch, bool up
81368137

81378138
NestConst<RelationSourceNode> relation = nodeAs<RelationSourceNode>(dsqlRelation);
81388139
fb_assert(relation);
8139-
dsqlScratch->qualifyExistingName(relation->dsqlName, obj_relation);
8140+
8141+
if (dsqlCursorName.hasData())
8142+
dsqlScratch->qualifyExistingName(relation->dsqlName, obj_relation);
81408143

81418144
NestConst<ValueExprNode>* ptr;
81428145

@@ -10971,8 +10974,6 @@ StmtNode* UpdateOrInsertNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
1097110974
{
1097210975
auto& pool = dsqlScratch->getPool();
1097310976

10974-
dsqlScratch->qualifyExistingName(relation->dsqlName, obj_relation);
10975-
1097610977
if (!dsqlScratch->isPsql())
1097710978
dsqlScratch->flags |= DsqlCompilerScratch::FLAG_UPDATE_OR_INSERT;
1097810979

@@ -10986,7 +10987,6 @@ StmtNode* UpdateOrInsertNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
1098610987
node->returning = returning;
1098710988

1098810989
const auto& relationName = relation->dsqlName;
10989-
auto baseName = relationName;
1099010990
bool needSavePoint;
1099110991

1099210992
// Build the INSERT node.
@@ -11002,6 +11002,7 @@ StmtNode* UpdateOrInsertNode::dsqlPass(DsqlCompilerScratch* dsqlScratch)
1100211002
DEV_BLKCHK(context, dsql_type_ctx);
1100311003

1100411004
const auto ctxRelation = context->ctx_relation;
11005+
auto baseName = relationName;
1100511006
auto fieldsCopy = fields;
1100611007

1100711008
// If a field list isn't present, build one using the same rules of INSERT INTO table VALUES ...

0 commit comments

Comments
 (0)