From e29e7016593fd2da6da5f75bc33a1abaf0858c53 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 8 Apr 2016 12:20:19 -0400 Subject: [PATCH 1/2] sql: Parse (and ignore) "drop behavior" options These options are used by the Django ORM. These options apply to features that we do not yet support (like foreign keys and views), so we have nothing to do with them but to parse them. --- sql/parser/alter_table.go | 20 +- sql/parser/drop.go | 33 +- sql/parser/parse_test.go | 7 + sql/parser/sql.go | 1337 +++++++++++++++++++------------------ sql/parser/sql.y | 53 +- sql/parser/truncate.go | 11 +- 6 files changed, 787 insertions(+), 674 deletions(-) diff --git a/sql/parser/alter_table.go b/sql/parser/alter_table.go index fb7fdbd44d23..055c4322ba56 100644 --- a/sql/parser/alter_table.go +++ b/sql/parser/alter_table.go @@ -106,6 +106,7 @@ type AlterTableDropColumn struct { columnKeyword bool IfExists bool Column string + DropBehavior DropBehavior } func (node *AlterTableDropColumn) String() string { @@ -118,17 +119,30 @@ func (node *AlterTableDropColumn) String() string { _, _ = buf.WriteString(" IF EXISTS") } fmt.Fprintf(&buf, " %s", node.Column) + if node.DropBehavior != DropDefault { + fmt.Fprintf(&buf, " %s", node.DropBehavior) + } return buf.String() } // AlterTableDropConstraint represents a DROP CONSTRAINT command. type AlterTableDropConstraint struct { - IfExists bool - Constraint string + IfExists bool + Constraint string + DropBehavior DropBehavior } func (node *AlterTableDropConstraint) String() string { - return fmt.Sprintf("DROP CONSTRAINT %s", node.Constraint) + var buf bytes.Buffer + _, _ = buf.WriteString("DROP CONSTRAINT ") + if node.IfExists { + _, _ = buf.WriteString("IF EXISTS ") + } + _, _ = buf.WriteString(node.Constraint) + if node.DropBehavior != DropDefault { + fmt.Fprintf(&buf, " %s", node.DropBehavior) + } + return buf.String() } // AlterTableSetDefault represents an ALTER COLUMN SET DEFAULT diff --git a/sql/parser/drop.go b/sql/parser/drop.go index ddced6332f57..b9c515c23d9e 100644 --- a/sql/parser/drop.go +++ b/sql/parser/drop.go @@ -22,7 +22,30 @@ package parser -import "bytes" +import ( + "bytes" + "fmt" +) + +// DropBehavior represents options for dropping schema elements. +type DropBehavior int + +// DropBehavior values. +const ( + DropDefault DropBehavior = iota + DropRestrict + DropCascade +) + +var dropBehaviorName = [...]string{ + DropDefault: "", + DropRestrict: "RESTRICT", + DropCascade: "CASCADE", +} + +func (d DropBehavior) String() string { + return dropBehaviorName[d] +} // DropDatabase represents a DROP DATABASE statement. type DropDatabase struct { @@ -42,8 +65,9 @@ func (node *DropDatabase) String() string { // DropIndex represents a DROP INDEX statement. type DropIndex struct { - IndexList TableNameWithIndexList - IfExists bool + IndexList TableNameWithIndexList + IfExists bool + DropBehavior DropBehavior } func (node *DropIndex) String() string { @@ -53,6 +77,9 @@ func (node *DropIndex) String() string { buf.WriteString("IF EXISTS ") } buf.WriteString(node.IndexList.String()) + if node.DropBehavior != DropDefault { + fmt.Fprintf(&buf, " %s", node.DropBehavior) + } return buf.String() } diff --git a/sql/parser/parse_test.go b/sql/parser/parse_test.go index 5de4ca353dd3..2c91dbf6e35b 100644 --- a/sql/parser/parse_test.go +++ b/sql/parser/parse_test.go @@ -103,6 +103,8 @@ func TestParse(t *testing.T) { {`DROP INDEX IF EXISTS a.b@c`}, {`DROP INDEX a.b@c, d@f`}, {`DROP INDEX IF EXISTS a.b@c, d@f`}, + {`DROP INDEX a.b@c CASCADE`}, + {`DROP INDEX IF EXISTS a.b@c RESTRICT`}, {`EXPLAIN SELECT 1`}, {`EXPLAIN (DEBUG) SELECT 1`}, @@ -370,6 +372,7 @@ func TestParse(t *testing.T) { {`TRUNCATE TABLE a`}, {`TRUNCATE TABLE a, b.c`}, + {`TRUNCATE TABLE a CASCADE`}, {`UPDATE a SET b = 3`}, {`UPDATE a.b SET b = 3`}, @@ -411,6 +414,10 @@ func TestParse(t *testing.T) { {`ALTER TABLE a DROP COLUMN IF EXISTS b, DROP CONSTRAINT a_idx`}, {`ALTER TABLE IF EXISTS a DROP COLUMN b, DROP CONSTRAINT a_idx`}, {`ALTER TABLE IF EXISTS a DROP COLUMN IF EXISTS b, DROP CONSTRAINT a_idx`}, + {`ALTER TABLE a DROP COLUMN b CASCADE`}, + {`ALTER TABLE a DROP COLUMN b RESTRICT`}, + {`ALTER TABLE a DROP CONSTRAINT b CASCADE`}, + {`ALTER TABLE a DROP CONSTRAINT IF EXISTS b RESTRICT`}, {`ALTER TABLE a ALTER COLUMN b SET DEFAULT 42`}, {`ALTER TABLE a ALTER COLUMN b SET DEFAULT NULL`}, diff --git a/sql/parser/sql.go b/sql/parser/sql.go index 89e8c8866c85..15536b3bf650 100644 --- a/sql/parser/sql.go +++ b/sql/parser/sql.go @@ -239,8 +239,11 @@ func (u *sqlSymUnion) idxElem() IndexElem { func (u *sqlSymUnion) idxElems() IndexElemList { return u.val.(IndexElemList) } +func (u *sqlSymUnion) dropBehavior() DropBehavior { + return u.val.(DropBehavior) +} -//line sql.y:259 +//line sql.y:262 type sqlSymType struct { yys int id int @@ -796,7 +799,7 @@ const sqlEofCode = 1 const sqlErrCode = 2 const sqlInitialStackSize = 16 -//line sql.y:4234 +//line sql.y:4267 //line yacctab:1 var sqlExca = [...]int{ @@ -4267,13 +4270,13 @@ sqldefault: case 1: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:648 + //line sql.y:651 { sqllex.(*scanner).stmts = sqlDollar[1].union.stmts() } case 2: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:654 + //line sql.y:657 { if sqlDollar[3].union.stmt() != nil { sqlVAL.union.val = append(sqlDollar[1].union.stmts(), sqlDollar[3].union.stmt()) @@ -4281,7 +4284,7 @@ sqldefault: } case 3: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:660 + //line sql.y:663 { if sqlDollar[1].union.stmt() != nil { sqlVAL.union.val = []Statement{sqlDollar[1].union.stmt()} @@ -4291,596 +4294,618 @@ sqldefault: } case 14: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:680 + //line sql.y:683 { sqlVAL.union.val = sqlDollar[1].union.slct() } case 21: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:690 + //line sql.y:693 { sqlVAL.union.val = Statement(nil) } case 22: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:696 + //line sql.y:699 { sqlVAL.union.val = &AlterTable{Table: sqlDollar[3].union.qname(), IfExists: false, Cmds: sqlDollar[4].union.alterTableCmds()} } case 23: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:700 + //line sql.y:703 { sqlVAL.union.val = &AlterTable{Table: sqlDollar[5].union.qname(), IfExists: true, Cmds: sqlDollar[6].union.alterTableCmds()} } case 24: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:706 + //line sql.y:709 { sqlVAL.union.val = AlterTableCmds{sqlDollar[1].union.alterTableCmd()} } case 25: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:710 + //line sql.y:713 { sqlVAL.union.val = append(sqlDollar[1].union.alterTableCmds(), sqlDollar[3].union.alterTableCmd()) } case 26: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:717 + //line sql.y:720 { sqlVAL.union.val = &AlterTableAddColumn{columnKeyword: false, IfNotExists: false, ColumnDef: sqlDollar[2].union.colDef()} } case 27: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:722 + //line sql.y:725 { sqlVAL.union.val = &AlterTableAddColumn{columnKeyword: false, IfNotExists: true, ColumnDef: sqlDollar[5].union.colDef()} } case 28: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:727 + //line sql.y:730 { sqlVAL.union.val = &AlterTableAddColumn{columnKeyword: true, IfNotExists: false, ColumnDef: sqlDollar[3].union.colDef()} } case 29: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:732 + //line sql.y:735 { sqlVAL.union.val = &AlterTableAddColumn{columnKeyword: true, IfNotExists: true, ColumnDef: sqlDollar[6].union.colDef()} } case 30: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:737 + //line sql.y:740 { sqlVAL.union.val = &AlterTableSetDefault{columnKeyword: sqlDollar[2].union.bool(), Column: sqlDollar[3].str, Default: sqlDollar[4].union.expr()} } case 31: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:742 + //line sql.y:745 { sqlVAL.union.val = &AlterTableDropNotNull{columnKeyword: sqlDollar[2].union.bool(), Column: sqlDollar[3].str} } case 32: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:746 + //line sql.y:749 { unimplemented() } case 33: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:749 + //line sql.y:752 { sqlVAL.union.val = &AlterTableDropColumn{columnKeyword: sqlDollar[2].union.bool(), IfExists: true, Column: sqlDollar[5].str} } case 34: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:754 + //line sql.y:757 { - sqlVAL.union.val = &AlterTableDropColumn{columnKeyword: sqlDollar[2].union.bool(), IfExists: false, Column: sqlDollar[3].str} + sqlVAL.union.val = &AlterTableDropColumn{ + columnKeyword: sqlDollar[2].union.bool(), + IfExists: false, + Column: sqlDollar[3].str, + DropBehavior: sqlDollar[4].union.dropBehavior(), + } } case 35: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:759 + //line sql.y:767 { } case 36: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:762 + //line sql.y:770 { sqlVAL.union.val = &AlterTableAddConstraint{ConstraintDef: sqlDollar[2].union.constraintDef()} } case 37: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:766 + //line sql.y:774 { unimplemented() } case 38: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:768 + //line sql.y:776 { unimplemented() } case 39: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:771 + //line sql.y:779 { - sqlVAL.union.val = &AlterTableDropConstraint{IfExists: true, Constraint: sqlDollar[5].str} + sqlVAL.union.val = &AlterTableDropConstraint{ + IfExists: true, + Constraint: sqlDollar[5].str, + DropBehavior: sqlDollar[6].union.dropBehavior(), + } } case 40: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:776 + //line sql.y:788 { - sqlVAL.union.val = &AlterTableDropConstraint{IfExists: false, Constraint: sqlDollar[3].str} + sqlVAL.union.val = &AlterTableDropConstraint{ + IfExists: false, + Constraint: sqlDollar[3].str, + DropBehavior: sqlDollar[4].union.dropBehavior(), + } } case 41: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:782 + //line sql.y:798 { sqlVAL.union.val = sqlDollar[3].union.expr() } case 42: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:786 + //line sql.y:802 { sqlVAL.union.val = nil } case 43: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:791 + //line sql.y:808 { - unimplemented() + sqlVAL.union.val = DropCascade } case 44: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:792 + //line sql.y:812 { - unimplemented() + sqlVAL.union.val = DropRestrict } case 45: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:793 + //line sql.y:816 { + sqlVAL.union.val = DropDefault } case 46: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:796 + //line sql.y:821 { unimplemented() } case 47: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:797 + //line sql.y:822 { } case 48: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:800 + //line sql.y:825 { unimplemented() } case 49: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:801 + //line sql.y:826 { } case 53: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:812 + //line sql.y:837 { sqlVAL.union.val = &Delete{Table: sqlDollar[4].union.tblExpr(), Where: newWhere(astWhere, sqlDollar[5].union.expr()), Returning: sqlDollar[6].union.retExprs()} } case 54: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:819 + //line sql.y:844 { sqlVAL.union.val = &DropDatabase{Name: Name(sqlDollar[3].str), IfExists: false} } case 55: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:823 + //line sql.y:848 { sqlVAL.union.val = &DropDatabase{Name: Name(sqlDollar[5].str), IfExists: true} } case 56: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:827 + //line sql.y:852 { - sqlVAL.union.val = &DropIndex{IndexList: sqlDollar[3].union.tableWithIdxList(), IfExists: false} + sqlVAL.union.val = &DropIndex{ + IndexList: sqlDollar[3].union.tableWithIdxList(), + IfExists: false, + DropBehavior: sqlDollar[4].union.dropBehavior(), + } } case 57: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:831 + //line sql.y:860 { - sqlVAL.union.val = &DropIndex{IndexList: sqlDollar[5].union.tableWithIdxList(), IfExists: true} + sqlVAL.union.val = &DropIndex{ + IndexList: sqlDollar[5].union.tableWithIdxList(), + IfExists: true, + DropBehavior: sqlDollar[6].union.dropBehavior(), + } } case 58: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:835 + //line sql.y:868 { sqlVAL.union.val = &DropTable{Names: sqlDollar[3].union.qnames(), IfExists: false} } case 59: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:839 + //line sql.y:872 { sqlVAL.union.val = &DropTable{Names: sqlDollar[5].union.qnames(), IfExists: true} } case 60: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:845 + //line sql.y:878 { sqlVAL.union.val = QualifiedNames{sqlDollar[1].union.qname()} } case 61: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:849 + //line sql.y:882 { sqlVAL.union.val = append(sqlDollar[1].union.qnames(), sqlDollar[3].union.qname()) } case 62: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:855 + //line sql.y:888 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str)} } case 63: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:859 + //line sql.y:892 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str), Indirect: sqlDollar[2].union.indirect()} } case 64: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:865 + //line sql.y:898 { sqlVAL.union.val = Indirection{NameIndirection(sqlDollar[2].str)} } case 65: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:869 + //line sql.y:902 { sqlVAL.union.val = append(sqlDollar[1].union.indirect(), NameIndirection(sqlDollar[3].str)) } case 66: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:876 + //line sql.y:909 { sqlVAL.union.val = &Explain{Statement: sqlDollar[2].union.stmt()} } case 67: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:880 + //line sql.y:913 { sqlVAL.union.val = &Explain{Options: sqlDollar[3].union.strs(), Statement: sqlDollar[5].union.stmt()} } case 68: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:886 + //line sql.y:919 { sqlVAL.union.val = sqlDollar[1].union.slct() } case 72: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:895 + //line sql.y:928 { sqlVAL.union.val = []string{sqlDollar[1].str} } case 73: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:899 + //line sql.y:932 { sqlVAL.union.val = append(sqlDollar[1].union.strs(), sqlDollar[3].str) } case 75: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:909 + //line sql.y:942 { sqlVAL.union.val = &Grant{Privileges: sqlDollar[2].union.privilegeList(), Grantees: NameList(sqlDollar[6].union.strs()), Targets: sqlDollar[4].union.targetList()} } case 76: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:916 + //line sql.y:949 { sqlVAL.union.val = &Revoke{Privileges: sqlDollar[2].union.privilegeList(), Grantees: NameList(sqlDollar[6].union.strs()), Targets: sqlDollar[4].union.targetList()} } case 77: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:923 + //line sql.y:956 { sqlVAL.union.val = TargetList{Tables: QualifiedNames(sqlDollar[1].union.qnames())} } case 78: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:927 + //line sql.y:960 { sqlVAL.union.val = TargetList{Tables: QualifiedNames(sqlDollar[2].union.qnames())} } case 79: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:931 + //line sql.y:964 { sqlVAL.union.val = TargetList{Databases: NameList(sqlDollar[2].union.strs())} } case 80: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:938 + //line sql.y:971 { sqlVAL.union.val = privilege.List{privilege.ALL} } case 81: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:941 + //line sql.y:974 { } case 82: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:945 + //line sql.y:978 { sqlVAL.union.val = privilege.List{sqlDollar[1].union.privilegeType()} } case 83: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:949 + //line sql.y:982 { sqlVAL.union.val = append(sqlDollar[1].union.privilegeList(), sqlDollar[3].union.privilegeType()) } case 84: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:956 + //line sql.y:989 { sqlVAL.union.val = privilege.CREATE } case 85: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:960 + //line sql.y:993 { sqlVAL.union.val = privilege.DROP } case 86: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:964 + //line sql.y:997 { sqlVAL.union.val = privilege.GRANT } case 87: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:968 + //line sql.y:1001 { sqlVAL.union.val = privilege.SELECT } case 88: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:972 + //line sql.y:1005 { sqlVAL.union.val = privilege.INSERT } case 89: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:976 + //line sql.y:1009 { sqlVAL.union.val = privilege.DELETE } case 90: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:980 + //line sql.y:1013 { sqlVAL.union.val = privilege.UPDATE } case 91: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:988 + //line sql.y:1021 { sqlVAL.union.val = []string{sqlDollar[1].str} } case 92: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:992 + //line sql.y:1025 { sqlVAL.union.val = append(sqlDollar[1].union.strs(), sqlDollar[3].str) } case 93: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1000 + //line sql.y:1033 { sqlVAL.union.val = sqlDollar[2].union.stmt() } case 94: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1004 + //line sql.y:1037 { sqlVAL.union.val = sqlDollar[3].union.stmt() } case 95: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1008 + //line sql.y:1041 { sqlVAL.union.val = &SetDefaultIsolation{Isolation: sqlDollar[6].union.isoLevel()} } case 96: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1012 + //line sql.y:1045 { sqlVAL.union.val = sqlDollar[3].union.stmt() } case 97: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1018 + //line sql.y:1051 { sqlVAL.union.val = sqlDollar[2].union.stmt() } case 99: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1025 + //line sql.y:1058 { sqlVAL.union.val = &SetTransaction{Isolation: sqlDollar[1].union.isoLevel(), UserPriority: UnspecifiedUserPriority} } case 100: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1029 + //line sql.y:1062 { sqlVAL.union.val = &SetTransaction{Isolation: UnspecifiedIsolation, UserPriority: sqlDollar[1].union.userPriority()} } case 101: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1033 + //line sql.y:1066 { sqlVAL.union.val = &SetTransaction{Isolation: sqlDollar[1].union.isoLevel(), UserPriority: sqlDollar[3].union.userPriority()} } case 102: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1037 + //line sql.y:1070 { sqlVAL.union.val = &SetTransaction{Isolation: sqlDollar[3].union.isoLevel(), UserPriority: sqlDollar[1].union.userPriority()} } case 103: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1044 + //line sql.y:1077 { sqlVAL.union.val = sqlDollar[2].union.userPriority() } case 104: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1050 + //line sql.y:1083 { sqlVAL.union.val = &Set{Name: sqlDollar[1].union.qname(), Values: sqlDollar[3].union.exprs()} } case 105: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1054 + //line sql.y:1087 { sqlVAL.union.val = &Set{Name: sqlDollar[1].union.qname(), Values: sqlDollar[3].union.exprs()} } case 106: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1058 + //line sql.y:1091 { sqlVAL.union.val = &Set{Name: sqlDollar[1].union.qname()} } case 107: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1062 + //line sql.y:1095 { sqlVAL.union.val = &Set{Name: sqlDollar[1].union.qname()} } case 109: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1069 + //line sql.y:1102 { unimplemented() } case 110: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1072 + //line sql.y:1105 { sqlVAL.union.val = &SetTimeZone{Value: sqlDollar[3].union.expr()} } case 111: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1075 + //line sql.y:1108 { unimplemented() } case 113: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1082 + //line sql.y:1115 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr()} } case 114: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1086 + //line sql.y:1119 { sqlVAL.union.val = append(sqlDollar[1].union.exprs(), sqlDollar[3].union.expr()) } case 117: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1094 + //line sql.y:1127 { sqlVAL.union.val = ValArg{name: sqlDollar[1].str} } case 118: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1100 + //line sql.y:1133 { sqlVAL.union.val = SnapshotIsolation } case 119: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1104 + //line sql.y:1137 { sqlVAL.union.val = SnapshotIsolation } case 120: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1108 + //line sql.y:1141 { sqlVAL.union.val = SnapshotIsolation } case 121: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1112 + //line sql.y:1145 { sqlVAL.union.val = SerializableIsolation } case 122: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1116 + //line sql.y:1149 { sqlVAL.union.val = SerializableIsolation } case 123: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1122 + //line sql.y:1155 { sqlVAL.union.val = Low } case 124: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1126 + //line sql.y:1159 { sqlVAL.union.val = Normal } case 125: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1130 + //line sql.y:1163 { sqlVAL.union.val = High } case 126: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1136 + //line sql.y:1169 { sqlVAL.union.val = DBool(true) } case 127: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1140 + //line sql.y:1173 { sqlVAL.union.val = DBool(false) } case 128: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1144 + //line sql.y:1177 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 130: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1159 + //line sql.y:1192 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 131: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1163 + //line sql.y:1196 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 132: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1167 + //line sql.y:1200 { expr := &CastExpr{Expr: DString(sqlDollar[2].str), Type: sqlDollar[1].union.colType()} var ctx EvalContext @@ -4896,265 +4921,265 @@ sqldefault: } case 134: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1182 + //line sql.y:1215 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 135: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1186 + //line sql.y:1219 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 136: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1191 + //line sql.y:1224 { unimplemented() } case 137: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1192 + //line sql.y:1225 { unimplemented() } case 138: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1193 + //line sql.y:1226 { } case 139: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1197 + //line sql.y:1230 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 140: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1201 + //line sql.y:1234 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 141: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1207 + //line sql.y:1240 { sqlVAL.union.val = &Show{Name: sqlDollar[2].str} } case 142: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1211 + //line sql.y:1244 { sqlVAL.union.val = &Show{Name: sqlDollar[2].str} } case 143: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1215 + //line sql.y:1248 { sqlVAL.union.val = &ShowColumns{Table: sqlDollar[4].union.qname()} } case 144: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1219 + //line sql.y:1252 { sqlVAL.union.val = &ShowDatabases{} } case 145: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1223 + //line sql.y:1256 { sqlVAL.union.val = &ShowGrants{Targets: sqlDollar[3].union.targetListPtr(), Grantees: sqlDollar[4].union.strs()} } case 146: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1227 + //line sql.y:1260 { sqlVAL.union.val = &ShowIndex{Table: sqlDollar[4].union.qname()} } case 147: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1231 + //line sql.y:1264 { sqlVAL.union.val = &ShowIndex{Table: sqlDollar[4].union.qname()} } case 148: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1235 + //line sql.y:1268 { sqlVAL.union.val = &ShowIndex{Table: sqlDollar[4].union.qname()} } case 149: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1239 + //line sql.y:1272 { sqlVAL.union.val = &ShowTables{Name: sqlDollar[3].union.qname()} } case 150: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1243 + //line sql.y:1276 { sqlVAL.union.val = &Show{Name: "TIME ZONE"} } case 151: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1247 + //line sql.y:1280 { sqlVAL.union.val = &Show{Name: "TRANSACTION ISOLATION LEVEL"} } case 152: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1251 + //line sql.y:1284 { sqlVAL.union.val = &Show{Name: "TRANSACTION PRIORITY"} } case 153: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1255 + //line sql.y:1288 { sqlVAL.union.val = Statement(nil) } case 154: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1261 + //line sql.y:1294 { sqlVAL.union.val = sqlDollar[2].union.qname() } case 155: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1265 + //line sql.y:1298 { sqlVAL.union.val = (*QualifiedName)(nil) } case 156: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1271 + //line sql.y:1304 { tmp := sqlDollar[2].union.targetList() sqlVAL.union.val = &tmp } case 157: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1276 + //line sql.y:1309 { sqlVAL.union.val = (*TargetList)(nil) } case 158: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1282 + //line sql.y:1315 { sqlVAL.union.val = sqlDollar[2].union.strs() } case 159: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1286 + //line sql.y:1319 { sqlVAL.union.val = []string(nil) } case 160: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1293 + //line sql.y:1326 { sqlVAL.union.val = &CreateTable{Table: sqlDollar[3].union.qname(), IfNotExists: false, Defs: sqlDollar[5].union.tblDefs()} } case 161: sqlDollar = sqlS[sqlpt-9 : sqlpt+1] - //line sql.y:1297 + //line sql.y:1330 { sqlVAL.union.val = &CreateTable{Table: sqlDollar[6].union.qname(), IfNotExists: true, Defs: sqlDollar[8].union.tblDefs()} } case 163: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1304 + //line sql.y:1337 { sqlVAL.union.val = TableDefs(nil) } case 164: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1310 + //line sql.y:1343 { sqlVAL.union.val = TableDefs{sqlDollar[1].union.tblDef()} } case 165: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1314 + //line sql.y:1347 { sqlVAL.union.val = append(sqlDollar[1].union.tblDefs(), sqlDollar[3].union.tblDef()) } case 166: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1320 + //line sql.y:1353 { sqlVAL.union.val = sqlDollar[1].union.colDef() } case 168: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1325 + //line sql.y:1358 { sqlVAL.union.val = sqlDollar[1].union.constraintDef() } case 169: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1331 + //line sql.y:1364 { sqlVAL.union.val = newColumnTableDef(Name(sqlDollar[1].str), sqlDollar[2].union.colType(), sqlDollar[3].union.colQuals()) } case 170: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1337 + //line sql.y:1370 { sqlVAL.union.val = append(sqlDollar[1].union.colQuals(), sqlDollar[2].union.colQual()) } case 171: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1341 + //line sql.y:1374 { sqlVAL.union.val = []ColumnQualification(nil) } case 172: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1347 + //line sql.y:1380 { sqlVAL.union.val = sqlDollar[3].union.colQual() } case 174: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1351 + //line sql.y:1384 { unimplemented() } case 175: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1367 + //line sql.y:1400 { sqlVAL.union.val = NotNullConstraint{} } case 176: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1371 + //line sql.y:1404 { sqlVAL.union.val = NullConstraint{} } case 177: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1375 + //line sql.y:1408 { sqlVAL.union.val = UniqueConstraint{} } case 178: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1379 + //line sql.y:1412 { sqlVAL.union.val = PrimaryKeyConstraint{} } case 179: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1382 + //line sql.y:1415 { unimplemented() } case 180: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1384 + //line sql.y:1417 { if ContainsVars(sqlDollar[2].union.expr()) { sqllex.Error("default expression contains a variable") @@ -5168,13 +5193,13 @@ sqldefault: } case 181: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1395 + //line sql.y:1428 { unimplemented() } case 182: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1399 + //line sql.y:1432 { sqlVAL.union.val = &IndexTableDef{ Name: Name(sqlDollar[2].str), @@ -5184,7 +5209,7 @@ sqldefault: } case 183: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:1407 + //line sql.y:1440 { sqlVAL.union.val = &UniqueConstraintTableDef{ IndexTableDef: IndexTableDef{ @@ -5196,26 +5221,26 @@ sqldefault: } case 184: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1422 + //line sql.y:1455 { sqlVAL.union.val = sqlDollar[3].union.constraintDef() sqlVAL.union.val.(ConstraintTableDef).setName(Name(sqlDollar[2].str)) } case 185: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1427 + //line sql.y:1460 { sqlVAL.union.val = sqlDollar[1].union.constraintDef() } case 186: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1432 + //line sql.y:1465 { unimplemented() } case 187: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1434 + //line sql.y:1467 { sqlVAL.union.val = &UniqueConstraintTableDef{ IndexTableDef: IndexTableDef{ @@ -5226,7 +5251,7 @@ sqldefault: } case 188: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1443 + //line sql.y:1476 { sqlVAL.union.val = &UniqueConstraintTableDef{ IndexTableDef: IndexTableDef{ @@ -5237,155 +5262,155 @@ sqldefault: } case 189: sqlDollar = sqlS[sqlpt-10 : sqlpt+1] - //line sql.y:1452 + //line sql.y:1485 { unimplemented() } case 192: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1469 + //line sql.y:1502 { sqlVAL.union.val = sqlDollar[3].union.strs() } case 193: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1473 + //line sql.y:1506 { sqlVAL.union.val = []string(nil) } case 194: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1479 + //line sql.y:1512 { sqlVAL.union.val = sqlDollar[2].union.strs() } case 195: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1483 + //line sql.y:1516 { sqlVAL.union.val = []string(nil) } case 196: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1488 + //line sql.y:1521 { unimplemented() } case 197: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1489 + //line sql.y:1522 { unimplemented() } case 198: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1490 + //line sql.y:1523 { unimplemented() } case 199: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1491 + //line sql.y:1524 { } case 200: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1498 + //line sql.y:1531 { unimplemented() } case 201: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1499 + //line sql.y:1532 { unimplemented() } case 202: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1500 + //line sql.y:1533 { unimplemented() } case 203: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1501 + //line sql.y:1534 { unimplemented() } case 204: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1502 + //line sql.y:1535 { } case 205: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1505 + //line sql.y:1538 { unimplemented() } case 206: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1508 + //line sql.y:1541 { unimplemented() } case 207: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1511 + //line sql.y:1544 { unimplemented() } case 208: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1512 + //line sql.y:1545 { unimplemented() } case 209: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1513 + //line sql.y:1546 { unimplemented() } case 210: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1514 + //line sql.y:1547 { unimplemented() } case 211: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1515 + //line sql.y:1548 { unimplemented() } case 212: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1519 + //line sql.y:1552 { sqlVAL.union.val = NumVal(sqlDollar[1].str) } case 213: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1523 + //line sql.y:1556 { sqlVAL.union.val = NumVal("-" + sqlDollar[2].str) } case 214: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1527 + //line sql.y:1560 { sqlVAL.union.val = DInt(sqlDollar[1].union.ival().Val) } case 215: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1534 + //line sql.y:1567 { - sqlVAL.union.val = &Truncate{Tables: sqlDollar[3].union.qnames()} + sqlVAL.union.val = &Truncate{Tables: sqlDollar[3].union.qnames(), DropBehavior: sqlDollar[4].union.dropBehavior()} } case 216: sqlDollar = sqlS[sqlpt-10 : sqlpt+1] - //line sql.y:1541 + //line sql.y:1574 { sqlVAL.union.val = &CreateIndex{ Name: Name(sqlDollar[4].str), @@ -5397,7 +5422,7 @@ sqldefault: } case 217: sqlDollar = sqlS[sqlpt-13 : sqlpt+1] - //line sql.y:1551 + //line sql.y:1584 { sqlVAL.union.val = &CreateIndex{ Name: Name(sqlDollar[7].str), @@ -5410,190 +5435,190 @@ sqldefault: } case 218: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1564 + //line sql.y:1597 { sqlVAL.union.val = true } case 219: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1568 + //line sql.y:1601 { sqlVAL.union.val = false } case 220: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1574 + //line sql.y:1607 { sqlVAL.union.val = IndexElemList{sqlDollar[1].union.idxElem()} } case 221: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1578 + //line sql.y:1611 { sqlVAL.union.val = append(sqlDollar[1].union.idxElems(), sqlDollar[3].union.idxElem()) } case 222: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1587 + //line sql.y:1620 { sqlVAL.union.val = IndexElem{Column: Name(sqlDollar[1].str), Direction: sqlDollar[3].union.dir()} } case 223: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1590 + //line sql.y:1623 { unimplemented() } case 224: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1591 + //line sql.y:1624 { unimplemented() } case 225: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1594 + //line sql.y:1627 { unimplemented() } case 226: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1595 + //line sql.y:1628 { } case 227: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1599 + //line sql.y:1632 { sqlVAL.union.val = Ascending } case 228: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1603 + //line sql.y:1636 { sqlVAL.union.val = Descending } case 229: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1607 + //line sql.y:1640 { sqlVAL.union.val = DefaultDirection } case 230: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1614 + //line sql.y:1647 { sqlVAL.union.val = &RenameDatabase{Name: Name(sqlDollar[3].str), NewName: Name(sqlDollar[6].str)} } case 231: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1618 + //line sql.y:1651 { sqlVAL.union.val = &RenameTable{Name: sqlDollar[3].union.qname(), NewName: sqlDollar[6].union.qname(), IfExists: false} } case 232: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1622 + //line sql.y:1655 { sqlVAL.union.val = &RenameTable{Name: sqlDollar[5].union.qname(), NewName: sqlDollar[8].union.qname(), IfExists: true} } case 233: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1626 + //line sql.y:1659 { sqlVAL.union.val = &RenameIndex{Index: sqlDollar[3].union.tableWithIdx(), NewName: Name(sqlDollar[6].str), IfExists: false} } case 234: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1630 + //line sql.y:1663 { sqlVAL.union.val = &RenameIndex{Index: sqlDollar[5].union.tableWithIdx(), NewName: Name(sqlDollar[8].str), IfExists: true} } case 235: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1634 + //line sql.y:1667 { sqlVAL.union.val = &RenameColumn{Table: sqlDollar[3].union.qname(), Name: Name(sqlDollar[6].str), NewName: Name(sqlDollar[8].str), IfExists: false} } case 236: sqlDollar = sqlS[sqlpt-10 : sqlpt+1] - //line sql.y:1638 + //line sql.y:1671 { sqlVAL.union.val = &RenameColumn{Table: sqlDollar[5].union.qname(), Name: Name(sqlDollar[8].str), NewName: Name(sqlDollar[10].str), IfExists: true} } case 237: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1642 + //line sql.y:1675 { sqlVAL.union.val = Statement(nil) } case 238: sqlDollar = sqlS[sqlpt-10 : sqlpt+1] - //line sql.y:1646 + //line sql.y:1679 { sqlVAL.union.val = Statement(nil) } case 239: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1652 + //line sql.y:1685 { sqlVAL.union.val = true } case 240: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1656 + //line sql.y:1689 { sqlVAL.union.val = false } case 241: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1661 + //line sql.y:1694 { } case 242: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1662 + //line sql.y:1695 { } case 243: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1666 + //line sql.y:1699 { sqlVAL.union.val = &ReleaseSavepoint{Savepoint: sqlDollar[2].str} } case 244: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1672 + //line sql.y:1705 { sqlVAL.union.val = &Savepoint{Name: sqlDollar[2].str} } case 245: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1679 + //line sql.y:1712 { sqlVAL.union.val = sqlDollar[3].union.stmt() } case 246: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1683 + //line sql.y:1716 { sqlVAL.union.val = sqlDollar[3].union.stmt() } case 247: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1687 + //line sql.y:1720 { sqlVAL.union.val = &CommitTransaction{} } case 248: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1691 + //line sql.y:1724 { sqlVAL.union.val = &CommitTransaction{} } case 249: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1695 + //line sql.y:1728 { if sqlDollar[2].str != "" { sqlVAL.union.val = &RollbackToSavepoint{Savepoint: sqlDollar[2].str} @@ -5603,101 +5628,101 @@ sqldefault: } case 250: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1704 + //line sql.y:1737 { } case 251: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1705 + //line sql.y:1738 { } case 252: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1709 + //line sql.y:1742 { sqlVAL.str = "" } case 253: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1713 + //line sql.y:1746 { sqlVAL.str = sqlDollar[3].str } case 254: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1717 + //line sql.y:1750 { sqlVAL.str = sqlDollar[2].str } case 255: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1721 + //line sql.y:1754 { sqlVAL.str = "" } case 256: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1727 + //line sql.y:1760 { sqlVAL.str = sqlDollar[2].str } case 257: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1731 + //line sql.y:1764 { sqlVAL.str = sqlDollar[1].str } case 258: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1737 + //line sql.y:1770 { sqlVAL.union.val = &BeginTransaction{Isolation: sqlDollar[1].union.isoLevel(), UserPriority: UnspecifiedUserPriority} } case 259: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1741 + //line sql.y:1774 { sqlVAL.union.val = &BeginTransaction{Isolation: UnspecifiedIsolation, UserPriority: sqlDollar[1].union.userPriority()} } case 260: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1745 + //line sql.y:1778 { sqlVAL.union.val = &BeginTransaction{Isolation: sqlDollar[1].union.isoLevel(), UserPriority: sqlDollar[3].union.userPriority()} } case 261: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1749 + //line sql.y:1782 { sqlVAL.union.val = &BeginTransaction{Isolation: sqlDollar[3].union.isoLevel(), UserPriority: sqlDollar[1].union.userPriority()} } case 262: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1753 + //line sql.y:1786 { sqlVAL.union.val = &BeginTransaction{Isolation: UnspecifiedIsolation, UserPriority: UnspecifiedUserPriority} } case 263: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1759 + //line sql.y:1792 { sqlVAL.union.val = sqlDollar[3].union.isoLevel() } case 264: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1765 + //line sql.y:1798 { sqlVAL.union.val = &CreateDatabase{Name: Name(sqlDollar[3].str)} } case 265: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:1769 + //line sql.y:1802 { sqlVAL.union.val = &CreateDatabase{IfNotExists: true, Name: Name(sqlDollar[6].str)} } case 266: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:1775 + //line sql.y:1808 { sqlVAL.union.val = sqlDollar[5].union.stmt() sqlVAL.union.val.(*Insert).Table = sqlDollar[4].union.qname() @@ -5705,161 +5730,161 @@ sqldefault: } case 269: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1792 + //line sql.y:1825 { sqlVAL.union.val = &Insert{Rows: sqlDollar[1].union.slct()} } case 270: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1796 + //line sql.y:1829 { sqlVAL.union.val = &Insert{Columns: sqlDollar[2].union.qnames(), Rows: sqlDollar[4].union.slct()} } case 271: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1800 + //line sql.y:1833 { sqlVAL.union.val = &Insert{Rows: &Select{}} } case 272: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1807 + //line sql.y:1840 { unimplemented() } case 273: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1808 + //line sql.y:1841 { unimplemented() } case 274: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1809 + //line sql.y:1842 { } case 275: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1812 + //line sql.y:1845 { unimplemented() } case 276: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1813 + //line sql.y:1846 { unimplemented() } case 277: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1814 + //line sql.y:1847 { } case 278: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1818 + //line sql.y:1851 { sqlVAL.union.val = sqlDollar[2].union.selExprs() } case 279: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:1822 + //line sql.y:1855 { sqlVAL.union.val = SelectExprs(nil) } case 280: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1829 + //line sql.y:1862 { sqlVAL.union.val = &Update{Table: sqlDollar[3].union.tblExpr(), Exprs: sqlDollar[5].union.updateExprs(), Where: newWhere(astWhere, sqlDollar[7].union.expr()), Returning: sqlDollar[8].union.retExprs()} } case 281: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1835 + //line sql.y:1868 { sqlVAL.union.val = UpdateExprs{sqlDollar[1].union.updateExpr()} } case 282: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1839 + //line sql.y:1872 { sqlVAL.union.val = append(sqlDollar[1].union.updateExprs(), sqlDollar[3].union.updateExpr()) } case 285: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1849 + //line sql.y:1882 { sqlVAL.union.val = &UpdateExpr{Names: QualifiedNames{sqlDollar[1].union.qname()}, Expr: sqlDollar[3].union.expr()} } case 286: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1861 + //line sql.y:1894 { sqlVAL.union.val = &UpdateExpr{Tuple: true, Names: sqlDollar[2].union.qnames(), Expr: &Tuple{sqlDollar[5].union.exprs()}} } case 287: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:1865 + //line sql.y:1898 { sqlVAL.union.val = &UpdateExpr{Tuple: true, Names: sqlDollar[2].union.qnames(), Expr: &Subquery{Select: sqlDollar[5].union.selectStmt()}} } case 289: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1909 + //line sql.y:1942 { sqlVAL.union.val = &Select{Select: sqlDollar[1].union.selectStmt()} } case 290: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1915 + //line sql.y:1948 { sqlVAL.union.val = &ParenSelect{Select: sqlDollar[2].union.slct()} } case 291: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1919 + //line sql.y:1952 { sqlVAL.union.val = &ParenSelect{Select: &Select{Select: sqlDollar[2].union.selectStmt()}} } case 292: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:1934 + //line sql.y:1967 { sqlVAL.union.val = &Select{Select: sqlDollar[1].union.selectStmt()} } case 293: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1938 + //line sql.y:1971 { sqlVAL.union.val = &Select{Select: sqlDollar[1].union.selectStmt(), OrderBy: sqlDollar[2].union.orderBy()} } case 294: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1942 + //line sql.y:1975 { sqlVAL.union.val = &Select{Select: sqlDollar[1].union.selectStmt(), OrderBy: sqlDollar[2].union.orderBy(), Limit: sqlDollar[3].union.limit()} } case 295: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:1946 + //line sql.y:1979 { sqlVAL.union.val = &Select{Select: sqlDollar[2].union.selectStmt()} } case 296: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:1950 + //line sql.y:1983 { sqlVAL.union.val = &Select{Select: sqlDollar[2].union.selectStmt(), OrderBy: sqlDollar[3].union.orderBy()} } case 297: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:1954 + //line sql.y:1987 { sqlVAL.union.val = &Select{Select: sqlDollar[2].union.selectStmt(), OrderBy: sqlDollar[3].union.orderBy(), Limit: sqlDollar[4].union.limit()} } case 300: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:1988 + //line sql.y:2021 { sqlVAL.union.val = &SelectClause{ Exprs: sqlDollar[3].union.selExprs(), @@ -5871,7 +5896,7 @@ sqldefault: } case 301: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:2000 + //line sql.y:2033 { sqlVAL.union.val = &SelectClause{ Distinct: sqlDollar[2].union.bool(), @@ -5884,7 +5909,7 @@ sqldefault: } case 303: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2012 + //line sql.y:2045 { sqlVAL.union.val = &SelectClause{ Exprs: SelectExprs{starSelectExpr()}, @@ -5894,7 +5919,7 @@ sqldefault: } case 304: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2020 + //line sql.y:2053 { sqlVAL.union.val = &UnionClause{ Type: UnionOp, @@ -5905,7 +5930,7 @@ sqldefault: } case 305: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2029 + //line sql.y:2062 { sqlVAL.union.val = &UnionClause{ Type: IntersectOp, @@ -5916,7 +5941,7 @@ sqldefault: } case 306: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2038 + //line sql.y:2071 { sqlVAL.union.val = &UnionClause{ Type: ExceptOp, @@ -5927,140 +5952,140 @@ sqldefault: } case 307: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2056 + //line sql.y:2089 { unimplemented() } case 308: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2057 + //line sql.y:2090 { unimplemented() } case 309: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2058 + //line sql.y:2091 { unimplemented() } case 310: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2061 + //line sql.y:2094 { unimplemented() } case 311: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2062 + //line sql.y:2095 { unimplemented() } case 312: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:2065 + //line sql.y:2098 { unimplemented() } case 313: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2069 + //line sql.y:2102 { sqlVAL.union.val = sqlDollar[1].union.slct() } case 317: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2077 + //line sql.y:2110 { unimplemented() } case 318: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2078 + //line sql.y:2111 { } case 319: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2081 + //line sql.y:2114 { } case 320: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2082 + //line sql.y:2115 { } case 321: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2086 + //line sql.y:2119 { sqlVAL.union.val = true } case 322: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2090 + //line sql.y:2123 { sqlVAL.union.val = false } case 323: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2094 + //line sql.y:2127 { sqlVAL.union.val = false } case 324: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2100 + //line sql.y:2133 { sqlVAL.union.val = true } case 325: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2105 + //line sql.y:2138 { } case 326: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2106 + //line sql.y:2139 { } case 327: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2110 + //line sql.y:2143 { sqlVAL.union.val = sqlDollar[1].union.orderBy() } case 328: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2114 + //line sql.y:2147 { sqlVAL.union.val = OrderBy(nil) } case 329: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2120 + //line sql.y:2153 { sqlVAL.union.val = OrderBy(sqlDollar[3].union.orders()) } case 330: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2126 + //line sql.y:2159 { sqlVAL.union.val = []*Order{sqlDollar[1].union.order()} } case 331: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2130 + //line sql.y:2163 { sqlVAL.union.val = append(sqlDollar[1].union.orders(), sqlDollar[3].union.order()) } case 332: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2136 + //line sql.y:2169 { sqlVAL.union.val = &Order{Expr: sqlDollar[1].union.expr(), Direction: sqlDollar[2].union.dir()} } case 333: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2144 + //line sql.y:2177 { if sqlDollar[1].union.limit() == nil { sqlVAL.union.val = sqlDollar[2].union.limit() @@ -6071,7 +6096,7 @@ sqldefault: } case 334: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2153 + //line sql.y:2186 { sqlVAL.union.val = sqlDollar[1].union.limit() if sqlDollar[2].union.limit() != nil { @@ -6080,7 +6105,7 @@ sqldefault: } case 337: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2164 + //line sql.y:2197 { if sqlDollar[2].union.expr() == nil { sqlVAL.union.val = (*Limit)(nil) @@ -6090,65 +6115,65 @@ sqldefault: } case 338: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2177 + //line sql.y:2210 { sqlVAL.union.val = &Limit{Offset: sqlDollar[2].union.expr()} } case 339: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2184 + //line sql.y:2217 { sqlVAL.union.val = &Limit{Offset: sqlDollar[2].union.expr()} } case 341: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2191 + //line sql.y:2224 { sqlVAL.union.val = Expr(nil) } case 342: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2205 + //line sql.y:2238 { } case 343: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2206 + //line sql.y:2239 { } case 344: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2232 + //line sql.y:2265 { sqlVAL.union.val = GroupBy(sqlDollar[3].union.exprs()) } case 345: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2236 + //line sql.y:2269 { sqlVAL.union.val = GroupBy(nil) } case 346: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2242 + //line sql.y:2275 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 347: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2246 + //line sql.y:2279 { sqlVAL.union.val = Expr(nil) } case 348: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2252 + //line sql.y:2285 { sqlVAL.union.val = &ValuesClause{[]*Tuple{{sqlDollar[2].union.exprs()}}} } case 349: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2256 + //line sql.y:2289 { valNode := sqlDollar[1].union.selectStmt().(*ValuesClause) valNode.Tuples = append(valNode.Tuples, &Tuple{sqlDollar[3].union.exprs()}) @@ -6156,49 +6181,49 @@ sqldefault: } case 350: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2268 + //line sql.y:2301 { sqlVAL.union.val = sqlDollar[2].union.tblExprs() } case 351: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2272 + //line sql.y:2305 { sqlVAL.union.val = TableExprs(nil) } case 352: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2278 + //line sql.y:2311 { sqlVAL.union.val = TableExprs{sqlDollar[1].union.tblExpr()} } case 353: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2282 + //line sql.y:2315 { sqlVAL.union.val = append(sqlDollar[1].union.tblExprs(), sqlDollar[3].union.tblExpr()) } case 354: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2288 + //line sql.y:2321 { sqlVAL.union.val = &IndexHints{Index: Name(sqlDollar[3].str)} } case 355: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2293 + //line sql.y:2326 { sqlVAL.union.val = &IndexHints{NoIndexJoin: true} } case 356: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2299 + //line sql.y:2332 { sqlVAL.union.val = sqlDollar[1].union.indexHints() } case 357: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2304 + //line sql.y:2337 { a := sqlDollar[1].union.indexHints() b := sqlDollar[3].union.indexHints() @@ -6218,2017 +6243,2017 @@ sqldefault: } case 358: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2324 + //line sql.y:2357 { sqlVAL.union.val = &IndexHints{Index: Name(sqlDollar[2].str)} } case 359: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2328 + //line sql.y:2361 { sqlVAL.union.val = sqlDollar[3].union.indexHints() } case 360: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2332 + //line sql.y:2365 { sqlVAL.union.val = (*IndexHints)(nil) } case 361: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2339 + //line sql.y:2372 { sqlVAL.union.val = &AliasedTableExpr{Expr: sqlDollar[1].union.qname(), Hints: sqlDollar[2].union.indexHints(), As: sqlDollar[3].union.aliasClause()} } case 362: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2343 + //line sql.y:2376 { sqlVAL.union.val = &AliasedTableExpr{Expr: &Subquery{Select: sqlDollar[1].union.selectStmt()}, As: sqlDollar[2].union.aliasClause()} } case 364: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2347 + //line sql.y:2380 { unimplemented() } case 365: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2365 + //line sql.y:2398 { sqlVAL.union.val = &ParenTableExpr{Expr: sqlDollar[2].union.tblExpr()} } case 366: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2369 + //line sql.y:2402 { sqlVAL.union.val = &JoinTableExpr{Join: astCrossJoin, Left: sqlDollar[1].union.tblExpr(), Right: sqlDollar[4].union.tblExpr()} } case 367: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2373 + //line sql.y:2406 { sqlVAL.union.val = &JoinTableExpr{Join: sqlDollar[2].str, Left: sqlDollar[1].union.tblExpr(), Right: sqlDollar[4].union.tblExpr(), Cond: sqlDollar[5].union.joinCond()} } case 368: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2377 + //line sql.y:2410 { sqlVAL.union.val = &JoinTableExpr{Join: astJoin, Left: sqlDollar[1].union.tblExpr(), Right: sqlDollar[3].union.tblExpr(), Cond: sqlDollar[4].union.joinCond()} } case 369: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2381 + //line sql.y:2414 { sqlVAL.union.val = &JoinTableExpr{Join: astNaturalJoin, Left: sqlDollar[1].union.tblExpr(), Right: sqlDollar[5].union.tblExpr()} } case 370: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2385 + //line sql.y:2418 { sqlVAL.union.val = &JoinTableExpr{Join: astNaturalJoin, Left: sqlDollar[1].union.tblExpr(), Right: sqlDollar[4].union.tblExpr()} } case 371: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2391 + //line sql.y:2424 { sqlVAL.union.val = AliasClause{Alias: Name(sqlDollar[2].str), Cols: NameList(sqlDollar[4].union.strs())} } case 372: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2395 + //line sql.y:2428 { sqlVAL.union.val = AliasClause{Alias: Name(sqlDollar[2].str)} } case 373: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2399 + //line sql.y:2432 { sqlVAL.union.val = AliasClause{Alias: Name(sqlDollar[1].str), Cols: NameList(sqlDollar[3].union.strs())} } case 374: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2403 + //line sql.y:2436 { sqlVAL.union.val = AliasClause{Alias: Name(sqlDollar[1].str)} } case 376: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2410 + //line sql.y:2443 { sqlVAL.union.val = AliasClause{} } case 377: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2416 + //line sql.y:2449 { sqlVAL.str = astFullJoin } case 378: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2420 + //line sql.y:2453 { sqlVAL.str = astLeftJoin } case 379: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2424 + //line sql.y:2457 { sqlVAL.str = astRightJoin } case 380: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2428 + //line sql.y:2461 { sqlVAL.str = astInnerJoin } case 381: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2434 + //line sql.y:2467 { } case 382: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2435 + //line sql.y:2468 { } case 383: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2446 + //line sql.y:2479 { sqlVAL.union.val = &UsingJoinCond{Cols: NameList(sqlDollar[3].union.strs())} } case 384: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2450 + //line sql.y:2483 { sqlVAL.union.val = &OnJoinCond{Expr: sqlDollar[2].union.expr()} } case 385: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2456 + //line sql.y:2489 { sqlVAL.union.val = sqlDollar[1].union.qname() } case 386: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2460 + //line sql.y:2493 { sqlVAL.union.val = sqlDollar[1].union.qname() } case 387: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2464 + //line sql.y:2497 { sqlVAL.union.val = sqlDollar[2].union.qname() } case 388: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2468 + //line sql.y:2501 { sqlVAL.union.val = sqlDollar[3].union.qname() } case 389: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2474 + //line sql.y:2507 { sqlVAL.union.val = QualifiedNames{sqlDollar[1].union.qname()} } case 390: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2478 + //line sql.y:2511 { sqlVAL.union.val = append(sqlDollar[1].union.qnames(), sqlDollar[3].union.qname()) } case 391: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2491 + //line sql.y:2524 { sqlVAL.union.val = &AliasedTableExpr{Expr: sqlDollar[1].union.qname()} } case 392: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2495 + //line sql.y:2528 { sqlVAL.union.val = &AliasedTableExpr{Expr: sqlDollar[1].union.qname(), As: AliasClause{Alias: Name(sqlDollar[2].str)}} } case 393: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2499 + //line sql.y:2532 { sqlVAL.union.val = &AliasedTableExpr{Expr: sqlDollar[1].union.qname(), As: AliasClause{Alias: Name(sqlDollar[3].str)}} } case 394: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2505 + //line sql.y:2538 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 395: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2509 + //line sql.y:2542 { sqlVAL.union.val = Expr(nil) } case 396: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2521 + //line sql.y:2554 { sqlVAL.union.val = sqlDollar[1].union.colType() } case 397: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2525 + //line sql.y:2558 { unimplemented() } case 398: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2526 + //line sql.y:2559 { unimplemented() } case 399: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2529 + //line sql.y:2562 { unimplemented() } case 400: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2530 + //line sql.y:2563 { unimplemented() } case 401: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2531 + //line sql.y:2564 { } case 407: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2539 + //line sql.y:2572 { unimplemented() } case 408: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2541 + //line sql.y:2574 { sqlVAL.union.val = &BytesType{Name: "BLOB"} } case 409: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2545 + //line sql.y:2578 { sqlVAL.union.val = &BytesType{Name: "BYTES"} } case 410: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2549 + //line sql.y:2582 { sqlVAL.union.val = &BytesType{Name: "BYTEA"} } case 411: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2553 + //line sql.y:2586 { sqlVAL.union.val = &StringType{Name: "TEXT"} } case 416: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2574 + //line sql.y:2607 { sqlVAL.union.val = &DecimalType{Prec: int(sqlDollar[2].union.ival().Val)} } case 417: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2578 + //line sql.y:2611 { sqlVAL.union.val = &DecimalType{Prec: int(sqlDollar[2].union.ival().Val), Scale: int(sqlDollar[4].union.ival().Val)} } case 418: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2582 + //line sql.y:2615 { sqlVAL.union.val = &DecimalType{} } case 419: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2589 + //line sql.y:2622 { sqlVAL.union.val = &IntType{Name: "INT"} } case 420: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2593 + //line sql.y:2626 { sqlVAL.union.val = &IntType{Name: "INT64"} } case 421: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2597 + //line sql.y:2630 { sqlVAL.union.val = &IntType{Name: "INTEGER"} } case 422: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2601 + //line sql.y:2634 { sqlVAL.union.val = &IntType{Name: "SMALLINT"} } case 423: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2605 + //line sql.y:2638 { sqlVAL.union.val = &IntType{Name: "BIGINT"} } case 424: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2609 + //line sql.y:2642 { sqlVAL.union.val = &FloatType{Name: "REAL"} } case 425: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2613 + //line sql.y:2646 { sqlVAL.union.val = &FloatType{Name: "FLOAT", Prec: int(sqlDollar[2].union.ival().Val)} } case 426: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2617 + //line sql.y:2650 { sqlVAL.union.val = &FloatType{Name: "DOUBLE PRECISION"} } case 427: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2621 + //line sql.y:2654 { sqlVAL.union.val = sqlDollar[2].union.colType() sqlVAL.union.val.(*DecimalType).Name = "DECIMAL" } case 428: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2626 + //line sql.y:2659 { sqlVAL.union.val = sqlDollar[2].union.colType() sqlVAL.union.val.(*DecimalType).Name = "DEC" } case 429: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2631 + //line sql.y:2664 { sqlVAL.union.val = sqlDollar[2].union.colType() sqlVAL.union.val.(*DecimalType).Name = "NUMERIC" } case 430: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2636 + //line sql.y:2669 { sqlVAL.union.val = &BoolType{Name: "BOOLEAN"} } case 431: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2640 + //line sql.y:2673 { sqlVAL.union.val = &BoolType{Name: "BOOL"} } case 432: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2646 + //line sql.y:2679 { sqlVAL.union.val = sqlDollar[2].union.ival() } case 433: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2650 + //line sql.y:2683 { sqlVAL.union.val = IntVal{} } case 438: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2668 + //line sql.y:2701 { sqlVAL.union.val = &IntType{Name: "BIT", N: int(sqlDollar[4].union.ival().Val)} } case 439: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2674 + //line sql.y:2707 { sqlVAL.union.val = &IntType{Name: "BIT"} } case 444: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2690 + //line sql.y:2723 { sqlVAL.union.val = sqlDollar[1].union.colType() sqlVAL.union.val.(*StringType).N = int(sqlDollar[3].union.ival().Val) } case 445: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2697 + //line sql.y:2730 { sqlVAL.union.val = sqlDollar[1].union.colType() } case 446: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2703 + //line sql.y:2736 { sqlVAL.union.val = &StringType{Name: "CHAR"} } case 447: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2707 + //line sql.y:2740 { sqlVAL.union.val = &StringType{Name: "CHAR"} } case 448: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2711 + //line sql.y:2744 { sqlVAL.union.val = &StringType{Name: "VARCHAR"} } case 449: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2715 + //line sql.y:2748 { sqlVAL.union.val = &StringType{Name: "STRING"} } case 450: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2720 + //line sql.y:2753 { } case 451: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2721 + //line sql.y:2754 { } case 452: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2726 + //line sql.y:2759 { sqlVAL.union.val = &DateType{} } case 453: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2730 + //line sql.y:2763 { sqlVAL.union.val = &TimestampType{} } case 454: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2734 + //line sql.y:2767 { sqlVAL.union.val = &TimestampType{withZone: true} } case 455: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2739 + //line sql.y:2772 { sqlVAL.union.val = &IntervalType{} } case 456: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2744 + //line sql.y:2777 { unimplemented() } case 457: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2745 + //line sql.y:2778 { unimplemented() } case 458: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2746 + //line sql.y:2779 { unimplemented() } case 459: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2747 + //line sql.y:2780 { unimplemented() } case 460: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2748 + //line sql.y:2781 { unimplemented() } case 461: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2749 + //line sql.y:2782 { unimplemented() } case 462: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2750 + //line sql.y:2783 { unimplemented() } case 463: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2751 + //line sql.y:2784 { unimplemented() } case 464: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2752 + //line sql.y:2785 { unimplemented() } case 465: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2753 + //line sql.y:2786 { unimplemented() } case 466: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2754 + //line sql.y:2787 { unimplemented() } case 467: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2755 + //line sql.y:2788 { unimplemented() } case 468: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2756 + //line sql.y:2789 { unimplemented() } case 469: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:2757 + //line sql.y:2790 { } case 470: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:2760 + //line sql.y:2793 { unimplemented() } case 471: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2761 + //line sql.y:2794 { unimplemented() } case 473: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2785 + //line sql.y:2818 { sqlVAL.union.val = &CastExpr{Expr: sqlDollar[1].union.expr(), Type: sqlDollar[3].union.colType()} } case 474: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2788 + //line sql.y:2821 { unimplemented() } case 475: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2789 + //line sql.y:2822 { unimplemented() } case 476: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2798 + //line sql.y:2831 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryPlus, Expr: sqlDollar[2].union.expr()} } case 477: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2802 + //line sql.y:2835 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryMinus, Expr: sqlDollar[2].union.expr()} } case 478: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2806 + //line sql.y:2839 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryComplement, Expr: sqlDollar[2].union.expr()} } case 479: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2810 + //line sql.y:2843 { sqlVAL.union.val = &BinaryExpr{Operator: Plus, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 480: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2814 + //line sql.y:2847 { sqlVAL.union.val = &BinaryExpr{Operator: Minus, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 481: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2818 + //line sql.y:2851 { sqlVAL.union.val = &BinaryExpr{Operator: Mult, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 482: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2822 + //line sql.y:2855 { sqlVAL.union.val = &BinaryExpr{Operator: Div, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 483: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2826 + //line sql.y:2859 { sqlVAL.union.val = &BinaryExpr{Operator: Mod, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 484: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2830 + //line sql.y:2863 { sqlVAL.union.val = &BinaryExpr{Operator: Bitxor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 485: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2834 + //line sql.y:2867 { sqlVAL.union.val = &BinaryExpr{Operator: Bitxor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 486: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2838 + //line sql.y:2871 { sqlVAL.union.val = &BinaryExpr{Operator: Bitand, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 487: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2842 + //line sql.y:2875 { sqlVAL.union.val = &BinaryExpr{Operator: Bitor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 488: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2846 + //line sql.y:2879 { sqlVAL.union.val = &ComparisonExpr{Operator: LT, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 489: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2850 + //line sql.y:2883 { sqlVAL.union.val = &ComparisonExpr{Operator: GT, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 490: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2854 + //line sql.y:2887 { sqlVAL.union.val = &ComparisonExpr{Operator: EQ, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 491: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2858 + //line sql.y:2891 { sqlVAL.union.val = &BinaryExpr{Operator: Concat, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 492: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2862 + //line sql.y:2895 { sqlVAL.union.val = &BinaryExpr{Operator: LShift, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 493: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2866 + //line sql.y:2899 { sqlVAL.union.val = &BinaryExpr{Operator: RShift, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 494: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2870 + //line sql.y:2903 { sqlVAL.union.val = &ComparisonExpr{Operator: LE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 495: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2874 + //line sql.y:2907 { sqlVAL.union.val = &ComparisonExpr{Operator: GE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 496: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2878 + //line sql.y:2911 { sqlVAL.union.val = &ComparisonExpr{Operator: NE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 497: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2882 + //line sql.y:2915 { sqlVAL.union.val = &AndExpr{Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 498: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2886 + //line sql.y:2919 { sqlVAL.union.val = &OrExpr{Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 499: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2890 + //line sql.y:2923 { sqlVAL.union.val = &NotExpr{Expr: sqlDollar[2].union.expr()} } case 500: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:2894 + //line sql.y:2927 { sqlVAL.union.val = &NotExpr{Expr: sqlDollar[2].union.expr()} } case 501: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2898 + //line sql.y:2931 { sqlVAL.union.val = &ComparisonExpr{Operator: Like, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 502: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2902 + //line sql.y:2935 { sqlVAL.union.val = &ComparisonExpr{Operator: NotLike, Left: sqlDollar[1].union.expr(), Right: sqlDollar[4].union.expr()} } case 503: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2906 + //line sql.y:2939 { sqlVAL.union.val = &ComparisonExpr{Operator: SimilarTo, Left: sqlDollar[1].union.expr(), Right: sqlDollar[4].union.expr()} } case 504: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2910 + //line sql.y:2943 { sqlVAL.union.val = &ComparisonExpr{Operator: NotSimilarTo, Left: sqlDollar[1].union.expr(), Right: sqlDollar[5].union.expr()} } case 505: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2914 + //line sql.y:2947 { sqlVAL.union.val = &ComparisonExpr{Operator: Is, Left: sqlDollar[1].union.expr(), Right: DNull} } case 506: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2918 + //line sql.y:2951 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNot, Left: sqlDollar[1].union.expr(), Right: DNull} } case 507: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2921 + //line sql.y:2954 { unimplemented() } case 508: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2923 + //line sql.y:2956 { sqlVAL.union.val = &ComparisonExpr{Operator: Is, Left: sqlDollar[1].union.expr(), Right: DBool(true)} } case 509: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2927 + //line sql.y:2960 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNot, Left: sqlDollar[1].union.expr(), Right: DBool(true)} } case 510: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2931 + //line sql.y:2964 { sqlVAL.union.val = &ComparisonExpr{Operator: Is, Left: sqlDollar[1].union.expr(), Right: DBool(false)} } case 511: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2935 + //line sql.y:2968 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNot, Left: sqlDollar[1].union.expr(), Right: DBool(false)} } case 512: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2939 + //line sql.y:2972 { sqlVAL.union.val = &ComparisonExpr{Operator: Is, Left: sqlDollar[1].union.expr(), Right: DNull} } case 513: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2943 + //line sql.y:2976 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNot, Left: sqlDollar[1].union.expr(), Right: DNull} } case 514: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:2947 + //line sql.y:2980 { sqlVAL.union.val = &ComparisonExpr{Operator: IsDistinctFrom, Left: sqlDollar[1].union.expr(), Right: sqlDollar[5].union.expr()} } case 515: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:2951 + //line sql.y:2984 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNotDistinctFrom, Left: sqlDollar[1].union.expr(), Right: sqlDollar[6].union.expr()} } case 516: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:2955 + //line sql.y:2988 { sqlVAL.union.val = &IsOfTypeExpr{Expr: sqlDollar[1].union.expr(), Types: sqlDollar[5].union.colTypes()} } case 517: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:2959 + //line sql.y:2992 { sqlVAL.union.val = &IsOfTypeExpr{Not: true, Expr: sqlDollar[1].union.expr(), Types: sqlDollar[6].union.colTypes()} } case 518: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:2963 + //line sql.y:2996 { sqlVAL.union.val = &RangeCond{Left: sqlDollar[1].union.expr(), From: sqlDollar[4].union.expr(), To: sqlDollar[6].union.expr()} } case 519: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:2967 + //line sql.y:3000 { sqlVAL.union.val = &RangeCond{Not: true, Left: sqlDollar[1].union.expr(), From: sqlDollar[5].union.expr(), To: sqlDollar[7].union.expr()} } case 520: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:2971 + //line sql.y:3004 { sqlVAL.union.val = &RangeCond{Left: sqlDollar[1].union.expr(), From: sqlDollar[4].union.expr(), To: sqlDollar[6].union.expr()} } case 521: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:2975 + //line sql.y:3008 { sqlVAL.union.val = &RangeCond{Not: true, Left: sqlDollar[1].union.expr(), From: sqlDollar[5].union.expr(), To: sqlDollar[7].union.expr()} } case 522: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:2979 + //line sql.y:3012 { sqlVAL.union.val = &ComparisonExpr{Operator: In, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 523: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:2983 + //line sql.y:3016 { sqlVAL.union.val = &ComparisonExpr{Operator: NotIn, Left: sqlDollar[1].union.expr(), Right: sqlDollar[4].union.expr()} } case 525: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3000 + //line sql.y:3033 { sqlVAL.union.val = &CastExpr{Expr: sqlDollar[1].union.expr(), Type: sqlDollar[3].union.colType()} } case 526: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3004 + //line sql.y:3037 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryPlus, Expr: sqlDollar[2].union.expr()} } case 527: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3008 + //line sql.y:3041 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryMinus, Expr: sqlDollar[2].union.expr()} } case 528: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3012 + //line sql.y:3045 { sqlVAL.union.val = &UnaryExpr{Operator: UnaryComplement, Expr: sqlDollar[2].union.expr()} } case 529: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3016 + //line sql.y:3049 { sqlVAL.union.val = &BinaryExpr{Operator: Plus, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 530: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3020 + //line sql.y:3053 { sqlVAL.union.val = &BinaryExpr{Operator: Minus, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 531: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3024 + //line sql.y:3057 { sqlVAL.union.val = &BinaryExpr{Operator: Mult, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 532: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3028 + //line sql.y:3061 { sqlVAL.union.val = &BinaryExpr{Operator: Div, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 533: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3032 + //line sql.y:3065 { sqlVAL.union.val = &BinaryExpr{Operator: Mod, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 534: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3036 + //line sql.y:3069 { sqlVAL.union.val = &BinaryExpr{Operator: Bitxor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 535: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3040 + //line sql.y:3073 { sqlVAL.union.val = &BinaryExpr{Operator: Bitxor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 536: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3044 + //line sql.y:3077 { sqlVAL.union.val = &BinaryExpr{Operator: Bitand, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 537: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3048 + //line sql.y:3081 { sqlVAL.union.val = &BinaryExpr{Operator: Bitor, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 538: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3052 + //line sql.y:3085 { sqlVAL.union.val = &ComparisonExpr{Operator: LT, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 539: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3056 + //line sql.y:3089 { sqlVAL.union.val = &ComparisonExpr{Operator: GT, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 540: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3060 + //line sql.y:3093 { sqlVAL.union.val = &ComparisonExpr{Operator: EQ, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 541: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3064 + //line sql.y:3097 { sqlVAL.union.val = &BinaryExpr{Operator: Concat, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 542: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3068 + //line sql.y:3101 { sqlVAL.union.val = &BinaryExpr{Operator: LShift, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 543: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3072 + //line sql.y:3105 { sqlVAL.union.val = &BinaryExpr{Operator: RShift, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 544: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3076 + //line sql.y:3109 { sqlVAL.union.val = &ComparisonExpr{Operator: LE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 545: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3080 + //line sql.y:3113 { sqlVAL.union.val = &ComparisonExpr{Operator: GE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 546: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3084 + //line sql.y:3117 { sqlVAL.union.val = &ComparisonExpr{Operator: NE, Left: sqlDollar[1].union.expr(), Right: sqlDollar[3].union.expr()} } case 547: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3088 + //line sql.y:3121 { sqlVAL.union.val = &ComparisonExpr{Operator: IsDistinctFrom, Left: sqlDollar[1].union.expr(), Right: sqlDollar[5].union.expr()} } case 548: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3092 + //line sql.y:3125 { sqlVAL.union.val = &ComparisonExpr{Operator: IsNotDistinctFrom, Left: sqlDollar[1].union.expr(), Right: sqlDollar[6].union.expr()} } case 549: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3096 + //line sql.y:3129 { sqlVAL.union.val = &IsOfTypeExpr{Expr: sqlDollar[1].union.expr(), Types: sqlDollar[5].union.colTypes()} } case 550: sqlDollar = sqlS[sqlpt-7 : sqlpt+1] - //line sql.y:3100 + //line sql.y:3133 { sqlVAL.union.val = &IsOfTypeExpr{Not: true, Expr: sqlDollar[1].union.expr(), Types: sqlDollar[6].union.colTypes()} } case 551: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3112 + //line sql.y:3145 { sqlVAL.union.val = sqlDollar[1].union.qname() } case 553: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3117 + //line sql.y:3150 { sqlVAL.union.val = ValArg{name: sqlDollar[1].str} } case 554: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3121 + //line sql.y:3154 { sqlVAL.union.val = &ParenExpr{Expr: sqlDollar[2].union.expr()} } case 557: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3127 + //line sql.y:3160 { sqlVAL.union.val = &Subquery{Select: sqlDollar[1].union.selectStmt()} } case 558: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3131 + //line sql.y:3164 { sqlVAL.union.val = &Subquery{Select: sqlDollar[1].union.selectStmt()} } case 559: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3135 + //line sql.y:3168 { sqlVAL.union.val = &ExistsExpr{Subquery: &Subquery{Select: sqlDollar[2].union.selectStmt()}} } case 560: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3141 + //line sql.y:3174 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 561: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3145 + //line sql.y:3178 { sqlVAL.union.val = sqlDollar[1].union.expr() } case 562: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3149 + //line sql.y:3182 { sqlVAL.union.val = sqlDollar[1].union.expr() } case 563: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3157 + //line sql.y:3190 { sqlVAL.union.val = &FuncExpr{Name: sqlDollar[1].union.qname()} } case 564: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3161 + //line sql.y:3194 { sqlVAL.union.val = &FuncExpr{Name: sqlDollar[1].union.qname(), Exprs: sqlDollar[3].union.exprs()} } case 565: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3164 + //line sql.y:3197 { unimplemented() } case 566: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:3165 + //line sql.y:3198 { unimplemented() } case 567: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3167 + //line sql.y:3200 { sqlVAL.union.val = &FuncExpr{Name: sqlDollar[1].union.qname(), Type: All, Exprs: sqlDollar[4].union.exprs()} } case 568: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3171 + //line sql.y:3204 { sqlVAL.union.val = &FuncExpr{Name: sqlDollar[1].union.qname(), Type: Distinct, Exprs: sqlDollar[4].union.exprs()} } case 569: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3175 + //line sql.y:3208 { sqlVAL.union.val = &FuncExpr{Name: sqlDollar[1].union.qname(), Exprs: Exprs{StarExpr()}} } case 570: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3188 + //line sql.y:3221 { sqlVAL.union.val = sqlDollar[1].union.expr() } case 571: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3192 + //line sql.y:3225 { sqlVAL.union.val = sqlDollar[1].union.expr() } case 572: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3201 + //line sql.y:3234 { unimplemented() } case 573: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3202 + //line sql.y:3235 { unimplemented() } case 574: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3206 + //line sql.y:3239 { unimplemented() } case 575: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3208 + //line sql.y:3241 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}} } case 576: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3212 + //line sql.y:3245 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}} } case 577: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3216 + //line sql.y:3249 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}} } case 578: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3220 + //line sql.y:3253 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}} } case 579: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3223 + //line sql.y:3256 { unimplemented() } case 580: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3224 + //line sql.y:3257 { unimplemented() } case 581: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3225 + //line sql.y:3258 { unimplemented() } case 582: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3226 + //line sql.y:3259 { unimplemented() } case 583: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3228 + //line sql.y:3261 { sqlVAL.union.val = &CastExpr{Expr: sqlDollar[3].union.expr(), Type: sqlDollar[5].union.colType()} } case 584: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3232 + //line sql.y:3265 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}, Exprs: sqlDollar[3].union.exprs()} } case 585: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3236 + //line sql.y:3269 { sqlVAL.union.val = &OverlayExpr{FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}, Exprs: sqlDollar[3].union.exprs()}} } case 586: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3240 + //line sql.y:3273 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: "STRPOS"}, Exprs: sqlDollar[3].union.exprs()} } case 587: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3244 + //line sql.y:3277 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}, Exprs: sqlDollar[3].union.exprs()} } case 588: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3247 + //line sql.y:3280 { unimplemented() } case 589: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3249 + //line sql.y:3282 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: "BTRIM"}, Exprs: sqlDollar[4].union.exprs()} } case 590: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3253 + //line sql.y:3286 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: "LTRIM"}, Exprs: sqlDollar[4].union.exprs()} } case 591: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3257 + //line sql.y:3290 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: "RTRIM"}, Exprs: sqlDollar[4].union.exprs()} } case 592: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3261 + //line sql.y:3294 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: "BTRIM"}, Exprs: sqlDollar[3].union.exprs()} } case 593: sqlDollar = sqlS[sqlpt-8 : sqlpt+1] - //line sql.y:3265 + //line sql.y:3298 { sqlVAL.union.val = &IfExpr{Cond: sqlDollar[3].union.expr(), True: sqlDollar[5].union.expr(), Else: sqlDollar[7].union.expr()} } case 594: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3269 + //line sql.y:3302 { sqlVAL.union.val = &NullIfExpr{Expr1: sqlDollar[3].union.expr(), Expr2: sqlDollar[5].union.expr()} } case 595: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3273 + //line sql.y:3306 { sqlVAL.union.val = &CoalesceExpr{Name: "IFNULL", Exprs: Exprs{sqlDollar[3].union.expr(), sqlDollar[5].union.expr()}} } case 596: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3277 + //line sql.y:3310 { sqlVAL.union.val = &CoalesceExpr{Name: "COALESCE", Exprs: sqlDollar[3].union.exprs()} } case 597: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3281 + //line sql.y:3314 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}, Exprs: sqlDollar[3].union.exprs()} } case 598: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3285 + //line sql.y:3318 { sqlVAL.union.val = &FuncExpr{Name: &QualifiedName{Base: Name(sqlDollar[1].str)}, Exprs: sqlDollar[3].union.exprs()} } case 599: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3291 + //line sql.y:3324 { unimplemented() } case 600: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3292 + //line sql.y:3325 { } case 601: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3295 + //line sql.y:3328 { unimplemented() } case 602: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3296 + //line sql.y:3329 { } case 603: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3300 + //line sql.y:3333 { unimplemented() } case 604: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3301 + //line sql.y:3334 { } case 605: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3304 + //line sql.y:3337 { unimplemented() } case 606: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3305 + //line sql.y:3338 { unimplemented() } case 607: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3308 + //line sql.y:3341 { unimplemented() } case 608: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3311 + //line sql.y:3344 { unimplemented() } case 609: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3312 + //line sql.y:3345 { unimplemented() } case 610: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3313 + //line sql.y:3346 { } case 611: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3317 + //line sql.y:3350 { unimplemented() } case 612: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3328 + //line sql.y:3361 { unimplemented() } case 613: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3329 + //line sql.y:3362 { } case 614: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3332 + //line sql.y:3365 { unimplemented() } case 615: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3333 + //line sql.y:3366 { } case 616: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3341 + //line sql.y:3374 { unimplemented() } case 617: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3342 + //line sql.y:3375 { unimplemented() } case 618: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3343 + //line sql.y:3376 { } case 619: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3346 + //line sql.y:3379 { unimplemented() } case 620: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3347 + //line sql.y:3380 { unimplemented() } case 621: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3353 + //line sql.y:3386 { unimplemented() } case 622: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3354 + //line sql.y:3387 { unimplemented() } case 623: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3355 + //line sql.y:3388 { unimplemented() } case 624: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3356 + //line sql.y:3389 { unimplemented() } case 625: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3357 + //line sql.y:3390 { unimplemented() } case 626: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3368 + //line sql.y:3401 { sqlVAL.union.val = &Row{sqlDollar[3].union.exprs()} } case 627: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3372 + //line sql.y:3405 { sqlVAL.union.val = &Row{nil} } case 628: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3376 + //line sql.y:3409 { sqlVAL.union.val = &Tuple{append(sqlDollar[2].union.exprs(), sqlDollar[4].union.expr())} } case 629: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3382 + //line sql.y:3415 { sqlVAL.union.val = &Row{sqlDollar[3].union.exprs()} } case 630: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3386 + //line sql.y:3419 { sqlVAL.union.val = &Row{nil} } case 631: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3392 + //line sql.y:3425 { sqlVAL.union.val = &Tuple{append(sqlDollar[2].union.exprs(), sqlDollar[4].union.expr())} } case 632: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3433 + //line sql.y:3466 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr()} } case 633: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3437 + //line sql.y:3470 { sqlVAL.union.val = append(sqlDollar[1].union.exprs(), sqlDollar[3].union.expr()) } case 634: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3443 + //line sql.y:3476 { sqlVAL.union.val = []ColumnType{sqlDollar[1].union.colType()} } case 635: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3447 + //line sql.y:3480 { sqlVAL.union.val = append(sqlDollar[1].union.colTypes(), sqlDollar[3].union.colType()) } case 636: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3453 + //line sql.y:3486 { sqlVAL.union.val = &Array{sqlDollar[2].union.exprs()} } case 637: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3457 + //line sql.y:3490 { sqlVAL.union.val = &Array{sqlDollar[2].union.exprs()} } case 638: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3461 + //line sql.y:3494 { sqlVAL.union.val = &Array{nil} } case 639: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3467 + //line sql.y:3500 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr()} } case 640: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3471 + //line sql.y:3504 { sqlVAL.union.val = append(sqlDollar[1].union.exprs(), sqlDollar[3].union.expr()) } case 641: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3477 + //line sql.y:3510 { sqlVAL.union.val = Exprs{DString(sqlDollar[1].str), sqlDollar[3].union.expr()} } case 649: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3499 + //line sql.y:3532 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), sqlDollar[2].union.expr(), sqlDollar[3].union.expr(), sqlDollar[4].union.expr()} } case 650: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3503 + //line sql.y:3536 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), sqlDollar[2].union.expr(), sqlDollar[3].union.expr()} } case 651: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3509 + //line sql.y:3542 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 652: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3516 + //line sql.y:3549 { sqlVAL.union.val = Exprs{sqlDollar[3].union.expr(), sqlDollar[1].union.expr()} } case 653: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3520 + //line sql.y:3553 { sqlVAL.union.val = Exprs(nil) } case 654: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3537 + //line sql.y:3570 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), sqlDollar[2].union.expr(), sqlDollar[3].union.expr()} } case 655: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3541 + //line sql.y:3574 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), sqlDollar[3].union.expr(), sqlDollar[2].union.expr()} } case 656: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3545 + //line sql.y:3578 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), sqlDollar[2].union.expr()} } case 657: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3549 + //line sql.y:3582 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr(), DInt(1), sqlDollar[2].union.expr()} } case 658: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3553 + //line sql.y:3586 { sqlVAL.union.val = sqlDollar[1].union.exprs() } case 659: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3557 + //line sql.y:3590 { sqlVAL.union.val = Exprs(nil) } case 660: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3563 + //line sql.y:3596 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 661: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3569 + //line sql.y:3602 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 662: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3575 + //line sql.y:3608 { sqlVAL.union.val = append(sqlDollar[3].union.exprs(), sqlDollar[1].union.expr()) } case 663: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3579 + //line sql.y:3612 { sqlVAL.union.val = sqlDollar[2].union.exprs() } case 664: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3583 + //line sql.y:3616 { sqlVAL.union.val = sqlDollar[1].union.exprs() } case 665: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3589 + //line sql.y:3622 { sqlVAL.union.val = &Subquery{Select: sqlDollar[1].union.selectStmt()} } case 666: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3593 + //line sql.y:3626 { sqlVAL.union.val = &Tuple{sqlDollar[2].union.exprs()} } case 667: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3604 + //line sql.y:3637 { sqlVAL.union.val = &CaseExpr{Expr: sqlDollar[2].union.expr(), Whens: sqlDollar[3].union.whens(), Else: sqlDollar[4].union.expr()} } case 668: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3611 + //line sql.y:3644 { sqlVAL.union.val = []*When{sqlDollar[1].union.when()} } case 669: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3615 + //line sql.y:3648 { sqlVAL.union.val = append(sqlDollar[1].union.whens(), sqlDollar[2].union.when()) } case 670: sqlDollar = sqlS[sqlpt-4 : sqlpt+1] - //line sql.y:3621 + //line sql.y:3654 { sqlVAL.union.val = &When{Cond: sqlDollar[2].union.expr(), Val: sqlDollar[4].union.expr()} } case 671: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3627 + //line sql.y:3660 { sqlVAL.union.val = sqlDollar[2].union.expr() } case 672: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3631 + //line sql.y:3664 { sqlVAL.union.val = Expr(nil) } case 674: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3638 + //line sql.y:3671 { sqlVAL.union.val = Expr(nil) } case 675: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3644 + //line sql.y:3677 { sqlVAL.union.val = sqlDollar[1].union.indirectElem() } case 676: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3648 + //line sql.y:3681 { sqlVAL.union.val = sqlDollar[1].union.indirectElem() } case 677: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3652 + //line sql.y:3685 { sqlVAL.union.val = &ArrayIndirection{Begin: sqlDollar[2].union.expr()} } case 678: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3656 + //line sql.y:3689 { sqlVAL.union.val = &ArrayIndirection{Begin: sqlDollar[2].union.expr(), End: sqlDollar[4].union.expr()} } case 679: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3662 + //line sql.y:3695 { sqlVAL.union.val = NameIndirection(sqlDollar[2].str) } case 680: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3668 + //line sql.y:3701 { sqlVAL.union.val = qualifiedStar } case 681: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3674 + //line sql.y:3707 { sqlVAL.union.val = Indirection{sqlDollar[1].union.indirectElem()} } case 682: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3678 + //line sql.y:3711 { sqlVAL.union.val = append(sqlDollar[1].union.indirect(), sqlDollar[2].union.indirectElem()) } case 683: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3683 + //line sql.y:3716 { } case 684: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3684 + //line sql.y:3717 { } case 686: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3693 + //line sql.y:3726 { sqlVAL.union.val = DefaultVal{} } case 687: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3699 + //line sql.y:3732 { sqlVAL.union.val = Exprs{sqlDollar[1].union.expr()} } case 688: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3703 + //line sql.y:3736 { sqlVAL.union.val = append(sqlDollar[1].union.exprs(), sqlDollar[3].union.expr()) } case 689: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3712 + //line sql.y:3745 { sqlVAL.union.val = sqlDollar[2].union.exprs() } case 690: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3718 + //line sql.y:3751 { sqlVAL.union.val = SelectExprs{sqlDollar[1].union.selExpr()} } case 691: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3722 + //line sql.y:3755 { sqlVAL.union.val = append(sqlDollar[1].union.selExprs(), sqlDollar[3].union.selExpr()) } case 692: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3728 + //line sql.y:3761 { sqlVAL.union.val = SelectExpr{Expr: sqlDollar[1].union.expr(), As: Name(sqlDollar[3].str)} } case 693: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3737 + //line sql.y:3770 { sqlVAL.union.val = SelectExpr{Expr: sqlDollar[1].union.expr(), As: Name(sqlDollar[2].str)} } case 694: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3741 + //line sql.y:3774 { sqlVAL.union.val = SelectExpr{Expr: sqlDollar[1].union.expr()} } case 695: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3745 + //line sql.y:3778 { sqlVAL.union.val = starSelectExpr() } case 696: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3753 + //line sql.y:3786 { sqlVAL.union.val = QualifiedNames{sqlDollar[1].union.qname()} } case 697: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3757 + //line sql.y:3790 { sqlVAL.union.val = append(sqlDollar[1].union.qnames(), sqlDollar[3].union.qname()) } case 698: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3763 + //line sql.y:3796 { sqlVAL.union.val = TableNameWithIndexList{sqlDollar[1].union.tableWithIdx()} } case 699: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3767 + //line sql.y:3800 { sqlVAL.union.val = append(sqlDollar[1].union.tableWithIdxList(), sqlDollar[3].union.tableWithIdx()) } case 700: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3773 + //line sql.y:3806 { sqlVAL.union.val = QualifiedNames{sqlDollar[1].union.qname()} } case 701: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3777 + //line sql.y:3810 { sqlVAL.union.val = append(sqlDollar[1].union.qnames(), sqlDollar[3].union.qname()) } case 702: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3788 + //line sql.y:3821 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str)} } case 703: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3792 + //line sql.y:3825 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str), Indirect: sqlDollar[2].union.indirect()} } case 704: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3798 + //line sql.y:3831 { sqlVAL.union.val = &TableNameWithIndex{Table: sqlDollar[1].union.qname(), Index: Name(sqlDollar[3].str)} } case 705: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3809 + //line sql.y:3842 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str)} } case 706: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3813 + //line sql.y:3846 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str), Indirect: Indirection{sqlDollar[2].union.indirectElem()}} } case 707: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3817 + //line sql.y:3850 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str), Indirect: Indirection{sqlDollar[2].union.indirectElem()}} } case 708: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3821 + //line sql.y:3854 { sqlVAL.union.val = &QualifiedName{Indirect: Indirection{unqualifiedStar}} } case 709: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3827 + //line sql.y:3860 { sqlVAL.union.val = []string{sqlDollar[1].str} } case 710: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3831 + //line sql.y:3864 { sqlVAL.union.val = append(sqlDollar[1].union.strs(), sqlDollar[3].str) } case 711: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3837 + //line sql.y:3870 { sqlVAL.union.val = sqlDollar[2].union.strs() } case 712: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3840 + //line sql.y:3873 { } case 713: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3850 + //line sql.y:3883 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str)} } case 714: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3854 + //line sql.y:3887 { sqlVAL.union.val = &QualifiedName{Base: Name(sqlDollar[1].str), Indirect: sqlDollar[2].union.indirect()} } case 715: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3861 + //line sql.y:3894 { sqlVAL.union.val = &IntVal{Val: sqlDollar[1].union.ival().Val, Str: sqlDollar[1].union.ival().Str} } case 716: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3865 + //line sql.y:3898 { sqlVAL.union.val = NumVal(sqlDollar[1].str) } case 717: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3869 + //line sql.y:3902 { sqlVAL.union.val = DString(sqlDollar[1].str) } case 718: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3873 + //line sql.y:3906 { sqlVAL.union.val = DBytes(sqlDollar[1].str) } case 719: sqlDollar = sqlS[sqlpt-6 : sqlpt+1] - //line sql.y:3876 + //line sql.y:3909 { unimplemented() } case 720: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3878 + //line sql.y:3911 { sqlVAL.union.val = &CastExpr{Expr: DString(sqlDollar[2].str), Type: sqlDollar[1].union.colType()} } case 721: sqlDollar = sqlS[sqlpt-3 : sqlpt+1] - //line sql.y:3882 + //line sql.y:3915 { sqlVAL.union.val = &CastExpr{Expr: DString(sqlDollar[2].str), Type: sqlDollar[1].union.colType()} } case 722: sqlDollar = sqlS[sqlpt-5 : sqlpt+1] - //line sql.y:3886 + //line sql.y:3919 { sqlVAL.union.val = &CastExpr{Expr: DString(sqlDollar[5].str), Type: sqlDollar[1].union.colType()} } case 723: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3890 + //line sql.y:3923 { sqlVAL.union.val = DBool(true) } case 724: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3894 + //line sql.y:3927 { sqlVAL.union.val = DBool(false) } case 725: sqlDollar = sqlS[sqlpt-1 : sqlpt+1] - //line sql.y:3898 + //line sql.y:3931 { sqlVAL.union.val = DNull } case 727: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3905 + //line sql.y:3938 { sqlVAL.union.val = sqlDollar[2].union.ival() } case 728: sqlDollar = sqlS[sqlpt-2 : sqlpt+1] - //line sql.y:3909 + //line sql.y:3942 { sqlVAL.union.val = IntVal{Val: -sqlDollar[2].union.ival().Val, Str: "-" + sqlDollar[2].union.ival().Str} } case 733: sqlDollar = sqlS[sqlpt-0 : sqlpt+1] - //line sql.y:3931 + //line sql.y:3964 { sqlVAL.str = "" } diff --git a/sql/parser/sql.y b/sql/parser/sql.y index 926fd2395dd7..f532668534d7 100644 --- a/sql/parser/sql.y +++ b/sql/parser/sql.y @@ -253,6 +253,9 @@ func (u *sqlSymUnion) idxElem() IndexElem { func (u *sqlSymUnion) idxElems() IndexElemList { return u.val.(IndexElemList) } +func (u *sqlSymUnion) dropBehavior() DropBehavior { + return u.val.(DropBehavior) +} %} @@ -303,7 +306,7 @@ func (u *sqlSymUnion) idxElems() IndexElemList { %type opt_collate_clause -%type opt_drop_behavior +%type opt_drop_behavior %type transaction_iso_level %type transaction_user_priority @@ -752,7 +755,12 @@ alter_table_cmd: // ALTER TABLE DROP [COLUMN] [RESTRICT|CASCADE] | DROP opt_column name opt_drop_behavior { - $$.val = &AlterTableDropColumn{columnKeyword: $2.bool(), IfExists: false, Column: $3} + $$.val = &AlterTableDropColumn{ + columnKeyword: $2.bool(), + IfExists: false, + Column: $3, + DropBehavior: $4.dropBehavior(), + } } // ALTER TABLE ALTER [COLUMN] [SET DATA] TYPE // [ USING ] @@ -769,12 +777,20 @@ alter_table_cmd: // ALTER TABLE DROP CONSTRAINT IF EXISTS [RESTRICT|CASCADE] | DROP CONSTRAINT IF EXISTS name opt_drop_behavior { - $$.val = &AlterTableDropConstraint{IfExists: true, Constraint: $5} + $$.val = &AlterTableDropConstraint{ + IfExists: true, + Constraint: $5, + DropBehavior: $6.dropBehavior(), + } } // ALTER TABLE DROP CONSTRAINT [RESTRICT|CASCADE] | DROP CONSTRAINT name opt_drop_behavior { - $$.val = &AlterTableDropConstraint{IfExists: false, Constraint: $3} + $$.val = &AlterTableDropConstraint{ + IfExists: false, + Constraint: $3, + DropBehavior: $4.dropBehavior(), + } } alter_column_default: @@ -788,9 +804,18 @@ alter_column_default: } opt_drop_behavior: - CASCADE { unimplemented() } -| RESTRICT { unimplemented() } -| /* EMPTY */ {} + CASCADE + { + $$.val = DropCascade + } +| RESTRICT + { + $$.val = DropRestrict + } +| /* EMPTY */ + { + $$.val = DropDefault + } opt_collate_clause: COLLATE any_name { unimplemented() } @@ -825,11 +850,19 @@ drop_stmt: } | DROP INDEX table_name_with_index_list opt_drop_behavior { - $$.val = &DropIndex{IndexList: $3.tableWithIdxList(), IfExists: false} + $$.val = &DropIndex{ + IndexList: $3.tableWithIdxList(), + IfExists: false, + DropBehavior: $4.dropBehavior(), + } } | DROP INDEX IF EXISTS table_name_with_index_list opt_drop_behavior { - $$.val = &DropIndex{IndexList: $5.tableWithIdxList(), IfExists: true} + $$.val = &DropIndex{ + IndexList: $5.tableWithIdxList(), + IfExists: true, + DropBehavior: $6.dropBehavior(), + } } | DROP TABLE any_name_list { @@ -1532,7 +1565,7 @@ numeric_only: truncate_stmt: TRUNCATE opt_table relation_expr_list opt_drop_behavior { - $$.val = &Truncate{Tables: $3.qnames()} + $$.val = &Truncate{Tables: $3.qnames(), DropBehavior: $4.dropBehavior()} } // CREATE INDEX diff --git a/sql/parser/truncate.go b/sql/parser/truncate.go index a9c11b0d3c4f..697609131951 100644 --- a/sql/parser/truncate.go +++ b/sql/parser/truncate.go @@ -22,11 +22,15 @@ package parser -import "bytes" +import ( + "bytes" + "fmt" +) // Truncate represents a TRUNCATE statement. type Truncate struct { - Tables QualifiedNames + Tables QualifiedNames + DropBehavior DropBehavior } func (node *Truncate) String() string { @@ -38,5 +42,8 @@ func (node *Truncate) String() string { } buf.WriteString(n.String()) } + if node.DropBehavior != DropDefault { + fmt.Fprintf(&buf, " %s", node.DropBehavior) + } return buf.String() } From e17134fe9aece9d245bd10ed2a99d3e45433da21 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Fri, 8 Apr 2016 22:04:21 -0400 Subject: [PATCH 2/2] sql: Simplify a type switch/assertion --- sql/alter_table.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sql/alter_table.go b/sql/alter_table.go index 23fff04d5822..444664ff45c1 100644 --- a/sql/alter_table.go +++ b/sql/alter_table.go @@ -169,25 +169,24 @@ func (p *planner) AlterTable(n *parser.AlterTable) (planNode, *roachpb.Error) { } } - case *parser.AlterTableSetDefault, *parser.AlterTableDropNotNull: - colMut := t.(parser.ColumnMutationCmd) + case parser.ColumnMutationCmd: // Column mutations - status, i, err := tableDesc.FindColumnByName(colMut.GetColumn()) + status, i, err := tableDesc.FindColumnByName(t.GetColumn()) if err != nil { return nil, roachpb.NewError(err) } switch status { case DescriptorActive: - applyColumnMutation(&tableDesc.Columns[i], colMut) + applyColumnMutation(&tableDesc.Columns[i], t) descriptorChanged = true case DescriptorIncomplete: switch tableDesc.Mutations[i].Direction { case DescriptorMutation_ADD: - return nil, roachpb.NewUErrorf("column %q in the middle of being added, try again later", colMut.GetColumn()) + return nil, roachpb.NewUErrorf("column %q in the middle of being added, try again later", t.GetColumn()) case DescriptorMutation_DROP: - return nil, roachpb.NewUErrorf("column %q in the middle of being dropped", colMut.GetColumn()) + return nil, roachpb.NewUErrorf("column %q in the middle of being dropped", t.GetColumn()) } }