From 8dae5141685b3433b75942df6b6d25b9e5b98270 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Fri, 14 Jun 2019 13:26:42 +0200 Subject: [PATCH] [plsql] Fix object table substitution clause for CREATE TABLE --- pmd-plsql/etc/grammar/PldocAST.jjt | 3 +-- .../net/sourceforge/pmd/lang/plsql/ast/CreateTable.pls | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pmd-plsql/etc/grammar/PldocAST.jjt b/pmd-plsql/etc/grammar/PldocAST.jjt index 4818ff5a58..2838e36436 100644 --- a/pmd-plsql/etc/grammar/PldocAST.jjt +++ b/pmd-plsql/etc/grammar/PldocAST.jjt @@ -3648,7 +3648,7 @@ ASTTable Table() : ObjectNameDeclaration() [ "=" ( | | | ) ] //object_table - ( Datatype() [ [ ] KEYWORD("SUBSTITUTABLE") KEYWORD("LEVELS") ]| + ( Datatype() [ [ ] KEYWORD("LEVELS") ]| //relational_table [ "(" ( LOOKAHEAD(2) OutOfLineConstraint() | TableColumn() ) ("," ( LOOKAHEAD(2) OutOfLineConstraint() | TableColumn() ))* ")" ] [LOOKAHEAD(4) ( | ) ] @@ -5586,7 +5586,6 @@ ASTKEYWORD_UNRESERVED KEYWORD_UNRESERVED (): {} | //| | -//| | //| | diff --git a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CreateTable.pls b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CreateTable.pls index 0351df1eaa..a99a0651c5 100644 --- a/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CreateTable.pls +++ b/pmd-plsql/src/test/resources/net/sourceforge/pmd/lang/plsql/ast/CreateTable.pls @@ -74,6 +74,10 @@ CREATE TABLE later (col1 NUMBER, col2 VARCHAR2(20)) SEGMENT CREATION DEFERRED CREATE TABLE persons OF person_t; +CREATE TABLE persons OF person_t SUBSTITUTABLE AT ALL LEVELS; + +CREATE TABLE persons OF person_t NOT SUBSTITUTABLE AT ALL LEVELS; + CREATE TABLE books (title VARCHAR2(100), author person_t); CREATE TABLE dept_80