Skip to content

Commit

Permalink
Fix oracle show systemVariable syntax loose issue (#31365)
Browse files Browse the repository at this point in the history
* fix oracle show systemVariable syntax loose issue

* fix sql parser error

* fix sql parser error
  • Loading branch information
yydeng626 authored May 28, 2024
1 parent 6f1de3f commit 0674b5a
Show file tree
Hide file tree
Showing 3 changed files with 531 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,8 @@ unreservedWord3
| WIDTH_BUCKET | WRAPPED | XID | XMLAGG | XMLATTRIBUTES | XMLCAST | XMLCDATA | XMLCOLATTVAL | XMLCOMMENT | XMLCONCAT | XMLDIFF
| XMLEXISTS | XMLEXISTS2 | XMLFOREST | XMLINDEX_REWRITE | XMLINDEX_REWRITE_IN_SELECT | XMLINDEX_SEL_IDX_TBL | XMLISNODE
| XMLISVALID | XMLNAMESPACES | XMLPARSE | XMLPATCH | XMLPI | XMLQUERY | XMLROOT | XMLSERIALIZE | XMLTABLE | XMLTOOBJECT
| XMLTRANSFORM | XMLTRANSFORMBLOB | XML_DML_RWT_STMT | XPATHTABLE | XS_SYS_CONTEXT | X_DYN_PRUNE | RESULT | TABLE | NUMBER | CHAR | SQLCODE
| XMLTRANSFORM | XMLTRANSFORMBLOB | XML_DML_RWT_STMT | XPATHTABLE | XS_SYS_CONTEXT | X_DYN_PRUNE | RESULT | TABLE | NUMBER | CHAR
| SQLCODE | TAB | TERM | NUM
;

schemaName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,82 @@ originalName
;

systemVariable
: identifier
: (APPI | APPINFO)
| (ARRAY | ARRAYSIZE)
| (AUTO | AUTOCOMMIT)
| (AUTOP | AUTOPN)
| AUTORECOVERY
| (AUTOT | AUTOTRACE)
| (BLO | BLOCKTERMINATOR)
| (CMDS | CMDSEP)
| (COLINVI | COLINVISIBLE)
| COLSEP
| (CON | CONCAT)
| (COPYC | COPYCOMMIT)
| COPYTYPECHECK
| (DEF | DEFINE)
| DESCRIBE
| ECHO
| (EDITF | EDITFILE)
| (EMB | EMBEDDED)
| ERRORDETAILS
| (ERRORL | ERRORLOGGING)
| (ESC | ESCAPE)
| ESCCHAR
| (EXITCOMMIT | OMMIT)
| FEEDBACK
| FLAGGER
| (FLU | FLUSH)
| (HEADING | HEA)
| (HISTORY | HIST)
| INSTANCE
| JSONPRINT
| (LINESIZE | LIN)
| (LOBOFFSET | LOBOF)
| LOGSOURCE
| LONG
| LONGCHUNKSIZE
| (MARK | MARKUP)
| (NEWPAGE | NEWP)
| NULL
| (NUMFORMAT | NUMF)
| (NUMWIDTH | NUM)
| (PAGESIZE | PAGES)
| (PAUSE | PAU)
| RECSEP
| RECSEPCHAR
| ROWLIMIT
| ROWPREFETCH
| SECUREDCOL
| (SERVEROUTPUT | SERVEROUT)
| (SHIFTINOUT | SHIFT)
| (SHOWMODE | SHOW)
| (SQLBLANKLINES | SQLBL)
| (SQLCASE | SQLC)
| (SQLCONTINUE | SQLCO)
| (SQLNUMBER | SQLN)
| (SQLPLUSCOMPATIBILITY | SQLPLUSCOMPAT)
| (SQLPREFIX | SQLPRE)
| (SQLPROMPT | SQLP)
| (SQLTERMINATOR | SQLT)
| (STATEMENTCACHE | STATEMENTC)
| (SUFFIX | SUF)
| TAB
| (TERMOUT | TERM)
| (TIME | TI)
| (TIMING | TIMI)
| (TRIMOUT | TRIM)
| (TRIMSPOOL | TRIMS)
| (UNDERLINE | UND)
| (VERIFY | VER)
| (WRAP | WRA)
| (XMLOPTIMIZATIONCHECK | XMLOPT)
| XQUERY
;

showOptions
// TODO refactor systemVariable sytax according to https://docs.oracle.com/en/database/oracle/oracle-database/23/sqpug/SET-system-variable-summary.html#GUID-A6A5ADFF-4119-4BA4-A13E-BC8D29166FAE
// : systemVariable
: ALL
: systemVariable
| ALL
| CON_ID
| CON_NAME
| EDITION
Expand Down
Loading

0 comments on commit 0674b5a

Please sign in to comment.