Skip to content

Commit d03030f

Browse files
committed
fix conflict for constraint state
1 parent 0f12cd8 commit d03030f

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

sql.y

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,20 +1283,19 @@ DefaultCollateClauseOrEmpty:
12831283
}
12841284

12851285
OnCommitClause:
1286-
OnCommitDef OnCommitRows
1287-
1288-
OnCommitDef:
12891286
{
12901287
// empty
12911288
}
1292-
| _on _commit _drop _definition
1289+
| OnCommitDef
1290+
| OnCommitRows
1291+
| OnCommitDef OnCommitRows
1292+
1293+
OnCommitDef:
1294+
_on _commit _drop _definition
12931295
| _on _commit _preserve _definition
12941296

12951297
OnCommitRows:
1296-
{
1297-
// empty
1298-
}
1299-
| _on _commit _delete _rows
1298+
_on _commit _delete _rows
13001299
| _on _commit _preserve _rows
13011300

13021301
PhysicalProps:
@@ -2228,13 +2227,25 @@ InlineConstraint:
22282227
}
22292228

22302229
InlineConstraintBody:
2231-
InlineConstraintType ConstraintStateOrEmpty
2230+
InlineConstraintType ConstraintState
22322231
{
22332232
$$ = &ast.InlineConstraint{
22342233
Type: ast.ConstraintType($1),
22352234
}
22362235
}
2237-
| ReferencesClause ConstraintStateOrEmpty
2236+
//| InlineConstraintType ConstraintState
2237+
// {
2238+
// $$ = &ast.InlineConstraint{
2239+
// Type: ast.ConstraintType($1),
2240+
// }
2241+
// }
2242+
//| ReferencesClause
2243+
// {
2244+
// $$ = &ast.InlineConstraint{
2245+
// Type: ast.ConstraintTypeReferences,
2246+
// }
2247+
// }
2248+
| ReferencesClause ConstraintState
22382249
{
22392250
$$ = &ast.InlineConstraint{
22402251
Type: ast.ConstraintTypeReferences,
@@ -2276,12 +2287,6 @@ ReferencesOnDelete:
22762287
| _on _delete _cascade
22772288
| _on _delete _set _null
22782289

2279-
ConstraintStateOrEmpty:
2280-
{
2281-
// empty
2282-
}
2283-
| ConstraintState
2284-
22852290
//ConstraintStateList:
22862291
// ConstraintState
22872292
//| ConstraintStateList ConstraintState
@@ -2301,7 +2306,7 @@ ConstraintStateOrEmpty:
23012306
//| _novalidate
23022307
//| ExceptionsClause
23032308

2304-
ConstraintState: // todo: support using_index_clause, enable/disable, validate, exceptions_clause
2309+
ConstraintState:
23052310
ConstraintStateDeferrableClause ConstraintStateRely UsingIndexClause ConstraintStateEnable ConstraintStateValidate ExceptionsClause
23062311

23072312
ConstraintStateDeferrableClause:
@@ -2359,8 +2364,8 @@ ExceptionsClause:
23592364
InlineRefConstraint:
23602365
_scope _is TableName
23612366
| _with _rowid
2362-
| ConstraintName ReferencesClause ConstraintStateOrEmpty
2363-
| ReferencesClause ConstraintStateOrEmpty
2367+
| ConstraintName ReferencesClause ConstraintState
2368+
| ReferencesClause ConstraintState
23642369

23652370
OutOfLineConstraint:
23662371
ConstraintName OutOfLineConstraintBody
@@ -2375,21 +2380,21 @@ OutOfLineConstraint:
23752380
}
23762381

23772382
OutOfLineConstraintBody:
2378-
_unique '(' ColumnNameList ')' ConstraintStateOrEmpty
2383+
_unique '(' ColumnNameList ')' ConstraintState
23792384
{
23802385
constraint := &ast.OutOfLineConstraint{}
23812386
constraint.Type = ast.ConstraintTypeUnique
23822387
constraint.Columns = $3.([]*element.Identifier)
23832388
$$ = constraint
23842389
}
2385-
| _primary _key '(' ColumnNameList ')' ConstraintStateOrEmpty
2390+
| _primary _key '(' ColumnNameList ')' ConstraintState
23862391
{
23872392
constraint := &ast.OutOfLineConstraint{}
23882393
constraint.Type = ast.ConstraintTypePK
23892394
constraint.Columns = $4.([]*element.Identifier)
23902395
$$ = constraint
23912396
}
2392-
| _foreign _key '(' ColumnNameList ')' ReferencesClause ConstraintStateOrEmpty
2397+
| _foreign _key '(' ColumnNameList ')' ReferencesClause ConstraintState
23932398
{
23942399
constraint := &ast.OutOfLineConstraint{}
23952400
constraint.Type = ast.ConstraintTypeReferences

0 commit comments

Comments
 (0)