Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/552#discussion_r67898558
--- Diff: core/sql/parser/StmtDDLCreate.cpp ---
@@ -5007,7 +5020,31 @@ StmtDDLCreateTable_visitTableDefElement(ElemDDLNode
* pCreateTableNode,
StmtDDLCreateTable * pCreateTable =
pCreateTableNode->castToStmtDDLCreateTable();
- if (pElement->castToElemDDLConstraint() NEQ NULL)
+ if (pElement->castToElemDDLLikeCreateTable() NEQ NULL)
+ {
+ pCreateTable->likeSourceTableCorrName_ =
+ pElement->castToElemDDLLikeCreateTable()
+ ->getDDLLikeNameAsCorrName();
+ pCreateTable->likeOptions_ =
+ pElement->castToElemDDLLikeCreateTable()
+ ->getLikeOptions();
+
+ if ((NOT pCreateTable->isExternal()) &&
+ (pElement->castToElemDDLLikeCreateTable()->forExtTable()))
+ {
+ *SqlParser_Diags << DgSqlCode(-3242)
+ << DgString0("'for' clause can only be
specified when creating an 'external' table.");
+ return;
+ }
+ else if ((pCreateTable->isExternal()) &&
+ (NOT
pElement->castToElemDDLLikeCreateTable()->forExtTable()))
+ {
+ *SqlParser_Diags << DgSqlCode(-3242)
+ << DgString0("'like' clause cannot be specified
when creating an external table.");
--- End diff --
Similar
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---