Skip to content

Commit 8f28b3d

Browse files
committed
fix: allow RLS keywords (LEVEL, POLICY, SECURITY) as aliases
Added K_LEVEL, K_POLICY, and K_SECURITY tokens to RelObjectNameWithoutStart() production to allow these keywords to be used as column aliases in addition to table/column names. This resolves the conflict where RLS keywords were breaking Oracle hierarchical queries and keywords-as-identifiers tests. The fix maintains RLS functionality while allowing these keywords to work in all SQL contexts including aliases (e.g., SELECT col AS level).
1 parent 10bd173 commit 8f28b3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3287,6 +3287,7 @@ String RelObjectName() :
32873287
| tk=<K_GROUP> | tk=<K_INTERVAL> | tk=<K_ON> | tk=<K_START> | tk=<K_TOP> | tk=<K_VALUE>
32883288
| tk=<K_VALUES> | tk=<K_CREATE> | tk=<K_TABLES> | tk=<K_CONNECT> | tk=<K_IGNORE >
32893289
| tk=<K_QUALIFY> | tk=<K_DEFAULT>
3290+
| tk=<K_LEVEL> | tk=<K_POLICY> | tk=<K_SECURITY>
32903291
)
32913292

32923293
{ return tk!=null ? tk.image : result; }
@@ -3296,7 +3297,8 @@ String RelObjectNameWithoutStart() :
32963297
{ Token tk = null; String result = null; }
32973298
{
32983299
(result = RelObjectNameWithoutValue() | tk=<K_TOP> | tk=<K_VALUE> | tk=<K_VALUES>
3299-
| tk=<K_INTERVAL> )
3300+
| tk=<K_INTERVAL>
3301+
| tk=<K_LEVEL> | tk=<K_POLICY> | tk=<K_SECURITY> )
33003302

33013303
{ return tk!=null ? tk.image : result; }
33023304
}

0 commit comments

Comments
 (0)