File tree 4 files changed +22
-0
lines changed
jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/create
4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public class CreateView implements Statement {
26
26
private ExpressionList <Column > columnNames = null ;
27
27
private boolean materialized = false ;
28
28
private ForceOption force = ForceOption .NONE ;
29
+ private boolean secure = false ;
29
30
private TemporaryOption temp = TemporaryOption .NONE ;
30
31
private AutoRefreshOption autoRefresh = AutoRefreshOption .NONE ;
31
32
private boolean withReadOnly = false ;
@@ -88,6 +89,14 @@ public void setForce(ForceOption force) {
88
89
this .force = force ;
89
90
}
90
91
92
+ public boolean isSecure () {
93
+ return secure ;
94
+ }
95
+
96
+ public void setSecure (boolean secure ) {
97
+ this .secure = secure ;
98
+ }
99
+
91
100
public TemporaryOption getTemporary () {
92
101
return temp ;
93
102
}
@@ -127,6 +136,9 @@ public String toString() {
127
136
sql .append ("OR REPLACE " );
128
137
}
129
138
appendForceOptionIfApplicable (sql );
139
+ if (secure ) {
140
+ sql .append ("SECURE " );
141
+ }
130
142
131
143
if (temp != TemporaryOption .NONE ) {
132
144
sql .append (temp .name ()).append (" " );
Original file line number Diff line number Diff line change @@ -53,6 +53,9 @@ public void deParse(CreateView createView) {
53
53
default :
54
54
// nothing
55
55
}
56
+ if (createView .isSecure ()) {
57
+ buffer .append ("SECURE " );
58
+ }
56
59
if (createView .getTemporary () != TemporaryOption .NONE ) {
57
60
buffer .append (createView .getTemporary ().name ()).append (" " );
58
61
}
Original file line number Diff line number Diff line change @@ -391,6 +391,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
391
391
| <K_SAMPLE: "SAMPLE">
392
392
| <K_SAVEPOINT: "SAVEPOINT">
393
393
| <K_SCHEMA: "SCHEMA">
394
+ | <K_SECURE: "SECURE">
394
395
| <K_SEED: "SEED">
395
396
| <K_SELECT: ("SELECT" | "SEL")>
396
397
| <K_SEMI : "SEMI">
@@ -5812,6 +5813,7 @@ CreateView CreateView(boolean isUsingOrReplace):
5812
5813
<K_NO> <K_FORCE> { createView.setForce(ForceOption.NO_FORCE); }
5813
5814
| <K_FORCE> { createView.setForce(ForceOption.FORCE); }
5814
5815
]
5816
+ [ <K_SECURE> { createView.setSecure(true);} ]
5815
5817
[
5816
5818
<K_TEMP> { createView.setTemporary(TemporaryOption.TEMP); }
5817
5819
| <K_TEMPORARY> { createView.setTemporary(TemporaryOption.TEMPORARY); }
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ public void testCreateForceView3() throws JSQLParserException {
119
119
"CREATE OR REPLACE NO FORCE VIEW view1 AS SELECT a, b FROM testtab" );
120
120
}
121
121
122
+ @ Test
123
+ public void testCreateSecureView () throws JSQLParserException {
124
+ assertSqlCanBeParsedAndDeparsed ("CREATE SECURE VIEW myview AS SELECT * FROM mytable" );
125
+ }
126
+
122
127
@ Test
123
128
public void testCreateVolatileView () throws JSQLParserException {
124
129
assertSqlCanBeParsedAndDeparsed ("CREATE VOLATILE VIEW myview AS SELECT * FROM mytable" );
You can’t perform that action at this time.
0 commit comments