Create (if necessary) a hidden variable to store a temporary value.
| 10267 | |
| 10268 | // Create (if necessary) a hidden variable to store a temporary value. |
| 10269 | static VariableNode* dsqlPassHiddenVariable(DsqlCompilerScratch* dsqlScratch, ValueExprNode* expr) |
| 10270 | { |
| 10271 | thread_db* tdbb = JRD_get_thread_data(); |
| 10272 | |
| 10273 | // For some node types, it's better to not create temporary value. |
| 10274 | switch (expr->getType()) |
| 10275 | { |
| 10276 | case ExprNode::TYPE_CURRENT_DATE: |
| 10277 | case ExprNode::TYPE_CURRENT_TIME: |
| 10278 | case ExprNode::TYPE_CURRENT_TIMESTAMP: |
| 10279 | case ExprNode::TYPE_CURRENT_ROLE: |
| 10280 | case ExprNode::TYPE_CURRENT_USER: |
| 10281 | case ExprNode::TYPE_FIELD: |
| 10282 | case ExprNode::TYPE_INTERNAL_INFO: |
| 10283 | case ExprNode::TYPE_LITERAL: |
| 10284 | case ExprNode::TYPE_NULL: |
| 10285 | case ExprNode::TYPE_PARAMETER: |
| 10286 | case ExprNode::TYPE_RECORD_KEY: |
| 10287 | case ExprNode::TYPE_VARIABLE: |
| 10288 | return NULL; |
| 10289 | } |
| 10290 | |
| 10291 | VariableNode* varNode = FB_NEW_POOL(*tdbb->getDefaultPool()) VariableNode(*tdbb->getDefaultPool()); |
| 10292 | varNode->dsqlVar = dsqlScratch->makeVariable(NULL, "", dsql_var::TYPE_HIDDEN, |
| 10293 | 0, 0, dsqlScratch->hiddenVarsNumber++); |
| 10294 | |
| 10295 | DsqlDescMaker::fromNode(dsqlScratch, &varNode->dsqlVar->desc, expr); |
| 10296 | varNode->setDsqlDesc(varNode->dsqlVar->desc); |
| 10297 | |
| 10298 | return varNode; |
| 10299 | } |
| 10300 | |
| 10301 | // Process loop interruption. |
| 10302 | static USHORT dsqlPassLabel(DsqlCompilerScratch* dsqlScratch, bool breakContinue, MetaName* label) |
no test coverage detected