本文整理汇总了C++中ExprNode::castToStmtDDLNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ExprNode::castToStmtDDLNode方法的具体用法?C++ ExprNode::castToStmtDDLNode怎么用?C++ ExprNode::castToStmtDDLNode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExprNode
的用法示例。
在下文中一共展示了ExprNode::castToStmtDDLNode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ns
//.........这里部分代码省略.........
sqlTextLen_ = 0;
if (recompControlInfo)
restoreRecompControlInfo(recompControlInfo);
return CmpStatement_SUCCESS;
}
ReturnStatus status = CmpStatement_SUCCESS;
if (statement.getCmpCompileInfo()->isHbaseDDL())
{
CmpMain::ReturnStatus rs = CmpMain::SUCCESS;
QueryText qText(sqlStr, inputCS);
CmpMessageReplyCode
*bound = new(outHeap_) CmpMessageReplyCode(outHeap_, statement.id(), 0, 0, outHeap_);
// CmpMain cmpmain;
Set_SqlParser_Flags(DELAYED_RESET); // sqlcompCleanup resets for us
Parser parser(CmpCommon::context());
BindWA bindWA(ActiveSchemaDB(), CmpCommon::context(), TRUE);
// save parser flags
Int32 savedParserFlags = Get_SqlParser_Flags (0xFFFFFFFF);
ExprNode * exprNode = NULL;
if (parser.parseDML(qText, &exprNode, NULL))
{
error(arkcmpErrorNoDiags, statement.data());
sqlTextStr_=NULL;
return CmpStatement_ERROR;
}
RelExpr * rRoot = NULL;
if (exprNode->getOperatorType() EQU STM_QUERY)
{
rRoot = (RelRoot*)exprNode->getChild(0);
}
else if (exprNode->getOperatorType() EQU REL_ROOT)
{
rRoot = (RelRoot*)exprNode;
}
CMPASSERT(rRoot);
ExprNode *boundDDL = rRoot->bindNode(&bindWA);
CMPASSERT(boundDDL);
if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_))
{
return CmpStatement_ERROR;
}
ExprNode * ddlNode = NULL;
DDLExpr * ddlExpr = NULL;
ddlExpr = (DDLExpr*)rRoot->getChild(0);
ddlNode = ddlExpr->getDDLNode();
if (ddlNode)
{
boundDDL = ddlNode->castToStmtDDLNode()->bindNode(&bindWA);
CMPASSERT(boundDDL);
if (CmpCommon::diags()->getNumber(DgSqlCode::ERROR_))
{
return CmpStatement_ERROR;
}
ddlNode = boundDDL;
}
// reset saved flags
Set_SqlParser_Flags (savedParserFlags);
CmpSeabaseDDL cmpSBD(heap_);
if (cmpSBD.executeSeabaseDDL(ddlExpr, ddlNode,
currCatName, currSchName))
{
Set_SqlParser_Flags(0);
return CmpStatement_ERROR;
}
Set_SqlParser_Flags (0);
// TEMPTEMP.
// Until support for metadata invalidation is in, clear up query cache for
// this process. That way statements issued later from this session will
// not see stale definitions.
// This also helps in running tests where tables are modified and accessed from
// the same session.
// This does not solve the issue of stale definition seen by other processes,
// that will be fixed once we have metadata invalidation.
CURRENTQCACHE->makeEmpty();
return CmpStatement_SUCCESS;
} // hbaseDDL
// This is a normal DDL request, call Catalog manager
*diags() << DgSqlCode(-4222)
<< DgString0("SQL Compiler DDL");
return CmpStatement_ERROR;
}