Skip to content

Commit 9d0d06d

Browse files
authored
[PlSql] Multiple grammar improvements (#4640)
* [PlSql] Implement "drop materialized view log" syntax * [PlSql] Implement "drop materialized view log" syntax test * [PlSql] Improve "create sequence" * [PlSql] Make UNUSABLE optional in on_comp_partitioned_clause * [PlSql] Add shrink_clause as an option index partition modifications * [PlSql] Add compute/estimate clauses to analyze * [PlSql] Support parallel degree/instances sub-clauses * [PlSql] Permit table_properties in any order * [PlSql] Change relational_property precedence order * [PlSql] Use constraint_name for partition by reference identifier * [PlSql] Add internal/external to table_partition_description * [PlSql] Allow physical properties in any order * [PlSql] Allow in-memory clause on partition_storage_clause This change also adjusts the behavior of inmemory_attributes so that the SQL can supply these attributes in any order, as allowed by the engine. * [PlSql] Add external table compression options * [PlSql] Remove redundant physical_attributes_clause rule * [PlSql] Support custom log groups on specific columns * [PlSql] Add unique index supplemental logging In Oracle 10g, supplemental logging was improved for logical replication to include the "UNIQUE INDEX" clause to log columns that are not declared as unique constraints, used by Streams and GoldenGate replication. * [PlSql] Improve truncate_table grammar options * [PlSql] Improve drop_table grammar options * [PlSql] Support alter table modify subpartition * [PlSql] Extend logical_replication_clause for Oracle 23 * [PlSql] Allow unnamed varray storage * [PlSql] Permit quoted column types * [PlSql] Extend identity_options coverage * [PlSql] Improve virtual_column_definition rule * [PlSql] Support casting object types to relational tables * [PlSql] Support negative literal numeric values * [PlSql] Support character varying/sdo_geometry data types * [PlSql] Remove redundant regular_id E_LETTER rule * [PlSql] Add ENABLED regular_id keyword * [PlSql] Remove redundant regular_id ERROR_INDEX and ERROR_CODE rules * [PlSql] Allow columns named template_table and timezone * [PlSql] Improve object permissions * [PlSql] Support move partition/subpartition * [PlSql] Fix initial value for `_isVersion11` for Python3
1 parent ba24bdd commit 9d0d06d

21 files changed

+645
-59
lines changed

sql/plsql/Antlr4ng/PlSqlParserBase.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ import { Parser, TokenStream, CommonTokenStream, Recognizer } from 'antlr4ng';
33
export abstract class PlSqlParserBase extends Parser {
44

55
_isVersion10: boolean;
6+
_isVersion11: boolean;
67
_isVersion12: boolean;
78

89
constructor(input: TokenStream) {
910
super(input);
1011
this._isVersion10 = true;
12+
this._isVersion11 = true;
1113
this._isVersion12 = true;
1214
}
1315

1416
isVersion10(): boolean {
1517
return this._isVersion10;
1618
}
1719

20+
isVersion11(): boolean {
21+
return this._isVersion11;
22+
}
23+
1824
isVersion12(): boolean {
1925
return this._isVersion12;
2026
}
@@ -23,6 +29,10 @@ export abstract class PlSqlParserBase extends Parser {
2329
this._isVersion10 = value;
2430
}
2531

32+
setVersion11(value: boolean): void {
33+
this._isVersion11 = value;
34+
}
35+
2636
setVersion12(value: boolean): void {
2737
this._isVersion12 = value;
2838
}

sql/plsql/CSharp/PlSqlParserBase.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
public abstract class PlSqlParserBase : Parser
88
{
99
private bool _isVersion10 = false;
10+
private bool _isVersion11 = true;
1011
private bool _isVersion12 = true;
1112

1213
protected PlSqlParserBase(ITokenStream input)
@@ -20,9 +21,13 @@ public PlSqlParserBase(ITokenStream input, TextWriter output, TextWriter errorOu
2021

2122
public bool isVersion10() => _isVersion10;
2223

24+
public bool isVersion11() => _isVersion11;
25+
2326
public bool isVersion12() => _isVersion12;
2427

2528
public bool setVersion10(bool value) => _isVersion10 = value;
2629

30+
public bool setVersion11(bool value) => _isVersion11 = value;
31+
2732
public bool setVersion12(bool value) => _isVersion12 = value;
2833
}

sql/plsql/Cpp/PlSqlParserBase.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
class PlSqlParserBase : public antlr4::Parser
77
{
88
bool _isVersion12 = true;
9+
bool _isVersion11 = true;
910
bool _isVersion10 = true;
1011

1112
public:
@@ -21,6 +22,16 @@ class PlSqlParserBase : public antlr4::Parser
2122
_isVersion12 = value;
2223
}
2324

25+
bool isVersion11()
26+
{
27+
return _isVersion11;
28+
}
29+
30+
void setVersion11(bool value)
31+
{
32+
_isVersion11 = value;
33+
}
34+
2435
bool isVersion10()
2536
{
2637
return _isVersion10;

sql/plsql/Dart/PlSqlParserBase.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import 'dart:convert';
55
abstract class PlSqlParserBase extends Parser
66
{
77
bool _isVersion12 = true;
8+
bool _isVersion11 = true;
89
bool _isVersion10 = true;
910

1011
PlSqlParserBase(TokenStream input) : super(input)
@@ -19,6 +20,14 @@ abstract class PlSqlParserBase extends Parser
1920
_isVersion12 = value;
2021
}
2122

23+
bool isVersion11() {
24+
return _isVersion11;
25+
}
26+
27+
void setVersion11(bool value) {
28+
_isVersion11 = value;
29+
}
30+
2231
bool isVersion10() {
2332
return _isVersion10;
2433
}

sql/plsql/Go/plsql_parser_base.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
type PlSqlParserBase struct {
99
*antlr.BaseParser
1010
_isVersion12 bool
11+
_isVersion11 bool
1112
_isVersion10 bool
1213
}
1314

@@ -16,7 +17,8 @@ var StaticConfig PlSqlParserBase
1617
func init() {
1718
StaticConfig = PlSqlParserBase {
1819
_isVersion12: true,
19-
_isVersion10: true,
20+
_isVersion11: true,
21+
_isVersion10: true,
2022
}
2123
}
2224

@@ -28,6 +30,14 @@ func (p *PlSqlParserBase) setVersion12(value bool) {
2830
StaticConfig._isVersion12 = value;
2931
}
3032

33+
func (p *PlSqlParserBase) isVersion11() bool {
34+
return StaticConfig._isVersion11;
35+
}
36+
37+
func (p *PlSqlParserBase) setVersion11(value bool) {
38+
StaticConfig._isVersion11 = value;
39+
}
40+
3141
func (p *PlSqlParserBase) isVersion10() bool {
3242
return StaticConfig._isVersion10;
3343
}

sql/plsql/Java/PlSqlParserBase.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
public abstract class PlSqlParserBase extends Parser
66
{
77
private boolean _isVersion12 = true;
8+
private boolean _isVersion11 = true;
89
private boolean _isVersion10 = true;
910

1011
public PlSqlParserBase(TokenStream input) {
@@ -19,6 +20,14 @@ public void setVersion12(boolean value) {
1920
_isVersion12 = value;
2021
}
2122

23+
public boolean isVersion11() {
24+
return _isVersion11;
25+
}
26+
27+
public void setVersion11(boolean value) {
28+
_isVersion11 = value;
29+
}
30+
2231
public boolean isVersion10() {
2332
return _isVersion10;
2433
}

sql/plsql/JavaScript/PlSqlParserBase.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ import JavaScriptLexer from './PlSqlParser.js';
33

44
export default class PlSqlParserBase extends antlr4.Parser {
55
_isVersion10;
6+
_isVersion11;
67
_isVersion12;
78

89
constructor(input) {
910
super(input);
1011
this._isVersion10 = true;
12+
this._isVersion11 = true;
1113
this._isVersion12 = true;
1214
}
1315

1416
isVersion10() {
1517
return this._isVersion10;
1618
}
1719

20+
isVersion11() {
21+
return this._isVersion11;
22+
}
23+
1824
isVersion12() {
1925
return this._isVersion12;
2026
}
@@ -23,6 +29,10 @@ export default class PlSqlParserBase extends antlr4.Parser {
2329
this._isVersion10 = value;
2430
}
2531

32+
setVersion11(value) {
33+
this._isVersion11 = value;
34+
}
35+
2636
setVersion12(value) {
2737
this._isVersion12 = value;
2838
}

sql/plsql/PlSqlLexer.g4

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ NOENTITYESCAPING : 'NOENTITYESCAPING';
11271127
NO_EXPAND_GSET_TO_UNION : 'NO_EXPAND_GSET_TO_UNION';
11281128
NO_EXPAND : 'NO_EXPAND';
11291129
NO_EXPAND_TABLE : 'NO_EXPAND_TABLE';
1130+
NOEXTEND : 'NOEXTEND';
11301131
NO_FACT : 'NO_FACT';
11311132
NO_FACTORIZE_JOIN : 'NO_FACTORIZE_JOIN';
11321133
NO_FILTERING : 'NO_FILTERING';
@@ -1213,6 +1214,7 @@ NOSEGMENT : 'NOSEGMENT';
12131214
NO_SEMIJOIN : 'NO_SEMIJOIN';
12141215
NO_SEMI_TO_INNER : 'NO_SEMI_TO_INNER';
12151216
NO_SET_TO_JOIN : 'NO_SET_TO_JOIN';
1217+
NOSHARD : 'NOSHARD';
12161218
NOSORT : 'NOSORT';
12171219
NO_SQL_TRANSLATION : 'NO_SQL_TRANSLATION';
12181220
NO_SQL_TUNE : 'NO_SQL_TUNE';
@@ -1701,6 +1703,7 @@ SETS : 'SETS';
17011703
SETTINGS : 'SETTINGS';
17021704
SET_TO_JOIN : 'SET_TO_JOIN';
17031705
SEVERE : 'SEVERE';
1706+
SHARD : 'SHARD';
17041707
SHARDSPACE : 'SHARDSPACE';
17051708
SHARED_POOL : 'SHARED_POOL';
17061709
SHARED : 'SHARED';

0 commit comments

Comments
 (0)