Remove PARALLEL option from SQL commands

This commit is contained in:
Tobie Morgan Hitchcock 2020-03-06 15:44:53 +00:00
parent 480f4b00a9
commit 2ef562de06
11 changed files with 1599 additions and 2034 deletions

View file

@ -11,23 +11,23 @@ import (
const ( const (
// ----- content types ---- // ----- content types ----
codecSelferCcUTF88981 = 1 codecSelferCcUTF88297 = 1
codecSelferCcRAW8981 = 255 codecSelferCcRAW8297 = 255
// ----- value types used ---- // ----- value types used ----
codecSelferValueTypeArray8981 = 10 codecSelferValueTypeArray8297 = 10
codecSelferValueTypeMap8981 = 9 codecSelferValueTypeMap8297 = 9
codecSelferValueTypeString8981 = 6 codecSelferValueTypeString8297 = 6
codecSelferValueTypeInt8981 = 2 codecSelferValueTypeInt8297 = 2
codecSelferValueTypeUint8981 = 3 codecSelferValueTypeUint8297 = 3
codecSelferValueTypeFloat8981 = 4 codecSelferValueTypeFloat8297 = 4
codecSelferBitsize8981 = uint8(32 << (^uint(0) >> 63)) codecSelferBitsize8297 = uint8(32 << (^uint(0) >> 63))
) )
var ( var (
errCodecSelferOnlyMapOrArrayEncodeToStruct8981 = errors.New(`only encoded map or array can be decoded into a struct`) errCodecSelferOnlyMapOrArrayEncodeToStruct8297 = errors.New(`only encoded map or array can be decoded into a struct`)
) )
type codecSelfer8981 struct{} type codecSelfer8297 struct{}
func init() { func init() {
if codec1978.GenVersion != 10 { if codec1978.GenVersion != 10 {
@ -40,7 +40,7 @@ func init() {
} }
func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperEncoder(e) z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r _, _, _ = h, z, r
if x == nil { if x == nil {
@ -78,10 +78,10 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if yyq2[0] { if yyq2[0] {
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Time)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Time))
} }
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, "") r.EncodeStringEnc(codecSelferCcUTF88297, "")
} }
} else { } else {
if yyq2[0] { if yyq2[0] {
@ -89,12 +89,12 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"time\"") z.WriteStr("\"time\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `time`) r.EncodeStringEnc(codecSelferCcUTF88297, `time`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Time)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Time))
} }
} }
} }
@ -103,10 +103,10 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if yyq2[1] { if yyq2[1] {
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Status)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Status))
} }
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, "") r.EncodeStringEnc(codecSelferCcUTF88297, "")
} }
} else { } else {
if yyq2[1] { if yyq2[1] {
@ -114,12 +114,12 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"status\"") z.WriteStr("\"status\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `status`) r.EncodeStringEnc(codecSelferCcUTF88297, `status`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Status)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Status))
} }
} }
} }
@ -128,10 +128,10 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if yyq2[2] { if yyq2[2] {
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Detail)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Detail))
} }
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, "") r.EncodeStringEnc(codecSelferCcUTF88297, "")
} }
} else { } else {
if yyq2[2] { if yyq2[2] {
@ -139,12 +139,12 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"detail\"") z.WriteStr("\"detail\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `detail`) r.EncodeStringEnc(codecSelferCcUTF88297, `detail`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Detail)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Detail))
} }
} }
} }
@ -168,7 +168,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"result\"") z.WriteStr("\"result\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `result`) r.EncodeStringEnc(codecSelferCcUTF88297, `result`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if x.Result == nil { if x.Result == nil {
@ -191,7 +191,7 @@ func (x *Response) CodecEncodeSelf(e *codec1978.Encoder) {
} }
func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
if false { if false {
@ -199,14 +199,14 @@ func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) {
z.DecExtension(x, yyxt1) z.DecExtension(x, yyxt1)
} else { } else {
yyct2 := r.ContainerType() yyct2 := r.ContainerType()
if yyct2 == codecSelferValueTypeMap8981 { if yyct2 == codecSelferValueTypeMap8297 {
yyl2 := r.ReadMapStart() yyl2 := r.ReadMapStart()
if yyl2 == 0 { if yyl2 == 0 {
r.ReadMapEnd() r.ReadMapEnd()
} else { } else {
x.codecDecodeSelfFromMap(yyl2, d) x.codecDecodeSelfFromMap(yyl2, d)
} }
} else if yyct2 == codecSelferValueTypeArray8981 { } else if yyct2 == codecSelferValueTypeArray8297 {
yyl2 := r.ReadArrayStart() yyl2 := r.ReadArrayStart()
if yyl2 == 0 { if yyl2 == 0 {
r.ReadArrayEnd() r.ReadArrayEnd()
@ -214,13 +214,13 @@ func (x *Response) CodecDecodeSelf(d *codec1978.Decoder) {
x.codecDecodeSelfFromArray(yyl2, d) x.codecDecodeSelfFromArray(yyl2, d)
} }
} else { } else {
panic(errCodecSelferOnlyMapOrArrayEncodeToStruct8981) panic(errCodecSelferOnlyMapOrArrayEncodeToStruct8297)
} }
} }
} }
func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyhl3 bool = l >= 0 var yyhl3 bool = l >= 0
@ -273,7 +273,7 @@ func (x *Response) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj9 int var yyj9 int
@ -363,7 +363,7 @@ func (x *Response) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
} }
func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) { func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperEncoder(e) z, r := codec1978.GenHelperEncoder(e)
_, _, _ = h, z, r _, _, _ = h, z, r
if x == nil { if x == nil {
@ -400,10 +400,10 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
if yyq2[0] { if yyq2[0] {
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Query)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Query))
} }
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, "") r.EncodeStringEnc(codecSelferCcUTF88297, "")
} }
} else { } else {
if yyq2[0] { if yyq2[0] {
@ -411,12 +411,12 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"query\"") z.WriteStr("\"query\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `query`) r.EncodeStringEnc(codecSelferCcUTF88297, `query`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Query)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Query))
} }
} }
} }
@ -425,10 +425,10 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
if yyq2[1] { if yyq2[1] {
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Action)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Action))
} }
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, "") r.EncodeStringEnc(codecSelferCcUTF88297, "")
} }
} else { } else {
if yyq2[1] { if yyq2[1] {
@ -436,12 +436,12 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"action\"") z.WriteStr("\"action\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `action`) r.EncodeStringEnc(codecSelferCcUTF88297, `action`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if false { if false {
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, string(x.Action)) r.EncodeStringEnc(codecSelferCcUTF88297, string(x.Action))
} }
} }
} }
@ -465,7 +465,7 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
if z.IsJSONHandle() { if z.IsJSONHandle() {
z.WriteStr("\"result\"") z.WriteStr("\"result\"")
} else { } else {
r.EncodeStringEnc(codecSelferCcUTF88981, `result`) r.EncodeStringEnc(codecSelferCcUTF88297, `result`)
} }
r.WriteMapElemValue() r.WriteMapElemValue()
if x.Result == nil { if x.Result == nil {
@ -488,7 +488,7 @@ func (x *Dispatch) CodecEncodeSelf(e *codec1978.Encoder) {
} }
func (x *Dispatch) CodecDecodeSelf(d *codec1978.Decoder) { func (x *Dispatch) CodecDecodeSelf(d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
if false { if false {
@ -496,14 +496,14 @@ func (x *Dispatch) CodecDecodeSelf(d *codec1978.Decoder) {
z.DecExtension(x, yyxt1) z.DecExtension(x, yyxt1)
} else { } else {
yyct2 := r.ContainerType() yyct2 := r.ContainerType()
if yyct2 == codecSelferValueTypeMap8981 { if yyct2 == codecSelferValueTypeMap8297 {
yyl2 := r.ReadMapStart() yyl2 := r.ReadMapStart()
if yyl2 == 0 { if yyl2 == 0 {
r.ReadMapEnd() r.ReadMapEnd()
} else { } else {
x.codecDecodeSelfFromMap(yyl2, d) x.codecDecodeSelfFromMap(yyl2, d)
} }
} else if yyct2 == codecSelferValueTypeArray8981 { } else if yyct2 == codecSelferValueTypeArray8297 {
yyl2 := r.ReadArrayStart() yyl2 := r.ReadArrayStart()
if yyl2 == 0 { if yyl2 == 0 {
r.ReadArrayEnd() r.ReadArrayEnd()
@ -511,13 +511,13 @@ func (x *Dispatch) CodecDecodeSelf(d *codec1978.Decoder) {
x.codecDecodeSelfFromArray(yyl2, d) x.codecDecodeSelfFromArray(yyl2, d)
} }
} else { } else {
panic(errCodecSelferOnlyMapOrArrayEncodeToStruct8981) panic(errCodecSelferOnlyMapOrArrayEncodeToStruct8297)
} }
} }
} }
func (x *Dispatch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) { func (x *Dispatch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyhl3 bool = l >= 0 var yyhl3 bool = l >= 0
@ -564,7 +564,7 @@ func (x *Dispatch) codecDecodeSelfFromMap(l int, d *codec1978.Decoder) {
} }
func (x *Dispatch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) { func (x *Dispatch) codecDecodeSelfFromArray(l int, d *codec1978.Decoder) {
var h codecSelfer8981 var h codecSelfer8297
z, r := codec1978.GenHelperDecoder(d) z, r := codec1978.GenHelperDecoder(d)
_, _, _ = h, z, r _, _, _ = h, z, r
var yyj8 int var yyj8 int

File diff suppressed because it is too large Load diff

View file

@ -160,77 +160,70 @@ type IfelseStatement struct {
// SelectStatement represents a SQL SELECT statement. // SelectStatement represents a SQL SELECT statement.
type SelectStatement struct { type SelectStatement struct {
RW bool RW bool
Expr Fields Expr Fields
What Exprs What Exprs
Cond Expr Cond Expr
Split Idents Split Idents
Group Groups Group Groups
Order Orders Order Orders
Limit Expr Limit Expr
Start Expr Start Expr
Fetch Fetchs Fetch Fetchs
Version Expr Version Expr
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// CreateStatement represents a SQL CREATE statement. // CreateStatement represents a SQL CREATE statement.
type CreateStatement struct { type CreateStatement struct {
What Exprs What Exprs
Data Expr Data Expr
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// UpdateStatement represents a SQL UPDATE statement. // UpdateStatement represents a SQL UPDATE statement.
type UpdateStatement struct { type UpdateStatement struct {
What Exprs What Exprs
Data Expr Data Expr
Cond Expr Cond Expr
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// DeleteStatement represents a SQL DELETE statement. // DeleteStatement represents a SQL DELETE statement.
type DeleteStatement struct { type DeleteStatement struct {
What Exprs What Exprs
Cond Expr Cond Expr
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// RelateStatement represents a SQL RELATE statement. // RelateStatement represents a SQL RELATE statement.
type RelateStatement struct { type RelateStatement struct {
Type Expr Type Expr
From Exprs From Exprs
With Exprs With Exprs
Data Expr Data Expr
Uniq bool Uniq bool
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// InsertStatement represents a SQL INSERT statement. // InsertStatement represents a SQL INSERT statement.
type InsertStatement struct { type InsertStatement struct {
Data Expr Data Expr
Into *Table Into *Table
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// UpsertStatement represents a SQL UPSERT statement. // UpsertStatement represents a SQL UPSERT statement.
type UpsertStatement struct { type UpsertStatement struct {
Data Expr Data Expr
Into *Table Into *Table
Echo Token Echo Token
Timeout time.Duration Timeout time.Duration
Parallel bool
} }
// -------------------------------------------------- // --------------------------------------------------

View file

@ -34,10 +34,6 @@ func (p *parser) parseCreateStatement() (stmt *CreateStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }

View file

@ -36,10 +36,6 @@ func (p *parser) parseDeleteStatement() (stmt *DeleteStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }

View file

@ -40,10 +40,6 @@ func (p *parser) parseInsertStatement() (stmt *InsertStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }

View file

@ -78,10 +78,6 @@ func (p *parser) parseRelateStatement() (stmt *RelateStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }

View file

@ -75,10 +75,6 @@ func (p *parser) parseSelectStatement() (stmt *SelectStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
if err = checkExpression(aggrs, stmt.Expr, stmt.Group); err != nil { if err = checkExpression(aggrs, stmt.Expr, stmt.Group); err != nil {
return nil, err return nil, err
} }

File diff suppressed because it is too large Load diff

View file

@ -38,10 +38,6 @@ func (p *parser) parseUpdateStatement() (stmt *UpdateStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }

View file

@ -40,10 +40,6 @@ func (p *parser) parseUpsertStatement() (stmt *UpsertStatement, err error) {
return nil, err return nil, err
} }
if stmt.Parallel, err = p.parseParallel(); err != nil {
return nil, err
}
return return
} }