diff --git a/go/vt/sqlparser/Makefile b/go/vt/sqlparser/Makefile index 1ca0af6755e..9dfe647113d 100644 --- a/go/vt/sqlparser/Makefile +++ b/go/vt/sqlparser/Makefile @@ -1,11 +1,11 @@ # Copyright 2019 The Vitess Authors. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -15,7 +15,7 @@ MAKEFLAGS = -s sql.go: sql.y - go run golang.org/x/tools/cmd/goyacc -o sql.go sql.y + go run ./goyacc -fast-append -o sql.go sql.y gofmt -w sql.go clean: diff --git a/go/vt/sqlparser/goyacc/goyacc.go b/go/vt/sqlparser/goyacc/goyacc.go new file mode 100644 index 00000000000..567a2240664 --- /dev/null +++ b/go/vt/sqlparser/goyacc/goyacc.go @@ -0,0 +1,3765 @@ +/* +Derived from Inferno's utils/iyacc/yacc.c +http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c + +This copyright NOTICE applies to all files in this directory and +subdirectories, unless another copyright notice appears in a given +file or subdirectory. If you take substantial code from this software to use in +other programs, you must somehow include with it an appropriate +copyright notice that includes the copyright notice and the other +notices below. It is fine (and often tidier) to do that in a separate +file such as NOTICE, LICENCE or COPYING. + + Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. + Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) + Portions Copyright © 1997-1999 Vita Nuova Limited + Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com) + Portions Copyright © 2004,2006 Bruce Ellis + Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) + Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others + Portions Copyright © 2009 The Go Authors. All rights reserved. + Portions Copyright © 2021 The Vitess Authors. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +package main + +// yacc +// major difference is lack of stem ("y" variable) +// + +import ( + "bufio" + "bytes" + "flag" + "fmt" + "go/format" + "io/ioutil" + "os" + "regexp" + "sort" + "strconv" + "strings" + "unicode" +) + +// the following are adjustable +// according to memory size +const ( + ACTSIZE = 120000 + NSTATES = 8000 + TEMPSIZE = 8000 + + SYMINC = 50 // increase for non-term or term + RULEINC = 50 // increase for max rule length prodptr[i] + PRODINC = 100 // increase for productions prodptr + WSETINC = 50 // increase for working sets wsets + STATEINC = 200 // increase for states statemem + + PRIVATE = 0xE000 // unicode private use + + // relationships which must hold: + // TEMPSIZE >= NTERMS + NNONTERM + 1; + // TEMPSIZE >= NSTATES; + // + + NTBASE = 010000 + ERRCODE = 8190 + ACCEPTCODE = 8191 + YYLEXUNK = 3 + TOKSTART = 4 //index of first defined token +) + +// no, left, right, binary assoc. +const ( + LASC = iota + 1 + RASC + BASC +) + +// flags for state generation +const ( + DONE = iota + MUSTDO + MUSTLOOKAHEAD +) + +// flags for a rule having an action, and being reduced +const ( + ACTFLAG = 1 << (iota + 2) + REDFLAG +) + +// output parser flags +const yyFlag = -1000 + +// parse tokens +const ( + IDENTIFIER = PRIVATE + iota + MARK + TERM + LEFT + RIGHT + BINARY + PREC + LCURLY + IDENTCOLON + NUMBER + START + TYPEDEF + TYPENAME + STRUCT + UNION + ERROR +) + +const ENDFILE = 0 +const EMPTY = 1 +const WHOKNOWS = 0 +const OK = 1 +const NOMORE = -1000 + +// macros for getting associativity and precedence levels +func ASSOC(i int) int { return i & 3 } + +func PLEVEL(i int) int { return (i >> 4) & 077 } + +func TYPE(i int) int { return (i >> 10) & 077 } + +// macros for setting associativity and precedence levels +func SETASC(i, j int) int { return i | j } + +func SETPLEV(i, j int) int { return i | (j << 4) } + +func SETTYPE(i, j int) int { return i | (j << 10) } + +// I/O descriptors +var finput *bufio.Reader // input file +var stderr *bufio.Writer +var ftable *bufio.Writer // y.go file +var fcode = &bytes.Buffer{} // saved code +var ftypes = &bytes.Buffer{} // saved type definitions +var foutput *bufio.Writer // y.output file + +var writtenImports bool // output file has recorded an import of "fmt" + +var oflag string // -o [y.go] - y.go file +var vflag string // -v [y.output] - y.output file +var lflag bool // -l - disable line directives +var prefix string // name prefix for identifiers, default yy +var allowFastAppend bool + +func init() { + flag.StringVar(&oflag, "o", "y.go", "parser output") + flag.StringVar(&prefix, "p", "yy", "name prefix to use in generated code") + flag.StringVar(&vflag, "v", "y.output", "create parsing tables") + flag.BoolVar(&lflag, "l", false, "disable line directives") + flag.BoolVar(&allowFastAppend, "fast-append", false, "enable fast-append optimization") +} + +var initialstacksize = 16 + +// communication variables between various I/O routines +var infile string // input file name +var numbval int // value of an input number +var tokname string // input token name, slop for runes and 0 +var tokflag = false + +// structure declarations +type Lkset []int + +type Pitem struct { + prod []int + off int // offset within the production + first int // first term or non-term in item + prodno int // production number for sorting +} + +type Item struct { + pitem Pitem + look Lkset +} + +type Symb struct { + name string + noconst bool + value int +} + +type Wset struct { + pitem Pitem + flag int + ws Lkset +} + +// storage of types +var ntypes int // number of types defined +var typeset = make(map[int]string) // pointers to type tags + +// token information + +var ntokens = 0 // number of tokens +var tokset []Symb +var toklev []int // vector with the precedence of the terminals + +// nonterminal information + +var nnonter = -1 // the number of nonterminals +var nontrst []Symb +var start int // start symbol + +// state information + +var nstate = 0 // number of states +var pstate = make([]int, NSTATES+2) // index into statemem to the descriptions of the states +var statemem []Item +var tystate = make([]int, NSTATES) // contains type information about the states +var tstates []int // states generated by terminal gotos +var ntstates []int // states generated by nonterminal gotos +var mstates = make([]int, NSTATES) // chain of overflows of term/nonterm generation lists +var lastred int // number of last reduction of a state +var defact = make([]int, NSTATES) // default actions of states + +// lookahead set information + +var nolook = 0 // flag to turn off lookahead computations +var tbitset = 0 // size of lookahead sets +var clset Lkset // temporary storage for lookahead computations + +// working set information + +var wsets []Wset +var cwp int + +// storage for action table + +var amem []int // action table storage +var memp int // next free action table position +var indgo = make([]int, NSTATES) // index to the stored goto table + +// temporary vector, indexable by states, terms, or ntokens + +var temp1 = make([]int, TEMPSIZE) // temporary storage, indexed by terms + ntokens or states +var lineno = 1 // current input line number +var fatfl = 1 // if on, error is fatal +var nerrors = 0 // number of errors + +// assigned token type values + +var extval = 0 + +// grammar rule information + +var nprod = 1 // number of productions +var prdptr [][]int // pointers to descriptions of productions +var levprd []int // precedence levels for the productions +var rlines []int // line number for this rule + +// statistics collection variables + +var zzgoent = 0 +var zzgobest = 0 +var zzacent = 0 +var zzexcp = 0 +var zzclose = 0 +var zzrrconf = 0 +var zzsrconf = 0 +var zzstate = 0 + +// optimizer arrays + +var yypgo [][]int +var optst [][]int +var ggreed []int +var pgo []int + +var maxspr int // maximum spread of any entry +var maxoff int // maximum offset into a array +var maxa int + +// storage for information about the nonterminals + +var pres [][][]int // vector of pointers to productions yielding each nonterminal +var pfirst []Lkset +var pempty []int // vector of nonterminals nontrivially deriving e + +// random stuff picked out from between functions + +var indebug = 0 // debugging flag for cpfir +var pidebug = 0 // debugging flag for putitem +var gsdebug = 0 // debugging flag for stagen +var cldebug = 0 // debugging flag for closure +var pkdebug = 0 // debugging flag for apack +var g2debug = 0 // debugging for go2gen +var adb = 0 // debugging for callopt + +type Resrv struct { + name string + value int +} + +var resrv = []Resrv{ + {"binary", BINARY}, + {"left", LEFT}, + {"nonassoc", BINARY}, + {"prec", PREC}, + {"right", RIGHT}, + {"start", START}, + {"term", TERM}, + {"token", TERM}, + {"type", TYPEDEF}, + {"union", UNION}, + {"struct", STRUCT}, + {"error", ERROR}, +} + +type Error struct { + lineno int + tokens []string + msg string +} + +var errors []Error + +type Row struct { + actions []int + defaultAction int +} + +var stateTable []Row + +var zznewstate = 0 + +const EOF = -1 + +func main() { + + setup() // initialize and read productions + + tbitset = (ntokens + 32) / 32 + cpres() // make table of which productions yield a given nonterminal + cempty() // make a table of which nonterminals can match the empty string + cpfir() // make a table of firsts of nonterminals + + stagen() // generate the states + + yypgo = make([][]int, nnonter+1) + optst = make([][]int, nstate) + output() // write the states and the tables + go2out() + + hideprod() + summary() + + callopt() + + typeinfo() + others() + + exit(0) +} + +func setup() { + var j, ty int + + stderr = bufio.NewWriter(os.Stderr) + foutput = nil + + flag.Parse() + if flag.NArg() != 1 { + usage() + } + if initialstacksize < 1 { + // never set so cannot happen + fmt.Fprintf(stderr, "yacc: stack size too small\n") + usage() + } + yaccpar = strings.Replace(yaccpartext, "$$", prefix, -1) + openup() + + fmt.Fprintf(ftable, "// Code generated by goyacc %s. DO NOT EDIT.\n", strings.Join(os.Args[1:], " ")) + + defin(0, "$end") + extval = PRIVATE // tokens start in unicode 'private use' + defin(0, "error") + defin(1, "$accept") + defin(0, "$unk") + i := 0 + + t := gettok() + +outer: + for { + switch t { + default: + errorf("syntax error tok=%v", t-PRIVATE) + + case MARK, ENDFILE: + break outer + + case ';': + // Do nothing. + + case START: + t = gettok() + if t != IDENTIFIER { + errorf("bad %%start construction") + } + start = chfind(1, tokname) + + case ERROR: + lno := lineno + var tokens []string + for { + t := gettok() + if t == ':' { + break + } + if t != IDENTIFIER && t != IDENTCOLON { + errorf("bad syntax in %%error") + } + tokens = append(tokens, tokname) + if t == IDENTCOLON { + break + } + } + if gettok() != IDENTIFIER { + errorf("bad syntax in %%error") + } + errors = append(errors, Error{lno, tokens, tokname}) + + case TYPEDEF: + t = gettok() + if t != TYPENAME { + errorf("bad syntax in %%type") + } + ty = numbval + for { + t = gettok() + switch t { + case IDENTIFIER: + t = chfind(1, tokname) + if t < NTBASE { + j = TYPE(toklev[t]) + if j != 0 && j != ty { + errorf("type redeclaration of token %s", + tokset[t].name) + } else { + toklev[t] = SETTYPE(toklev[t], ty) + } + } else { + j = nontrst[t-NTBASE].value + if j != 0 && j != ty { + errorf("type redeclaration of nonterminal %v", + nontrst[t-NTBASE].name) + } else { + nontrst[t-NTBASE].value = ty + } + } + continue + + case ',': + continue + } + break + } + continue + + case UNION: + parsetypes(true) + + case STRUCT: + parsetypes(false) + + case LEFT, BINARY, RIGHT, TERM: + // nonzero means new prec. and assoc. + lev := t - TERM + if lev != 0 { + i++ + } + ty = 0 + + // get identifiers so defined + t = gettok() + + // there is a type defined + if t == TYPENAME { + ty = numbval + t = gettok() + } + for { + switch t { + case ',': + t = gettok() + continue + + case ';': + // Do nothing. + + case IDENTIFIER: + j = chfind(0, tokname) + if j >= NTBASE { + errorf("%v defined earlier as nonterminal", tokname) + } + if lev != 0 { + if ASSOC(toklev[j]) != 0 { + errorf("redeclaration of precedence of %v", tokname) + } + toklev[j] = SETASC(toklev[j], lev) + toklev[j] = SETPLEV(toklev[j], i) + } + if ty != 0 { + if TYPE(toklev[j]) != 0 { + errorf("redeclaration of type of %v", tokname) + } + toklev[j] = SETTYPE(toklev[j], ty) + } + t = gettok() + if t == NUMBER { + tokset[j].value = numbval + t = gettok() + } + + continue + } + break + } + continue + + case LCURLY: + cpycode() + } + t = gettok() + } + + if t == ENDFILE { + errorf("unexpected EOF before %%") + } + + fmt.Fprintf(fcode, "switch %snt {\n", prefix) + + moreprod() + prdptr[0] = []int{NTBASE, start, 1, 0} + + nprod = 1 + curprod := make([]int, RULEINC) + t = gettok() + if t != IDENTCOLON { + errorf("bad syntax on first rule") + } + + if start == 0 { + prdptr[0][1] = chfind(1, tokname) + } + + // read rules + // put into prdptr array in the format + // target + // followed by id's of terminals and non-terminals + // followed by -nprod + + for t != MARK && t != ENDFILE { + mem := 0 + + // process a rule + rlines[nprod] = lineno + ruleline := lineno + if t == '|' { + curprod[mem] = prdptr[nprod-1][0] + mem++ + } else if t == IDENTCOLON { + curprod[mem] = chfind(1, tokname) + if curprod[mem] < NTBASE { + lerrorf(ruleline, "token illegal on LHS of grammar rule") + } + mem++ + } else { + lerrorf(ruleline, "illegal rule: missing semicolon or | ?") + } + + // read rule body + t = gettok() + for { + for t == IDENTIFIER { + curprod[mem] = chfind(1, tokname) + if curprod[mem] < NTBASE { + levprd[nprod] = toklev[curprod[mem]] + } + mem++ + if mem >= len(curprod) { + ncurprod := make([]int, mem+RULEINC) + copy(ncurprod, curprod) + curprod = ncurprod + } + t = gettok() + } + if t == PREC { + if gettok() != IDENTIFIER { + lerrorf(ruleline, "illegal %%prec syntax") + } + j = chfind(2, tokname) + if j >= NTBASE { + lerrorf(ruleline, "nonterminal "+nontrst[j-NTBASE].name+" illegal after %%prec") + } + levprd[nprod] = toklev[j] + t = gettok() + } + if t != '=' { + break + } + levprd[nprod] |= ACTFLAG + fmt.Fprintf(fcode, "\n\tcase %v:", nprod) + fmt.Fprintf(fcode, "\n\t\t%sDollar = %sS[%spt-%v:%spt+1]", prefix, prefix, prefix, mem-1, prefix) + + var act bytes.Buffer + var unionType string + cpyact(&act, curprod, mem, &unionType) + + if unionType != "" { + fmt.Fprintf(fcode, "\n\t\tvar %sLOCAL %s", prefix, unionType) + } + fcode.Write(act.Bytes()) + if unionType != "" { + fmt.Fprintf(fcode, "\n\t\t%sVAL.union = %sLOCAL", prefix, prefix) + } + + // action within rule... + t = gettok() + if t == IDENTIFIER { + // make it a nonterminal + j = chfind(1, fmt.Sprintf("$$%v", nprod)) + + // + // the current rule will become rule number nprod+1 + // enter null production for action + // + prdptr[nprod] = make([]int, 2) + prdptr[nprod][0] = j + prdptr[nprod][1] = -nprod + + // update the production information + nprod++ + moreprod() + levprd[nprod] = levprd[nprod-1] & ^ACTFLAG + levprd[nprod-1] = ACTFLAG + rlines[nprod] = lineno + + // make the action appear in the original rule + curprod[mem] = j + mem++ + if mem >= len(curprod) { + ncurprod := make([]int, mem+RULEINC) + copy(ncurprod, curprod) + curprod = ncurprod + } + } + } + + for t == ';' { + t = gettok() + } + curprod[mem] = -nprod + mem++ + + // check that default action is reasonable + if ntypes != 0 && (levprd[nprod]&ACTFLAG) == 0 && + nontrst[curprod[0]-NTBASE].value != 0 { + // no explicit action, LHS has value + tempty := curprod[1] + if tempty < 0 { + lerrorf(ruleline, "must return a value, since LHS has a type") + } + if tempty >= NTBASE { + tempty = nontrst[tempty-NTBASE].value + } else { + tempty = TYPE(toklev[tempty]) + } + if tempty != nontrst[curprod[0]-NTBASE].value { + lerrorf(ruleline, "default action causes potential type clash") + } + } + moreprod() + prdptr[nprod] = make([]int, mem) + copy(prdptr[nprod], curprod) + nprod++ + moreprod() + levprd[nprod] = 0 + } + + if TEMPSIZE < ntokens+nnonter+1 { + errorf("too many tokens (%d) or non-terminals (%d)", ntokens, nnonter) + } + + // + // end of all rules + // dump out the prefix code + // + + fmt.Fprintf(fcode, "\n\t}") + + // put out non-literal terminals + for i := TOKSTART; i <= ntokens; i++ { + // non-literals + if !tokset[i].noconst { + fmt.Fprintf(ftable, "const %v = %v\n", tokset[i].name, tokset[i].value) + } + } + + // put out names of tokens + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %sToknames = [...]string{\n", prefix) + for i := 1; i <= ntokens; i++ { + fmt.Fprintf(ftable, "\t%q,\n", tokset[i].name) + } + fmt.Fprintf(ftable, "}\n") + + // put out names of states. + // commented out to avoid a huge table just for debugging. + // re-enable to have the names in the binary. + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %sStatenames = [...]string{\n", prefix) + // for i:=TOKSTART; i<=ntokens; i++ { + // fmt.Fprintf(ftable, "\t%q,\n", tokset[i].name); + // } + fmt.Fprintf(ftable, "}\n") + + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sEofCode = 1\n", prefix) + fmt.Fprintf(ftable, "const %sErrCode = 2\n", prefix) + fmt.Fprintf(ftable, "const %sInitialStackSize = %v\n", prefix, initialstacksize) + + // + // copy any postfix code + // + if t == MARK { + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + for { + c := getrune(finput) + if c == EOF { + break + } + ftable.WriteRune(c) + } + } +} + +// +// allocate enough room to hold another production +// +func moreprod() { + n := len(prdptr) + if nprod >= n { + nn := n + PRODINC + aprod := make([][]int, nn) + alevprd := make([]int, nn) + arlines := make([]int, nn) + + copy(aprod, prdptr) + copy(alevprd, levprd) + copy(arlines, rlines) + + prdptr = aprod + levprd = alevprd + rlines = arlines + } +} + +// +// define s to be a terminal if nt==0 +// or a nonterminal if nt==1 +// +func defin(nt int, s string) int { + val := 0 + if nt != 0 { + nnonter++ + if nnonter >= len(nontrst) { + anontrst := make([]Symb, nnonter+SYMINC) + copy(anontrst, nontrst) + nontrst = anontrst + } + nontrst[nnonter] = Symb{name: s} + return NTBASE + nnonter + } + + // must be a token + ntokens++ + if ntokens >= len(tokset) { + nn := ntokens + SYMINC + atokset := make([]Symb, nn) + atoklev := make([]int, nn) + + copy(atoklev, toklev) + copy(atokset, tokset) + + tokset = atokset + toklev = atoklev + } + tokset[ntokens].name = s + toklev[ntokens] = 0 + + // establish value for token + // single character literal + if s[0] == '\'' || s[0] == '"' { + q, err := strconv.Unquote(s) + if err != nil { + errorf("invalid token: %s", err) + } + rq := []rune(q) + if len(rq) != 1 { + errorf("character token too long: %s", s) + } + val = int(rq[0]) + if val == 0 { + errorf("token value 0 is illegal") + } + tokset[ntokens].noconst = true + } else { + val = extval + extval++ + if s[0] == '$' { + tokset[ntokens].noconst = true + } + } + + tokset[ntokens].value = val + return ntokens +} + +var peekline = 0 + +func gettok() int { + var i int + var match, c rune + + tokname = "" + for { + lineno += peekline + peekline = 0 + c = getrune(finput) + for c == ' ' || c == '\n' || c == '\t' || c == '\v' || c == '\r' { + if c == '\n' { + lineno++ + } + c = getrune(finput) + } + + // skip comment -- fix + if c != '/' { + break + } + lineno += skipcom() + } + + switch c { + case EOF: + if tokflag { + fmt.Printf(">>> ENDFILE %v\n", lineno) + } + return ENDFILE + + case '{': + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> ={ %v\n", lineno) + } + return '=' + + case '<': + // get, and look up, a type name (union member name) + c = getrune(finput) + for c != '>' && c != EOF && c != '\n' { + tokname += string(c) + c = getrune(finput) + } + + if c != '>' { + errorf("unterminated < ... > clause") + } + + for i = 1; i <= ntypes; i++ { + if typeset[i] == tokname { + numbval = i + if tokflag { + fmt.Printf(">>> TYPENAME old <%v> %v\n", tokname, lineno) + } + return TYPENAME + } + } + ntypes++ + numbval = ntypes + typeset[numbval] = tokname + if tokflag { + fmt.Printf(">>> TYPENAME new <%v> %v\n", tokname, lineno) + } + return TYPENAME + + case '"', '\'': + match = c + tokname = string(c) + for { + c = getrune(finput) + if c == '\n' || c == EOF { + errorf("illegal or missing ' or \"") + } + if c == '\\' { + tokname += string('\\') + c = getrune(finput) + } else if c == match { + if tokflag { + fmt.Printf(">>> IDENTIFIER \"%v\" %v\n", tokname, lineno) + } + tokname += string(c) + return IDENTIFIER + } + tokname += string(c) + } + + case '%': + c = getrune(finput) + switch c { + case '%': + if tokflag { + fmt.Printf(">>> MARK %%%% %v\n", lineno) + } + return MARK + case '=': + if tokflag { + fmt.Printf(">>> PREC %%= %v\n", lineno) + } + return PREC + case '{': + if tokflag { + fmt.Printf(">>> LCURLY %%{ %v\n", lineno) + } + return LCURLY + } + + getword(c) + // find a reserved word + for i := range resrv { + if tokname == resrv[i].name { + if tokflag { + fmt.Printf(">>> %%%v %v %v\n", tokname, + resrv[i].value-PRIVATE, lineno) + } + return resrv[i].value + } + } + errorf("invalid escape, or illegal reserved word: %v", tokname) + + case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9': + numbval = int(c - '0') + for { + c = getrune(finput) + if !isdigit(c) { + break + } + numbval = numbval*10 + int(c-'0') + } + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> NUMBER %v %v\n", numbval, lineno) + } + return NUMBER + + default: + if isword(c) || c == '.' || c == '$' { + getword(c) + break + } + if tokflag { + fmt.Printf(">>> OPERATOR %v %v\n", string(c), lineno) + } + return int(c) + } + + // look ahead to distinguish IDENTIFIER from IDENTCOLON + c = getrune(finput) + for c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\r' || c == '/' { + if c == '\n' { + peekline++ + } + // look for comments + if c == '/' { + peekline += skipcom() + } + c = getrune(finput) + } + if c == ':' { + if tokflag { + fmt.Printf(">>> IDENTCOLON %v: %v\n", tokname, lineno) + } + return IDENTCOLON + } + + ungetrune(finput, c) + if tokflag { + fmt.Printf(">>> IDENTIFIER %v %v\n", tokname, lineno) + } + return IDENTIFIER +} + +func getword(c rune) { + tokname = "" + for isword(c) || isdigit(c) || c == '.' || c == '$' { + tokname += string(c) + c = getrune(finput) + } + ungetrune(finput, c) +} + +// +// determine the type of a symbol +// +func fdtype(t int) (int, string) { + var v int + var s string + + if t >= NTBASE { + v = nontrst[t-NTBASE].value + s = nontrst[t-NTBASE].name + } else { + v = TYPE(toklev[t]) + s = tokset[t].name + } + return v, s +} + +func chfind(t int, s string) int { + if s[0] == '"' || s[0] == '\'' { + t = 0 + } + for i := 0; i <= ntokens; i++ { + if s == tokset[i].name { + return i + } + } + for i := 0; i <= nnonter; i++ { + if s == nontrst[i].name { + return NTBASE + i + } + } + + // cannot find name + if t > 1 { + errorf("%v should have been defined earlier", s) + } + return defin(t, s) +} + +const ( + startUnion = iota + skippingLeadingBlanks + readingMember + skippingLaterBlanks + readingType +) + +type gotypeinfo struct { + typename string + union bool +} + +var gotypes = make(map[string]*gotypeinfo) + +func typeinfo() { + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + fmt.Fprintf(ftable, "type %sSymType struct {", prefix) + for _, tt := range gotypes { + if tt.union { + fmt.Fprintf(ftable, "\n\tunion interface{}") + break + } + } + ftable.Write(ftypes.Bytes()) + fmt.Fprintf(ftable, "\n\tyys int") + fmt.Fprintf(ftable, "\n}\n\n") + + var sortedTypes []string + for member, tt := range gotypes { + if tt.union { + sortedTypes = append(sortedTypes, member) + } + } + sort.Strings(sortedTypes) + + for _, member := range sortedTypes { + tt := gotypes[member] + fmt.Fprintf(ftable, "\nfunc (st *%sSymType) %sUnion() %s {\n", prefix, member, tt.typename) + fmt.Fprintf(ftable, "\tv, _ := st.union.(%s)\n", tt.typename) + fmt.Fprintf(ftable, "\treturn v\n") + fmt.Fprintf(ftable, "}\n") + } +} + +// +// copy the union declaration to the output, and the define file if present +// +func parsetypes(union bool) { + var member, typ bytes.Buffer + state := startUnion + +out: + for { + c := getrune(finput) + if c == EOF { + errorf("EOF encountered while processing %%union") + } + switch c { + case '\n': + lineno++ + if state == readingType { + gotypes[member.String()] = &gotypeinfo{ + typename: typ.String(), + union: union, + } + if !union { + fmt.Fprintf(ftypes, "\n\t%s %s", member.Bytes(), typ.Bytes()) + } + member.Reset() + typ.Reset() + } + state = skippingLeadingBlanks + default: + switch state { + case skippingLeadingBlanks: + if c == ' ' || c == '\t' { + continue + } + if c == '}' { + break out + } + state = readingMember + member.WriteRune(c) + case readingMember: + if c == ' ' || c == '\t' { + state = skippingLaterBlanks + continue + } + member.WriteRune(c) + case skippingLaterBlanks: + if c == ' ' || c == '\t' { + continue + } + state = readingType + typ.WriteRune(c) + case readingType: + typ.WriteRune(c) + } + } + } +} + +// +// saves code between %{ and %} +// adds an import for __fmt__ the first time +// +func cpycode() { + lno := lineno + + c := getrune(finput) + if c == '\n' { + c = getrune(finput) + lineno++ + } + if !lflag { + fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno) + } + // accumulate until %} + code := make([]rune, 0, 1024) + for c != EOF { + if c == '%' { + c = getrune(finput) + if c == '}' { + emitcode(code, lno+1) + return + } + code = append(code, '%') + } + code = append(code, c) + if c == '\n' { + lineno++ + } + c = getrune(finput) + } + lineno = lno + errorf("eof before %%}") +} + +// +// emits code saved up from between %{ and %} +// called by cpycode +// adds an import for __yyfmt__ after the package clause +// +func emitcode(code []rune, lineno int) { + for i, line := range lines(code) { + writecode(line) + if !writtenImports && isPackageClause(line) { + fmt.Fprintln(ftable, `import (`) + fmt.Fprintln(ftable, `__yyfmt__ "fmt"`) + fmt.Fprintln(ftable, `__yyunsafe__ "unsafe"`) + fmt.Fprintln(ftable, `)`) + if !lflag { + fmt.Fprintf(ftable, "//line %v:%v\n\t\t", infile, lineno+i) + } + writtenImports = true + } + } +} + +// +// does this line look like a package clause? not perfect: might be confused by early comments. +// +func isPackageClause(line []rune) bool { + line = skipspace(line) + + // must be big enough. + if len(line) < len("package X\n") { + return false + } + + // must start with "package" + for i, r := range []rune("package") { + if line[i] != r { + return false + } + } + line = skipspace(line[len("package"):]) + + // must have another identifier. + if len(line) == 0 || (!unicode.IsLetter(line[0]) && line[0] != '_') { + return false + } + for len(line) > 0 { + if !unicode.IsLetter(line[0]) && !unicode.IsDigit(line[0]) && line[0] != '_' { + break + } + line = line[1:] + } + line = skipspace(line) + + // eol, newline, or comment must follow + if len(line) == 0 { + return true + } + if line[0] == '\r' || line[0] == '\n' { + return true + } + if len(line) >= 2 { + return line[0] == '/' && (line[1] == '/' || line[1] == '*') + } + return false +} + +// +// skip initial spaces +// +func skipspace(line []rune) []rune { + for len(line) > 0 { + if line[0] != ' ' && line[0] != '\t' { + break + } + line = line[1:] + } + return line +} + +// +// break code into lines +// +func lines(code []rune) [][]rune { + l := make([][]rune, 0, 100) + for len(code) > 0 { + // one line per loop + var i int + for i = range code { + if code[i] == '\n' { + break + } + } + l = append(l, code[:i+1]) + code = code[i+1:] + } + return l +} + +// +// writes code to ftable +// +func writecode(code []rune) { + for _, r := range code { + ftable.WriteRune(r) + } +} + +// +// skip over comments +// skipcom is called after reading a '/' +// +func skipcom() int { + c := getrune(finput) + if c == '/' { + for c != EOF { + if c == '\n' { + return 1 + } + c = getrune(finput) + } + errorf("EOF inside comment") + return 0 + } + if c != '*' { + errorf("illegal comment") + } + + nl := 0 // lines skipped + c = getrune(finput) + +l1: + switch c { + case '*': + c = getrune(finput) + if c == '/' { + break + } + goto l1 + + case '\n': + nl++ + fallthrough + + default: + c = getrune(finput) + goto l1 + } + return nl +} + +var fastAppendRe = regexp.MustCompile(`\s+append\(\$[$1],`) + +func cpyyvalaccess(fcode *bytes.Buffer, curprod []int, tok int, unionType *string) { + if ntypes == 0 { + fmt.Fprintf(fcode, "%sVAL", prefix) + return + } + + if tok < 0 { + tok, _ = fdtype(curprod[0]) + } + ti, ok := gotypes[typeset[tok]] + if !ok { + errorf("missing Go type information for %s", typeset[tok]) + } + if !ti.union { + fmt.Fprintf(fcode, "%sVAL.%s", prefix, typeset[tok]) + return + } + + var buf bytes.Buffer + lvalue := false + fastAppend := false + +loop: + for { + c := getrune(finput) + + switch c { + case ' ', '\t': + buf.WriteRune(c) + + case '=': + lvalue = true + if allowFastAppend && *unionType == "" { + peek, err := finput.Peek(16) + if err != nil { + errorf("failed to scan forward: %v", err) + } + match := fastAppendRe.Find(peek) + if len(match) > 0 { + fastAppend = true + for range match { + _ = getrune(finput) + } + } else { + buf.WriteRune(c) + } + break loop + } + + buf.WriteRune(c) + break loop + + default: + buf.WriteRune(c) + break loop + } + } + + if fastAppend { + fmt.Fprintf(fcode, "\t%sSLICE := (*%s)(%sIaddr(%sVAL.union))\n", prefix, ti.typename, prefix, prefix) + fmt.Fprintf(fcode, "\t*%sSLICE = append(*%sSLICE, ", prefix, prefix) + } else if lvalue { + fmt.Fprintf(fcode, "%sLOCAL", prefix) + *unionType = ti.typename + } else if *unionType == "" { + fmt.Fprintf(fcode, "%sVAL.%sUnion()", prefix, typeset[tok]) + } else { + fmt.Fprintf(fcode, "%sLOCAL", prefix) + } + fcode.Write(buf.Bytes()) +} + +// +// copy action to the next ; or closing } +// +func cpyact(fcode *bytes.Buffer, curprod []int, max int, unionType *string) { + if !lflag { + fmt.Fprintf(fcode, "\n//line %v:%v", infile, lineno) + } + fmt.Fprint(fcode, "\n\t\t") + + lno := lineno + brac := 0 + +loop: + for { + c := getrune(finput) + + swt: + switch c { + case ';': + if brac == 0 { + fcode.WriteRune(c) + return + } + + case '{': + brac++ + + case '$': + s := 1 + tok := -1 + c = getrune(finput) + + // type description + if c == '<' { + ungetrune(finput, c) + if gettok() != TYPENAME { + errorf("bad syntax on $ clause") + } + tok = numbval + c = getrune(finput) + } + if c == '$' { + cpyyvalaccess(fcode, curprod, tok, unionType) + continue loop + } + if c == '-' { + s = -s + c = getrune(finput) + } + j := 0 + if isdigit(c) { + for isdigit(c) { + j = j*10 + int(c-'0') + c = getrune(finput) + } + ungetrune(finput, c) + j = j * s + if j >= max { + errorf("Illegal use of $%v", j) + } + } else if isword(c) || c == '.' { + // look for $name + ungetrune(finput, c) + if gettok() != IDENTIFIER { + errorf("$ must be followed by an identifier") + } + tokn := chfind(2, tokname) + fnd := -1 + c = getrune(finput) + if c != '@' { + ungetrune(finput, c) + } else if gettok() != NUMBER { + errorf("@ must be followed by number") + } else { + fnd = numbval + } + for j = 1; j < max; j++ { + if tokn == curprod[j] { + fnd-- + if fnd <= 0 { + break + } + } + } + if j >= max { + errorf("$name or $name@number not found") + } + } else { + fcode.WriteRune('$') + if s < 0 { + fcode.WriteRune('-') + } + ungetrune(finput, c) + continue loop + } + fmt.Fprintf(fcode, "%sDollar[%v]", prefix, j) + + // put out the proper tag + if ntypes != 0 { + if j <= 0 && tok < 0 { + errorf("must specify type of $%v", j) + } + if tok < 0 { + tok, _ = fdtype(curprod[j]) + } + ti, ok := gotypes[typeset[tok]] + if !ok { + errorf("missing Go type information for %s", typeset[tok]) + } + if ti.union { + fmt.Fprintf(fcode, ".%sUnion()", typeset[tok]) + } else { + fmt.Fprintf(fcode, ".%s", typeset[tok]) + } + } + continue loop + + case '}': + brac-- + if brac != 0 { + break + } + fcode.WriteRune(c) + return + + case '/': + nc := getrune(finput) + if nc != '/' && nc != '*' { + ungetrune(finput, nc) + break + } + // a comment + fcode.WriteRune(c) + fcode.WriteRune(nc) + c = getrune(finput) + for c != EOF { + switch { + case c == '\n': + lineno++ + if nc == '/' { // end of // comment + break swt + } + case c == '*' && nc == '*': // end of /* comment? + nnc := getrune(finput) + if nnc == '/' { + fcode.WriteRune('*') + fcode.WriteRune('/') + continue loop + } + ungetrune(finput, nnc) + } + fcode.WriteRune(c) + c = getrune(finput) + } + errorf("EOF inside comment") + + case '\'', '"': + // character string or constant + match := c + fcode.WriteRune(c) + c = getrune(finput) + for c != EOF { + if c == '\\' { + fcode.WriteRune(c) + c = getrune(finput) + if c == '\n' { + lineno++ + } + } else if c == match { + break swt + } + if c == '\n' { + errorf("newline in string or char const") + } + fcode.WriteRune(c) + c = getrune(finput) + } + errorf("EOF in string or character constant") + + case EOF: + lineno = lno + errorf("action does not terminate") + + case '\n': + fmt.Fprint(fcode, "\n\t") + lineno++ + continue loop + } + + fcode.WriteRune(c) + } +} + +func openup() { + infile = flag.Arg(0) + finput = open(infile) + if finput == nil { + errorf("cannot open %v", infile) + } + + foutput = nil + if vflag != "" { + foutput = create(vflag) + if foutput == nil { + errorf("can't create file %v", vflag) + } + } + + ftable = nil + if oflag == "" { + oflag = "y.go" + } + ftable = create(oflag) + if ftable == nil { + errorf("can't create file %v", oflag) + } + +} + +// +// return a pointer to the name of symbol i +// +func symnam(i int) string { + var s string + + if i >= NTBASE { + s = nontrst[i-NTBASE].name + } else { + s = tokset[i].name + } + return s +} + +// +// set elements 0 through n-1 to c +// +func aryfil(v []int, n, c int) { + for i := 0; i < n; i++ { + v[i] = c + } +} + +// +// compute an array with the beginnings of productions yielding given nonterminals +// The array pres points to these lists +// the array pyield has the lists: the total size is only NPROD+1 +// +func cpres() { + pres = make([][][]int, nnonter+1) + curres := make([][]int, nprod) + + if false { + for j := 0; j <= nnonter; j++ { + fmt.Printf("nnonter[%v] = %v\n", j, nontrst[j].name) + } + for j := 0; j < nprod; j++ { + fmt.Printf("prdptr[%v][0] = %v+NTBASE\n", j, prdptr[j][0]-NTBASE) + } + } + + fatfl = 0 // make undefined symbols nonfatal + for i := 0; i <= nnonter; i++ { + n := 0 + c := i + NTBASE + for j := 0; j < nprod; j++ { + if prdptr[j][0] == c { + curres[n] = prdptr[j][1:] + n++ + } + } + if n == 0 { + errorf("nonterminal %v not defined", nontrst[i].name) + continue + } + pres[i] = make([][]int, n) + copy(pres[i], curres) + } + fatfl = 1 + if nerrors != 0 { + summary() + exit(1) + } +} + +// +// mark nonterminals which derive the empty string +// also, look for nonterminals which don't derive any token strings +// +func cempty() { + var i, p, np int + var prd []int + + pempty = make([]int, nnonter+1) + + // first, use the array pempty to detect productions that can never be reduced + // set pempty to WHONOWS + aryfil(pempty, nnonter+1, WHOKNOWS) + + // now, look at productions, marking nonterminals which derive something +more: + for { + for i = 0; i < nprod; i++ { + prd = prdptr[i] + if pempty[prd[0]-NTBASE] != 0 { + continue + } + np = len(prd) - 1 + for p = 1; p < np; p++ { + if prd[p] >= NTBASE && pempty[prd[p]-NTBASE] == WHOKNOWS { + break + } + } + // production can be derived + if p == np { + pempty[prd[0]-NTBASE] = OK + continue more + } + } + break + } + + // now, look at the nonterminals, to see if they are all OK + for i = 0; i <= nnonter; i++ { + // the added production rises or falls as the start symbol ... + if i == 0 { + continue + } + if pempty[i] != OK { + fatfl = 0 + errorf("nonterminal " + nontrst[i].name + " never derives any token string") + } + } + + if nerrors != 0 { + summary() + exit(1) + } + + // now, compute the pempty array, to see which nonterminals derive the empty string + // set pempty to WHOKNOWS + aryfil(pempty, nnonter+1, WHOKNOWS) + + // loop as long as we keep finding empty nonterminals + +again: + for { + next: + for i = 1; i < nprod; i++ { + // not known to be empty + prd = prdptr[i] + if pempty[prd[0]-NTBASE] != WHOKNOWS { + continue + } + np = len(prd) - 1 + for p = 1; p < np; p++ { + if prd[p] < NTBASE || pempty[prd[p]-NTBASE] != EMPTY { + continue next + } + } + + // we have a nontrivially empty nonterminal + pempty[prd[0]-NTBASE] = EMPTY + + // got one ... try for another + continue again + } + return + } +} + +// +// compute an array with the first of nonterminals +// +func cpfir() { + var s, n, p, np, ch, i int + var curres [][]int + var prd []int + + wsets = make([]Wset, nnonter+WSETINC) + pfirst = make([]Lkset, nnonter+1) + for i = 0; i <= nnonter; i++ { + wsets[i].ws = mkset() + pfirst[i] = mkset() + curres = pres[i] + n = len(curres) + + // initially fill the sets + for s = 0; s < n; s++ { + prd = curres[s] + np = len(prd) - 1 + for p = 0; p < np; p++ { + ch = prd[p] + if ch < NTBASE { + setbit(pfirst[i], ch) + break + } + if pempty[ch-NTBASE] == 0 { + break + } + } + } + } + + // now, reflect transitivity + changes := 1 + for changes != 0 { + changes = 0 + for i = 0; i <= nnonter; i++ { + curres = pres[i] + n = len(curres) + for s = 0; s < n; s++ { + prd = curres[s] + np = len(prd) - 1 + for p = 0; p < np; p++ { + ch = prd[p] - NTBASE + if ch < 0 { + break + } + changes |= setunion(pfirst[i], pfirst[ch]) + if pempty[ch] == 0 { + break + } + } + } + } + } + + if indebug == 0 { + return + } + if foutput != nil { + for i = 0; i <= nnonter; i++ { + fmt.Fprintf(foutput, "\n%v: %v %v\n", + nontrst[i].name, pfirst[i], pempty[i]) + } + } +} + +// +// generate the states +// +func stagen() { + // initialize + nstate = 0 + tstates = make([]int, ntokens+1) // states generated by terminal gotos + ntstates = make([]int, nnonter+1) // states generated by nonterminal gotos + amem = make([]int, ACTSIZE) + memp = 0 + + clset = mkset() + pstate[0] = 0 + pstate[1] = 0 + aryfil(clset, tbitset, 0) + putitem(Pitem{prdptr[0], 0, 0, 0}, clset) + tystate[0] = MUSTDO + nstate = 1 + pstate[2] = pstate[1] + + // + // now, the main state generation loop + // first pass generates all of the states + // later passes fix up lookahead + // could be sped up a lot by remembering + // results of the first pass rather than recomputing + // + first := 1 + for more := 1; more != 0; first = 0 { + more = 0 + for i := 0; i < nstate; i++ { + if tystate[i] != MUSTDO { + continue + } + + tystate[i] = DONE + aryfil(temp1, nnonter+1, 0) + + // take state i, close it, and do gotos + closure(i) + + // generate goto's + for p := 0; p < cwp; p++ { + pi := wsets[p] + if pi.flag != 0 { + continue + } + wsets[p].flag = 1 + c := pi.pitem.first + if c <= 1 { + if pstate[i+1]-pstate[i] <= p { + tystate[i] = MUSTLOOKAHEAD + } + continue + } + + // do a goto on c + putitem(wsets[p].pitem, wsets[p].ws) + for q := p + 1; q < cwp; q++ { + // this item contributes to the goto + if c == wsets[q].pitem.first { + putitem(wsets[q].pitem, wsets[q].ws) + wsets[q].flag = 1 + } + } + + if c < NTBASE { + state(c) // register new state + } else { + temp1[c-NTBASE] = state(c) + } + } + + if gsdebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "%v: ", i) + for j := 0; j <= nnonter; j++ { + if temp1[j] != 0 { + fmt.Fprintf(foutput, "%v %v,", nontrst[j].name, temp1[j]) + } + } + fmt.Fprintf(foutput, "\n") + } + + if first != 0 { + indgo[i] = apack(temp1[1:], nnonter-1) - 1 + } + + more++ + } + } +} + +// +// generate the closure of state i +// +func closure(i int) { + zzclose++ + + // first, copy kernel of state i to wsets + cwp = 0 + q := pstate[i+1] + for p := pstate[i]; p < q; p++ { + wsets[cwp].pitem = statemem[p].pitem + wsets[cwp].flag = 1 // this item must get closed + copy(wsets[cwp].ws, statemem[p].look) + cwp++ + } + + // now, go through the loop, closing each item + work := 1 + for work != 0 { + work = 0 + for u := 0; u < cwp; u++ { + if wsets[u].flag == 0 { + continue + } + + // dot is before c + c := wsets[u].pitem.first + if c < NTBASE { + wsets[u].flag = 0 + // only interesting case is where . is before nonterminal + continue + } + + // compute the lookahead + aryfil(clset, tbitset, 0) + + // find items involving c + for v := u; v < cwp; v++ { + if wsets[v].flag != 1 || wsets[v].pitem.first != c { + continue + } + pi := wsets[v].pitem.prod + ipi := wsets[v].pitem.off + 1 + + wsets[v].flag = 0 + if nolook != 0 { + continue + } + + ch := pi[ipi] + ipi++ + for ch > 0 { + // terminal symbol + if ch < NTBASE { + setbit(clset, ch) + break + } + + // nonterminal symbol + setunion(clset, pfirst[ch-NTBASE]) + if pempty[ch-NTBASE] == 0 { + break + } + ch = pi[ipi] + ipi++ + } + if ch <= 0 { + setunion(clset, wsets[v].ws) + } + } + + // + // now loop over productions derived from c + // + curres := pres[c-NTBASE] + n := len(curres) + + nexts: + // initially fill the sets + for s := 0; s < n; s++ { + prd := curres[s] + + // + // put these items into the closure + // is the item there + // + for v := 0; v < cwp; v++ { + // yes, it is there + if wsets[v].pitem.off == 0 && + aryeq(wsets[v].pitem.prod, prd) != 0 { + if nolook == 0 && + setunion(wsets[v].ws, clset) != 0 { + wsets[v].flag = 1 + work = 1 + } + continue nexts + } + } + + // not there; make a new entry + if cwp >= len(wsets) { + awsets := make([]Wset, cwp+WSETINC) + copy(awsets, wsets) + wsets = awsets + } + wsets[cwp].pitem = Pitem{prd, 0, prd[0], -prd[len(prd)-1]} + wsets[cwp].flag = 1 + wsets[cwp].ws = mkset() + if nolook == 0 { + work = 1 + copy(wsets[cwp].ws, clset) + } + cwp++ + } + } + } + + // have computed closure; flags are reset; return + if cldebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "\nState %v, nolook = %v\n", i, nolook) + for u := 0; u < cwp; u++ { + if wsets[u].flag != 0 { + fmt.Fprintf(foutput, "flag set\n") + } + wsets[u].flag = 0 + fmt.Fprintf(foutput, "\t%v", writem(wsets[u].pitem)) + prlook(wsets[u].ws) + fmt.Fprintf(foutput, "\n") + } + } +} + +// +// sorts last state,and sees if it equals earlier ones. returns state number +// +func state(c int) int { + zzstate++ + p1 := pstate[nstate] + p2 := pstate[nstate+1] + if p1 == p2 { + return 0 // null state + } + + // sort the items + var k, l int + for k = p1 + 1; k < p2; k++ { // make k the biggest + for l = k; l > p1; l-- { + if statemem[l].pitem.prodno < statemem[l-1].pitem.prodno || + statemem[l].pitem.prodno == statemem[l-1].pitem.prodno && + statemem[l].pitem.off < statemem[l-1].pitem.off { + s := statemem[l] + statemem[l] = statemem[l-1] + statemem[l-1] = s + } else { + break + } + } + } + + size1 := p2 - p1 // size of state + + var i int + if c >= NTBASE { + i = ntstates[c-NTBASE] + } else { + i = tstates[c] + } + +look: + for ; i != 0; i = mstates[i] { + // get ith state + q1 := pstate[i] + q2 := pstate[i+1] + size2 := q2 - q1 + if size1 != size2 { + continue + } + k = p1 + for l = q1; l < q2; l++ { + if aryeq(statemem[l].pitem.prod, statemem[k].pitem.prod) == 0 || + statemem[l].pitem.off != statemem[k].pitem.off { + continue look + } + k++ + } + + // found it + pstate[nstate+1] = pstate[nstate] // delete last state + + // fix up lookaheads + if nolook != 0 { + return i + } + k = p1 + for l = q1; l < q2; l++ { + if setunion(statemem[l].look, statemem[k].look) != 0 { + tystate[i] = MUSTDO + } + k++ + } + return i + } + + // state is new + zznewstate++ + if nolook != 0 { + errorf("yacc state/nolook error") + } + pstate[nstate+2] = p2 + if nstate+1 >= NSTATES { + errorf("too many states") + } + if c >= NTBASE { + mstates[nstate] = ntstates[c-NTBASE] + ntstates[c-NTBASE] = nstate + } else { + mstates[nstate] = tstates[c] + tstates[c] = nstate + } + tystate[nstate] = MUSTDO + nstate++ + return nstate - 1 +} + +func putitem(p Pitem, set Lkset) { + p.off++ + p.first = p.prod[p.off] + + if pidebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "putitem(%v), state %v\n", writem(p), nstate) + } + j := pstate[nstate+1] + if j >= len(statemem) { + asm := make([]Item, j+STATEINC) + copy(asm, statemem) + statemem = asm + } + statemem[j].pitem = p + if nolook == 0 { + s := mkset() + copy(s, set) + statemem[j].look = s + } + j++ + pstate[nstate+1] = j +} + +// +// creates output string for item pointed to by pp +// +func writem(pp Pitem) string { + var i int + + p := pp.prod + q := chcopy(nontrst[prdptr[pp.prodno][0]-NTBASE].name) + ": " + npi := pp.off + + pi := aryeq(p, prdptr[pp.prodno]) + + for { + c := ' ' + if pi == npi { + c = '.' + } + q += string(c) + + i = p[pi] + pi++ + if i <= 0 { + break + } + q += chcopy(symnam(i)) + } + + // an item calling for a reduction + i = p[npi] + if i < 0 { + q += fmt.Sprintf(" (%v)", -i) + } + + return q +} + +// +// pack state i from temp1 into amem +// +func apack(p []int, n int) int { + // + // we don't need to worry about checking because + // we will only look at entries known to be there... + // eliminate leading and trailing 0's + // + off := 0 + pp := 0 + for ; pp <= n && p[pp] == 0; pp++ { + off-- + } + + // no actions + if pp > n { + return 0 + } + for ; n > pp && p[n] == 0; n-- { + } + p = p[pp : n+1] + + // now, find a place for the elements from p to q, inclusive + r := len(amem) - len(p) + +nextk: + for rr := 0; rr <= r; rr++ { + qq := rr + for pp = 0; pp < len(p); pp++ { + if p[pp] != 0 { + if p[pp] != amem[qq] && amem[qq] != 0 { + continue nextk + } + } + qq++ + } + + // we have found an acceptable k + if pkdebug != 0 && foutput != nil { + fmt.Fprintf(foutput, "off = %v, k = %v\n", off+rr, rr) + } + qq = rr + for pp = 0; pp < len(p); pp++ { + if p[pp] != 0 { + if qq > memp { + memp = qq + } + amem[qq] = p[pp] + } + qq++ + } + if pkdebug != 0 && foutput != nil { + for pp = 0; pp <= memp; pp += 10 { + fmt.Fprintf(foutput, "\n") + for qq = pp; qq <= pp+9; qq++ { + fmt.Fprintf(foutput, "%v ", amem[qq]) + } + fmt.Fprintf(foutput, "\n") + } + } + return off + rr + } + errorf("no space in action table") + return 0 +} + +// +// print the output for the states +// +func output() { + var c, u, v int + + if !lflag { + fmt.Fprintf(ftable, "\n//line yacctab:1") + } + fmt.Fprintf(ftable, "\nvar %sExca = [...]int{\n", prefix) + + if len(errors) > 0 { + stateTable = make([]Row, nstate) + } + + noset := mkset() + + // output the stuff for state i + for i := 0; i < nstate; i++ { + nolook = 0 + if tystate[i] != MUSTLOOKAHEAD { + nolook = 1 + } + closure(i) + + // output actions + nolook = 1 + aryfil(temp1, ntokens+nnonter+1, 0) + for u = 0; u < cwp; u++ { + c = wsets[u].pitem.first + if c > 1 && c < NTBASE && temp1[c] == 0 { + for v = u; v < cwp; v++ { + if c == wsets[v].pitem.first { + putitem(wsets[v].pitem, noset) + } + } + temp1[c] = state(c) + } else if c > NTBASE { + c -= NTBASE + if temp1[c+ntokens] == 0 { + temp1[c+ntokens] = amem[indgo[i]+c] + } + } + } + if i == 1 { + temp1[1] = ACCEPTCODE + } + + // now, we have the shifts; look at the reductions + lastred = 0 + for u = 0; u < cwp; u++ { + c = wsets[u].pitem.first + + // reduction + if c > 0 { + continue + } + lastred = -c + us := wsets[u].ws + for k := 0; k <= ntokens; k++ { + if bitset(us, k) == 0 { + continue + } + if temp1[k] == 0 { + temp1[k] = c + } else if temp1[k] < 0 { // reduce/reduce conflict + if foutput != nil { + fmt.Fprintf(foutput, + "\n %v: reduce/reduce conflict (red'ns "+ + "%v and %v) on %v", + i, -temp1[k], lastred, symnam(k)) + } + if -temp1[k] > lastred { + temp1[k] = -lastred + } + zzrrconf++ + } else { + // potential shift/reduce conflict + precftn(lastred, k, i) + } + } + } + wract(i) + } + + fmt.Fprintf(ftable, "}\n") + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sPrivate = %v\n", prefix, PRIVATE) +} + +// +// decide a shift/reduce conflict by precedence. +// r is a rule number, t a token number +// the conflict is in state s +// temp1[t] is changed to reflect the action +// +func precftn(r, t, s int) { + var action int + + lp := levprd[r] + lt := toklev[t] + if PLEVEL(lt) == 0 || PLEVEL(lp) == 0 { + // conflict + if foutput != nil { + fmt.Fprintf(foutput, + "\n%v: shift/reduce conflict (shift %v(%v), red'n %v(%v)) on %v", + s, temp1[t], PLEVEL(lt), r, PLEVEL(lp), symnam(t)) + } + zzsrconf++ + return + } + if PLEVEL(lt) == PLEVEL(lp) { + action = ASSOC(lt) + } else if PLEVEL(lt) > PLEVEL(lp) { + action = RASC // shift + } else { + action = LASC + } // reduce + switch action { + case BASC: // error action + temp1[t] = ERRCODE + case LASC: // reduce + temp1[t] = -r + } +} + +// +// output state i +// temp1 has the actions, lastred the default +// +func wract(i int) { + var p, p1 int + + // find the best choice for lastred + lastred = 0 + ntimes := 0 + for j := 0; j <= ntokens; j++ { + if temp1[j] >= 0 { + continue + } + if temp1[j]+lastred == 0 { + continue + } + // count the number of appearances of temp1[j] + count := 0 + tred := -temp1[j] + levprd[tred] |= REDFLAG + for p = 0; p <= ntokens; p++ { + if temp1[p]+tred == 0 { + count++ + } + } + if count > ntimes { + lastred = tred + ntimes = count + } + } + + // + // for error recovery, arrange that, if there is a shift on the + // error recovery token, `error', that the default be the error action + // + if temp1[2] > 0 { + lastred = 0 + } + + // clear out entries in temp1 which equal lastred + // count entries in optst table + n := 0 + for p = 0; p <= ntokens; p++ { + p1 = temp1[p] + if p1+lastred == 0 { + temp1[p] = 0 + p1 = 0 + } + if p1 > 0 && p1 != ACCEPTCODE && p1 != ERRCODE { + n++ + } + } + + wrstate(i) + defact[i] = lastred + flag := 0 + os := make([]int, n*2) + n = 0 + for p = 0; p <= ntokens; p++ { + p1 = temp1[p] + if p1 != 0 { + if p1 < 0 { + p1 = -p1 + } else if p1 == ACCEPTCODE { + p1 = -1 + } else if p1 == ERRCODE { + p1 = 0 + } else { + os[n] = p + n++ + os[n] = p1 + n++ + zzacent++ + continue + } + if flag == 0 { + fmt.Fprintf(ftable, "\t-1, %v,\n", i) + } + flag++ + fmt.Fprintf(ftable, "\t%v, %v,\n", p, p1) + zzexcp++ + } + } + if flag != 0 { + defact[i] = -2 + fmt.Fprintf(ftable, "\t-2, %v,\n", lastred) + } + optst[i] = os +} + +// +// writes state i +// +func wrstate(i int) { + var j0, j1, u int + var pp, qq int + + if len(errors) > 0 { + actions := append([]int(nil), temp1...) + defaultAction := ERRCODE + if lastred != 0 { + defaultAction = -lastred + } + stateTable[i] = Row{actions, defaultAction} + } + + if foutput == nil { + return + } + fmt.Fprintf(foutput, "\nstate %v\n", i) + qq = pstate[i+1] + for pp = pstate[i]; pp < qq; pp++ { + fmt.Fprintf(foutput, "\t%v\n", writem(statemem[pp].pitem)) + } + if tystate[i] == MUSTLOOKAHEAD { + // print out empty productions in closure + for u = pstate[i+1] - pstate[i]; u < cwp; u++ { + if wsets[u].pitem.first < 0 { + fmt.Fprintf(foutput, "\t%v\n", writem(wsets[u].pitem)) + } + } + } + + // check for state equal to another + for j0 = 0; j0 <= ntokens; j0++ { + j1 = temp1[j0] + if j1 != 0 { + fmt.Fprintf(foutput, "\n\t%v ", symnam(j0)) + + // shift, error, or accept + if j1 > 0 { + if j1 == ACCEPTCODE { + fmt.Fprintf(foutput, "accept") + } else if j1 == ERRCODE { + fmt.Fprintf(foutput, "error") + } else { + fmt.Fprintf(foutput, "shift %v", j1) + } + } else { + fmt.Fprintf(foutput, "reduce %v (src line %v)", -j1, rlines[-j1]) + } + } + } + + // output the final production + if lastred != 0 { + fmt.Fprintf(foutput, "\n\t. reduce %v (src line %v)\n\n", + lastred, rlines[lastred]) + } else { + fmt.Fprintf(foutput, "\n\t. error\n\n") + } + + // now, output nonterminal actions + j1 = ntokens + for j0 = 1; j0 <= nnonter; j0++ { + j1++ + if temp1[j1] != 0 { + fmt.Fprintf(foutput, "\t%v goto %v\n", symnam(j0+NTBASE), temp1[j1]) + } + } +} + +// +// output the gotos for the nontermninals +// +func go2out() { + for i := 1; i <= nnonter; i++ { + go2gen(i) + + // find the best one to make default + best := -1 + times := 0 + + // is j the most frequent + for j := 0; j < nstate; j++ { + if tystate[j] == 0 { + continue + } + if tystate[j] == best { + continue + } + + // is tystate[j] the most frequent + count := 0 + cbest := tystate[j] + for k := j; k < nstate; k++ { + if tystate[k] == cbest { + count++ + } + } + if count > times { + best = cbest + times = count + } + } + + // best is now the default entry + zzgobest += times - 1 + n := 0 + for j := 0; j < nstate; j++ { + if tystate[j] != 0 && tystate[j] != best { + n++ + } + } + goent := make([]int, 2*n+1) + n = 0 + for j := 0; j < nstate; j++ { + if tystate[j] != 0 && tystate[j] != best { + goent[n] = j + n++ + goent[n] = tystate[j] + n++ + zzgoent++ + } + } + + // now, the default + if best == -1 { + best = 0 + } + + zzgoent++ + goent[n] = best + yypgo[i] = goent + } +} + +// +// output the gotos for nonterminal c +// +func go2gen(c int) { + var i, cc, p, q int + + // first, find nonterminals with gotos on c + aryfil(temp1, nnonter+1, 0) + temp1[c] = 1 + work := 1 + for work != 0 { + work = 0 + for i = 0; i < nprod; i++ { + // cc is a nonterminal with a goto on c + cc = prdptr[i][1] - NTBASE + if cc >= 0 && temp1[cc] != 0 { + // thus, the left side of production i does too + cc = prdptr[i][0] - NTBASE + if temp1[cc] == 0 { + work = 1 + temp1[cc] = 1 + } + } + } + } + + // now, we have temp1[c] = 1 if a goto on c in closure of cc + if g2debug != 0 && foutput != nil { + fmt.Fprintf(foutput, "%v: gotos on ", nontrst[c].name) + for i = 0; i <= nnonter; i++ { + if temp1[i] != 0 { + fmt.Fprintf(foutput, "%v ", nontrst[i].name) + } + } + fmt.Fprintf(foutput, "\n") + } + + // now, go through and put gotos into tystate + aryfil(tystate, nstate, 0) + for i = 0; i < nstate; i++ { + q = pstate[i+1] + for p = pstate[i]; p < q; p++ { + cc = statemem[p].pitem.first + if cc >= NTBASE { + // goto on c is possible + if temp1[cc-NTBASE] != 0 { + tystate[i] = amem[indgo[i]+c] + break + } + } + } + } +} + +// +// in order to free up the mem and amem arrays for the optimizer, +// and still be able to output yyr1, etc., after the sizes of +// the action array is known, we hide the nonterminals +// derived by productions in levprd. +// +func hideprod() { + nred := 0 + levprd[0] = 0 + for i := 1; i < nprod; i++ { + if (levprd[i] & REDFLAG) == 0 { + if foutput != nil { + fmt.Fprintf(foutput, "Rule not reduced: %v\n", + writem(Pitem{prdptr[i], 0, 0, i})) + } + fmt.Printf("rule %v never reduced\n", writem(Pitem{prdptr[i], 0, 0, i})) + nred++ + } + levprd[i] = prdptr[i][0] - NTBASE + } + if nred != 0 { + fmt.Printf("%v rules never reduced\n", nred) + } +} + +func callopt() { + var j, k, p, q, i int + var v []int + + pgo = make([]int, nnonter+1) + pgo[0] = 0 + maxoff = 0 + maxspr = 0 + for i = 0; i < nstate; i++ { + k = 32000 + j = 0 + v = optst[i] + q = len(v) + for p = 0; p < q; p += 2 { + if v[p] > j { + j = v[p] + } + if v[p] < k { + k = v[p] + } + } + + // nontrivial situation + if k <= j { + // j is now the range + // j -= k; // call scj + if k > maxoff { + maxoff = k + } + } + tystate[i] = q + 2*j + if j > maxspr { + maxspr = j + } + } + + // initialize ggreed table + ggreed = make([]int, nnonter+1) + for i = 1; i <= nnonter; i++ { + ggreed[i] = 1 + j = 0 + + // minimum entry index is always 0 + v = yypgo[i] + q = len(v) - 1 + for p = 0; p < q; p += 2 { + ggreed[i] += 2 + if v[p] > j { + j = v[p] + } + } + ggreed[i] = ggreed[i] + 2*j + if j > maxoff { + maxoff = j + } + } + + // now, prepare to put the shift actions into the amem array + for i = 0; i < ACTSIZE; i++ { + amem[i] = 0 + } + maxa = 0 + for i = 0; i < nstate; i++ { + if tystate[i] == 0 && adb > 1 { + fmt.Fprintf(ftable, "State %v: null\n", i) + } + indgo[i] = yyFlag + } + + i = nxti() + for i != NOMORE { + if i >= 0 { + stin(i) + } else { + gin(-i) + } + i = nxti() + } + + // print amem array + if adb > 2 { + for p = 0; p <= maxa; p += 10 { + fmt.Fprintf(ftable, "%v ", p) + for i = 0; i < 10; i++ { + fmt.Fprintf(ftable, "%v ", amem[p+i]) + } + ftable.WriteRune('\n') + } + } + + aoutput() + osummary() +} + +// +// finds the next i +// +func nxti() int { + max := 0 + maxi := 0 + for i := 1; i <= nnonter; i++ { + if ggreed[i] >= max { + max = ggreed[i] + maxi = -i + } + } + for i := 0; i < nstate; i++ { + if tystate[i] >= max { + max = tystate[i] + maxi = i + } + } + if max == 0 { + return NOMORE + } + return maxi +} + +func gin(i int) { + var s int + + // enter gotos on nonterminal i into array amem + ggreed[i] = 0 + + q := yypgo[i] + nq := len(q) - 1 + + // now, find amem place for it +nextgp: + for p := 0; p < ACTSIZE; p++ { + if amem[p] != 0 { + continue + } + for r := 0; r < nq; r += 2 { + s = p + q[r] + 1 + if s > maxa { + maxa = s + if maxa >= ACTSIZE { + errorf("a array overflow") + } + } + if amem[s] != 0 { + continue nextgp + } + } + + // we have found amem spot + amem[p] = q[nq] + if p > maxa { + maxa = p + } + for r := 0; r < nq; r += 2 { + s = p + q[r] + 1 + amem[s] = q[r+1] + } + pgo[i] = p + if adb > 1 { + fmt.Fprintf(ftable, "Nonterminal %v, entry at %v\n", i, pgo[i]) + } + return + } + errorf("cannot place goto %v\n", i) +} + +func stin(i int) { + var s int + + tystate[i] = 0 + + // enter state i into the amem array + q := optst[i] + nq := len(q) + +nextn: + // find an acceptable place + for n := -maxoff; n < ACTSIZE; n++ { + flag := 0 + for r := 0; r < nq; r += 2 { + s = q[r] + n + if s < 0 || s > ACTSIZE { + continue nextn + } + if amem[s] == 0 { + flag++ + } else if amem[s] != q[r+1] { + continue nextn + } + } + + // check the position equals another only if the states are identical + for j := 0; j < nstate; j++ { + if indgo[j] == n { + + // we have some disagreement + if flag != 0 { + continue nextn + } + if nq == len(optst[j]) { + + // states are equal + indgo[i] = n + if adb > 1 { + fmt.Fprintf(ftable, "State %v: entry at"+ + "%v equals state %v\n", + i, n, j) + } + return + } + + // we have some disagreement + continue nextn + } + } + + for r := 0; r < nq; r += 2 { + s = q[r] + n + if s > maxa { + maxa = s + } + if amem[s] != 0 && amem[s] != q[r+1] { + errorf("clobber of a array, pos'n %v, by %v", s, q[r+1]) + } + amem[s] = q[r+1] + } + indgo[i] = n + if adb > 1 { + fmt.Fprintf(ftable, "State %v: entry at %v\n", i, indgo[i]) + } + return + } + errorf("Error; failure to place state %v", i) +} + +// +// this version is for limbo +// write out the optimized parser +// +func aoutput() { + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "const %sLast = %v\n", prefix, maxa+1) + arout("Act", amem, maxa+1) + arout("Pact", indgo, nstate) + arout("Pgo", pgo, nnonter+1) +} + +// +// put out other arrays, copy the parsers +// +func others() { + var i, j int + + arout("R1", levprd, nprod) + aryfil(temp1, nprod, 0) + + // + //yyr2 is the number of rules for each production + // + for i = 1; i < nprod; i++ { + temp1[i] = len(prdptr[i]) - 2 + } + arout("R2", temp1, nprod) + + aryfil(temp1, nstate, -1000) + for i = 0; i <= ntokens; i++ { + for j := tstates[i]; j != 0; j = mstates[j] { + temp1[j] = i + } + } + for i = 0; i <= nnonter; i++ { + for j = ntstates[i]; j != 0; j = mstates[j] { + temp1[j] = -i + } + } + arout("Chk", temp1, nstate) + arout("Def", defact, nstate) + + // put out token translation tables + // table 1 has 0-256 + aryfil(temp1, 256, 0) + c := 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value + if j >= 0 && j < 256 { + if temp1[j] != 0 { + fmt.Print("yacc bug -- cannot have 2 different Ts with same value\n") + fmt.Printf(" %s and %s\n", tokset[i].name, tokset[temp1[j]].name) + nerrors++ + } + temp1[j] = i + if j > c { + c = j + } + } + } + for i = 0; i <= c; i++ { + if temp1[i] == 0 { + temp1[i] = YYLEXUNK + } + } + arout("Tok1", temp1, c+1) + + // table 2 has PRIVATE-PRIVATE+256 + aryfil(temp1, 256, 0) + c = 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value - PRIVATE + if j >= 0 && j < 256 { + if temp1[j] != 0 { + fmt.Print("yacc bug -- cannot have 2 different Ts with same value\n") + fmt.Printf(" %s and %s\n", tokset[i].name, tokset[temp1[j]].name) + nerrors++ + } + temp1[j] = i + if j > c { + c = j + } + } + } + arout("Tok2", temp1, c+1) + + // table 3 has everything else + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %sTok3 = [...]int{\n\t", prefix) + c = 0 + for i = 1; i <= ntokens; i++ { + j = tokset[i].value + if j >= 0 && j < 256 { + continue + } + if j >= PRIVATE && j < 256+PRIVATE { + continue + } + + if c%5 != 0 { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d, %d,", j, i) + c++ + if c%5 == 0 { + fmt.Fprint(ftable, "\n\t") + } + } + if c%5 != 0 { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d,\n}\n", 0) + + // Custom error messages. + fmt.Fprintf(ftable, "\n") + fmt.Fprintf(ftable, "var %sErrorMessages = [...]struct {\n", prefix) + fmt.Fprintf(ftable, "\tstate int\n") + fmt.Fprintf(ftable, "\ttoken int\n") + fmt.Fprintf(ftable, "\tmsg string\n") + fmt.Fprintf(ftable, "}{\n") + for _, error := range errors { + lineno = error.lineno + state, token := runMachine(error.tokens) + fmt.Fprintf(ftable, "\t{%v, %v, %s},\n", state, token, error.msg) + } + fmt.Fprintf(ftable, "}\n") + + // copy parser text + ch := getrune(finput) + for ch != EOF { + ftable.WriteRune(ch) + ch = getrune(finput) + } + + // copy yaccpar + if !lflag { + fmt.Fprintf(ftable, "\n//line yaccpar:1\n") + } + + parts := strings.SplitN(yaccpar, prefix+"run()", 2) + fmt.Fprintf(ftable, "%v", parts[0]) + ftable.Write(fcode.Bytes()) + fmt.Fprintf(ftable, "%v", parts[1]) +} + +func runMachine(tokens []string) (state, token int) { + var stack []int + i := 0 + token = -1 + +Loop: + if token < 0 { + token = chfind(2, tokens[i]) + i++ + } + + row := stateTable[state] + + c := token + if token >= NTBASE { + c = token - NTBASE + ntokens + } + action := row.actions[c] + if action == 0 { + action = row.defaultAction + } + + switch { + case action == ACCEPTCODE: + errorf("tokens are accepted") + return + case action == ERRCODE: + if token >= NTBASE { + errorf("error at non-terminal token %s", symnam(token)) + } + return + case action > 0: + // Shift to state action. + stack = append(stack, state) + state = action + token = -1 + goto Loop + default: + // Reduce by production -action. + prod := prdptr[-action] + if rhsLen := len(prod) - 2; rhsLen > 0 { + n := len(stack) - rhsLen + state = stack[n] + stack = stack[:n] + } + if token >= 0 { + i-- + } + token = prod[0] + goto Loop + } +} + +func arout(s string, v []int, n int) { + s = prefix + s + ftable.WriteRune('\n') + fmt.Fprintf(ftable, "var %v = [...]int{", s) + for i := 0; i < n; i++ { + if i%10 == 0 { + fmt.Fprintf(ftable, "\n\t") + } else { + ftable.WriteRune(' ') + } + fmt.Fprintf(ftable, "%d,", v[i]) + } + fmt.Fprintf(ftable, "\n}\n") +} + +// +// output the summary on y.output +// +func summary() { + if foutput != nil { + fmt.Fprintf(foutput, "\n%v terminals, %v nonterminals\n", ntokens, nnonter+1) + fmt.Fprintf(foutput, "%v grammar rules, %v/%v states\n", nprod, nstate, NSTATES) + fmt.Fprintf(foutput, "%v shift/reduce, %v reduce/reduce conflicts reported\n", zzsrconf, zzrrconf) + fmt.Fprintf(foutput, "%v working sets used\n", len(wsets)) + fmt.Fprintf(foutput, "memory: parser %v/%v\n", memp, ACTSIZE) + fmt.Fprintf(foutput, "%v extra closures\n", zzclose-2*nstate) + fmt.Fprintf(foutput, "%v shift entries, %v exceptions\n", zzacent, zzexcp) + fmt.Fprintf(foutput, "%v goto entries\n", zzgoent) + fmt.Fprintf(foutput, "%v entries saved by goto default\n", zzgobest) + } + if zzsrconf != 0 || zzrrconf != 0 { + fmt.Printf("\nconflicts: ") + if zzsrconf != 0 { + fmt.Printf("%v shift/reduce", zzsrconf) + } + if zzsrconf != 0 && zzrrconf != 0 { + fmt.Printf(", ") + } + if zzrrconf != 0 { + fmt.Printf("%v reduce/reduce", zzrrconf) + } + fmt.Printf("\n") + } +} + +// +// write optimizer summary +// +func osummary() { + if foutput == nil { + return + } + i := 0 + for p := maxa; p >= 0; p-- { + if amem[p] == 0 { + i++ + } + } + + fmt.Fprintf(foutput, "Optimizer space used: output %v/%v\n", maxa+1, ACTSIZE) + fmt.Fprintf(foutput, "%v table entries, %v zero\n", maxa+1, i) + fmt.Fprintf(foutput, "maximum spread: %v, maximum offset: %v\n", maxspr, maxoff) +} + +// +// copies and protects "'s in q +// +func chcopy(q string) string { + s := "" + i := 0 + j := 0 + for i = 0; i < len(q); i++ { + if q[i] == '"' { + s += q[j:i] + "\\" + j = i + } + } + return s + q[j:i] +} + +func usage() { + fmt.Fprintf(stderr, "usage: yacc [-o output] [-v parsetable] input\n") + exit(1) +} + +func bitset(set Lkset, bit int) int { return set[bit>>5] & (1 << uint(bit&31)) } + +func setbit(set Lkset, bit int) { set[bit>>5] |= (1 << uint(bit&31)) } + +func mkset() Lkset { return make([]int, tbitset) } + +// +// set a to the union of a and b +// return 1 if b is not a subset of a, 0 otherwise +// +func setunion(a, b []int) int { + sub := 0 + for i := 0; i < tbitset; i++ { + x := a[i] + y := x | b[i] + a[i] = y + if y != x { + sub = 1 + } + } + return sub +} + +func prlook(p Lkset) { + if p == nil { + fmt.Fprintf(foutput, "\tNULL") + return + } + fmt.Fprintf(foutput, " { ") + for j := 0; j <= ntokens; j++ { + if bitset(p, j) != 0 { + fmt.Fprintf(foutput, "%v ", symnam(j)) + } + } + fmt.Fprintf(foutput, "}") +} + +// +// utility routines +// +var peekrune rune + +func isdigit(c rune) bool { return c >= '0' && c <= '9' } + +func isword(c rune) bool { + return c >= 0xa0 || c == '_' || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') +} + +// +// return 1 if 2 arrays are equal +// return 0 if not equal +// +func aryeq(a []int, b []int) int { + n := len(a) + if len(b) != n { + return 0 + } + for ll := 0; ll < n; ll++ { + if a[ll] != b[ll] { + return 0 + } + } + return 1 +} + +func getrune(f *bufio.Reader) rune { + var r rune + + if peekrune != 0 { + if peekrune == EOF { + return EOF + } + r = peekrune + peekrune = 0 + return r + } + + c, n, err := f.ReadRune() + if n == 0 { + return EOF + } + if err != nil { + errorf("read error: %v", err) + } + //fmt.Printf("rune = %v n=%v\n", string(c), n); + return c +} + +func ungetrune(f *bufio.Reader, c rune) { + if f != finput { + panic("ungetc - not finput") + } + if peekrune != 0 { + panic("ungetc - 2nd unget") + } + peekrune = c +} + +func open(s string) *bufio.Reader { + fi, err := os.Open(s) + if err != nil { + errorf("error opening %v: %v", s, err) + } + //fmt.Printf("open %v\n", s); + return bufio.NewReader(fi) +} + +func create(s string) *bufio.Writer { + fo, err := os.Create(s) + if err != nil { + errorf("error creating %v: %v", s, err) + } + //fmt.Printf("create %v mode %v\n", s); + return bufio.NewWriter(fo) +} + +// +// write out error comment +// +func lerrorf(lineno int, s string, v ...interface{}) { + nerrors++ + fmt.Fprintf(stderr, s, v...) + fmt.Fprintf(stderr, ": %v:%v\n", infile, lineno) + if fatfl != 0 { + summary() + exit(1) + } +} + +func errorf(s string, v ...interface{}) { + lerrorf(lineno, s, v...) +} + +func exit(status int) { + if ftable != nil { + ftable.Flush() + ftable = nil + gofmt() + } + if foutput != nil { + foutput.Flush() + foutput = nil + } + if stderr != nil { + stderr.Flush() + stderr = nil + } + os.Exit(status) +} + +func gofmt() { + src, err := ioutil.ReadFile(oflag) + if err != nil { + return + } + src, err = format.Source(src) + if err != nil { + return + } + ioutil.WriteFile(oflag, src, 0666) +} + +var yaccpar string // will be processed version of yaccpartext: s/$$/prefix/g +var yaccpartext = ` +/* parser for yacc output */ + +func $$Iaddr(v interface{}) __yyunsafe__.Pointer { + type h struct { + t __yyunsafe__.Pointer + p __yyunsafe__.Pointer + } + return (*h)(__yyunsafe__.Pointer(&v)).p +} + +var ( + $$Debug = 0 + $$ErrorVerbose = false +) + +type $$Lexer interface { + Lex(lval *$$SymType) int + Error(s string) +} + +type $$Parser interface { + Parse($$Lexer) int + Lookahead() int +} + +type $$ParserImpl struct { + lval $$SymType + stack [$$InitialStackSize]$$SymType + char int +} + +func (p *$$ParserImpl) Lookahead() int { + return p.char +} + +func $$NewParser() $$Parser { + return &$$ParserImpl{} +} + +const $$Flag = -1000 + +func $$Tokname(c int) string { + if c >= 1 && c-1 < len($$Toknames) { + if $$Toknames[c-1] != "" { + return $$Toknames[c-1] + } + } + return __yyfmt__.Sprintf("tok-%v", c) +} + +func $$Statname(s int) string { + if s >= 0 && s < len($$Statenames) { + if $$Statenames[s] != "" { + return $$Statenames[s] + } + } + return __yyfmt__.Sprintf("state-%v", s) +} + +func $$ErrorMessage(state, lookAhead int) string { + const TOKSTART = 4 + + if !$$ErrorVerbose { + return "syntax error" + } + + for _, e := range $$ErrorMessages { + if e.state == state && e.token == lookAhead { + return "syntax error: " + e.msg + } + } + + res := "syntax error: unexpected " + $$Tokname(lookAhead) + + // To match Bison, suggest at most four expected tokens. + expected := make([]int, 0, 4) + + // Look for shiftable tokens. + base := $$Pact[state] + for tok := TOKSTART; tok-1 < len($$Toknames); tok++ { + if n := base + tok; n >= 0 && n < $$Last && $$Chk[$$Act[n]] == tok { + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + } + + if $$Def[state] == -2 { + i := 0 + for $$Exca[i] != -1 || $$Exca[i+1] != state { + i += 2 + } + + // Look for tokens that we accept or reduce. + for i += 2; $$Exca[i] >= 0; i += 2 { + tok := $$Exca[i] + if tok < TOKSTART || $$Exca[i+1] == 0 { + continue + } + if len(expected) == cap(expected) { + return res + } + expected = append(expected, tok) + } + + // If the default action is to accept or reduce, give up. + if $$Exca[i+1] != 0 { + return res + } + } + + for i, tok := range expected { + if i == 0 { + res += ", expecting " + } else { + res += " or " + } + res += $$Tokname(tok) + } + return res +} + +func $$lex1(lex $$Lexer, lval *$$SymType) (char, token int) { + token = 0 + char = lex.Lex(lval) + if char <= 0 { + token = $$Tok1[0] + goto out + } + if char < len($$Tok1) { + token = $$Tok1[char] + goto out + } + if char >= $$Private { + if char < $$Private+len($$Tok2) { + token = $$Tok2[char-$$Private] + goto out + } + } + for i := 0; i < len($$Tok3); i += 2 { + token = $$Tok3[i+0] + if token == char { + token = $$Tok3[i+1] + goto out + } + } + +out: + if token == 0 { + token = $$Tok2[1] /* unknown char */ + } + if $$Debug >= 3 { + __yyfmt__.Printf("lex %s(%d)\n", $$Tokname(token), uint(char)) + } + return char, token +} + +func $$Parse($$lex $$Lexer) int { + return $$NewParser().Parse($$lex) +} + +func ($$rcvr *$$ParserImpl) Parse($$lex $$Lexer) int { + var $$n int + var $$VAL $$SymType + var $$Dollar []$$SymType + _ = $$Dollar // silence set and not used + $$S := $$rcvr.stack[:] + + Nerrs := 0 /* number of errors */ + Errflag := 0 /* error recovery flag */ + $$state := 0 + $$rcvr.char = -1 + $$token := -1 // $$rcvr.char translated into internal numbering + defer func() { + // Make sure we report no lookahead when not parsing. + $$state = -1 + $$rcvr.char = -1 + $$token = -1 + }() + $$p := -1 + goto $$stack + +ret0: + return 0 + +ret1: + return 1 + +$$stack: + /* put a state and value onto the stack */ + if $$Debug >= 4 { + __yyfmt__.Printf("char %v in %v\n", $$Tokname($$token), $$Statname($$state)) + } + + $$p++ + if $$p >= len($$S) { + nyys := make([]$$SymType, len($$S)*2) + copy(nyys, $$S) + $$S = nyys + } + $$S[$$p] = $$VAL + $$S[$$p].yys = $$state + +$$newstate: + $$n = $$Pact[$$state] + if $$n <= $$Flag { + goto $$default /* simple state */ + } + if $$rcvr.char < 0 { + $$rcvr.char, $$token = $$lex1($$lex, &$$rcvr.lval) + } + $$n += $$token + if $$n < 0 || $$n >= $$Last { + goto $$default + } + $$n = $$Act[$$n] + if $$Chk[$$n] == $$token { /* valid shift */ + $$rcvr.char = -1 + $$token = -1 + $$VAL = $$rcvr.lval + $$state = $$n + if Errflag > 0 { + Errflag-- + } + goto $$stack + } + +$$default: + /* default state action */ + $$n = $$Def[$$state] + if $$n == -2 { + if $$rcvr.char < 0 { + $$rcvr.char, $$token = $$lex1($$lex, &$$rcvr.lval) + } + + /* look through exception table */ + xi := 0 + for { + if $$Exca[xi+0] == -1 && $$Exca[xi+1] == $$state { + break + } + xi += 2 + } + for xi += 2; ; xi += 2 { + $$n = $$Exca[xi+0] + if $$n < 0 || $$n == $$token { + break + } + } + $$n = $$Exca[xi+1] + if $$n < 0 { + goto ret0 + } + } + if $$n == 0 { + /* error ... attempt to resume parsing */ + switch Errflag { + case 0: /* brand new error */ + $$lex.Error($$ErrorMessage($$state, $$token)) + Nerrs++ + if $$Debug >= 1 { + __yyfmt__.Printf("%s", $$Statname($$state)) + __yyfmt__.Printf(" saw %s\n", $$Tokname($$token)) + } + fallthrough + + case 1, 2: /* incompletely recovered error ... try again */ + Errflag = 3 + + /* find a state where "error" is a legal shift action */ + for $$p >= 0 { + $$n = $$Pact[$$S[$$p].yys] + $$ErrCode + if $$n >= 0 && $$n < $$Last { + $$state = $$Act[$$n] /* simulate a shift of "error" */ + if $$Chk[$$state] == $$ErrCode { + goto $$stack + } + } + + /* the current p has no shift on "error", pop stack */ + if $$Debug >= 2 { + __yyfmt__.Printf("error recovery pops state %d\n", $$S[$$p].yys) + } + $$p-- + } + /* there is no state on the stack with an error shift ... abort */ + goto ret1 + + case 3: /* no shift yet; clobber input char */ + if $$Debug >= 2 { + __yyfmt__.Printf("error recovery discards %s\n", $$Tokname($$token)) + } + if $$token == $$EofCode { + goto ret1 + } + $$rcvr.char = -1 + $$token = -1 + goto $$newstate /* try again in the same state */ + } + } + + /* reduction by production $$n */ + if $$Debug >= 2 { + __yyfmt__.Printf("reduce %v in:\n\t%v\n", $$n, $$Statname($$state)) + } + + $$nt := $$n + $$pt := $$p + _ = $$pt // guard against "declared and not used" + + $$p -= $$R2[$$n] + // $$p is now the index of $0. Perform the default action. Iff the + // reduced production is ε, $1 is possibly out of range. + if $$p+1 >= len($$S) { + nyys := make([]$$SymType, len($$S)*2) + copy(nyys, $$S) + $$S = nyys + } + $$VAL = $$S[$$p+1] + + /* consult goto table to find next state */ + $$n = $$R1[$$n] + $$g := $$Pgo[$$n] + $$j := $$g + $$S[$$p].yys + 1 + + if $$j >= $$Last { + $$state = $$Act[$$g] + } else { + $$state = $$Act[$$j] + if $$Chk[$$state] != -$$n { + $$state = $$Act[$$g] + } + } + // dummy call; replaced with literal code + $$run() + goto $$stack /* stack new state and value */ +} +` diff --git a/go/vt/sqlparser/parser.go b/go/vt/sqlparser/parser.go index cb5cf06605c..92892ada7a1 100644 --- a/go/vt/sqlparser/parser.go +++ b/go/vt/sqlparser/parser.go @@ -28,36 +28,27 @@ import ( ) // parserPool is a pool for parser objects. -var parserPool = sync.Pool{} +var parserPool = sync.Pool{ + New: func() interface{} { + return &yyParserImpl{} + }, +} // zeroParser is a zero-initialized parser to help reinitialize the parser for pooling. -var zeroParser = *(yyNewParser().(*yyParserImpl)) +var zeroParser yyParserImpl // MySQLVersion is the version of MySQL that the parser would emulate var MySQLVersion string = "50709" // yyParsePooled is a wrapper around yyParse that pools the parser objects. There isn't a -// particularly good reason to use yyParse directly, since it immediately discards its parser. What -// would be ideal down the line is to actually pool the stacks themselves rather than the parser -// objects, as per https://github.com/cznic/goyacc/blob/master/main.go. However, absent an upstream -// change to goyacc, this is the next best option. +// particularly good reason to use yyParse directly, since it immediately discards its parser. // // N.B: Parser pooling means that you CANNOT take references directly to parse stack variables (e.g. // $$ = &$4) in sql.y rules. You must instead add an intermediate reference like so: // showCollationFilterOpt := $4 // $$ = &Show{Type: string($2), ShowCollationFilterOpt: &showCollationFilterOpt} func yyParsePooled(yylex yyLexer) int { - // Being very particular about using the base type and not an interface type b/c we depend on - // the implementation to know how to reinitialize the parser. - var parser *yyParserImpl - - i := parserPool.Get() - if i != nil { - parser = i.(*yyParserImpl) - } else { - parser = yyNewParser().(*yyParserImpl) - } - + parser := parserPool.Get().(*yyParserImpl) defer func() { *parser = zeroParser parserPool.Put(parser) diff --git a/go/vt/sqlparser/sql.go b/go/vt/sqlparser/sql.go index e2731b8c886..6a7a4f6760e 100644 --- a/go/vt/sqlparser/sql.go +++ b/go/vt/sqlparser/sql.go @@ -1,9 +1,12 @@ -// Code generated by goyacc -o sql.go sql.y. DO NOT EDIT. +// Code generated by goyacc -fast-append -o sql.go sql.y. DO NOT EDIT. //line sql.y:18 package sqlparser -import __yyfmt__ "fmt" +import ( + __yyfmt__ "fmt" + __yyunsafe__ "unsafe" +) //line sql.y:18 @@ -38,105 +41,6 @@ func skipToEnd(yylex interface{}) { yylex.(*Tokenizer).SkipToEnd = true } -//line sql.y:53 -type yySymType struct { - yys int - empty struct{} - statement Statement - selStmt SelectStatement - ins *Insert - byt byte - str string - strs []string - selectExprs SelectExprs - selectExpr SelectExpr - columns Columns - partitions Partitions - colName *ColName - tableExprs TableExprs - tableExpr TableExpr - joinCondition JoinCondition - tableName TableName - tableNames TableNames - indexHints *IndexHints - expr Expr - exprs Exprs - boolVal BoolVal - boolean bool - literal *Literal - colTuple ColTuple - values Values - valTuple ValTuple - subquery *Subquery - derivedTable *DerivedTable - whens []*When - when *When - orderBy OrderBy - order *Order - limit *Limit - updateExprs UpdateExprs - setExprs SetExprs - updateExpr *UpdateExpr - setExpr *SetExpr - characteristic Characteristic - characteristics []Characteristic - colIdent ColIdent - tableIdent TableIdent - convertType *ConvertType - aliasedTableName *AliasedTableExpr - TableSpec *TableSpec - columnType ColumnType - colKeyOpt ColumnKeyOption - optVal Expr - LengthScaleOption LengthScaleOption - columnDefinition *ColumnDefinition - columnDefinitions []*ColumnDefinition - indexDefinition *IndexDefinition - indexInfo *IndexInfo - indexOption *IndexOption - indexOptions []*IndexOption - indexColumn *IndexColumn - indexColumns []*IndexColumn - constraintDefinition *ConstraintDefinition - constraintInfo ConstraintInfo - ReferenceAction ReferenceAction - partDefs []*PartitionDefinition - partDef *PartitionDefinition - partSpec *PartitionSpec - partSpecs []*PartitionSpec - vindexParam VindexParam - vindexParams []VindexParam - showFilter *ShowFilter - optLike *OptLike - isolationLevel IsolationLevel - insertAction InsertAction - scope Scope - ignore Ignore - lock Lock - joinType JoinType - comparisonExprOperator ComparisonExprOperator - isExprOperator IsExprOperator - matchExprOption MatchExprOption - orderDirection OrderDirection - explainType ExplainType - selectInto *SelectInto - createDatabase *CreateDatabase - alterDatabase *AlterDatabase - collateAndCharset CollateAndCharset - collateAndCharsets []CollateAndCharset - createTable *CreateTable - tableAndLockTypes []*TableAndLockType - tableAndLockType *TableAndLockType - lockType LockType - alterTable *AlterTable - alterOption AlterOption - alterOptions []AlterOption - tableOption *TableOption - tableOptions TableOptions - renameTablePairs []*RenameTablePair - columnTypeOptions *ColumnTypeOptions -} - const LEX_ERROR = 57346 const UNION = 57347 const SELECT = 57348 @@ -4232,6 +4136,433 @@ var yyPgo = [...]int{ 133, } +//line sql.y:5133 +type yySymType struct { + union interface{} + empty struct{} + LengthScaleOption LengthScaleOption + tableName TableName + tableIdent TableIdent + str string + strs []string + vindexParam VindexParam + colIdent ColIdent + joinCondition JoinCondition + collateAndCharset CollateAndCharset + columnType ColumnType + yys int +} + +func (st *yySymType) ReferenceActionUnion() ReferenceAction { + v, _ := st.union.(ReferenceAction) + return v +} + +func (st *yySymType) aliasedTableNameUnion() *AliasedTableExpr { + v, _ := st.union.(*AliasedTableExpr) + return v +} + +func (st *yySymType) alterDatabaseUnion() *AlterDatabase { + v, _ := st.union.(*AlterDatabase) + return v +} + +func (st *yySymType) alterOptionUnion() AlterOption { + v, _ := st.union.(AlterOption) + return v +} + +func (st *yySymType) alterOptionsUnion() []AlterOption { + v, _ := st.union.([]AlterOption) + return v +} + +func (st *yySymType) alterTableUnion() *AlterTable { + v, _ := st.union.(*AlterTable) + return v +} + +func (st *yySymType) boolValUnion() BoolVal { + v, _ := st.union.(BoolVal) + return v +} + +func (st *yySymType) booleanUnion() bool { + v, _ := st.union.(bool) + return v +} + +func (st *yySymType) characteristicUnion() Characteristic { + v, _ := st.union.(Characteristic) + return v +} + +func (st *yySymType) characteristicsUnion() []Characteristic { + v, _ := st.union.([]Characteristic) + return v +} + +func (st *yySymType) colKeyOptUnion() ColumnKeyOption { + v, _ := st.union.(ColumnKeyOption) + return v +} + +func (st *yySymType) colNameUnion() *ColName { + v, _ := st.union.(*ColName) + return v +} + +func (st *yySymType) colTupleUnion() ColTuple { + v, _ := st.union.(ColTuple) + return v +} + +func (st *yySymType) collateAndCharsetsUnion() []CollateAndCharset { + v, _ := st.union.([]CollateAndCharset) + return v +} + +func (st *yySymType) columnDefinitionUnion() *ColumnDefinition { + v, _ := st.union.(*ColumnDefinition) + return v +} + +func (st *yySymType) columnDefinitionsUnion() []*ColumnDefinition { + v, _ := st.union.([]*ColumnDefinition) + return v +} + +func (st *yySymType) columnTypeOptionsUnion() *ColumnTypeOptions { + v, _ := st.union.(*ColumnTypeOptions) + return v +} + +func (st *yySymType) columnsUnion() Columns { + v, _ := st.union.(Columns) + return v +} + +func (st *yySymType) comparisonExprOperatorUnion() ComparisonExprOperator { + v, _ := st.union.(ComparisonExprOperator) + return v +} + +func (st *yySymType) constraintDefinitionUnion() *ConstraintDefinition { + v, _ := st.union.(*ConstraintDefinition) + return v +} + +func (st *yySymType) constraintInfoUnion() ConstraintInfo { + v, _ := st.union.(ConstraintInfo) + return v +} + +func (st *yySymType) convertTypeUnion() *ConvertType { + v, _ := st.union.(*ConvertType) + return v +} + +func (st *yySymType) createDatabaseUnion() *CreateDatabase { + v, _ := st.union.(*CreateDatabase) + return v +} + +func (st *yySymType) createTableUnion() *CreateTable { + v, _ := st.union.(*CreateTable) + return v +} + +func (st *yySymType) derivedTableUnion() *DerivedTable { + v, _ := st.union.(*DerivedTable) + return v +} + +func (st *yySymType) explainTypeUnion() ExplainType { + v, _ := st.union.(ExplainType) + return v +} + +func (st *yySymType) exprUnion() Expr { + v, _ := st.union.(Expr) + return v +} + +func (st *yySymType) exprsUnion() Exprs { + v, _ := st.union.(Exprs) + return v +} + +func (st *yySymType) ignoreUnion() Ignore { + v, _ := st.union.(Ignore) + return v +} + +func (st *yySymType) indexColumnUnion() *IndexColumn { + v, _ := st.union.(*IndexColumn) + return v +} + +func (st *yySymType) indexColumnsUnion() []*IndexColumn { + v, _ := st.union.([]*IndexColumn) + return v +} + +func (st *yySymType) indexDefinitionUnion() *IndexDefinition { + v, _ := st.union.(*IndexDefinition) + return v +} + +func (st *yySymType) indexHintsUnion() *IndexHints { + v, _ := st.union.(*IndexHints) + return v +} + +func (st *yySymType) indexInfoUnion() *IndexInfo { + v, _ := st.union.(*IndexInfo) + return v +} + +func (st *yySymType) indexOptionUnion() *IndexOption { + v, _ := st.union.(*IndexOption) + return v +} + +func (st *yySymType) indexOptionsUnion() []*IndexOption { + v, _ := st.union.([]*IndexOption) + return v +} + +func (st *yySymType) insUnion() *Insert { + v, _ := st.union.(*Insert) + return v +} + +func (st *yySymType) insertActionUnion() InsertAction { + v, _ := st.union.(InsertAction) + return v +} + +func (st *yySymType) isExprOperatorUnion() IsExprOperator { + v, _ := st.union.(IsExprOperator) + return v +} + +func (st *yySymType) isolationLevelUnion() IsolationLevel { + v, _ := st.union.(IsolationLevel) + return v +} + +func (st *yySymType) joinTypeUnion() JoinType { + v, _ := st.union.(JoinType) + return v +} + +func (st *yySymType) limitUnion() *Limit { + v, _ := st.union.(*Limit) + return v +} + +func (st *yySymType) literalUnion() *Literal { + v, _ := st.union.(*Literal) + return v +} + +func (st *yySymType) lockUnion() Lock { + v, _ := st.union.(Lock) + return v +} + +func (st *yySymType) lockTypeUnion() LockType { + v, _ := st.union.(LockType) + return v +} + +func (st *yySymType) matchExprOptionUnion() MatchExprOption { + v, _ := st.union.(MatchExprOption) + return v +} + +func (st *yySymType) optLikeUnion() *OptLike { + v, _ := st.union.(*OptLike) + return v +} + +func (st *yySymType) optValUnion() Expr { + v, _ := st.union.(Expr) + return v +} + +func (st *yySymType) orderUnion() *Order { + v, _ := st.union.(*Order) + return v +} + +func (st *yySymType) orderByUnion() OrderBy { + v, _ := st.union.(OrderBy) + return v +} + +func (st *yySymType) orderDirectionUnion() OrderDirection { + v, _ := st.union.(OrderDirection) + return v +} + +func (st *yySymType) partDefUnion() *PartitionDefinition { + v, _ := st.union.(*PartitionDefinition) + return v +} + +func (st *yySymType) partDefsUnion() []*PartitionDefinition { + v, _ := st.union.([]*PartitionDefinition) + return v +} + +func (st *yySymType) partSpecUnion() *PartitionSpec { + v, _ := st.union.(*PartitionSpec) + return v +} + +func (st *yySymType) partSpecsUnion() []*PartitionSpec { + v, _ := st.union.([]*PartitionSpec) + return v +} + +func (st *yySymType) partitionsUnion() Partitions { + v, _ := st.union.(Partitions) + return v +} + +func (st *yySymType) renameTablePairsUnion() []*RenameTablePair { + v, _ := st.union.([]*RenameTablePair) + return v +} + +func (st *yySymType) scopeUnion() Scope { + v, _ := st.union.(Scope) + return v +} + +func (st *yySymType) selStmtUnion() SelectStatement { + v, _ := st.union.(SelectStatement) + return v +} + +func (st *yySymType) selectExprUnion() SelectExpr { + v, _ := st.union.(SelectExpr) + return v +} + +func (st *yySymType) selectExprsUnion() SelectExprs { + v, _ := st.union.(SelectExprs) + return v +} + +func (st *yySymType) selectIntoUnion() *SelectInto { + v, _ := st.union.(*SelectInto) + return v +} + +func (st *yySymType) setExprUnion() *SetExpr { + v, _ := st.union.(*SetExpr) + return v +} + +func (st *yySymType) setExprsUnion() SetExprs { + v, _ := st.union.(SetExprs) + return v +} + +func (st *yySymType) showFilterUnion() *ShowFilter { + v, _ := st.union.(*ShowFilter) + return v +} + +func (st *yySymType) statementUnion() Statement { + v, _ := st.union.(Statement) + return v +} + +func (st *yySymType) subqueryUnion() *Subquery { + v, _ := st.union.(*Subquery) + return v +} + +func (st *yySymType) tableAndLockTypeUnion() *TableAndLockType { + v, _ := st.union.(*TableAndLockType) + return v +} + +func (st *yySymType) tableAndLockTypesUnion() TableAndLockTypes { + v, _ := st.union.(TableAndLockTypes) + return v +} + +func (st *yySymType) tableExprUnion() TableExpr { + v, _ := st.union.(TableExpr) + return v +} + +func (st *yySymType) tableExprsUnion() TableExprs { + v, _ := st.union.(TableExprs) + return v +} + +func (st *yySymType) tableNamesUnion() TableNames { + v, _ := st.union.(TableNames) + return v +} + +func (st *yySymType) tableOptionUnion() *TableOption { + v, _ := st.union.(*TableOption) + return v +} + +func (st *yySymType) tableOptionsUnion() TableOptions { + v, _ := st.union.(TableOptions) + return v +} + +func (st *yySymType) tableSpecUnion() *TableSpec { + v, _ := st.union.(*TableSpec) + return v +} + +func (st *yySymType) updateExprUnion() *UpdateExpr { + v, _ := st.union.(*UpdateExpr) + return v +} + +func (st *yySymType) updateExprsUnion() UpdateExprs { + v, _ := st.union.(UpdateExprs) + return v +} + +func (st *yySymType) valTupleUnion() ValTuple { + v, _ := st.union.(ValTuple) + return v +} + +func (st *yySymType) valuesUnion() Values { + v, _ := st.union.(Values) + return v +} + +func (st *yySymType) vindexParamsUnion() []VindexParam { + v, _ := st.union.([]VindexParam) + return v +} + +func (st *yySymType) whenUnion() *When { + v, _ := st.union.(*When) + return v +} + +func (st *yySymType) whensUnion() []*When { + v, _ := st.union.([]*When) + return v +} + var yyR1 = [...]int{ 0, 274, 275, 275, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -5061,6 +5392,14 @@ var yyErrorMessages = [...]struct { /* parser for yacc output */ +func yyIaddr(v interface{}) __yyunsafe__.Pointer { + type h struct { + t __yyunsafe__.Pointer + p __yyunsafe__.Pointer + } + return (*h)(__yyunsafe__.Pointer(&v)).p +} + var ( yyDebug = 0 yyErrorVerbose = false @@ -5390,828 +5729,1002 @@ yydefault: case 1: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:407 +//line sql.y:413 { - setParseTree(yylex, yyDollar[1].statement) + setParseTree(yylex, yyDollar[1].statementUnion()) } case 2: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:412 +//line sql.y:418 { } case 3: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:413 +//line sql.y:419 { } case 4: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:417 + var yyLOCAL Statement +//line sql.y:423 { - yyVAL.statement = yyDollar[1].selStmt + yyLOCAL = yyDollar[1].selStmtUnion() } + yyVAL.union = yyLOCAL case 33: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:449 +//line sql.y:455 { setParseTree(yylex, nil) } case 34: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:455 +//line sql.y:461 { yyVAL.colIdent = NewColIdentWithAt(string(yyDollar[1].str), NoAt) } case 35: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:459 +//line sql.y:465 { yyVAL.colIdent = NewColIdentWithAt(string(yyDollar[1].str), SingleAt) } case 36: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:463 +//line sql.y:469 { yyVAL.colIdent = NewColIdentWithAt(string(yyDollar[1].str), DoubleAt) } case 37: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:468 +//line sql.y:474 { yyVAL.colIdent = NewColIdentWithAt("", NoAt) } case 38: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:472 +//line sql.y:478 { yyVAL.colIdent = yyDollar[1].colIdent } case 39: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:478 + var yyLOCAL Statement +//line sql.y:484 { - yyVAL.statement = &OtherAdmin{} + yyLOCAL = &OtherAdmin{} } + yyVAL.union = yyLOCAL case 40: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:484 + var yyLOCAL Statement +//line sql.y:490 { - yyVAL.statement = &Load{} + yyLOCAL = &Load{} } + yyVAL.union = yyLOCAL case 41: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:490 + var yyLOCAL SelectStatement +//line sql.y:496 { - sel := yyDollar[1].selStmt.(*Select) - sel.OrderBy = yyDollar[2].orderBy - sel.Limit = yyDollar[3].limit - sel.Lock = yyDollar[4].lock - sel.Into = yyDollar[5].selectInto - yyVAL.selStmt = sel + sel := yyDollar[1].selStmtUnion().(*Select) + sel.OrderBy = yyDollar[2].orderByUnion() + sel.Limit = yyDollar[3].limitUnion() + sel.Lock = yyDollar[4].lockUnion() + sel.Into = yyDollar[5].selectIntoUnion() + yyLOCAL = sel } + yyVAL.union = yyLOCAL case 42: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:499 + var yyLOCAL SelectStatement +//line sql.y:505 { - yyVAL.selStmt = &Union{FirstStatement: &ParenSelect{Select: yyDollar[2].selStmt}, OrderBy: yyDollar[4].orderBy, Limit: yyDollar[5].limit, Lock: yyDollar[6].lock} + yyLOCAL = &Union{FirstStatement: &ParenSelect{Select: yyDollar[2].selStmtUnion()}, OrderBy: yyDollar[4].orderByUnion(), Limit: yyDollar[5].limitUnion(), Lock: yyDollar[6].lockUnion()} } + yyVAL.union = yyLOCAL case 43: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:503 + var yyLOCAL SelectStatement +//line sql.y:509 { - yyVAL.selStmt = Unionize(yyDollar[1].selStmt, yyDollar[3].selStmt, yyDollar[2].boolean, yyDollar[4].orderBy, yyDollar[5].limit, yyDollar[6].lock) + yyLOCAL = Unionize(yyDollar[1].selStmtUnion(), yyDollar[3].selStmtUnion(), yyDollar[2].booleanUnion(), yyDollar[4].orderByUnion(), yyDollar[5].limitUnion(), yyDollar[6].lockUnion()) } + yyVAL.union = yyLOCAL case 44: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:507 + var yyLOCAL SelectStatement +//line sql.y:513 { - yyVAL.selStmt = NewSelect(Comments(yyDollar[2].strs), SelectExprs{&Nextval{Expr: yyDollar[5].expr}}, []string{yyDollar[3].str} /*options*/, TableExprs{&AliasedTableExpr{Expr: yyDollar[7].tableName}}, nil /*where*/, nil /*groupBy*/, nil /*having*/) + yyLOCAL = NewSelect(Comments(yyDollar[2].strs), SelectExprs{&Nextval{Expr: yyDollar[5].exprUnion()}}, []string{yyDollar[3].str} /*options*/, TableExprs{&AliasedTableExpr{Expr: yyDollar[7].tableName}}, nil /*where*/, nil /*groupBy*/, nil /*having*/) } + yyVAL.union = yyLOCAL case 45: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:530 + var yyLOCAL SelectStatement +//line sql.y:536 { - sel := yyDollar[1].selStmt.(*Select) - sel.OrderBy = yyDollar[2].orderBy - sel.Limit = yyDollar[3].limit - sel.Lock = yyDollar[4].lock - yyVAL.selStmt = sel + sel := yyDollar[1].selStmtUnion().(*Select) + sel.OrderBy = yyDollar[2].orderByUnion() + sel.Limit = yyDollar[3].limitUnion() + sel.Lock = yyDollar[4].lockUnion() + yyLOCAL = sel } + yyVAL.union = yyLOCAL case 46: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:538 + var yyLOCAL SelectStatement +//line sql.y:544 { - yyVAL.selStmt = Unionize(yyDollar[1].selStmt, yyDollar[3].selStmt, yyDollar[2].boolean, yyDollar[4].orderBy, yyDollar[5].limit, yyDollar[6].lock) + yyLOCAL = Unionize(yyDollar[1].selStmtUnion(), yyDollar[3].selStmtUnion(), yyDollar[2].booleanUnion(), yyDollar[4].orderByUnion(), yyDollar[5].limitUnion(), yyDollar[6].lockUnion()) } + yyVAL.union = yyLOCAL case 47: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:544 + var yyLOCAL Statement +//line sql.y:550 { - yyVAL.statement = &Stream{Comments: Comments(yyDollar[2].strs), SelectExpr: yyDollar[3].selectExpr, Table: yyDollar[5].tableName} + yyLOCAL = &Stream{Comments: Comments(yyDollar[2].strs), SelectExpr: yyDollar[3].selectExprUnion(), Table: yyDollar[5].tableName} } + yyVAL.union = yyLOCAL case 48: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:550 + var yyLOCAL Statement +//line sql.y:556 { - yyVAL.statement = &VStream{Comments: Comments(yyDollar[2].strs), SelectExpr: yyDollar[3].selectExpr, Table: yyDollar[5].tableName, Where: NewWhere(WhereClause, yyDollar[6].expr), Limit: yyDollar[7].limit} + yyLOCAL = &VStream{Comments: Comments(yyDollar[2].strs), SelectExpr: yyDollar[3].selectExprUnion(), Table: yyDollar[5].tableName, Where: NewWhere(WhereClause, yyDollar[6].exprUnion()), Limit: yyDollar[7].limitUnion()} } + yyVAL.union = yyLOCAL case 49: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:558 + var yyLOCAL SelectStatement +//line sql.y:564 { - yyVAL.selStmt = NewSelect(Comments(yyDollar[2].strs), yyDollar[4].selectExprs /*SelectExprs*/, yyDollar[3].strs /*options*/, yyDollar[5].tableExprs /*from*/, NewWhere(WhereClause, yyDollar[6].expr), GroupBy(yyDollar[7].exprs), NewWhere(HavingClause, yyDollar[8].expr)) + yyLOCAL = NewSelect(Comments(yyDollar[2].strs), yyDollar[4].selectExprsUnion() /*SelectExprs*/, yyDollar[3].strs /*options*/, yyDollar[5].tableExprsUnion() /*from*/, NewWhere(WhereClause, yyDollar[6].exprUnion()), GroupBy(yyDollar[7].exprsUnion()), NewWhere(HavingClause, yyDollar[8].exprUnion())) } + yyVAL.union = yyLOCAL case 50: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:564 + var yyLOCAL SelectStatement +//line sql.y:570 { - yyVAL.selStmt = yyDollar[1].selStmt + yyLOCAL = yyDollar[1].selStmtUnion() } + yyVAL.union = yyLOCAL case 51: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:568 + var yyLOCAL SelectStatement +//line sql.y:574 { - yyVAL.selStmt = &ParenSelect{Select: yyDollar[2].selStmt} + yyLOCAL = &ParenSelect{Select: yyDollar[2].selStmtUnion()} } + yyVAL.union = yyLOCAL case 52: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:575 + var yyLOCAL Statement +//line sql.y:581 { // insert_data returns a *Insert pre-filled with Columns & Values - ins := yyDollar[6].ins - ins.Action = yyDollar[1].insertAction + ins := yyDollar[6].insUnion() + ins.Action = yyDollar[1].insertActionUnion() ins.Comments = yyDollar[2].strs - ins.Ignore = yyDollar[3].ignore + ins.Ignore = yyDollar[3].ignoreUnion() ins.Table = yyDollar[4].tableName - ins.Partitions = yyDollar[5].partitions - ins.OnDup = OnDup(yyDollar[7].updateExprs) - yyVAL.statement = ins + ins.Partitions = yyDollar[5].partitionsUnion() + ins.OnDup = OnDup(yyDollar[7].updateExprsUnion()) + yyLOCAL = ins } + yyVAL.union = yyLOCAL case 53: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:587 + var yyLOCAL Statement +//line sql.y:593 { - cols := make(Columns, 0, len(yyDollar[7].updateExprs)) - vals := make(ValTuple, 0, len(yyDollar[8].updateExprs)) - for _, updateList := range yyDollar[7].updateExprs { + cols := make(Columns, 0, len(yyDollar[7].updateExprsUnion())) + vals := make(ValTuple, 0, len(yyDollar[8].updateExprsUnion())) + for _, updateList := range yyDollar[7].updateExprsUnion() { cols = append(cols, updateList.Name.Name) vals = append(vals, updateList.Expr) } - yyVAL.statement = &Insert{Action: yyDollar[1].insertAction, Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, Table: yyDollar[4].tableName, Partitions: yyDollar[5].partitions, Columns: cols, Rows: Values{vals}, OnDup: OnDup(yyDollar[8].updateExprs)} + yyLOCAL = &Insert{Action: yyDollar[1].insertActionUnion(), Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), Table: yyDollar[4].tableName, Partitions: yyDollar[5].partitionsUnion(), Columns: cols, Rows: Values{vals}, OnDup: OnDup(yyDollar[8].updateExprsUnion())} } + yyVAL.union = yyLOCAL case 54: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:599 + var yyLOCAL InsertAction +//line sql.y:605 { - yyVAL.insertAction = InsertAct + yyLOCAL = InsertAct } + yyVAL.union = yyLOCAL case 55: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:603 + var yyLOCAL InsertAction +//line sql.y:609 { - yyVAL.insertAction = ReplaceAct + yyLOCAL = ReplaceAct } + yyVAL.union = yyLOCAL case 56: yyDollar = yyS[yypt-9 : yypt+1] -//line sql.y:609 + var yyLOCAL Statement +//line sql.y:615 { - yyVAL.statement = &Update{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, TableExprs: yyDollar[4].tableExprs, Exprs: yyDollar[6].updateExprs, Where: NewWhere(WhereClause, yyDollar[7].expr), OrderBy: yyDollar[8].orderBy, Limit: yyDollar[9].limit} + yyLOCAL = &Update{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), TableExprs: yyDollar[4].tableExprsUnion(), Exprs: yyDollar[6].updateExprsUnion(), Where: NewWhere(WhereClause, yyDollar[7].exprUnion()), OrderBy: yyDollar[8].orderByUnion(), Limit: yyDollar[9].limitUnion()} } + yyVAL.union = yyLOCAL case 57: yyDollar = yyS[yypt-9 : yypt+1] -//line sql.y:615 + var yyLOCAL Statement +//line sql.y:621 { - yyVAL.statement = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, TableExprs: TableExprs{&AliasedTableExpr{Expr: yyDollar[5].tableName}}, Partitions: yyDollar[6].partitions, Where: NewWhere(WhereClause, yyDollar[7].expr), OrderBy: yyDollar[8].orderBy, Limit: yyDollar[9].limit} + yyLOCAL = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), TableExprs: TableExprs{&AliasedTableExpr{Expr: yyDollar[5].tableName}}, Partitions: yyDollar[6].partitionsUnion(), Where: NewWhere(WhereClause, yyDollar[7].exprUnion()), OrderBy: yyDollar[8].orderByUnion(), Limit: yyDollar[9].limitUnion()} } + yyVAL.union = yyLOCAL case 58: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:619 + var yyLOCAL Statement +//line sql.y:625 { - yyVAL.statement = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, Targets: yyDollar[5].tableNames, TableExprs: yyDollar[7].tableExprs, Where: NewWhere(WhereClause, yyDollar[8].expr)} + yyLOCAL = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), Targets: yyDollar[5].tableNamesUnion(), TableExprs: yyDollar[7].tableExprsUnion(), Where: NewWhere(WhereClause, yyDollar[8].exprUnion())} } + yyVAL.union = yyLOCAL case 59: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:623 + var yyLOCAL Statement +//line sql.y:629 { - yyVAL.statement = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, Targets: yyDollar[4].tableNames, TableExprs: yyDollar[6].tableExprs, Where: NewWhere(WhereClause, yyDollar[7].expr)} + yyLOCAL = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), Targets: yyDollar[4].tableNamesUnion(), TableExprs: yyDollar[6].tableExprsUnion(), Where: NewWhere(WhereClause, yyDollar[7].exprUnion())} } + yyVAL.union = yyLOCAL case 60: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:627 + var yyLOCAL Statement +//line sql.y:633 { - yyVAL.statement = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignore, Targets: yyDollar[4].tableNames, TableExprs: yyDollar[6].tableExprs, Where: NewWhere(WhereClause, yyDollar[7].expr)} + yyLOCAL = &Delete{Comments: Comments(yyDollar[2].strs), Ignore: yyDollar[3].ignoreUnion(), Targets: yyDollar[4].tableNamesUnion(), TableExprs: yyDollar[6].tableExprsUnion(), Where: NewWhere(WhereClause, yyDollar[7].exprUnion())} } + yyVAL.union = yyLOCAL case 61: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:632 +//line sql.y:638 { } case 62: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:633 +//line sql.y:639 { } case 63: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:637 + var yyLOCAL TableNames +//line sql.y:643 { - yyVAL.tableNames = TableNames{yyDollar[1].tableName.ToViewName()} + yyLOCAL = TableNames{yyDollar[1].tableName.ToViewName()} } + yyVAL.union = yyLOCAL case 64: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:641 +//line sql.y:647 { - yyVAL.tableNames = append(yyVAL.tableNames, yyDollar[3].tableName.ToViewName()) + yySLICE := (*TableNames)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableName.ToViewName()) } case 65: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:647 + var yyLOCAL TableNames +//line sql.y:653 { - yyVAL.tableNames = TableNames{yyDollar[1].tableName} + yyLOCAL = TableNames{yyDollar[1].tableName} } + yyVAL.union = yyLOCAL case 66: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:651 +//line sql.y:657 { - yyVAL.tableNames = append(yyVAL.tableNames, yyDollar[3].tableName) + yySLICE := (*TableNames)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableName) } case 67: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:657 + var yyLOCAL TableNames +//line sql.y:663 { - yyVAL.tableNames = TableNames{yyDollar[1].tableName} + yyLOCAL = TableNames{yyDollar[1].tableName} } + yyVAL.union = yyLOCAL case 68: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:661 +//line sql.y:667 { - yyVAL.tableNames = append(yyVAL.tableNames, yyDollar[3].tableName) + yySLICE := (*TableNames)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableName) } case 69: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:666 + var yyLOCAL Partitions +//line sql.y:672 { - yyVAL.partitions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 70: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:670 + var yyLOCAL Partitions +//line sql.y:676 { - yyVAL.partitions = yyDollar[3].partitions + yyLOCAL = yyDollar[3].partitionsUnion() } + yyVAL.union = yyLOCAL case 71: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:676 + var yyLOCAL Statement +//line sql.y:682 { - yyVAL.statement = &Set{Comments: Comments(yyDollar[2].strs), Exprs: yyDollar[3].setExprs} + yyLOCAL = &Set{Comments: Comments(yyDollar[2].strs), Exprs: yyDollar[3].setExprsUnion()} } + yyVAL.union = yyLOCAL case 72: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:682 + var yyLOCAL Statement +//line sql.y:688 { - yyVAL.statement = &SetTransaction{Comments: Comments(yyDollar[2].strs), Scope: yyDollar[3].scope, Characteristics: yyDollar[5].characteristics} + yyLOCAL = &SetTransaction{Comments: Comments(yyDollar[2].strs), Scope: yyDollar[3].scopeUnion(), Characteristics: yyDollar[5].characteristicsUnion()} } + yyVAL.union = yyLOCAL case 73: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:686 + var yyLOCAL Statement +//line sql.y:692 { - yyVAL.statement = &SetTransaction{Comments: Comments(yyDollar[2].strs), Characteristics: yyDollar[4].characteristics, Scope: ImplicitScope} + yyLOCAL = &SetTransaction{Comments: Comments(yyDollar[2].strs), Characteristics: yyDollar[4].characteristicsUnion(), Scope: ImplicitScope} } + yyVAL.union = yyLOCAL case 74: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:692 + var yyLOCAL []Characteristic +//line sql.y:698 { - yyVAL.characteristics = []Characteristic{yyDollar[1].characteristic} + yyLOCAL = []Characteristic{yyDollar[1].characteristicUnion()} } + yyVAL.union = yyLOCAL case 75: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:696 +//line sql.y:702 { - yyVAL.characteristics = append(yyVAL.characteristics, yyDollar[3].characteristic) + yySLICE := (*[]Characteristic)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].characteristicUnion()) } case 76: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:702 + var yyLOCAL Characteristic +//line sql.y:708 { - yyVAL.characteristic = yyDollar[3].isolationLevel + yyLOCAL = yyDollar[3].isolationLevelUnion() } + yyVAL.union = yyLOCAL case 77: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:706 + var yyLOCAL Characteristic +//line sql.y:712 { - yyVAL.characteristic = ReadWrite + yyLOCAL = ReadWrite } + yyVAL.union = yyLOCAL case 78: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:710 + var yyLOCAL Characteristic +//line sql.y:716 { - yyVAL.characteristic = ReadOnly + yyLOCAL = ReadOnly } + yyVAL.union = yyLOCAL case 79: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:716 + var yyLOCAL IsolationLevel +//line sql.y:722 { - yyVAL.isolationLevel = RepeatableRead + yyLOCAL = RepeatableRead } + yyVAL.union = yyLOCAL case 80: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:720 + var yyLOCAL IsolationLevel +//line sql.y:726 { - yyVAL.isolationLevel = ReadCommitted + yyLOCAL = ReadCommitted } + yyVAL.union = yyLOCAL case 81: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:724 + var yyLOCAL IsolationLevel +//line sql.y:730 { - yyVAL.isolationLevel = ReadUncommitted + yyLOCAL = ReadUncommitted } + yyVAL.union = yyLOCAL case 82: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:728 + var yyLOCAL IsolationLevel +//line sql.y:734 { - yyVAL.isolationLevel = Serializable + yyLOCAL = Serializable } + yyVAL.union = yyLOCAL case 83: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:734 + var yyLOCAL Scope +//line sql.y:740 { - yyVAL.scope = SessionScope + yyLOCAL = SessionScope } + yyVAL.union = yyLOCAL case 84: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:738 + var yyLOCAL Scope +//line sql.y:744 { - yyVAL.scope = GlobalScope + yyLOCAL = GlobalScope } + yyVAL.union = yyLOCAL case 85: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:744 + var yyLOCAL Statement +//line sql.y:750 { - yyDollar[1].createTable.TableSpec = yyDollar[2].TableSpec - yyDollar[1].createTable.FullyParsed = true - yyVAL.statement = yyDollar[1].createTable + yyDollar[1].createTableUnion().TableSpec = yyDollar[2].tableSpecUnion() + yyDollar[1].createTableUnion().FullyParsed = true + yyLOCAL = yyDollar[1].createTableUnion() } + yyVAL.union = yyLOCAL case 86: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:750 + var yyLOCAL Statement +//line sql.y:756 { // Create table [name] like [name] - yyDollar[1].createTable.OptLike = yyDollar[2].optLike - yyDollar[1].createTable.FullyParsed = true - yyVAL.statement = yyDollar[1].createTable + yyDollar[1].createTableUnion().OptLike = yyDollar[2].optLikeUnion() + yyDollar[1].createTableUnion().FullyParsed = true + yyLOCAL = yyDollar[1].createTableUnion() } + yyVAL.union = yyLOCAL case 87: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:757 + var yyLOCAL Statement +//line sql.y:763 { - indexDef := yyDollar[1].alterTable.AlterOptions[0].(*AddIndexDefinition).IndexDefinition - indexDef.Columns = yyDollar[3].indexColumns - indexDef.Options = append(indexDef.Options, yyDollar[5].indexOptions...) - yyDollar[1].alterTable.AlterOptions = append(yyDollar[1].alterTable.AlterOptions, yyDollar[6].alterOptions...) - yyDollar[1].alterTable.FullyParsed = true - yyVAL.statement = yyDollar[1].alterTable + indexDef := yyDollar[1].alterTableUnion().AlterOptions[0].(*AddIndexDefinition).IndexDefinition + indexDef.Columns = yyDollar[3].indexColumnsUnion() + indexDef.Options = append(indexDef.Options, yyDollar[5].indexOptionsUnion()...) + yyDollar[1].alterTableUnion().AlterOptions = append(yyDollar[1].alterTableUnion().AlterOptions, yyDollar[6].alterOptionsUnion()...) + yyDollar[1].alterTableUnion().FullyParsed = true + yyLOCAL = yyDollar[1].alterTableUnion() } + yyVAL.union = yyLOCAL case 88: yyDollar = yyS[yypt-11 : yypt+1] -//line sql.y:766 + var yyLOCAL Statement +//line sql.y:772 { - yyVAL.statement = &CreateView{ViewName: yyDollar[7].tableName.ToViewName(), IsReplace: yyDollar[2].boolean, Algorithm: yyDollar[3].str, Definer: yyDollar[4].str, Security: yyDollar[5].str, Columns: yyDollar[8].columns, Select: yyDollar[10].selStmt, CheckOption: yyDollar[11].str} + yyLOCAL = &CreateView{ViewName: yyDollar[7].tableName.ToViewName(), IsReplace: yyDollar[2].booleanUnion(), Algorithm: yyDollar[3].str, Definer: yyDollar[4].str, Security: yyDollar[5].str, Columns: yyDollar[8].columnsUnion(), Select: yyDollar[10].selStmtUnion(), CheckOption: yyDollar[11].str} } + yyVAL.union = yyLOCAL case 89: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:770 + var yyLOCAL Statement +//line sql.y:776 { - yyDollar[1].createDatabase.FullyParsed = true - yyDollar[1].createDatabase.CreateOptions = yyDollar[2].collateAndCharsets - yyVAL.statement = yyDollar[1].createDatabase + yyDollar[1].createDatabaseUnion().FullyParsed = true + yyDollar[1].createDatabaseUnion().CreateOptions = yyDollar[2].collateAndCharsetsUnion() + yyLOCAL = yyDollar[1].createDatabaseUnion() } + yyVAL.union = yyLOCAL case 90: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:777 + var yyLOCAL bool +//line sql.y:783 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 91: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:781 + var yyLOCAL bool +//line sql.y:787 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 92: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:786 +//line sql.y:792 { yyVAL.colIdent = NewColIdent("") } case 93: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:790 +//line sql.y:796 { yyVAL.colIdent = yyDollar[2].colIdent } case 94: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:796 +//line sql.y:802 { yyVAL.colIdent = yyDollar[1].colIdent } case 95: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:801 + var yyLOCAL []VindexParam +//line sql.y:807 { var v []VindexParam - yyVAL.vindexParams = v + yyLOCAL = v } + yyVAL.union = yyLOCAL case 96: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:806 + var yyLOCAL []VindexParam +//line sql.y:812 { - yyVAL.vindexParams = yyDollar[2].vindexParams + yyLOCAL = yyDollar[2].vindexParamsUnion() } + yyVAL.union = yyLOCAL case 97: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:812 + var yyLOCAL []VindexParam +//line sql.y:818 { - yyVAL.vindexParams = make([]VindexParam, 0, 4) - yyVAL.vindexParams = append(yyVAL.vindexParams, yyDollar[1].vindexParam) + yyLOCAL = make([]VindexParam, 0, 4) + yyLOCAL = append(yyLOCAL, yyDollar[1].vindexParam) } + yyVAL.union = yyLOCAL case 98: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:817 +//line sql.y:823 { - yyVAL.vindexParams = append(yyVAL.vindexParams, yyDollar[3].vindexParam) + yySLICE := (*[]VindexParam)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].vindexParam) } case 99: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:823 +//line sql.y:829 { yyVAL.vindexParam = VindexParam{Key: yyDollar[1].colIdent, Val: yyDollar[3].str} } case 100: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:829 + var yyLOCAL *CreateTable +//line sql.y:835 { - yyVAL.createTable = &CreateTable{Table: yyDollar[5].tableName, IfNotExists: yyDollar[4].boolean, Temp: yyDollar[2].boolean} - setDDL(yylex, yyVAL.createTable) + yyLOCAL = &CreateTable{Table: yyDollar[5].tableName, IfNotExists: yyDollar[4].booleanUnion(), Temp: yyDollar[2].booleanUnion()} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 101: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:836 + var yyLOCAL *AlterTable +//line sql.y:842 { - yyVAL.alterTable = &AlterTable{Table: yyDollar[3].tableName} - setDDL(yylex, yyVAL.alterTable) + yyLOCAL = &AlterTable{Table: yyDollar[3].tableName} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 102: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:843 + var yyLOCAL *AlterTable +//line sql.y:849 { - yyVAL.alterTable = &AlterTable{Table: yyDollar[6].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[3].colIdent, Type: string(yyDollar[2].str)}, Options: yyDollar[4].indexOptions}}}} - setDDL(yylex, yyVAL.alterTable) + yyLOCAL = &AlterTable{Table: yyDollar[6].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[3].colIdent, Type: string(yyDollar[2].str)}, Options: yyDollar[4].indexOptionsUnion()}}}} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 103: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:848 + var yyLOCAL *AlterTable +//line sql.y:854 { - yyVAL.alterTable = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Fulltext: true}, Options: yyDollar[5].indexOptions}}}} - setDDL(yylex, yyVAL.alterTable) + yyLOCAL = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Fulltext: true}, Options: yyDollar[5].indexOptionsUnion()}}}} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 104: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:853 + var yyLOCAL *AlterTable +//line sql.y:859 { - yyVAL.alterTable = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Spatial: true}, Options: yyDollar[5].indexOptions}}}} - setDDL(yylex, yyVAL.alterTable) + yyLOCAL = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Spatial: true}, Options: yyDollar[5].indexOptionsUnion()}}}} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 105: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:858 + var yyLOCAL *AlterTable +//line sql.y:864 { - yyVAL.alterTable = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Unique: true}, Options: yyDollar[5].indexOptions}}}} - setDDL(yylex, yyVAL.alterTable) + yyLOCAL = &AlterTable{Table: yyDollar[7].tableName, AlterOptions: []AlterOption{&AddIndexDefinition{IndexDefinition: &IndexDefinition{Info: &IndexInfo{Name: yyDollar[4].colIdent, Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Unique: true}, Options: yyDollar[5].indexOptionsUnion()}}}} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 106: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:865 + var yyLOCAL *CreateDatabase +//line sql.y:871 { - yyVAL.createDatabase = &CreateDatabase{Comments: Comments(yyDollar[3].strs), DBName: string(yyDollar[5].colIdent.String()), IfNotExists: yyDollar[4].boolean} - setDDL(yylex, yyVAL.createDatabase) + yyLOCAL = &CreateDatabase{Comments: Comments(yyDollar[3].strs), DBName: string(yyDollar[5].colIdent.String()), IfNotExists: yyDollar[4].booleanUnion()} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 107: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:872 + var yyLOCAL *AlterDatabase +//line sql.y:878 { - yyVAL.alterDatabase = &AlterDatabase{} - setDDL(yylex, yyVAL.alterDatabase) + yyLOCAL = &AlterDatabase{} + setDDL(yylex, yyLOCAL) } + yyVAL.union = yyLOCAL case 110: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:883 + var yyLOCAL *TableSpec +//line sql.y:889 { - yyVAL.TableSpec = yyDollar[2].TableSpec - yyVAL.TableSpec.Options = yyDollar[4].tableOptions + yyLOCAL = yyDollar[2].tableSpecUnion() + yyLOCAL.Options = yyDollar[4].tableOptionsUnion() } + yyVAL.union = yyLOCAL case 111: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:889 + var yyLOCAL []CollateAndCharset +//line sql.y:895 { - yyVAL.collateAndCharsets = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 112: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:893 + var yyLOCAL []CollateAndCharset +//line sql.y:899 { - yyVAL.collateAndCharsets = yyDollar[1].collateAndCharsets + yyLOCAL = yyDollar[1].collateAndCharsetsUnion() } + yyVAL.union = yyLOCAL case 113: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:899 + var yyLOCAL []CollateAndCharset +//line sql.y:905 { - yyVAL.collateAndCharsets = []CollateAndCharset{yyDollar[1].collateAndCharset} + yyLOCAL = []CollateAndCharset{yyDollar[1].collateAndCharset} } + yyVAL.union = yyLOCAL case 114: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:903 + var yyLOCAL []CollateAndCharset +//line sql.y:909 { - yyVAL.collateAndCharsets = []CollateAndCharset{yyDollar[1].collateAndCharset} + yyLOCAL = []CollateAndCharset{yyDollar[1].collateAndCharset} } + yyVAL.union = yyLOCAL case 115: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:907 +//line sql.y:913 { - yyVAL.collateAndCharsets = append(yyDollar[1].collateAndCharsets, yyDollar[2].collateAndCharset) + yySLICE := (*[]CollateAndCharset)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].collateAndCharset) } case 116: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:911 +//line sql.y:917 { - yyVAL.collateAndCharsets = append(yyDollar[1].collateAndCharsets, yyDollar[2].collateAndCharset) + yySLICE := (*[]CollateAndCharset)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].collateAndCharset) } case 117: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:916 + var yyLOCAL bool +//line sql.y:922 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 118: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:920 + var yyLOCAL bool +//line sql.y:926 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 119: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:926 +//line sql.y:932 { - yyVAL.collateAndCharset = CollateAndCharset{Type: CharacterSetType, Value: (yyDollar[4].colIdent.String()), IsDefault: yyDollar[1].boolean} + yyVAL.collateAndCharset = CollateAndCharset{Type: CharacterSetType, Value: (yyDollar[4].colIdent.String()), IsDefault: yyDollar[1].booleanUnion()} } case 120: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:930 +//line sql.y:936 { - yyVAL.collateAndCharset = CollateAndCharset{Type: CharacterSetType, Value: (encodeSQLString(yyDollar[4].str)), IsDefault: yyDollar[1].boolean} + yyVAL.collateAndCharset = CollateAndCharset{Type: CharacterSetType, Value: (encodeSQLString(yyDollar[4].str)), IsDefault: yyDollar[1].booleanUnion()} } case 121: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:936 +//line sql.y:942 { - yyVAL.collateAndCharset = CollateAndCharset{Type: CollateType, Value: (yyDollar[4].colIdent.String()), IsDefault: yyDollar[1].boolean} + yyVAL.collateAndCharset = CollateAndCharset{Type: CollateType, Value: (yyDollar[4].colIdent.String()), IsDefault: yyDollar[1].booleanUnion()} } case 122: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:940 +//line sql.y:946 { - yyVAL.collateAndCharset = CollateAndCharset{Type: CollateType, Value: (encodeSQLString(yyDollar[4].str)), IsDefault: yyDollar[1].boolean} + yyVAL.collateAndCharset = CollateAndCharset{Type: CollateType, Value: (encodeSQLString(yyDollar[4].str)), IsDefault: yyDollar[1].booleanUnion()} } case 123: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:947 + var yyLOCAL *OptLike +//line sql.y:953 { - yyVAL.optLike = &OptLike{LikeTable: yyDollar[2].tableName} + yyLOCAL = &OptLike{LikeTable: yyDollar[2].tableName} } + yyVAL.union = yyLOCAL case 124: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:951 + var yyLOCAL *OptLike +//line sql.y:957 { - yyVAL.optLike = &OptLike{LikeTable: yyDollar[3].tableName} + yyLOCAL = &OptLike{LikeTable: yyDollar[3].tableName} } + yyVAL.union = yyLOCAL case 125: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:957 + var yyLOCAL []*ColumnDefinition +//line sql.y:963 { - yyVAL.columnDefinitions = []*ColumnDefinition{yyDollar[1].columnDefinition} + yyLOCAL = []*ColumnDefinition{yyDollar[1].columnDefinitionUnion()} } + yyVAL.union = yyLOCAL case 126: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:961 +//line sql.y:967 { - yyVAL.columnDefinitions = append(yyDollar[1].columnDefinitions, yyDollar[3].columnDefinition) + yySLICE := (*[]*ColumnDefinition)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].columnDefinitionUnion()) } case 127: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:967 + var yyLOCAL *TableSpec +//line sql.y:973 { - yyVAL.TableSpec = &TableSpec{} - yyVAL.TableSpec.AddColumn(yyDollar[1].columnDefinition) + yyLOCAL = &TableSpec{} + yyLOCAL.AddColumn(yyDollar[1].columnDefinitionUnion()) } + yyVAL.union = yyLOCAL case 128: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:972 + var yyLOCAL *TableSpec +//line sql.y:978 { - yyVAL.TableSpec = &TableSpec{} - yyVAL.TableSpec.AddConstraint(yyDollar[1].constraintDefinition) + yyLOCAL = &TableSpec{} + yyLOCAL.AddConstraint(yyDollar[1].constraintDefinitionUnion()) } + yyVAL.union = yyLOCAL case 129: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:977 +//line sql.y:983 { - yyVAL.TableSpec.AddColumn(yyDollar[3].columnDefinition) + yyVAL.tableSpecUnion().AddColumn(yyDollar[3].columnDefinitionUnion()) } case 130: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:981 +//line sql.y:987 { - yyVAL.TableSpec.AddColumn(yyDollar[3].columnDefinition) - yyVAL.TableSpec.AddConstraint(yyDollar[4].constraintDefinition) + yyVAL.tableSpecUnion().AddColumn(yyDollar[3].columnDefinitionUnion()) + yyVAL.tableSpecUnion().AddConstraint(yyDollar[4].constraintDefinitionUnion()) } case 131: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:986 +//line sql.y:992 { - yyVAL.TableSpec.AddIndex(yyDollar[3].indexDefinition) + yyVAL.tableSpecUnion().AddIndex(yyDollar[3].indexDefinitionUnion()) } case 132: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:990 +//line sql.y:996 { - yyVAL.TableSpec.AddConstraint(yyDollar[3].constraintDefinition) + yyVAL.tableSpecUnion().AddConstraint(yyDollar[3].constraintDefinitionUnion()) } case 133: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:994 +//line sql.y:1000 { - yyVAL.TableSpec.AddConstraint(yyDollar[3].constraintDefinition) + yyVAL.tableSpecUnion().AddConstraint(yyDollar[3].constraintDefinitionUnion()) } case 134: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1000 + var yyLOCAL *ColumnDefinition +//line sql.y:1006 { - yyDollar[2].columnType.Options = yyDollar[3].columnTypeOptions - yyVAL.columnDefinition = &ColumnDefinition{Name: yyDollar[1].colIdent, Type: yyDollar[2].columnType} + yyDollar[2].columnType.Options = yyDollar[3].columnTypeOptionsUnion() + yyLOCAL = &ColumnDefinition{Name: yyDollar[1].colIdent, Type: yyDollar[2].columnType} } + yyVAL.union = yyLOCAL case 135: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1010 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1016 { - yyVAL.columnTypeOptions = &ColumnTypeOptions{NotNull: false, Default: nil, OnUpdate: nil, Autoincrement: false, KeyOpt: colKeyNone, Comment: nil} + yyLOCAL = &ColumnTypeOptions{NotNull: false, Default: nil, OnUpdate: nil, Autoincrement: false, KeyOpt: colKeyNone, Comment: nil} } + yyVAL.union = yyLOCAL case 136: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1014 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1020 { - yyDollar[1].columnTypeOptions.NotNull = false - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().NotNull = false + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 137: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1019 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1025 { - yyDollar[1].columnTypeOptions.NotNull = true - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().NotNull = true + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 138: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1024 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1030 { - yyDollar[1].columnTypeOptions.Default = yyDollar[3].expr - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().Default = yyDollar[3].exprUnion() + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 139: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1029 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1035 { - yyDollar[1].columnTypeOptions.OnUpdate = yyDollar[4].expr - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().OnUpdate = yyDollar[4].exprUnion() + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 140: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1034 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1040 { - yyDollar[1].columnTypeOptions.Autoincrement = true - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().Autoincrement = true + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 141: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1039 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1045 { - yyDollar[1].columnTypeOptions.Comment = NewStrLiteral(yyDollar[3].str) - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().Comment = NewStrLiteral(yyDollar[3].str) + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 142: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1044 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1050 { - yyDollar[1].columnTypeOptions.KeyOpt = colKeyPrimary - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().KeyOpt = colKeyPrimary + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 143: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1049 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1055 { - yyDollar[1].columnTypeOptions.KeyOpt = colKey - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().KeyOpt = colKey + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 144: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1054 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1060 { - yyDollar[1].columnTypeOptions.KeyOpt = colKeyUniqueKey - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().KeyOpt = colKeyUniqueKey + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 145: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1059 + var yyLOCAL *ColumnTypeOptions +//line sql.y:1065 { - yyDollar[1].columnTypeOptions.KeyOpt = colKeyUnique - yyVAL.columnTypeOptions = yyDollar[1].columnTypeOptions + yyDollar[1].columnTypeOptionsUnion().KeyOpt = colKeyUnique + yyLOCAL = yyDollar[1].columnTypeOptionsUnion() } + yyVAL.union = yyLOCAL case 146: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1066 +//line sql.y:1072 { yyVAL.columnType = yyDollar[1].columnType - yyVAL.columnType.Unsigned = yyDollar[2].boolean - yyVAL.columnType.Zerofill = yyDollar[3].boolean + yyVAL.columnType.Unsigned = yyDollar[2].booleanUnion() + yyVAL.columnType.Zerofill = yyDollar[3].booleanUnion() } case 150: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1077 +//line sql.y:1083 { yyVAL.columnType = yyDollar[1].columnType - yyVAL.columnType.Length = yyDollar[2].literal + yyVAL.columnType.Length = yyDollar[2].literalUnion() } case 151: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1082 +//line sql.y:1088 { yyVAL.columnType = yyDollar[1].columnType } case 152: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1088 +//line sql.y:1094 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 153: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1092 +//line sql.y:1098 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 154: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1096 +//line sql.y:1102 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 155: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1100 +//line sql.y:1106 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 156: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1104 +//line sql.y:1110 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 157: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1108 +//line sql.y:1114 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 158: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1112 +//line sql.y:1118 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 159: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1116 +//line sql.y:1122 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 160: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1120 +//line sql.y:1126 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 161: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1126 +//line sql.y:1132 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} yyVAL.columnType.Length = yyDollar[2].LengthScaleOption.Length @@ -6219,7 +6732,7 @@ yydefault: } case 162: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1132 +//line sql.y:1138 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} yyVAL.columnType.Length = yyDollar[2].LengthScaleOption.Length @@ -6227,7 +6740,7 @@ yydefault: } case 163: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1138 +//line sql.y:1144 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} yyVAL.columnType.Length = yyDollar[2].LengthScaleOption.Length @@ -6235,7 +6748,7 @@ yydefault: } case 164: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1144 +//line sql.y:1150 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} yyVAL.columnType.Length = yyDollar[2].LengthScaleOption.Length @@ -6243,7 +6756,7 @@ yydefault: } case 165: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1150 +//line sql.y:1156 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} yyVAL.columnType.Length = yyDollar[2].LengthScaleOption.Length @@ -6251,206 +6764,210 @@ yydefault: } case 166: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1158 +//line sql.y:1164 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 167: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1162 +//line sql.y:1168 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 168: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1166 +//line sql.y:1172 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 169: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1170 +//line sql.y:1176 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 170: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1174 +//line sql.y:1180 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 171: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1180 +//line sql.y:1186 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal, Charset: yyDollar[3].str, Collate: yyDollar[4].str} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion(), Charset: yyDollar[3].str, Collate: yyDollar[4].str} } case 172: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1184 +//line sql.y:1190 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal, Charset: yyDollar[3].str, Collate: yyDollar[4].str} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion(), Charset: yyDollar[3].str, Collate: yyDollar[4].str} } case 173: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1188 +//line sql.y:1194 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 174: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1192 +//line sql.y:1198 { - yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } case 175: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1196 +//line sql.y:1202 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Charset: yyDollar[2].str, Collate: yyDollar[3].str} } case 176: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1200 +//line sql.y:1206 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Charset: yyDollar[2].str, Collate: yyDollar[3].str} } case 177: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1204 +//line sql.y:1210 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Charset: yyDollar[2].str, Collate: yyDollar[3].str} } case 178: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1208 +//line sql.y:1214 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), Charset: yyDollar[2].str, Collate: yyDollar[3].str} } case 179: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1212 +//line sql.y:1218 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 180: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1216 +//line sql.y:1222 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 181: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1220 +//line sql.y:1226 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 182: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1224 +//line sql.y:1230 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 183: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1228 +//line sql.y:1234 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 184: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:1232 +//line sql.y:1238 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), EnumValues: yyDollar[3].strs, Charset: yyDollar[5].str, Collate: yyDollar[6].str} } case 185: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:1237 +//line sql.y:1243 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str), EnumValues: yyDollar[3].strs, Charset: yyDollar[5].str, Collate: yyDollar[6].str} } case 186: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1243 +//line sql.y:1249 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 187: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1247 +//line sql.y:1253 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 188: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1251 +//line sql.y:1257 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 189: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1255 +//line sql.y:1261 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 190: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1259 +//line sql.y:1265 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 191: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1263 +//line sql.y:1269 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 192: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1267 +//line sql.y:1273 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 193: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1271 +//line sql.y:1277 { yyVAL.columnType = ColumnType{Type: string(yyDollar[1].str)} } case 194: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1277 +//line sql.y:1283 { yyVAL.strs = make([]string, 0, 4) yyVAL.strs = append(yyVAL.strs, encodeSQLString(yyDollar[1].str)) } case 195: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1282 +//line sql.y:1288 { yyVAL.strs = append(yyDollar[1].strs, encodeSQLString(yyDollar[3].str)) } case 196: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1287 + var yyLOCAL *Literal +//line sql.y:1293 { - yyVAL.literal = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 197: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1291 + var yyLOCAL *Literal +//line sql.y:1297 { - yyVAL.literal = NewIntLiteral(yyDollar[2].str) + yyLOCAL = NewIntLiteral(yyDollar[2].str) } + yyVAL.union = yyLOCAL case 198: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1296 +//line sql.y:1302 { yyVAL.LengthScaleOption = LengthScaleOption{} } case 199: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1300 +//line sql.y:1306 { yyVAL.LengthScaleOption = LengthScaleOption{ Length: NewIntLiteral(yyDollar[2].str), @@ -6459,13 +6976,13 @@ yydefault: } case 200: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1308 +//line sql.y:1314 { yyVAL.LengthScaleOption = LengthScaleOption{} } case 201: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1312 +//line sql.y:1318 { yyVAL.LengthScaleOption = LengthScaleOption{ Length: NewIntLiteral(yyDollar[2].str), @@ -6473,7 +6990,7 @@ yydefault: } case 202: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1318 +//line sql.y:1324 { yyVAL.LengthScaleOption = LengthScaleOption{ Length: NewIntLiteral(yyDollar[2].str), @@ -6482,1006 +6999,1257 @@ yydefault: } case 203: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1326 + var yyLOCAL bool +//line sql.y:1332 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 204: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1330 + var yyLOCAL bool +//line sql.y:1336 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 205: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1335 + var yyLOCAL bool +//line sql.y:1341 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 206: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1339 + var yyLOCAL bool +//line sql.y:1345 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 207: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1344 +//line sql.y:1350 { yyVAL.str = "" } case 208: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1348 +//line sql.y:1354 { yyVAL.str = string(yyDollar[2].colIdent.String()) } case 209: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1352 +//line sql.y:1358 { yyVAL.str = encodeSQLString(yyDollar[2].str) } case 210: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1356 +//line sql.y:1362 { yyVAL.str = string(yyDollar[2].str) } case 211: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1361 +//line sql.y:1367 { yyVAL.str = "" } case 212: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1365 +//line sql.y:1371 { yyVAL.str = string(yyDollar[2].colIdent.String()) } case 213: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1369 +//line sql.y:1375 { yyVAL.str = encodeSQLString(yyDollar[2].str) } case 214: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1376 + var yyLOCAL *IndexDefinition +//line sql.y:1382 { - yyVAL.indexDefinition = &IndexDefinition{Info: yyDollar[1].indexInfo, Columns: yyDollar[3].indexColumns, Options: yyDollar[5].indexOptions} + yyLOCAL = &IndexDefinition{Info: yyDollar[1].indexInfoUnion(), Columns: yyDollar[3].indexColumnsUnion(), Options: yyDollar[5].indexOptionsUnion()} } + yyVAL.union = yyLOCAL case 215: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1381 + var yyLOCAL []*IndexOption +//line sql.y:1387 { - yyVAL.indexOptions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 216: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1385 + var yyLOCAL []*IndexOption +//line sql.y:1391 { - yyVAL.indexOptions = yyDollar[1].indexOptions + yyLOCAL = yyDollar[1].indexOptionsUnion() } + yyVAL.union = yyLOCAL case 217: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1391 + var yyLOCAL []*IndexOption +//line sql.y:1397 { - yyVAL.indexOptions = []*IndexOption{yyDollar[1].indexOption} + yyLOCAL = []*IndexOption{yyDollar[1].indexOptionUnion()} } + yyVAL.union = yyLOCAL case 218: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1395 +//line sql.y:1401 { - yyVAL.indexOptions = append(yyVAL.indexOptions, yyDollar[2].indexOption) + yySLICE := (*[]*IndexOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].indexOptionUnion()) } case 219: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1401 + var yyLOCAL *IndexOption +//line sql.y:1407 { - yyVAL.indexOption = yyDollar[1].indexOption + yyLOCAL = yyDollar[1].indexOptionUnion() } + yyVAL.union = yyLOCAL case 220: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1405 + var yyLOCAL *IndexOption +//line sql.y:1411 { // should not be string - yyVAL.indexOption = &IndexOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &IndexOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 221: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1410 + var yyLOCAL *IndexOption +//line sql.y:1416 { - yyVAL.indexOption = &IndexOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[2].str)} + yyLOCAL = &IndexOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[2].str)} } + yyVAL.union = yyLOCAL case 222: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1414 + var yyLOCAL *IndexOption +//line sql.y:1420 { - yyVAL.indexOption = &IndexOption{Name: string(yyDollar[1].str) + " " + string(yyDollar[2].str), String: yyDollar[3].colIdent.String()} + yyLOCAL = &IndexOption{Name: string(yyDollar[1].str) + " " + string(yyDollar[2].str), String: yyDollar[3].colIdent.String()} } + yyVAL.union = yyLOCAL case 223: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1420 +//line sql.y:1426 { yyVAL.str = "" } case 224: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1424 +//line sql.y:1430 { yyVAL.str = string(yyDollar[1].str) } case 225: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1430 + var yyLOCAL *IndexInfo +//line sql.y:1436 { - yyVAL.indexInfo = &IndexInfo{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), ConstraintName: NewColIdent(yyDollar[1].str), Name: NewColIdent("PRIMARY"), Primary: true, Unique: true} + yyLOCAL = &IndexInfo{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), ConstraintName: NewColIdent(yyDollar[1].str), Name: NewColIdent("PRIMARY"), Primary: true, Unique: true} } + yyVAL.union = yyLOCAL case 226: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1434 + var yyLOCAL *IndexInfo +//line sql.y:1440 { - yyVAL.indexInfo = &IndexInfo{Type: string(yyDollar[1].str) + " " + string(yyDollar[2].str), Name: NewColIdent(yyDollar[3].str), Spatial: true, Unique: false} + yyLOCAL = &IndexInfo{Type: string(yyDollar[1].str) + " " + string(yyDollar[2].str), Name: NewColIdent(yyDollar[3].str), Spatial: true, Unique: false} } + yyVAL.union = yyLOCAL case 227: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1438 + var yyLOCAL *IndexInfo +//line sql.y:1444 { - yyVAL.indexInfo = &IndexInfo{Type: string(yyDollar[1].str) + " " + string(yyDollar[2].str), Name: NewColIdent(yyDollar[3].str), Fulltext: true, Unique: false} + yyLOCAL = &IndexInfo{Type: string(yyDollar[1].str) + " " + string(yyDollar[2].str), Name: NewColIdent(yyDollar[3].str), Fulltext: true, Unique: false} } + yyVAL.union = yyLOCAL case 228: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1442 + var yyLOCAL *IndexInfo +//line sql.y:1448 { - yyVAL.indexInfo = &IndexInfo{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), ConstraintName: NewColIdent(yyDollar[1].str), Name: NewColIdent(yyDollar[4].str), Unique: true} + yyLOCAL = &IndexInfo{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), ConstraintName: NewColIdent(yyDollar[1].str), Name: NewColIdent(yyDollar[4].str), Unique: true} } + yyVAL.union = yyLOCAL case 229: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1446 + var yyLOCAL *IndexInfo +//line sql.y:1452 { - yyVAL.indexInfo = &IndexInfo{Type: string(yyDollar[1].str), Name: NewColIdent(yyDollar[2].str), Unique: false} + yyLOCAL = &IndexInfo{Type: string(yyDollar[1].str), Name: NewColIdent(yyDollar[2].str), Unique: false} } + yyVAL.union = yyLOCAL case 230: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1451 +//line sql.y:1457 { yyVAL.str = "" } case 231: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1455 +//line sql.y:1461 { yyVAL.str = yyDollar[2].str } case 232: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1461 +//line sql.y:1467 { yyVAL.str = string(yyDollar[1].str) } case 233: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1465 +//line sql.y:1471 { yyVAL.str = string(yyDollar[1].str) } case 234: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1469 +//line sql.y:1475 { yyVAL.str = string(yyDollar[1].str) } case 235: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1476 +//line sql.y:1482 { yyVAL.str = string(yyDollar[1].str) } case 236: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1480 +//line sql.y:1486 { yyVAL.str = string(yyDollar[1].str) } case 237: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1485 +//line sql.y:1491 { yyVAL.str = "key" } case 238: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1489 +//line sql.y:1495 { yyVAL.str = yyDollar[1].str } case 239: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1495 +//line sql.y:1501 { yyVAL.str = string(yyDollar[1].str) } case 240: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1499 +//line sql.y:1505 { yyVAL.str = string(yyDollar[1].str) } case 241: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1504 +//line sql.y:1510 { yyVAL.str = "" } case 242: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1508 +//line sql.y:1514 { yyVAL.str = string(yyDollar[1].colIdent.String()) } case 243: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1514 + var yyLOCAL []*IndexColumn +//line sql.y:1520 { - yyVAL.indexColumns = []*IndexColumn{yyDollar[1].indexColumn} + yyLOCAL = []*IndexColumn{yyDollar[1].indexColumnUnion()} } + yyVAL.union = yyLOCAL case 244: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1518 +//line sql.y:1524 { - yyVAL.indexColumns = append(yyVAL.indexColumns, yyDollar[3].indexColumn) + yySLICE := (*[]*IndexColumn)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].indexColumnUnion()) } case 245: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1524 + var yyLOCAL *IndexColumn +//line sql.y:1530 { - yyVAL.indexColumn = &IndexColumn{Column: yyDollar[1].colIdent, Length: yyDollar[2].literal, Direction: yyDollar[3].orderDirection} + yyLOCAL = &IndexColumn{Column: yyDollar[1].colIdent, Length: yyDollar[2].literalUnion(), Direction: yyDollar[3].orderDirectionUnion()} } + yyVAL.union = yyLOCAL case 246: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1530 + var yyLOCAL *ConstraintDefinition +//line sql.y:1536 { - yyVAL.constraintDefinition = &ConstraintDefinition{Name: string(yyDollar[2].colIdent.String()), Details: yyDollar[3].constraintInfo} + yyLOCAL = &ConstraintDefinition{Name: string(yyDollar[2].colIdent.String()), Details: yyDollar[3].constraintInfoUnion()} } + yyVAL.union = yyLOCAL case 247: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1534 + var yyLOCAL *ConstraintDefinition +//line sql.y:1540 { - yyVAL.constraintDefinition = &ConstraintDefinition{Details: yyDollar[1].constraintInfo} + yyLOCAL = &ConstraintDefinition{Details: yyDollar[1].constraintInfoUnion()} } + yyVAL.union = yyLOCAL case 248: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1540 + var yyLOCAL *ConstraintDefinition +//line sql.y:1546 { - yyVAL.constraintDefinition = &ConstraintDefinition{Name: string(yyDollar[2].colIdent.String()), Details: yyDollar[3].constraintInfo} + yyLOCAL = &ConstraintDefinition{Name: string(yyDollar[2].colIdent.String()), Details: yyDollar[3].constraintInfoUnion()} } + yyVAL.union = yyLOCAL case 249: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1544 + var yyLOCAL *ConstraintDefinition +//line sql.y:1550 { - yyVAL.constraintDefinition = &ConstraintDefinition{Details: yyDollar[1].constraintInfo} + yyLOCAL = &ConstraintDefinition{Details: yyDollar[1].constraintInfoUnion()} } + yyVAL.union = yyLOCAL case 250: yyDollar = yyS[yypt-10 : yypt+1] -//line sql.y:1550 + var yyLOCAL ConstraintInfo +//line sql.y:1556 { - yyVAL.constraintInfo = &ForeignKeyDefinition{Source: yyDollar[4].columns, ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columns} + yyLOCAL = &ForeignKeyDefinition{Source: yyDollar[4].columnsUnion(), ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columnsUnion()} } + yyVAL.union = yyLOCAL case 251: yyDollar = yyS[yypt-11 : yypt+1] -//line sql.y:1554 + var yyLOCAL ConstraintInfo +//line sql.y:1560 { - yyVAL.constraintInfo = &ForeignKeyDefinition{Source: yyDollar[4].columns, ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columns, OnDelete: yyDollar[11].ReferenceAction} + yyLOCAL = &ForeignKeyDefinition{Source: yyDollar[4].columnsUnion(), ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columnsUnion(), OnDelete: yyDollar[11].ReferenceActionUnion()} } + yyVAL.union = yyLOCAL case 252: yyDollar = yyS[yypt-11 : yypt+1] -//line sql.y:1558 + var yyLOCAL ConstraintInfo +//line sql.y:1564 { - yyVAL.constraintInfo = &ForeignKeyDefinition{Source: yyDollar[4].columns, ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columns, OnUpdate: yyDollar[11].ReferenceAction} + yyLOCAL = &ForeignKeyDefinition{Source: yyDollar[4].columnsUnion(), ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columnsUnion(), OnUpdate: yyDollar[11].ReferenceActionUnion()} } + yyVAL.union = yyLOCAL case 253: yyDollar = yyS[yypt-12 : yypt+1] -//line sql.y:1562 + var yyLOCAL ConstraintInfo +//line sql.y:1568 { - yyVAL.constraintInfo = &ForeignKeyDefinition{Source: yyDollar[4].columns, ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columns, OnDelete: yyDollar[11].ReferenceAction, OnUpdate: yyDollar[12].ReferenceAction} + yyLOCAL = &ForeignKeyDefinition{Source: yyDollar[4].columnsUnion(), ReferencedTable: yyDollar[7].tableName, ReferencedColumns: yyDollar[9].columnsUnion(), OnDelete: yyDollar[11].ReferenceActionUnion(), OnUpdate: yyDollar[12].ReferenceActionUnion()} } + yyVAL.union = yyLOCAL case 254: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1568 + var yyLOCAL ConstraintInfo +//line sql.y:1574 { - yyVAL.constraintInfo = &CheckConstraintDefinition{Expr: yyDollar[3].expr, Enforced: yyDollar[5].boolean} + yyLOCAL = &CheckConstraintDefinition{Expr: yyDollar[3].exprUnion(), Enforced: yyDollar[5].booleanUnion()} } + yyVAL.union = yyLOCAL case 255: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1574 + var yyLOCAL ReferenceAction +//line sql.y:1580 { - yyVAL.ReferenceAction = yyDollar[3].ReferenceAction + yyLOCAL = yyDollar[3].ReferenceActionUnion() } + yyVAL.union = yyLOCAL case 256: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1580 + var yyLOCAL ReferenceAction +//line sql.y:1586 { - yyVAL.ReferenceAction = yyDollar[3].ReferenceAction + yyLOCAL = yyDollar[3].ReferenceActionUnion() } + yyVAL.union = yyLOCAL case 257: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1586 + var yyLOCAL ReferenceAction +//line sql.y:1592 { - yyVAL.ReferenceAction = Restrict + yyLOCAL = Restrict } + yyVAL.union = yyLOCAL case 258: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1590 + var yyLOCAL ReferenceAction +//line sql.y:1596 { - yyVAL.ReferenceAction = Cascade + yyLOCAL = Cascade } + yyVAL.union = yyLOCAL case 259: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1594 + var yyLOCAL ReferenceAction +//line sql.y:1600 { - yyVAL.ReferenceAction = NoAction + yyLOCAL = NoAction } + yyVAL.union = yyLOCAL case 260: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1598 + var yyLOCAL ReferenceAction +//line sql.y:1604 { - yyVAL.ReferenceAction = SetDefault + yyLOCAL = SetDefault } + yyVAL.union = yyLOCAL case 261: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1602 + var yyLOCAL ReferenceAction +//line sql.y:1608 { - yyVAL.ReferenceAction = SetNull + yyLOCAL = SetNull } + yyVAL.union = yyLOCAL case 262: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1607 +//line sql.y:1613 { yyVAL.str = "" } case 263: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1611 +//line sql.y:1617 { yyVAL.str = string(yyDollar[1].str) } case 264: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1615 +//line sql.y:1621 { yyVAL.str = string(yyDollar[1].str) } case 265: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1620 + var yyLOCAL bool +//line sql.y:1626 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 266: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1624 + var yyLOCAL bool +//line sql.y:1630 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 267: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1628 + var yyLOCAL bool +//line sql.y:1634 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 268: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1633 + var yyLOCAL TableOptions +//line sql.y:1639 { - yyVAL.tableOptions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 269: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1637 + var yyLOCAL TableOptions +//line sql.y:1643 { - yyVAL.tableOptions = yyDollar[1].tableOptions + yyLOCAL = yyDollar[1].tableOptionsUnion() } + yyVAL.union = yyLOCAL case 270: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1643 + var yyLOCAL TableOptions +//line sql.y:1649 { - yyVAL.tableOptions = TableOptions{yyDollar[1].tableOption} + yyLOCAL = TableOptions{yyDollar[1].tableOptionUnion()} } + yyVAL.union = yyLOCAL case 271: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1647 +//line sql.y:1653 { - yyVAL.tableOptions = append(yyDollar[1].tableOptions, yyDollar[3].tableOption) + yySLICE := (*TableOptions)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableOptionUnion()) } case 272: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1651 +//line sql.y:1657 { - yyVAL.tableOptions = append(yyDollar[1].tableOptions, yyDollar[2].tableOption) + yySLICE := (*TableOptions)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].tableOptionUnion()) } case 273: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1657 + var yyLOCAL TableOptions +//line sql.y:1663 { - yyVAL.tableOptions = TableOptions{yyDollar[1].tableOption} + yyLOCAL = TableOptions{yyDollar[1].tableOptionUnion()} } + yyVAL.union = yyLOCAL case 274: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1661 +//line sql.y:1667 { - yyVAL.tableOptions = append(yyDollar[1].tableOptions, yyDollar[2].tableOption) + yySLICE := (*TableOptions)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].tableOptionUnion()) } case 275: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1667 + var yyLOCAL *TableOption +//line sql.y:1673 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 276: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1671 + var yyLOCAL *TableOption +//line sql.y:1677 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 277: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1675 + var yyLOCAL *TableOption +//line sql.y:1681 { - yyVAL.tableOption = &TableOption{Name: (string(yyDollar[2].str)), String: yyDollar[4].str} + yyLOCAL = &TableOption{Name: (string(yyDollar[2].str)), String: yyDollar[4].str} } + yyVAL.union = yyLOCAL case 278: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1679 + var yyLOCAL *TableOption +//line sql.y:1685 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[2].str), String: yyDollar[4].str} + yyLOCAL = &TableOption{Name: string(yyDollar[2].str), String: yyDollar[4].str} } + yyVAL.union = yyLOCAL case 279: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1683 + var yyLOCAL *TableOption +//line sql.y:1689 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 280: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1687 + var yyLOCAL *TableOption +//line sql.y:1693 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 281: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1691 + var yyLOCAL *TableOption +//line sql.y:1697 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 282: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1695 + var yyLOCAL *TableOption +//line sql.y:1701 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 283: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1699 + var yyLOCAL *TableOption +//line sql.y:1705 { - yyVAL.tableOption = &TableOption{Name: (string(yyDollar[1].str) + " " + string(yyDollar[2].str)), Value: NewStrLiteral(yyDollar[4].str)} + yyLOCAL = &TableOption{Name: (string(yyDollar[1].str) + " " + string(yyDollar[2].str)), Value: NewStrLiteral(yyDollar[4].str)} } + yyVAL.union = yyLOCAL case 284: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1703 + var yyLOCAL *TableOption +//line sql.y:1709 { - yyVAL.tableOption = &TableOption{Name: (string(yyDollar[1].str) + " " + string(yyDollar[2].str)), Value: NewStrLiteral(yyDollar[4].str)} + yyLOCAL = &TableOption{Name: (string(yyDollar[1].str) + " " + string(yyDollar[2].str)), Value: NewStrLiteral(yyDollar[4].str)} } + yyVAL.union = yyLOCAL case 285: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1707 + var yyLOCAL *TableOption +//line sql.y:1713 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 286: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1711 + var yyLOCAL *TableOption +//line sql.y:1717 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 287: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1715 + var yyLOCAL *TableOption +//line sql.y:1721 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: yyDollar[3].colIdent.String()} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: yyDollar[3].colIdent.String()} } + yyVAL.union = yyLOCAL case 288: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1719 + var yyLOCAL *TableOption +//line sql.y:1725 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 289: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1723 + var yyLOCAL *TableOption +//line sql.y:1729 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 290: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1727 + var yyLOCAL *TableOption +//line sql.y:1733 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 291: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1731 + var yyLOCAL *TableOption +//line sql.y:1737 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 292: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1735 + var yyLOCAL *TableOption +//line sql.y:1741 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 293: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1739 + var yyLOCAL *TableOption +//line sql.y:1745 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 294: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1743 + var yyLOCAL *TableOption +//line sql.y:1749 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 295: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1747 + var yyLOCAL *TableOption +//line sql.y:1753 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewStrLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 296: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1751 + var yyLOCAL *TableOption +//line sql.y:1757 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 297: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1755 + var yyLOCAL *TableOption +//line sql.y:1761 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 298: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1759 + var yyLOCAL *TableOption +//line sql.y:1765 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 299: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1763 + var yyLOCAL *TableOption +//line sql.y:1769 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 300: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1767 + var yyLOCAL *TableOption +//line sql.y:1773 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: string(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 301: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1771 + var yyLOCAL *TableOption +//line sql.y:1777 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Value: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 302: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1775 + var yyLOCAL *TableOption +//line sql.y:1781 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), String: (yyDollar[3].colIdent.String() + yyDollar[4].str)} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), String: (yyDollar[3].colIdent.String() + yyDollar[4].str)} } + yyVAL.union = yyLOCAL case 303: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1779 + var yyLOCAL *TableOption +//line sql.y:1785 { - yyVAL.tableOption = &TableOption{Name: string(yyDollar[1].str), Tables: yyDollar[4].tableNames} + yyLOCAL = &TableOption{Name: string(yyDollar[1].str), Tables: yyDollar[4].tableNamesUnion()} } + yyVAL.union = yyLOCAL case 304: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1784 +//line sql.y:1790 { yyVAL.str = "" } case 305: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1788 +//line sql.y:1794 { yyVAL.str = " " + string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 306: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1792 +//line sql.y:1798 { yyVAL.str = " " + string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 316: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1811 +//line sql.y:1817 { yyVAL.str = yyDollar[1].colIdent.String() } case 317: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1815 +//line sql.y:1821 { yyVAL.str = encodeSQLString(yyDollar[1].str) } case 318: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1819 +//line sql.y:1825 { yyVAL.str = string(yyDollar[1].str) } case 319: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1824 +//line sql.y:1830 { yyVAL.str = "" } case 321: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1830 + var yyLOCAL *ColName +//line sql.y:1836 { - yyVAL.colName = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 322: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1834 + var yyLOCAL *ColName +//line sql.y:1840 { - yyVAL.colName = yyDollar[2].colName + yyLOCAL = yyDollar[2].colNameUnion() } + yyVAL.union = yyLOCAL case 323: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1839 + var yyLOCAL *ColName +//line sql.y:1845 { - yyVAL.colName = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 324: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1843 + var yyLOCAL *ColName +//line sql.y:1849 { - yyVAL.colName = yyDollar[2].colName + yyLOCAL = yyDollar[2].colNameUnion() } + yyVAL.union = yyLOCAL case 325: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:1848 + var yyLOCAL []AlterOption +//line sql.y:1854 { - yyVAL.alterOptions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 326: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1852 + var yyLOCAL []AlterOption +//line sql.y:1858 { - yyVAL.alterOptions = yyDollar[1].alterOptions + yyLOCAL = yyDollar[1].alterOptionsUnion() } + yyVAL.union = yyLOCAL case 327: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1856 +//line sql.y:1862 { - yyVAL.alterOptions = append(yyDollar[1].alterOptions, &OrderByOption{Cols: yyDollar[5].columns}) + yySLICE := (*[]AlterOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, &OrderByOption{Cols: yyDollar[5].columnsUnion()}) } case 328: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1860 + var yyLOCAL []AlterOption +//line sql.y:1866 { - yyVAL.alterOptions = yyDollar[1].alterOptions + yyLOCAL = yyDollar[1].alterOptionsUnion() } + yyVAL.union = yyLOCAL case 329: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1864 +//line sql.y:1870 { - yyVAL.alterOptions = append(yyDollar[1].alterOptions, yyDollar[3].alterOptions...) + yySLICE := (*[]AlterOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].alterOptionsUnion()...) } case 330: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:1868 + var yyLOCAL []AlterOption +//line sql.y:1874 { - yyVAL.alterOptions = append(append(yyDollar[1].alterOptions, yyDollar[3].alterOptions...), &OrderByOption{Cols: yyDollar[7].columns}) + yyLOCAL = append(append(yyDollar[1].alterOptionsUnion(), yyDollar[3].alterOptionsUnion()...), &OrderByOption{Cols: yyDollar[7].columnsUnion()}) } + yyVAL.union = yyLOCAL case 331: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1874 + var yyLOCAL []AlterOption +//line sql.y:1880 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 332: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1878 +//line sql.y:1884 { - yyVAL.alterOptions = append(yyDollar[1].alterOptions, yyDollar[3].alterOption) + yySLICE := (*[]AlterOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].alterOptionUnion()) } case 333: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1882 +//line sql.y:1888 { - yyVAL.alterOptions = append(yyDollar[1].alterOptions, yyDollar[3].alterOption) + yySLICE := (*[]AlterOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].alterOptionUnion()) } case 334: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1888 + var yyLOCAL AlterOption +//line sql.y:1894 { - yyVAL.alterOption = yyDollar[1].tableOptions + yyLOCAL = yyDollar[1].tableOptionsUnion() } + yyVAL.union = yyLOCAL case 335: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1892 + var yyLOCAL AlterOption +//line sql.y:1898 { - yyVAL.alterOption = &AddConstraintDefinition{ConstraintDefinition: yyDollar[2].constraintDefinition} + yyLOCAL = &AddConstraintDefinition{ConstraintDefinition: yyDollar[2].constraintDefinitionUnion()} } + yyVAL.union = yyLOCAL case 336: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1896 + var yyLOCAL AlterOption +//line sql.y:1902 { - yyVAL.alterOption = &AddConstraintDefinition{ConstraintDefinition: yyDollar[2].constraintDefinition} + yyLOCAL = &AddConstraintDefinition{ConstraintDefinition: yyDollar[2].constraintDefinitionUnion()} } + yyVAL.union = yyLOCAL case 337: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1900 + var yyLOCAL AlterOption +//line sql.y:1906 { - yyVAL.alterOption = &AddIndexDefinition{IndexDefinition: yyDollar[2].indexDefinition} + yyLOCAL = &AddIndexDefinition{IndexDefinition: yyDollar[2].indexDefinitionUnion()} } + yyVAL.union = yyLOCAL case 338: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1904 + var yyLOCAL AlterOption +//line sql.y:1910 { - yyVAL.alterOption = &AddColumns{Columns: yyDollar[4].columnDefinitions} + yyLOCAL = &AddColumns{Columns: yyDollar[4].columnDefinitionsUnion()} } + yyVAL.union = yyLOCAL case 339: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1908 + var yyLOCAL AlterOption +//line sql.y:1914 { - yyVAL.alterOption = &AddColumns{Columns: []*ColumnDefinition{yyDollar[3].columnDefinition}, First: yyDollar[4].colName, After: yyDollar[5].colName} + yyLOCAL = &AddColumns{Columns: []*ColumnDefinition{yyDollar[3].columnDefinitionUnion()}, First: yyDollar[4].colNameUnion(), After: yyDollar[5].colNameUnion()} } + yyVAL.union = yyLOCAL case 340: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1912 + var yyLOCAL AlterOption +//line sql.y:1918 { - yyVAL.alterOption = &AlterColumn{Column: yyDollar[3].colName, DropDefault: true} + yyLOCAL = &AlterColumn{Column: yyDollar[3].colNameUnion(), DropDefault: true} } + yyVAL.union = yyLOCAL case 341: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:1916 + var yyLOCAL AlterOption +//line sql.y:1922 { - yyVAL.alterOption = &AlterColumn{Column: yyDollar[3].colName, DropDefault: false, DefaultVal: yyDollar[6].expr} + yyLOCAL = &AlterColumn{Column: yyDollar[3].colNameUnion(), DropDefault: false, DefaultVal: yyDollar[6].exprUnion()} } + yyVAL.union = yyLOCAL case 342: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:1920 + var yyLOCAL AlterOption +//line sql.y:1926 { - yyVAL.alterOption = &ChangeColumn{OldColumn: yyDollar[3].colName, NewColDefinition: yyDollar[4].columnDefinition, First: yyDollar[5].colName, After: yyDollar[6].colName} + yyLOCAL = &ChangeColumn{OldColumn: yyDollar[3].colNameUnion(), NewColDefinition: yyDollar[4].columnDefinitionUnion(), First: yyDollar[5].colNameUnion(), After: yyDollar[6].colNameUnion()} } + yyVAL.union = yyLOCAL case 343: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1924 + var yyLOCAL AlterOption +//line sql.y:1930 { - yyVAL.alterOption = &ModifyColumn{NewColDefinition: yyDollar[3].columnDefinition, First: yyDollar[4].colName, After: yyDollar[5].colName} + yyLOCAL = &ModifyColumn{NewColDefinition: yyDollar[3].columnDefinitionUnion(), First: yyDollar[4].colNameUnion(), After: yyDollar[5].colNameUnion()} } + yyVAL.union = yyLOCAL case 344: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1928 + var yyLOCAL AlterOption +//line sql.y:1934 { - yyVAL.alterOption = &AlterCharset{CharacterSet: yyDollar[4].str, Collate: yyDollar[5].str} + yyLOCAL = &AlterCharset{CharacterSet: yyDollar[4].str, Collate: yyDollar[5].str} } + yyVAL.union = yyLOCAL case 345: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1932 + var yyLOCAL AlterOption +//line sql.y:1938 { - yyVAL.alterOption = &KeyState{Enable: false} + yyLOCAL = &KeyState{Enable: false} } + yyVAL.union = yyLOCAL case 346: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1936 + var yyLOCAL AlterOption +//line sql.y:1942 { - yyVAL.alterOption = &KeyState{Enable: true} + yyLOCAL = &KeyState{Enable: true} } + yyVAL.union = yyLOCAL case 347: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1940 + var yyLOCAL AlterOption +//line sql.y:1946 { - yyVAL.alterOption = &TablespaceOperation{Import: false} + yyLOCAL = &TablespaceOperation{Import: false} } + yyVAL.union = yyLOCAL case 348: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:1944 + var yyLOCAL AlterOption +//line sql.y:1950 { - yyVAL.alterOption = &TablespaceOperation{Import: true} + yyLOCAL = &TablespaceOperation{Import: true} } + yyVAL.union = yyLOCAL case 349: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1948 + var yyLOCAL AlterOption +//line sql.y:1954 { - yyVAL.alterOption = &DropColumn{Name: yyDollar[3].colName} + yyLOCAL = &DropColumn{Name: yyDollar[3].colNameUnion()} } + yyVAL.union = yyLOCAL case 350: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1952 + var yyLOCAL AlterOption +//line sql.y:1958 { - yyVAL.alterOption = &DropKey{Type: NormalKeyType, Name: yyDollar[3].colIdent.String()} + yyLOCAL = &DropKey{Type: NormalKeyType, Name: yyDollar[3].colIdent.String()} } + yyVAL.union = yyLOCAL case 351: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1956 + var yyLOCAL AlterOption +//line sql.y:1962 { - yyVAL.alterOption = &DropKey{Type: PrimaryKeyType} + yyLOCAL = &DropKey{Type: PrimaryKeyType} } + yyVAL.union = yyLOCAL case 352: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:1960 + var yyLOCAL AlterOption +//line sql.y:1966 { - yyVAL.alterOption = &DropKey{Type: ForeignKeyType, Name: yyDollar[4].colIdent.String()} + yyLOCAL = &DropKey{Type: ForeignKeyType, Name: yyDollar[4].colIdent.String()} } + yyVAL.union = yyLOCAL case 353: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1964 + var yyLOCAL AlterOption +//line sql.y:1970 { - yyVAL.alterOption = &Force{} + yyLOCAL = &Force{} } + yyVAL.union = yyLOCAL case 354: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1968 + var yyLOCAL AlterOption +//line sql.y:1974 { - yyVAL.alterOption = &RenameTableName{Table: yyDollar[3].tableName} + yyLOCAL = &RenameTableName{Table: yyDollar[3].tableName} } + yyVAL.union = yyLOCAL case 355: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:1972 + var yyLOCAL AlterOption +//line sql.y:1978 { - yyVAL.alterOption = &RenameIndex{OldName: yyDollar[3].colIdent.String(), NewName: yyDollar[5].colIdent.String()} + yyLOCAL = &RenameIndex{OldName: yyDollar[3].colIdent.String(), NewName: yyDollar[5].colIdent.String()} } + yyVAL.union = yyLOCAL case 356: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:1978 + var yyLOCAL []AlterOption +//line sql.y:1984 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 357: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1982 +//line sql.y:1988 { - yyVAL.alterOptions = append(yyDollar[1].alterOptions, yyDollar[3].alterOption) + yySLICE := (*[]AlterOption)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].alterOptionUnion()) } case 358: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1988 + var yyLOCAL AlterOption +//line sql.y:1994 { - yyVAL.alterOption = AlgorithmValue(string(yyDollar[3].str)) + yyLOCAL = AlgorithmValue(string(yyDollar[3].str)) } + yyVAL.union = yyLOCAL case 359: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1992 + var yyLOCAL AlterOption +//line sql.y:1998 { - yyVAL.alterOption = AlgorithmValue(string(yyDollar[3].str)) + yyLOCAL = AlgorithmValue(string(yyDollar[3].str)) } + yyVAL.union = yyLOCAL case 360: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:1996 + var yyLOCAL AlterOption +//line sql.y:2002 { - yyVAL.alterOption = AlgorithmValue(string(yyDollar[3].str)) + yyLOCAL = AlgorithmValue(string(yyDollar[3].str)) } + yyVAL.union = yyLOCAL case 361: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2000 + var yyLOCAL AlterOption +//line sql.y:2006 { - yyVAL.alterOption = &LockOption{Type: DefaultType} + yyLOCAL = &LockOption{Type: DefaultType} } + yyVAL.union = yyLOCAL case 362: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2004 + var yyLOCAL AlterOption +//line sql.y:2010 { - yyVAL.alterOption = &LockOption{Type: NoneType} + yyLOCAL = &LockOption{Type: NoneType} } + yyVAL.union = yyLOCAL case 363: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2008 + var yyLOCAL AlterOption +//line sql.y:2014 { - yyVAL.alterOption = &LockOption{Type: SharedType} + yyLOCAL = &LockOption{Type: SharedType} } + yyVAL.union = yyLOCAL case 364: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2012 + var yyLOCAL AlterOption +//line sql.y:2018 { - yyVAL.alterOption = &LockOption{Type: ExclusiveType} + yyLOCAL = &LockOption{Type: ExclusiveType} } + yyVAL.union = yyLOCAL case 365: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2016 + var yyLOCAL AlterOption +//line sql.y:2022 { - yyVAL.alterOption = &Validation{With: true} + yyLOCAL = &Validation{With: true} } + yyVAL.union = yyLOCAL case 366: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2020 + var yyLOCAL AlterOption +//line sql.y:2026 { - yyVAL.alterOption = &Validation{With: false} + yyLOCAL = &Validation{With: false} } + yyVAL.union = yyLOCAL case 367: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2026 + var yyLOCAL Statement +//line sql.y:2032 { - yyDollar[1].alterTable.FullyParsed = true - yyDollar[1].alterTable.AlterOptions = yyDollar[2].alterOptions - yyVAL.statement = yyDollar[1].alterTable + yyDollar[1].alterTableUnion().FullyParsed = true + yyDollar[1].alterTableUnion().AlterOptions = yyDollar[2].alterOptionsUnion() + yyLOCAL = yyDollar[1].alterTableUnion() } + yyVAL.union = yyLOCAL case 368: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2032 + var yyLOCAL Statement +//line sql.y:2038 { - yyDollar[1].alterTable.FullyParsed = true - yyDollar[1].alterTable.AlterOptions = yyDollar[2].alterOptions - yyDollar[1].alterTable.PartitionSpec = &PartitionSpec{Action: RemoveAction} - yyVAL.statement = yyDollar[1].alterTable + yyDollar[1].alterTableUnion().FullyParsed = true + yyDollar[1].alterTableUnion().AlterOptions = yyDollar[2].alterOptionsUnion() + yyDollar[1].alterTableUnion().PartitionSpec = &PartitionSpec{Action: RemoveAction} + yyLOCAL = yyDollar[1].alterTableUnion() } + yyVAL.union = yyLOCAL case 369: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2039 + var yyLOCAL Statement +//line sql.y:2045 { - yyDollar[1].alterTable.FullyParsed = true - yyDollar[1].alterTable.AlterOptions = yyDollar[2].alterOptions - yyDollar[1].alterTable.PartitionSpec = yyDollar[4].partSpec - yyVAL.statement = yyDollar[1].alterTable + yyDollar[1].alterTableUnion().FullyParsed = true + yyDollar[1].alterTableUnion().AlterOptions = yyDollar[2].alterOptionsUnion() + yyDollar[1].alterTableUnion().PartitionSpec = yyDollar[4].partSpecUnion() + yyLOCAL = yyDollar[1].alterTableUnion() } + yyVAL.union = yyLOCAL case 370: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2046 + var yyLOCAL Statement +//line sql.y:2052 { - yyDollar[1].alterTable.FullyParsed = true - yyDollar[1].alterTable.PartitionSpec = yyDollar[2].partSpec - yyVAL.statement = yyDollar[1].alterTable + yyDollar[1].alterTableUnion().FullyParsed = true + yyDollar[1].alterTableUnion().PartitionSpec = yyDollar[2].partSpecUnion() + yyLOCAL = yyDollar[1].alterTableUnion() } + yyVAL.union = yyLOCAL case 371: yyDollar = yyS[yypt-10 : yypt+1] -//line sql.y:2052 + var yyLOCAL Statement +//line sql.y:2058 { - yyVAL.statement = &AlterView{ViewName: yyDollar[6].tableName.ToViewName(), Algorithm: yyDollar[2].str, Definer: yyDollar[3].str, Security: yyDollar[4].str, Columns: yyDollar[7].columns, Select: yyDollar[9].selStmt, CheckOption: yyDollar[10].str} + yyLOCAL = &AlterView{ViewName: yyDollar[6].tableName.ToViewName(), Algorithm: yyDollar[2].str, Definer: yyDollar[3].str, Security: yyDollar[4].str, Columns: yyDollar[7].columnsUnion(), Select: yyDollar[9].selStmtUnion(), CheckOption: yyDollar[10].str} } + yyVAL.union = yyLOCAL case 372: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2056 + var yyLOCAL Statement +//line sql.y:2062 { - yyDollar[1].alterDatabase.FullyParsed = true - yyDollar[1].alterDatabase.DBName = yyDollar[2].colIdent.String() - yyDollar[1].alterDatabase.AlterOptions = yyDollar[3].collateAndCharsets - yyVAL.statement = yyDollar[1].alterDatabase + yyDollar[1].alterDatabaseUnion().FullyParsed = true + yyDollar[1].alterDatabaseUnion().DBName = yyDollar[2].colIdent.String() + yyDollar[1].alterDatabaseUnion().AlterOptions = yyDollar[3].collateAndCharsetsUnion() + yyLOCAL = yyDollar[1].alterDatabaseUnion() } + yyVAL.union = yyLOCAL case 373: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:2063 + var yyLOCAL Statement +//line sql.y:2069 { - yyDollar[1].alterDatabase.FullyParsed = true - yyDollar[1].alterDatabase.DBName = yyDollar[2].colIdent.String() - yyDollar[1].alterDatabase.UpdateDataDirectory = true - yyVAL.statement = yyDollar[1].alterDatabase + yyDollar[1].alterDatabaseUnion().FullyParsed = true + yyDollar[1].alterDatabaseUnion().DBName = yyDollar[2].colIdent.String() + yyDollar[1].alterDatabaseUnion().UpdateDataDirectory = true + yyLOCAL = yyDollar[1].alterDatabaseUnion() } + yyVAL.union = yyLOCAL case 374: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2070 + var yyLOCAL Statement +//line sql.y:2076 { - yyVAL.statement = &AlterVschema{ + yyLOCAL = &AlterVschema{ Action: CreateVindexDDLAction, Table: yyDollar[5].tableName, VindexSpec: &VindexSpec{ Name: NewColIdent(yyDollar[5].tableName.Name.String()), Type: yyDollar[6].colIdent, - Params: yyDollar[7].vindexParams, + Params: yyDollar[7].vindexParamsUnion(), }, } } + yyVAL.union = yyLOCAL case 375: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2082 + var yyLOCAL Statement +//line sql.y:2088 { - yyVAL.statement = &AlterVschema{ + yyLOCAL = &AlterVschema{ Action: DropVindexDDLAction, Table: yyDollar[5].tableName, VindexSpec: &VindexSpec{ @@ -7489,38 +8257,46 @@ yydefault: }, } } + yyVAL.union = yyLOCAL case 376: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2092 + var yyLOCAL Statement +//line sql.y:2098 { - yyVAL.statement = &AlterVschema{Action: AddVschemaTableDDLAction, Table: yyDollar[5].tableName} + yyLOCAL = &AlterVschema{Action: AddVschemaTableDDLAction, Table: yyDollar[5].tableName} } + yyVAL.union = yyLOCAL case 377: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2096 + var yyLOCAL Statement +//line sql.y:2102 { - yyVAL.statement = &AlterVschema{Action: DropVschemaTableDDLAction, Table: yyDollar[5].tableName} + yyLOCAL = &AlterVschema{Action: DropVschemaTableDDLAction, Table: yyDollar[5].tableName} } + yyVAL.union = yyLOCAL case 378: yyDollar = yyS[yypt-12 : yypt+1] -//line sql.y:2100 + var yyLOCAL Statement +//line sql.y:2106 { - yyVAL.statement = &AlterVschema{ + yyLOCAL = &AlterVschema{ Action: AddColVindexDDLAction, Table: yyDollar[4].tableName, VindexSpec: &VindexSpec{ Name: yyDollar[7].colIdent, Type: yyDollar[11].colIdent, - Params: yyDollar[12].vindexParams, + Params: yyDollar[12].vindexParamsUnion(), }, - VindexCols: yyDollar[9].columns, + VindexCols: yyDollar[9].columnsUnion(), } } + yyVAL.union = yyLOCAL case 379: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2113 + var yyLOCAL Statement +//line sql.y:2119 { - yyVAL.statement = &AlterVschema{ + yyLOCAL = &AlterVschema{ Action: DropColVindexDDLAction, Table: yyDollar[4].tableName, VindexSpec: &VindexSpec{ @@ -7528,17 +8304,21 @@ yydefault: }, } } + yyVAL.union = yyLOCAL case 380: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2123 + var yyLOCAL Statement +//line sql.y:2129 { - yyVAL.statement = &AlterVschema{Action: AddSequenceDDLAction, Table: yyDollar[5].tableName} + yyLOCAL = &AlterVschema{Action: AddSequenceDDLAction, Table: yyDollar[5].tableName} } + yyVAL.union = yyLOCAL case 381: yyDollar = yyS[yypt-9 : yypt+1] -//line sql.y:2127 + var yyLOCAL Statement +//line sql.y:2133 { - yyVAL.statement = &AlterVschema{ + yyLOCAL = &AlterVschema{ Action: AddAutoIncDDLAction, Table: yyDollar[4].tableName, AutoIncSpec: &AutoIncSpec{ @@ -7547,3357 +8327,4167 @@ yydefault: }, } } + yyVAL.union = yyLOCAL case 382: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2140 + var yyLOCAL *PartitionSpec +//line sql.y:2146 { - yyVAL.partSpec = &PartitionSpec{Action: AddAction, Definitions: []*PartitionDefinition{yyDollar[4].partDef}} + yyLOCAL = &PartitionSpec{Action: AddAction, Definitions: []*PartitionDefinition{yyDollar[4].partDefUnion()}} } + yyVAL.union = yyLOCAL case 383: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2144 + var yyLOCAL *PartitionSpec +//line sql.y:2150 { - yyVAL.partSpec = &PartitionSpec{Action: DropAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: DropAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 384: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2148 + var yyLOCAL *PartitionSpec +//line sql.y:2154 { - yyVAL.partSpec = &PartitionSpec{Action: ReorganizeAction, Names: yyDollar[3].partitions, Definitions: yyDollar[6].partDefs} + yyLOCAL = &PartitionSpec{Action: ReorganizeAction, Names: yyDollar[3].partitionsUnion(), Definitions: yyDollar[6].partDefsUnion()} } + yyVAL.union = yyLOCAL case 385: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2152 + var yyLOCAL *PartitionSpec +//line sql.y:2158 { - yyVAL.partSpec = &PartitionSpec{Action: DiscardAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: DiscardAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 386: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2156 + var yyLOCAL *PartitionSpec +//line sql.y:2162 { - yyVAL.partSpec = &PartitionSpec{Action: DiscardAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: DiscardAction, IsAll: true} } + yyVAL.union = yyLOCAL case 387: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2160 + var yyLOCAL *PartitionSpec +//line sql.y:2166 { - yyVAL.partSpec = &PartitionSpec{Action: ImportAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: ImportAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 388: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2164 + var yyLOCAL *PartitionSpec +//line sql.y:2170 { - yyVAL.partSpec = &PartitionSpec{Action: ImportAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: ImportAction, IsAll: true} } + yyVAL.union = yyLOCAL case 389: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2168 + var yyLOCAL *PartitionSpec +//line sql.y:2174 { - yyVAL.partSpec = &PartitionSpec{Action: TruncateAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: TruncateAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 390: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2172 + var yyLOCAL *PartitionSpec +//line sql.y:2178 { - yyVAL.partSpec = &PartitionSpec{Action: TruncateAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: TruncateAction, IsAll: true} } + yyVAL.union = yyLOCAL case 391: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2176 + var yyLOCAL *PartitionSpec +//line sql.y:2182 { - yyVAL.partSpec = &PartitionSpec{Action: CoalesceAction, Number: NewIntLiteral(yyDollar[3].str)} + yyLOCAL = &PartitionSpec{Action: CoalesceAction, Number: NewIntLiteral(yyDollar[3].str)} } + yyVAL.union = yyLOCAL case 392: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2180 + var yyLOCAL *PartitionSpec +//line sql.y:2186 { - yyVAL.partSpec = &PartitionSpec{Action: ExchangeAction, Names: Partitions{yyDollar[3].colIdent}, TableName: yyDollar[6].tableName, WithoutValidation: yyDollar[7].boolean} + yyLOCAL = &PartitionSpec{Action: ExchangeAction, Names: Partitions{yyDollar[3].colIdent}, TableName: yyDollar[6].tableName, WithoutValidation: yyDollar[7].booleanUnion()} } + yyVAL.union = yyLOCAL case 393: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2184 + var yyLOCAL *PartitionSpec +//line sql.y:2190 { - yyVAL.partSpec = &PartitionSpec{Action: AnalyzeAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: AnalyzeAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 394: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2188 + var yyLOCAL *PartitionSpec +//line sql.y:2194 { - yyVAL.partSpec = &PartitionSpec{Action: AnalyzeAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: AnalyzeAction, IsAll: true} } + yyVAL.union = yyLOCAL case 395: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2192 + var yyLOCAL *PartitionSpec +//line sql.y:2198 { - yyVAL.partSpec = &PartitionSpec{Action: CheckAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: CheckAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 396: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2196 + var yyLOCAL *PartitionSpec +//line sql.y:2202 { - yyVAL.partSpec = &PartitionSpec{Action: CheckAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: CheckAction, IsAll: true} } + yyVAL.union = yyLOCAL case 397: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2200 + var yyLOCAL *PartitionSpec +//line sql.y:2206 { - yyVAL.partSpec = &PartitionSpec{Action: OptimizeAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: OptimizeAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 398: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2204 + var yyLOCAL *PartitionSpec +//line sql.y:2210 { - yyVAL.partSpec = &PartitionSpec{Action: OptimizeAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: OptimizeAction, IsAll: true} } + yyVAL.union = yyLOCAL case 399: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2208 + var yyLOCAL *PartitionSpec +//line sql.y:2214 { - yyVAL.partSpec = &PartitionSpec{Action: RebuildAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: RebuildAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 400: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2212 + var yyLOCAL *PartitionSpec +//line sql.y:2218 { - yyVAL.partSpec = &PartitionSpec{Action: RebuildAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: RebuildAction, IsAll: true} } + yyVAL.union = yyLOCAL case 401: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2216 + var yyLOCAL *PartitionSpec +//line sql.y:2222 { - yyVAL.partSpec = &PartitionSpec{Action: RepairAction, Names: yyDollar[3].partitions} + yyLOCAL = &PartitionSpec{Action: RepairAction, Names: yyDollar[3].partitionsUnion()} } + yyVAL.union = yyLOCAL case 402: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2220 + var yyLOCAL *PartitionSpec +//line sql.y:2226 { - yyVAL.partSpec = &PartitionSpec{Action: RepairAction, IsAll: true} + yyLOCAL = &PartitionSpec{Action: RepairAction, IsAll: true} } + yyVAL.union = yyLOCAL case 403: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2224 + var yyLOCAL *PartitionSpec +//line sql.y:2230 { - yyVAL.partSpec = &PartitionSpec{Action: UpgradeAction} + yyLOCAL = &PartitionSpec{Action: UpgradeAction} } + yyVAL.union = yyLOCAL case 404: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2229 + var yyLOCAL bool +//line sql.y:2235 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 405: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2233 + var yyLOCAL bool +//line sql.y:2239 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 406: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2237 + var yyLOCAL bool +//line sql.y:2243 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 407: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2244 + var yyLOCAL []*PartitionDefinition +//line sql.y:2250 { - yyVAL.partDefs = []*PartitionDefinition{yyDollar[1].partDef} + yyLOCAL = []*PartitionDefinition{yyDollar[1].partDefUnion()} } + yyVAL.union = yyLOCAL case 408: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2248 +//line sql.y:2254 { - yyVAL.partDefs = append(yyDollar[1].partDefs, yyDollar[3].partDef) + yySLICE := (*[]*PartitionDefinition)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].partDefUnion()) } case 409: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:2254 + var yyLOCAL *PartitionDefinition +//line sql.y:2260 { - yyVAL.partDef = &PartitionDefinition{Name: yyDollar[2].colIdent, Limit: yyDollar[7].expr} + yyLOCAL = &PartitionDefinition{Name: yyDollar[2].colIdent, Limit: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 410: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:2258 + var yyLOCAL *PartitionDefinition +//line sql.y:2264 { - yyVAL.partDef = &PartitionDefinition{Name: yyDollar[2].colIdent, Maxvalue: true} + yyLOCAL = &PartitionDefinition{Name: yyDollar[2].colIdent, Maxvalue: true} } + yyVAL.union = yyLOCAL case 411: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2264 + var yyLOCAL Statement +//line sql.y:2270 { - yyVAL.statement = &RenameTable{TablePairs: yyDollar[3].renameTablePairs} + yyLOCAL = &RenameTable{TablePairs: yyDollar[3].renameTablePairsUnion()} } + yyVAL.union = yyLOCAL case 412: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2270 + var yyLOCAL []*RenameTablePair +//line sql.y:2276 { - yyVAL.renameTablePairs = []*RenameTablePair{{FromTable: yyDollar[1].tableName, ToTable: yyDollar[3].tableName}} + yyLOCAL = []*RenameTablePair{{FromTable: yyDollar[1].tableName, ToTable: yyDollar[3].tableName}} } + yyVAL.union = yyLOCAL case 413: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2274 +//line sql.y:2280 { - yyVAL.renameTablePairs = append(yyDollar[1].renameTablePairs, &RenameTablePair{FromTable: yyDollar[3].tableName, ToTable: yyDollar[5].tableName}) + yySLICE := (*[]*RenameTablePair)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, &RenameTablePair{FromTable: yyDollar[3].tableName, ToTable: yyDollar[5].tableName}) } case 414: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:2280 + var yyLOCAL Statement +//line sql.y:2286 { - yyVAL.statement = &DropTable{FromTables: yyDollar[5].tableNames, IfExists: yyDollar[4].boolean, Temp: yyDollar[2].boolean} + yyLOCAL = &DropTable{FromTables: yyDollar[5].tableNamesUnion(), IfExists: yyDollar[4].booleanUnion(), Temp: yyDollar[2].booleanUnion()} } + yyVAL.union = yyLOCAL case 415: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:2284 + var yyLOCAL Statement +//line sql.y:2290 { // Change this to an alter statement if yyDollar[3].colIdent.Lowered() == "primary" { - yyVAL.statement = &AlterTable{Table: yyDollar[5].tableName, AlterOptions: append([]AlterOption{&DropKey{Type: PrimaryKeyType}}, yyDollar[6].alterOptions...)} + yyLOCAL = &AlterTable{Table: yyDollar[5].tableName, AlterOptions: append([]AlterOption{&DropKey{Type: PrimaryKeyType}}, yyDollar[6].alterOptionsUnion()...)} } else { - yyVAL.statement = &AlterTable{Table: yyDollar[5].tableName, AlterOptions: append([]AlterOption{&DropKey{Type: NormalKeyType, Name: yyDollar[3].colIdent.String()}}, yyDollar[6].alterOptions...)} + yyLOCAL = &AlterTable{Table: yyDollar[5].tableName, AlterOptions: append([]AlterOption{&DropKey{Type: NormalKeyType, Name: yyDollar[3].colIdent.String()}}, yyDollar[6].alterOptionsUnion()...)} } } + yyVAL.union = yyLOCAL case 416: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2293 + var yyLOCAL Statement +//line sql.y:2299 { - yyVAL.statement = &DropView{FromTables: yyDollar[4].tableNames, IfExists: yyDollar[3].boolean} + yyLOCAL = &DropView{FromTables: yyDollar[4].tableNamesUnion(), IfExists: yyDollar[3].booleanUnion()} } + yyVAL.union = yyLOCAL case 417: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2297 + var yyLOCAL Statement +//line sql.y:2303 { - yyVAL.statement = &DropDatabase{Comments: Comments(yyDollar[3].strs), DBName: string(yyDollar[5].colIdent.String()), IfExists: yyDollar[4].boolean} + yyLOCAL = &DropDatabase{Comments: Comments(yyDollar[3].strs), DBName: string(yyDollar[5].colIdent.String()), IfExists: yyDollar[4].booleanUnion()} } + yyVAL.union = yyLOCAL case 418: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2303 + var yyLOCAL Statement +//line sql.y:2309 { - yyVAL.statement = &TruncateTable{Table: yyDollar[3].tableName} + yyLOCAL = &TruncateTable{Table: yyDollar[3].tableName} } + yyVAL.union = yyLOCAL case 419: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2307 + var yyLOCAL Statement +//line sql.y:2313 { - yyVAL.statement = &TruncateTable{Table: yyDollar[2].tableName} + yyLOCAL = &TruncateTable{Table: yyDollar[2].tableName} } + yyVAL.union = yyLOCAL case 420: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2312 + var yyLOCAL Statement +//line sql.y:2318 { - yyVAL.statement = &OtherRead{} + yyLOCAL = &OtherRead{} } + yyVAL.union = yyLOCAL case 421: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2318 + var yyLOCAL Statement +//line sql.y:2324 { - yyVAL.statement = &Show{&ShowBasic{Command: Charset, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Charset, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 422: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2322 + var yyLOCAL Statement +//line sql.y:2328 { - yyVAL.statement = &Show{&ShowBasic{Command: Collation, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Collation, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 423: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2326 + var yyLOCAL Statement +//line sql.y:2332 { - yyVAL.statement = &Show{&ShowBasic{Full: yyDollar[2].boolean, Command: Column, Tbl: yyDollar[5].tableName, DbName: yyDollar[6].str, Filter: yyDollar[7].showFilter}} + yyLOCAL = &Show{&ShowBasic{Full: yyDollar[2].booleanUnion(), Command: Column, Tbl: yyDollar[5].tableName, DbName: yyDollar[6].str, Filter: yyDollar[7].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 424: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2330 + var yyLOCAL Statement +//line sql.y:2336 { - yyVAL.statement = &Show{&ShowBasic{Command: Database, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Database, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 425: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2334 + var yyLOCAL Statement +//line sql.y:2340 { - yyVAL.statement = &Show{&ShowBasic{Command: Database, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Database, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 426: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2338 + var yyLOCAL Statement +//line sql.y:2344 { - yyVAL.statement = &Show{&ShowBasic{Command: Keyspace, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Keyspace, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 427: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2342 + var yyLOCAL Statement +//line sql.y:2348 { - yyVAL.statement = &Show{&ShowBasic{Command: Keyspace, Filter: yyDollar[3].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Keyspace, Filter: yyDollar[3].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 428: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2346 + var yyLOCAL Statement +//line sql.y:2352 { - yyVAL.statement = &Show{&ShowBasic{Command: Function, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Function, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 429: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2350 + var yyLOCAL Statement +//line sql.y:2356 { - yyVAL.statement = &Show{&ShowBasic{Command: Index, Tbl: yyDollar[5].tableName, DbName: yyDollar[6].str, Filter: yyDollar[7].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Index, Tbl: yyDollar[5].tableName, DbName: yyDollar[6].str, Filter: yyDollar[7].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 430: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2354 + var yyLOCAL Statement +//line sql.y:2360 { - yyVAL.statement = &Show{&ShowBasic{Command: OpenTable, DbName: yyDollar[4].str, Filter: yyDollar[5].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: OpenTable, DbName: yyDollar[4].str, Filter: yyDollar[5].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 431: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2358 + var yyLOCAL Statement +//line sql.y:2364 { - yyVAL.statement = &Show{&ShowBasic{Command: Privilege}} + yyLOCAL = &Show{&ShowBasic{Command: Privilege}} } + yyVAL.union = yyLOCAL case 432: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2362 + var yyLOCAL Statement +//line sql.y:2368 { - yyVAL.statement = &Show{&ShowBasic{Command: Procedure, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Procedure, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 433: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2366 + var yyLOCAL Statement +//line sql.y:2372 { - yyVAL.statement = &Show{&ShowBasic{Command: StatusSession, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: StatusSession, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 434: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2370 + var yyLOCAL Statement +//line sql.y:2376 { - yyVAL.statement = &Show{&ShowBasic{Command: StatusGlobal, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: StatusGlobal, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 435: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2374 + var yyLOCAL Statement +//line sql.y:2380 { - yyVAL.statement = &Show{&ShowBasic{Command: VariableSession, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: VariableSession, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 436: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2378 + var yyLOCAL Statement +//line sql.y:2384 { - yyVAL.statement = &Show{&ShowBasic{Command: VariableGlobal, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: VariableGlobal, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 437: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2382 + var yyLOCAL Statement +//line sql.y:2388 { - yyVAL.statement = &Show{&ShowBasic{Command: TableStatus, DbName: yyDollar[4].str, Filter: yyDollar[5].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: TableStatus, DbName: yyDollar[4].str, Filter: yyDollar[5].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 438: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2386 + var yyLOCAL Statement +//line sql.y:2392 { - yyVAL.statement = &Show{&ShowBasic{Command: Table, Full: yyDollar[2].boolean, DbName: yyDollar[4].str, Filter: yyDollar[5].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Table, Full: yyDollar[2].booleanUnion(), DbName: yyDollar[4].str, Filter: yyDollar[5].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 439: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2390 + var yyLOCAL Statement +//line sql.y:2396 { - yyVAL.statement = &Show{&ShowBasic{Command: Trigger, DbName: yyDollar[3].str, Filter: yyDollar[4].showFilter}} + yyLOCAL = &Show{&ShowBasic{Command: Trigger, DbName: yyDollar[3].str, Filter: yyDollar[4].showFilterUnion()}} } + yyVAL.union = yyLOCAL case 440: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2394 + var yyLOCAL Statement +//line sql.y:2400 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateDb, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateDb, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 441: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2398 + var yyLOCAL Statement +//line sql.y:2404 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateE, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateE, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 442: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2402 + var yyLOCAL Statement +//line sql.y:2408 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateF, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateF, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 443: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2406 + var yyLOCAL Statement +//line sql.y:2412 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateProc, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateProc, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 444: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2410 + var yyLOCAL Statement +//line sql.y:2416 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateTbl, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateTbl, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 445: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2414 + var yyLOCAL Statement +//line sql.y:2420 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateTr, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateTr, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 446: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2418 + var yyLOCAL Statement +//line sql.y:2424 { - yyVAL.statement = &Show{&ShowCreate{Command: CreateV, Op: yyDollar[4].tableName}} + yyLOCAL = &Show{&ShowCreate{Command: CreateV, Op: yyDollar[4].tableName}} } + yyVAL.union = yyLOCAL case 447: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2422 + var yyLOCAL Statement +//line sql.y:2428 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 448: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2426 + var yyLOCAL Statement +//line sql.y:2432 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].colIdent.String()), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].colIdent.String()), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 449: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2430 + var yyLOCAL Statement +//line sql.y:2436 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 450: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2434 + var yyLOCAL Statement +//line sql.y:2440 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 451: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2438 + var yyLOCAL Statement +//line sql.y:2444 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Table: yyDollar[4].tableName, Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Table: yyDollar[4].tableName, Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 452: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2442 + var yyLOCAL Statement +//line sql.y:2448 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 453: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2446 + var yyLOCAL Statement +//line sql.y:2452 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Table: yyDollar[4].tableName, Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Table: yyDollar[4].tableName, Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 454: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2450 + var yyLOCAL Statement +//line sql.y:2456 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[3].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[3].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 455: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2454 + var yyLOCAL Statement +//line sql.y:2460 { - showTablesOpt := &ShowTablesOpt{Filter: yyDollar[4].showFilter} - yyVAL.statement = &Show{&ShowLegacy{Scope: VitessMetadataScope, Type: string(yyDollar[3].str), ShowTablesOpt: showTablesOpt}} + showTablesOpt := &ShowTablesOpt{Filter: yyDollar[4].showFilterUnion()} + yyLOCAL = &Show{&ShowLegacy{Scope: VitessMetadataScope, Type: string(yyDollar[3].str), ShowTablesOpt: showTablesOpt}} } + yyVAL.union = yyLOCAL case 456: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2459 + var yyLOCAL Statement +//line sql.y:2465 { - yyVAL.statement = &Show{&ShowBasic{Command: VitessMigrations, Filter: yyDollar[4].showFilter, DbName: yyDollar[3].str}} + yyLOCAL = &Show{&ShowBasic{Command: VitessMigrations, Filter: yyDollar[4].showFilterUnion(), DbName: yyDollar[3].str}} } + yyVAL.union = yyLOCAL case 457: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2463 + var yyLOCAL Statement +//line sql.y:2469 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 458: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2467 + var yyLOCAL Statement +//line sql.y:2473 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 459: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2471 + var yyLOCAL Statement +//line sql.y:2477 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), OnTable: yyDollar[5].tableName, Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str) + " " + string(yyDollar[3].str), OnTable: yyDollar[5].tableName, Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 460: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2475 + var yyLOCAL Statement +//line sql.y:2481 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 461: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2480 + var yyLOCAL Statement +//line sql.y:2486 { // This should probably be a different type (ShowVitessTopoOpt), but // just getting the thing working for now - showTablesOpt := &ShowTablesOpt{Filter: yyDollar[3].showFilter} - yyVAL.statement = &Show{&ShowLegacy{Type: yyDollar[2].str, ShowTablesOpt: showTablesOpt}} + showTablesOpt := &ShowTablesOpt{Filter: yyDollar[3].showFilterUnion()} + yyLOCAL = &Show{&ShowLegacy{Type: yyDollar[2].str, ShowTablesOpt: showTablesOpt}} } + yyVAL.union = yyLOCAL case 462: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2494 + var yyLOCAL Statement +//line sql.y:2500 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].colIdent.String()), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].colIdent.String()), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 463: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2498 + var yyLOCAL Statement +//line sql.y:2504 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 464: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2502 + var yyLOCAL Statement +//line sql.y:2508 { - yyVAL.statement = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} + yyLOCAL = &Show{&ShowLegacy{Type: string(yyDollar[2].str), Scope: ImplicitScope}} } + yyVAL.union = yyLOCAL case 465: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2508 +//line sql.y:2514 { yyVAL.str = string(yyDollar[1].str) } case 466: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2512 +//line sql.y:2518 { yyVAL.str = string(yyDollar[1].str) } case 467: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2518 +//line sql.y:2524 { yyVAL.str = "" } case 468: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2522 +//line sql.y:2528 { yyVAL.str = "extended " } case 469: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2528 + var yyLOCAL bool +//line sql.y:2534 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 470: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2532 + var yyLOCAL bool +//line sql.y:2538 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 471: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2538 +//line sql.y:2544 { yyVAL.str = string(yyDollar[1].str) } case 472: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2542 +//line sql.y:2548 { yyVAL.str = string(yyDollar[1].str) } case 473: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2548 +//line sql.y:2554 { yyVAL.str = "" } case 474: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2552 +//line sql.y:2558 { yyVAL.str = yyDollar[2].tableIdent.v } case 475: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2556 +//line sql.y:2562 { yyVAL.str = yyDollar[2].tableIdent.v } case 476: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2562 + var yyLOCAL *ShowFilter +//line sql.y:2568 { - yyVAL.showFilter = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 477: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2566 + var yyLOCAL *ShowFilter +//line sql.y:2572 { - yyVAL.showFilter = &ShowFilter{Like: string(yyDollar[2].str)} + yyLOCAL = &ShowFilter{Like: string(yyDollar[2].str)} } + yyVAL.union = yyLOCAL case 478: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2570 + var yyLOCAL *ShowFilter +//line sql.y:2576 { - yyVAL.showFilter = &ShowFilter{Filter: yyDollar[2].expr} + yyLOCAL = &ShowFilter{Filter: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 479: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2576 + var yyLOCAL *ShowFilter +//line sql.y:2582 { - yyVAL.showFilter = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 480: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2580 + var yyLOCAL *ShowFilter +//line sql.y:2586 { - yyVAL.showFilter = &ShowFilter{Like: string(yyDollar[2].str)} + yyLOCAL = &ShowFilter{Like: string(yyDollar[2].str)} } + yyVAL.union = yyLOCAL case 481: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2586 +//line sql.y:2592 { yyVAL.empty = struct{}{} } case 482: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2590 +//line sql.y:2596 { yyVAL.empty = struct{}{} } case 483: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2594 +//line sql.y:2600 { yyVAL.empty = struct{}{} } case 484: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2600 + var yyLOCAL Statement +//line sql.y:2606 { - yyVAL.statement = &Use{DBName: yyDollar[2].tableIdent} + yyLOCAL = &Use{DBName: yyDollar[2].tableIdent} } + yyVAL.union = yyLOCAL case 485: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2604 + var yyLOCAL Statement +//line sql.y:2610 { - yyVAL.statement = &Use{DBName: TableIdent{v: ""}} + yyLOCAL = &Use{DBName: TableIdent{v: ""}} } + yyVAL.union = yyLOCAL case 486: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2610 + var yyLOCAL Statement +//line sql.y:2616 { - yyVAL.statement = &Begin{} + yyLOCAL = &Begin{} } + yyVAL.union = yyLOCAL case 487: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2614 + var yyLOCAL Statement +//line sql.y:2620 { - yyVAL.statement = &Begin{} + yyLOCAL = &Begin{} } + yyVAL.union = yyLOCAL case 488: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2620 + var yyLOCAL Statement +//line sql.y:2626 { - yyVAL.statement = &Commit{} + yyLOCAL = &Commit{} } + yyVAL.union = yyLOCAL case 489: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2626 + var yyLOCAL Statement +//line sql.y:2632 { - yyVAL.statement = &Rollback{} + yyLOCAL = &Rollback{} } + yyVAL.union = yyLOCAL case 490: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:2630 + var yyLOCAL Statement +//line sql.y:2636 { - yyVAL.statement = &SRollback{Name: yyDollar[5].colIdent} + yyLOCAL = &SRollback{Name: yyDollar[5].colIdent} } + yyVAL.union = yyLOCAL case 491: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2635 +//line sql.y:2641 { yyVAL.empty = struct{}{} } case 492: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2637 +//line sql.y:2643 { yyVAL.empty = struct{}{} } case 493: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2640 +//line sql.y:2646 { yyVAL.empty = struct{}{} } case 494: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2642 +//line sql.y:2648 { yyVAL.empty = struct{}{} } case 495: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2647 + var yyLOCAL Statement +//line sql.y:2653 { - yyVAL.statement = &Savepoint{Name: yyDollar[2].colIdent} + yyLOCAL = &Savepoint{Name: yyDollar[2].colIdent} } + yyVAL.union = yyLOCAL case 496: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2653 + var yyLOCAL Statement +//line sql.y:2659 { - yyVAL.statement = &Release{Name: yyDollar[3].colIdent} + yyLOCAL = &Release{Name: yyDollar[3].colIdent} } + yyVAL.union = yyLOCAL case 497: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2658 + var yyLOCAL ExplainType +//line sql.y:2664 { - yyVAL.explainType = EmptyType + yyLOCAL = EmptyType } + yyVAL.union = yyLOCAL case 498: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2662 + var yyLOCAL ExplainType +//line sql.y:2668 { - yyVAL.explainType = JSONType + yyLOCAL = JSONType } + yyVAL.union = yyLOCAL case 499: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2666 + var yyLOCAL ExplainType +//line sql.y:2672 { - yyVAL.explainType = TreeType + yyLOCAL = TreeType } + yyVAL.union = yyLOCAL case 500: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2670 + var yyLOCAL ExplainType +//line sql.y:2676 { - yyVAL.explainType = VitessType + yyLOCAL = VitessType } + yyVAL.union = yyLOCAL case 501: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2674 + var yyLOCAL ExplainType +//line sql.y:2680 { - yyVAL.explainType = TraditionalType + yyLOCAL = TraditionalType } + yyVAL.union = yyLOCAL case 502: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2678 + var yyLOCAL ExplainType +//line sql.y:2684 { - yyVAL.explainType = AnalyzeType + yyLOCAL = AnalyzeType } + yyVAL.union = yyLOCAL case 503: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2684 +//line sql.y:2690 { yyVAL.str = yyDollar[1].str } case 504: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2688 +//line sql.y:2694 { yyVAL.str = yyDollar[1].str } case 505: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2692 +//line sql.y:2698 { yyVAL.str = yyDollar[1].str } case 506: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2698 + var yyLOCAL Statement +//line sql.y:2704 { - yyVAL.statement = yyDollar[1].selStmt + yyLOCAL = yyDollar[1].selStmtUnion() } + yyVAL.union = yyLOCAL case 507: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2702 + var yyLOCAL Statement +//line sql.y:2708 { - yyVAL.statement = yyDollar[1].statement + yyLOCAL = yyDollar[1].statementUnion() } + yyVAL.union = yyLOCAL case 508: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2706 + var yyLOCAL Statement +//line sql.y:2712 { - yyVAL.statement = yyDollar[1].statement + yyLOCAL = yyDollar[1].statementUnion() } + yyVAL.union = yyLOCAL case 509: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2710 + var yyLOCAL Statement +//line sql.y:2716 { - yyVAL.statement = yyDollar[1].statement + yyLOCAL = yyDollar[1].statementUnion() } + yyVAL.union = yyLOCAL case 510: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2715 +//line sql.y:2721 { yyVAL.str = "" } case 511: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2719 +//line sql.y:2725 { yyVAL.str = yyDollar[1].colIdent.val } case 512: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2723 +//line sql.y:2729 { yyVAL.str = encodeSQLString(yyDollar[1].str) } case 513: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2729 + var yyLOCAL Statement +//line sql.y:2735 { - yyVAL.statement = &ExplainTab{Table: yyDollar[2].tableName, Wild: yyDollar[3].str} + yyLOCAL = &ExplainTab{Table: yyDollar[2].tableName, Wild: yyDollar[3].str} } + yyVAL.union = yyLOCAL case 514: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2733 + var yyLOCAL Statement +//line sql.y:2739 { - yyVAL.statement = &ExplainStmt{Type: yyDollar[2].explainType, Statement: yyDollar[3].statement} + yyLOCAL = &ExplainStmt{Type: yyDollar[2].explainTypeUnion(), Statement: yyDollar[3].statementUnion()} } + yyVAL.union = yyLOCAL case 515: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2739 + var yyLOCAL Statement +//line sql.y:2745 { - yyVAL.statement = &OtherAdmin{} + yyLOCAL = &OtherAdmin{} } + yyVAL.union = yyLOCAL case 516: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2743 + var yyLOCAL Statement +//line sql.y:2749 { - yyVAL.statement = &OtherAdmin{} + yyLOCAL = &OtherAdmin{} } + yyVAL.union = yyLOCAL case 517: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2749 + var yyLOCAL Statement +//line sql.y:2755 { - yyVAL.statement = &LockTables{Tables: yyDollar[3].tableAndLockTypes} + yyLOCAL = &LockTables{Tables: yyDollar[3].tableAndLockTypesUnion()} } + yyVAL.union = yyLOCAL case 518: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2755 + var yyLOCAL TableAndLockTypes +//line sql.y:2761 { - yyVAL.tableAndLockTypes = TableAndLockTypes{yyDollar[1].tableAndLockType} + yyLOCAL = TableAndLockTypes{yyDollar[1].tableAndLockTypeUnion()} } + yyVAL.union = yyLOCAL case 519: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2759 +//line sql.y:2765 { - yyVAL.tableAndLockTypes = append(yyDollar[1].tableAndLockTypes, yyDollar[3].tableAndLockType) + yySLICE := (*TableAndLockTypes)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableAndLockTypeUnion()) } case 520: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2765 + var yyLOCAL *TableAndLockType +//line sql.y:2771 { - yyVAL.tableAndLockType = &TableAndLockType{Table: yyDollar[1].aliasedTableName, Lock: yyDollar[2].lockType} + yyLOCAL = &TableAndLockType{Table: yyDollar[1].aliasedTableNameUnion(), Lock: yyDollar[2].lockTypeUnion()} } + yyVAL.union = yyLOCAL case 521: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2771 + var yyLOCAL LockType +//line sql.y:2777 { - yyVAL.lockType = Read + yyLOCAL = Read } + yyVAL.union = yyLOCAL case 522: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2775 + var yyLOCAL LockType +//line sql.y:2781 { - yyVAL.lockType = ReadLocal + yyLOCAL = ReadLocal } + yyVAL.union = yyLOCAL case 523: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2779 + var yyLOCAL LockType +//line sql.y:2785 { - yyVAL.lockType = Write + yyLOCAL = Write } + yyVAL.union = yyLOCAL case 524: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2783 + var yyLOCAL LockType +//line sql.y:2789 { - yyVAL.lockType = LowPriorityWrite + yyLOCAL = LowPriorityWrite } + yyVAL.union = yyLOCAL case 525: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2789 + var yyLOCAL Statement +//line sql.y:2795 { - yyVAL.statement = &UnlockTables{} + yyLOCAL = &UnlockTables{} } + yyVAL.union = yyLOCAL case 526: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2795 + var yyLOCAL Statement +//line sql.y:2801 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean, FlushOptions: yyDollar[3].strs} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion(), FlushOptions: yyDollar[3].strs} } + yyVAL.union = yyLOCAL case 527: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2799 + var yyLOCAL Statement +//line sql.y:2805 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion()} } + yyVAL.union = yyLOCAL case 528: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:2803 + var yyLOCAL Statement +//line sql.y:2809 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean, WithLock: true} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion(), WithLock: true} } + yyVAL.union = yyLOCAL case 529: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2807 + var yyLOCAL Statement +//line sql.y:2813 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean, TableNames: yyDollar[4].tableNames} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion(), TableNames: yyDollar[4].tableNamesUnion()} } + yyVAL.union = yyLOCAL case 530: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:2811 + var yyLOCAL Statement +//line sql.y:2817 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean, TableNames: yyDollar[4].tableNames, WithLock: true} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion(), TableNames: yyDollar[4].tableNamesUnion(), WithLock: true} } + yyVAL.union = yyLOCAL case 531: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:2815 + var yyLOCAL Statement +//line sql.y:2821 { - yyVAL.statement = &Flush{IsLocal: yyDollar[2].boolean, TableNames: yyDollar[4].tableNames, ForExport: true} + yyLOCAL = &Flush{IsLocal: yyDollar[2].booleanUnion(), TableNames: yyDollar[4].tableNamesUnion(), ForExport: true} } + yyVAL.union = yyLOCAL case 532: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2821 +//line sql.y:2827 { yyVAL.strs = []string{yyDollar[1].str} } case 533: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2825 +//line sql.y:2831 { yyVAL.strs = append(yyDollar[1].strs, yyDollar[3].str) } case 534: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2831 +//line sql.y:2837 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 535: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2835 +//line sql.y:2841 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 536: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2839 +//line sql.y:2845 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 537: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2843 +//line sql.y:2849 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 538: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2847 +//line sql.y:2853 { yyVAL.str = string(yyDollar[1].str) } case 539: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2851 +//line sql.y:2857 { yyVAL.str = string(yyDollar[1].str) } case 540: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2855 +//line sql.y:2861 { yyVAL.str = string(yyDollar[1].str) } case 541: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2859 +//line sql.y:2865 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) + yyDollar[3].str } case 542: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2863 +//line sql.y:2869 { yyVAL.str = string(yyDollar[1].str) + " " + string(yyDollar[2].str) } case 543: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2867 +//line sql.y:2873 { yyVAL.str = string(yyDollar[1].str) } case 544: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2871 +//line sql.y:2877 { yyVAL.str = string(yyDollar[1].str) } case 545: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2875 +//line sql.y:2881 { yyVAL.str = string(yyDollar[1].str) } case 546: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2880 + var yyLOCAL bool +//line sql.y:2886 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 547: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2884 + var yyLOCAL bool +//line sql.y:2890 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 548: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2888 + var yyLOCAL bool +//line sql.y:2894 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 549: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2893 +//line sql.y:2899 { yyVAL.str = "" } case 550: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2897 +//line sql.y:2903 { yyVAL.str = " " + string(yyDollar[1].str) + " " + string(yyDollar[2].str) + " " + yyDollar[3].colIdent.String() } case 551: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2902 +//line sql.y:2908 { setAllowComments(yylex, true) } case 552: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2906 +//line sql.y:2912 { yyVAL.strs = yyDollar[2].strs setAllowComments(yylex, false) } case 553: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2912 +//line sql.y:2918 { yyVAL.strs = nil } case 554: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2916 +//line sql.y:2922 { yyVAL.strs = append(yyDollar[1].strs, yyDollar[2].str) } case 555: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2922 + var yyLOCAL bool +//line sql.y:2928 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 556: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2926 + var yyLOCAL bool +//line sql.y:2932 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 557: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2930 + var yyLOCAL bool +//line sql.y:2936 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 558: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2935 +//line sql.y:2941 { yyVAL.str = "" } case 559: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2939 +//line sql.y:2945 { yyVAL.str = SQLNoCacheStr } case 560: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2943 +//line sql.y:2949 { yyVAL.str = SQLCacheStr } case 561: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2948 + var yyLOCAL bool +//line sql.y:2954 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 562: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2952 + var yyLOCAL bool +//line sql.y:2958 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 563: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2956 + var yyLOCAL bool +//line sql.y:2962 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 564: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2961 + var yyLOCAL SelectExprs +//line sql.y:2967 { - yyVAL.selectExprs = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 565: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2965 + var yyLOCAL SelectExprs +//line sql.y:2971 { - yyVAL.selectExprs = yyDollar[1].selectExprs + yyLOCAL = yyDollar[1].selectExprsUnion() } + yyVAL.union = yyLOCAL case 566: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:2970 +//line sql.y:2976 { yyVAL.strs = nil } case 567: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2974 +//line sql.y:2980 { yyVAL.strs = []string{yyDollar[1].str} } case 568: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:2978 +//line sql.y:2984 { // TODO: This is a hack since I couldn't get it to work in a nicer way. I got 'conflicts: 8 shift/reduce' yyVAL.strs = []string{yyDollar[1].str, yyDollar[2].str} } case 569: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:2982 +//line sql.y:2988 { yyVAL.strs = []string{yyDollar[1].str, yyDollar[2].str, yyDollar[3].str} } case 570: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:2986 +//line sql.y:2992 { yyVAL.strs = []string{yyDollar[1].str, yyDollar[2].str, yyDollar[3].str, yyDollar[4].str} } case 571: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2992 +//line sql.y:2998 { yyVAL.str = SQLNoCacheStr } case 572: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:2996 +//line sql.y:3002 { yyVAL.str = SQLCacheStr } case 573: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3000 +//line sql.y:3006 { yyVAL.str = DistinctStr } case 574: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3004 +//line sql.y:3010 { yyVAL.str = DistinctStr } case 575: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3008 +//line sql.y:3014 { yyVAL.str = StraightJoinHint } case 576: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3012 +//line sql.y:3018 { yyVAL.str = SQLCalcFoundRowsStr } case 577: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3016 +//line sql.y:3022 { yyVAL.str = AllStr // These are not picked up by NewSelect, and so ALL will be dropped. But this is OK, since it's redundant anyway } case 578: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3022 + var yyLOCAL SelectExprs +//line sql.y:3028 { - yyVAL.selectExprs = SelectExprs{yyDollar[1].selectExpr} + yyLOCAL = SelectExprs{yyDollar[1].selectExprUnion()} } + yyVAL.union = yyLOCAL case 579: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3026 +//line sql.y:3032 { - yyVAL.selectExprs = append(yyVAL.selectExprs, yyDollar[3].selectExpr) + yySLICE := (*SelectExprs)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].selectExprUnion()) } case 580: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3032 + var yyLOCAL SelectExpr +//line sql.y:3038 { - yyVAL.selectExpr = &StarExpr{} + yyLOCAL = &StarExpr{} } + yyVAL.union = yyLOCAL case 581: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3036 + var yyLOCAL SelectExpr +//line sql.y:3042 { - yyVAL.selectExpr = &AliasedExpr{Expr: yyDollar[1].expr, As: yyDollar[2].colIdent} + yyLOCAL = &AliasedExpr{Expr: yyDollar[1].exprUnion(), As: yyDollar[2].colIdent} } + yyVAL.union = yyLOCAL case 582: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3040 + var yyLOCAL SelectExpr +//line sql.y:3046 { - yyVAL.selectExpr = &StarExpr{TableName: TableName{Name: yyDollar[1].tableIdent}} + yyLOCAL = &StarExpr{TableName: TableName{Name: yyDollar[1].tableIdent}} } + yyVAL.union = yyLOCAL case 583: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3044 + var yyLOCAL SelectExpr +//line sql.y:3050 { - yyVAL.selectExpr = &StarExpr{TableName: TableName{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].tableIdent}} + yyLOCAL = &StarExpr{TableName: TableName{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].tableIdent}} } + yyVAL.union = yyLOCAL case 584: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3049 +//line sql.y:3055 { yyVAL.colIdent = ColIdent{} } case 585: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3053 +//line sql.y:3059 { yyVAL.colIdent = yyDollar[1].colIdent } case 586: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3057 +//line sql.y:3063 { yyVAL.colIdent = yyDollar[2].colIdent } case 588: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3064 +//line sql.y:3070 { yyVAL.colIdent = NewColIdent(string(yyDollar[1].str)) } case 589: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3069 + var yyLOCAL TableExprs +//line sql.y:3075 { - yyVAL.tableExprs = TableExprs{&AliasedTableExpr{Expr: TableName{Name: NewTableIdent("dual")}}} + yyLOCAL = TableExprs{&AliasedTableExpr{Expr: TableName{Name: NewTableIdent("dual")}}} } + yyVAL.union = yyLOCAL case 590: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3073 + var yyLOCAL TableExprs +//line sql.y:3079 { - yyVAL.tableExprs = yyDollar[2].tableExprs + yyLOCAL = yyDollar[2].tableExprsUnion() } + yyVAL.union = yyLOCAL case 591: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3079 + var yyLOCAL TableExprs +//line sql.y:3085 { - yyVAL.tableExprs = TableExprs{yyDollar[1].tableExpr} + yyLOCAL = TableExprs{yyDollar[1].tableExprUnion()} } + yyVAL.union = yyLOCAL case 592: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3083 +//line sql.y:3089 { - yyVAL.tableExprs = append(yyVAL.tableExprs, yyDollar[3].tableExpr) + yySLICE := (*TableExprs)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].tableExprUnion()) } case 595: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3093 + var yyLOCAL TableExpr +//line sql.y:3099 { - yyVAL.tableExpr = yyDollar[1].aliasedTableName + yyLOCAL = yyDollar[1].aliasedTableNameUnion() } + yyVAL.union = yyLOCAL case 596: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3097 + var yyLOCAL TableExpr +//line sql.y:3103 { - yyVAL.tableExpr = &AliasedTableExpr{Expr: yyDollar[1].derivedTable, As: yyDollar[3].tableIdent} + yyLOCAL = &AliasedTableExpr{Expr: yyDollar[1].derivedTableUnion(), As: yyDollar[3].tableIdent} } + yyVAL.union = yyLOCAL case 597: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3101 + var yyLOCAL TableExpr +//line sql.y:3107 { - yyVAL.tableExpr = &ParenTableExpr{Exprs: yyDollar[2].tableExprs} + yyLOCAL = &ParenTableExpr{Exprs: yyDollar[2].tableExprsUnion()} } + yyVAL.union = yyLOCAL case 598: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3107 + var yyLOCAL *DerivedTable +//line sql.y:3113 { - yyVAL.derivedTable = &DerivedTable{yyDollar[2].selStmt} + yyLOCAL = &DerivedTable{yyDollar[2].selStmtUnion()} } + yyVAL.union = yyLOCAL case 599: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3113 + var yyLOCAL *AliasedTableExpr +//line sql.y:3119 { - yyVAL.aliasedTableName = &AliasedTableExpr{Expr: yyDollar[1].tableName, As: yyDollar[2].tableIdent, Hints: yyDollar[3].indexHints} + yyLOCAL = &AliasedTableExpr{Expr: yyDollar[1].tableName, As: yyDollar[2].tableIdent, Hints: yyDollar[3].indexHintsUnion()} } + yyVAL.union = yyLOCAL case 600: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:3117 + var yyLOCAL *AliasedTableExpr +//line sql.y:3123 { - yyVAL.aliasedTableName = &AliasedTableExpr{Expr: yyDollar[1].tableName, Partitions: yyDollar[4].partitions, As: yyDollar[6].tableIdent, Hints: yyDollar[7].indexHints} + yyLOCAL = &AliasedTableExpr{Expr: yyDollar[1].tableName, Partitions: yyDollar[4].partitionsUnion(), As: yyDollar[6].tableIdent, Hints: yyDollar[7].indexHintsUnion()} } + yyVAL.union = yyLOCAL case 601: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3122 + var yyLOCAL Columns +//line sql.y:3128 { - yyVAL.columns = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 602: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3126 + var yyLOCAL Columns +//line sql.y:3132 { - yyVAL.columns = yyDollar[2].columns + yyLOCAL = yyDollar[2].columnsUnion() } + yyVAL.union = yyLOCAL case 603: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3132 + var yyLOCAL Columns +//line sql.y:3138 { - yyVAL.columns = Columns{yyDollar[1].colIdent} + yyLOCAL = Columns{yyDollar[1].colIdent} } + yyVAL.union = yyLOCAL case 604: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3136 +//line sql.y:3142 { - yyVAL.columns = append(yyVAL.columns, yyDollar[3].colIdent) + yySLICE := (*Columns)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].colIdent) } case 605: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3142 + var yyLOCAL Partitions +//line sql.y:3148 { - yyVAL.partitions = Partitions{yyDollar[1].colIdent} + yyLOCAL = Partitions{yyDollar[1].colIdent} } + yyVAL.union = yyLOCAL case 606: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3146 +//line sql.y:3152 { - yyVAL.partitions = append(yyVAL.partitions, yyDollar[3].colIdent) + yySLICE := (*Partitions)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].colIdent) } case 607: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3159 + var yyLOCAL TableExpr +//line sql.y:3165 { - yyVAL.tableExpr = &JoinTableExpr{LeftExpr: yyDollar[1].tableExpr, Join: yyDollar[2].joinType, RightExpr: yyDollar[3].tableExpr, Condition: yyDollar[4].joinCondition} + yyLOCAL = &JoinTableExpr{LeftExpr: yyDollar[1].tableExprUnion(), Join: yyDollar[2].joinTypeUnion(), RightExpr: yyDollar[3].tableExprUnion(), Condition: yyDollar[4].joinCondition} } + yyVAL.union = yyLOCAL case 608: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3163 + var yyLOCAL TableExpr +//line sql.y:3169 { - yyVAL.tableExpr = &JoinTableExpr{LeftExpr: yyDollar[1].tableExpr, Join: yyDollar[2].joinType, RightExpr: yyDollar[3].tableExpr, Condition: yyDollar[4].joinCondition} + yyLOCAL = &JoinTableExpr{LeftExpr: yyDollar[1].tableExprUnion(), Join: yyDollar[2].joinTypeUnion(), RightExpr: yyDollar[3].tableExprUnion(), Condition: yyDollar[4].joinCondition} } + yyVAL.union = yyLOCAL case 609: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3167 + var yyLOCAL TableExpr +//line sql.y:3173 { - yyVAL.tableExpr = &JoinTableExpr{LeftExpr: yyDollar[1].tableExpr, Join: yyDollar[2].joinType, RightExpr: yyDollar[3].tableExpr, Condition: yyDollar[4].joinCondition} + yyLOCAL = &JoinTableExpr{LeftExpr: yyDollar[1].tableExprUnion(), Join: yyDollar[2].joinTypeUnion(), RightExpr: yyDollar[3].tableExprUnion(), Condition: yyDollar[4].joinCondition} } + yyVAL.union = yyLOCAL case 610: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3171 + var yyLOCAL TableExpr +//line sql.y:3177 { - yyVAL.tableExpr = &JoinTableExpr{LeftExpr: yyDollar[1].tableExpr, Join: yyDollar[2].joinType, RightExpr: yyDollar[3].tableExpr} + yyLOCAL = &JoinTableExpr{LeftExpr: yyDollar[1].tableExprUnion(), Join: yyDollar[2].joinTypeUnion(), RightExpr: yyDollar[3].tableExprUnion()} } + yyVAL.union = yyLOCAL case 611: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3177 +//line sql.y:3183 { - yyVAL.joinCondition = JoinCondition{On: yyDollar[2].expr} + yyVAL.joinCondition = JoinCondition{On: yyDollar[2].exprUnion()} } case 612: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3179 +//line sql.y:3185 { - yyVAL.joinCondition = JoinCondition{Using: yyDollar[3].columns} + yyVAL.joinCondition = JoinCondition{Using: yyDollar[3].columnsUnion()} } case 613: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3183 +//line sql.y:3189 { yyVAL.joinCondition = JoinCondition{} } case 614: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3185 +//line sql.y:3191 { yyVAL.joinCondition = yyDollar[1].joinCondition } case 615: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3189 +//line sql.y:3195 { yyVAL.joinCondition = JoinCondition{} } case 616: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3191 +//line sql.y:3197 { - yyVAL.joinCondition = JoinCondition{On: yyDollar[2].expr} + yyVAL.joinCondition = JoinCondition{On: yyDollar[2].exprUnion()} } case 617: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3194 +//line sql.y:3200 { yyVAL.empty = struct{}{} } case 618: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3196 +//line sql.y:3202 { yyVAL.empty = struct{}{} } case 619: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3199 +//line sql.y:3205 { yyVAL.tableIdent = NewTableIdent("") } case 620: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3203 +//line sql.y:3209 { yyVAL.tableIdent = yyDollar[1].tableIdent } case 621: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3207 +//line sql.y:3213 { yyVAL.tableIdent = yyDollar[2].tableIdent } case 623: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3214 +//line sql.y:3220 { yyVAL.tableIdent = NewTableIdent(string(yyDollar[1].str)) } case 624: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3220 + var yyLOCAL JoinType +//line sql.y:3226 { - yyVAL.joinType = NormalJoinType + yyLOCAL = NormalJoinType } + yyVAL.union = yyLOCAL case 625: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3224 + var yyLOCAL JoinType +//line sql.y:3230 { - yyVAL.joinType = NormalJoinType + yyLOCAL = NormalJoinType } + yyVAL.union = yyLOCAL case 626: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3228 + var yyLOCAL JoinType +//line sql.y:3234 { - yyVAL.joinType = NormalJoinType + yyLOCAL = NormalJoinType } + yyVAL.union = yyLOCAL case 627: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3234 + var yyLOCAL JoinType +//line sql.y:3240 { - yyVAL.joinType = StraightJoinType + yyLOCAL = StraightJoinType } + yyVAL.union = yyLOCAL case 628: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3240 + var yyLOCAL JoinType +//line sql.y:3246 { - yyVAL.joinType = LeftJoinType + yyLOCAL = LeftJoinType } + yyVAL.union = yyLOCAL case 629: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3244 + var yyLOCAL JoinType +//line sql.y:3250 { - yyVAL.joinType = LeftJoinType + yyLOCAL = LeftJoinType } + yyVAL.union = yyLOCAL case 630: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3248 + var yyLOCAL JoinType +//line sql.y:3254 { - yyVAL.joinType = RightJoinType + yyLOCAL = RightJoinType } + yyVAL.union = yyLOCAL case 631: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3252 + var yyLOCAL JoinType +//line sql.y:3258 { - yyVAL.joinType = RightJoinType + yyLOCAL = RightJoinType } + yyVAL.union = yyLOCAL case 632: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3258 + var yyLOCAL JoinType +//line sql.y:3264 { - yyVAL.joinType = NaturalJoinType + yyLOCAL = NaturalJoinType } + yyVAL.union = yyLOCAL case 633: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3262 + var yyLOCAL JoinType +//line sql.y:3268 { - if yyDollar[2].joinType == LeftJoinType { - yyVAL.joinType = NaturalLeftJoinType + if yyDollar[2].joinTypeUnion() == LeftJoinType { + yyLOCAL = NaturalLeftJoinType } else { - yyVAL.joinType = NaturalRightJoinType + yyLOCAL = NaturalRightJoinType } } + yyVAL.union = yyLOCAL case 634: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3272 +//line sql.y:3278 { yyVAL.tableName = yyDollar[2].tableName } case 635: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3276 +//line sql.y:3282 { yyVAL.tableName = yyDollar[1].tableName } case 636: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3282 +//line sql.y:3288 { yyVAL.tableName = TableName{Name: yyDollar[1].tableIdent} } case 637: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3286 +//line sql.y:3292 { yyVAL.tableName = TableName{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].tableIdent} } case 638: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3292 +//line sql.y:3298 { yyVAL.tableName = TableName{Name: yyDollar[1].tableIdent} } case 639: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3297 + var yyLOCAL *IndexHints +//line sql.y:3303 { - yyVAL.indexHints = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 640: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3301 + var yyLOCAL *IndexHints +//line sql.y:3307 { - yyVAL.indexHints = &IndexHints{Type: UseOp, Indexes: yyDollar[4].columns} + yyLOCAL = &IndexHints{Type: UseOp, Indexes: yyDollar[4].columnsUnion()} } + yyVAL.union = yyLOCAL case 641: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3305 + var yyLOCAL *IndexHints +//line sql.y:3311 { - yyVAL.indexHints = &IndexHints{Type: UseOp} + yyLOCAL = &IndexHints{Type: UseOp} } + yyVAL.union = yyLOCAL case 642: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3309 + var yyLOCAL *IndexHints +//line sql.y:3315 { - yyVAL.indexHints = &IndexHints{Type: IgnoreOp, Indexes: yyDollar[4].columns} + yyLOCAL = &IndexHints{Type: IgnoreOp, Indexes: yyDollar[4].columnsUnion()} } + yyVAL.union = yyLOCAL case 643: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3313 + var yyLOCAL *IndexHints +//line sql.y:3319 { - yyVAL.indexHints = &IndexHints{Type: ForceOp, Indexes: yyDollar[4].columns} + yyLOCAL = &IndexHints{Type: ForceOp, Indexes: yyDollar[4].columnsUnion()} } + yyVAL.union = yyLOCAL case 644: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3318 + var yyLOCAL Expr +//line sql.y:3324 { - yyVAL.expr = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 645: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3322 + var yyLOCAL Expr +//line sql.y:3328 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 646: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3328 + var yyLOCAL Expr +//line sql.y:3334 { - yyVAL.expr = yyDollar[1].expr + yyLOCAL = yyDollar[1].exprUnion() } + yyVAL.union = yyLOCAL case 647: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3332 + var yyLOCAL Expr +//line sql.y:3338 { - yyVAL.expr = &AndExpr{Left: yyDollar[1].expr, Right: yyDollar[3].expr} + yyLOCAL = &AndExpr{Left: yyDollar[1].exprUnion(), Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 648: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3336 + var yyLOCAL Expr +//line sql.y:3342 { - yyVAL.expr = &OrExpr{Left: yyDollar[1].expr, Right: yyDollar[3].expr} + yyLOCAL = &OrExpr{Left: yyDollar[1].exprUnion(), Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 649: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3340 + var yyLOCAL Expr +//line sql.y:3346 { - yyVAL.expr = &XorExpr{Left: yyDollar[1].expr, Right: yyDollar[3].expr} + yyLOCAL = &XorExpr{Left: yyDollar[1].exprUnion(), Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 650: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3344 + var yyLOCAL Expr +//line sql.y:3350 { - yyVAL.expr = &NotExpr{Expr: yyDollar[2].expr} + yyLOCAL = &NotExpr{Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 651: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3348 + var yyLOCAL Expr +//line sql.y:3354 { - yyVAL.expr = &IsExpr{Operator: yyDollar[3].isExprOperator, Expr: yyDollar[1].expr} + yyLOCAL = &IsExpr{Operator: yyDollar[3].isExprOperatorUnion(), Expr: yyDollar[1].exprUnion()} } + yyVAL.union = yyLOCAL case 652: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3352 + var yyLOCAL Expr +//line sql.y:3358 { - yyVAL.expr = yyDollar[1].expr + yyLOCAL = yyDollar[1].exprUnion() } + yyVAL.union = yyLOCAL case 653: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3356 + var yyLOCAL Expr +//line sql.y:3362 { - yyVAL.expr = &Default{ColName: yyDollar[2].str} + yyLOCAL = &Default{ColName: yyDollar[2].str} } + yyVAL.union = yyLOCAL case 654: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3362 +//line sql.y:3368 { yyVAL.str = "" } case 655: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3366 +//line sql.y:3372 { yyVAL.str = string(yyDollar[2].colIdent.String()) } case 656: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3372 + var yyLOCAL BoolVal +//line sql.y:3378 { - yyVAL.boolVal = BoolVal(true) + yyLOCAL = BoolVal(true) } + yyVAL.union = yyLOCAL case 657: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3376 + var yyLOCAL BoolVal +//line sql.y:3382 { - yyVAL.boolVal = BoolVal(false) + yyLOCAL = BoolVal(false) } + yyVAL.union = yyLOCAL case 658: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3382 + var yyLOCAL Expr +//line sql.y:3388 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: yyDollar[2].comparisonExprOperator, Right: yyDollar[3].expr} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: yyDollar[2].comparisonExprOperatorUnion(), Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 659: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3386 + var yyLOCAL Expr +//line sql.y:3392 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: InOp, Right: yyDollar[3].colTuple} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: InOp, Right: yyDollar[3].colTupleUnion()} } + yyVAL.union = yyLOCAL case 660: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3390 + var yyLOCAL Expr +//line sql.y:3396 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: NotInOp, Right: yyDollar[4].colTuple} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: NotInOp, Right: yyDollar[4].colTupleUnion()} } + yyVAL.union = yyLOCAL case 661: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3394 + var yyLOCAL Expr +//line sql.y:3400 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: LikeOp, Right: yyDollar[3].expr, Escape: yyDollar[4].expr} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: LikeOp, Right: yyDollar[3].exprUnion(), Escape: yyDollar[4].exprUnion()} } + yyVAL.union = yyLOCAL case 662: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3398 + var yyLOCAL Expr +//line sql.y:3404 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: NotLikeOp, Right: yyDollar[4].expr, Escape: yyDollar[5].expr} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: NotLikeOp, Right: yyDollar[4].exprUnion(), Escape: yyDollar[5].exprUnion()} } + yyVAL.union = yyLOCAL case 663: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3402 + var yyLOCAL Expr +//line sql.y:3408 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: RegexpOp, Right: yyDollar[3].expr} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: RegexpOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 664: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3406 + var yyLOCAL Expr +//line sql.y:3412 { - yyVAL.expr = &ComparisonExpr{Left: yyDollar[1].expr, Operator: NotRegexpOp, Right: yyDollar[4].expr} + yyLOCAL = &ComparisonExpr{Left: yyDollar[1].exprUnion(), Operator: NotRegexpOp, Right: yyDollar[4].exprUnion()} } + yyVAL.union = yyLOCAL case 665: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3410 + var yyLOCAL Expr +//line sql.y:3416 { - yyVAL.expr = &RangeCond{Left: yyDollar[1].expr, Operator: BetweenOp, From: yyDollar[3].expr, To: yyDollar[5].expr} + yyLOCAL = &RangeCond{Left: yyDollar[1].exprUnion(), Operator: BetweenOp, From: yyDollar[3].exprUnion(), To: yyDollar[5].exprUnion()} } + yyVAL.union = yyLOCAL case 666: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:3414 + var yyLOCAL Expr +//line sql.y:3420 { - yyVAL.expr = &RangeCond{Left: yyDollar[1].expr, Operator: NotBetweenOp, From: yyDollar[4].expr, To: yyDollar[6].expr} + yyLOCAL = &RangeCond{Left: yyDollar[1].exprUnion(), Operator: NotBetweenOp, From: yyDollar[4].exprUnion(), To: yyDollar[6].exprUnion()} } + yyVAL.union = yyLOCAL case 667: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3418 + var yyLOCAL Expr +//line sql.y:3424 { - yyVAL.expr = &ExistsExpr{Subquery: yyDollar[2].subquery} + yyLOCAL = &ExistsExpr{Subquery: yyDollar[2].subqueryUnion()} } + yyVAL.union = yyLOCAL case 668: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3424 + var yyLOCAL IsExprOperator +//line sql.y:3430 { - yyVAL.isExprOperator = IsNullOp + yyLOCAL = IsNullOp } + yyVAL.union = yyLOCAL case 669: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3428 + var yyLOCAL IsExprOperator +//line sql.y:3434 { - yyVAL.isExprOperator = IsNotNullOp + yyLOCAL = IsNotNullOp } + yyVAL.union = yyLOCAL case 670: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3432 + var yyLOCAL IsExprOperator +//line sql.y:3438 { - yyVAL.isExprOperator = IsTrueOp + yyLOCAL = IsTrueOp } + yyVAL.union = yyLOCAL case 671: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3436 + var yyLOCAL IsExprOperator +//line sql.y:3442 { - yyVAL.isExprOperator = IsNotTrueOp + yyLOCAL = IsNotTrueOp } + yyVAL.union = yyLOCAL case 672: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3440 + var yyLOCAL IsExprOperator +//line sql.y:3446 { - yyVAL.isExprOperator = IsFalseOp + yyLOCAL = IsFalseOp } + yyVAL.union = yyLOCAL case 673: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3444 + var yyLOCAL IsExprOperator +//line sql.y:3450 { - yyVAL.isExprOperator = IsNotFalseOp + yyLOCAL = IsNotFalseOp } + yyVAL.union = yyLOCAL case 674: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3450 + var yyLOCAL ComparisonExprOperator +//line sql.y:3456 { - yyVAL.comparisonExprOperator = EqualOp + yyLOCAL = EqualOp } + yyVAL.union = yyLOCAL case 675: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3454 + var yyLOCAL ComparisonExprOperator +//line sql.y:3460 { - yyVAL.comparisonExprOperator = LessThanOp + yyLOCAL = LessThanOp } + yyVAL.union = yyLOCAL case 676: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3458 + var yyLOCAL ComparisonExprOperator +//line sql.y:3464 { - yyVAL.comparisonExprOperator = GreaterThanOp + yyLOCAL = GreaterThanOp } + yyVAL.union = yyLOCAL case 677: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3462 + var yyLOCAL ComparisonExprOperator +//line sql.y:3468 { - yyVAL.comparisonExprOperator = LessEqualOp + yyLOCAL = LessEqualOp } + yyVAL.union = yyLOCAL case 678: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3466 + var yyLOCAL ComparisonExprOperator +//line sql.y:3472 { - yyVAL.comparisonExprOperator = GreaterEqualOp + yyLOCAL = GreaterEqualOp } + yyVAL.union = yyLOCAL case 679: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3470 + var yyLOCAL ComparisonExprOperator +//line sql.y:3476 { - yyVAL.comparisonExprOperator = NotEqualOp + yyLOCAL = NotEqualOp } + yyVAL.union = yyLOCAL case 680: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3474 + var yyLOCAL ComparisonExprOperator +//line sql.y:3480 { - yyVAL.comparisonExprOperator = NullSafeEqualOp + yyLOCAL = NullSafeEqualOp } + yyVAL.union = yyLOCAL case 681: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3479 + var yyLOCAL Expr +//line sql.y:3485 { - yyVAL.expr = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 682: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3483 + var yyLOCAL Expr +//line sql.y:3489 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 683: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3489 + var yyLOCAL ColTuple +//line sql.y:3495 { - yyVAL.colTuple = yyDollar[1].valTuple + yyLOCAL = yyDollar[1].valTupleUnion() } + yyVAL.union = yyLOCAL case 684: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3493 + var yyLOCAL ColTuple +//line sql.y:3499 { - yyVAL.colTuple = yyDollar[1].subquery + yyLOCAL = yyDollar[1].subqueryUnion() } + yyVAL.union = yyLOCAL case 685: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3497 + var yyLOCAL ColTuple +//line sql.y:3503 { - yyVAL.colTuple = ListArg(yyDollar[1].str) + yyLOCAL = ListArg(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 686: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3503 + var yyLOCAL *Subquery +//line sql.y:3509 { - yyVAL.subquery = &Subquery{yyDollar[2].selStmt} + yyLOCAL = &Subquery{yyDollar[2].selStmtUnion()} } + yyVAL.union = yyLOCAL case 687: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3509 + var yyLOCAL Exprs +//line sql.y:3515 { - yyVAL.exprs = Exprs{yyDollar[1].expr} + yyLOCAL = Exprs{yyDollar[1].exprUnion()} } + yyVAL.union = yyLOCAL case 688: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3513 +//line sql.y:3519 { - yyVAL.exprs = append(yyDollar[1].exprs, yyDollar[3].expr) + yySLICE := (*Exprs)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].exprUnion()) } case 689: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3519 + var yyLOCAL Expr +//line sql.y:3525 { - yyVAL.expr = yyDollar[1].expr + yyLOCAL = yyDollar[1].exprUnion() } + yyVAL.union = yyLOCAL case 690: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3523 + var yyLOCAL Expr +//line sql.y:3529 { - yyVAL.expr = yyDollar[1].boolVal + yyLOCAL = yyDollar[1].boolValUnion() } + yyVAL.union = yyLOCAL case 691: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3527 + var yyLOCAL Expr +//line sql.y:3533 { - yyVAL.expr = yyDollar[1].colName + yyLOCAL = yyDollar[1].colNameUnion() } + yyVAL.union = yyLOCAL case 692: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3531 + var yyLOCAL Expr +//line sql.y:3537 { - yyVAL.expr = yyDollar[1].expr + yyLOCAL = yyDollar[1].exprUnion() } + yyVAL.union = yyLOCAL case 693: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3535 + var yyLOCAL Expr +//line sql.y:3541 { - yyVAL.expr = yyDollar[1].subquery + yyLOCAL = yyDollar[1].subqueryUnion() } + yyVAL.union = yyLOCAL case 694: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3539 + var yyLOCAL Expr +//line sql.y:3545 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: BitAndOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: BitAndOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 695: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3543 + var yyLOCAL Expr +//line sql.y:3549 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: BitOrOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: BitOrOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 696: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3547 + var yyLOCAL Expr +//line sql.y:3553 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: BitXorOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: BitXorOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 697: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3551 + var yyLOCAL Expr +//line sql.y:3557 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: PlusOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: PlusOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 698: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3555 + var yyLOCAL Expr +//line sql.y:3561 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: MinusOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: MinusOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 699: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3559 + var yyLOCAL Expr +//line sql.y:3565 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: MultOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: MultOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 700: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3563 + var yyLOCAL Expr +//line sql.y:3569 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: DivOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: DivOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 701: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3567 + var yyLOCAL Expr +//line sql.y:3573 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: IntDivOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: IntDivOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 702: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3571 + var yyLOCAL Expr +//line sql.y:3577 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: ModOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: ModOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 703: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3575 + var yyLOCAL Expr +//line sql.y:3581 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: ModOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: ModOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 704: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3579 + var yyLOCAL Expr +//line sql.y:3585 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: ShiftLeftOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: ShiftLeftOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 705: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3583 + var yyLOCAL Expr +//line sql.y:3589 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].expr, Operator: ShiftRightOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].exprUnion(), Operator: ShiftRightOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 706: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3587 + var yyLOCAL Expr +//line sql.y:3593 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].colName, Operator: JSONExtractOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].colNameUnion(), Operator: JSONExtractOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 707: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3591 + var yyLOCAL Expr +//line sql.y:3597 { - yyVAL.expr = &BinaryExpr{Left: yyDollar[1].colName, Operator: JSONUnquoteExtractOp, Right: yyDollar[3].expr} + yyLOCAL = &BinaryExpr{Left: yyDollar[1].colNameUnion(), Operator: JSONUnquoteExtractOp, Right: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 708: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3595 + var yyLOCAL Expr +//line sql.y:3601 { - yyVAL.expr = &CollateExpr{Expr: yyDollar[1].expr, Charset: yyDollar[3].str} + yyLOCAL = &CollateExpr{Expr: yyDollar[1].exprUnion(), Charset: yyDollar[3].str} } + yyVAL.union = yyLOCAL case 709: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3599 + var yyLOCAL Expr +//line sql.y:3605 { - yyVAL.expr = &UnaryExpr{Operator: BinaryOp, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: BinaryOp, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 710: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3603 + var yyLOCAL Expr +//line sql.y:3609 { - yyVAL.expr = &UnaryExpr{Operator: UBinaryOp, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: UBinaryOp, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 711: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3607 + var yyLOCAL Expr +//line sql.y:3613 { - yyVAL.expr = &UnaryExpr{Operator: Utf8Op, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: Utf8Op, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 712: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3611 + var yyLOCAL Expr +//line sql.y:3617 { - yyVAL.expr = &UnaryExpr{Operator: Utf8mb4Op, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: Utf8mb4Op, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 713: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3615 + var yyLOCAL Expr +//line sql.y:3621 { - yyVAL.expr = &UnaryExpr{Operator: Latin1Op, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: Latin1Op, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 714: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3619 + var yyLOCAL Expr +//line sql.y:3625 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 715: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3623 + var yyLOCAL Expr +//line sql.y:3629 { - yyVAL.expr = handleUnaryMinus(yyDollar[2].expr) + yyLOCAL = handleUnaryMinus(yyDollar[2].exprUnion()) } + yyVAL.union = yyLOCAL case 716: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3627 + var yyLOCAL Expr +//line sql.y:3633 { - yyVAL.expr = &UnaryExpr{Operator: TildaOp, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: TildaOp, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 717: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3631 + var yyLOCAL Expr +//line sql.y:3637 { - yyVAL.expr = &UnaryExpr{Operator: BangOp, Expr: yyDollar[2].expr} + yyLOCAL = &UnaryExpr{Operator: BangOp, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 718: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3635 + var yyLOCAL Expr +//line sql.y:3641 { // This rule prevents the usage of INTERVAL // as a function. If support is needed for that, // we'll need to revisit this. The solution // will be non-trivial because of grammar conflicts. - yyVAL.expr = &IntervalExpr{Expr: yyDollar[2].expr, Unit: yyDollar[3].colIdent.String()} + yyLOCAL = &IntervalExpr{Expr: yyDollar[2].exprUnion(), Unit: yyDollar[3].colIdent.String()} } + yyVAL.union = yyLOCAL case 723: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3653 + var yyLOCAL Expr +//line sql.y:3659 { - yyVAL.expr = &FuncExpr{Name: yyDollar[1].colIdent, Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: yyDollar[1].colIdent, Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 724: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3657 + var yyLOCAL Expr +//line sql.y:3663 { - yyVAL.expr = &FuncExpr{Name: yyDollar[1].colIdent, Distinct: true, Exprs: yyDollar[4].selectExprs} + yyLOCAL = &FuncExpr{Name: yyDollar[1].colIdent, Distinct: true, Exprs: yyDollar[4].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 725: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3661 + var yyLOCAL Expr +//line sql.y:3667 { - yyVAL.expr = &FuncExpr{Name: yyDollar[1].colIdent, Distinct: true, Exprs: yyDollar[4].selectExprs} + yyLOCAL = &FuncExpr{Name: yyDollar[1].colIdent, Distinct: true, Exprs: yyDollar[4].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 726: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:3665 + var yyLOCAL Expr +//line sql.y:3671 { - yyVAL.expr = &FuncExpr{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].colIdent, Exprs: yyDollar[5].selectExprs} + yyLOCAL = &FuncExpr{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].colIdent, Exprs: yyDollar[5].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 727: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3675 + var yyLOCAL Expr +//line sql.y:3681 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("left"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("left"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 728: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3679 + var yyLOCAL Expr +//line sql.y:3685 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("right"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("right"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 729: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:3683 + var yyLOCAL Expr +//line sql.y:3689 { - yyVAL.expr = &ConvertExpr{Expr: yyDollar[3].expr, Type: yyDollar[5].convertType} + yyLOCAL = &ConvertExpr{Expr: yyDollar[3].exprUnion(), Type: yyDollar[5].convertTypeUnion()} } + yyVAL.union = yyLOCAL case 730: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:3687 + var yyLOCAL Expr +//line sql.y:3693 { - yyVAL.expr = &ConvertExpr{Expr: yyDollar[3].expr, Type: yyDollar[5].convertType} + yyLOCAL = &ConvertExpr{Expr: yyDollar[3].exprUnion(), Type: yyDollar[5].convertTypeUnion()} } + yyVAL.union = yyLOCAL case 731: yyDollar = yyS[yypt-6 : yypt+1] -//line sql.y:3691 + var yyLOCAL Expr +//line sql.y:3697 { - yyVAL.expr = &ConvertUsingExpr{Expr: yyDollar[3].expr, Type: yyDollar[5].str} + yyLOCAL = &ConvertUsingExpr{Expr: yyDollar[3].exprUnion(), Type: yyDollar[5].str} } + yyVAL.union = yyLOCAL case 732: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3695 + var yyLOCAL Expr +//line sql.y:3701 { - yyVAL.expr = &SubstrExpr{Name: yyDollar[3].colName, From: yyDollar[5].expr, To: yyDollar[7].expr} + yyLOCAL = &SubstrExpr{Name: yyDollar[3].colNameUnion(), From: yyDollar[5].exprUnion(), To: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 733: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3699 + var yyLOCAL Expr +//line sql.y:3705 { - yyVAL.expr = &SubstrExpr{Name: yyDollar[3].colName, From: yyDollar[5].expr, To: yyDollar[7].expr} + yyLOCAL = &SubstrExpr{Name: yyDollar[3].colNameUnion(), From: yyDollar[5].exprUnion(), To: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 734: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3703 + var yyLOCAL Expr +//line sql.y:3709 { - yyVAL.expr = &SubstrExpr{StrVal: NewStrLiteral(yyDollar[3].str), From: yyDollar[5].expr, To: yyDollar[7].expr} + yyLOCAL = &SubstrExpr{StrVal: NewStrLiteral(yyDollar[3].str), From: yyDollar[5].exprUnion(), To: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 735: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3707 + var yyLOCAL Expr +//line sql.y:3713 { - yyVAL.expr = &SubstrExpr{StrVal: NewStrLiteral(yyDollar[3].str), From: yyDollar[5].expr, To: yyDollar[7].expr} + yyLOCAL = &SubstrExpr{StrVal: NewStrLiteral(yyDollar[3].str), From: yyDollar[5].exprUnion(), To: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 736: yyDollar = yyS[yypt-9 : yypt+1] -//line sql.y:3711 + var yyLOCAL Expr +//line sql.y:3717 { - yyVAL.expr = &MatchExpr{Columns: yyDollar[3].selectExprs, Expr: yyDollar[7].expr, Option: yyDollar[8].matchExprOption} + yyLOCAL = &MatchExpr{Columns: yyDollar[3].selectExprsUnion(), Expr: yyDollar[7].exprUnion(), Option: yyDollar[8].matchExprOptionUnion()} } + yyVAL.union = yyLOCAL case 737: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3715 + var yyLOCAL Expr +//line sql.y:3721 { - yyVAL.expr = &GroupConcatExpr{Distinct: yyDollar[3].boolean, Exprs: yyDollar[4].selectExprs, OrderBy: yyDollar[5].orderBy, Separator: yyDollar[6].str, Limit: yyDollar[7].limit} + yyLOCAL = &GroupConcatExpr{Distinct: yyDollar[3].booleanUnion(), Exprs: yyDollar[4].selectExprsUnion(), OrderBy: yyDollar[5].orderByUnion(), Separator: yyDollar[6].str, Limit: yyDollar[7].limitUnion()} } + yyVAL.union = yyLOCAL case 738: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3719 + var yyLOCAL Expr +//line sql.y:3725 { - yyVAL.expr = &CaseExpr{Expr: yyDollar[2].expr, Whens: yyDollar[3].whens, Else: yyDollar[4].expr} + yyLOCAL = &CaseExpr{Expr: yyDollar[2].exprUnion(), Whens: yyDollar[3].whensUnion(), Else: yyDollar[4].exprUnion()} } + yyVAL.union = yyLOCAL case 739: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3723 + var yyLOCAL Expr +//line sql.y:3729 { - yyVAL.expr = &ValuesFuncExpr{Name: yyDollar[3].colName} + yyLOCAL = &ValuesFuncExpr{Name: yyDollar[3].colNameUnion()} } + yyVAL.union = yyLOCAL case 740: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3733 + var yyLOCAL Expr +//line sql.y:3739 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("current_timestamp")} + yyLOCAL = &FuncExpr{Name: NewColIdent("current_timestamp")} } + yyVAL.union = yyLOCAL case 741: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3737 + var yyLOCAL Expr +//line sql.y:3743 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("utc_timestamp")} + yyLOCAL = &FuncExpr{Name: NewColIdent("utc_timestamp")} } + yyVAL.union = yyLOCAL case 742: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3741 + var yyLOCAL Expr +//line sql.y:3747 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("utc_time")} + yyLOCAL = &FuncExpr{Name: NewColIdent("utc_time")} } + yyVAL.union = yyLOCAL case 743: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3746 + var yyLOCAL Expr +//line sql.y:3752 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("utc_date")} + yyLOCAL = &FuncExpr{Name: NewColIdent("utc_date")} } + yyVAL.union = yyLOCAL case 744: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3751 + var yyLOCAL Expr +//line sql.y:3757 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("localtime")} + yyLOCAL = &FuncExpr{Name: NewColIdent("localtime")} } + yyVAL.union = yyLOCAL case 745: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3756 + var yyLOCAL Expr +//line sql.y:3762 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("localtimestamp")} + yyLOCAL = &FuncExpr{Name: NewColIdent("localtimestamp")} } + yyVAL.union = yyLOCAL case 746: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3762 + var yyLOCAL Expr +//line sql.y:3768 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("current_date")} + yyLOCAL = &FuncExpr{Name: NewColIdent("current_date")} } + yyVAL.union = yyLOCAL case 747: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3767 + var yyLOCAL Expr +//line sql.y:3773 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("current_time")} + yyLOCAL = &FuncExpr{Name: NewColIdent("current_time")} } + yyVAL.union = yyLOCAL case 748: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3772 + var yyLOCAL Expr +//line sql.y:3778 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("current_timestamp"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("current_timestamp"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 749: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3776 + var yyLOCAL Expr +//line sql.y:3782 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("utc_timestamp"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("utc_timestamp"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 750: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3780 + var yyLOCAL Expr +//line sql.y:3786 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("utc_time"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("utc_time"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 751: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3785 + var yyLOCAL Expr +//line sql.y:3791 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("localtime"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("localtime"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 752: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3790 + var yyLOCAL Expr +//line sql.y:3796 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("localtimestamp"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("localtimestamp"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 753: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3795 + var yyLOCAL Expr +//line sql.y:3801 { - yyVAL.expr = &CurTimeFuncExpr{Name: NewColIdent("current_time"), Fsp: yyDollar[2].expr} + yyLOCAL = &CurTimeFuncExpr{Name: NewColIdent("current_time"), Fsp: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 754: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3799 + var yyLOCAL Expr +//line sql.y:3805 { - yyVAL.expr = &TimestampFuncExpr{Name: string("timestampadd"), Unit: yyDollar[3].colIdent.String(), Expr1: yyDollar[5].expr, Expr2: yyDollar[7].expr} + yyLOCAL = &TimestampFuncExpr{Name: string("timestampadd"), Unit: yyDollar[3].colIdent.String(), Expr1: yyDollar[5].exprUnion(), Expr2: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 755: yyDollar = yyS[yypt-8 : yypt+1] -//line sql.y:3803 + var yyLOCAL Expr +//line sql.y:3809 { - yyVAL.expr = &TimestampFuncExpr{Name: string("timestampdiff"), Unit: yyDollar[3].colIdent.String(), Expr1: yyDollar[5].expr, Expr2: yyDollar[7].expr} + yyLOCAL = &TimestampFuncExpr{Name: string("timestampdiff"), Unit: yyDollar[3].colIdent.String(), Expr1: yyDollar[5].exprUnion(), Expr2: yyDollar[7].exprUnion()} } + yyVAL.union = yyLOCAL case 758: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3813 + var yyLOCAL Expr +//line sql.y:3819 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 759: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3823 + var yyLOCAL Expr +//line sql.y:3829 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("if"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("if"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 760: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3827 + var yyLOCAL Expr +//line sql.y:3833 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("database"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("database"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 761: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3831 + var yyLOCAL Expr +//line sql.y:3837 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("schema"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("schema"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 762: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3835 + var yyLOCAL Expr +//line sql.y:3841 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("mod"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("mod"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 763: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3839 + var yyLOCAL Expr +//line sql.y:3845 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("replace"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("replace"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 764: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3843 + var yyLOCAL Expr +//line sql.y:3849 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("substr"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("substr"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 765: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3847 + var yyLOCAL Expr +//line sql.y:3853 { - yyVAL.expr = &FuncExpr{Name: NewColIdent("substr"), Exprs: yyDollar[3].selectExprs} + yyLOCAL = &FuncExpr{Name: NewColIdent("substr"), Exprs: yyDollar[3].selectExprsUnion()} } + yyVAL.union = yyLOCAL case 766: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3853 + var yyLOCAL MatchExprOption +//line sql.y:3859 { - yyVAL.matchExprOption = NoOption + yyLOCAL = NoOption } + yyVAL.union = yyLOCAL case 767: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3857 + var yyLOCAL MatchExprOption +//line sql.y:3863 { - yyVAL.matchExprOption = BooleanModeOpt + yyLOCAL = BooleanModeOpt } + yyVAL.union = yyLOCAL case 768: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3861 + var yyLOCAL MatchExprOption +//line sql.y:3867 { - yyVAL.matchExprOption = NaturalLanguageModeOpt + yyLOCAL = NaturalLanguageModeOpt } + yyVAL.union = yyLOCAL case 769: yyDollar = yyS[yypt-7 : yypt+1] -//line sql.y:3865 + var yyLOCAL MatchExprOption +//line sql.y:3871 { - yyVAL.matchExprOption = NaturalLanguageModeWithQueryExpansionOpt + yyLOCAL = NaturalLanguageModeWithQueryExpansionOpt } + yyVAL.union = yyLOCAL case 770: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3869 + var yyLOCAL MatchExprOption +//line sql.y:3875 { - yyVAL.matchExprOption = QueryExpansionOpt + yyLOCAL = QueryExpansionOpt } + yyVAL.union = yyLOCAL case 771: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3875 +//line sql.y:3881 { yyVAL.str = string(yyDollar[1].colIdent.String()) } case 772: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3879 +//line sql.y:3885 { yyVAL.str = string(yyDollar[1].str) } case 773: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3883 +//line sql.y:3889 { yyVAL.str = string(yyDollar[1].str) } case 774: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3889 + var yyLOCAL *ConvertType +//line sql.y:3895 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } + yyVAL.union = yyLOCAL case 775: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3893 + var yyLOCAL *ConvertType +//line sql.y:3899 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal, Charset: yyDollar[3].str, Operator: CharacterSetOp} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion(), Charset: yyDollar[3].str, Operator: CharacterSetOp} } + yyVAL.union = yyLOCAL case 776: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3897 + var yyLOCAL *ConvertType +//line sql.y:3903 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal, Charset: string(yyDollar[3].colIdent.String())} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion(), Charset: string(yyDollar[3].colIdent.String())} } + yyVAL.union = yyLOCAL case 777: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3901 + var yyLOCAL *ConvertType +//line sql.y:3907 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 778: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3905 + var yyLOCAL *ConvertType +//line sql.y:3911 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } + yyVAL.union = yyLOCAL case 779: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3909 + var yyLOCAL *ConvertType +//line sql.y:3915 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} - yyVAL.convertType.Length = yyDollar[2].LengthScaleOption.Length - yyVAL.convertType.Scale = yyDollar[2].LengthScaleOption.Scale + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL.Length = yyDollar[2].LengthScaleOption.Length + yyLOCAL.Scale = yyDollar[2].LengthScaleOption.Scale } + yyVAL.union = yyLOCAL case 780: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3915 + var yyLOCAL *ConvertType +//line sql.y:3921 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 781: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3919 + var yyLOCAL *ConvertType +//line sql.y:3925 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } + yyVAL.union = yyLOCAL case 782: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3923 + var yyLOCAL *ConvertType +//line sql.y:3929 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 783: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3927 + var yyLOCAL *ConvertType +//line sql.y:3933 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 784: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3931 + var yyLOCAL *ConvertType +//line sql.y:3937 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literal} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str), Length: yyDollar[2].literalUnion()} } + yyVAL.union = yyLOCAL case 785: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3935 + var yyLOCAL *ConvertType +//line sql.y:3941 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 786: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3939 + var yyLOCAL *ConvertType +//line sql.y:3945 { - yyVAL.convertType = &ConvertType{Type: string(yyDollar[1].str)} + yyLOCAL = &ConvertType{Type: string(yyDollar[1].str)} } + yyVAL.union = yyLOCAL case 787: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3944 + var yyLOCAL Expr +//line sql.y:3950 { - yyVAL.expr = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 788: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3948 + var yyLOCAL Expr +//line sql.y:3954 { - yyVAL.expr = yyDollar[1].expr + yyLOCAL = yyDollar[1].exprUnion() } + yyVAL.union = yyLOCAL case 789: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3953 +//line sql.y:3959 { yyVAL.str = string("") } case 790: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3957 +//line sql.y:3963 { yyVAL.str = " separator " + encodeSQLString(yyDollar[2].str) } case 791: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3963 + var yyLOCAL []*When +//line sql.y:3969 { - yyVAL.whens = []*When{yyDollar[1].when} + yyLOCAL = []*When{yyDollar[1].whenUnion()} } + yyVAL.union = yyLOCAL case 792: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3967 +//line sql.y:3973 { - yyVAL.whens = append(yyDollar[1].whens, yyDollar[2].when) + yySLICE := (*[]*When)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[2].whenUnion()) } case 793: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:3973 + var yyLOCAL *When +//line sql.y:3979 { - yyVAL.when = &When{Cond: yyDollar[2].expr, Val: yyDollar[4].expr} + yyLOCAL = &When{Cond: yyDollar[2].exprUnion(), Val: yyDollar[4].exprUnion()} } + yyVAL.union = yyLOCAL case 794: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:3978 + var yyLOCAL Expr +//line sql.y:3984 { - yyVAL.expr = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 795: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:3982 + var yyLOCAL Expr +//line sql.y:3988 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 796: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:3988 + var yyLOCAL *ColName +//line sql.y:3994 { - yyVAL.colName = &ColName{Name: yyDollar[1].colIdent} + yyLOCAL = &ColName{Name: yyDollar[1].colIdent} } + yyVAL.union = yyLOCAL case 797: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:3992 + var yyLOCAL *ColName +//line sql.y:3998 { - yyVAL.colName = &ColName{Qualifier: TableName{Name: yyDollar[1].tableIdent}, Name: yyDollar[3].colIdent} + yyLOCAL = &ColName{Qualifier: TableName{Name: yyDollar[1].tableIdent}, Name: yyDollar[3].colIdent} } + yyVAL.union = yyLOCAL case 798: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:3996 + var yyLOCAL *ColName +//line sql.y:4002 { - yyVAL.colName = &ColName{Qualifier: TableName{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].tableIdent}, Name: yyDollar[5].colIdent} + yyLOCAL = &ColName{Qualifier: TableName{Qualifier: yyDollar[1].tableIdent, Name: yyDollar[3].tableIdent}, Name: yyDollar[5].colIdent} } + yyVAL.union = yyLOCAL case 799: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4002 + var yyLOCAL Expr +//line sql.y:4008 { - yyVAL.expr = NewStrLiteral(yyDollar[1].str) + yyLOCAL = NewStrLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 800: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4006 + var yyLOCAL Expr +//line sql.y:4012 { - yyVAL.expr = NewHexLiteral(yyDollar[1].str) + yyLOCAL = NewHexLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 801: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4010 + var yyLOCAL Expr +//line sql.y:4016 { - yyVAL.expr = NewBitLiteral(yyDollar[1].str) + yyLOCAL = NewBitLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 802: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4014 + var yyLOCAL Expr +//line sql.y:4020 { - yyVAL.expr = NewIntLiteral(yyDollar[1].str) + yyLOCAL = NewIntLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 803: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4018 + var yyLOCAL Expr +//line sql.y:4024 { - yyVAL.expr = NewFloatLiteral(yyDollar[1].str) + yyLOCAL = NewFloatLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 804: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4022 + var yyLOCAL Expr +//line sql.y:4028 { - yyVAL.expr = NewHexNumLiteral(yyDollar[1].str) + yyLOCAL = NewHexNumLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 805: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4026 + var yyLOCAL Expr +//line sql.y:4032 { - yyVAL.expr = NewArgument(yyDollar[1].str) + yyLOCAL = NewArgument(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 806: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4030 + var yyLOCAL Expr +//line sql.y:4036 { - yyVAL.expr = &NullVal{} + yyLOCAL = &NullVal{} } + yyVAL.union = yyLOCAL case 807: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4036 + var yyLOCAL Expr +//line sql.y:4042 { // TODO(sougou): Deprecate this construct. if yyDollar[1].colIdent.Lowered() != "value" { yylex.Error("expecting value after next") return 1 } - yyVAL.expr = NewIntLiteral("1") + yyLOCAL = NewIntLiteral("1") } + yyVAL.union = yyLOCAL case 808: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4045 + var yyLOCAL Expr +//line sql.y:4051 { - yyVAL.expr = NewIntLiteral(yyDollar[1].str) + yyLOCAL = NewIntLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 809: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4049 + var yyLOCAL Expr +//line sql.y:4055 { - yyVAL.expr = NewArgument(yyDollar[1].str) + yyLOCAL = NewArgument(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 810: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4054 + var yyLOCAL Exprs +//line sql.y:4060 { - yyVAL.exprs = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 811: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4058 + var yyLOCAL Exprs +//line sql.y:4064 { - yyVAL.exprs = yyDollar[3].exprs + yyLOCAL = yyDollar[3].exprsUnion() } + yyVAL.union = yyLOCAL case 812: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4063 + var yyLOCAL Expr +//line sql.y:4069 { - yyVAL.expr = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 813: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4067 + var yyLOCAL Expr +//line sql.y:4073 { - yyVAL.expr = yyDollar[2].expr + yyLOCAL = yyDollar[2].exprUnion() } + yyVAL.union = yyLOCAL case 814: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4072 + var yyLOCAL OrderBy +//line sql.y:4078 { - yyVAL.orderBy = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 815: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4076 + var yyLOCAL OrderBy +//line sql.y:4082 { - yyVAL.orderBy = yyDollar[3].orderBy + yyLOCAL = yyDollar[3].orderByUnion() } + yyVAL.union = yyLOCAL case 816: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4082 + var yyLOCAL OrderBy +//line sql.y:4088 { - yyVAL.orderBy = OrderBy{yyDollar[1].order} + yyLOCAL = OrderBy{yyDollar[1].orderUnion()} } + yyVAL.union = yyLOCAL case 817: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4086 +//line sql.y:4092 { - yyVAL.orderBy = append(yyDollar[1].orderBy, yyDollar[3].order) + yySLICE := (*OrderBy)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].orderUnion()) } case 818: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4092 + var yyLOCAL *Order +//line sql.y:4098 { - yyVAL.order = &Order{Expr: yyDollar[1].expr, Direction: yyDollar[2].orderDirection} + yyLOCAL = &Order{Expr: yyDollar[1].exprUnion(), Direction: yyDollar[2].orderDirectionUnion()} } + yyVAL.union = yyLOCAL case 819: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4097 + var yyLOCAL OrderDirection +//line sql.y:4103 { - yyVAL.orderDirection = AscOrder + yyLOCAL = AscOrder } + yyVAL.union = yyLOCAL case 820: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4101 + var yyLOCAL OrderDirection +//line sql.y:4107 { - yyVAL.orderDirection = AscOrder + yyLOCAL = AscOrder } + yyVAL.union = yyLOCAL case 821: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4105 + var yyLOCAL OrderDirection +//line sql.y:4111 { - yyVAL.orderDirection = DescOrder + yyLOCAL = DescOrder } + yyVAL.union = yyLOCAL case 822: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4110 + var yyLOCAL *Limit +//line sql.y:4116 { - yyVAL.limit = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 823: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4114 + var yyLOCAL *Limit +//line sql.y:4120 { - yyVAL.limit = &Limit{Rowcount: yyDollar[2].expr} + yyLOCAL = &Limit{Rowcount: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 824: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4118 + var yyLOCAL *Limit +//line sql.y:4124 { - yyVAL.limit = &Limit{Offset: yyDollar[2].expr, Rowcount: yyDollar[4].expr} + yyLOCAL = &Limit{Offset: yyDollar[2].exprUnion(), Rowcount: yyDollar[4].exprUnion()} } + yyVAL.union = yyLOCAL case 825: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4122 + var yyLOCAL *Limit +//line sql.y:4128 { - yyVAL.limit = &Limit{Offset: yyDollar[4].expr, Rowcount: yyDollar[2].expr} + yyLOCAL = &Limit{Offset: yyDollar[4].exprUnion(), Rowcount: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 826: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4127 + var yyLOCAL []AlterOption +//line sql.y:4133 { - yyVAL.alterOptions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 827: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4131 + var yyLOCAL []AlterOption +//line sql.y:4137 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption, yyDollar[2].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion(), yyDollar[2].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 828: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4135 + var yyLOCAL []AlterOption +//line sql.y:4141 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption, yyDollar[2].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion(), yyDollar[2].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 829: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4139 + var yyLOCAL []AlterOption +//line sql.y:4145 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 830: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4143 + var yyLOCAL []AlterOption +//line sql.y:4149 { - yyVAL.alterOptions = []AlterOption{yyDollar[1].alterOption} + yyLOCAL = []AlterOption{yyDollar[1].alterOptionUnion()} } + yyVAL.union = yyLOCAL case 831: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4150 + var yyLOCAL AlterOption +//line sql.y:4156 { - yyVAL.alterOption = &LockOption{Type: DefaultType} + yyLOCAL = &LockOption{Type: DefaultType} } + yyVAL.union = yyLOCAL case 832: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4154 + var yyLOCAL AlterOption +//line sql.y:4160 { - yyVAL.alterOption = &LockOption{Type: NoneType} + yyLOCAL = &LockOption{Type: NoneType} } + yyVAL.union = yyLOCAL case 833: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4158 + var yyLOCAL AlterOption +//line sql.y:4164 { - yyVAL.alterOption = &LockOption{Type: SharedType} + yyLOCAL = &LockOption{Type: SharedType} } + yyVAL.union = yyLOCAL case 834: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4162 + var yyLOCAL AlterOption +//line sql.y:4168 { - yyVAL.alterOption = &LockOption{Type: ExclusiveType} + yyLOCAL = &LockOption{Type: ExclusiveType} } + yyVAL.union = yyLOCAL case 835: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4168 + var yyLOCAL AlterOption +//line sql.y:4174 { - yyVAL.alterOption = AlgorithmValue(yyDollar[3].str) + yyLOCAL = AlgorithmValue(yyDollar[3].str) } + yyVAL.union = yyLOCAL case 836: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4172 + var yyLOCAL AlterOption +//line sql.y:4178 { - yyVAL.alterOption = AlgorithmValue(yyDollar[3].str) + yyLOCAL = AlgorithmValue(yyDollar[3].str) } + yyVAL.union = yyLOCAL case 837: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4176 + var yyLOCAL AlterOption +//line sql.y:4182 { - yyVAL.alterOption = AlgorithmValue(yyDollar[3].str) + yyLOCAL = AlgorithmValue(yyDollar[3].str) } + yyVAL.union = yyLOCAL case 838: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4181 +//line sql.y:4187 { yyVAL.str = "" } case 839: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4185 +//line sql.y:4191 { yyVAL.str = string(yyDollar[3].str) } case 840: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4189 +//line sql.y:4195 { yyVAL.str = string(yyDollar[3].str) } case 841: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4193 +//line sql.y:4199 { yyVAL.str = string(yyDollar[3].str) } case 842: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4198 +//line sql.y:4204 { yyVAL.str = "" } case 843: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4202 +//line sql.y:4208 { yyVAL.str = yyDollar[3].str } case 844: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4208 +//line sql.y:4214 { yyVAL.str = string(yyDollar[1].str) } case 845: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4212 +//line sql.y:4218 { yyVAL.str = string(yyDollar[1].str) } case 846: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4217 +//line sql.y:4223 { yyVAL.str = "" } case 847: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4221 +//line sql.y:4227 { yyVAL.str = yyDollar[2].str } case 848: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4226 +//line sql.y:4232 { yyVAL.str = "cascaded" } case 849: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4230 +//line sql.y:4236 { yyVAL.str = string(yyDollar[1].str) } case 850: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4234 +//line sql.y:4240 { yyVAL.str = string(yyDollar[1].str) } case 851: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4239 +//line sql.y:4245 { yyVAL.str = "" } case 852: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4243 +//line sql.y:4249 { yyVAL.str = yyDollar[3].str } case 853: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4249 +//line sql.y:4255 { yyVAL.str = string(yyDollar[1].str) } case 854: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4253 +//line sql.y:4259 { yyVAL.str = string(yyDollar[1].str) } case 855: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4257 +//line sql.y:4263 { yyVAL.str = encodeSQLString(yyDollar[1].str) + "@" + string(yyDollar[2].str) } case 856: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4261 +//line sql.y:4267 { yyVAL.str = string(yyDollar[1].str) } case 857: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4266 + var yyLOCAL Lock +//line sql.y:4272 { - yyVAL.lock = NoLock + yyLOCAL = NoLock } + yyVAL.union = yyLOCAL case 858: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4270 + var yyLOCAL Lock +//line sql.y:4276 { - yyVAL.lock = ForUpdateLock + yyLOCAL = ForUpdateLock } + yyVAL.union = yyLOCAL case 859: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4274 + var yyLOCAL Lock +//line sql.y:4280 { - yyVAL.lock = ShareModeLock + yyLOCAL = ShareModeLock } + yyVAL.union = yyLOCAL case 860: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4279 + var yyLOCAL *SelectInto +//line sql.y:4285 { - yyVAL.selectInto = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 861: yyDollar = yyS[yypt-9 : yypt+1] -//line sql.y:4283 + var yyLOCAL *SelectInto +//line sql.y:4289 { - yyVAL.selectInto = &SelectInto{Type: IntoOutfileS3, FileName: encodeSQLString(yyDollar[4].str), Charset: yyDollar[5].str, FormatOption: yyDollar[6].str, ExportOption: yyDollar[7].str, Manifest: yyDollar[8].str, Overwrite: yyDollar[9].str} + yyLOCAL = &SelectInto{Type: IntoOutfileS3, FileName: encodeSQLString(yyDollar[4].str), Charset: yyDollar[5].str, FormatOption: yyDollar[6].str, ExportOption: yyDollar[7].str, Manifest: yyDollar[8].str, Overwrite: yyDollar[9].str} } + yyVAL.union = yyLOCAL case 862: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4287 + var yyLOCAL *SelectInto +//line sql.y:4293 { - yyVAL.selectInto = &SelectInto{Type: IntoDumpfile, FileName: encodeSQLString(yyDollar[3].str), Charset: "", FormatOption: "", ExportOption: "", Manifest: "", Overwrite: ""} + yyLOCAL = &SelectInto{Type: IntoDumpfile, FileName: encodeSQLString(yyDollar[3].str), Charset: "", FormatOption: "", ExportOption: "", Manifest: "", Overwrite: ""} } + yyVAL.union = yyLOCAL case 863: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:4291 + var yyLOCAL *SelectInto +//line sql.y:4297 { - yyVAL.selectInto = &SelectInto{Type: IntoOutfile, FileName: encodeSQLString(yyDollar[3].str), Charset: yyDollar[4].str, FormatOption: "", ExportOption: yyDollar[5].str, Manifest: "", Overwrite: ""} + yyLOCAL = &SelectInto{Type: IntoOutfile, FileName: encodeSQLString(yyDollar[3].str), Charset: yyDollar[4].str, FormatOption: "", ExportOption: yyDollar[5].str, Manifest: "", Overwrite: ""} } + yyVAL.union = yyLOCAL case 864: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4296 +//line sql.y:4302 { yyVAL.str = "" } case 865: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4300 +//line sql.y:4306 { yyVAL.str = " format csv" + yyDollar[3].str } case 866: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4304 +//line sql.y:4310 { yyVAL.str = " format text" + yyDollar[3].str } case 867: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4309 +//line sql.y:4315 { yyVAL.str = "" } case 868: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4313 +//line sql.y:4319 { yyVAL.str = " header" } case 869: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4318 +//line sql.y:4324 { yyVAL.str = "" } case 870: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4322 +//line sql.y:4328 { yyVAL.str = " manifest on" } case 871: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4326 +//line sql.y:4332 { yyVAL.str = " manifest off" } case 872: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4331 +//line sql.y:4337 { yyVAL.str = "" } case 873: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4335 +//line sql.y:4341 { yyVAL.str = " overwrite on" } case 874: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4339 +//line sql.y:4345 { yyVAL.str = " overwrite off" } case 875: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4345 +//line sql.y:4351 { yyVAL.str = yyDollar[1].str + yyDollar[2].str } case 876: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4350 +//line sql.y:4356 { yyVAL.str = "" } case 877: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4354 +//line sql.y:4360 { yyVAL.str = " lines" + yyDollar[2].str } case 878: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4360 +//line sql.y:4366 { yyVAL.str = yyDollar[1].str } case 879: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4364 +//line sql.y:4370 { yyVAL.str = yyDollar[1].str + yyDollar[2].str } case 880: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4370 +//line sql.y:4376 { yyVAL.str = " starting by " + encodeSQLString(yyDollar[3].str) } case 881: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4374 +//line sql.y:4380 { yyVAL.str = " terminated by " + encodeSQLString(yyDollar[3].str) } case 882: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4379 +//line sql.y:4385 { yyVAL.str = "" } case 883: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4383 +//line sql.y:4389 { yyVAL.str = " " + yyDollar[1].str + yyDollar[2].str } case 884: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4389 +//line sql.y:4395 { yyVAL.str = yyDollar[1].str } case 885: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4393 +//line sql.y:4399 { yyVAL.str = yyDollar[1].str + yyDollar[2].str } case 886: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4399 +//line sql.y:4405 { yyVAL.str = " terminated by " + encodeSQLString(yyDollar[3].str) } case 887: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4403 +//line sql.y:4409 { yyVAL.str = yyDollar[1].str + " enclosed by " + encodeSQLString(yyDollar[4].str) } case 888: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4407 +//line sql.y:4413 { yyVAL.str = " escaped by " + encodeSQLString(yyDollar[3].str) } case 889: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4412 +//line sql.y:4418 { yyVAL.str = "" } case 890: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4416 +//line sql.y:4422 { yyVAL.str = " optionally" } case 891: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4429 + var yyLOCAL *Insert +//line sql.y:4435 { - yyVAL.ins = &Insert{Rows: yyDollar[2].values} + yyLOCAL = &Insert{Rows: yyDollar[2].valuesUnion()} } + yyVAL.union = yyLOCAL case 892: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4433 + var yyLOCAL *Insert +//line sql.y:4439 { - yyVAL.ins = &Insert{Rows: yyDollar[1].selStmt} + yyLOCAL = &Insert{Rows: yyDollar[1].selStmtUnion()} } + yyVAL.union = yyLOCAL case 893: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:4437 + var yyLOCAL *Insert +//line sql.y:4443 { - yyVAL.ins = &Insert{Columns: yyDollar[2].columns, Rows: yyDollar[5].values} + yyLOCAL = &Insert{Columns: yyDollar[2].columnsUnion(), Rows: yyDollar[5].valuesUnion()} } + yyVAL.union = yyLOCAL case 894: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4441 + var yyLOCAL *Insert +//line sql.y:4447 { - yyVAL.ins = &Insert{Rows: yyDollar[4].values} + yyLOCAL = &Insert{Rows: yyDollar[4].valuesUnion()} } + yyVAL.union = yyLOCAL case 895: yyDollar = yyS[yypt-4 : yypt+1] -//line sql.y:4445 + var yyLOCAL *Insert +//line sql.y:4451 { - yyVAL.ins = &Insert{Columns: yyDollar[2].columns, Rows: yyDollar[4].selStmt} + yyLOCAL = &Insert{Columns: yyDollar[2].columnsUnion(), Rows: yyDollar[4].selStmtUnion()} } + yyVAL.union = yyLOCAL case 896: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4451 + var yyLOCAL Columns +//line sql.y:4457 { - yyVAL.columns = Columns{yyDollar[1].colIdent} + yyLOCAL = Columns{yyDollar[1].colIdent} } + yyVAL.union = yyLOCAL case 897: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4455 + var yyLOCAL Columns +//line sql.y:4461 { - yyVAL.columns = Columns{yyDollar[3].colIdent} + yyLOCAL = Columns{yyDollar[3].colIdent} } + yyVAL.union = yyLOCAL case 898: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4459 +//line sql.y:4465 { - yyVAL.columns = append(yyVAL.columns, yyDollar[3].colIdent) + yySLICE := (*Columns)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].colIdent) } case 899: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:4463 +//line sql.y:4469 { - yyVAL.columns = append(yyVAL.columns, yyDollar[5].colIdent) + yySLICE := (*Columns)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[5].colIdent) } case 900: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4468 + var yyLOCAL UpdateExprs +//line sql.y:4474 { - yyVAL.updateExprs = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 901: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:4472 + var yyLOCAL UpdateExprs +//line sql.y:4478 { - yyVAL.updateExprs = yyDollar[5].updateExprs + yyLOCAL = yyDollar[5].updateExprsUnion() } + yyVAL.union = yyLOCAL case 902: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4478 + var yyLOCAL Values +//line sql.y:4484 { - yyVAL.values = Values{yyDollar[1].valTuple} + yyLOCAL = Values{yyDollar[1].valTupleUnion()} } + yyVAL.union = yyLOCAL case 903: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4482 +//line sql.y:4488 { - yyVAL.values = append(yyDollar[1].values, yyDollar[3].valTuple) + yySLICE := (*Values)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].valTupleUnion()) } case 904: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4488 + var yyLOCAL ValTuple +//line sql.y:4494 { - yyVAL.valTuple = yyDollar[1].valTuple + yyLOCAL = yyDollar[1].valTupleUnion() } + yyVAL.union = yyLOCAL case 905: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4492 + var yyLOCAL ValTuple +//line sql.y:4498 { - yyVAL.valTuple = ValTuple{} + yyLOCAL = ValTuple{} } + yyVAL.union = yyLOCAL case 906: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4498 + var yyLOCAL ValTuple +//line sql.y:4504 { - yyVAL.valTuple = ValTuple(yyDollar[2].exprs) + yyLOCAL = ValTuple(yyDollar[2].exprsUnion()) } + yyVAL.union = yyLOCAL case 907: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4504 + var yyLOCAL Expr +//line sql.y:4510 { - if len(yyDollar[1].valTuple) == 1 { - yyVAL.expr = yyDollar[1].valTuple[0] + if len(yyDollar[1].valTupleUnion()) == 1 { + yyLOCAL = yyDollar[1].valTupleUnion()[0] } else { - yyVAL.expr = yyDollar[1].valTuple + yyLOCAL = yyDollar[1].valTupleUnion() } } + yyVAL.union = yyLOCAL case 908: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4514 + var yyLOCAL UpdateExprs +//line sql.y:4520 { - yyVAL.updateExprs = UpdateExprs{yyDollar[1].updateExpr} + yyLOCAL = UpdateExprs{yyDollar[1].updateExprUnion()} } + yyVAL.union = yyLOCAL case 909: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4518 +//line sql.y:4524 { - yyVAL.updateExprs = append(yyDollar[1].updateExprs, yyDollar[3].updateExpr) + yySLICE := (*UpdateExprs)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].updateExprUnion()) } case 910: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4524 + var yyLOCAL *UpdateExpr +//line sql.y:4530 { - yyVAL.updateExpr = &UpdateExpr{Name: yyDollar[1].colName, Expr: yyDollar[3].expr} + yyLOCAL = &UpdateExpr{Name: yyDollar[1].colNameUnion(), Expr: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 911: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4530 + var yyLOCAL SetExprs +//line sql.y:4536 { - yyVAL.setExprs = SetExprs{yyDollar[1].setExpr} + yyLOCAL = SetExprs{yyDollar[1].setExprUnion()} } + yyVAL.union = yyLOCAL case 912: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4534 +//line sql.y:4540 { - yyVAL.setExprs = append(yyDollar[1].setExprs, yyDollar[3].setExpr) + yySLICE := (*SetExprs)(yyIaddr(yyVAL.union)) + *yySLICE = append(*yySLICE, yyDollar[3].setExprUnion()) } case 913: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4540 + var yyLOCAL *SetExpr +//line sql.y:4546 { - yyVAL.setExpr = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: NewStrLiteral("on")} + yyLOCAL = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: NewStrLiteral("on")} } + yyVAL.union = yyLOCAL case 914: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4544 + var yyLOCAL *SetExpr +//line sql.y:4550 { - yyVAL.setExpr = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: NewStrLiteral("off")} + yyLOCAL = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: NewStrLiteral("off")} } + yyVAL.union = yyLOCAL case 915: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4548 + var yyLOCAL *SetExpr +//line sql.y:4554 { - yyVAL.setExpr = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: yyDollar[3].expr} + yyLOCAL = &SetExpr{Name: yyDollar[1].colIdent, Scope: ImplicitScope, Expr: yyDollar[3].exprUnion()} } + yyVAL.union = yyLOCAL case 916: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4552 + var yyLOCAL *SetExpr +//line sql.y:4558 { - yyVAL.setExpr = &SetExpr{Name: NewColIdent(string(yyDollar[1].str)), Scope: ImplicitScope, Expr: yyDollar[2].expr} + yyLOCAL = &SetExpr{Name: NewColIdent(string(yyDollar[1].str)), Scope: ImplicitScope, Expr: yyDollar[2].exprUnion()} } + yyVAL.union = yyLOCAL case 917: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4556 + var yyLOCAL *SetExpr +//line sql.y:4562 { - yyDollar[2].setExpr.Scope = yyDollar[1].scope - yyVAL.setExpr = yyDollar[2].setExpr + yyDollar[2].setExprUnion().Scope = yyDollar[1].scopeUnion() + yyLOCAL = yyDollar[2].setExprUnion() } + yyVAL.union = yyLOCAL case 919: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4564 +//line sql.y:4570 { yyVAL.str = "charset" } case 922: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4574 + var yyLOCAL Expr +//line sql.y:4580 { - yyVAL.expr = NewStrLiteral(yyDollar[1].colIdent.String()) + yyLOCAL = NewStrLiteral(yyDollar[1].colIdent.String()) } + yyVAL.union = yyLOCAL case 923: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4578 + var yyLOCAL Expr +//line sql.y:4584 { - yyVAL.expr = NewStrLiteral(yyDollar[1].str) + yyLOCAL = NewStrLiteral(yyDollar[1].str) } + yyVAL.union = yyLOCAL case 924: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4582 + var yyLOCAL Expr +//line sql.y:4588 { - yyVAL.expr = &Default{} + yyLOCAL = &Default{} } + yyVAL.union = yyLOCAL case 927: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4591 + var yyLOCAL bool +//line sql.y:4597 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 928: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4593 + var yyLOCAL bool +//line sql.y:4599 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 929: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4596 + var yyLOCAL bool +//line sql.y:4602 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 930: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4598 + var yyLOCAL bool +//line sql.y:4604 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 931: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4601 + var yyLOCAL bool +//line sql.y:4607 { - yyVAL.boolean = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 932: yyDollar = yyS[yypt-3 : yypt+1] -//line sql.y:4603 + var yyLOCAL bool +//line sql.y:4609 { - yyVAL.boolean = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 933: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4606 + var yyLOCAL Ignore +//line sql.y:4612 { - yyVAL.ignore = false + yyLOCAL = false } + yyVAL.union = yyLOCAL case 934: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4608 + var yyLOCAL Ignore +//line sql.y:4614 { - yyVAL.ignore = true + yyLOCAL = true } + yyVAL.union = yyLOCAL case 935: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4611 +//line sql.y:4617 { yyVAL.empty = struct{}{} } case 936: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4613 +//line sql.y:4619 { yyVAL.empty = struct{}{} } case 937: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4615 +//line sql.y:4621 { yyVAL.empty = struct{}{} } case 938: yyDollar = yyS[yypt-5 : yypt+1] -//line sql.y:4619 + var yyLOCAL Statement +//line sql.y:4625 { - yyVAL.statement = &CallProc{Name: yyDollar[2].tableName, Params: yyDollar[4].exprs} + yyLOCAL = &CallProc{Name: yyDollar[2].tableName, Params: yyDollar[4].exprsUnion()} } + yyVAL.union = yyLOCAL case 939: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4624 + var yyLOCAL Exprs +//line sql.y:4630 { - yyVAL.exprs = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 940: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4628 + var yyLOCAL Exprs +//line sql.y:4634 { - yyVAL.exprs = yyDollar[1].exprs + yyLOCAL = yyDollar[1].exprsUnion() } + yyVAL.union = yyLOCAL case 941: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:4633 + var yyLOCAL []*IndexOption +//line sql.y:4639 { - yyVAL.indexOptions = nil + yyLOCAL = nil } + yyVAL.union = yyLOCAL case 942: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4635 + var yyLOCAL []*IndexOption +//line sql.y:4641 { - yyVAL.indexOptions = []*IndexOption{yyDollar[1].indexOption} + yyLOCAL = []*IndexOption{yyDollar[1].indexOptionUnion()} } + yyVAL.union = yyLOCAL case 943: yyDollar = yyS[yypt-2 : yypt+1] -//line sql.y:4639 + var yyLOCAL *IndexOption +//line sql.y:4645 { - yyVAL.indexOption = &IndexOption{Name: string(yyDollar[1].str), String: string(yyDollar[2].colIdent.String())} + yyLOCAL = &IndexOption{Name: string(yyDollar[1].str), String: string(yyDollar[2].colIdent.String())} } + yyVAL.union = yyLOCAL case 944: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4645 +//line sql.y:4651 { yyVAL.colIdent = yyDollar[1].colIdent } case 945: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4649 +//line sql.y:4655 { yyVAL.colIdent = NewColIdent(string(yyDollar[1].str)) } case 947: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4656 +//line sql.y:4662 { yyVAL.colIdent = NewColIdent(string(yyDollar[1].str)) } case 948: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4662 +//line sql.y:4668 { yyVAL.tableIdent = NewTableIdent(string(yyDollar[1].colIdent.String())) } case 949: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4666 +//line sql.y:4672 { yyVAL.tableIdent = NewTableIdent(string(yyDollar[1].str)) } case 951: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:4673 +//line sql.y:4679 { yyVAL.tableIdent = NewTableIdent(string(yyDollar[1].str)) } case 1351: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:5097 +//line sql.y:5103 { if incNesting(yylex) { yylex.Error("max nesting level reached") @@ -10906,31 +12496,31 @@ yydefault: } case 1352: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:5106 +//line sql.y:5112 { decNesting(yylex) } case 1353: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:5111 +//line sql.y:5117 { skipToEnd(yylex) } case 1354: yyDollar = yyS[yypt-0 : yypt+1] -//line sql.y:5116 +//line sql.y:5122 { skipToEnd(yylex) } case 1355: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:5120 +//line sql.y:5126 { skipToEnd(yylex) } case 1356: yyDollar = yyS[yypt-1 : yypt+1] -//line sql.y:5124 +//line sql.y:5130 { skipToEnd(yylex) } diff --git a/go/vt/sqlparser/sql.y b/go/vt/sqlparser/sql.y index cd62dedaf17..d1474a785a4 100644 --- a/go/vt/sqlparser/sql.y +++ b/go/vt/sqlparser/sql.y @@ -50,78 +50,95 @@ func skipToEnd(yylex interface{}) { %} -%union { +%struct { empty struct{} + LengthScaleOption LengthScaleOption + tableName TableName + tableIdent TableIdent + str string + strs []string + vindexParam VindexParam + colIdent ColIdent + joinCondition JoinCondition + collateAndCharset CollateAndCharset + columnType ColumnType +} + +%union { statement Statement selStmt SelectStatement + tableExpr TableExpr + expr Expr + colTuple ColTuple + optVal Expr + constraintInfo ConstraintInfo + alterOption AlterOption + characteristic Characteristic + ins *Insert - byt byte - str string - strs []string - selectExprs SelectExprs - selectExpr SelectExpr - columns Columns - partitions Partitions colName *ColName - tableExprs TableExprs - tableExpr TableExpr - joinCondition JoinCondition - tableName TableName - tableNames TableNames indexHints *IndexHints - expr Expr - exprs Exprs - boolVal BoolVal - boolean bool literal *Literal - colTuple ColTuple - values Values - valTuple ValTuple subquery *Subquery derivedTable *DerivedTable - whens []*When when *When - orderBy OrderBy order *Order limit *Limit - updateExprs UpdateExprs - setExprs SetExprs updateExpr *UpdateExpr setExpr *SetExpr - characteristic Characteristic - characteristics []Characteristic - colIdent ColIdent - tableIdent TableIdent convertType *ConvertType aliasedTableName *AliasedTableExpr - TableSpec *TableSpec - columnType ColumnType - colKeyOpt ColumnKeyOption - optVal Expr - LengthScaleOption LengthScaleOption + tableSpec *TableSpec columnDefinition *ColumnDefinition - columnDefinitions []*ColumnDefinition indexDefinition *IndexDefinition indexInfo *IndexInfo indexOption *IndexOption - indexOptions []*IndexOption indexColumn *IndexColumn - indexColumns []*IndexColumn - constraintDefinition *ConstraintDefinition - constraintInfo ConstraintInfo - ReferenceAction ReferenceAction - partDefs []*PartitionDefinition partDef *PartitionDefinition partSpec *PartitionSpec - partSpecs []*PartitionSpec - vindexParam VindexParam - vindexParams []VindexParam showFilter *ShowFilter optLike *OptLike + selectInto *SelectInto + createDatabase *CreateDatabase + alterDatabase *AlterDatabase + createTable *CreateTable + tableAndLockType *TableAndLockType + alterTable *AlterTable + tableOption *TableOption + columnTypeOptions *ColumnTypeOptions + constraintDefinition *ConstraintDefinition + + whens []*When + columnDefinitions []*ColumnDefinition + indexOptions []*IndexOption + indexColumns []*IndexColumn + collateAndCharsets []CollateAndCharset + tableAndLockTypes TableAndLockTypes + renameTablePairs []*RenameTablePair + alterOptions []AlterOption + vindexParams []VindexParam + partDefs []*PartitionDefinition + partSpecs []*PartitionSpec + characteristics []Characteristic + selectExpr SelectExpr + columns Columns + partitions Partitions + tableExprs TableExprs + tableNames TableNames + exprs Exprs + values Values + valTuple ValTuple + orderBy OrderBy + updateExprs UpdateExprs + setExprs SetExprs + selectExprs SelectExprs + tableOptions TableOptions + + colKeyOpt ColumnKeyOption + ReferenceAction ReferenceAction isolationLevel IsolationLevel insertAction InsertAction scope Scope - ignore Ignore lock Lock joinType JoinType comparisonExprOperator ComparisonExprOperator @@ -129,22 +146,11 @@ func skipToEnd(yylex interface{}) { matchExprOption MatchExprOption orderDirection OrderDirection explainType ExplainType - selectInto *SelectInto - createDatabase *CreateDatabase - alterDatabase *AlterDatabase - collateAndCharset CollateAndCharset - collateAndCharsets []CollateAndCharset - createTable *CreateTable - tableAndLockTypes []*TableAndLockType - tableAndLockType *TableAndLockType lockType LockType - alterTable *AlterTable - alterOption AlterOption - alterOptions []AlterOption - tableOption *TableOption - tableOptions TableOptions - renameTablePairs []*RenameTablePair - columnTypeOptions *ColumnTypeOptions + + boolean bool + boolVal BoolVal + ignore Ignore } %token LEX_ERROR @@ -372,7 +378,7 @@ func skipToEnd(yylex interface{}) { %type index_or_key index_symbols from_or_in index_or_key_opt %type name_opt constraint_name_opt %type equal_opt -%type table_spec table_column_list +%type table_spec table_column_list %type create_like %type table_opt_value %type table_option diff --git a/tools/check_make_parser.sh b/tools/check_make_parser.sh index e114c6a9169..9859876d37e 100755 --- a/tools/check_make_parser.sh +++ b/tools/check_make_parser.sh @@ -19,7 +19,7 @@ if ! cd go/vt/sqlparser/ ; then fi mv $CUR $TMP -output=$(go run golang.org/x/tools/cmd/goyacc -o $CUR sql.y) +output=$(go run ./goyacc -fast-append -o $CUR sql.y) expectedOutput=" conflicts: 1 shift/reduce"