Remove POLICY from SQL DEFINE SCOPE statement

This commit is contained in:
Tobie Morgan Hitchcock 2016-11-21 18:43:15 +00:00
parent 11d394f9fc
commit 19650ab770
4 changed files with 8 additions and 19 deletions

View file

@ -256,14 +256,13 @@ type RemoveTokenStatement struct {
// DefineScopeStatement represents an SQL DEFINE SCOPE statement. // DefineScopeStatement represents an SQL DEFINE SCOPE statement.
type DefineScopeStatement struct { type DefineScopeStatement struct {
KV string `cork:"-" codec:"-"` KV string `cork:"-" codec:"-"`
NS string `cork:"-" codec:"-"` NS string `cork:"-" codec:"-"`
DB string `cork:"-" codec:"-"` DB string `cork:"-" codec:"-"`
Name string `cork:"name" codec:"name"` Name string `cork:"name" codec:"name"`
Time time.Duration `cork:"time" codec:"time"` Time time.Duration `cork:"time" codec:"time"`
Signup Expr `cork:"signup" codec:"signup"` Signup Expr `cork:"signup" codec:"signup"`
Signin Expr `cork:"signin" codec:"signin"` Signin Expr `cork:"signin" codec:"signin"`
Policy map[string]interface{} `cork:"policy" codec:"policy"`
} }
// RemoveScopeStatement represents an SQL REMOVE SCOPE statement. // RemoveScopeStatement represents an SQL REMOVE SCOPE statement.

View file

@ -1201,7 +1201,6 @@ func (this *DefineScopeStatement) MarshalCORK() (dst []byte, err error) {
e.Encode(this.Time) e.Encode(this.Time)
e.Encode(this.Signup) e.Encode(this.Signup)
e.Encode(this.Signin) e.Encode(this.Signin)
e.Encode(this.Policy)
return b.Bytes(), nil return b.Bytes(), nil
} }
@ -1212,7 +1211,6 @@ func (this *DefineScopeStatement) UnmarshalCORK(src []byte) (err error) {
d.Decode(&this.Time) d.Decode(&this.Time)
d.Decode(&this.Signup) d.Decode(&this.Signup)
d.Decode(&this.Signin) d.Decode(&this.Signin)
d.Decode(&this.Policy)
return return
} }

View file

@ -28,7 +28,7 @@ func (p *parser) parseDefineScopeStatement() (stmt *DefineScopeStatement, err er
for { for {
tok, _, exi := p.mightBe(SESSION, POLICY, SIGNUP, SIGNIN) tok, _, exi := p.mightBe(SESSION, SIGNUP, SIGNIN)
if !exi { if !exi {
break break
} }
@ -39,12 +39,6 @@ func (p *parser) parseDefineScopeStatement() (stmt *DefineScopeStatement, err er
} }
} }
if p.is(tok, POLICY) {
if stmt.Policy, err = p.parseObject(); err != nil {
return nil, err
}
}
if p.is(tok, SIGNUP) { if p.is(tok, SIGNUP) {
_, _, _ = p.mightBe(AS) _, _, _ = p.mightBe(AS)
if stmt.Signup, err = p.parseExpr(); err != nil { if stmt.Signup, err = p.parseExpr(); err != nil {

View file

@ -157,7 +157,6 @@ const (
OR OR
ORDER ORDER
PASSWORD PASSWORD
POLICY
READONLY READONLY
REJECT REJECT
RELATE RELATE
@ -321,7 +320,6 @@ var tokens = [...]string{
OR: "OR", OR: "OR",
ORDER: "ORDER", ORDER: "ORDER",
PASSWORD: "PASSWORD", PASSWORD: "PASSWORD",
POLICY: "POLICY",
READONLY: "READONLY", READONLY: "READONLY",
REJECT: "REJECT", REJECT: "REJECT",
RELATE: "RELATE", RELATE: "RELATE",