diff --git a/docs/_includes/side_menu.html b/docs/_includes/side_menu.html index d04144f1..bac9615e 100644 --- a/docs/_includes/side_menu.html +++ b/docs/_includes/side_menu.html @@ -24,6 +24,7 @@
  • Variable
  • Row Value
  • Cursor
  • +
  • Temporary Table
  • Control Flow
  • Transaction Management
  • Built-in Commands
  • diff --git a/docs/_posts/2006-01-02-temporary-table.md b/docs/_posts/2006-01-02-temporary-table.md new file mode 100644 index 00000000..32182fe8 --- /dev/null +++ b/docs/_posts/2006-01-02-temporary-table.md @@ -0,0 +1,26 @@ +--- +layout: default +title: Temporary Table - Reference Manual - csvq +category: reference +--- + +# Temporary Table + +A Temporary Table is a temporary view that can be used in a procedure. +You can refer, insert, update, or delete temporary tables. + +## Declare Temporary Table +{: #declare} + +```sql +DECLARE table_name TABLE [(column_name [, column_name ...])] FOR select_query; +``` + +_table_name_ +: [identifier]({{ '/reference/statement.html#parsing' | relative_url }}) + +_column_name_ +: [identifier]({{ '/reference/statement.html#parsing' | relative_url }}) + +_select_query_ +: [Select Query]({{ '/reference/select-query.html' | relative_url }}) diff --git a/docs/reference.md b/docs/reference.md index afb31952..e855be43 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -20,6 +20,7 @@ title: Reference Manual - csvq * [Variable]({{ '/reference/variable.html' | relative_url }}) * [Row Value]({{ '/reference/row-value.html' | relative_url }}) * [Cursor]({{ '/reference/cursor.html' | relative_url }}) + * [Temporary Table]({{ '/reference/temporary-table.html' | relative_url }}) * [Control Flow]({{ '/reference/control-flow.html' | relative_url }}) * [Transaction Management]({{ '/reference/transaction.html' | relative_url }}) * [Built-in Commands]({{ '/reference/built-in.html' | relative_url }}) diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 0db34741..c8ab37f5 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -10,7 +10,7 @@ https://mithrandie.github.io/csvq/reference.html - 2017-07-05T21:28:49+00:00 + 2017-07-10T05:11:55+00:00 https://mithrandie.github.io/csvq/reference/install.html @@ -68,6 +68,10 @@ https://mithrandie.github.io/csvq/reference/cursor.html 2017-06-29T17:08:49+00:00 + + https://mithrandie.github.io/csvq/reference/temporary-table.html + 2017-07-10T05:11:55+00:00 + https://mithrandie.github.io/csvq/reference/control-flow.html 2017-07-06T20:38:36+00:00 diff --git a/lib/action/calc.go b/lib/action/calc.go index b2fe2b1c..97586d80 100644 --- a/lib/action/calc.go +++ b/lib/action/calc.go @@ -4,6 +4,7 @@ import ( "strconv" "strings" + "errors" "github.com/mithrandie/csvq/lib/cmd" "github.com/mithrandie/csvq/lib/parser" "github.com/mithrandie/csvq/lib/query" @@ -14,10 +15,9 @@ func Calc(expr string) error { q := "select " + expr + " from stdin" - parser.SetDebugLevel(0, true) program, err := parser.Parse(q) if err != nil { - return err + return errors.New("syntax error") } selectEntity, _ := program[0].(parser.SelectQuery).SelectEntity.(parser.SelectEntity) diff --git a/lib/action/calc_test.go b/lib/action/calc_test.go index e7fd21d6..affaaada 100644 --- a/lib/action/calc_test.go +++ b/lib/action/calc_test.go @@ -27,7 +27,7 @@ var calcTests = []struct { { Stdin: "foo", Input: "from", - Error: "syntax error: unexpected FROM", + Error: "syntax error", }, { Stdin: "", diff --git a/lib/action/write_test.go b/lib/action/write_test.go index ca3b55c8..9cc89141 100644 --- a/lib/action/write_test.go +++ b/lib/action/write_test.go @@ -34,7 +34,7 @@ var executeTests = []struct { { Name: "Query Execution Error", Input: "select from", - Error: "syntax error: unexpected FROM", + Error: "syntax error: unexpected from [L:1 C:8]", }, } diff --git a/lib/parser/ast.go b/lib/parser/ast.go index 3228cab1..c46ac420 100644 --- a/lib/parser/ast.go +++ b/lib/parser/ast.go @@ -567,12 +567,12 @@ func (sq Subquery) String() string { type Comparison struct { LHS Expression - Operator Token + Operator string RHS Expression } func (c Comparison) String() string { - s := []string{c.LHS.String(), c.Operator.Literal, c.RHS.String()} + s := []string{c.LHS.String(), c.Operator, c.RHS.String()} return joinWithSpace(s) } @@ -641,24 +641,24 @@ func (i In) String() string { type All struct { All string LHS Expression - Operator Token + Operator string Values Expression } func (a All) String() string { - s := []string{a.LHS.String(), a.Operator.Literal, a.All, a.Values.String()} + s := []string{a.LHS.String(), a.Operator, a.All, a.Values.String()} return joinWithSpace(s) } type Any struct { Any string LHS Expression - Operator Token + Operator string Values Expression } func (a Any) String() string { - s := []string{a.LHS.String(), a.Operator.Literal, a.Any, a.Values.String()} + s := []string{a.LHS.String(), a.Operator, a.Any, a.Values.String()} return joinWithSpace(s) } @@ -761,14 +761,14 @@ func (f Function) String() string { type Table struct { Object Expression - As Token + As string Alias Expression } func (t Table) String() string { s := []string{t.Object.String()} - if !t.As.IsEmpty() { - s = append(s, t.As.Literal) + if 0 < len(t.As) { + s = append(s, t.As) } if t.Alias != nil { s = append(s, t.Alias.String()) @@ -834,14 +834,14 @@ func (jc JoinCondition) String() string { type Field struct { Object Expression - As Token + As string Alias Expression } func (f Field) String() string { s := []string{f.Object.String()} - if !f.As.IsEmpty() { - s = append(s, f.As.Literal) + if 0 < len(f.As) { + s = append(s, f.As) } if f.Alias != nil { s = append(s, f.Alias.String()) @@ -1348,6 +1348,12 @@ func (e CursorStatus) String() string { return joinWithSpace(s) } +type TableDeclaration struct { + Table Identifier + Fields []Expression + Query Expression +} + type TransactionControl struct { Token int } diff --git a/lib/parser/ast_test.go b/lib/parser/ast_test.go index ac3cb0e2..f2975e77 100644 --- a/lib/parser/ast_test.go +++ b/lib/parser/ast_test.go @@ -497,7 +497,7 @@ func TestSelectEntity_String(t *testing.T) { Where: "where", Filter: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, }, @@ -511,7 +511,7 @@ func TestSelectEntity_String(t *testing.T) { Having: "having", Filter: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, }, @@ -545,7 +545,7 @@ func TestSelectClause_String(t *testing.T) { }, Field{ Object: Identifier{Literal: "column2"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, }, }, @@ -575,7 +575,7 @@ func TestWhereClause_String(t *testing.T) { Where: "where", Filter: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, } @@ -604,7 +604,7 @@ func TestHavingClause_String(t *testing.T) { Having: "having", Filter: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, } @@ -820,7 +820,7 @@ func TestSubquery_String(t *testing.T) { func TestComparison_String(t *testing.T) { e := Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, } expect := "column > 1" @@ -924,7 +924,7 @@ func TestAll_String(t *testing.T) { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", Values: Subquery{ Query: SelectQuery{ SelectEntity: SelectEntity{ @@ -961,7 +961,7 @@ func TestAny_String(t *testing.T) { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", Values: Subquery{ Query: SelectQuery{ SelectEntity: SelectEntity{ @@ -1136,7 +1136,7 @@ func TestFunction_String(t *testing.T) { func TestTable_String(t *testing.T) { e := Table{ Object: Identifier{Literal: "table"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, } expect := "table as alias" @@ -1156,7 +1156,7 @@ func TestTable_String(t *testing.T) { func TestTable_Name(t *testing.T) { e := Table{ Object: Identifier{Literal: "table.csv"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, } expect := "alias" @@ -1234,7 +1234,7 @@ func TestJoinCondition_String(t *testing.T) { Literal: "on", On: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, } @@ -1259,7 +1259,7 @@ func TestJoinCondition_String(t *testing.T) { func TestField_String(t *testing.T) { e := Field{ Object: Identifier{Literal: "column"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, } expect := "column as alias" @@ -1279,7 +1279,7 @@ func TestField_String(t *testing.T) { func TestField_Name(t *testing.T) { e := Field{ Object: Identifier{Literal: "column"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, } expect := "alias" @@ -1399,7 +1399,7 @@ func TestCase_String(t *testing.T) { Then: "then", Condition: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, Result: String{literal: "A"}, @@ -1418,7 +1418,7 @@ func TestCaseWhen_String(t *testing.T) { Then: "then", Condition: Comparison{ LHS: Identifier{Literal: "column"}, - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: Integer{literal: "1"}, }, Result: String{literal: "abcde"}, @@ -1741,7 +1741,7 @@ func TestUpdateQuery_String(t *testing.T) { Where: "where", Filter: Comparison{ LHS: Identifier{Literal: "column3"}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: NewInteger(3), }, }, @@ -1802,7 +1802,7 @@ func TestDeleteQuery_String(t *testing.T) { Where: "where", Filter: Comparison{ LHS: Identifier{Literal: "column1"}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: NewInteger(1), }, }, diff --git a/lib/parser/lexer.go b/lib/parser/lexer.go index 04b63bdc..0aeb343c 100644 --- a/lib/parser/lexer.go +++ b/lib/parser/lexer.go @@ -2,32 +2,41 @@ package parser import ( "errors" + "fmt" ) type Lexer struct { Scanner program []Statement + token Token err error } func (l *Lexer) Lex(lval *yySymType) int { - token, literal, quoted, err := l.Scan() + tok, err := l.Scan() if err != nil { l.Error(err.Error()) } - lval.token = Token{Token: token, Literal: literal, Quoted: quoted} - return token + lval.token = tok + l.token = lval.token + return tok.Token } func (l *Lexer) Error(e string) { - l.err = errors.New(e) + if 0 < l.token.Token { + l.err = errors.New(fmt.Sprintf("%s: unexpected %s [L:%d C:%d]", e, l.token.Literal, l.token.Line, l.token.Char)) + } else { + l.err = errors.New(fmt.Sprintf("%s [L:%d C:%d]", e, l.token.Line, l.token.Char)) + } } type Token struct { Token int Literal string Quoted bool + Line int + Char int } func (t *Token) IsEmpty() bool { diff --git a/lib/parser/parser.go b/lib/parser/parser.go index 5441f354..5957491c 100644 --- a/lib/parser/parser.go +++ b/lib/parser/parser.go @@ -261,7 +261,7 @@ const yyEofCode = 1 const yyErrCode = 2 const yyInitialStackSize = 16 -//line parser.y:1489 +//line parser.y:1508 func SetDebugLevel(level int, verbose bool) { yyDebug = level @@ -279,7 +279,7 @@ func Parse(s string) ([]Statement, error) { var yyExca = [...]int{ -1, 0, 1, 1, - -2, 74, + -2, 78, -1, 1, 1, -1, -2, 0, @@ -288,524 +288,533 @@ var yyExca = [...]int{ 77, 1, 81, 1, 83, 1, - -2, 74, - -1, 46, - 58, 54, - 59, 54, - 60, 54, - -2, 65, - -1, 115, - 64, 251, - 68, 251, - 69, 251, - -2, 267, - -1, 148, - 4, 34, - -2, 251, - -1, 149, - 4, 35, - -2, 251, + -2, 78, + -1, 47, + 58, 58, + 59, 58, + 60, 58, + -2, 69, + -1, 116, + 64, 255, + 68, 255, + 69, 255, + -2, 271, -1, 150, + 4, 38, + -2, 255, + -1, 151, + 4, 39, + -2, 255, + -1, 152, 77, 1, 81, 1, 83, 1, - -2, 74, - -1, 168, - 117, 147, - -2, 249, + -2, 78, -1, 170, - 79, 182, - -2, 251, - -1, 180, - 38, 147, - 97, 147, - 117, 147, - -2, 249, - -1, 181, + 117, 151, + -2, 253, + -1, 172, + 79, 186, + -2, 255, + -1, 182, + 38, 151, + 97, 151, + 117, 151, + -2, 253, + -1, 183, 83, 3, - -2, 74, - -1, 198, - 48, 253, - 50, 257, - -2, 189, - -1, 216, - 64, 251, - 68, 251, - 69, 251, - -2, 175, - -1, 226, - 64, 251, - 68, 251, - 69, 251, - -2, 246, - -1, 231, + -2, 78, + -1, 200, + 48, 257, + 50, 261, + -2, 193, + -1, 218, + 64, 255, + 68, 255, + 69, 255, + -2, 179, + -1, 228, + 64, 255, + 68, 255, + 69, 255, + -2, 250, + -1, 235, 70, 0, 107, 0, 110, 0, - -2, 118, - -1, 232, + -2, 122, + -1, 236, 70, 0, 107, 0, 110, 0, - -2, 120, - -1, 265, + -2, 124, + -1, 269, 77, 3, 81, 3, 83, 3, - -2, 74, - -1, 280, - 64, 251, - 68, 251, - 69, 251, - -2, 70, + -2, 78, -1, 284, - 64, 251, - 68, 251, - 69, 251, - -2, 109, - -1, 297, - 50, 257, - -2, 253, - -1, 310, - 64, 251, - 68, 251, - 69, 251, - -2, 60, - -1, 317, - 117, 147, - -2, 249, - -1, 330, - 83, 1, + 64, 255, + 68, 255, + 69, 255, -2, 74, + -1, 288, + 64, 255, + 68, 255, + 69, 255, + -2, 113, + -1, 301, + 50, 261, + -2, 257, + -1, 314, + 64, 255, + 68, 255, + 69, 255, + -2, 64, + -1, 321, + 117, 151, + -2, 253, -1, 336, + 83, 1, + -2, 78, + -1, 342, 70, 0, 107, 0, 110, 0, - -2, 129, - -1, 340, - 64, 251, - 68, 251, - 69, 251, - -2, 187, - -1, 362, + -2, 133, + -1, 346, + 64, 255, + 68, 255, + 69, 255, + -2, 191, + -1, 368, 83, 3, - -2, 74, - -1, 366, - 64, 251, - 68, 251, - 69, 251, - -2, 73, - -1, 417, - 83, 184, - -2, 251, - -1, 428, + -2, 78, + -1, 372, + 64, 255, + 68, 255, + 69, 255, + -2, 77, + -1, 425, + 83, 188, + -2, 255, + -1, 436, 77, 1, 81, 1, 83, 1, - -2, 74, - -1, 441, - 64, 251, - 68, 251, - 69, 251, - -2, 204, - -1, 447, - 64, 251, - 68, 251, - 69, 251, - -2, 64, + -2, 78, + -1, 449, + 64, 255, + 68, 255, + 69, 255, + -2, 208, -1, 455, - 64, 251, - 68, 251, - 69, 251, - -2, 213, - -1, 460, + 64, 255, + 68, 255, + 69, 255, + -2, 68, + -1, 463, + 64, 255, + 68, 255, + 69, 255, + -2, 217, + -1, 469, 77, 1, 81, 1, 83, 1, - -2, 74, - -1, 462, - 79, 197, - 81, 197, - 83, 197, - -2, 251, + -2, 78, -1, 471, + 79, 201, + 81, 201, + 83, 201, + -2, 255, + -1, 480, 77, 1, 81, 1, 83, 1, - -2, 18, - -1, 497, + -2, 19, + -1, 507, 83, 3, - -2, 74, - -1, 502, - 64, 251, - 68, 251, - 69, 251, - -2, 173, - -1, 521, + -2, 78, + -1, 512, + 64, 255, + 68, 255, + 69, 255, + -2, 177, + -1, 532, 77, 3, 81, 3, 83, 3, - -2, 74, + -2, 78, } const yyPrivate = 57344 -const yyLast = 1065 +const yyLast = 1104 var yyAct = [...]int{ - 37, 2, 403, 318, 198, 39, 40, 41, 42, 43, - 44, 45, 264, 121, 85, 34, 495, 34, 510, 384, - 166, 60, 61, 62, 89, 289, 482, 36, 1, 86, - 20, 113, 20, 398, 250, 374, 206, 376, 281, 367, - 328, 213, 129, 412, 112, 298, 217, 111, 63, 65, - 66, 67, 95, 197, 155, 296, 93, 199, 140, 404, - 16, 312, 124, 116, 57, 345, 144, 145, 146, 38, - 167, 209, 317, 126, 126, 167, 454, 438, 46, 51, - 138, 139, 168, 436, 77, 167, 3, 301, 426, 302, - 303, 304, 299, 147, 151, 297, 397, 157, 158, 159, - 160, 161, 340, 379, 120, 64, 125, 125, 425, 52, - 370, 183, 128, 183, 315, 137, 185, 52, 286, 48, - 194, 49, 186, 47, 202, 204, 177, 141, 524, 523, - 522, 75, 110, 494, 473, 115, 157, 158, 159, 160, - 161, 136, 276, 187, 466, 465, 464, 456, 192, 137, - 453, 195, 126, 173, 449, 126, 300, 437, 431, 219, - 33, 396, 341, 248, 220, 34, 159, 160, 161, 380, - 506, 33, 76, 64, 503, 136, 148, 149, 229, 255, - 20, 500, 364, 266, 208, 64, 353, 351, 349, 221, - 180, 165, 249, 54, 103, 105, 34, 184, 273, 46, - 170, 164, 255, 176, 211, 212, 225, 271, 98, 233, - 92, 20, 54, 287, 120, 263, 219, 54, 292, 126, - 54, 294, 142, 188, 91, 305, 488, 156, 518, 227, - 126, 272, 467, 143, 295, 252, 277, 216, 285, 520, - 508, 171, 472, 273, 172, 226, 319, 322, 292, 292, - 275, 459, 125, 137, 230, 231, 232, 293, 416, 307, - 239, 240, 241, 242, 243, 244, 245, 266, 339, 274, - 360, 361, 343, 329, 424, 363, 327, 356, 358, 288, - 34, 365, 320, 410, 357, 324, 333, 362, 137, 311, - 332, 313, 314, 280, 284, 20, 253, 321, 423, 498, - 104, 331, 319, 497, 253, 330, 346, 499, 427, 498, - 310, 331, 292, 528, 326, 179, 137, 355, 519, 492, - 458, 479, 33, 369, 135, 126, 174, 408, 409, 178, - 435, 388, 378, 80, 262, 164, 106, 334, 419, 336, - 219, 394, 136, 383, 389, 34, 322, 259, 182, 292, - 53, 258, 395, 382, 387, 210, 347, 393, 413, 385, - 20, 132, 406, 235, 266, 433, 291, 234, 236, 486, - 411, 359, 261, 260, 33, 429, 251, 34, 238, 237, - 254, 257, 366, 445, 443, 420, 442, 421, 386, 422, - 381, 446, 20, 279, 190, 219, 323, 325, 108, 372, - 373, 450, 526, 444, 292, 440, 126, 392, 432, 434, - 137, 126, 137, 448, 137, 439, 191, 285, 216, 102, - 103, 105, 319, 106, 107, 137, 292, 292, 469, 134, - 471, 391, 457, 175, 414, 309, 136, 122, 136, 407, - 136, 470, 405, 34, 335, 56, 337, 338, 485, 417, - 487, 430, 131, 132, 133, 55, 229, 490, 20, 491, - 377, 203, 119, 292, 203, 222, 223, 348, 126, 474, - 126, 53, 478, 284, 224, 34, 481, 316, 301, 322, - 302, 303, 304, 441, 64, 108, 34, 489, 493, 496, - 20, 504, 207, 507, 447, 375, 228, 377, 137, 266, - 513, 20, 306, 71, 72, 256, 256, 515, 455, 123, - 511, 126, 34, 509, 505, 501, 476, 477, 461, 64, - 527, 462, 193, 266, 480, 64, 104, 20, 319, 531, - 130, 525, 205, 468, 529, 127, 34, 196, 114, 203, - 35, 59, 64, 53, 118, 53, 53, 530, 58, 94, - 90, 20, 291, 399, 400, 401, 402, 10, 375, 9, - 375, 137, 375, 69, 70, 73, 74, 8, 7, 256, - 6, 256, 256, 290, 451, 452, 163, 162, 164, 5, - 301, 154, 302, 303, 304, 299, 502, 514, 297, 4, - 344, 169, 256, 350, 352, 354, 82, 64, 102, 103, - 105, 512, 106, 107, 35, 163, 162, 164, 214, 215, - 154, 377, 201, 200, 517, 516, 96, 81, 152, 151, - 256, 153, 157, 158, 159, 160, 161, 163, 463, 164, - 84, 38, 154, 78, 203, 83, 79, 64, 102, 103, - 105, 475, 106, 107, 35, 375, 371, 152, 151, 283, - 153, 157, 158, 159, 160, 161, 99, 246, 247, 282, - 100, 117, 278, 189, 108, 390, 308, 50, 97, 152, - 151, 15, 153, 157, 158, 159, 160, 161, 101, 267, - 14, 87, 68, 256, 13, 256, 12, 256, 375, 109, - 11, 265, 64, 102, 103, 105, 99, 106, 107, 35, - 100, 0, 0, 0, 108, 104, 218, 33, 97, 88, - 0, 0, 0, 0, 0, 203, 0, 0, 101, 0, - 203, 164, 0, 0, 154, 0, 0, 0, 0, 109, - 0, 64, 102, 103, 105, 0, 106, 107, 35, 0, - 0, 0, 0, 0, 0, 104, 0, 0, 0, 88, - 0, 99, 0, 256, 0, 100, 0, 0, 0, 108, - 0, 152, 151, 97, 153, 157, 158, 159, 160, 161, - 256, 0, 0, 101, 0, 0, 0, 203, 0, 203, - 0, 0, 0, 0, 109, 0, 0, 163, 162, 164, - 99, 368, 154, 0, 100, 0, 0, 0, 108, 0, - 104, 342, 97, 0, 88, 0, 0, 0, 0, 163, - 162, 164, 101, 256, 154, 0, 0, 0, 369, 0, - 203, 0, 0, 109, 0, 0, 163, 162, 164, 152, - 151, 154, 153, 157, 158, 159, 160, 161, 0, 104, - 247, 521, 0, 88, 0, 163, 162, 164, 0, 0, - 154, 152, 151, 0, 153, 157, 158, 159, 160, 161, - 460, 0, 163, 162, 164, 0, 0, 154, 152, 151, - 0, 153, 157, 158, 159, 160, 161, 428, 0, 0, - 0, 163, 162, 164, 0, 0, 154, 152, 151, 0, - 153, 157, 158, 159, 160, 161, 418, 163, 162, 164, - 0, 0, 154, 0, 152, 151, 0, 153, 157, 158, - 159, 160, 161, 0, 181, 0, 0, 163, 162, 164, - 0, 0, 154, 152, 151, 0, 153, 157, 158, 159, - 160, 161, 150, 163, 162, 164, 35, 0, 154, 152, - 151, 31, 153, 157, 158, 159, 160, 161, 415, 162, - 164, 17, 0, 154, 18, 0, 0, 0, 0, 152, - 151, 0, 153, 157, 158, 159, 160, 161, 0, 35, - 0, 0, 0, 0, 31, 152, 151, 0, 153, 157, - 158, 159, 160, 161, 17, 0, 0, 18, 0, 0, - 152, 151, 0, 153, 157, 158, 159, 160, 161, 33, - 0, 268, 0, 29, 0, 0, 0, 0, 0, 23, - 0, 0, 27, 24, 25, 26, 301, 0, 302, 303, - 304, 299, 483, 484, 297, 21, 22, 269, 270, 30, - 32, 19, 33, 0, 28, 0, 29, 0, 0, 0, - 0, 0, 23, 0, 0, 27, 24, 25, 26, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 21, 22, - 0, 0, 30, 32, 19, + 38, 2, 322, 90, 122, 40, 41, 42, 43, 44, + 45, 46, 87, 21, 168, 21, 268, 491, 380, 404, + 505, 409, 61, 62, 63, 521, 382, 285, 64, 66, + 67, 68, 114, 390, 86, 35, 208, 35, 37, 1, + 293, 334, 200, 219, 215, 302, 157, 373, 199, 300, + 96, 94, 130, 127, 127, 138, 17, 254, 17, 141, + 139, 140, 410, 112, 420, 113, 52, 146, 147, 148, + 78, 201, 351, 149, 58, 211, 125, 316, 39, 169, + 117, 462, 305, 446, 306, 307, 308, 303, 321, 170, + 301, 169, 169, 444, 121, 47, 434, 166, 403, 346, + 156, 385, 99, 185, 376, 185, 179, 165, 164, 166, + 319, 196, 156, 188, 142, 535, 433, 187, 534, 533, + 504, 126, 126, 189, 290, 482, 475, 129, 194, 76, + 111, 197, 127, 116, 474, 127, 473, 154, 153, 221, + 155, 159, 160, 161, 162, 163, 175, 53, 464, 154, + 153, 304, 155, 159, 160, 161, 162, 163, 461, 386, + 457, 445, 39, 153, 439, 21, 159, 160, 161, 162, + 163, 415, 516, 253, 150, 151, 402, 34, 347, 65, + 210, 161, 162, 163, 252, 270, 222, 35, 275, 167, + 34, 233, 513, 65, 65, 259, 21, 221, 172, 296, + 127, 178, 298, 237, 510, 370, 309, 359, 17, 213, + 214, 127, 204, 206, 77, 231, 47, 227, 35, 291, + 277, 190, 159, 160, 161, 162, 163, 323, 326, 296, + 296, 357, 259, 331, 323, 218, 299, 289, 355, 17, + 267, 280, 223, 228, 256, 230, 182, 55, 186, 276, + 55, 121, 143, 234, 235, 236, 311, 278, 158, 243, + 244, 245, 246, 247, 248, 249, 345, 277, 126, 279, + 349, 270, 362, 297, 366, 367, 258, 261, 315, 369, + 317, 318, 21, 497, 371, 323, 364, 324, 339, 338, + 529, 328, 284, 288, 476, 296, 333, 53, 335, 49, + 466, 50, 229, 48, 35, 55, 325, 145, 127, 314, + 531, 519, 93, 361, 394, 432, 166, 481, 468, 104, + 106, 92, 424, 221, 400, 17, 3, 418, 363, 326, + 368, 414, 296, 416, 417, 281, 257, 508, 340, 431, + 342, 507, 341, 509, 343, 344, 384, 389, 395, 21, + 337, 388, 435, 393, 336, 412, 173, 353, 176, 174, + 508, 257, 144, 352, 399, 354, 337, 539, 530, 502, + 270, 35, 365, 467, 428, 421, 429, 419, 430, 401, + 221, 21, 137, 372, 34, 437, 488, 443, 375, 296, + 81, 127, 17, 381, 136, 266, 127, 107, 263, 166, + 55, 427, 262, 35, 442, 184, 458, 323, 54, 212, + 295, 296, 296, 456, 265, 264, 137, 465, 181, 218, + 289, 447, 440, 452, 17, 105, 448, 180, 239, 133, + 450, 495, 238, 240, 391, 454, 478, 422, 480, 34, + 327, 329, 242, 241, 132, 133, 134, 453, 255, 21, + 296, 451, 425, 479, 392, 127, 387, 127, 381, 109, + 381, 441, 381, 487, 283, 192, 326, 537, 501, 378, + 379, 35, 398, 490, 193, 233, 288, 397, 313, 123, + 413, 498, 21, 411, 499, 305, 449, 306, 307, 308, + 57, 177, 17, 21, 494, 56, 496, 455, 120, 127, + 65, 517, 135, 518, 35, 506, 383, 511, 503, 270, + 524, 463, 485, 486, 515, 35, 526, 323, 310, 205, + 21, 292, 205, 470, 522, 17, 471, 520, 65, 54, + 472, 538, 483, 536, 270, 320, 17, 232, 514, 124, + 542, 195, 35, 383, 209, 21, 198, 381, 131, 540, + 224, 225, 541, 207, 115, 36, 330, 60, 332, 226, + 477, 65, 65, 17, 260, 260, 119, 35, 65, 103, + 104, 106, 128, 107, 108, 36, 59, 65, 103, 104, + 106, 95, 107, 108, 36, 91, 137, 10, 17, 9, + 8, 381, 512, 405, 406, 407, 408, 7, 205, 6, + 295, 294, 54, 5, 54, 54, 4, 350, 523, 171, + 83, 216, 65, 103, 104, 106, 217, 107, 108, 36, + 203, 202, 459, 460, 528, 527, 97, 100, 82, 85, + 260, 101, 260, 260, 79, 109, 100, 84, 80, 98, + 101, 484, 377, 287, 109, 286, 118, 34, 98, 102, + 282, 191, 396, 260, 356, 358, 360, 312, 102, 51, + 110, 383, 16, 165, 164, 166, 271, 15, 156, 110, + 88, 100, 69, 14, 13, 101, 105, 220, 12, 109, + 89, 260, 137, 98, 137, 105, 137, 11, 269, 89, + 0, 0, 0, 102, 165, 205, 166, 438, 0, 156, + 0, 0, 0, 0, 110, 154, 153, 0, 155, 159, + 160, 161, 162, 163, 0, 250, 251, 165, 164, 166, + 105, 348, 156, 0, 89, 0, 0, 0, 65, 103, + 104, 106, 0, 107, 108, 36, 154, 153, 0, 155, + 159, 160, 161, 162, 163, 0, 260, 0, 260, 0, + 260, 103, 104, 106, 0, 107, 108, 0, 0, 154, + 153, 374, 155, 159, 160, 161, 162, 163, 0, 0, + 251, 0, 489, 0, 0, 0, 0, 0, 205, 165, + 164, 166, 0, 205, 156, 0, 0, 100, 375, 0, + 0, 101, 0, 500, 0, 109, 0, 0, 305, 98, + 306, 307, 308, 303, 492, 493, 301, 0, 0, 102, + 72, 73, 0, 0, 0, 0, 0, 109, 260, 0, + 110, 154, 153, 0, 155, 159, 160, 161, 162, 163, + 0, 0, 0, 0, 0, 260, 105, 525, 0, 0, + 89, 0, 205, 0, 205, 165, 164, 166, 0, 0, + 156, 0, 0, 0, 165, 164, 166, 0, 105, 156, + 532, 0, 0, 165, 164, 166, 0, 0, 156, 469, + 70, 71, 74, 75, 0, 0, 0, 0, 436, 260, + 0, 0, 0, 0, 0, 0, 205, 154, 153, 0, + 155, 159, 160, 161, 162, 163, 154, 153, 0, 155, + 159, 160, 161, 162, 163, 154, 153, 0, 155, 159, + 160, 161, 162, 163, 165, 164, 166, 0, 0, 156, + 0, 0, 0, 165, 164, 166, 0, 0, 156, 426, + 0, 0, 165, 164, 166, 0, 0, 156, 0, 0, + 183, 165, 164, 166, 0, 0, 156, 152, 0, 0, + 423, 164, 166, 0, 0, 156, 154, 153, 0, 155, + 159, 160, 161, 162, 163, 154, 153, 0, 155, 159, + 160, 161, 162, 163, 154, 153, 0, 155, 159, 160, + 161, 162, 163, 154, 153, 0, 155, 159, 160, 161, + 162, 163, 154, 153, 0, 155, 159, 160, 161, 162, + 163, 36, 0, 0, 0, 0, 32, 305, 36, 306, + 307, 308, 303, 32, 0, 301, 18, 0, 0, 19, + 0, 0, 0, 18, 0, 0, 19, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 34, 0, 272, 0, 30, 0, + 0, 34, 0, 29, 24, 30, 0, 28, 25, 26, + 27, 24, 0, 0, 28, 25, 26, 27, 0, 0, + 22, 23, 273, 274, 31, 33, 20, 22, 23, 0, + 0, 31, 33, 20, } var yyPact = [...]int{ - 958, -1000, 958, -51, -51, -51, -51, -51, -51, -51, - -51, -1000, -1000, -1000, -1000, -1000, 104, 425, 415, 530, - -51, -51, -51, 538, 538, 538, 538, 472, 727, 727, - -51, 526, 727, 437, 105, -1000, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, -1000, 399, 489, 538, 521, - 516, 394, 251, -1000, 248, 538, 538, -51, 9, 113, - -1000, -1000, -1000, 148, -1000, -51, -51, -51, 538, -1000, - -1000, -1000, -1000, 727, 727, 852, -1000, -1000, -1000, -1000, - -1000, -1000, -1000, -1000, -1000, 105, -1000, -1000, 633, -34, - -1000, -1000, -1000, -1000, -1000, -1000, -1000, 727, 134, 77, - 727, 538, -1000, -1000, 188, -1000, -1000, -1000, -1000, 74, - 832, 284, -5, -1000, 87, 511, -1000, 4, 538, -1000, - 727, 350, 375, 538, 506, 2, 515, 101, 518, 474, - 101, 294, 294, 294, 593, -1000, 47, 96, 73, 438, - -1000, 530, 727, 143, -1000, -1000, -1000, 476, 868, 868, - 958, 727, 727, 727, 268, 299, 317, 727, 727, 727, - 727, 727, 727, 727, -1000, 540, 46, 538, 251, 217, - 868, 63, 63, 283, 311, -1000, 654, 264, -1000, -1000, - 251, 925, 538, 529, 414, -1000, 437, 120, 868, 348, - 727, 727, 97, 538, 538, -1000, 538, 474, 38, -1000, - 480, -1000, -1000, -1000, -1000, 101, 396, 727, -1000, 96, - -1000, 96, 96, -1000, -4, 455, 868, -1000, -1000, -44, - -1000, 538, 181, 169, 538, -1000, 868, 248, 529, 224, - 25, -14, -14, 327, 727, 63, 727, 63, 63, 53, - 53, -1000, -1000, -1000, 562, 654, -1000, 727, -1000, -1000, - 45, 688, 225, 727, -1000, 633, -1000, -1000, 63, 72, - 71, 70, 268, 399, 201, 925, -1000, -1000, 727, -51, - -51, 205, -1000, -7, -51, -1000, 66, 538, -1000, 727, - 744, -1000, -8, 357, 868, -1000, 63, 538, -1000, 516, - -15, 59, -49, -1000, -1000, -1000, 342, 429, 309, 340, - 101, -1000, -1000, -1000, -1000, -1000, 538, 474, 391, 366, - 868, 302, -1000, -1000, 302, 593, 538, 251, 44, -22, - 522, 538, 407, -1000, 538, 402, -51, -51, 200, 224, - 958, 727, -1000, -1000, 883, -1000, -14, -1000, -1000, -1000, - 722, -1000, -1000, -1000, 175, 217, 727, 816, 273, 86, - -1000, 86, -1000, 86, -1000, 210, -9, 230, -1000, 797, - -1000, -1000, 925, -1000, 248, 41, 868, -1000, 249, 319, - 727, 258, -1000, -1000, -1000, -35, 40, -41, 474, 538, - 727, 101, 336, 309, 335, -1000, 101, -1000, -1000, -1000, - -1000, 727, 727, -1000, -1000, 37, -1000, 538, -1000, -1000, - -1000, 538, 538, 33, -42, 727, 30, 538, -1000, -1000, - 244, 168, 234, -1000, 780, 727, -1000, 868, 727, 63, - 29, 28, 27, -1000, 137, -1000, 528, -51, 925, 159, - 17, 447, -1000, -1000, -1000, 485, 63, 300, 538, -1000, - -1000, 868, 967, 101, 321, 101, 531, 868, -1000, 127, - -1000, -1000, -1000, 522, 538, 868, -1000, -1000, -51, 243, - 958, 654, 868, -1000, -1000, -1000, -1000, -1000, 16, -1000, - 222, 958, 229, -1000, 65, -1000, -1000, -1000, -1000, 63, - -1000, -1000, -1000, 727, 58, 531, 101, 967, 54, -1000, - -1000, -1000, -51, -1000, -1000, 157, 222, 925, 727, -51, - 248, -1000, 868, 538, 531, -1000, 130, -1000, 242, 156, - 232, -1000, 761, -1000, 13, 12, 11, 399, 361, -51, - 237, 925, -1000, -1000, -1000, -1000, 727, -1000, -51, -1000, - -1000, -1000, + 997, -1000, 997, -42, -42, -42, -42, -42, -42, -42, + -42, -1000, -1000, -1000, -1000, -1000, -1000, 284, 465, 460, + 546, -42, -42, -42, 557, 557, 557, 557, 779, 724, + 724, -42, 542, 724, 473, 142, -1000, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, -1000, 441, 519, 557, + 558, 534, 386, 321, -1000, 310, 557, 557, -42, -4, + 143, -1000, -1000, -1000, 277, -1000, -42, -42, -42, 557, + -1000, -1000, -1000, -1000, 724, 724, 867, -1000, -1000, -1000, + -1000, -1000, -1000, -1000, -1000, -1000, 142, -1000, -1000, 573, + -27, -1000, -1000, -1000, -1000, -1000, -1000, -1000, 724, 249, + 131, 724, 557, -1000, -1000, 313, -1000, -1000, -1000, -1000, + 130, 858, 341, -15, -1000, 138, 42, -1000, -5, 557, + -1000, 724, 421, 433, 557, 525, -7, 524, 189, 539, + 526, 189, 348, 348, 348, 564, -1000, 69, 134, 126, + 523, -1000, 546, 724, 216, 129, -1000, -1000, -1000, 517, + 876, 876, 997, 724, 724, 724, 332, 364, 381, 724, + 724, 724, 724, 724, 724, 724, -1000, 598, 67, 557, + 321, 257, 876, 79, 79, 334, 353, -1000, 30, 325, + -1000, -1000, 321, 990, 557, 544, 746, -1000, 473, 219, + 876, 419, 724, 724, 103, 557, 557, -1000, 557, 526, + 33, -1000, 496, -1000, -1000, -1000, -1000, 189, 439, 724, + -1000, 134, -1000, 134, 134, -1000, -8, 513, 876, -1000, + -1000, -28, -1000, 557, 190, 175, 557, -1000, 876, 310, + 557, 310, 544, 273, 111, 55, 55, 388, 724, 79, + 724, 79, 79, 68, 68, -1000, -1000, -1000, 629, 30, + -1000, 724, -1000, -1000, 61, 608, 282, 724, -1000, 573, + -1000, -1000, 79, 122, 115, 91, 332, 441, 245, 990, + -1000, -1000, 724, -42, -42, 248, -1000, -13, -42, -1000, + 89, 557, -1000, 724, 714, -1000, -14, 427, 876, -1000, + 79, 557, -1000, 534, -17, 49, -40, -1000, -1000, -1000, + 408, 436, 384, 406, 189, -1000, -1000, -1000, -1000, -1000, + 557, 526, 437, 431, 876, 370, -1000, -1000, 370, 564, + 557, 321, 59, -20, 562, 557, 448, -1000, 557, 443, + -42, 54, -42, -42, 244, 273, 997, 724, -1000, -1000, + 885, -1000, 55, -1000, -1000, -1000, 652, -1000, -1000, -1000, + 239, 257, 724, 849, 336, 116, -1000, 116, -1000, 116, + -1000, 251, -1, 274, -1000, 798, -1000, -1000, 990, -1000, + 310, 47, 876, -1000, 314, 415, 724, 315, -1000, -1000, + -1000, -25, 44, -35, 526, 557, 724, 189, 403, 384, + 399, -1000, 189, -1000, -1000, -1000, -1000, 724, 724, -1000, + -1000, 43, -1000, 557, -1000, -1000, -1000, 557, 557, 41, + -37, 724, 31, 557, -1000, 214, -1000, -1000, 297, 235, + 289, -1000, 789, 724, -1000, 876, 724, 79, 19, 17, + 9, -1000, 199, -1000, 555, -42, 990, 234, 8, 510, + -1000, -1000, -1000, 481, 79, 365, 557, -1000, -1000, 876, + 749, 189, 383, 189, 958, 876, -1000, 184, -1000, -1000, + -1000, 562, 557, 876, -1000, -1000, 310, -42, 293, 997, + 30, 876, -1000, -1000, -1000, -1000, -1000, 3, -1000, 260, + 997, 265, -1000, 88, -1000, -1000, -1000, -1000, 79, -1000, + -1000, -1000, 724, 76, 958, 189, 749, 56, -1000, -1000, + -42, -1000, -42, -1000, -1000, 228, 260, 990, 724, -42, + 310, -1000, 876, 557, 958, -1000, 192, -1000, -1000, 292, + 227, 283, -1000, 780, -1000, 2, 1, -2, 441, 426, + -42, 291, 990, -1000, -1000, -1000, -1000, 724, -1000, -42, + -1000, -1000, -1000, } var yyPgo = [...]int{ - 0, 27, 12, 1, 691, 690, 686, 684, 682, 681, - 680, 679, 671, 86, 61, 79, 667, 42, 36, 666, - 665, 13, 663, 39, 662, 60, 661, 63, 84, 172, - 102, 208, 35, 38, 659, 649, 646, 641, 333, 636, - 635, 633, 630, 617, 34, 616, 46, 615, 614, 57, - 613, 4, 612, 26, 609, 608, 596, 591, 590, 37, - 20, 53, 62, 3, 41, 65, 589, 579, 573, 25, - 570, 568, 567, 59, 2, 33, 559, 557, 43, 40, - 18, 16, 24, 550, 224, 210, 56, 549, 52, 14, - 47, 29, 548, 64, 376, 54, 55, 19, 45, 71, - 544, 227, 0, + 0, 38, 16, 1, 688, 687, 678, 674, 673, 672, + 670, 667, 666, 662, 326, 77, 66, 659, 52, 36, + 657, 652, 4, 651, 47, 650, 55, 646, 80, 70, + 214, 99, 102, 18, 27, 645, 643, 642, 641, 390, + 638, 637, 634, 629, 628, 57, 626, 43, 625, 624, + 71, 621, 42, 620, 17, 616, 611, 610, 609, 607, + 26, 14, 48, 76, 2, 44, 72, 606, 603, 601, + 40, 599, 597, 590, 62, 21, 19, 589, 587, 64, + 41, 25, 20, 3, 585, 321, 312, 51, 581, 50, + 34, 63, 12, 576, 74, 448, 46, 49, 33, 45, + 75, 566, 258, 0, } var yyR1 = [...]int{ 0, 1, 1, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, - 5, 5, 6, 6, 7, 7, 7, 7, 7, 8, - 8, 8, 8, 8, 8, 8, 9, 9, 10, 10, - 10, 10, 10, 11, 11, 11, 11, 12, 12, 13, - 14, 14, 14, 14, 15, 15, 16, 17, 17, 18, - 18, 19, 19, 20, 20, 21, 21, 22, 22, 22, - 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, - 28, 28, 28, 28, 28, 28, 29, 29, 30, 30, - 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, - 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, - 35, 36, 36, 36, 37, 37, 38, 39, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 41, 41, 41, - 41, 41, 42, 42, 42, 43, 43, 44, 44, 44, - 45, 45, 46, 47, 48, 48, 49, 49, 49, 50, - 50, 51, 51, 51, 51, 51, 51, 52, 52, 52, - 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, - 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, - 61, 62, 62, 63, 63, 64, 64, 65, 65, 66, - 66, 66, 66, 67, 68, 69, 69, 70, 70, 71, - 72, 72, 73, 73, 74, 74, 75, 75, 75, 75, - 75, 76, 76, 77, 78, 78, 79, 79, 80, 80, - 81, 81, 82, 83, 84, 84, 85, 85, 86, 87, - 88, 89, 90, 90, 91, 92, 92, 93, 93, 94, - 94, 95, 95, 96, 96, 97, 97, 98, 98, 98, - 98, 99, 99, 100, 100, 101, 101, 102, 102, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, + 4, 5, 5, 6, 6, 7, 7, 7, 7, 7, + 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, + 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, + 12, 13, 13, 14, 15, 15, 15, 15, 16, 16, + 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, + 22, 23, 23, 23, 24, 24, 25, 25, 26, 26, + 27, 27, 28, 28, 29, 29, 29, 29, 29, 29, + 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 32, 32, 33, 33, 34, + 34, 35, 35, 36, 36, 37, 37, 37, 38, 38, + 39, 40, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 41, 42, 42, 42, 42, 42, 43, 43, 43, 44, + 44, 45, 45, 45, 46, 46, 47, 48, 49, 49, + 50, 50, 50, 51, 51, 52, 52, 52, 52, 52, + 52, 53, 53, 53, 53, 53, 54, 54, 54, 55, + 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, + 60, 61, 61, 62, 62, 63, 63, 64, 64, 65, + 65, 66, 66, 67, 67, 67, 67, 68, 69, 70, + 70, 71, 71, 72, 73, 73, 74, 74, 75, 75, + 76, 76, 76, 76, 76, 77, 77, 78, 79, 79, + 80, 80, 81, 81, 82, 82, 83, 84, 85, 85, + 86, 86, 87, 88, 89, 90, 91, 91, 92, 93, + 93, 94, 94, 95, 95, 96, 96, 97, 97, 98, + 98, 99, 99, 99, 99, 100, 100, 101, 101, 102, + 102, 103, 103, } var yyR2 = [...]int{ 0, 0, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 3, 2, 2, 2, 6, 3, 3, 3, 6, 0, - 1, 1, 1, 1, 2, 2, 5, 6, 8, 9, - 7, 9, 2, 8, 9, 2, 2, 5, 3, 5, - 5, 4, 4, 4, 1, 1, 3, 0, 2, 0, - 2, 0, 3, 0, 2, 0, 3, 0, 3, 4, - 0, 2, 0, 2, 0, 2, 6, 9, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 3, 1, 1, 3, 1, 3, 2, 4, 1, - 1, 0, 1, 1, 1, 1, 3, 3, 3, 3, - 3, 3, 4, 4, 6, 6, 4, 6, 4, 4, - 4, 6, 4, 4, 6, 4, 2, 3, 3, 3, - 3, 3, 3, 3, 2, 4, 1, 0, 2, 2, - 5, 7, 8, 2, 0, 3, 1, 2, 3, 1, - 1, 1, 1, 2, 3, 1, 1, 5, 5, 6, - 6, 4, 0, 2, 4, 1, 1, 1, 1, 3, - 5, 0, 1, 0, 2, 1, 3, 1, 3, 1, - 3, 1, 3, 1, 3, 1, 3, 4, 2, 6, - 9, 5, 8, 7, 3, 1, 3, 5, 6, 6, - 6, 8, 1, 3, 1, 3, 0, 1, 1, 2, - 2, 5, 7, 7, 4, 2, 0, 2, 4, 2, - 0, 2, 1, 1, 1, 2, 1, 2, 1, 1, - 1, 1, 1, 3, 3, 1, 3, 1, 3, 0, - 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, - 1, 0, 1, 0, 1, 1, 1, 0, 1, + 1, 3, 2, 2, 2, 6, 3, 3, 3, 6, + 6, 9, 6, 0, 1, 1, 1, 1, 2, 2, + 5, 6, 8, 9, 7, 9, 2, 8, 9, 2, + 2, 5, 3, 5, 5, 4, 4, 4, 1, 1, + 3, 0, 2, 0, 2, 0, 3, 0, 2, 0, + 3, 0, 3, 4, 0, 2, 0, 2, 0, 2, + 6, 9, 1, 3, 1, 1, 1, 1, 1, 1, + 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 3, 1, 1, 3, 1, + 3, 2, 4, 1, 1, 0, 1, 1, 1, 1, + 3, 3, 3, 3, 3, 3, 4, 4, 6, 6, + 4, 6, 4, 4, 4, 6, 4, 4, 6, 4, + 2, 3, 3, 3, 3, 3, 3, 3, 2, 4, + 1, 0, 2, 2, 5, 7, 8, 2, 0, 3, + 1, 2, 3, 1, 1, 1, 1, 2, 3, 1, + 1, 5, 5, 6, 6, 4, 0, 2, 4, 1, + 1, 1, 1, 3, 5, 0, 1, 0, 2, 1, + 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, + 3, 4, 2, 6, 9, 5, 8, 7, 3, 1, + 3, 5, 6, 6, 6, 8, 1, 3, 1, 3, + 0, 1, 1, 2, 2, 5, 7, 7, 4, 2, + 0, 2, 4, 2, 0, 2, 1, 1, 1, 2, + 1, 2, 1, 1, 1, 1, 1, 3, 3, 1, + 3, 1, 3, 0, 1, 0, 1, 0, 1, 0, + 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, + 1, 0, 1, } var yyChk = [...]int{ - -1000, -1, -3, -13, -66, -67, -70, -71, -72, -76, - -77, -5, -6, -7, -10, -12, -25, 26, 29, 106, - -91, 100, 101, 84, 88, 89, 90, 87, 76, 78, - 104, 16, 105, 74, -89, 11, -1, -102, 120, -102, - -102, -102, -102, -102, -102, -102, -14, 19, 15, 17, - -16, -15, 13, -38, 116, 30, 30, -93, -92, 11, - -102, -102, -102, -82, 4, -82, -82, -82, -8, 91, - 92, 31, 32, 93, 94, -30, -29, -28, -41, -39, - -38, -43, -56, -40, -42, -89, -91, -9, 116, -82, - -83, -84, -85, -86, -87, -88, -45, 75, -31, 63, - 67, 85, 5, 6, 112, 7, 9, 10, 71, 96, - -30, -90, -89, -102, 12, -30, -27, -26, -100, 25, - 109, -21, 38, 20, -62, -49, -82, 14, -62, -17, - 14, 58, 59, 60, -94, 73, -13, -25, -82, -82, - -102, 118, 109, 85, -102, -102, -102, -82, -30, -30, - 80, 108, 107, 110, 70, -95, -101, 111, 112, 113, - 114, 115, 66, 65, 67, -30, -60, 119, 116, -57, - -30, 107, 110, -95, -101, -38, -30, -82, -84, -85, - 116, 82, 64, 118, 110, -102, 118, -82, -30, -22, - 44, 41, -82, 16, 118, -82, 22, -61, -51, -49, - -50, -52, 23, -38, 24, 14, -18, 18, -61, -99, - 61, -99, -99, -64, -55, -54, -30, -46, 113, -82, - 117, 116, 27, 28, 36, -93, -30, 86, 20, -1, - -30, -30, -30, -95, 68, 64, 69, 62, 61, -30, - -30, -30, -30, -30, -30, -30, 117, 118, 117, -82, - -44, -94, -65, 79, -31, 116, -38, -31, 68, 64, - 62, 61, 70, -44, -2, -4, -3, -11, 76, 102, - 103, -82, -90, -89, -28, -27, 22, 116, -24, 45, - -30, -33, -34, -35, -30, -46, 21, 116, -13, -69, - -68, -29, -82, -62, -82, -18, -96, 57, -98, 54, - 118, 49, 51, 52, 53, -82, 22, -61, -19, 39, - -30, -15, -14, -15, -15, 118, 22, 116, -63, -82, - -73, 116, -82, -29, 116, -29, -13, -90, -79, -78, - 81, 77, -86, -88, -30, -31, -30, -31, -31, -60, - -30, 117, 113, -60, -58, -65, 81, -30, -31, 116, - -38, 116, -38, 116, -38, -95, -21, 83, -2, -30, - -102, -102, 82, -102, 116, -63, -30, -23, 47, 74, - 118, -36, 42, 43, -32, -31, -59, -29, -17, 118, - 110, 48, -96, -98, -97, 50, 48, -61, -82, -18, - -20, 40, 41, -64, -82, -44, 117, 118, -75, 31, - 32, 33, 34, -74, -73, 35, -59, 37, -102, -102, - 83, -79, -78, -1, -30, 65, 83, -30, 80, 65, - -32, -32, -32, 88, 64, 117, 97, 78, 80, -2, - -13, 117, -23, 46, -33, 72, 118, 117, 118, -18, - -69, -30, -51, 48, -97, 48, -51, -30, -60, 117, - -63, -29, -29, 117, 118, -30, 117, -82, 76, 83, - 80, -30, -30, -31, 117, 117, 117, 95, 5, -102, - -2, -3, 83, 117, 22, -37, 31, 32, -32, 21, - -13, -59, -53, 55, 56, -51, 48, -51, 99, -75, - -74, -102, 76, -1, 117, -81, -80, 81, 77, 78, - 116, -32, -30, 116, -51, -53, 116, -102, 83, -81, - -80, -2, -30, -102, -13, -63, -47, -48, 98, 76, - 83, 80, 117, 117, 117, -21, 41, -102, 76, -2, - -60, -102, + -1000, -1, -3, -14, -67, -68, -71, -72, -73, -77, + -78, -5, -6, -7, -8, -11, -13, -26, 26, 29, + 106, -92, 100, 101, 84, 88, 89, 90, 87, 76, + 78, 104, 16, 105, 74, -90, 11, -1, -103, 120, + -103, -103, -103, -103, -103, -103, -103, -15, 19, 15, + 17, -17, -16, 13, -39, 116, 30, 30, -94, -93, + 11, -103, -103, -103, -83, 4, -83, -83, -83, -9, + 91, 92, 31, 32, 93, 94, -31, -30, -29, -42, + -40, -39, -44, -57, -41, -43, -90, -92, -10, 116, + -83, -84, -85, -86, -87, -88, -89, -46, 75, -32, + 63, 67, 85, 5, 6, 112, 7, 9, 10, 71, + 96, -31, -91, -90, -103, 12, -31, -28, -27, -101, + 25, 109, -22, 38, 20, -63, -50, -83, 14, -63, + -18, 14, 58, 59, 60, -95, 73, -14, -26, -83, + -83, -103, 118, 109, 85, 30, -103, -103, -103, -83, + -31, -31, 80, 108, 107, 110, 70, -96, -102, 111, + 112, 113, 114, 115, 66, 65, 67, -31, -61, 119, + 116, -58, -31, 107, 110, -96, -102, -39, -31, -83, + -85, -86, 116, 82, 64, 118, 110, -103, 118, -83, + -31, -23, 44, 41, -83, 16, 118, -83, 22, -62, + -52, -50, -51, -53, 23, -39, 24, 14, -19, 18, + -62, -100, 61, -100, -100, -65, -56, -55, -31, -47, + 113, -83, 117, 116, 27, 28, 36, -94, -31, 86, + 116, 86, 20, -1, -31, -31, -31, -96, 68, 64, + 69, 62, 61, -31, -31, -31, -31, -31, -31, -31, + 117, 118, 117, -83, -45, -95, -66, 79, -32, 116, + -39, -32, 68, 64, 62, 61, 70, -45, -2, -4, + -3, -12, 76, 102, 103, -83, -91, -90, -29, -28, + 22, 116, -25, 45, -31, -34, -35, -36, -31, -47, + 21, 116, -14, -70, -69, -30, -83, -63, -83, -19, + -97, 57, -99, 54, 118, 49, 51, 52, 53, -83, + 22, -62, -20, 39, -31, -16, -15, -16, -16, 118, + 22, 116, -64, -83, -74, 116, -83, -30, 116, -30, + -14, -64, -14, -91, -80, -79, 81, 77, -87, -89, + -31, -32, -31, -32, -32, -61, -31, 117, 113, -61, + -59, -66, 81, -31, -32, 116, -39, 116, -39, 116, + -39, -96, -22, 83, -2, -31, -103, -103, 82, -103, + 116, -64, -31, -24, 47, 74, 118, -37, 42, 43, + -33, -32, -60, -30, -18, 118, 110, 48, -97, -99, + -98, 50, 48, -62, -83, -19, -21, 40, 41, -65, + -83, -45, 117, 118, -76, 31, 32, 33, 34, -75, + -74, 35, -60, 37, -103, 117, -103, -103, 83, -80, + -79, -1, -31, 65, 83, -31, 80, 65, -33, -33, + -33, 88, 64, 117, 97, 78, 80, -2, -14, 117, + -24, 46, -34, 72, 118, 117, 118, -19, -70, -31, + -52, 48, -98, 48, -52, -31, -61, 117, -64, -30, + -30, 117, 118, -31, 117, -83, 86, 76, 83, 80, + -31, -31, -32, 117, 117, 117, 95, 5, -103, -2, + -3, 83, 117, 22, -38, 31, 32, -33, 21, -14, + -60, -54, 55, 56, -52, 48, -52, 99, -76, -75, + -14, -103, 76, -1, 117, -82, -81, 81, 77, 78, + 116, -33, -31, 116, -52, -54, 116, -103, -103, 83, + -82, -81, -2, -31, -103, -14, -64, -48, -49, 98, + 76, 83, 80, 117, 117, 117, -22, 41, -103, 76, + -2, -61, -103, } var yyDef = [...]int{ - -2, -2, -2, 267, 267, 267, 267, 267, 267, 267, - 267, 13, 14, 15, 16, 17, 0, 0, 0, 0, - 267, 267, 267, 0, 0, 0, 0, 29, 0, 0, - 267, 0, 0, 263, 0, 241, 2, 5, 268, 6, - 7, 8, 9, 10, 11, 12, -2, 0, 0, 0, - 57, 0, 249, 55, 74, 0, 0, 267, 247, 245, - 21, 22, 23, 0, 232, 267, 267, 267, 0, 30, - 31, 32, 33, 0, 0, 251, 88, 89, 90, 91, - 92, 93, 94, 95, 96, 97, 98, 99, 74, 86, - 80, 81, 82, 83, 84, 85, 146, 181, 251, 0, - 0, 0, 233, 234, 0, 236, 238, 239, 240, 0, - 251, 0, 97, 42, 0, -2, 75, 78, 0, 264, - 0, 67, 0, 0, 0, 191, 156, 0, 0, 59, - 0, 261, 261, 261, 0, 250, 0, 0, 0, 0, - 20, 0, 0, 0, 25, 26, 27, 0, -2, -2, - -2, 0, 265, 266, 251, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 252, 251, 0, 0, -2, 0, - -2, 265, 266, 0, 0, 136, 144, 0, 235, 237, - -2, -2, 0, 0, 0, 48, 263, 0, 244, 72, - 0, 0, 74, 0, 0, 157, 0, 59, -2, 161, - 162, 165, 166, 159, 160, 0, 61, 0, 58, 0, - 262, 0, 0, 56, 195, 178, -2, 176, 177, 86, - 116, 0, 0, 0, 0, 248, -2, 74, 0, 226, - 117, -2, -2, 0, 0, 0, 0, 0, 0, 137, - 138, 139, 140, 141, 142, 143, 100, 0, 101, 87, - 0, 0, 183, 0, 119, 74, 102, 121, 0, 0, - 0, 0, 251, 65, 0, -2, 18, 19, 0, 267, - 267, 0, 243, 242, 267, 79, 0, 0, 49, 0, - -2, 66, 105, 111, -2, 110, 0, 0, 201, 57, - 205, 0, 86, 192, 158, 207, 0, -2, 255, 0, - 0, 254, 258, 259, 260, 163, 0, 59, 63, 0, - -2, 51, 54, 52, 53, 0, 0, -2, 0, 193, - 216, 0, 212, 221, 0, 0, 267, 267, 0, 226, - -2, 0, 122, 123, 251, 126, -2, 130, 133, 188, - -2, 145, 148, 149, 0, 198, 0, 251, 0, 74, - 128, 74, 132, 74, 135, 0, 0, 0, 4, 251, - 45, 46, -2, 47, 74, 0, -2, 68, 70, 0, - 0, 107, 112, 113, 199, 103, 0, 185, 59, 0, - 0, 0, 0, 255, 0, 256, 0, 190, 164, 208, - 50, 0, 0, 196, 179, 0, 209, 0, 210, 217, - 218, 0, 0, 0, 214, 0, 0, 0, 24, 28, - 0, 0, 225, 227, 251, 0, 180, -2, 0, 0, - 0, 0, 0, 36, 0, 150, 0, 267, -2, 0, - 0, 0, 69, 71, 106, 0, 0, 74, 0, 203, - 206, -2, 172, 0, 0, 0, 171, -2, 62, 145, - 194, 219, 220, 216, 0, -2, 222, 223, 267, 0, - -2, 124, -2, 125, 127, 131, 134, 37, 0, 40, - 230, -2, 0, 76, 0, 108, 114, 115, 104, 0, - 202, 186, 167, 0, 0, 168, 0, 172, 0, 211, - 215, 38, 267, 224, 151, 0, 230, -2, 0, 267, - 74, 200, -2, 0, 170, 169, 154, 39, 0, 0, - 229, 231, 251, 41, 0, 0, 0, 65, 0, 267, - 0, -2, 77, 174, 152, 153, 0, 43, 267, 228, - 155, 44, + -2, -2, -2, 271, 271, 271, 271, 271, 271, 271, + 271, 13, 14, 15, 16, 17, 18, 0, 0, 0, + 0, 271, 271, 271, 0, 0, 0, 0, 33, 0, + 0, 271, 0, 0, 267, 0, 245, 2, 5, 272, + 6, 7, 8, 9, 10, 11, 12, -2, 0, 0, + 0, 61, 0, 253, 59, 78, 0, 0, 271, 251, + 249, 22, 23, 24, 0, 236, 271, 271, 271, 0, + 34, 35, 36, 37, 0, 0, 255, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 78, + 90, 84, 85, 86, 87, 88, 89, 150, 185, 255, + 0, 0, 0, 237, 238, 0, 240, 242, 243, 244, + 0, 255, 0, 101, 46, 0, -2, 79, 82, 0, + 268, 0, 71, 0, 0, 0, 195, 160, 0, 0, + 63, 0, 265, 265, 265, 0, 254, 0, 0, 0, + 0, 21, 0, 0, 0, 0, 26, 27, 28, 0, + -2, -2, -2, 0, 269, 270, 255, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 256, 255, 0, 0, + -2, 0, -2, 269, 270, 0, 0, 140, 148, 0, + 239, 241, -2, -2, 0, 0, 0, 52, 267, 0, + 248, 76, 0, 0, 78, 0, 0, 161, 0, 63, + -2, 165, 166, 169, 170, 163, 164, 0, 65, 0, + 62, 0, 266, 0, 0, 60, 199, 182, -2, 180, + 181, 90, 120, 0, 0, 0, 0, 252, -2, 78, + 0, 78, 0, 230, 121, -2, -2, 0, 0, 0, + 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, + 104, 0, 105, 91, 0, 0, 187, 0, 123, 78, + 106, 125, 0, 0, 0, 0, 255, 69, 0, -2, + 19, 20, 0, 271, 271, 0, 247, 246, 271, 83, + 0, 0, 53, 0, -2, 70, 109, 115, -2, 114, + 0, 0, 205, 61, 209, 0, 90, 196, 162, 211, + 0, -2, 259, 0, 0, 258, 262, 263, 264, 167, + 0, 63, 67, 0, -2, 55, 58, 56, 57, 0, + 0, -2, 0, 197, 220, 0, 216, 225, 0, 0, + 271, 0, 271, 271, 0, 230, -2, 0, 126, 127, + 255, 130, -2, 134, 137, 192, -2, 149, 152, 153, + 0, 202, 0, 255, 0, 78, 132, 78, 136, 78, + 139, 0, 0, 0, 4, 255, 49, 50, -2, 51, + 78, 0, -2, 72, 74, 0, 0, 111, 116, 117, + 203, 107, 0, 189, 63, 0, 0, 0, 0, 259, + 0, 260, 0, 194, 168, 212, 54, 0, 0, 200, + 183, 0, 213, 0, 214, 221, 222, 0, 0, 0, + 218, 0, 0, 0, 25, 30, 32, 29, 0, 0, + 229, 231, 255, 0, 184, -2, 0, 0, 0, 0, + 0, 40, 0, 154, 0, 271, -2, 0, 0, 0, + 73, 75, 110, 0, 0, 78, 0, 207, 210, -2, + 176, 0, 0, 0, 175, -2, 66, 149, 198, 223, + 224, 220, 0, -2, 226, 227, 78, 271, 0, -2, + 128, -2, 129, 131, 135, 138, 41, 0, 44, 234, + -2, 0, 80, 0, 112, 118, 119, 108, 0, 206, + 190, 171, 0, 0, 172, 0, 176, 0, 215, 219, + 271, 42, 271, 228, 155, 0, 234, -2, 0, 271, + 78, 204, -2, 0, 174, 173, 158, 31, 43, 0, + 0, 233, 235, 255, 45, 0, 0, 0, 69, 0, + 271, 0, -2, 81, 178, 156, 157, 0, 47, 271, + 232, 159, 48, } var yyTok1 = [...]int{ @@ -1174,299 +1183,323 @@ yydefault: case 1: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:162 + //line parser.y:163 { yyVAL.program = nil yylex.(*Lexer).program = yyVAL.program } case 2: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:167 + //line parser.y:168 { yyVAL.program = append([]Statement{yyDollar[1].statement}, yyDollar[2].program...) yylex.(*Lexer).program = yyVAL.program } case 3: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:174 + //line parser.y:175 { yyVAL.program = nil yylex.(*Lexer).program = yyVAL.program } case 4: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:179 + //line parser.y:180 { yyVAL.program = append([]Statement{yyDollar[1].statement}, yyDollar[2].program...) yylex.(*Lexer).program = yyVAL.program } case 5: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:186 + //line parser.y:187 { yyVAL.statement = yyDollar[1].expression } case 6: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:190 + //line parser.y:191 { yyVAL.statement = yyDollar[1].expression } case 7: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:194 + //line parser.y:195 { yyVAL.statement = yyDollar[1].expression } case 8: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:198 + //line parser.y:199 { yyVAL.statement = yyDollar[1].expression } case 9: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:202 + //line parser.y:203 { yyVAL.statement = yyDollar[1].expression } case 10: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:206 + //line parser.y:207 { yyVAL.statement = yyDollar[1].expression } case 11: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:210 + //line parser.y:211 { yyVAL.statement = yyDollar[1].expression } case 12: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:214 + //line parser.y:215 { yyVAL.statement = yyDollar[1].expression } case 13: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:218 + //line parser.y:219 { yyVAL.statement = yyDollar[1].statement } case 14: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:222 + //line parser.y:223 { yyVAL.statement = yyDollar[1].statement } case 15: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:226 + //line parser.y:227 { yyVAL.statement = yyDollar[1].statement } case 16: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:230 + //line parser.y:231 { yyVAL.statement = yyDollar[1].statement } case 17: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:234 + //line parser.y:235 { yyVAL.statement = yyDollar[1].statement } case 18: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:240 + //line parser.y:239 { yyVAL.statement = yyDollar[1].statement } case 19: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:244 + //line parser.y:245 { yyVAL.statement = yyDollar[1].statement } case 20: + yyDollar = yyS[yypt-1 : yypt+1] + //line parser.y:249 + { + yyVAL.statement = yyDollar[1].statement + } + case 21: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:250 + //line parser.y:255 { yyVAL.statement = VariableDeclaration{Assignments: yyDollar[2].expressions} } - case 21: + case 22: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:254 + //line parser.y:259 { yyVAL.statement = yyDollar[1].expression } - case 22: + case 23: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:260 + //line parser.y:265 { yyVAL.statement = TransactionControl{Token: yyDollar[1].token.Token} } - case 23: + case 24: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:264 + //line parser.y:269 { yyVAL.statement = TransactionControl{Token: yyDollar[1].token.Token} } - case 24: + case 25: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:270 + //line parser.y:275 { yyVAL.statement = CursorDeclaration{Cursor: yyDollar[2].identifier, Query: yyDollar[5].expression.(SelectQuery)} } - case 25: + case 26: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:274 + //line parser.y:279 { yyVAL.statement = OpenCursor{Cursor: yyDollar[2].identifier} } - case 26: + case 27: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:278 + //line parser.y:283 { yyVAL.statement = CloseCursor{Cursor: yyDollar[2].identifier} } - case 27: + case 28: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:282 + //line parser.y:287 { yyVAL.statement = DisposeCursor{Cursor: yyDollar[2].identifier} } - case 28: + case 29: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:286 + //line parser.y:291 { yyVAL.statement = FetchCursor{Position: yyDollar[2].expression, Cursor: yyDollar[3].identifier, Variables: yyDollar[5].variables} } - case 29: + case 30: + yyDollar = yyS[yypt-6 : yypt+1] + //line parser.y:297 + { + yyVAL.statement = TableDeclaration{Table: yyDollar[2].identifier, Fields: yyDollar[5].expressions} + } + case 31: + yyDollar = yyS[yypt-9 : yypt+1] + //line parser.y:301 + { + yyVAL.statement = TableDeclaration{Table: yyDollar[2].identifier, Fields: yyDollar[5].expressions, Query: yyDollar[8].expression} + } + case 32: + yyDollar = yyS[yypt-6 : yypt+1] + //line parser.y:305 + { + yyVAL.statement = TableDeclaration{Table: yyDollar[2].identifier, Query: yyDollar[5].expression} + } + case 33: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:292 + //line parser.y:311 { yyVAL.expression = nil } - case 30: + case 34: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:296 + //line parser.y:315 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token} } - case 31: + case 35: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:300 + //line parser.y:319 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token} } - case 32: + case 36: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:304 + //line parser.y:323 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token} } - case 33: + case 37: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:308 + //line parser.y:327 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token} } - case 34: + case 38: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:312 + //line parser.y:331 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token, Number: yyDollar[2].expression} } - case 35: + case 39: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:316 + //line parser.y:335 { yyVAL.expression = FetchPosition{Position: yyDollar[1].token, Number: yyDollar[2].expression} } - case 36: + case 40: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:322 + //line parser.y:341 { yyVAL.expression = CursorStatus{CursorLit: yyDollar[1].token.Literal, Cursor: yyDollar[2].identifier, Is: yyDollar[3].token.Literal, Negation: yyDollar[4].token, Type: yyDollar[5].token.Token, TypeLit: yyDollar[5].token.Literal} } - case 37: + case 41: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:326 + //line parser.y:345 { yyVAL.expression = CursorStatus{CursorLit: yyDollar[1].token.Literal, Cursor: yyDollar[2].identifier, Is: yyDollar[3].token.Literal, Negation: yyDollar[4].token, Type: yyDollar[6].token.Token, TypeLit: yyDollar[5].token.Literal + " " + yyDollar[6].token.Literal} } - case 38: + case 42: yyDollar = yyS[yypt-8 : yypt+1] - //line parser.y:332 + //line parser.y:351 { yyVAL.statement = If{Condition: yyDollar[2].expression, Statements: yyDollar[4].program, Else: yyDollar[5].procexpr} } - case 39: + case 43: yyDollar = yyS[yypt-9 : yypt+1] - //line parser.y:336 + //line parser.y:355 { yyVAL.statement = If{Condition: yyDollar[2].expression, Statements: yyDollar[4].program, ElseIf: yyDollar[5].procexprs, Else: yyDollar[6].procexpr} } - case 40: + case 44: yyDollar = yyS[yypt-7 : yypt+1] - //line parser.y:340 + //line parser.y:359 { yyVAL.statement = While{Condition: yyDollar[2].expression, Statements: yyDollar[4].program} } - case 41: + case 45: yyDollar = yyS[yypt-9 : yypt+1] - //line parser.y:344 + //line parser.y:363 { yyVAL.statement = WhileInCursor{Variables: yyDollar[2].variables, Cursor: yyDollar[4].identifier, Statements: yyDollar[6].program} } - case 42: + case 46: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:348 + //line parser.y:367 { yyVAL.statement = FlowControl{Token: yyDollar[1].token.Token} } - case 43: + case 47: yyDollar = yyS[yypt-8 : yypt+1] - //line parser.y:354 + //line parser.y:373 { yyVAL.statement = If{Condition: yyDollar[2].expression, Statements: yyDollar[4].program, Else: yyDollar[5].procexpr} } - case 44: + case 48: yyDollar = yyS[yypt-9 : yypt+1] - //line parser.y:358 + //line parser.y:377 { yyVAL.statement = If{Condition: yyDollar[2].expression, Statements: yyDollar[4].program, ElseIf: yyDollar[5].procexprs, Else: yyDollar[6].procexpr} } - case 45: + case 49: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:362 + //line parser.y:381 { yyVAL.statement = FlowControl{Token: yyDollar[1].token.Token} } - case 46: + case 50: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:366 + //line parser.y:385 { yyVAL.statement = FlowControl{Token: yyDollar[1].token.Token} } - case 47: + case 51: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:372 + //line parser.y:391 { yyVAL.statement = SetFlag{Name: yyDollar[2].token.Literal, Value: yyDollar[4].primary} } - case 48: + case 52: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:376 + //line parser.y:395 { yyVAL.statement = Print{Value: yyDollar[2].expression} } - case 49: + case 53: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:382 + //line parser.y:401 { yyVAL.expression = SelectQuery{ CommonTableClause: yyDollar[1].expression, @@ -1476,9 +1509,9 @@ yydefault: OffsetClause: yyDollar[5].expression, } } - case 50: + case 54: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:394 + //line parser.y:413 { yyVAL.expression = SelectEntity{ SelectClause: yyDollar[1].expression, @@ -1488,9 +1521,9 @@ yydefault: HavingClause: yyDollar[5].expression, } } - case 51: + case 55: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:404 + //line parser.y:423 { yyVAL.expression = SelectSet{ LHS: yyDollar[1].expression, @@ -1499,9 +1532,9 @@ yydefault: RHS: yyDollar[4].expression, } } - case 52: + case 56: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:413 + //line parser.y:432 { yyVAL.expression = SelectSet{ LHS: yyDollar[1].expression, @@ -1510,9 +1543,9 @@ yydefault: RHS: yyDollar[4].expression, } } - case 53: + case 57: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:422 + //line parser.y:441 { yyVAL.expression = SelectSet{ LHS: yyDollar[1].expression, @@ -1521,387 +1554,387 @@ yydefault: RHS: yyDollar[4].expression, } } - case 54: + case 58: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:433 + //line parser.y:452 { yyVAL.expression = yyDollar[1].expression } - case 55: + case 59: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:437 + //line parser.y:456 { yyVAL.expression = yyDollar[1].expression } - case 56: + case 60: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:443 + //line parser.y:462 { yyVAL.expression = SelectClause{Select: yyDollar[1].token.Literal, Distinct: yyDollar[2].token, Fields: yyDollar[3].expressions} } - case 57: + case 61: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:449 + //line parser.y:468 { yyVAL.expression = nil } - case 58: + case 62: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:453 + //line parser.y:472 { yyVAL.expression = FromClause{From: yyDollar[1].token.Literal, Tables: yyDollar[2].expressions} } - case 59: + case 63: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:459 + //line parser.y:478 { yyVAL.expression = nil } - case 60: + case 64: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:463 + //line parser.y:482 { yyVAL.expression = WhereClause{Where: yyDollar[1].token.Literal, Filter: yyDollar[2].expression} } - case 61: + case 65: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:469 + //line parser.y:488 { yyVAL.expression = nil } - case 62: + case 66: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:473 + //line parser.y:492 { yyVAL.expression = GroupByClause{GroupBy: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Items: yyDollar[3].expressions} } - case 63: + case 67: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:479 + //line parser.y:498 { yyVAL.expression = nil } - case 64: + case 68: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:483 + //line parser.y:502 { yyVAL.expression = HavingClause{Having: yyDollar[1].token.Literal, Filter: yyDollar[2].expression} } - case 65: + case 69: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:489 + //line parser.y:508 { yyVAL.expression = nil } - case 66: + case 70: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:493 + //line parser.y:512 { yyVAL.expression = OrderByClause{OrderBy: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Items: yyDollar[3].expressions} } - case 67: + case 71: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:499 + //line parser.y:518 { yyVAL.expression = nil } - case 68: + case 72: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:503 + //line parser.y:522 { yyVAL.expression = LimitClause{Limit: yyDollar[1].token.Literal, Value: yyDollar[2].expression, With: yyDollar[3].expression} } - case 69: + case 73: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:507 + //line parser.y:526 { yyVAL.expression = LimitClause{Limit: yyDollar[1].token.Literal, Value: yyDollar[2].expression, Percent: yyDollar[3].token.Literal, With: yyDollar[4].expression} } - case 70: + case 74: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:513 + //line parser.y:532 { yyVAL.expression = nil } - case 71: + case 75: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:517 + //line parser.y:536 { yyVAL.expression = LimitWith{With: yyDollar[1].token.Literal, Type: yyDollar[2].token} } - case 72: + case 76: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:523 + //line parser.y:542 { yyVAL.expression = nil } - case 73: + case 77: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:527 + //line parser.y:546 { yyVAL.expression = OffsetClause{Offset: yyDollar[1].token.Literal, Value: yyDollar[2].expression} } - case 74: + case 78: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:533 + //line parser.y:552 { yyVAL.expression = nil } - case 75: + case 79: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:537 + //line parser.y:556 { yyVAL.expression = CommonTableClause{With: yyDollar[1].token.Literal, CommonTables: yyDollar[2].expressions} } - case 76: + case 80: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:543 + //line parser.y:562 { yyVAL.expression = CommonTable{Recursive: yyDollar[1].token, Name: yyDollar[2].identifier, As: yyDollar[3].token.Literal, Query: yyDollar[5].expression.(SelectQuery)} } - case 77: + case 81: yyDollar = yyS[yypt-9 : yypt+1] - //line parser.y:547 + //line parser.y:566 { yyVAL.expression = CommonTable{Recursive: yyDollar[1].token, Name: yyDollar[2].identifier, Columns: yyDollar[4].expressions, As: yyDollar[6].token.Literal, Query: yyDollar[8].expression.(SelectQuery)} } - case 78: + case 82: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:553 + //line parser.y:572 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 79: + case 83: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:557 + //line parser.y:576 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 80: + case 84: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:563 + //line parser.y:582 { yyVAL.primary = yyDollar[1].text } - case 81: + case 85: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:567 + //line parser.y:586 { yyVAL.primary = yyDollar[1].integer } - case 82: + case 86: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:571 + //line parser.y:590 { yyVAL.primary = yyDollar[1].float } - case 83: + case 87: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:575 + //line parser.y:594 { yyVAL.primary = yyDollar[1].ternary } - case 84: + case 88: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:579 + //line parser.y:598 { yyVAL.primary = yyDollar[1].datetime } - case 85: + case 89: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:583 + //line parser.y:602 { yyVAL.primary = yyDollar[1].null } - case 86: + case 90: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:589 + //line parser.y:608 { yyVAL.expression = FieldReference{Column: yyDollar[1].identifier} } - case 87: + case 91: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:593 + //line parser.y:612 { yyVAL.expression = FieldReference{View: yyDollar[1].identifier, Column: yyDollar[3].identifier} } - case 88: + case 92: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:599 + //line parser.y:618 { yyVAL.expression = yyDollar[1].expression } - case 89: + case 93: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:603 + //line parser.y:622 { yyVAL.expression = yyDollar[1].primary } - case 90: + case 94: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:607 + //line parser.y:626 { yyVAL.expression = yyDollar[1].expression } - case 91: + case 95: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:611 + //line parser.y:630 { yyVAL.expression = yyDollar[1].expression } - case 92: + case 96: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:615 + //line parser.y:634 { yyVAL.expression = yyDollar[1].expression } - case 93: + case 97: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:619 + //line parser.y:638 { yyVAL.expression = yyDollar[1].expression } - case 94: + case 98: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:623 + //line parser.y:642 { yyVAL.expression = yyDollar[1].expression } - case 95: + case 99: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:627 + //line parser.y:646 { yyVAL.expression = yyDollar[1].expression } - case 96: + case 100: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:631 + //line parser.y:650 { yyVAL.expression = yyDollar[1].expression } - case 97: + case 101: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:635 + //line parser.y:654 { yyVAL.expression = yyDollar[1].variable } - case 98: + case 102: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:639 + //line parser.y:658 { yyVAL.expression = yyDollar[1].expression } - case 99: + case 103: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:643 + //line parser.y:662 { yyVAL.expression = yyDollar[1].expression } - case 100: + case 104: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:647 + //line parser.y:666 { yyVAL.expression = Parentheses{Expr: yyDollar[2].expression} } - case 101: + case 105: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:653 + //line parser.y:672 { yyVAL.expression = RowValue{Value: ValueList{Values: yyDollar[2].expressions}} } - case 102: + case 106: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:657 + //line parser.y:676 { yyVAL.expression = RowValue{Value: yyDollar[1].expression} } - case 103: + case 107: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:663 + //line parser.y:682 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 104: + case 108: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:667 + //line parser.y:686 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 105: + case 109: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:673 + //line parser.y:692 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 106: + case 110: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:677 + //line parser.y:696 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 107: + case 111: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:683 + //line parser.y:702 { yyVAL.expression = OrderItem{Value: yyDollar[1].expression, Direction: yyDollar[2].token} } - case 108: + case 112: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:687 + //line parser.y:706 { yyVAL.expression = OrderItem{Value: yyDollar[1].expression, Direction: yyDollar[2].token, Nulls: yyDollar[3].token.Literal, Position: yyDollar[4].token} } - case 109: + case 113: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:693 + //line parser.y:712 { yyVAL.expression = yyDollar[1].expression } - case 110: + case 114: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:697 + //line parser.y:716 { yyVAL.expression = yyDollar[1].expression } - case 111: + case 115: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:703 + //line parser.y:722 { yyVAL.token = Token{} } - case 112: + case 116: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:707 + //line parser.y:726 { yyVAL.token = yyDollar[1].token } - case 113: + case 117: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:711 + //line parser.y:730 { yyVAL.token = yyDollar[1].token } - case 114: + case 118: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:717 + //line parser.y:736 { yyVAL.token = yyDollar[1].token } - case 115: + case 119: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:721 + //line parser.y:740 { yyVAL.token = yyDollar[1].token } - case 116: + case 120: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:727 + //line parser.y:746 { yyVAL.expression = Subquery{Query: yyDollar[2].expression.(SelectQuery)} } - case 117: + case 121: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:733 + //line parser.y:752 { var item1 []Expression var item2 []Expression @@ -1922,913 +1955,913 @@ yydefault: yyVAL.expression = Concat{Items: append(item1, item2...)} } - case 118: + case 122: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:756 + //line parser.y:775 { - yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: yyDollar[2].token, RHS: yyDollar[3].expression} + yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, RHS: yyDollar[3].expression} } - case 119: + case 123: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:760 + //line parser.y:779 { - yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: yyDollar[2].token, RHS: yyDollar[3].expression} + yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, RHS: yyDollar[3].expression} } - case 120: + case 124: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:764 + //line parser.y:783 { - yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: Token{Token: COMPARISON_OP, Literal: "="}, RHS: yyDollar[3].expression} + yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: "=", RHS: yyDollar[3].expression} } - case 121: + case 125: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:768 + //line parser.y:787 { - yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: Token{Token: COMPARISON_OP, Literal: "="}, RHS: yyDollar[3].expression} + yyVAL.expression = Comparison{LHS: yyDollar[1].expression, Operator: "=", RHS: yyDollar[3].expression} } - case 122: + case 126: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:772 + //line parser.y:791 { yyVAL.expression = Is{Is: yyDollar[2].token.Literal, LHS: yyDollar[1].expression, RHS: yyDollar[4].ternary, Negation: yyDollar[3].token} } - case 123: + case 127: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:776 + //line parser.y:795 { yyVAL.expression = Is{Is: yyDollar[2].token.Literal, LHS: yyDollar[1].expression, RHS: yyDollar[4].null, Negation: yyDollar[3].token} } - case 124: + case 128: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:780 + //line parser.y:799 { yyVAL.expression = Between{Between: yyDollar[3].token.Literal, And: yyDollar[5].token.Literal, LHS: yyDollar[1].expression, Low: yyDollar[4].expression, High: yyDollar[6].expression, Negation: yyDollar[2].token} } - case 125: + case 129: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:784 + //line parser.y:803 { yyVAL.expression = Between{Between: yyDollar[3].token.Literal, And: yyDollar[5].token.Literal, LHS: yyDollar[1].expression, Low: yyDollar[4].expression, High: yyDollar[6].expression, Negation: yyDollar[2].token} } - case 126: + case 130: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:788 + //line parser.y:807 { yyVAL.expression = In{In: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Values: yyDollar[4].expression, Negation: yyDollar[2].token} } - case 127: + case 131: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:792 + //line parser.y:811 { yyVAL.expression = In{In: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Values: RowValueList{RowValues: yyDollar[5].expressions}, Negation: yyDollar[2].token} } - case 128: + case 132: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:796 + //line parser.y:815 { yyVAL.expression = In{In: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Values: yyDollar[4].expression, Negation: yyDollar[2].token} } - case 129: + case 133: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:800 + //line parser.y:819 { yyVAL.expression = Like{Like: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Pattern: yyDollar[4].expression, Negation: yyDollar[2].token} } - case 130: + case 134: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:804 + //line parser.y:823 { - yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: yyDollar[4].expression} + yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: yyDollar[4].expression} } - case 131: + case 135: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:808 + //line parser.y:827 { - yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: RowValueList{RowValues: yyDollar[5].expressions}} + yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: RowValueList{RowValues: yyDollar[5].expressions}} } - case 132: + case 136: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:812 + //line parser.y:831 { - yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: yyDollar[4].expression} + yyVAL.expression = Any{Any: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: yyDollar[4].expression} } - case 133: + case 137: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:816 + //line parser.y:835 { - yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: yyDollar[4].expression} + yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: yyDollar[4].expression} } - case 134: + case 138: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:820 + //line parser.y:839 { - yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: RowValueList{RowValues: yyDollar[5].expressions}} + yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: RowValueList{RowValues: yyDollar[5].expressions}} } - case 135: + case 139: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:824 + //line parser.y:843 { - yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token, Values: yyDollar[4].expression} + yyVAL.expression = All{All: yyDollar[3].token.Literal, LHS: yyDollar[1].expression, Operator: yyDollar[2].token.Literal, Values: yyDollar[4].expression} } - case 136: + case 140: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:828 + //line parser.y:847 { yyVAL.expression = Exists{Exists: yyDollar[1].token.Literal, Query: yyDollar[2].expression.(Subquery)} } - case 137: + case 141: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:834 + //line parser.y:853 { yyVAL.expression = Arithmetic{LHS: yyDollar[1].expression, Operator: int('+'), RHS: yyDollar[3].expression} } - case 138: + case 142: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:838 + //line parser.y:857 { yyVAL.expression = Arithmetic{LHS: yyDollar[1].expression, Operator: int('-'), RHS: yyDollar[3].expression} } - case 139: + case 143: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:842 + //line parser.y:861 { yyVAL.expression = Arithmetic{LHS: yyDollar[1].expression, Operator: int('*'), RHS: yyDollar[3].expression} } - case 140: + case 144: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:846 + //line parser.y:865 { yyVAL.expression = Arithmetic{LHS: yyDollar[1].expression, Operator: int('/'), RHS: yyDollar[3].expression} } - case 141: + case 145: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:850 + //line parser.y:869 { yyVAL.expression = Arithmetic{LHS: yyDollar[1].expression, Operator: int('%'), RHS: yyDollar[3].expression} } - case 142: + case 146: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:856 + //line parser.y:875 { yyVAL.expression = Logic{LHS: yyDollar[1].expression, Operator: yyDollar[2].token, RHS: yyDollar[3].expression} } - case 143: + case 147: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:860 + //line parser.y:879 { yyVAL.expression = Logic{LHS: yyDollar[1].expression, Operator: yyDollar[2].token, RHS: yyDollar[3].expression} } - case 144: + case 148: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:864 + //line parser.y:883 { yyVAL.expression = Logic{LHS: nil, Operator: yyDollar[1].token, RHS: yyDollar[2].expression} } - case 145: + case 149: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:870 + //line parser.y:889 { yyVAL.expression = Function{Name: yyDollar[1].identifier.Literal, Option: yyDollar[3].expression.(Option)} } - case 146: + case 150: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:874 + //line parser.y:893 { yyVAL.expression = yyDollar[1].expression } - case 147: + case 151: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:880 + //line parser.y:899 { yyVAL.expression = Option{} } - case 148: + case 152: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:884 + //line parser.y:903 { yyVAL.expression = Option{Distinct: yyDollar[1].token, Args: []Expression{AllColumns{}}} } - case 149: + case 153: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:888 + //line parser.y:907 { yyVAL.expression = Option{Distinct: yyDollar[1].token, Args: yyDollar[2].expressions} } - case 150: + case 154: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:894 + //line parser.y:913 { yyVAL.expression = GroupConcat{GroupConcat: yyDollar[1].token.Literal, Option: yyDollar[3].expression.(Option), OrderBy: yyDollar[4].expression} } - case 151: + case 155: yyDollar = yyS[yypt-7 : yypt+1] - //line parser.y:898 + //line parser.y:917 { yyVAL.expression = GroupConcat{GroupConcat: yyDollar[1].token.Literal, Option: yyDollar[3].expression.(Option), OrderBy: yyDollar[4].expression, SeparatorLit: yyDollar[5].token.Literal, Separator: yyDollar[6].token.Literal} } - case 152: + case 156: yyDollar = yyS[yypt-8 : yypt+1] - //line parser.y:904 + //line parser.y:923 { yyVAL.expression = AnalyticFunction{Name: yyDollar[1].identifier.Literal, Option: yyDollar[3].expression.(Option), Over: yyDollar[5].token.Literal, AnalyticClause: yyDollar[7].expression.(AnalyticClause)} } - case 153: + case 157: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:910 + //line parser.y:929 { yyVAL.expression = AnalyticClause{Partition: yyDollar[1].expression, OrderByClause: yyDollar[2].expression} } - case 154: + case 158: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:916 + //line parser.y:935 { yyVAL.expression = nil } - case 155: + case 159: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:920 + //line parser.y:939 { yyVAL.expression = Partition{PartitionBy: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Values: yyDollar[3].expressions} } - case 156: + case 160: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:926 + //line parser.y:945 { yyVAL.expression = Table{Object: yyDollar[1].identifier} } - case 157: + case 161: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:930 + //line parser.y:949 { yyVAL.expression = Table{Object: yyDollar[1].identifier, Alias: yyDollar[2].identifier} } - case 158: + case 162: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:934 + //line parser.y:953 { - yyVAL.expression = Table{Object: yyDollar[1].identifier, As: yyDollar[2].token, Alias: yyDollar[3].identifier} + yyVAL.expression = Table{Object: yyDollar[1].identifier, As: yyDollar[2].token.Literal, Alias: yyDollar[3].identifier} } - case 159: + case 163: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:940 + //line parser.y:959 { yyVAL.expression = yyDollar[1].expression } - case 160: + case 164: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:944 + //line parser.y:963 { yyVAL.expression = Stdin{Stdin: yyDollar[1].token.Literal} } - case 161: + case 165: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:950 + //line parser.y:969 { yyVAL.expression = yyDollar[1].expression } - case 162: + case 166: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:954 + //line parser.y:973 { yyVAL.expression = Table{Object: yyDollar[1].expression} } - case 163: + case 167: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:958 + //line parser.y:977 { yyVAL.expression = Table{Object: yyDollar[1].expression, Alias: yyDollar[2].identifier} } - case 164: + case 168: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:962 + //line parser.y:981 { - yyVAL.expression = Table{Object: yyDollar[1].expression, As: yyDollar[2].token, Alias: yyDollar[3].identifier} + yyVAL.expression = Table{Object: yyDollar[1].expression, As: yyDollar[2].token.Literal, Alias: yyDollar[3].identifier} } - case 165: + case 169: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:966 + //line parser.y:985 { yyVAL.expression = Table{Object: yyDollar[1].expression} } - case 166: + case 170: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:970 + //line parser.y:989 { yyVAL.expression = Table{Object: Dual{Dual: yyDollar[1].token.Literal}} } - case 167: + case 171: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:976 + //line parser.y:995 { yyVAL.expression = Join{Join: yyDollar[3].token.Literal, Table: yyDollar[1].expression.(Table), JoinTable: yyDollar[4].expression.(Table), Natural: Token{}, JoinType: yyDollar[2].token, Condition: yyDollar[5].expression} } - case 168: + case 172: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:980 + //line parser.y:999 { yyVAL.expression = Join{Join: yyDollar[4].token.Literal, Table: yyDollar[1].expression.(Table), JoinTable: yyDollar[5].expression.(Table), Natural: yyDollar[2].token, JoinType: yyDollar[3].token, Condition: nil} } - case 169: + case 173: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:984 + //line parser.y:1003 { yyVAL.expression = Join{Join: yyDollar[4].token.Literal, Table: yyDollar[1].expression.(Table), JoinTable: yyDollar[5].expression.(Table), Natural: Token{}, JoinType: yyDollar[3].token, Direction: yyDollar[2].token, Condition: yyDollar[6].expression} } - case 170: + case 174: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:988 + //line parser.y:1007 { yyVAL.expression = Join{Join: yyDollar[5].token.Literal, Table: yyDollar[1].expression.(Table), JoinTable: yyDollar[6].expression.(Table), Natural: yyDollar[2].token, JoinType: yyDollar[4].token, Direction: yyDollar[3].token, Condition: nil} } - case 171: + case 175: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:992 + //line parser.y:1011 { yyVAL.expression = Join{Join: yyDollar[3].token.Literal, Table: yyDollar[1].expression.(Table), JoinTable: yyDollar[4].expression.(Table), Natural: Token{}, JoinType: yyDollar[2].token, Condition: nil} } - case 172: + case 176: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:998 + //line parser.y:1017 { yyVAL.expression = nil } - case 173: + case 177: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1002 + //line parser.y:1021 { yyVAL.expression = JoinCondition{Literal: yyDollar[1].token.Literal, On: yyDollar[2].expression} } - case 174: + case 178: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:1006 + //line parser.y:1025 { yyVAL.expression = JoinCondition{Literal: yyDollar[1].token.Literal, Using: yyDollar[3].expressions} } - case 175: + case 179: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1012 + //line parser.y:1031 { yyVAL.expression = yyDollar[1].expression } - case 176: + case 180: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1016 + //line parser.y:1035 { yyVAL.expression = yyDollar[1].expression } - case 177: + case 181: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1020 + //line parser.y:1039 { yyVAL.expression = AllColumns{} } - case 178: + case 182: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1026 + //line parser.y:1045 { yyVAL.expression = Field{Object: yyDollar[1].expression} } - case 179: + case 183: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1030 + //line parser.y:1049 { - yyVAL.expression = Field{Object: yyDollar[1].expression, As: yyDollar[2].token, Alias: yyDollar[3].identifier} + yyVAL.expression = Field{Object: yyDollar[1].expression, As: yyDollar[2].token.Literal, Alias: yyDollar[3].identifier} } - case 180: + case 184: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:1036 + //line parser.y:1055 { yyVAL.expression = Case{Case: yyDollar[1].token.Literal, End: yyDollar[5].token.Literal, Value: yyDollar[2].expression, When: yyDollar[3].expressions, Else: yyDollar[4].expression} } - case 181: + case 185: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1042 + //line parser.y:1061 { yyVAL.expression = nil } - case 182: + case 186: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1046 + //line parser.y:1065 { yyVAL.expression = yyDollar[1].expression } - case 183: + case 187: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1052 + //line parser.y:1071 { yyVAL.expression = nil } - case 184: + case 188: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1056 + //line parser.y:1075 { yyVAL.expression = CaseElse{Else: yyDollar[1].token.Literal, Result: yyDollar[2].expression} } - case 185: + case 189: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1062 + //line parser.y:1081 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 186: + case 190: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1066 + //line parser.y:1085 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 187: + case 191: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1072 + //line parser.y:1091 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 188: + case 192: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1076 + //line parser.y:1095 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 189: + case 193: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1082 + //line parser.y:1101 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 190: + case 194: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1086 + //line parser.y:1105 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 191: + case 195: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1092 + //line parser.y:1111 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 192: + case 196: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1096 + //line parser.y:1115 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 193: + case 197: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1102 + //line parser.y:1121 { yyVAL.expressions = []Expression{yyDollar[1].identifier} } - case 194: + case 198: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1106 + //line parser.y:1125 { yyVAL.expressions = append([]Expression{yyDollar[1].identifier}, yyDollar[3].expressions...) } - case 195: + case 199: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1112 + //line parser.y:1131 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 196: + case 200: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1116 + //line parser.y:1135 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 197: + case 201: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:1122 + //line parser.y:1141 { yyVAL.expressions = []Expression{CaseWhen{When: yyDollar[1].token.Literal, Then: yyDollar[3].token.Literal, Condition: yyDollar[2].expression, Result: yyDollar[4].expression}} } - case 198: + case 202: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1126 + //line parser.y:1145 { yyVAL.expressions = append(yyDollar[1].expressions, yyDollar[2].expressions...) } - case 199: + case 203: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:1132 + //line parser.y:1151 { yyVAL.expression = InsertQuery{CommonTableClause: yyDollar[1].expression, Insert: yyDollar[2].token.Literal, Into: yyDollar[3].token.Literal, Table: yyDollar[4].identifier, Values: yyDollar[5].token.Literal, ValuesList: yyDollar[6].expressions} } - case 200: + case 204: yyDollar = yyS[yypt-9 : yypt+1] - //line parser.y:1136 + //line parser.y:1155 { yyVAL.expression = InsertQuery{CommonTableClause: yyDollar[1].expression, Insert: yyDollar[2].token.Literal, Into: yyDollar[3].token.Literal, Table: yyDollar[4].identifier, Fields: yyDollar[6].expressions, Values: yyDollar[8].token.Literal, ValuesList: yyDollar[9].expressions} } - case 201: + case 205: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:1140 + //line parser.y:1159 { yyVAL.expression = InsertQuery{CommonTableClause: yyDollar[1].expression, Insert: yyDollar[2].token.Literal, Into: yyDollar[3].token.Literal, Table: yyDollar[4].identifier, Query: yyDollar[5].expression.(SelectQuery)} } - case 202: + case 206: yyDollar = yyS[yypt-8 : yypt+1] - //line parser.y:1144 + //line parser.y:1163 { yyVAL.expression = InsertQuery{CommonTableClause: yyDollar[1].expression, Insert: yyDollar[2].token.Literal, Into: yyDollar[3].token.Literal, Table: yyDollar[4].identifier, Fields: yyDollar[6].expressions, Query: yyDollar[8].expression.(SelectQuery)} } - case 203: + case 207: yyDollar = yyS[yypt-7 : yypt+1] - //line parser.y:1150 + //line parser.y:1169 { yyVAL.expression = UpdateQuery{CommonTableClause: yyDollar[1].expression, Update: yyDollar[2].token.Literal, Tables: yyDollar[3].expressions, Set: yyDollar[4].token.Literal, SetList: yyDollar[5].expressions, FromClause: yyDollar[6].expression, WhereClause: yyDollar[7].expression} } - case 204: + case 208: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1156 + //line parser.y:1175 { yyVAL.expression = UpdateSet{Field: yyDollar[1].expression.(FieldReference), Value: yyDollar[3].expression} } - case 205: + case 209: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1162 + //line parser.y:1181 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 206: + case 210: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1166 + //line parser.y:1185 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 207: + case 211: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:1172 + //line parser.y:1191 { from := FromClause{From: yyDollar[3].token.Literal, Tables: yyDollar[4].expressions} yyVAL.expression = DeleteQuery{CommonTableClause: yyDollar[1].expression, Delete: yyDollar[2].token.Literal, FromClause: from, WhereClause: yyDollar[5].expression} } - case 208: + case 212: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:1177 + //line parser.y:1196 { from := FromClause{From: yyDollar[4].token.Literal, Tables: yyDollar[5].expressions} yyVAL.expression = DeleteQuery{CommonTableClause: yyDollar[1].expression, Delete: yyDollar[2].token.Literal, Tables: yyDollar[3].expressions, FromClause: from, WhereClause: yyDollar[6].expression} } - case 209: + case 213: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:1184 + //line parser.y:1203 { yyVAL.expression = CreateTable{CreateTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Fields: yyDollar[5].expressions} } - case 210: + case 214: yyDollar = yyS[yypt-6 : yypt+1] - //line parser.y:1190 + //line parser.y:1209 { yyVAL.expression = AddColumns{AlterTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Add: yyDollar[4].token.Literal, Columns: []Expression{yyDollar[5].expression}, Position: yyDollar[6].expression} } - case 211: + case 215: yyDollar = yyS[yypt-8 : yypt+1] - //line parser.y:1194 + //line parser.y:1213 { yyVAL.expression = AddColumns{AlterTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Add: yyDollar[4].token.Literal, Columns: yyDollar[6].expressions, Position: yyDollar[8].expression} } - case 212: + case 216: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1200 + //line parser.y:1219 { yyVAL.expression = ColumnDefault{Column: yyDollar[1].identifier} } - case 213: + case 217: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1204 + //line parser.y:1223 { yyVAL.expression = ColumnDefault{Column: yyDollar[1].identifier, Default: yyDollar[2].token.Literal, Value: yyDollar[3].expression} } - case 214: + case 218: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1210 + //line parser.y:1229 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 215: + case 219: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1214 + //line parser.y:1233 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 216: + case 220: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1220 + //line parser.y:1239 { yyVAL.expression = nil } - case 217: + case 221: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1224 + //line parser.y:1243 { yyVAL.expression = ColumnPosition{Position: yyDollar[1].token} } - case 218: + case 222: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1228 + //line parser.y:1247 { yyVAL.expression = ColumnPosition{Position: yyDollar[1].token} } - case 219: + case 223: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1232 + //line parser.y:1251 { yyVAL.expression = ColumnPosition{Position: yyDollar[1].token, Column: yyDollar[2].expression} } - case 220: + case 224: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1236 + //line parser.y:1255 { yyVAL.expression = ColumnPosition{Position: yyDollar[1].token, Column: yyDollar[2].expression} } - case 221: + case 225: yyDollar = yyS[yypt-5 : yypt+1] - //line parser.y:1242 + //line parser.y:1261 { yyVAL.expression = DropColumns{AlterTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Drop: yyDollar[4].token.Literal, Columns: []Expression{yyDollar[5].expression}} } - case 222: + case 226: yyDollar = yyS[yypt-7 : yypt+1] - //line parser.y:1246 + //line parser.y:1265 { yyVAL.expression = DropColumns{AlterTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Drop: yyDollar[4].token.Literal, Columns: yyDollar[6].expressions} } - case 223: + case 227: yyDollar = yyS[yypt-7 : yypt+1] - //line parser.y:1252 + //line parser.y:1271 { yyVAL.expression = RenameColumn{AlterTable: yyDollar[1].token.Literal + " " + yyDollar[2].token.Literal, Table: yyDollar[3].identifier, Rename: yyDollar[4].token.Literal, Old: yyDollar[5].expression.(FieldReference), To: yyDollar[6].token.Literal, New: yyDollar[7].identifier} } - case 224: + case 228: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:1258 + //line parser.y:1277 { yyVAL.procexprs = []ProcExpr{ElseIf{Condition: yyDollar[2].expression, Statements: yyDollar[4].program}} } - case 225: + case 229: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1262 + //line parser.y:1281 { yyVAL.procexprs = append(yyDollar[1].procexprs, yyDollar[2].procexprs...) } - case 226: + case 230: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1268 + //line parser.y:1287 { yyVAL.procexpr = nil } - case 227: + case 231: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1272 + //line parser.y:1291 { yyVAL.procexpr = Else{Statements: yyDollar[2].program} } - case 228: + case 232: yyDollar = yyS[yypt-4 : yypt+1] - //line parser.y:1278 + //line parser.y:1297 { yyVAL.procexprs = []ProcExpr{ElseIf{Condition: yyDollar[2].expression, Statements: yyDollar[4].program}} } - case 229: + case 233: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1282 + //line parser.y:1301 { yyVAL.procexprs = append(yyDollar[1].procexprs, yyDollar[2].procexprs...) } - case 230: + case 234: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1288 + //line parser.y:1307 { yyVAL.procexpr = nil } - case 231: + case 235: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1292 + //line parser.y:1311 { yyVAL.procexpr = Else{Statements: yyDollar[2].program} } - case 232: + case 236: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1298 + //line parser.y:1317 { yyVAL.identifier = Identifier{Literal: yyDollar[1].token.Literal, Quoted: yyDollar[1].token.Quoted} } - case 233: + case 237: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1304 + //line parser.y:1323 { yyVAL.text = NewString(yyDollar[1].token.Literal) } - case 234: + case 238: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1310 + //line parser.y:1329 { yyVAL.integer = NewIntegerFromString(yyDollar[1].token.Literal) } - case 235: + case 239: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1314 + //line parser.y:1333 { i := yyDollar[2].integer.Value() * -1 yyVAL.integer = NewInteger(i) } - case 236: + case 240: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1321 + //line parser.y:1340 { yyVAL.float = NewFloatFromString(yyDollar[1].token.Literal) } - case 237: + case 241: yyDollar = yyS[yypt-2 : yypt+1] - //line parser.y:1325 + //line parser.y:1344 { f := yyDollar[2].float.Value() * -1 yyVAL.float = NewFloat(f) } - case 238: + case 242: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1332 + //line parser.y:1351 { yyVAL.ternary = NewTernaryFromString(yyDollar[1].token.Literal) } - case 239: + case 243: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1338 + //line parser.y:1357 { yyVAL.datetime = NewDatetimeFromString(yyDollar[1].token.Literal) } - case 240: + case 244: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1344 + //line parser.y:1363 { yyVAL.null = NewNullFromString(yyDollar[1].token.Literal) } - case 241: + case 245: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1350 + //line parser.y:1369 { yyVAL.variable = Variable{Name: yyDollar[1].token.Literal} } - case 242: + case 246: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1356 + //line parser.y:1375 { yyVAL.variables = []Variable{yyDollar[1].variable} } - case 243: + case 247: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1360 + //line parser.y:1379 { yyVAL.variables = append([]Variable{yyDollar[1].variable}, yyDollar[3].variables...) } - case 244: + case 248: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1366 + //line parser.y:1385 { yyVAL.expression = VariableSubstitution{Variable: yyDollar[1].variable, Value: yyDollar[3].expression} } - case 245: + case 249: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1372 + //line parser.y:1391 { yyVAL.expression = VariableAssignment{Name: yyDollar[1].token.Literal} } - case 246: + case 250: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1376 + //line parser.y:1395 { yyVAL.expression = VariableAssignment{Name: yyDollar[1].token.Literal, Value: yyDollar[3].expression} } - case 247: + case 251: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1382 + //line parser.y:1401 { yyVAL.expressions = []Expression{yyDollar[1].expression} } - case 248: + case 252: yyDollar = yyS[yypt-3 : yypt+1] - //line parser.y:1386 + //line parser.y:1405 { yyVAL.expressions = append([]Expression{yyDollar[1].expression}, yyDollar[3].expressions...) } - case 249: + case 253: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1392 + //line parser.y:1411 { yyVAL.token = Token{} } - case 250: + case 254: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1396 + //line parser.y:1415 { yyVAL.token = yyDollar[1].token } - case 251: + case 255: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1402 + //line parser.y:1421 { yyVAL.token = Token{} } - case 252: + case 256: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1406 + //line parser.y:1425 { yyVAL.token = yyDollar[1].token } - case 253: + case 257: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1412 + //line parser.y:1431 { yyVAL.token = Token{} } - case 254: + case 258: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1416 + //line parser.y:1435 { yyVAL.token = yyDollar[1].token } - case 255: + case 259: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1422 + //line parser.y:1441 { yyVAL.token = Token{} } - case 256: + case 260: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1426 + //line parser.y:1445 { yyVAL.token = yyDollar[1].token } - case 257: + case 261: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1432 + //line parser.y:1451 { yyVAL.token = Token{} } - case 258: + case 262: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1436 + //line parser.y:1455 { yyVAL.token = yyDollar[1].token } - case 259: + case 263: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1440 + //line parser.y:1459 { yyVAL.token = yyDollar[1].token } - case 260: + case 264: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1444 + //line parser.y:1463 { yyVAL.token = yyDollar[1].token } - case 261: + case 265: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1450 + //line parser.y:1469 { yyVAL.token = Token{} } - case 262: + case 266: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1454 + //line parser.y:1473 { yyVAL.token = yyDollar[1].token } - case 263: + case 267: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1460 + //line parser.y:1479 { yyVAL.token = Token{} } - case 264: + case 268: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1464 + //line parser.y:1483 { yyVAL.token = yyDollar[1].token } - case 265: + case 269: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1471 + //line parser.y:1490 { yyVAL.token = yyDollar[1].token } - case 266: + case 270: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1475 + //line parser.y:1494 { yyVAL.token = Token{Token: COMPARISON_OP, Literal: string('=')} } - case 267: + case 271: yyDollar = yyS[yypt-0 : yypt+1] - //line parser.y:1481 + //line parser.y:1500 { yyVAL.token = Token{} } - case 268: + case 272: yyDollar = yyS[yypt-1 : yypt+1] - //line parser.y:1485 + //line parser.y:1504 { yyVAL.token = Token{Token: ';', Literal: string(';')} } diff --git a/lib/parser/parser.output b/lib/parser/parser.output index 861f9bf9..86404217 100644 --- a/lib/parser/parser.output +++ b/lib/parser/parser.output @@ -2,37 +2,38 @@ state 0 $accept: .program $end program: . (1) - common_table_clause: . (74) - - $end reduce 1 (src line 160) - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - WHILE shift 29 - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) + common_table_clause: . (78) + + $end reduce 1 (src line 161) + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + WHILE shift 30 + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) program goto 1 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -40,8 +41,8 @@ state 0 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 state 1 $accept: program.$end @@ -53,40 +54,41 @@ state 1 state 2 program: statement.program program: . (1) - common_table_clause: . (74) - - $end reduce 1 (src line 160) - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - ELSEIF reduce 1 (src line 160) - WHILE shift 29 - ELSE reduce 1 (src line 160) - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - program goto 36 + common_table_clause: . (78) + + $end reduce 1 (src line 161) + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + ELSEIF reduce 1 (src line 161) + WHILE shift 30 + ELSE reduce 1 (src line 161) + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + program goto 37 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -94,112 +96,118 @@ state 2 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 state 3 statement: select_query.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 37 + statement_terminal goto 38 state 4 statement: insert_query.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 39 + statement_terminal goto 40 state 5 statement: update_query.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 40 + statement_terminal goto 41 state 6 statement: delete_query.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 41 + statement_terminal goto 42 state 7 statement: create_table.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 42 + statement_terminal goto 43 state 8 statement: add_columns.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 43 + statement_terminal goto 44 state 9 statement: drop_columns.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 44 + statement_terminal goto 45 state 10 statement: rename_column.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 45 + statement_terminal goto 46 state 11 statement: variable_statement. (13) - . reduce 13 (src line 217) + . reduce 13 (src line 218) state 12 statement: transaction_statement. (14) - . reduce 14 (src line 221) + . reduce 14 (src line 222) state 13 statement: cursor_statement. (15) - . reduce 15 (src line 225) + . reduce 15 (src line 226) state 14 - statement: flow_control_statement. (16) + statement: table_statement. (16) - . reduce 16 (src line 229) + . reduce 16 (src line 230) state 15 - statement: command_statement. (17) + statement: flow_control_statement. (17) - . reduce 17 (src line 233) + . reduce 17 (src line 234) state 16 + statement: command_statement. (18) + + . reduce 18 (src line 238) + + +state 17 select_query: common_table_clause.select_entity order_by_clause limit_clause offset_clause insert_query: common_table_clause.INSERT INTO identifier VALUES row_values insert_query: common_table_clause.INSERT INTO identifier '(' field_references ')' VALUES row_values @@ -209,662 +217,669 @@ state 16 delete_query: common_table_clause.DELETE FROM tables where_clause delete_query: common_table_clause.DELETE identified_tables FROM tables where_clause - SELECT shift 52 - UPDATE shift 48 - DELETE shift 49 - INSERT shift 47 - '(' shift 54 + SELECT shift 53 + UPDATE shift 49 + DELETE shift 50 + INSERT shift 48 + '(' shift 55 . error - select_entity goto 46 - select_set_entity goto 51 - select_clause goto 50 - subquery goto 53 + select_entity goto 47 + select_set_entity goto 52 + select_clause goto 51 + subquery goto 54 -state 17 +state 18 create_table: CREATE.TABLE identifier '(' identifiers ')' - TABLE shift 55 + TABLE shift 56 . error -state 18 +state 19 add_columns: ALTER.TABLE identifier ADD column_default column_position add_columns: ALTER.TABLE identifier ADD '(' column_defaults ')' column_position drop_columns: ALTER.TABLE identifier DROP field_reference drop_columns: ALTER.TABLE identifier DROP '(' field_references ')' rename_column: ALTER.TABLE identifier RENAME field_reference TO identifier - TABLE shift 56 + TABLE shift 57 . error -state 19 +state 20 variable_statement: VAR.variable_assignments statement_terminal - VARIABLE shift 59 + VARIABLE shift 60 . error - variable_assignment goto 58 - variable_assignments goto 57 - -state 20 - variable_statement: variable_substitution.statement_terminal - statement_terminal: . (267) - - ';' shift 38 - . reduce 267 (src line 1479) - - statement_terminal goto 60 + variable_assignment goto 59 + variable_assignments goto 58 state 21 - transaction_statement: COMMIT.statement_terminal - statement_terminal: . (267) + variable_statement: variable_substitution.statement_terminal + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) statement_terminal goto 61 state 22 - transaction_statement: ROLLBACK.statement_terminal - statement_terminal: . (267) + transaction_statement: COMMIT.statement_terminal + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) statement_terminal goto 62 state 23 - cursor_statement: DECLARE.identifier CURSOR FOR select_query statement_terminal + transaction_statement: ROLLBACK.statement_terminal + statement_terminal: . (271) - IDENTIFIER shift 64 - . error + ';' shift 39 + . reduce 271 (src line 1498) - identifier goto 63 + statement_terminal goto 63 state 24 - cursor_statement: OPEN.identifier statement_terminal + cursor_statement: DECLARE.identifier CURSOR FOR select_query statement_terminal + table_statement: DECLARE.identifier TABLE '(' identifiers ')' + table_statement: DECLARE.identifier TABLE '(' identifiers ')' FOR select_query statement_terminal + table_statement: DECLARE.identifier TABLE FOR select_query statement_terminal - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 65 + identifier goto 64 state 25 - cursor_statement: CLOSE.identifier statement_terminal + cursor_statement: OPEN.identifier statement_terminal - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error identifier goto 66 state 26 - cursor_statement: DISPOSE.identifier statement_terminal + cursor_statement: CLOSE.identifier statement_terminal - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error identifier goto 67 state 27 - cursor_statement: FETCH.fetch_position identifier INTO variables statement_terminal - fetch_position: . (29) - - FIRST shift 71 - LAST shift 72 - NEXT shift 69 - PRIOR shift 70 - ABSOLUTE shift 73 - RELATIVE shift 74 - . reduce 29 (src line 290) + cursor_statement: DISPOSE.identifier statement_terminal + + IDENTIFIER shift 65 + . error - fetch_position goto 68 + identifier goto 68 state 28 + cursor_statement: FETCH.fetch_position identifier INTO variables statement_terminal + fetch_position: . (33) + + FIRST shift 72 + LAST shift 73 + NEXT shift 70 + PRIOR shift 71 + ABSOLUTE shift 74 + RELATIVE shift 75 + . reduce 33 (src line 309) + + fetch_position goto 69 + +state 29 flow_control_statement: IF.value THEN program else END IF statement_terminal flow_control_statement: IF.value THEN program elseif else END IF statement_terminal - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 75 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 76 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 29 +state 30 flow_control_statement: WHILE.value DO in_loop_program END WHILE statement_terminal flow_control_statement: WHILE.variables IN identifier DO in_loop_program END WHILE statement_terminal - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 110 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 112 - variables goto 111 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 111 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 113 + variables goto 112 + variable_substitution goto 87 -state 30 +state 31 flow_control_statement: EXIT.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 113 + statement_terminal goto 114 -state 31 +state 32 command_statement: SET.FLAG '=' primary statement_terminal - FLAG shift 114 + FLAG shift 115 . error -state 32 +state 33 command_statement: PRINT.value statement_terminal - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 115 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 116 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 33 +state 34 common_table_clause: WITH.common_tables - recursive: . (263) + recursive: . (267) - RECURSIVE shift 119 - . reduce 263 (src line 1458) + RECURSIVE shift 120 + . reduce 267 (src line 1477) - common_table goto 117 - common_tables goto 116 - recursive goto 118 + common_table goto 118 + common_tables goto 117 + recursive goto 119 -state 34 +state 35 variable_substitution: variable.SUBSTITUTION_OP value - SUBSTITUTION_OP shift 120 + SUBSTITUTION_OP shift 121 . error -state 35 - variable: VARIABLE. (241) +state 36 + variable: VARIABLE. (245) - . reduce 241 (src line 1348) + . reduce 245 (src line 1367) -state 36 +state 37 program: statement program. (2) - . reduce 2 (src line 166) + . reduce 2 (src line 167) -state 37 +state 38 statement: select_query statement_terminal. (5) - . reduce 5 (src line 184) + . reduce 5 (src line 185) -state 38 - statement_terminal: ';'. (268) +state 39 + statement_terminal: ';'. (272) - . reduce 268 (src line 1484) + . reduce 272 (src line 1503) -state 39 +state 40 statement: insert_query statement_terminal. (6) - . reduce 6 (src line 189) + . reduce 6 (src line 190) -state 40 +state 41 statement: update_query statement_terminal. (7) - . reduce 7 (src line 193) + . reduce 7 (src line 194) -state 41 +state 42 statement: delete_query statement_terminal. (8) - . reduce 8 (src line 197) + . reduce 8 (src line 198) -state 42 +state 43 statement: create_table statement_terminal. (9) - . reduce 9 (src line 201) + . reduce 9 (src line 202) -state 43 +state 44 statement: add_columns statement_terminal. (10) - . reduce 10 (src line 205) + . reduce 10 (src line 206) -state 44 +state 45 statement: drop_columns statement_terminal. (11) - . reduce 11 (src line 209) + . reduce 11 (src line 210) -state 45 +state 46 statement: rename_column statement_terminal. (12) - . reduce 12 (src line 213) + . reduce 12 (src line 214) -state 46 +state 47 select_query: common_table_clause select_entity.order_by_clause limit_clause offset_clause - select_set_entity: select_entity. (54) - order_by_clause: . (65) + select_set_entity: select_entity. (58) + order_by_clause: . (69) - ORDER shift 122 - UNION reduce 54 (src line 431) - INTERSECT reduce 54 (src line 431) - EXCEPT reduce 54 (src line 431) - . reduce 65 (src line 487) + ORDER shift 123 + UNION reduce 58 (src line 450) + INTERSECT reduce 58 (src line 450) + EXCEPT reduce 58 (src line 450) + . reduce 69 (src line 506) - order_by_clause goto 121 + order_by_clause goto 122 -state 47 +state 48 insert_query: common_table_clause INSERT.INTO identifier VALUES row_values insert_query: common_table_clause INSERT.INTO identifier '(' field_references ')' VALUES row_values insert_query: common_table_clause INSERT.INTO identifier select_query insert_query: common_table_clause INSERT.INTO identifier '(' field_references ')' select_query - INTO shift 123 + INTO shift 124 . error -state 48 +state 49 update_query: common_table_clause UPDATE.identified_tables SET update_set_list from_clause where_clause - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identified_table goto 125 - identified_tables goto 124 - identifier goto 126 + identified_table goto 126 + identified_tables goto 125 + identifier goto 127 -state 49 +state 50 delete_query: common_table_clause DELETE.FROM tables where_clause delete_query: common_table_clause DELETE.identified_tables FROM tables where_clause - IDENTIFIER shift 64 - FROM shift 127 + IDENTIFIER shift 65 + FROM shift 128 . error - identified_table goto 125 - identified_tables goto 128 - identifier goto 126 + identified_table goto 126 + identified_tables goto 129 + identifier goto 127 -state 50 +state 51 select_entity: select_clause.from_clause where_clause group_by_clause having_clause - from_clause: . (57) + from_clause: . (61) - FROM shift 130 - . reduce 57 (src line 447) + FROM shift 131 + . reduce 61 (src line 466) - from_clause goto 129 + from_clause goto 130 -state 51 +state 52 select_entity: select_set_entity.UNION all select_set_entity select_entity: select_set_entity.INTERSECT all select_set_entity select_entity: select_set_entity.EXCEPT all select_set_entity - UNION shift 131 - INTERSECT shift 132 - EXCEPT shift 133 + UNION shift 132 + INTERSECT shift 133 + EXCEPT shift 134 . error -state 52 +state 53 select_clause: SELECT.distinct fields - distinct: . (249) + distinct: . (253) - DISTINCT shift 135 - . reduce 249 (src line 1390) + DISTINCT shift 136 + . reduce 253 (src line 1409) - distinct goto 134 + distinct goto 135 -state 53 - select_set_entity: subquery. (55) +state 54 + select_set_entity: subquery. (59) - . reduce 55 (src line 436) + . reduce 59 (src line 455) -state 54 +state 55 subquery: '('.select_query ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - . reduce 74 (src line 531) + WITH shift 34 + . reduce 78 (src line 550) - select_query goto 136 - common_table_clause goto 137 + select_query goto 137 + common_table_clause goto 138 -state 55 +state 56 create_table: CREATE TABLE.identifier '(' identifiers ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 138 + identifier goto 139 -state 56 +state 57 add_columns: ALTER TABLE.identifier ADD column_default column_position add_columns: ALTER TABLE.identifier ADD '(' column_defaults ')' column_position drop_columns: ALTER TABLE.identifier DROP field_reference drop_columns: ALTER TABLE.identifier DROP '(' field_references ')' rename_column: ALTER TABLE.identifier RENAME field_reference TO identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 139 - -state 57 - variable_statement: VAR variable_assignments.statement_terminal - statement_terminal: . (267) - - ';' shift 38 - . reduce 267 (src line 1479) - - statement_terminal goto 140 + identifier goto 140 state 58 - variable_assignments: variable_assignment. (247) - variable_assignments: variable_assignment.',' variable_assignments + variable_statement: VAR variable_assignments.statement_terminal + statement_terminal: . (271) - ',' shift 141 - . reduce 247 (src line 1380) + ';' shift 39 + . reduce 271 (src line 1498) + statement_terminal goto 141 state 59 - variable_assignment: VARIABLE. (245) - variable_assignment: VARIABLE.SUBSTITUTION_OP value + variable_assignments: variable_assignment. (251) + variable_assignments: variable_assignment.',' variable_assignments - SUBSTITUTION_OP shift 142 - . reduce 245 (src line 1370) + ',' shift 142 + . reduce 251 (src line 1399) state 60 - variable_statement: variable_substitution statement_terminal. (21) + variable_assignment: VARIABLE. (249) + variable_assignment: VARIABLE.SUBSTITUTION_OP value - . reduce 21 (src line 253) + SUBSTITUTION_OP shift 143 + . reduce 249 (src line 1389) state 61 - transaction_statement: COMMIT statement_terminal. (22) + variable_statement: variable_substitution statement_terminal. (22) . reduce 22 (src line 258) state 62 - transaction_statement: ROLLBACK statement_terminal. (23) + transaction_statement: COMMIT statement_terminal. (23) . reduce 23 (src line 263) state 63 - cursor_statement: DECLARE identifier.CURSOR FOR select_query statement_terminal + transaction_statement: ROLLBACK statement_terminal. (24) - CURSOR shift 143 - . error + . reduce 24 (src line 268) state 64 - identifier: IDENTIFIER. (232) + cursor_statement: DECLARE identifier.CURSOR FOR select_query statement_terminal + table_statement: DECLARE identifier.TABLE '(' identifiers ')' + table_statement: DECLARE identifier.TABLE '(' identifiers ')' FOR select_query statement_terminal + table_statement: DECLARE identifier.TABLE FOR select_query statement_terminal - . reduce 232 (src line 1296) + TABLE shift 145 + CURSOR shift 144 + . error state 65 - cursor_statement: OPEN identifier.statement_terminal - statement_terminal: . (267) + identifier: IDENTIFIER. (236) - ';' shift 38 - . reduce 267 (src line 1479) + . reduce 236 (src line 1315) - statement_terminal goto 144 state 66 - cursor_statement: CLOSE identifier.statement_terminal - statement_terminal: . (267) + cursor_statement: OPEN identifier.statement_terminal + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 145 + statement_terminal goto 146 state 67 - cursor_statement: DISPOSE identifier.statement_terminal - statement_terminal: . (267) + cursor_statement: CLOSE identifier.statement_terminal + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 146 + statement_terminal goto 147 state 68 - cursor_statement: FETCH fetch_position.identifier INTO variables statement_terminal + cursor_statement: DISPOSE identifier.statement_terminal + statement_terminal: . (271) - IDENTIFIER shift 64 - . error + ';' shift 39 + . reduce 271 (src line 1498) - identifier goto 147 + statement_terminal goto 148 state 69 - fetch_position: NEXT. (30) + cursor_statement: FETCH fetch_position.identifier INTO variables statement_terminal - . reduce 30 (src line 295) + IDENTIFIER shift 65 + . error + identifier goto 149 state 70 - fetch_position: PRIOR. (31) + fetch_position: NEXT. (34) - . reduce 31 (src line 299) + . reduce 34 (src line 314) state 71 - fetch_position: FIRST. (32) + fetch_position: PRIOR. (35) - . reduce 32 (src line 303) + . reduce 35 (src line 318) state 72 - fetch_position: LAST. (33) + fetch_position: FIRST. (36) - . reduce 33 (src line 307) + . reduce 36 (src line 322) state 73 - fetch_position: ABSOLUTE.value + fetch_position: LAST. (37) + + . reduce 37 (src line 326) - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 148 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 state 74 - fetch_position: RELATIVE.value + fetch_position: ABSOLUTE.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 149 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 150 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 state 75 + fetch_position: RELATIVE.value + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 151 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +state 76 flow_control_statement: IF value.THEN program else END IF statement_terminal flow_control_statement: IF value.THEN program elseif else END IF statement_terminal string_operation: value.STRING_OP value @@ -884,256 +899,256 @@ state 75 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - THEN shift 150 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 - -state 76 - value: field_reference. (88) - - . reduce 88 (src line 597) - + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + THEN shift 152 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 state 77 - value: primary. (89) + value: field_reference. (92) - . reduce 89 (src line 602) + . reduce 92 (src line 616) state 78 - value: arithmetic. (90) + value: primary. (93) - . reduce 90 (src line 606) + . reduce 93 (src line 621) state 79 - value: string_operation. (91) + value: arithmetic. (94) - . reduce 91 (src line 610) + . reduce 94 (src line 625) - 80: reduce/reduce conflict (red'ns 92 and 102) on IN - 80: reduce/reduce conflict (red'ns 92 and 102) on NOT - 80: reduce/reduce conflict (red'ns 92 and 102) on BETWEEN - 80: reduce/reduce conflict (red'ns 92 and 102) on COMPARISON_OP - 80: reduce/reduce conflict (red'ns 92 and 102) on '=' state 80 - value: subquery. (92) - row_value: subquery. (102) + value: string_operation. (95) - . reduce 92 (src line 614) + . reduce 95 (src line 629) + 81: reduce/reduce conflict (red'ns 96 and 106) on IN + 81: reduce/reduce conflict (red'ns 96 and 106) on NOT + 81: reduce/reduce conflict (red'ns 96 and 106) on BETWEEN + 81: reduce/reduce conflict (red'ns 96 and 106) on COMPARISON_OP + 81: reduce/reduce conflict (red'ns 96 and 106) on '=' state 81 - value: function. (93) + value: subquery. (96) + row_value: subquery. (106) - . reduce 93 (src line 618) + . reduce 96 (src line 633) state 82 - value: case. (94) + value: function. (97) - . reduce 94 (src line 622) + . reduce 97 (src line 637) state 83 - value: comparison. (95) + value: case. (98) - . reduce 95 (src line 626) + . reduce 98 (src line 641) state 84 - value: logic. (96) + value: comparison. (99) - . reduce 96 (src line 630) + . reduce 99 (src line 645) state 85 - value: variable. (97) - variable_substitution: variable.SUBSTITUTION_OP value + value: logic. (100) - SUBSTITUTION_OP shift 120 - . reduce 97 (src line 634) + . reduce 100 (src line 649) state 86 - value: variable_substitution. (98) + value: variable. (101) + variable_substitution: variable.SUBSTITUTION_OP value - . reduce 98 (src line 638) + SUBSTITUTION_OP shift 121 + . reduce 101 (src line 653) state 87 - value: cursor_status. (99) + value: variable_substitution. (102) - . reduce 99 (src line 642) + . reduce 102 (src line 657) -88: shift/reduce conflict (shift 88(0), red'n 74(0)) on '(' state 88 + value: cursor_status. (103) + + . reduce 103 (src line 661) + + +89: shift/reduce conflict (shift 89(0), red'n 78(0)) on '(' +state 89 value: '('.value ')' row_value: '('.values ')' subquery: '('.select_query ')' - common_table_clause: . (74) - - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - WITH shift 33 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . reduce 74 (src line 531) - - cursor_status goto 87 - select_query goto 136 - common_table_clause goto 137 - primary goto 77 - field_reference goto 76 - value goto 165 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 166 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 - -89: shift/reduce conflict (shift 168(0), red'n 86(0)) on '(' -state 89 - field_reference: identifier. (86) + common_table_clause: . (78) + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + WITH shift 34 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . reduce 78 (src line 550) + + cursor_status goto 88 + select_query goto 137 + common_table_clause goto 138 + primary goto 78 + field_reference goto 77 + value goto 167 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 168 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +90: shift/reduce conflict (shift 170(0), red'n 90(0)) on '(' +state 90 + field_reference: identifier. (90) field_reference: identifier.'.' identifier function: identifier.'(' option ')' - '(' shift 168 - '.' shift 167 - . reduce 86 (src line 587) - - -state 90 - primary: text. (80) - - . reduce 80 (src line 561) + '(' shift 170 + '.' shift 169 + . reduce 90 (src line 606) state 91 - primary: integer. (81) + primary: text. (84) - . reduce 81 (src line 566) + . reduce 84 (src line 580) state 92 - primary: float. (82) + primary: integer. (85) - . reduce 82 (src line 570) + . reduce 85 (src line 585) state 93 - primary: ternary. (83) + primary: float. (86) - . reduce 83 (src line 574) + . reduce 86 (src line 589) state 94 - primary: datetime. (84) + primary: ternary. (87) - . reduce 84 (src line 578) + . reduce 87 (src line 593) state 95 - primary: null. (85) + primary: datetime. (88) - . reduce 85 (src line 582) + . reduce 88 (src line 597) state 96 - function: group_concat. (146) + primary: null. (89) - . reduce 146 (src line 873) + . reduce 89 (src line 601) state 97 - case: CASE.case_value case_when case_else END - case_value: . (181) - - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . reduce 181 (src line 1040) - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 170 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - case_value goto 169 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + function: group_concat. (150) + + . reduce 150 (src line 892) + state 98 + case: CASE.case_value case_when case_else END + case_value: . (185) + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . reduce 185 (src line 1059) + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 172 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + case_value goto 171 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +state 99 comparison: row_value.COMPARISON_OP row_value comparison: row_value.'=' row_value comparison: row_value.negation BETWEEN row_value AND row_value @@ -1143,133 +1158,133 @@ state 98 comparison: row_value.comparison_operator ANY subquery comparison: row_value.comparison_operator ALL '(' row_values ')' comparison: row_value.comparison_operator ALL subquery - negation: . (251) + negation: . (255) - NOT shift 164 - COMPARISON_OP shift 171 - '=' shift 172 - . reduce 251 (src line 1400) + NOT shift 166 + COMPARISON_OP shift 173 + '=' shift 174 + . reduce 255 (src line 1419) - negation goto 173 - comparison_operator goto 174 + negation goto 175 + comparison_operator goto 176 -state 99 +state 100 comparison: EXISTS.subquery - '(' shift 54 + '(' shift 55 . error - subquery goto 175 + subquery goto 177 -state 100 +state 101 logic: NOT.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 176 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 178 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 101 +state 102 cursor_status: CURSOR.identifier IS negation OPEN cursor_status: CURSOR.identifier IS negation IN RANGE - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 177 - -state 102 - text: STRING. (233) - - . reduce 233 (src line 1302) - + identifier goto 179 state 103 - integer: INTEGER. (234) + text: STRING. (237) - . reduce 234 (src line 1308) + . reduce 237 (src line 1321) state 104 - integer: '-'.integer - float: '-'.float + integer: INTEGER. (238) - INTEGER shift 103 - FLOAT shift 105 - '-' shift 104 - . error + . reduce 238 (src line 1327) - integer goto 178 - float goto 179 state 105 - float: FLOAT. (236) + integer: '-'.integer + float: '-'.float - . reduce 236 (src line 1319) + INTEGER shift 104 + FLOAT shift 106 + '-' shift 105 + . error + integer goto 180 + float goto 181 state 106 - ternary: TERNARY. (238) + float: FLOAT. (240) - . reduce 238 (src line 1330) + . reduce 240 (src line 1338) state 107 - datetime: DATETIME. (239) + ternary: TERNARY. (242) - . reduce 239 (src line 1336) + . reduce 242 (src line 1349) state 108 - null: NULL. (240) + datetime: DATETIME. (243) - . reduce 240 (src line 1342) + . reduce 243 (src line 1355) state 109 + null: NULL. (244) + + . reduce 244 (src line 1361) + + +state 110 group_concat: GROUP_CONCAT.'(' option order_by_clause ')' group_concat: GROUP_CONCAT.'(' option order_by_clause SEPARATOR STRING ')' - '(' shift 180 + '(' shift 182 . error -state 110 +state 111 flow_control_statement: WHILE value.DO in_loop_program END WHILE statement_terminal string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value @@ -1288,59 +1303,59 @@ state 110 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - DO shift 181 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + DO shift 183 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 111 +state 112 flow_control_statement: WHILE variables.IN identifier DO in_loop_program END WHILE statement_terminal - IN shift 182 + IN shift 184 . error - 112: reduce/reduce conflict (red'ns 97 and 242) on IN -state 112 - value: variable. (97) - variables: variable. (242) + 113: reduce/reduce conflict (red'ns 101 and 246) on IN +state 113 + value: variable. (101) + variables: variable. (246) variables: variable.',' variables variable_substitution: variable.SUBSTITUTION_OP value - SUBSTITUTION_OP shift 120 - ',' shift 183 - . reduce 97 (src line 634) + SUBSTITUTION_OP shift 121 + ',' shift 185 + . reduce 101 (src line 653) -state 113 - flow_control_statement: EXIT statement_terminal. (42) +state 114 + flow_control_statement: EXIT statement_terminal. (46) - . reduce 42 (src line 347) + . reduce 46 (src line 366) -state 114 +state 115 command_statement: SET FLAG.'=' primary statement_terminal - '=' shift 184 + '=' shift 186 . error -state 115 +state 116 command_statement: PRINT value.statement_terminal string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value @@ -1359,418 +1374,428 @@ state 115 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - statement_terminal: . (267) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - ';' shift 38 - . reduce 267 (src line 1479) - - negation goto 155 - comparison_operator goto 156 - statement_terminal goto 185 + statement_terminal: . (271) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + ';' shift 39 + . reduce 271 (src line 1498) + + negation goto 157 + comparison_operator goto 158 + statement_terminal goto 187 -state 116 - common_table_clause: WITH common_tables. (75) +state 117 + common_table_clause: WITH common_tables. (79) - . reduce 75 (src line 536) + . reduce 79 (src line 555) -state 117 - common_tables: common_table. (78) +state 118 + common_tables: common_table. (82) common_tables: common_table.',' common_tables - ',' shift 186 - . reduce 78 (src line 551) + ',' shift 188 + . reduce 82 (src line 570) -state 118 +state 119 common_table: recursive.identifier AS '(' select_query ')' common_table: recursive.identifier '(' identifiers ')' AS '(' select_query ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 187 + identifier goto 189 -state 119 - recursive: RECURSIVE. (264) +state 120 + recursive: RECURSIVE. (268) - . reduce 264 (src line 1463) + . reduce 268 (src line 1482) -state 120 +state 121 variable_substitution: variable SUBSTITUTION_OP.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 188 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 190 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 121 +state 122 select_query: common_table_clause select_entity order_by_clause.limit_clause offset_clause - limit_clause: . (67) + limit_clause: . (71) - LIMIT shift 190 - . reduce 67 (src line 497) + LIMIT shift 192 + . reduce 71 (src line 516) - limit_clause goto 189 + limit_clause goto 191 -state 122 +state 123 order_by_clause: ORDER.BY order_items - BY shift 191 + BY shift 193 . error -state 123 +state 124 insert_query: common_table_clause INSERT INTO.identifier VALUES row_values insert_query: common_table_clause INSERT INTO.identifier '(' field_references ')' VALUES row_values insert_query: common_table_clause INSERT INTO.identifier select_query insert_query: common_table_clause INSERT INTO.identifier '(' field_references ')' select_query - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 192 + identifier goto 194 -state 124 +state 125 update_query: common_table_clause UPDATE identified_tables.SET update_set_list from_clause where_clause - SET shift 193 + SET shift 195 . error -state 125 - identified_tables: identified_table. (191) +state 126 + identified_tables: identified_table. (195) identified_tables: identified_table.',' identified_tables - ',' shift 194 - . reduce 191 (src line 1090) + ',' shift 196 + . reduce 195 (src line 1109) -state 126 - identified_table: identifier. (156) +state 127 + identified_table: identifier. (160) identified_table: identifier.identifier identified_table: identifier.AS identifier - IDENTIFIER shift 64 - AS shift 196 - . reduce 156 (src line 924) + IDENTIFIER shift 65 + AS shift 198 + . reduce 160 (src line 943) - identifier goto 195 + identifier goto 197 -state 127 +state 128 delete_query: common_table_clause DELETE FROM.tables where_clause - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 198 - join goto 201 - tables goto 197 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 200 + join goto 203 + tables goto 199 + identifier goto 127 -state 128 +state 129 delete_query: common_table_clause DELETE identified_tables.FROM tables where_clause - FROM shift 205 + FROM shift 207 . error -state 129 +state 130 select_entity: select_clause from_clause.where_clause group_by_clause having_clause - where_clause: . (59) + where_clause: . (63) - WHERE shift 207 - . reduce 59 (src line 457) + WHERE shift 209 + . reduce 63 (src line 476) - where_clause goto 206 + where_clause goto 208 -state 130 +state 131 from_clause: FROM.tables - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 198 - join goto 201 - tables goto 208 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 200 + join goto 203 + tables goto 210 + identifier goto 127 -state 131 +state 132 select_entity: select_set_entity UNION.all select_set_entity - all: . (261) + all: . (265) - ALL shift 210 - . reduce 261 (src line 1448) + ALL shift 212 + . reduce 265 (src line 1467) - all goto 209 + all goto 211 -state 132 +state 133 select_entity: select_set_entity INTERSECT.all select_set_entity - all: . (261) + all: . (265) - ALL shift 210 - . reduce 261 (src line 1448) + ALL shift 212 + . reduce 265 (src line 1467) - all goto 211 + all goto 213 -state 133 +state 134 select_entity: select_set_entity EXCEPT.all select_set_entity - all: . (261) + all: . (265) - ALL shift 210 - . reduce 261 (src line 1448) + ALL shift 212 + . reduce 265 (src line 1467) - all goto 212 + all goto 214 -state 134 +state 135 select_clause: SELECT distinct.fields - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '*' shift 218 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 216 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - analytic_function goto 217 - field_object goto 215 - field goto 214 - case goto 82 - fields goto 213 - identifier goto 219 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '*' shift 220 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 218 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + analytic_function goto 219 + field_object goto 217 + field goto 216 + case goto 83 + fields goto 215 + identifier goto 221 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 135 - distinct: DISTINCT. (250) +state 136 + distinct: DISTINCT. (254) - . reduce 250 (src line 1395) + . reduce 254 (src line 1414) -state 136 +state 137 subquery: '(' select_query.')' - ')' shift 220 + ')' shift 222 . error -state 137 +state 138 select_query: common_table_clause.select_entity order_by_clause limit_clause offset_clause - SELECT shift 52 - '(' shift 54 + SELECT shift 53 + '(' shift 55 . error - select_entity goto 46 - select_set_entity goto 51 - select_clause goto 50 - subquery goto 53 + select_entity goto 47 + select_set_entity goto 52 + select_clause goto 51 + subquery goto 54 -state 138 +state 139 create_table: CREATE TABLE identifier.'(' identifiers ')' - '(' shift 221 + '(' shift 223 . error -state 139 +state 140 add_columns: ALTER TABLE identifier.ADD column_default column_position add_columns: ALTER TABLE identifier.ADD '(' column_defaults ')' column_position drop_columns: ALTER TABLE identifier.DROP field_reference drop_columns: ALTER TABLE identifier.DROP '(' field_references ')' rename_column: ALTER TABLE identifier.RENAME field_reference TO identifier - ADD shift 222 - DROP shift 223 - RENAME shift 224 + ADD shift 224 + DROP shift 225 + RENAME shift 226 . error -state 140 - variable_statement: VAR variable_assignments statement_terminal. (20) +state 141 + variable_statement: VAR variable_assignments statement_terminal. (21) - . reduce 20 (src line 248) + . reduce 21 (src line 253) -state 141 +state 142 variable_assignments: variable_assignment ','.variable_assignments - VARIABLE shift 59 + VARIABLE shift 60 . error - variable_assignment goto 58 - variable_assignments goto 225 + variable_assignment goto 59 + variable_assignments goto 227 -state 142 +state 143 variable_assignment: VARIABLE SUBSTITUTION_OP.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 226 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 228 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 143 +state 144 cursor_statement: DECLARE identifier CURSOR.FOR select_query statement_terminal - FOR shift 227 + FOR shift 229 . error -state 144 - cursor_statement: OPEN identifier statement_terminal. (25) - - . reduce 25 (src line 273) - - state 145 - cursor_statement: CLOSE identifier statement_terminal. (26) + table_statement: DECLARE identifier TABLE.'(' identifiers ')' + table_statement: DECLARE identifier TABLE.'(' identifiers ')' FOR select_query statement_terminal + table_statement: DECLARE identifier TABLE.FOR select_query statement_terminal - . reduce 26 (src line 277) + FOR shift 231 + '(' shift 230 + . error state 146 - cursor_statement: DISPOSE identifier statement_terminal. (27) + cursor_statement: OPEN identifier statement_terminal. (26) - . reduce 27 (src line 281) + . reduce 26 (src line 278) state 147 + cursor_statement: CLOSE identifier statement_terminal. (27) + + . reduce 27 (src line 282) + + +state 148 + cursor_statement: DISPOSE identifier statement_terminal. (28) + + . reduce 28 (src line 286) + + +state 149 cursor_statement: FETCH fetch_position identifier.INTO variables statement_terminal - INTO shift 228 + INTO shift 232 . error -state 148 - fetch_position: ABSOLUTE value. (34) +state 150 + fetch_position: ABSOLUTE value. (38) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -1788,28 +1813,28 @@ state 148 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IDENTIFIER reduce 34 (src line 311) - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IDENTIFIER reduce 38 (src line 330) + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 149 - fetch_position: RELATIVE value. (35) +state 151 + fetch_position: RELATIVE value. (39) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -1827,63 +1852,64 @@ state 149 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IDENTIFIER reduce 35 (src line 315) - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IDENTIFIER reduce 39 (src line 334) + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 150 +state 152 flow_control_statement: IF value THEN.program else END IF statement_terminal flow_control_statement: IF value THEN.program elseif else END IF statement_terminal program: . (1) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - ELSEIF reduce 1 (src line 160) - WHILE shift 29 - ELSE reduce 1 (src line 160) - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - program goto 229 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + ELSEIF reduce 1 (src line 161) + WHILE shift 30 + ELSE reduce 1 (src line 161) + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + program goto 233 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -1891,479 +1917,479 @@ state 150 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 151 +state 153 string_operation: value STRING_OP.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 230 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 234 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 152 +state 154 comparison: value COMPARISON_OP.value - comparison_operator: COMPARISON_OP. (265) - - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . reduce 265 (src line 1469) - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 231 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + comparison_operator: COMPARISON_OP. (269) + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . reduce 269 (src line 1488) + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 235 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 153 +state 155 comparison: value '='.value - comparison_operator: '='. (266) - - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . reduce 266 (src line 1474) - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 232 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + comparison_operator: '='. (270) + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . reduce 270 (src line 1493) + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 236 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 154 +state 156 comparison: value IS.negation ternary comparison: value IS.negation null - negation: . (251) + negation: . (255) - NOT shift 164 - . reduce 251 (src line 1400) + NOT shift 166 + . reduce 255 (src line 1419) - negation goto 233 + negation goto 237 -state 155 +state 157 comparison: value negation.BETWEEN value AND value comparison: value negation.IN row_value comparison: value negation.LIKE value - IN shift 235 - BETWEEN shift 234 - LIKE shift 236 + IN shift 239 + BETWEEN shift 238 + LIKE shift 240 . error -state 156 +state 158 comparison: value comparison_operator.ANY row_value comparison: value comparison_operator.ALL row_value - ALL shift 238 - ANY shift 237 + ALL shift 242 + ANY shift 241 . error -state 157 +state 159 arithmetic: value '+'.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 239 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 243 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 158 +state 160 arithmetic: value '-'.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 240 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 244 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 159 +state 161 arithmetic: value '*'.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 241 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 245 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 160 +state 162 arithmetic: value '/'.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 242 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 246 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 161 +state 163 arithmetic: value '%'.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 243 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 247 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 162 +state 164 logic: value OR.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 244 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 248 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 163 +state 165 logic: value AND.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 245 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 249 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 164 - negation: NOT. (252) +state 166 + negation: NOT. (256) - . reduce 252 (src line 1405) + . reduce 256 (src line 1424) -165: shift/reduce conflict (shift 246(0), red'n 187(0)) on ')' -state 165 +167: shift/reduce conflict (shift 250(0), red'n 191(0)) on ')' +state 167 value: '(' value.')' string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value @@ -2382,65 +2408,65 @@ state 165 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - values: value. (187) + values: value. (191) values: value.',' values - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - ')' shift 246 - ',' shift 247 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + ')' shift 250 + ',' shift 251 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 166 +state 168 row_value: '(' values.')' - ')' shift 248 + ')' shift 252 . error -state 167 +state 169 field_reference: identifier '.'.identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 249 + identifier goto 253 -state 168 +state 170 function: identifier '('.option ')' - option: . (147) - distinct: . (249) + option: . (151) + distinct: . (253) - DISTINCT shift 135 - ')' reduce 147 (src line 878) - . reduce 249 (src line 1390) + DISTINCT shift 136 + ')' reduce 151 (src line 897) + . reduce 253 (src line 1409) - option goto 250 - distinct goto 251 + option goto 254 + distinct goto 255 -state 169 +state 171 case: CASE case_value.case_when case_else END - WHEN shift 253 + WHEN shift 257 . error - case_when goto 252 + case_when goto 256 -state 170 +state 172 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -2458,78 +2484,78 @@ state 170 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - case_value: value. (182) - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - WHEN reduce 182 (src line 1045) - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + case_value: value. (186) + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + WHEN reduce 186 (src line 1064) + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 171 +state 173 comparison: row_value COMPARISON_OP.row_value - comparison_operator: COMPARISON_OP. (265) + comparison_operator: COMPARISON_OP. (269) - '(' shift 255 - . reduce 265 (src line 1469) + '(' shift 259 + . reduce 269 (src line 1488) - row_value goto 254 - subquery goto 256 + row_value goto 258 + subquery goto 260 -state 172 +state 174 comparison: row_value '='.row_value - comparison_operator: '='. (266) + comparison_operator: '='. (270) - '(' shift 255 - . reduce 266 (src line 1474) + '(' shift 259 + . reduce 270 (src line 1493) - row_value goto 257 - subquery goto 256 + row_value goto 261 + subquery goto 260 -state 173 +state 175 comparison: row_value negation.BETWEEN row_value AND row_value comparison: row_value negation.IN '(' row_values ')' comparison: row_value negation.IN subquery - IN shift 259 - BETWEEN shift 258 + IN shift 263 + BETWEEN shift 262 . error -state 174 +state 176 comparison: row_value comparison_operator.ANY '(' row_values ')' comparison: row_value comparison_operator.ANY subquery comparison: row_value comparison_operator.ALL '(' row_values ')' comparison: row_value comparison_operator.ALL subquery - ALL shift 261 - ANY shift 260 + ALL shift 265 + ANY shift 264 . error -state 175 - comparison: EXISTS subquery. (136) +state 177 + comparison: EXISTS subquery. (140) - . reduce 136 (src line 827) + . reduce 140 (src line 846) - 176: reduce/reduce conflict (red'ns 144 and 251) on IN - 176: reduce/reduce conflict (red'ns 144 and 251) on BETWEEN - 176: reduce/reduce conflict (red'ns 144 and 251) on LIKE -state 176 + 178: reduce/reduce conflict (red'ns 148 and 255) on IN + 178: reduce/reduce conflict (red'ns 148 and 255) on BETWEEN + 178: reduce/reduce conflict (red'ns 148 and 255) on LIKE +state 178 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -2547,97 +2573,98 @@ state 176 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - logic: NOT value. (144) - negation: . (251) - - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 144 (src line 863) - - negation goto 155 - comparison_operator goto 156 + logic: NOT value. (148) + negation: . (255) + + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 148 (src line 882) + + negation goto 157 + comparison_operator goto 158 -state 177 +state 179 cursor_status: CURSOR identifier.IS negation OPEN cursor_status: CURSOR identifier.IS negation IN RANGE - IS shift 262 + IS shift 266 . error -state 178 - integer: '-' integer. (235) +state 180 + integer: '-' integer. (239) - . reduce 235 (src line 1313) + . reduce 239 (src line 1332) -state 179 - float: '-' float. (237) +state 181 + float: '-' float. (241) - . reduce 237 (src line 1324) + . reduce 241 (src line 1343) -state 180 +state 182 group_concat: GROUP_CONCAT '('.option order_by_clause ')' group_concat: GROUP_CONCAT '('.option order_by_clause SEPARATOR STRING ')' - option: . (147) - distinct: . (249) + option: . (151) + distinct: . (253) - ORDER reduce 147 (src line 878) - DISTINCT shift 135 - SEPARATOR reduce 147 (src line 878) - ')' reduce 147 (src line 878) - . reduce 249 (src line 1390) + ORDER reduce 151 (src line 897) + DISTINCT shift 136 + SEPARATOR reduce 151 (src line 897) + ')' reduce 151 (src line 897) + . reduce 253 (src line 1409) - option goto 263 - distinct goto 251 + option goto 267 + distinct goto 255 -state 181 +state 183 flow_control_statement: WHILE value DO.in_loop_program END WHILE statement_terminal in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - WHILE shift 29 - END reduce 3 (src line 172) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - in_loop_program goto 264 - statement goto 266 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + WHILE shift 30 + END reduce 3 (src line 173) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + in_loop_program goto 268 + statement goto 270 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -2645,88 +2672,88 @@ state 181 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 182 +state 184 flow_control_statement: WHILE variables IN.identifier DO in_loop_program END WHILE statement_terminal - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 271 + identifier goto 275 -state 183 +state 185 variables: variable ','.variables - VARIABLE shift 35 + VARIABLE shift 36 . error - variable goto 273 - variables goto 272 + variable goto 277 + variables goto 276 -state 184 +state 186 command_statement: SET FLAG '='.primary statement_terminal - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - NULL shift 108 - '-' shift 104 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + NULL shift 109 + '-' shift 105 . error - primary goto 274 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 + primary goto 278 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 -state 185 - command_statement: PRINT value statement_terminal. (48) +state 187 + command_statement: PRINT value statement_terminal. (52) - . reduce 48 (src line 375) + . reduce 52 (src line 394) -state 186 +state 188 common_tables: common_table ','.common_tables - recursive: . (263) + recursive: . (267) - RECURSIVE shift 119 - . reduce 263 (src line 1458) + RECURSIVE shift 120 + . reduce 267 (src line 1477) - common_table goto 117 - common_tables goto 275 - recursive goto 118 + common_table goto 118 + common_tables goto 279 + recursive goto 119 -state 187 +state 189 common_table: recursive identifier.AS '(' select_query ')' common_table: recursive identifier.'(' identifiers ')' AS '(' select_query ')' - AS shift 276 - '(' shift 277 - . error - - -188: shift/reduce conflict (shift 163(4), red'n 244(0)) on AND -188: shift/reduce conflict (shift 162(3), red'n 244(0)) on OR -188: shift/reduce conflict (shift 164(5), red'n 244(0)) on NOT -188: shift/reduce conflict (shift 154(6), red'n 244(0)) on IS -188: shift/reduce conflict (shift 152(6), red'n 244(0)) on COMPARISON_OP -188: shift/reduce conflict (shift 151(7), red'n 244(0)) on STRING_OP -188: shift/reduce conflict (shift 153(6), red'n 244(0)) on '=' -188: shift/reduce conflict (shift 157(8), red'n 244(0)) on '+' -188: shift/reduce conflict (shift 158(8), red'n 244(0)) on '-' -188: shift/reduce conflict (shift 159(9), red'n 244(0)) on '*' -188: shift/reduce conflict (shift 160(9), red'n 244(0)) on '/' -188: shift/reduce conflict (shift 161(9), red'n 244(0)) on '%' - 188: reduce/reduce conflict (red'ns 244 and 251) on IN - 188: reduce/reduce conflict (red'ns 244 and 251) on BETWEEN - 188: reduce/reduce conflict (red'ns 244 and 251) on LIKE -state 188 + AS shift 280 + '(' shift 281 + . error + + +190: shift/reduce conflict (shift 165(4), red'n 248(0)) on AND +190: shift/reduce conflict (shift 164(3), red'n 248(0)) on OR +190: shift/reduce conflict (shift 166(5), red'n 248(0)) on NOT +190: shift/reduce conflict (shift 156(6), red'n 248(0)) on IS +190: shift/reduce conflict (shift 154(6), red'n 248(0)) on COMPARISON_OP +190: shift/reduce conflict (shift 153(7), red'n 248(0)) on STRING_OP +190: shift/reduce conflict (shift 155(6), red'n 248(0)) on '=' +190: shift/reduce conflict (shift 159(8), red'n 248(0)) on '+' +190: shift/reduce conflict (shift 160(8), red'n 248(0)) on '-' +190: shift/reduce conflict (shift 161(9), red'n 248(0)) on '*' +190: shift/reduce conflict (shift 162(9), red'n 248(0)) on '/' +190: shift/reduce conflict (shift 163(9), red'n 248(0)) on '%' + 190: reduce/reduce conflict (red'ns 248 and 255) on IN + 190: reduce/reduce conflict (red'ns 248 and 255) on BETWEEN + 190: reduce/reduce conflict (red'ns 248 and 255) on LIKE +state 190 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -2744,393 +2771,393 @@ state 188 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - variable_substitution: variable SUBSTITUTION_OP value. (244) - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 244 (src line 1364) - - negation goto 155 - comparison_operator goto 156 + variable_substitution: variable SUBSTITUTION_OP value. (248) + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 248 (src line 1383) + + negation goto 157 + comparison_operator goto 158 -state 189 +state 191 select_query: common_table_clause select_entity order_by_clause limit_clause.offset_clause - offset_clause: . (72) + offset_clause: . (76) - OFFSET shift 279 - . reduce 72 (src line 521) + OFFSET shift 283 + . reduce 76 (src line 540) - offset_clause goto 278 + offset_clause goto 282 -state 190 +state 192 limit_clause: LIMIT.value limit_with limit_clause: LIMIT.value PERCENT limit_with - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 280 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 284 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 191 +state 193 order_by_clause: ORDER BY.order_items - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 284 - row_value goto 98 - order_items goto 281 - order_item goto 282 - order_value goto 283 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - analytic_function goto 285 - case goto 82 - identifier goto 219 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 - -192: shift/reduce conflict (shift 287(0), red'n 74(0)) on '(' -state 192 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 288 + row_value goto 99 + order_items goto 285 + order_item goto 286 + order_value goto 287 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + analytic_function goto 289 + case goto 83 + identifier goto 221 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +194: shift/reduce conflict (shift 291(0), red'n 78(0)) on '(' +state 194 insert_query: common_table_clause INSERT INTO identifier.VALUES row_values insert_query: common_table_clause INSERT INTO identifier.'(' field_references ')' VALUES row_values insert_query: common_table_clause INSERT INTO identifier.select_query insert_query: common_table_clause INSERT INTO identifier.'(' field_references ')' select_query - common_table_clause: . (74) + common_table_clause: . (78) - VALUES shift 286 - WITH shift 33 - '(' shift 287 - . reduce 74 (src line 531) + VALUES shift 290 + WITH shift 34 + '(' shift 291 + . reduce 78 (src line 550) - select_query goto 288 - common_table_clause goto 137 + select_query goto 292 + common_table_clause goto 138 -state 193 +state 195 update_query: common_table_clause UPDATE identified_tables SET.update_set_list from_clause where_clause - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 291 - update_set goto 290 - update_set_list goto 289 - identifier goto 292 + field_reference goto 295 + update_set goto 294 + update_set_list goto 293 + identifier goto 296 -state 194 +state 196 identified_tables: identified_table ','.identified_tables - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identified_table goto 125 - identified_tables goto 293 - identifier goto 126 + identified_table goto 126 + identified_tables goto 297 + identifier goto 127 -state 195 - identified_table: identifier identifier. (157) +state 197 + identified_table: identifier identifier. (161) - . reduce 157 (src line 929) + . reduce 161 (src line 948) -state 196 +state 198 identified_table: identifier AS.identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 294 + identifier goto 298 -state 197 +state 199 delete_query: common_table_clause DELETE FROM tables.where_clause - where_clause: . (59) + where_clause: . (63) - WHERE shift 207 - . reduce 59 (src line 457) + WHERE shift 209 + . reduce 63 (src line 476) - where_clause goto 295 + where_clause goto 299 - 198: reduce/reduce conflict (red'ns 253 and 257) on JOIN -state 198 + 200: reduce/reduce conflict (red'ns 257 and 261) on JOIN +state 200 join: table.join_inner JOIN table join_condition join: table.NATURAL join_inner JOIN table join: table.join_direction join_outer JOIN table join_condition join: table.NATURAL join_direction join_outer JOIN table join: table.CROSS JOIN table - tables: table. (189) + tables: table. (193) tables: table.',' tables - join_inner: . (253) - join_direction: . (257) - - JOIN reduce 253 (src line 1410) - INNER shift 301 - OUTER reduce 257 (src line 1430) - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - NATURAL shift 297 - ',' shift 300 - . reduce 189 (src line 1080) - - join_inner goto 296 - join_direction goto 298 + join_inner: . (257) + join_direction: . (261) + + JOIN reduce 257 (src line 1429) + INNER shift 305 + OUTER reduce 261 (src line 1449) + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + NATURAL shift 301 + ',' shift 304 + . reduce 193 (src line 1099) + + join_inner goto 300 + join_direction goto 302 -state 199 - table: identified_table. (161) +state 201 + table: identified_table. (165) - . reduce 161 (src line 948) + . reduce 165 (src line 967) -state 200 - table: virtual_table. (162) +state 202 + table: virtual_table. (166) table: virtual_table.identifier table: virtual_table.AS identifier - IDENTIFIER shift 64 - AS shift 306 - . reduce 162 (src line 953) + IDENTIFIER shift 65 + AS shift 310 + . reduce 166 (src line 972) - identifier goto 305 + identifier goto 309 -state 201 - table: join. (165) +state 203 + table: join. (169) - . reduce 165 (src line 965) + . reduce 169 (src line 984) -state 202 - table: DUAL. (166) +state 204 + table: DUAL. (170) - . reduce 166 (src line 969) + . reduce 170 (src line 988) -state 203 - virtual_table: subquery. (159) +state 205 + virtual_table: subquery. (163) - . reduce 159 (src line 938) + . reduce 163 (src line 957) -state 204 - virtual_table: STDIN. (160) +state 206 + virtual_table: STDIN. (164) - . reduce 160 (src line 943) + . reduce 164 (src line 962) -state 205 +state 207 delete_query: common_table_clause DELETE identified_tables FROM.tables where_clause - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 198 - join goto 201 - tables goto 307 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 200 + join goto 203 + tables goto 311 + identifier goto 127 -state 206 +state 208 select_entity: select_clause from_clause where_clause.group_by_clause having_clause - group_by_clause: . (61) + group_by_clause: . (65) - GROUP shift 309 - . reduce 61 (src line 467) + GROUP shift 313 + . reduce 65 (src line 486) - group_by_clause goto 308 + group_by_clause goto 312 -state 207 +state 209 where_clause: WHERE.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 310 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 314 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 208 - from_clause: FROM tables. (58) +state 210 + from_clause: FROM tables. (62) - . reduce 58 (src line 452) + . reduce 62 (src line 471) -state 209 +state 211 select_entity: select_set_entity UNION all.select_set_entity - SELECT shift 52 - '(' shift 54 + SELECT shift 53 + '(' shift 55 . error - select_entity goto 312 - select_set_entity goto 311 - select_clause goto 50 - subquery goto 53 + select_entity goto 316 + select_set_entity goto 315 + select_clause goto 51 + subquery goto 54 -state 210 - all: ALL. (262) +state 212 + all: ALL. (266) - . reduce 262 (src line 1453) + . reduce 266 (src line 1472) -state 211 +state 213 select_entity: select_set_entity INTERSECT all.select_set_entity - SELECT shift 52 - '(' shift 54 + SELECT shift 53 + '(' shift 55 . error - select_entity goto 312 - select_set_entity goto 313 - select_clause goto 50 - subquery goto 53 + select_entity goto 316 + select_set_entity goto 317 + select_clause goto 51 + subquery goto 54 -state 212 +state 214 select_entity: select_set_entity EXCEPT all.select_set_entity - SELECT shift 52 - '(' shift 54 + SELECT shift 53 + '(' shift 55 . error - select_entity goto 312 - select_set_entity goto 314 - select_clause goto 50 - subquery goto 53 + select_entity goto 316 + select_set_entity goto 318 + select_clause goto 51 + subquery goto 54 -state 213 - select_clause: SELECT distinct fields. (56) +state 215 + select_clause: SELECT distinct fields. (60) - . reduce 56 (src line 441) + . reduce 60 (src line 460) -state 214 - fields: field. (195) +state 216 + fields: field. (199) fields: field.',' fields - ',' shift 315 - . reduce 195 (src line 1110) + ',' shift 319 + . reduce 199 (src line 1129) -state 215 - field: field_object. (178) +state 217 + field: field_object. (182) field: field_object.AS identifier - AS shift 316 - . reduce 178 (src line 1024) + AS shift 320 + . reduce 182 (src line 1043) -state 216 +state 218 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3148,106 +3175,106 @@ state 216 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - field_object: value. (175) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 175 (src line 1010) + field_object: value. (179) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 179 (src line 1029) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 -state 217 - field_object: analytic_function. (176) +state 219 + field_object: analytic_function. (180) - . reduce 176 (src line 1015) + . reduce 180 (src line 1034) -state 218 - field_object: '*'. (177) +state 220 + field_object: '*'. (181) - . reduce 177 (src line 1019) + . reduce 181 (src line 1038) -219: shift/reduce conflict (shift 317(0), red'n 86(0)) on '(' -state 219 - field_reference: identifier. (86) +221: shift/reduce conflict (shift 321(0), red'n 90(0)) on '(' +state 221 + field_reference: identifier. (90) field_reference: identifier.'.' identifier function: identifier.'(' option ')' analytic_function: identifier.'(' option ')' OVER '(' analytic_clause ')' - '(' shift 317 - '.' shift 167 - . reduce 86 (src line 587) + '(' shift 321 + '.' shift 169 + . reduce 90 (src line 606) -state 220 - subquery: '(' select_query ')'. (116) +state 222 + subquery: '(' select_query ')'. (120) - . reduce 116 (src line 725) + . reduce 120 (src line 744) -state 221 +state 223 create_table: CREATE TABLE identifier '('.identifiers ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifiers goto 318 - identifier goto 319 + identifiers goto 322 + identifier goto 323 -state 222 +state 224 add_columns: ALTER TABLE identifier ADD.column_default column_position add_columns: ALTER TABLE identifier ADD.'(' column_defaults ')' column_position - IDENTIFIER shift 64 - '(' shift 321 + IDENTIFIER shift 65 + '(' shift 325 . error - column_default goto 320 - identifier goto 322 + column_default goto 324 + identifier goto 326 -state 223 +state 225 drop_columns: ALTER TABLE identifier DROP.field_reference drop_columns: ALTER TABLE identifier DROP.'(' field_references ')' - IDENTIFIER shift 64 - '(' shift 324 + IDENTIFIER shift 65 + '(' shift 328 . error - field_reference goto 323 - identifier goto 292 + field_reference goto 327 + identifier goto 296 -state 224 +state 226 rename_column: ALTER TABLE identifier RENAME.field_reference TO identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 325 - identifier goto 292 + field_reference goto 329 + identifier goto 296 -state 225 - variable_assignments: variable_assignment ',' variable_assignments. (248) +state 227 + variable_assignments: variable_assignment ',' variable_assignments. (252) - . reduce 248 (src line 1385) + . reduce 252 (src line 1404) -state 226 +state 228 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3265,66 +3292,86 @@ state 226 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - variable_assignment: VARIABLE SUBSTITUTION_OP value. (246) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 246 (src line 1375) - - negation goto 155 - comparison_operator goto 156 + variable_assignment: VARIABLE SUBSTITUTION_OP value. (250) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 250 (src line 1394) + + negation goto 157 + comparison_operator goto 158 -state 227 +state 229 cursor_statement: DECLARE identifier CURSOR FOR.select_query statement_terminal - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - . reduce 74 (src line 531) + WITH shift 34 + . reduce 78 (src line 550) - select_query goto 326 - common_table_clause goto 137 + select_query goto 330 + common_table_clause goto 138 -state 228 +state 230 + table_statement: DECLARE identifier TABLE '('.identifiers ')' + table_statement: DECLARE identifier TABLE '('.identifiers ')' FOR select_query statement_terminal + + IDENTIFIER shift 65 + . error + + identifiers goto 331 + identifier goto 323 + +state 231 + table_statement: DECLARE identifier TABLE FOR.select_query statement_terminal + common_table_clause: . (78) + + WITH shift 34 + . reduce 78 (src line 550) + + select_query goto 332 + common_table_clause goto 138 + +state 232 cursor_statement: FETCH fetch_position identifier INTO.variables statement_terminal - VARIABLE shift 35 + VARIABLE shift 36 . error - variable goto 273 - variables goto 327 + variable goto 277 + variables goto 333 -state 229 +state 233 flow_control_statement: IF value THEN program.else END IF statement_terminal flow_control_statement: IF value THEN program.elseif else END IF statement_terminal - else: . (226) + else: . (230) - ELSEIF shift 331 - ELSE shift 330 - . reduce 226 (src line 1266) + ELSEIF shift 337 + ELSE shift 336 + . reduce 230 (src line 1285) - elseif goto 329 - else goto 328 + elseif goto 335 + else goto 334 - 230: reduce/reduce conflict (red'ns 117 and 251) on IN - 230: reduce/reduce conflict (red'ns 117 and 251) on BETWEEN - 230: reduce/reduce conflict (red'ns 117 and 251) on LIKE -state 230 + 234: reduce/reduce conflict (red'ns 121 and 255) on IN + 234: reduce/reduce conflict (red'ns 121 and 255) on BETWEEN + 234: reduce/reduce conflict (red'ns 121 and 255) on LIKE +state 234 string_operation: value.STRING_OP value - string_operation: value STRING_OP value. (117) + string_operation: value STRING_OP value. (121) comparison: value.COMPARISON_OP value comparison: value.'=' value comparison: value.IS negation ternary @@ -3341,25 +3388,25 @@ state 230 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 117 (src line 731) + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 121 (src line 750) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 231: reduce/reduce conflict (red'ns 118 and 251) on IN - 231: reduce/reduce conflict (red'ns 118 and 251) on BETWEEN - 231: reduce/reduce conflict (red'ns 118 and 251) on LIKE -state 231 + 235: reduce/reduce conflict (red'ns 122 and 255) on IN + 235: reduce/reduce conflict (red'ns 122 and 255) on BETWEEN + 235: reduce/reduce conflict (red'ns 122 and 255) on LIKE +state 235 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value - comparison: value COMPARISON_OP value. (118) + comparison: value COMPARISON_OP value. (122) comparison: value.'=' value comparison: value.IS negation ternary comparison: value.IS negation null @@ -3375,30 +3422,30 @@ state 231 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) IS error COMPARISON_OP error - STRING_OP shift 151 + STRING_OP shift 153 '=' error - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 118 (src line 754) - - negation goto 155 - comparison_operator goto 156 - - 232: reduce/reduce conflict (red'ns 120 and 251) on IN - 232: reduce/reduce conflict (red'ns 120 and 251) on BETWEEN - 232: reduce/reduce conflict (red'ns 120 and 251) on LIKE -state 232 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 122 (src line 773) + + negation goto 157 + comparison_operator goto 158 + + 236: reduce/reduce conflict (red'ns 124 and 255) on IN + 236: reduce/reduce conflict (red'ns 124 and 255) on BETWEEN + 236: reduce/reduce conflict (red'ns 124 and 255) on LIKE +state 236 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value - comparison: value '=' value. (120) + comparison: value '=' value. (124) comparison: value.IS negation ternary comparison: value.IS negation null comparison: value.negation BETWEEN value AND value @@ -3413,150 +3460,150 @@ state 232 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) IS error COMPARISON_OP error - STRING_OP shift 151 + STRING_OP shift 153 '=' error - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 120 (src line 763) + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 124 (src line 782) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 -state 233 +state 237 comparison: value IS negation.ternary comparison: value IS negation.null - TERNARY shift 106 - NULL shift 108 + TERNARY shift 107 + NULL shift 109 . error - ternary goto 332 - null goto 333 + ternary goto 338 + null goto 339 -state 234 +state 238 comparison: value negation BETWEEN.value AND value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 334 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 340 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 235 +state 239 comparison: value negation IN.row_value - '(' shift 255 + '(' shift 259 . error - row_value goto 335 - subquery goto 256 + row_value goto 341 + subquery goto 260 -state 236 +state 240 comparison: value negation LIKE.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 336 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 342 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 237 +state 241 comparison: value comparison_operator ANY.row_value - '(' shift 255 + '(' shift 259 . error - row_value goto 337 - subquery goto 256 + row_value goto 343 + subquery goto 260 -state 238 +state 242 comparison: value comparison_operator ALL.row_value - '(' shift 255 + '(' shift 259 . error - row_value goto 338 - subquery goto 256 + row_value goto 344 + subquery goto 260 - 239: reduce/reduce conflict (red'ns 137 and 251) on IN - 239: reduce/reduce conflict (red'ns 137 and 251) on BETWEEN - 239: reduce/reduce conflict (red'ns 137 and 251) on LIKE -state 239 + 243: reduce/reduce conflict (red'ns 141 and 255) on IN + 243: reduce/reduce conflict (red'ns 141 and 255) on BETWEEN + 243: reduce/reduce conflict (red'ns 141 and 255) on LIKE +state 243 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3568,27 +3615,27 @@ state 239 comparison: value.comparison_operator ANY row_value comparison: value.comparison_operator ALL row_value arithmetic: value.'+' value - arithmetic: value '+' value. (137) + arithmetic: value '+' value. (141) arithmetic: value.'-' value arithmetic: value.'*' value arithmetic: value.'/' value arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 137 (src line 832) + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 141 (src line 851) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 240: reduce/reduce conflict (red'ns 138 and 251) on IN - 240: reduce/reduce conflict (red'ns 138 and 251) on BETWEEN - 240: reduce/reduce conflict (red'ns 138 and 251) on LIKE -state 240 + 244: reduce/reduce conflict (red'ns 142 and 255) on IN + 244: reduce/reduce conflict (red'ns 142 and 255) on BETWEEN + 244: reduce/reduce conflict (red'ns 142 and 255) on LIKE +state 244 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3601,26 +3648,26 @@ state 240 comparison: value.comparison_operator ALL row_value arithmetic: value.'+' value arithmetic: value.'-' value - arithmetic: value '-' value. (138) + arithmetic: value '-' value. (142) arithmetic: value.'*' value arithmetic: value.'/' value arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 138 (src line 837) + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 142 (src line 856) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 241: reduce/reduce conflict (red'ns 139 and 251) on IN - 241: reduce/reduce conflict (red'ns 139 and 251) on BETWEEN - 241: reduce/reduce conflict (red'ns 139 and 251) on LIKE -state 241 + 245: reduce/reduce conflict (red'ns 143 and 255) on IN + 245: reduce/reduce conflict (red'ns 143 and 255) on BETWEEN + 245: reduce/reduce conflict (red'ns 143 and 255) on LIKE +state 245 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3634,22 +3681,22 @@ state 241 arithmetic: value.'+' value arithmetic: value.'-' value arithmetic: value.'*' value - arithmetic: value '*' value. (139) + arithmetic: value '*' value. (143) arithmetic: value.'/' value arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - . reduce 139 (src line 841) + . reduce 143 (src line 860) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 242: reduce/reduce conflict (red'ns 140 and 251) on IN - 242: reduce/reduce conflict (red'ns 140 and 251) on BETWEEN - 242: reduce/reduce conflict (red'ns 140 and 251) on LIKE -state 242 + 246: reduce/reduce conflict (red'ns 144 and 255) on IN + 246: reduce/reduce conflict (red'ns 144 and 255) on BETWEEN + 246: reduce/reduce conflict (red'ns 144 and 255) on LIKE +state 246 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3664,21 +3711,21 @@ state 242 arithmetic: value.'-' value arithmetic: value.'*' value arithmetic: value.'/' value - arithmetic: value '/' value. (140) + arithmetic: value '/' value. (144) arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - . reduce 140 (src line 845) + . reduce 144 (src line 864) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 243: reduce/reduce conflict (red'ns 141 and 251) on IN - 243: reduce/reduce conflict (red'ns 141 and 251) on BETWEEN - 243: reduce/reduce conflict (red'ns 141 and 251) on LIKE -state 243 + 247: reduce/reduce conflict (red'ns 145 and 255) on IN + 247: reduce/reduce conflict (red'ns 145 and 255) on BETWEEN + 247: reduce/reduce conflict (red'ns 145 and 255) on LIKE +state 247 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3694,20 +3741,20 @@ state 243 arithmetic: value.'*' value arithmetic: value.'/' value arithmetic: value.'%' value - arithmetic: value '%' value. (141) + arithmetic: value '%' value. (145) logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) - . reduce 141 (src line 849) + . reduce 145 (src line 868) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 - 244: reduce/reduce conflict (red'ns 142 and 251) on IN - 244: reduce/reduce conflict (red'ns 142 and 251) on BETWEEN - 244: reduce/reduce conflict (red'ns 142 and 251) on LIKE -state 244 + 248: reduce/reduce conflict (red'ns 146 and 255) on IN + 248: reduce/reduce conflict (red'ns 146 and 255) on BETWEEN + 248: reduce/reduce conflict (red'ns 146 and 255) on LIKE +state 248 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3724,30 +3771,30 @@ state 244 arithmetic: value.'/' value arithmetic: value.'%' value logic: value.OR value - logic: value OR value. (142) + logic: value OR value. (146) logic: value.AND value - negation: . (251) - - AND shift 163 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 142 (src line 854) - - negation goto 155 - comparison_operator goto 156 - - 245: reduce/reduce conflict (red'ns 143 and 251) on IN - 245: reduce/reduce conflict (red'ns 143 and 251) on BETWEEN - 245: reduce/reduce conflict (red'ns 143 and 251) on LIKE -state 245 + negation: . (255) + + AND shift 165 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 146 (src line 873) + + negation goto 157 + comparison_operator goto 158 + + 249: reduce/reduce conflict (red'ns 147 and 255) on IN + 249: reduce/reduce conflict (red'ns 147 and 255) on BETWEEN + 249: reduce/reduce conflict (red'ns 147 and 255) on LIKE +state 249 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -3765,365 +3812,366 @@ state 245 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - logic: value AND value. (143) - negation: . (251) - - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 143 (src line 859) - - negation goto 155 - comparison_operator goto 156 + logic: value AND value. (147) + negation: . (255) + + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 147 (src line 878) + + negation goto 157 + comparison_operator goto 158 -state 246 - value: '(' value ')'. (100) +state 250 + value: '(' value ')'. (104) - . reduce 100 (src line 646) + . reduce 104 (src line 665) -state 247 +state 251 values: value ','.values - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 340 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 339 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 346 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 345 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 248 - row_value: '(' values ')'. (101) +state 252 + row_value: '(' values ')'. (105) - . reduce 101 (src line 651) + . reduce 105 (src line 670) -state 249 - field_reference: identifier '.' identifier. (87) +state 253 + field_reference: identifier '.' identifier. (91) - . reduce 87 (src line 592) + . reduce 91 (src line 611) -state 250 +state 254 function: identifier '(' option.')' - ')' shift 341 + ')' shift 347 . error -state 251 +state 255 option: distinct.'*' option: distinct.values - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '*' shift 342 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 340 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 343 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '*' shift 348 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 346 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 349 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 252 +state 256 case: CASE case_value case_when.case_else END case_when: case_when.case_when - case_else: . (183) + case_else: . (187) - WHEN shift 253 - ELSE shift 346 - . reduce 183 (src line 1050) + WHEN shift 257 + ELSE shift 352 + . reduce 187 (src line 1069) - case_else goto 344 - case_when goto 345 + case_else goto 350 + case_when goto 351 -state 253 +state 257 case_when: WHEN.value THEN value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 347 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 353 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 254 - comparison: row_value COMPARISON_OP row_value. (119) +state 258 + comparison: row_value COMPARISON_OP row_value. (123) - . reduce 119 (src line 759) + . reduce 123 (src line 778) -255: shift/reduce conflict (shift 88(0), red'n 74(0)) on '(' -state 255 +259: shift/reduce conflict (shift 89(0), red'n 78(0)) on '(' +state 259 row_value: '('.values ')' subquery: '('.select_query ')' - common_table_clause: . (74) - - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - WITH shift 33 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . reduce 74 (src line 531) - - cursor_status goto 87 - select_query goto 136 - common_table_clause goto 137 - primary goto 77 - field_reference goto 76 - value goto 340 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 166 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + common_table_clause: . (78) + + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + WITH shift 34 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . reduce 78 (src line 550) + + cursor_status goto 88 + select_query goto 137 + common_table_clause goto 138 + primary goto 78 + field_reference goto 77 + value goto 346 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 168 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 256 - row_value: subquery. (102) +state 260 + row_value: subquery. (106) - . reduce 102 (src line 656) + . reduce 106 (src line 675) -state 257 - comparison: row_value '=' row_value. (121) +state 261 + comparison: row_value '=' row_value. (125) - . reduce 121 (src line 767) + . reduce 125 (src line 786) -state 258 +state 262 comparison: row_value negation BETWEEN.row_value AND row_value - '(' shift 255 + '(' shift 259 . error - row_value goto 348 - subquery goto 256 + row_value goto 354 + subquery goto 260 -state 259 +state 263 comparison: row_value negation IN.'(' row_values ')' comparison: row_value negation IN.subquery - '(' shift 349 + '(' shift 355 . error - subquery goto 350 + subquery goto 356 -state 260 +state 264 comparison: row_value comparison_operator ANY.'(' row_values ')' comparison: row_value comparison_operator ANY.subquery - '(' shift 351 + '(' shift 357 . error - subquery goto 352 + subquery goto 358 -state 261 +state 265 comparison: row_value comparison_operator ALL.'(' row_values ')' comparison: row_value comparison_operator ALL.subquery - '(' shift 353 + '(' shift 359 . error - subquery goto 354 + subquery goto 360 -state 262 +state 266 cursor_status: CURSOR identifier IS.negation OPEN cursor_status: CURSOR identifier IS.negation IN RANGE - negation: . (251) + negation: . (255) - NOT shift 164 - . reduce 251 (src line 1400) + NOT shift 166 + . reduce 255 (src line 1419) - negation goto 355 + negation goto 361 -state 263 +state 267 group_concat: GROUP_CONCAT '(' option.order_by_clause ')' group_concat: GROUP_CONCAT '(' option.order_by_clause SEPARATOR STRING ')' - order_by_clause: . (65) + order_by_clause: . (69) - ORDER shift 122 - . reduce 65 (src line 487) + ORDER shift 123 + . reduce 69 (src line 506) - order_by_clause goto 356 + order_by_clause goto 362 -state 264 +state 268 flow_control_statement: WHILE value DO in_loop_program.END WHILE statement_terminal - END shift 357 + END shift 363 . error -state 265 +state 269 in_loop_program: in_loop_statement.in_loop_program in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - ELSEIF reduce 3 (src line 172) - WHILE shift 29 - ELSE reduce 3 (src line 172) - END reduce 3 (src line 172) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - in_loop_program goto 358 - statement goto 266 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + ELSEIF reduce 3 (src line 173) + WHILE shift 30 + ELSE reduce 3 (src line 173) + END reduce 3 (src line 173) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + in_loop_program goto 364 + statement goto 270 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -4131,188 +4179,188 @@ state 265 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 266 - in_loop_statement: statement. (18) +state 270 + in_loop_statement: statement. (19) - . reduce 18 (src line 238) + . reduce 19 (src line 243) -state 267 - in_loop_statement: in_loop_flow_control_statement. (19) +state 271 + in_loop_statement: in_loop_flow_control_statement. (20) - . reduce 19 (src line 243) + . reduce 20 (src line 248) -state 268 +state 272 flow_control_statement: IF.value THEN program else END IF statement_terminal flow_control_statement: IF.value THEN program elseif else END IF statement_terminal in_loop_flow_control_statement: IF.value THEN in_loop_program in_loop_else END IF statement_terminal in_loop_flow_control_statement: IF.value THEN in_loop_program in_loop_elseif in_loop_else END IF statement_terminal - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 359 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 365 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 269 +state 273 in_loop_flow_control_statement: CONTINUE.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 360 + statement_terminal goto 366 -state 270 +state 274 in_loop_flow_control_statement: BREAK.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 361 + statement_terminal goto 367 -state 271 +state 275 flow_control_statement: WHILE variables IN identifier.DO in_loop_program END WHILE statement_terminal - DO shift 362 + DO shift 368 . error -state 272 - variables: variable ',' variables. (243) +state 276 + variables: variable ',' variables. (247) - . reduce 243 (src line 1359) + . reduce 247 (src line 1378) -state 273 - variables: variable. (242) +state 277 + variables: variable. (246) variables: variable.',' variables - ',' shift 183 - . reduce 242 (src line 1354) + ',' shift 185 + . reduce 246 (src line 1373) -state 274 +state 278 command_statement: SET FLAG '=' primary.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 363 + statement_terminal goto 369 -state 275 - common_tables: common_table ',' common_tables. (79) +state 279 + common_tables: common_table ',' common_tables. (83) - . reduce 79 (src line 556) + . reduce 83 (src line 575) -state 276 +state 280 common_table: recursive identifier AS.'(' select_query ')' - '(' shift 364 + '(' shift 370 . error -state 277 +state 281 common_table: recursive identifier '('.identifiers ')' AS '(' select_query ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifiers goto 365 - identifier goto 319 + identifiers goto 371 + identifier goto 323 -state 278 - select_query: common_table_clause select_entity order_by_clause limit_clause offset_clause. (49) +state 282 + select_query: common_table_clause select_entity order_by_clause limit_clause offset_clause. (53) - . reduce 49 (src line 380) + . reduce 53 (src line 399) -state 279 +state 283 offset_clause: OFFSET.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 366 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 - -280: shift/reduce conflict (shift 369(0), red'n 70(0)) on WITH -state 280 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 372 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +284: shift/reduce conflict (shift 375(0), red'n 74(0)) on WITH +state 284 limit_clause: LIMIT value.limit_with limit_clause: LIMIT value.PERCENT limit_with string_operation: value.STRING_OP value @@ -4332,59 +4380,59 @@ state 280 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - limit_with: . (70) - negation: . (251) - - PERCENT shift 368 - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - WITH shift 369 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 70 (src line 511) - - limit_with goto 367 - negation goto 155 - comparison_operator goto 156 + limit_with: . (74) + negation: . (255) + + PERCENT shift 374 + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + WITH shift 375 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 74 (src line 530) + + limit_with goto 373 + negation goto 157 + comparison_operator goto 158 -state 281 - order_by_clause: ORDER BY order_items. (66) +state 285 + order_by_clause: ORDER BY order_items. (70) - . reduce 66 (src line 492) + . reduce 70 (src line 511) -state 282 - order_items: order_item. (105) +state 286 + order_items: order_item. (109) order_items: order_item.',' order_items - ',' shift 370 - . reduce 105 (src line 671) + ',' shift 376 + . reduce 109 (src line 690) -state 283 +state 287 order_item: order_value.order_direction order_item: order_value.order_direction NULLS order_null_position - order_direction: . (111) + order_direction: . (115) - ASC shift 372 - DESC shift 373 - . reduce 111 (src line 701) + ASC shift 378 + DESC shift 379 + . reduce 115 (src line 720) - order_direction goto 371 + order_direction goto 377 -state 284 - order_value: value. (109) +state 288 + order_value: value. (113) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -4402,233 +4450,233 @@ state 284 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 109 (src line 691) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 113 (src line 710) -state 285 - order_value: analytic_function. (110) + negation goto 157 + comparison_operator goto 158 - . reduce 110 (src line 696) +state 289 + order_value: analytic_function. (114) + + . reduce 114 (src line 715) -state 286 +state 290 insert_query: common_table_clause INSERT INTO identifier VALUES.row_values - '(' shift 255 + '(' shift 259 . error - row_value goto 375 - row_values goto 374 - subquery goto 256 + row_value goto 381 + row_values goto 380 + subquery goto 260 -state 287 +state 291 insert_query: common_table_clause INSERT INTO identifier '('.field_references ')' VALUES row_values insert_query: common_table_clause INSERT INTO identifier '('.field_references ')' select_query - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 377 - field_references goto 376 - identifier goto 292 + field_reference goto 383 + field_references goto 382 + identifier goto 296 -state 288 - insert_query: common_table_clause INSERT INTO identifier select_query. (201) +state 292 + insert_query: common_table_clause INSERT INTO identifier select_query. (205) - . reduce 201 (src line 1139) + . reduce 205 (src line 1158) -state 289 +state 293 update_query: common_table_clause UPDATE identified_tables SET update_set_list.from_clause where_clause - from_clause: . (57) + from_clause: . (61) - FROM shift 130 - . reduce 57 (src line 447) + FROM shift 131 + . reduce 61 (src line 466) - from_clause goto 378 + from_clause goto 384 -state 290 - update_set_list: update_set. (205) +state 294 + update_set_list: update_set. (209) update_set_list: update_set.',' update_set_list - ',' shift 379 - . reduce 205 (src line 1160) + ',' shift 385 + . reduce 209 (src line 1179) -state 291 +state 295 update_set: field_reference.'=' value - '=' shift 380 + '=' shift 386 . error -state 292 - field_reference: identifier. (86) +state 296 + field_reference: identifier. (90) field_reference: identifier.'.' identifier - '.' shift 167 - . reduce 86 (src line 587) + '.' shift 169 + . reduce 90 (src line 606) -state 293 - identified_tables: identified_table ',' identified_tables. (192) +state 297 + identified_tables: identified_table ',' identified_tables. (196) - . reduce 192 (src line 1095) + . reduce 196 (src line 1114) -state 294 - identified_table: identifier AS identifier. (158) +state 298 + identified_table: identifier AS identifier. (162) - . reduce 158 (src line 933) + . reduce 162 (src line 952) -state 295 - delete_query: common_table_clause DELETE FROM tables where_clause. (207) +state 299 + delete_query: common_table_clause DELETE FROM tables where_clause. (211) - . reduce 207 (src line 1170) + . reduce 211 (src line 1189) -state 296 +state 300 join: table join_inner.JOIN table join_condition - JOIN shift 381 + JOIN shift 387 . error - 297: reduce/reduce conflict (red'ns 253 and 257) on JOIN -state 297 + 301: reduce/reduce conflict (red'ns 257 and 261) on JOIN +state 301 join: table NATURAL.join_inner JOIN table join: table NATURAL.join_direction join_outer JOIN table - join_inner: . (253) - join_direction: . (257) + join_inner: . (257) + join_direction: . (261) - INNER shift 301 - OUTER reduce 257 (src line 1430) - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - . reduce 253 (src line 1410) + INNER shift 305 + OUTER reduce 261 (src line 1449) + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + . reduce 257 (src line 1429) - join_inner goto 382 - join_direction goto 383 + join_inner goto 388 + join_direction goto 389 -state 298 +state 302 join: table join_direction.join_outer JOIN table join_condition - join_outer: . (255) + join_outer: . (259) - OUTER shift 385 - . reduce 255 (src line 1420) + OUTER shift 391 + . reduce 259 (src line 1439) - join_outer goto 384 + join_outer goto 390 -state 299 +state 303 join: table CROSS.JOIN table - JOIN shift 386 + JOIN shift 392 . error -state 300 +state 304 tables: table ','.tables - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 198 - join goto 201 - tables goto 387 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 200 + join goto 203 + tables goto 393 + identifier goto 127 -state 301 - join_inner: INNER. (254) +state 305 + join_inner: INNER. (258) - . reduce 254 (src line 1415) + . reduce 258 (src line 1434) -state 302 - join_direction: LEFT. (258) +state 306 + join_direction: LEFT. (262) - . reduce 258 (src line 1435) + . reduce 262 (src line 1454) -state 303 - join_direction: RIGHT. (259) +state 307 + join_direction: RIGHT. (263) - . reduce 259 (src line 1439) + . reduce 263 (src line 1458) -state 304 - join_direction: FULL. (260) +state 308 + join_direction: FULL. (264) - . reduce 260 (src line 1443) + . reduce 264 (src line 1462) -state 305 - table: virtual_table identifier. (163) +state 309 + table: virtual_table identifier. (167) - . reduce 163 (src line 957) + . reduce 167 (src line 976) -state 306 +state 310 table: virtual_table AS.identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 388 + identifier goto 394 -state 307 +state 311 delete_query: common_table_clause DELETE identified_tables FROM tables.where_clause - where_clause: . (59) + where_clause: . (63) - WHERE shift 207 - . reduce 59 (src line 457) + WHERE shift 209 + . reduce 63 (src line 476) - where_clause goto 389 + where_clause goto 395 -state 308 +state 312 select_entity: select_clause from_clause where_clause group_by_clause.having_clause - having_clause: . (63) + having_clause: . (67) - HAVING shift 391 - . reduce 63 (src line 477) + HAVING shift 397 + . reduce 67 (src line 496) - having_clause goto 390 + having_clause goto 396 -state 309 +state 313 group_by_clause: GROUP.BY values - BY shift 392 + BY shift 398 . error -state 310 - where_clause: WHERE value. (60) +state 314 + where_clause: WHERE value. (64) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -4646,271 +4694,289 @@ state 310 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 60 (src line 462) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 64 (src line 481) + + negation goto 157 + comparison_operator goto 158 -state 311 +state 315 select_entity: select_set_entity.UNION all select_set_entity - select_entity: select_set_entity UNION all select_set_entity. (51) + select_entity: select_set_entity UNION all select_set_entity. (55) select_entity: select_set_entity.INTERSECT all select_set_entity select_entity: select_set_entity.EXCEPT all select_set_entity - INTERSECT shift 132 - . reduce 51 (src line 403) + INTERSECT shift 133 + . reduce 55 (src line 422) -state 312 - select_set_entity: select_entity. (54) +state 316 + select_set_entity: select_entity. (58) - . reduce 54 (src line 431) + . reduce 58 (src line 450) -state 313 +state 317 select_entity: select_set_entity.UNION all select_set_entity select_entity: select_set_entity.INTERSECT all select_set_entity - select_entity: select_set_entity INTERSECT all select_set_entity. (52) + select_entity: select_set_entity INTERSECT all select_set_entity. (56) select_entity: select_set_entity.EXCEPT all select_set_entity - . reduce 52 (src line 412) + . reduce 56 (src line 431) -state 314 +state 318 select_entity: select_set_entity.UNION all select_set_entity select_entity: select_set_entity.INTERSECT all select_set_entity select_entity: select_set_entity.EXCEPT all select_set_entity - select_entity: select_set_entity EXCEPT all select_set_entity. (53) + select_entity: select_set_entity EXCEPT all select_set_entity. (57) - INTERSECT shift 132 - . reduce 53 (src line 421) + INTERSECT shift 133 + . reduce 57 (src line 440) -state 315 +state 319 fields: field ','.fields - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '*' shift 218 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 216 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - analytic_function goto 217 - field_object goto 215 - field goto 214 - case goto 82 - fields goto 393 - identifier goto 219 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '*' shift 220 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 218 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + analytic_function goto 219 + field_object goto 217 + field goto 216 + case goto 83 + fields goto 399 + identifier goto 221 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 316 +state 320 field: field_object AS.identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 394 + identifier goto 400 -state 317 +state 321 function: identifier '('.option ')' analytic_function: identifier '('.option ')' OVER '(' analytic_clause ')' - option: . (147) - distinct: . (249) + option: . (151) + distinct: . (253) - DISTINCT shift 135 - ')' reduce 147 (src line 878) - . reduce 249 (src line 1390) + DISTINCT shift 136 + ')' reduce 151 (src line 897) + . reduce 253 (src line 1409) - option goto 395 - distinct goto 251 + option goto 401 + distinct goto 255 -state 318 +state 322 create_table: CREATE TABLE identifier '(' identifiers.')' - ')' shift 396 + ')' shift 402 . error -state 319 - identifiers: identifier. (193) +state 323 + identifiers: identifier. (197) identifiers: identifier.',' identifiers - ',' shift 397 - . reduce 193 (src line 1100) + ',' shift 403 + . reduce 197 (src line 1119) -state 320 +state 324 add_columns: ALTER TABLE identifier ADD column_default.column_position - column_position: . (216) + column_position: . (220) - FIRST shift 399 - LAST shift 400 - AFTER shift 401 - BEFORE shift 402 - . reduce 216 (src line 1218) + FIRST shift 405 + LAST shift 406 + AFTER shift 407 + BEFORE shift 408 + . reduce 220 (src line 1237) - column_position goto 398 + column_position goto 404 -state 321 +state 325 add_columns: ALTER TABLE identifier ADD '('.column_defaults ')' column_position - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - column_default goto 404 - column_defaults goto 403 - identifier goto 322 + column_default goto 410 + column_defaults goto 409 + identifier goto 326 -state 322 - column_default: identifier. (212) +state 326 + column_default: identifier. (216) column_default: identifier.DEFAULT value - DEFAULT shift 405 - . reduce 212 (src line 1198) + DEFAULT shift 411 + . reduce 216 (src line 1217) -state 323 - drop_columns: ALTER TABLE identifier DROP field_reference. (221) +state 327 + drop_columns: ALTER TABLE identifier DROP field_reference. (225) - . reduce 221 (src line 1240) + . reduce 225 (src line 1259) -state 324 +state 328 drop_columns: ALTER TABLE identifier DROP '('.field_references ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 377 - field_references goto 406 - identifier goto 292 + field_reference goto 383 + field_references goto 412 + identifier goto 296 -state 325 +state 329 rename_column: ALTER TABLE identifier RENAME field_reference.TO identifier - TO shift 407 + TO shift 413 . error -state 326 +state 330 cursor_statement: DECLARE identifier CURSOR FOR select_query.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 408 + statement_terminal goto 414 -state 327 +state 331 + table_statement: DECLARE identifier TABLE '(' identifiers.')' + table_statement: DECLARE identifier TABLE '(' identifiers.')' FOR select_query statement_terminal + + ')' shift 415 + . error + + +state 332 + table_statement: DECLARE identifier TABLE FOR select_query.statement_terminal + statement_terminal: . (271) + + ';' shift 39 + . reduce 271 (src line 1498) + + statement_terminal goto 416 + +state 333 cursor_statement: FETCH fetch_position identifier INTO variables.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 409 + statement_terminal goto 417 -state 328 +state 334 flow_control_statement: IF value THEN program else.END IF statement_terminal - END shift 410 + END shift 418 . error -state 329 +state 335 flow_control_statement: IF value THEN program elseif.else END IF statement_terminal elseif: elseif.elseif - else: . (226) + else: . (230) - ELSEIF shift 331 - ELSE shift 330 - . reduce 226 (src line 1266) + ELSEIF shift 337 + ELSE shift 336 + . reduce 230 (src line 1285) - elseif goto 412 - else goto 411 + elseif goto 420 + else goto 419 -state 330 +state 336 else: ELSE.program program: . (1) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - WHILE shift 29 - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - program goto 413 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + WHILE shift 30 + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + program goto 421 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -4918,65 +4984,65 @@ state 330 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 331 +state 337 elseif: ELSEIF.value THEN program - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 414 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 422 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 332 - comparison: value IS negation ternary. (122) +state 338 + comparison: value IS negation ternary. (126) - . reduce 122 (src line 771) + . reduce 126 (src line 790) -state 333 - comparison: value IS negation null. (123) +state 339 + comparison: value IS negation null. (127) - . reduce 123 (src line 775) + . reduce 127 (src line 794) -state 334 +state 340 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -4995,35 +5061,35 @@ state 334 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - AND shift 415 - OR shift 162 - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 423 + OR shift 164 + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 335 - comparison: value negation IN row_value. (126) +state 341 + comparison: value negation IN row_value. (130) - . reduce 126 (src line 787) + . reduce 130 (src line 806) - 336: reduce/reduce conflict (red'ns 129 and 251) on IN - 336: reduce/reduce conflict (red'ns 129 and 251) on BETWEEN - 336: reduce/reduce conflict (red'ns 129 and 251) on LIKE -state 336 + 342: reduce/reduce conflict (red'ns 133 and 255) on IN + 342: reduce/reduce conflict (red'ns 133 and 255) on BETWEEN + 342: reduce/reduce conflict (red'ns 133 and 255) on LIKE +state 342 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -5032,7 +5098,7 @@ state 336 comparison: value.negation BETWEEN value AND value comparison: value.negation IN row_value comparison: value.negation LIKE value - comparison: value negation LIKE value. (129) + comparison: value negation LIKE value. (133) comparison: value.comparison_operator ANY row_value comparison: value.comparison_operator ALL row_value arithmetic: value.'+' value @@ -5042,41 +5108,41 @@ state 336 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) + negation: . (255) IS error COMPARISON_OP error - STRING_OP shift 151 + STRING_OP shift 153 '=' error - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 129 (src line 799) + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 133 (src line 818) - negation goto 155 - comparison_operator goto 156 + negation goto 157 + comparison_operator goto 158 -state 337 - comparison: value comparison_operator ANY row_value. (130) +state 343 + comparison: value comparison_operator ANY row_value. (134) - . reduce 130 (src line 803) + . reduce 134 (src line 822) -state 338 - comparison: value comparison_operator ALL row_value. (133) +state 344 + comparison: value comparison_operator ALL row_value. (137) - . reduce 133 (src line 815) + . reduce 137 (src line 834) -state 339 - values: value ',' values. (188) +state 345 + values: value ',' values. (192) - . reduce 188 (src line 1075) + . reduce 192 (src line 1094) -state 340 +state 346 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -5094,110 +5160,110 @@ state 340 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - values: value. (187) + values: value. (191) values: value.',' values - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - ',' shift 247 - . reduce 187 (src line 1070) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + ',' shift 251 + . reduce 191 (src line 1089) + + negation goto 157 + comparison_operator goto 158 -state 341 - function: identifier '(' option ')'. (145) +state 347 + function: identifier '(' option ')'. (149) - . reduce 145 (src line 868) + . reduce 149 (src line 887) -state 342 - option: distinct '*'. (148) +state 348 + option: distinct '*'. (152) - . reduce 148 (src line 883) + . reduce 152 (src line 902) -state 343 - option: distinct values. (149) +state 349 + option: distinct values. (153) - . reduce 149 (src line 887) + . reduce 153 (src line 906) -state 344 +state 350 case: CASE case_value case_when case_else.END - END shift 416 + END shift 424 . error -345: shift/reduce conflict (shift 253(0), red'n 198(0)) on WHEN -state 345 +351: shift/reduce conflict (shift 257(0), red'n 202(0)) on WHEN +state 351 case_when: case_when.case_when - case_when: case_when case_when. (198) + case_when: case_when case_when. (202) - WHEN shift 253 - . reduce 198 (src line 1125) + WHEN shift 257 + . reduce 202 (src line 1144) - case_when goto 345 + case_when goto 351 -state 346 +state 352 case_else: ELSE.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 417 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 425 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 347 +state 353 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -5216,131 +5282,131 @@ state 347 logic: value.OR value logic: value.AND value case_when: WHEN value.THEN value - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - THEN shift 418 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + THEN shift 426 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 348 +state 354 comparison: row_value negation BETWEEN row_value.AND row_value - AND shift 419 + AND shift 427 . error -349: shift/reduce conflict (shift 255(0), red'n 74(0)) on '(' -state 349 +355: shift/reduce conflict (shift 259(0), red'n 78(0)) on '(' +state 355 subquery: '('.select_query ')' comparison: row_value negation IN '('.row_values ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - '(' shift 255 - . reduce 74 (src line 531) + WITH shift 34 + '(' shift 259 + . reduce 78 (src line 550) - select_query goto 136 - common_table_clause goto 137 - row_value goto 375 - row_values goto 420 - subquery goto 256 + select_query goto 137 + common_table_clause goto 138 + row_value goto 381 + row_values goto 428 + subquery goto 260 -state 350 - comparison: row_value negation IN subquery. (128) +state 356 + comparison: row_value negation IN subquery. (132) - . reduce 128 (src line 795) + . reduce 132 (src line 814) -351: shift/reduce conflict (shift 255(0), red'n 74(0)) on '(' -state 351 +357: shift/reduce conflict (shift 259(0), red'n 78(0)) on '(' +state 357 subquery: '('.select_query ')' comparison: row_value comparison_operator ANY '('.row_values ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - '(' shift 255 - . reduce 74 (src line 531) + WITH shift 34 + '(' shift 259 + . reduce 78 (src line 550) - select_query goto 136 - common_table_clause goto 137 - row_value goto 375 - row_values goto 421 - subquery goto 256 + select_query goto 137 + common_table_clause goto 138 + row_value goto 381 + row_values goto 429 + subquery goto 260 -state 352 - comparison: row_value comparison_operator ANY subquery. (132) +state 358 + comparison: row_value comparison_operator ANY subquery. (136) - . reduce 132 (src line 811) + . reduce 136 (src line 830) -353: shift/reduce conflict (shift 255(0), red'n 74(0)) on '(' -state 353 +359: shift/reduce conflict (shift 259(0), red'n 78(0)) on '(' +state 359 subquery: '('.select_query ')' comparison: row_value comparison_operator ALL '('.row_values ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - '(' shift 255 - . reduce 74 (src line 531) + WITH shift 34 + '(' shift 259 + . reduce 78 (src line 550) - select_query goto 136 - common_table_clause goto 137 - row_value goto 375 - row_values goto 422 - subquery goto 256 + select_query goto 137 + common_table_clause goto 138 + row_value goto 381 + row_values goto 430 + subquery goto 260 -state 354 - comparison: row_value comparison_operator ALL subquery. (135) +state 360 + comparison: row_value comparison_operator ALL subquery. (139) - . reduce 135 (src line 823) + . reduce 139 (src line 842) -state 355 +state 361 cursor_status: CURSOR identifier IS negation.OPEN cursor_status: CURSOR identifier IS negation.IN RANGE - IN shift 424 - OPEN shift 423 + IN shift 432 + OPEN shift 431 . error -state 356 +state 362 group_concat: GROUP_CONCAT '(' option order_by_clause.')' group_concat: GROUP_CONCAT '(' option order_by_clause.SEPARATOR STRING ')' - SEPARATOR shift 426 - ')' shift 425 + SEPARATOR shift 434 + ')' shift 433 . error -state 357 +state 363 flow_control_statement: WHILE value DO in_loop_program END.WHILE statement_terminal - WHILE shift 427 + WHILE shift 435 . error -state 358 +state 364 in_loop_program: in_loop_statement in_loop_program. (4) - . reduce 4 (src line 178) + . reduce 4 (src line 179) -state 359 +state 365 flow_control_statement: IF value.THEN program else END IF statement_terminal flow_control_statement: IF value.THEN program elseif else END IF statement_terminal in_loop_flow_control_statement: IF value.THEN in_loop_program in_loop_else END IF statement_terminal @@ -5362,76 +5428,77 @@ state 359 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - THEN shift 428 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + THEN shift 436 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 360 - in_loop_flow_control_statement: CONTINUE statement_terminal. (45) +state 366 + in_loop_flow_control_statement: CONTINUE statement_terminal. (49) - . reduce 45 (src line 361) + . reduce 49 (src line 380) -state 361 - in_loop_flow_control_statement: BREAK statement_terminal. (46) +state 367 + in_loop_flow_control_statement: BREAK statement_terminal. (50) - . reduce 46 (src line 365) + . reduce 50 (src line 384) -state 362 +state 368 flow_control_statement: WHILE variables IN identifier DO.in_loop_program END WHILE statement_terminal in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - WHILE shift 29 - END reduce 3 (src line 172) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - in_loop_program goto 429 - statement goto 266 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + WHILE shift 30 + END reduce 3 (src line 173) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + in_loop_program goto 437 + statement goto 270 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -5439,34 +5506,34 @@ state 362 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 363 - command_statement: SET FLAG '=' primary statement_terminal. (47) +state 369 + command_statement: SET FLAG '=' primary statement_terminal. (51) - . reduce 47 (src line 370) + . reduce 51 (src line 389) -state 364 +state 370 common_table: recursive identifier AS '('.select_query ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - . reduce 74 (src line 531) + WITH shift 34 + . reduce 78 (src line 550) - select_query goto 430 - common_table_clause goto 137 + select_query goto 438 + common_table_clause goto 138 -state 365 +state 371 common_table: recursive identifier '(' identifiers.')' AS '(' select_query ')' - ')' shift 431 + ')' shift 439 . error -state 366 - offset_clause: OFFSET value. (73) +state 372 + offset_clause: OFFSET value. (77) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -5484,570 +5551,584 @@ state 366 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 73 (src line 526) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 77 (src line 545) + + negation goto 157 + comparison_operator goto 158 -state 367 - limit_clause: LIMIT value limit_with. (68) +state 373 + limit_clause: LIMIT value limit_with. (72) - . reduce 68 (src line 502) + . reduce 72 (src line 521) -368: shift/reduce conflict (shift 369(0), red'n 70(0)) on WITH -state 368 +374: shift/reduce conflict (shift 375(0), red'n 74(0)) on WITH +state 374 limit_clause: LIMIT value PERCENT.limit_with - limit_with: . (70) + limit_with: . (74) - WITH shift 369 - . reduce 70 (src line 511) + WITH shift 375 + . reduce 74 (src line 530) - limit_with goto 432 + limit_with goto 440 -state 369 +state 375 limit_with: WITH.TIES - TIES shift 433 + TIES shift 441 . error -state 370 +state 376 order_items: order_item ','.order_items - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 284 - row_value goto 98 - order_items goto 434 - order_item goto 282 - order_value goto 283 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - analytic_function goto 285 - case goto 82 - identifier goto 219 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 288 + row_value goto 99 + order_items goto 442 + order_item goto 286 + order_value goto 287 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + analytic_function goto 289 + case goto 83 + identifier goto 221 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 371 - order_item: order_value order_direction. (107) +state 377 + order_item: order_value order_direction. (111) order_item: order_value order_direction.NULLS order_null_position - NULLS shift 435 - . reduce 107 (src line 681) + NULLS shift 443 + . reduce 111 (src line 700) -state 372 - order_direction: ASC. (112) +state 378 + order_direction: ASC. (116) - . reduce 112 (src line 706) + . reduce 116 (src line 725) -state 373 - order_direction: DESC. (113) +state 379 + order_direction: DESC. (117) - . reduce 113 (src line 710) + . reduce 117 (src line 729) -state 374 - insert_query: common_table_clause INSERT INTO identifier VALUES row_values. (199) +state 380 + insert_query: common_table_clause INSERT INTO identifier VALUES row_values. (203) - . reduce 199 (src line 1130) + . reduce 203 (src line 1149) -state 375 - row_values: row_value. (103) +state 381 + row_values: row_value. (107) row_values: row_value.',' row_values - ',' shift 436 - . reduce 103 (src line 661) + ',' shift 444 + . reduce 107 (src line 680) -state 376 +state 382 insert_query: common_table_clause INSERT INTO identifier '(' field_references.')' VALUES row_values insert_query: common_table_clause INSERT INTO identifier '(' field_references.')' select_query - ')' shift 437 + ')' shift 445 . error -state 377 - field_references: field_reference. (185) +state 383 + field_references: field_reference. (189) field_references: field_reference.',' field_references - ',' shift 438 - . reduce 185 (src line 1060) + ',' shift 446 + . reduce 189 (src line 1079) -state 378 +state 384 update_query: common_table_clause UPDATE identified_tables SET update_set_list from_clause.where_clause - where_clause: . (59) + where_clause: . (63) - WHERE shift 207 - . reduce 59 (src line 457) + WHERE shift 209 + . reduce 63 (src line 476) - where_clause goto 439 + where_clause goto 447 -state 379 +state 385 update_set_list: update_set ','.update_set_list - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 291 - update_set goto 290 - update_set_list goto 440 - identifier goto 292 + field_reference goto 295 + update_set goto 294 + update_set_list goto 448 + identifier goto 296 -state 380 +state 386 update_set: field_reference '='.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 441 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 449 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 381 +state 387 join: table join_inner JOIN.table join_condition - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 442 - join goto 201 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 450 + join goto 203 + identifier goto 127 -state 382 +state 388 join: table NATURAL join_inner.JOIN table - JOIN shift 443 + JOIN shift 451 . error -state 383 +state 389 join: table NATURAL join_direction.join_outer JOIN table - join_outer: . (255) + join_outer: . (259) - OUTER shift 385 - . reduce 255 (src line 1420) + OUTER shift 391 + . reduce 259 (src line 1439) - join_outer goto 444 + join_outer goto 452 -state 384 +state 390 join: table join_direction join_outer.JOIN table join_condition - JOIN shift 445 + JOIN shift 453 . error -state 385 - join_outer: OUTER. (256) +state 391 + join_outer: OUTER. (260) - . reduce 256 (src line 1425) + . reduce 260 (src line 1444) -state 386 +state 392 join: table CROSS JOIN.table - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 446 - join goto 201 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 454 + join goto 203 + identifier goto 127 -state 387 - tables: table ',' tables. (190) +state 393 + tables: table ',' tables. (194) - . reduce 190 (src line 1085) + . reduce 194 (src line 1104) -state 388 - table: virtual_table AS identifier. (164) +state 394 + table: virtual_table AS identifier. (168) - . reduce 164 (src line 961) + . reduce 168 (src line 980) -state 389 - delete_query: common_table_clause DELETE identified_tables FROM tables where_clause. (208) +state 395 + delete_query: common_table_clause DELETE identified_tables FROM tables where_clause. (212) - . reduce 208 (src line 1176) + . reduce 212 (src line 1195) -state 390 - select_entity: select_clause from_clause where_clause group_by_clause having_clause. (50) +state 396 + select_entity: select_clause from_clause where_clause group_by_clause having_clause. (54) - . reduce 50 (src line 392) + . reduce 54 (src line 411) -state 391 +state 397 having_clause: HAVING.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 447 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 455 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 392 +state 398 group_by_clause: GROUP BY.values - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 340 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 448 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 346 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 456 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 393 - fields: field ',' fields. (196) +state 399 + fields: field ',' fields. (200) - . reduce 196 (src line 1115) + . reduce 200 (src line 1134) -state 394 - field: field_object AS identifier. (179) +state 400 + field: field_object AS identifier. (183) - . reduce 179 (src line 1029) + . reduce 183 (src line 1048) -state 395 +state 401 function: identifier '(' option.')' analytic_function: identifier '(' option.')' OVER '(' analytic_clause ')' - ')' shift 449 + ')' shift 457 . error -state 396 - create_table: CREATE TABLE identifier '(' identifiers ')'. (209) +state 402 + create_table: CREATE TABLE identifier '(' identifiers ')'. (213) - . reduce 209 (src line 1182) + . reduce 213 (src line 1201) -state 397 +state 403 identifiers: identifier ','.identifiers - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifiers goto 450 - identifier goto 319 + identifiers goto 458 + identifier goto 323 -state 398 - add_columns: ALTER TABLE identifier ADD column_default column_position. (210) +state 404 + add_columns: ALTER TABLE identifier ADD column_default column_position. (214) - . reduce 210 (src line 1188) + . reduce 214 (src line 1207) -state 399 - column_position: FIRST. (217) +state 405 + column_position: FIRST. (221) - . reduce 217 (src line 1223) + . reduce 221 (src line 1242) -state 400 - column_position: LAST. (218) +state 406 + column_position: LAST. (222) - . reduce 218 (src line 1227) + . reduce 222 (src line 1246) -state 401 +state 407 column_position: AFTER.field_reference - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 451 - identifier goto 292 + field_reference goto 459 + identifier goto 296 -state 402 +state 408 column_position: BEFORE.field_reference - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 452 - identifier goto 292 + field_reference goto 460 + identifier goto 296 -state 403 +state 409 add_columns: ALTER TABLE identifier ADD '(' column_defaults.')' column_position - ')' shift 453 + ')' shift 461 . error -state 404 - column_defaults: column_default. (214) +state 410 + column_defaults: column_default. (218) column_defaults: column_default.',' column_defaults - ',' shift 454 - . reduce 214 (src line 1208) + ',' shift 462 + . reduce 218 (src line 1227) -state 405 +state 411 column_default: identifier DEFAULT.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 455 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 463 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 406 +state 412 drop_columns: ALTER TABLE identifier DROP '(' field_references.')' - ')' shift 456 + ')' shift 464 . error -state 407 +state 413 rename_column: ALTER TABLE identifier RENAME field_reference TO.identifier - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifier goto 457 + identifier goto 465 -state 408 - cursor_statement: DECLARE identifier CURSOR FOR select_query statement_terminal. (24) +state 414 + cursor_statement: DECLARE identifier CURSOR FOR select_query statement_terminal. (25) - . reduce 24 (src line 268) + . reduce 25 (src line 273) -state 409 - cursor_statement: FETCH fetch_position identifier INTO variables statement_terminal. (28) +state 415 + table_statement: DECLARE identifier TABLE '(' identifiers ')'. (30) + table_statement: DECLARE identifier TABLE '(' identifiers ')'.FOR select_query statement_terminal - . reduce 28 (src line 285) + FOR shift 466 + . reduce 30 (src line 295) -state 410 +state 416 + table_statement: DECLARE identifier TABLE FOR select_query statement_terminal. (32) + + . reduce 32 (src line 304) + + +state 417 + cursor_statement: FETCH fetch_position identifier INTO variables statement_terminal. (29) + + . reduce 29 (src line 290) + + +state 418 flow_control_statement: IF value THEN program else END.IF statement_terminal - IF shift 458 + IF shift 467 . error -state 411 +state 419 flow_control_statement: IF value THEN program elseif else.END IF statement_terminal - END shift 459 + END shift 468 . error -412: shift/reduce conflict (shift 331(0), red'n 225(0)) on ELSEIF -state 412 +420: shift/reduce conflict (shift 337(0), red'n 229(0)) on ELSEIF +state 420 elseif: elseif.elseif - elseif: elseif elseif. (225) + elseif: elseif elseif. (229) - ELSEIF shift 331 - . reduce 225 (src line 1261) + ELSEIF shift 337 + . reduce 229 (src line 1280) - elseif goto 412 + elseif goto 420 -state 413 - else: ELSE program. (227) +state 421 + else: ELSE program. (231) - . reduce 227 (src line 1271) + . reduce 231 (src line 1290) -state 414 +state 422 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6066,77 +6147,77 @@ state 414 logic: value.OR value logic: value.AND value elseif: ELSEIF value.THEN program - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - THEN shift 460 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + THEN shift 469 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 415 +state 423 comparison: value negation BETWEEN value AND.value logic: value AND.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 461 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 470 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 416 - case: CASE case_value case_when case_else END. (180) +state 424 + case: CASE case_value case_when case_else END. (184) - . reduce 180 (src line 1034) + . reduce 184 (src line 1053) -state 417 +state 425 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6154,183 +6235,184 @@ state 417 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - case_else: ELSE value. (184) - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - END reduce 184 (src line 1055) - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + case_else: ELSE value. (188) + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + END reduce 188 (src line 1074) + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 418 +state 426 case_when: WHEN value THEN.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 462 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 471 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 419 +state 427 comparison: row_value negation BETWEEN row_value AND.row_value - '(' shift 255 + '(' shift 259 . error - row_value goto 463 - subquery goto 256 + row_value goto 472 + subquery goto 260 -state 420 +state 428 comparison: row_value negation IN '(' row_values.')' - ')' shift 464 + ')' shift 473 . error -state 421 +state 429 comparison: row_value comparison_operator ANY '(' row_values.')' - ')' shift 465 + ')' shift 474 . error -state 422 +state 430 comparison: row_value comparison_operator ALL '(' row_values.')' - ')' shift 466 + ')' shift 475 . error -state 423 - cursor_status: CURSOR identifier IS negation OPEN. (36) +state 431 + cursor_status: CURSOR identifier IS negation OPEN. (40) - . reduce 36 (src line 320) + . reduce 40 (src line 339) -state 424 +state 432 cursor_status: CURSOR identifier IS negation IN.RANGE - RANGE shift 467 + RANGE shift 476 . error -state 425 - group_concat: GROUP_CONCAT '(' option order_by_clause ')'. (150) +state 433 + group_concat: GROUP_CONCAT '(' option order_by_clause ')'. (154) - . reduce 150 (src line 892) + . reduce 154 (src line 911) -state 426 +state 434 group_concat: GROUP_CONCAT '(' option order_by_clause SEPARATOR.STRING ')' - STRING shift 468 + STRING shift 477 . error -state 427 +state 435 flow_control_statement: WHILE value DO in_loop_program END WHILE.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 469 + statement_terminal goto 478 - 428: reduce/reduce conflict (red'ns 1 and 3) on ELSEIF - 428: reduce/reduce conflict (red'ns 1 and 3) on ELSE - 428: reduce/reduce conflict (red'ns 1 and 3) on END -state 428 + 436: reduce/reduce conflict (red'ns 1 and 3) on ELSEIF + 436: reduce/reduce conflict (red'ns 1 and 3) on ELSE + 436: reduce/reduce conflict (red'ns 1 and 3) on END +state 436 flow_control_statement: IF value THEN.program else END IF statement_terminal flow_control_statement: IF value THEN.program elseif else END IF statement_terminal in_loop_flow_control_statement: IF value THEN.in_loop_program in_loop_else END IF statement_terminal in_loop_flow_control_statement: IF value THEN.in_loop_program in_loop_elseif in_loop_else END IF statement_terminal program: . (1) in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - ELSEIF reduce 1 (src line 160) - WHILE shift 29 - ELSE reduce 1 (src line 160) - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - program goto 229 - in_loop_program goto 470 - statement goto 471 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + ELSEIF reduce 1 (src line 161) + WHILE shift 30 + ELSE reduce 1 (src line 161) + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + program goto 233 + in_loop_program goto 479 + statement goto 480 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -6338,102 +6420,102 @@ state 428 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 429 +state 437 flow_control_statement: WHILE variables IN identifier DO in_loop_program.END WHILE statement_terminal - END shift 472 + END shift 481 . error -state 430 +state 438 common_table: recursive identifier AS '(' select_query.')' - ')' shift 473 + ')' shift 482 . error -state 431 +state 439 common_table: recursive identifier '(' identifiers ')'.AS '(' select_query ')' - AS shift 474 + AS shift 483 . error -state 432 - limit_clause: LIMIT value PERCENT limit_with. (69) +state 440 + limit_clause: LIMIT value PERCENT limit_with. (73) - . reduce 69 (src line 506) + . reduce 73 (src line 525) -state 433 - limit_with: WITH TIES. (71) +state 441 + limit_with: WITH TIES. (75) - . reduce 71 (src line 516) + . reduce 75 (src line 535) -state 434 - order_items: order_item ',' order_items. (106) +state 442 + order_items: order_item ',' order_items. (110) - . reduce 106 (src line 676) + . reduce 110 (src line 695) -state 435 +state 443 order_item: order_value order_direction NULLS.order_null_position - FIRST shift 476 - LAST shift 477 + FIRST shift 485 + LAST shift 486 . error - order_null_position goto 475 + order_null_position goto 484 -state 436 +state 444 row_values: row_value ','.row_values - '(' shift 255 + '(' shift 259 . error - row_value goto 375 - row_values goto 478 - subquery goto 256 + row_value goto 381 + row_values goto 487 + subquery goto 260 -state 437 +state 445 insert_query: common_table_clause INSERT INTO identifier '(' field_references ')'.VALUES row_values insert_query: common_table_clause INSERT INTO identifier '(' field_references ')'.select_query - common_table_clause: . (74) + common_table_clause: . (78) - VALUES shift 479 - WITH shift 33 - . reduce 74 (src line 531) + VALUES shift 488 + WITH shift 34 + . reduce 78 (src line 550) - select_query goto 480 - common_table_clause goto 137 + select_query goto 489 + common_table_clause goto 138 -state 438 +state 446 field_references: field_reference ','.field_references - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - field_reference goto 377 - field_references goto 481 - identifier goto 292 + field_reference goto 383 + field_references goto 490 + identifier goto 296 -state 439 - update_query: common_table_clause UPDATE identified_tables SET update_set_list from_clause where_clause. (203) +state 447 + update_query: common_table_clause UPDATE identified_tables SET update_set_list from_clause where_clause. (207) - . reduce 203 (src line 1148) + . reduce 207 (src line 1167) -state 440 - update_set_list: update_set ',' update_set_list. (206) +state 448 + update_set_list: update_set ',' update_set_list. (210) - . reduce 206 (src line 1165) + . reduce 210 (src line 1184) -state 441 +state 449 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6451,136 +6533,136 @@ state 441 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - update_set: field_reference '=' value. (204) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 204 (src line 1154) - - negation goto 155 - comparison_operator goto 156 - - 442: reduce/reduce conflict (red'ns 253 and 172) on JOIN -442: shift/reduce conflict (shift 301(0), red'n 172(0)) on INNER -442: shift/reduce conflict (shift 302(0), red'n 172(0)) on LEFT -442: shift/reduce conflict (shift 303(0), red'n 172(0)) on RIGHT -442: shift/reduce conflict (shift 304(0), red'n 172(0)) on FULL -442: shift/reduce conflict (shift 299(0), red'n 172(0)) on CROSS -442: shift/reduce conflict (shift 483(0), red'n 172(0)) on ON -442: shift/reduce conflict (shift 484(0), red'n 172(0)) on USING -442: shift/reduce conflict (shift 297(0), red'n 172(0)) on NATURAL - 442: reduce/reduce conflict (red'ns 172 and 257) on JOIN - 442: reduce/reduce conflict (red'ns 172 and 257) on OUTER -state 442 + update_set: field_reference '=' value. (208) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 208 (src line 1173) + + negation goto 157 + comparison_operator goto 158 + + 450: reduce/reduce conflict (red'ns 257 and 176) on JOIN +450: shift/reduce conflict (shift 305(0), red'n 176(0)) on INNER +450: shift/reduce conflict (shift 306(0), red'n 176(0)) on LEFT +450: shift/reduce conflict (shift 307(0), red'n 176(0)) on RIGHT +450: shift/reduce conflict (shift 308(0), red'n 176(0)) on FULL +450: shift/reduce conflict (shift 303(0), red'n 176(0)) on CROSS +450: shift/reduce conflict (shift 492(0), red'n 176(0)) on ON +450: shift/reduce conflict (shift 493(0), red'n 176(0)) on USING +450: shift/reduce conflict (shift 301(0), red'n 176(0)) on NATURAL + 450: reduce/reduce conflict (red'ns 176 and 261) on JOIN + 450: reduce/reduce conflict (red'ns 176 and 261) on OUTER +state 450 join: table.join_inner JOIN table join_condition join: table join_inner JOIN table.join_condition join: table.NATURAL join_inner JOIN table join: table.join_direction join_outer JOIN table join_condition join: table.NATURAL join_direction join_outer JOIN table join: table.CROSS JOIN table - join_inner: . (253) - join_condition: . (172) - join_direction: . (257) - - INNER shift 301 - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - ON shift 483 - USING shift 484 - NATURAL shift 297 - . reduce 172 (src line 996) - - join_condition goto 482 - join_inner goto 296 - join_direction goto 298 + join_inner: . (257) + join_condition: . (176) + join_direction: . (261) + + INNER shift 305 + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + ON shift 492 + USING shift 493 + NATURAL shift 301 + . reduce 176 (src line 1015) -state 443 + join_condition goto 491 + join_inner goto 300 + join_direction goto 302 + +state 451 join: table NATURAL join_inner JOIN.table - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 . error - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 485 - join goto 201 - identifier goto 126 + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 494 + join goto 203 + identifier goto 127 -state 444 +state 452 join: table NATURAL join_direction join_outer.JOIN table - JOIN shift 486 + JOIN shift 495 . error -state 445 +state 453 join: table join_direction join_outer JOIN.table join_condition - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 - . error - - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 487 - join goto 201 - identifier goto 126 - -446: shift/reduce conflict (shift 301(0), red'n 171(0)) on INNER -446: shift/reduce conflict (shift 302(0), red'n 171(0)) on LEFT -446: shift/reduce conflict (shift 303(0), red'n 171(0)) on RIGHT -446: shift/reduce conflict (shift 304(0), red'n 171(0)) on FULL -446: shift/reduce conflict (shift 299(0), red'n 171(0)) on CROSS -446: shift/reduce conflict (shift 297(0), red'n 171(0)) on NATURAL - 446: reduce/reduce conflict (red'ns 171 and 253) on JOIN - 446: reduce/reduce conflict (red'ns 171 and 257) on JOIN - 446: reduce/reduce conflict (red'ns 171 and 257) on OUTER -state 446 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 + . error + + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 496 + join goto 203 + identifier goto 127 + +454: shift/reduce conflict (shift 305(0), red'n 175(0)) on INNER +454: shift/reduce conflict (shift 306(0), red'n 175(0)) on LEFT +454: shift/reduce conflict (shift 307(0), red'n 175(0)) on RIGHT +454: shift/reduce conflict (shift 308(0), red'n 175(0)) on FULL +454: shift/reduce conflict (shift 303(0), red'n 175(0)) on CROSS +454: shift/reduce conflict (shift 301(0), red'n 175(0)) on NATURAL + 454: reduce/reduce conflict (red'ns 175 and 257) on JOIN + 454: reduce/reduce conflict (red'ns 175 and 261) on JOIN + 454: reduce/reduce conflict (red'ns 175 and 261) on OUTER +state 454 join: table.join_inner JOIN table join_condition join: table.NATURAL join_inner JOIN table join: table.join_direction join_outer JOIN table join_condition join: table.NATURAL join_direction join_outer JOIN table join: table.CROSS JOIN table - join: table CROSS JOIN table. (171) - join_inner: . (253) - join_direction: . (257) - - INNER shift 301 - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - NATURAL shift 297 - . reduce 171 (src line 991) + join: table CROSS JOIN table. (175) + join_inner: . (257) + join_direction: . (261) + + INNER shift 305 + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + NATURAL shift 301 + . reduce 175 (src line 1010) - join_inner goto 296 - join_direction goto 298 + join_inner goto 300 + join_direction goto 302 -state 447 - having_clause: HAVING value. (64) +state 455 + having_clause: HAVING value. (68) string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6598,83 +6680,83 @@ state 447 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 64 (src line 482) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 68 (src line 501) + + negation goto 157 + comparison_operator goto 158 -state 448 - group_by_clause: GROUP BY values. (62) +state 456 + group_by_clause: GROUP BY values. (66) - . reduce 62 (src line 472) + . reduce 66 (src line 491) -state 449 - function: identifier '(' option ')'. (145) +state 457 + function: identifier '(' option ')'. (149) analytic_function: identifier '(' option ')'.OVER '(' analytic_clause ')' - OVER shift 488 - . reduce 145 (src line 868) + OVER shift 497 + . reduce 149 (src line 887) -state 450 - identifiers: identifier ',' identifiers. (194) +state 458 + identifiers: identifier ',' identifiers. (198) - . reduce 194 (src line 1105) + . reduce 198 (src line 1124) -state 451 - column_position: AFTER field_reference. (219) +state 459 + column_position: AFTER field_reference. (223) - . reduce 219 (src line 1231) + . reduce 223 (src line 1250) -state 452 - column_position: BEFORE field_reference. (220) +state 460 + column_position: BEFORE field_reference. (224) - . reduce 220 (src line 1235) + . reduce 224 (src line 1254) -state 453 +state 461 add_columns: ALTER TABLE identifier ADD '(' column_defaults ')'.column_position - column_position: . (216) + column_position: . (220) - FIRST shift 399 - LAST shift 400 - AFTER shift 401 - BEFORE shift 402 - . reduce 216 (src line 1218) + FIRST shift 405 + LAST shift 406 + AFTER shift 407 + BEFORE shift 408 + . reduce 220 (src line 1237) - column_position goto 489 + column_position goto 498 -state 454 +state 462 column_defaults: column_default ','.column_defaults - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - column_default goto 404 - column_defaults goto 490 - identifier goto 322 + column_default goto 410 + column_defaults goto 499 + identifier goto 326 -state 455 +state 463 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6692,93 +6774,104 @@ state 455 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - column_default: identifier DEFAULT value. (213) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 213 (src line 1203) - - negation goto 155 - comparison_operator goto 156 + column_default: identifier DEFAULT value. (217) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 217 (src line 1222) + + negation goto 157 + comparison_operator goto 158 -state 456 - drop_columns: ALTER TABLE identifier DROP '(' field_references ')'. (222) +state 464 + drop_columns: ALTER TABLE identifier DROP '(' field_references ')'. (226) - . reduce 222 (src line 1245) + . reduce 226 (src line 1264) -state 457 - rename_column: ALTER TABLE identifier RENAME field_reference TO identifier. (223) +state 465 + rename_column: ALTER TABLE identifier RENAME field_reference TO identifier. (227) - . reduce 223 (src line 1250) + . reduce 227 (src line 1269) -state 458 +state 466 + table_statement: DECLARE identifier TABLE '(' identifiers ')' FOR.select_query statement_terminal + common_table_clause: . (78) + + WITH shift 34 + . reduce 78 (src line 550) + + select_query goto 500 + common_table_clause goto 138 + +state 467 flow_control_statement: IF value THEN program else END IF.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 491 + statement_terminal goto 501 -state 459 +state 468 flow_control_statement: IF value THEN program elseif else END.IF statement_terminal - IF shift 492 + IF shift 502 . error -state 460 +state 469 elseif: ELSEIF value THEN.program program: . (1) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - ELSEIF reduce 1 (src line 160) - WHILE shift 29 - ELSE reduce 1 (src line 160) - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - program goto 493 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + ELSEIF reduce 1 (src line 161) + WHILE shift 30 + ELSE reduce 1 (src line 161) + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + program goto 503 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -6786,25 +6879,25 @@ state 460 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 - - 461: reduce/reduce conflict (red'ns 124 and 143) on IN - 461: reduce/reduce conflict (red'ns 124 and 143) on AND - 461: reduce/reduce conflict (red'ns 124 and 143) on OR - 461: reduce/reduce conflict (red'ns 124 and 143) on BETWEEN - 461: reduce/reduce conflict (red'ns 124 and 143) on LIKE - 461: reduce/reduce conflict (red'ns 124 and 251) on IN - 461: reduce/reduce conflict (red'ns 124 and 251) on BETWEEN - 461: reduce/reduce conflict (red'ns 124 and 251) on LIKE -state 461 + variable goto 35 + variable_substitution goto 21 + + 470: reduce/reduce conflict (red'ns 128 and 147) on IN + 470: reduce/reduce conflict (red'ns 128 and 147) on AND + 470: reduce/reduce conflict (red'ns 128 and 147) on OR + 470: reduce/reduce conflict (red'ns 128 and 147) on BETWEEN + 470: reduce/reduce conflict (red'ns 128 and 147) on LIKE + 470: reduce/reduce conflict (red'ns 128 and 255) on IN + 470: reduce/reduce conflict (red'ns 128 and 255) on BETWEEN + 470: reduce/reduce conflict (red'ns 128 and 255) on LIKE +state 470 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value comparison: value.IS negation ternary comparison: value.IS negation null comparison: value.negation BETWEEN value AND value - comparison: value negation BETWEEN value AND value. (124) + comparison: value negation BETWEEN value AND value. (128) comparison: value.negation IN row_value comparison: value.negation LIKE value comparison: value.comparison_operator ANY row_value @@ -6816,25 +6909,25 @@ state 461 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - logic: value AND value. (143) - negation: . (251) - - NOT shift 164 - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 124 (src line 779) - - negation goto 155 - comparison_operator goto 156 + logic: value AND value. (147) + negation: . (255) + + NOT shift 166 + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 128 (src line 798) + + negation goto 157 + comparison_operator goto 158 -state 462 +state 471 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -6852,146 +6945,147 @@ state 462 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - case_when: WHEN value THEN value. (197) - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - WHEN reduce 197 (src line 1120) - ELSE reduce 197 (src line 1120) - END reduce 197 (src line 1120) - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + case_when: WHEN value THEN value. (201) + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + WHEN reduce 201 (src line 1139) + ELSE reduce 201 (src line 1139) + END reduce 201 (src line 1139) + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 463 - comparison: row_value negation BETWEEN row_value AND row_value. (125) +state 472 + comparison: row_value negation BETWEEN row_value AND row_value. (129) - . reduce 125 (src line 783) + . reduce 129 (src line 802) -state 464 - comparison: row_value negation IN '(' row_values ')'. (127) +state 473 + comparison: row_value negation IN '(' row_values ')'. (131) - . reduce 127 (src line 791) + . reduce 131 (src line 810) -state 465 - comparison: row_value comparison_operator ANY '(' row_values ')'. (131) +state 474 + comparison: row_value comparison_operator ANY '(' row_values ')'. (135) - . reduce 131 (src line 807) + . reduce 135 (src line 826) -state 466 - comparison: row_value comparison_operator ALL '(' row_values ')'. (134) +state 475 + comparison: row_value comparison_operator ALL '(' row_values ')'. (138) - . reduce 134 (src line 819) + . reduce 138 (src line 838) -state 467 - cursor_status: CURSOR identifier IS negation IN RANGE. (37) +state 476 + cursor_status: CURSOR identifier IS negation IN RANGE. (41) - . reduce 37 (src line 325) + . reduce 41 (src line 344) -state 468 +state 477 group_concat: GROUP_CONCAT '(' option order_by_clause SEPARATOR STRING.')' - ')' shift 494 + ')' shift 504 . error -state 469 - flow_control_statement: WHILE value DO in_loop_program END WHILE statement_terminal. (40) +state 478 + flow_control_statement: WHILE value DO in_loop_program END WHILE statement_terminal. (44) - . reduce 40 (src line 339) + . reduce 44 (src line 358) -state 470 +state 479 in_loop_flow_control_statement: IF value THEN in_loop_program.in_loop_else END IF statement_terminal in_loop_flow_control_statement: IF value THEN in_loop_program.in_loop_elseif in_loop_else END IF statement_terminal - in_loop_else: . (230) - - ELSEIF shift 498 - ELSE shift 497 - . reduce 230 (src line 1286) - - in_loop_elseif goto 496 - in_loop_else goto 495 - -471: shift/reduce conflict (shift 35(0), red'n 18(0)) on VARIABLE -471: shift/reduce conflict (shift 31(0), red'n 18(0)) on SET -471: shift/reduce conflict (shift 17(0), red'n 18(0)) on CREATE -471: shift/reduce conflict (shift 18(0), red'n 18(0)) on ALTER -471: shift/reduce conflict (shift 33(0), red'n 18(0)) on WITH -471: shift/reduce conflict (shift 28(0), red'n 18(0)) on IF -471: shift/reduce conflict (shift 29(0), red'n 18(0)) on WHILE -471: shift/reduce conflict (shift 23(0), red'n 18(0)) on DECLARE -471: shift/reduce conflict (shift 27(0), red'n 18(0)) on FETCH -471: shift/reduce conflict (shift 24(0), red'n 18(0)) on OPEN -471: shift/reduce conflict (shift 25(0), red'n 18(0)) on CLOSE -471: shift/reduce conflict (shift 26(0), red'n 18(0)) on DISPOSE -471: shift/reduce conflict (shift 21(0), red'n 18(0)) on COMMIT -471: shift/reduce conflict (shift 22(0), red'n 18(0)) on ROLLBACK -471: shift/reduce conflict (shift 30(0), red'n 18(0)) on EXIT -471: shift/reduce conflict (shift 32(0), red'n 18(0)) on PRINT -471: shift/reduce conflict (shift 19(0), red'n 18(0)) on VAR - 471: reduce/reduce conflict (red'ns 18 and 1) on ELSEIF - 471: reduce/reduce conflict (red'ns 18 and 1) on ELSE - 471: reduce/reduce conflict (red'ns 18 and 1) on END - 471: reduce/reduce conflict (red'ns 18 and 74) on SELECT - 471: reduce/reduce conflict (red'ns 18 and 74) on UPDATE - 471: reduce/reduce conflict (red'ns 18 and 74) on DELETE - 471: reduce/reduce conflict (red'ns 18 and 74) on INSERT - 471: reduce/reduce conflict (red'ns 18 and 74) on '(' -state 471 + in_loop_else: . (234) + + ELSEIF shift 508 + ELSE shift 507 + . reduce 234 (src line 1305) + + in_loop_elseif goto 506 + in_loop_else goto 505 + +480: shift/reduce conflict (shift 36(0), red'n 19(0)) on VARIABLE +480: shift/reduce conflict (shift 32(0), red'n 19(0)) on SET +480: shift/reduce conflict (shift 18(0), red'n 19(0)) on CREATE +480: shift/reduce conflict (shift 19(0), red'n 19(0)) on ALTER +480: shift/reduce conflict (shift 34(0), red'n 19(0)) on WITH +480: shift/reduce conflict (shift 29(0), red'n 19(0)) on IF +480: shift/reduce conflict (shift 30(0), red'n 19(0)) on WHILE +480: shift/reduce conflict (shift 24(0), red'n 19(0)) on DECLARE +480: shift/reduce conflict (shift 28(0), red'n 19(0)) on FETCH +480: shift/reduce conflict (shift 25(0), red'n 19(0)) on OPEN +480: shift/reduce conflict (shift 26(0), red'n 19(0)) on CLOSE +480: shift/reduce conflict (shift 27(0), red'n 19(0)) on DISPOSE +480: shift/reduce conflict (shift 22(0), red'n 19(0)) on COMMIT +480: shift/reduce conflict (shift 23(0), red'n 19(0)) on ROLLBACK +480: shift/reduce conflict (shift 31(0), red'n 19(0)) on EXIT +480: shift/reduce conflict (shift 33(0), red'n 19(0)) on PRINT +480: shift/reduce conflict (shift 20(0), red'n 19(0)) on VAR + 480: reduce/reduce conflict (red'ns 19 and 1) on ELSEIF + 480: reduce/reduce conflict (red'ns 19 and 1) on ELSE + 480: reduce/reduce conflict (red'ns 19 and 1) on END + 480: reduce/reduce conflict (red'ns 19 and 78) on SELECT + 480: reduce/reduce conflict (red'ns 19 and 78) on UPDATE + 480: reduce/reduce conflict (red'ns 19 and 78) on DELETE + 480: reduce/reduce conflict (red'ns 19 and 78) on INSERT + 480: reduce/reduce conflict (red'ns 19 and 78) on '(' +state 480 program: statement.program - in_loop_statement: statement. (18) + in_loop_statement: statement. (19) program: . (1) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 28 - ELSEIF reduce 1 (src line 160) - WHILE shift 29 - ELSE reduce 1 (src line 160) - END reduce 1 (src line 160) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 18 (src line 238) + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 29 + ELSEIF reduce 1 (src line 161) + WHILE shift 30 + ELSE reduce 1 (src line 161) + END reduce 1 (src line 161) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 19 (src line 243) - program goto 36 + program goto 37 statement goto 2 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -6999,316 +7093,326 @@ state 471 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 472 +state 481 flow_control_statement: WHILE variables IN identifier DO in_loop_program END.WHILE statement_terminal - WHILE shift 499 + WHILE shift 509 . error -state 473 - common_table: recursive identifier AS '(' select_query ')'. (76) +state 482 + common_table: recursive identifier AS '(' select_query ')'. (80) - . reduce 76 (src line 541) + . reduce 80 (src line 560) -state 474 +state 483 common_table: recursive identifier '(' identifiers ')' AS.'(' select_query ')' - '(' shift 500 + '(' shift 510 . error -state 475 - order_item: order_value order_direction NULLS order_null_position. (108) +state 484 + order_item: order_value order_direction NULLS order_null_position. (112) - . reduce 108 (src line 686) + . reduce 112 (src line 705) -state 476 - order_null_position: FIRST. (114) +state 485 + order_null_position: FIRST. (118) - . reduce 114 (src line 715) + . reduce 118 (src line 734) -state 477 - order_null_position: LAST. (115) +state 486 + order_null_position: LAST. (119) - . reduce 115 (src line 720) + . reduce 119 (src line 739) -state 478 - row_values: row_value ',' row_values. (104) +state 487 + row_values: row_value ',' row_values. (108) - . reduce 104 (src line 666) + . reduce 108 (src line 685) -state 479 +state 488 insert_query: common_table_clause INSERT INTO identifier '(' field_references ')' VALUES.row_values - '(' shift 255 + '(' shift 259 . error - row_value goto 375 - row_values goto 501 - subquery goto 256 + row_value goto 381 + row_values goto 511 + subquery goto 260 -state 480 - insert_query: common_table_clause INSERT INTO identifier '(' field_references ')' select_query. (202) +state 489 + insert_query: common_table_clause INSERT INTO identifier '(' field_references ')' select_query. (206) - . reduce 202 (src line 1143) + . reduce 206 (src line 1162) -state 481 - field_references: field_reference ',' field_references. (186) +state 490 + field_references: field_reference ',' field_references. (190) - . reduce 186 (src line 1065) + . reduce 190 (src line 1084) -state 482 - join: table join_inner JOIN table join_condition. (167) +state 491 + join: table join_inner JOIN table join_condition. (171) - . reduce 167 (src line 974) + . reduce 171 (src line 993) -state 483 +state 492 join_condition: ON.value - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 502 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 512 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 484 +state 493 join_condition: USING.'(' identifiers ')' - '(' shift 503 + '(' shift 513 . error -485: shift/reduce conflict (shift 301(0), red'n 168(0)) on INNER -485: shift/reduce conflict (shift 302(0), red'n 168(0)) on LEFT -485: shift/reduce conflict (shift 303(0), red'n 168(0)) on RIGHT -485: shift/reduce conflict (shift 304(0), red'n 168(0)) on FULL -485: shift/reduce conflict (shift 299(0), red'n 168(0)) on CROSS -485: shift/reduce conflict (shift 297(0), red'n 168(0)) on NATURAL - 485: reduce/reduce conflict (red'ns 168 and 253) on JOIN - 485: reduce/reduce conflict (red'ns 168 and 257) on JOIN - 485: reduce/reduce conflict (red'ns 168 and 257) on OUTER -state 485 +494: shift/reduce conflict (shift 305(0), red'n 172(0)) on INNER +494: shift/reduce conflict (shift 306(0), red'n 172(0)) on LEFT +494: shift/reduce conflict (shift 307(0), red'n 172(0)) on RIGHT +494: shift/reduce conflict (shift 308(0), red'n 172(0)) on FULL +494: shift/reduce conflict (shift 303(0), red'n 172(0)) on CROSS +494: shift/reduce conflict (shift 301(0), red'n 172(0)) on NATURAL + 494: reduce/reduce conflict (red'ns 172 and 257) on JOIN + 494: reduce/reduce conflict (red'ns 172 and 261) on JOIN + 494: reduce/reduce conflict (red'ns 172 and 261) on OUTER +state 494 join: table.join_inner JOIN table join_condition join: table.NATURAL join_inner JOIN table - join: table NATURAL join_inner JOIN table. (168) + join: table NATURAL join_inner JOIN table. (172) join: table.join_direction join_outer JOIN table join_condition join: table.NATURAL join_direction join_outer JOIN table join: table.CROSS JOIN table - join_inner: . (253) - join_direction: . (257) + join_inner: . (257) + join_direction: . (261) - INNER shift 301 - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - NATURAL shift 297 - . reduce 168 (src line 979) + INNER shift 305 + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + NATURAL shift 301 + . reduce 172 (src line 998) - join_inner goto 296 - join_direction goto 298 + join_inner goto 300 + join_direction goto 302 -state 486 +state 495 join: table NATURAL join_direction join_outer JOIN.table - IDENTIFIER shift 64 - DUAL shift 202 - STDIN shift 204 - '(' shift 54 - . error - - subquery goto 203 - identified_table goto 199 - virtual_table goto 200 - table goto 504 - join goto 201 - identifier goto 126 - - 487: reduce/reduce conflict (red'ns 253 and 257) on JOIN - 487: reduce/reduce conflict (red'ns 253 and 172) on JOIN -487: shift/reduce conflict (shift 301(0), red'n 172(0)) on INNER - 487: reduce/reduce conflict (red'ns 257 and 172) on OUTER -487: shift/reduce conflict (shift 302(0), red'n 172(0)) on LEFT -487: shift/reduce conflict (shift 303(0), red'n 172(0)) on RIGHT -487: shift/reduce conflict (shift 304(0), red'n 172(0)) on FULL -487: shift/reduce conflict (shift 299(0), red'n 172(0)) on CROSS -487: shift/reduce conflict (shift 483(0), red'n 172(0)) on ON -487: shift/reduce conflict (shift 484(0), red'n 172(0)) on USING -487: shift/reduce conflict (shift 297(0), red'n 172(0)) on NATURAL -state 487 + IDENTIFIER shift 65 + DUAL shift 204 + STDIN shift 206 + '(' shift 55 + . error + + subquery goto 205 + identified_table goto 201 + virtual_table goto 202 + table goto 514 + join goto 203 + identifier goto 127 + + 496: reduce/reduce conflict (red'ns 257 and 261) on JOIN + 496: reduce/reduce conflict (red'ns 257 and 176) on JOIN +496: shift/reduce conflict (shift 305(0), red'n 176(0)) on INNER + 496: reduce/reduce conflict (red'ns 261 and 176) on OUTER +496: shift/reduce conflict (shift 306(0), red'n 176(0)) on LEFT +496: shift/reduce conflict (shift 307(0), red'n 176(0)) on RIGHT +496: shift/reduce conflict (shift 308(0), red'n 176(0)) on FULL +496: shift/reduce conflict (shift 303(0), red'n 176(0)) on CROSS +496: shift/reduce conflict (shift 492(0), red'n 176(0)) on ON +496: shift/reduce conflict (shift 493(0), red'n 176(0)) on USING +496: shift/reduce conflict (shift 301(0), red'n 176(0)) on NATURAL +state 496 join: table.join_inner JOIN table join_condition join: table.NATURAL join_inner JOIN table join: table.join_direction join_outer JOIN table join_condition join: table join_direction join_outer JOIN table.join_condition join: table.NATURAL join_direction join_outer JOIN table join: table.CROSS JOIN table - join_inner: . (253) - join_direction: . (257) - join_condition: . (172) - - INNER shift 301 - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - ON shift 483 - USING shift 484 - NATURAL shift 297 - . reduce 172 (src line 996) - - join_condition goto 505 - join_inner goto 296 - join_direction goto 298 + join_inner: . (257) + join_direction: . (261) + join_condition: . (176) + + INNER shift 305 + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + ON shift 492 + USING shift 493 + NATURAL shift 301 + . reduce 176 (src line 1015) -state 488 + join_condition goto 515 + join_inner goto 300 + join_direction goto 302 + +state 497 analytic_function: identifier '(' option ')' OVER.'(' analytic_clause ')' - '(' shift 506 + '(' shift 516 . error -state 489 - add_columns: ALTER TABLE identifier ADD '(' column_defaults ')' column_position. (211) +state 498 + add_columns: ALTER TABLE identifier ADD '(' column_defaults ')' column_position. (215) - . reduce 211 (src line 1193) + . reduce 215 (src line 1212) -state 490 - column_defaults: column_default ',' column_defaults. (215) +state 499 + column_defaults: column_default ',' column_defaults. (219) - . reduce 215 (src line 1213) + . reduce 219 (src line 1232) -state 491 - flow_control_statement: IF value THEN program else END IF statement_terminal. (38) +state 500 + table_statement: DECLARE identifier TABLE '(' identifiers ')' FOR select_query.statement_terminal + statement_terminal: . (271) - . reduce 38 (src line 330) + ';' shift 39 + . reduce 271 (src line 1498) + statement_terminal goto 517 -state 492 +state 501 + flow_control_statement: IF value THEN program else END IF statement_terminal. (42) + + . reduce 42 (src line 349) + + +state 502 flow_control_statement: IF value THEN program elseif else END IF.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 507 + statement_terminal goto 518 -state 493 - elseif: ELSEIF value THEN program. (224) +state 503 + elseif: ELSEIF value THEN program. (228) - . reduce 224 (src line 1256) + . reduce 228 (src line 1275) -state 494 - group_concat: GROUP_CONCAT '(' option order_by_clause SEPARATOR STRING ')'. (151) +state 504 + group_concat: GROUP_CONCAT '(' option order_by_clause SEPARATOR STRING ')'. (155) - . reduce 151 (src line 897) + . reduce 155 (src line 916) -state 495 +state 505 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_else.END IF statement_terminal - END shift 508 + END shift 519 . error -state 496 +state 506 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif.in_loop_else END IF statement_terminal in_loop_elseif: in_loop_elseif.in_loop_elseif - in_loop_else: . (230) + in_loop_else: . (234) - ELSEIF shift 498 - ELSE shift 497 - . reduce 230 (src line 1286) + ELSEIF shift 508 + ELSE shift 507 + . reduce 234 (src line 1305) - in_loop_elseif goto 510 - in_loop_else goto 509 + in_loop_elseif goto 521 + in_loop_else goto 520 -state 497 +state 507 in_loop_else: ELSE.in_loop_program in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - WHILE shift 29 - END reduce 3 (src line 172) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - in_loop_program goto 511 - statement goto 266 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + WHILE shift 30 + END reduce 3 (src line 173) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + in_loop_program goto 522 + statement goto 270 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -7316,78 +7420,78 @@ state 497 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 498 +state 508 in_loop_elseif: ELSEIF.value THEN in_loop_program - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 512 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 523 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 -state 499 +state 509 flow_control_statement: WHILE variables IN identifier DO in_loop_program END WHILE.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 513 + statement_terminal goto 524 -state 500 +state 510 common_table: recursive identifier '(' identifiers ')' AS '('.select_query ')' - common_table_clause: . (74) + common_table_clause: . (78) - WITH shift 33 - . reduce 74 (src line 531) + WITH shift 34 + . reduce 78 (src line 550) - select_query goto 514 - common_table_clause goto 137 + select_query goto 525 + common_table_clause goto 138 -state 501 - insert_query: common_table_clause INSERT INTO identifier '(' field_references ')' VALUES row_values. (200) +state 511 + insert_query: common_table_clause INSERT INTO identifier '(' field_references ')' VALUES row_values. (204) - . reduce 200 (src line 1135) + . reduce 204 (src line 1154) -state 502 +state 512 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -7405,121 +7509,127 @@ state 502 arithmetic: value.'%' value logic: value.OR value logic: value.AND value - join_condition: ON value. (173) - negation: . (251) - - IN reduce 251 (src line 1400) - AND shift 163 - OR shift 162 - NOT shift 164 - BETWEEN reduce 251 (src line 1400) - LIKE reduce 251 (src line 1400) - IS shift 154 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 173 (src line 1001) - - negation goto 155 - comparison_operator goto 156 + join_condition: ON value. (177) + negation: . (255) + + IN reduce 255 (src line 1419) + AND shift 165 + OR shift 164 + NOT shift 166 + BETWEEN reduce 255 (src line 1419) + LIKE reduce 255 (src line 1419) + IS shift 156 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 177 (src line 1020) + + negation goto 157 + comparison_operator goto 158 -state 503 +state 513 join_condition: USING '('.identifiers ')' - IDENTIFIER shift 64 + IDENTIFIER shift 65 . error - identifiers goto 515 - identifier goto 319 + identifiers goto 526 + identifier goto 323 -504: shift/reduce conflict (shift 301(0), red'n 170(0)) on INNER -504: shift/reduce conflict (shift 302(0), red'n 170(0)) on LEFT -504: shift/reduce conflict (shift 303(0), red'n 170(0)) on RIGHT -504: shift/reduce conflict (shift 304(0), red'n 170(0)) on FULL -504: shift/reduce conflict (shift 299(0), red'n 170(0)) on CROSS -504: shift/reduce conflict (shift 297(0), red'n 170(0)) on NATURAL - 504: reduce/reduce conflict (red'ns 170 and 253) on JOIN - 504: reduce/reduce conflict (red'ns 170 and 257) on JOIN - 504: reduce/reduce conflict (red'ns 170 and 257) on OUTER -state 504 +514: shift/reduce conflict (shift 305(0), red'n 174(0)) on INNER +514: shift/reduce conflict (shift 306(0), red'n 174(0)) on LEFT +514: shift/reduce conflict (shift 307(0), red'n 174(0)) on RIGHT +514: shift/reduce conflict (shift 308(0), red'n 174(0)) on FULL +514: shift/reduce conflict (shift 303(0), red'n 174(0)) on CROSS +514: shift/reduce conflict (shift 301(0), red'n 174(0)) on NATURAL + 514: reduce/reduce conflict (red'ns 174 and 257) on JOIN + 514: reduce/reduce conflict (red'ns 174 and 261) on JOIN + 514: reduce/reduce conflict (red'ns 174 and 261) on OUTER +state 514 join: table.join_inner JOIN table join_condition join: table.NATURAL join_inner JOIN table join: table.join_direction join_outer JOIN table join_condition join: table.NATURAL join_direction join_outer JOIN table - join: table NATURAL join_direction join_outer JOIN table. (170) + join: table NATURAL join_direction join_outer JOIN table. (174) join: table.CROSS JOIN table - join_inner: . (253) - join_direction: . (257) + join_inner: . (257) + join_direction: . (261) - INNER shift 301 - LEFT shift 302 - RIGHT shift 303 - FULL shift 304 - CROSS shift 299 - NATURAL shift 297 - . reduce 170 (src line 987) + INNER shift 305 + LEFT shift 306 + RIGHT shift 307 + FULL shift 308 + CROSS shift 303 + NATURAL shift 301 + . reduce 174 (src line 1006) - join_inner goto 296 - join_direction goto 298 + join_inner goto 300 + join_direction goto 302 -state 505 - join: table join_direction join_outer JOIN table join_condition. (169) +state 515 + join: table join_direction join_outer JOIN table join_condition. (173) - . reduce 169 (src line 983) + . reduce 173 (src line 1002) -state 506 +state 516 analytic_function: identifier '(' option ')' OVER '('.analytic_clause ')' - partition: . (154) + partition: . (158) - PARTITION shift 518 - . reduce 154 (src line 914) + PARTITION shift 529 + . reduce 158 (src line 933) - analytic_clause goto 516 - partition goto 517 + analytic_clause goto 527 + partition goto 528 -state 507 - flow_control_statement: IF value THEN program elseif else END IF statement_terminal. (39) +state 517 + table_statement: DECLARE identifier TABLE '(' identifiers ')' FOR select_query statement_terminal. (31) - . reduce 39 (src line 335) + . reduce 31 (src line 300) -state 508 +state 518 + flow_control_statement: IF value THEN program elseif else END IF statement_terminal. (43) + + . reduce 43 (src line 354) + + +state 519 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_else END.IF statement_terminal - IF shift 519 + IF shift 530 . error -state 509 +state 520 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif in_loop_else.END IF statement_terminal - END shift 520 + END shift 531 . error -510: shift/reduce conflict (shift 498(0), red'n 229(0)) on ELSEIF -state 510 +521: shift/reduce conflict (shift 508(0), red'n 233(0)) on ELSEIF +state 521 in_loop_elseif: in_loop_elseif.in_loop_elseif - in_loop_elseif: in_loop_elseif in_loop_elseif. (229) + in_loop_elseif: in_loop_elseif in_loop_elseif. (233) - ELSEIF shift 498 - . reduce 229 (src line 1281) + ELSEIF shift 508 + . reduce 233 (src line 1300) - in_loop_elseif goto 510 + in_loop_elseif goto 521 -state 511 - in_loop_else: ELSE in_loop_program. (231) +state 522 + in_loop_else: ELSE in_loop_program. (235) - . reduce 231 (src line 1291) + . reduce 235 (src line 1310) -state 512 +state 523 string_operation: value.STRING_OP value comparison: value.COMPARISON_OP value comparison: value.'=' value @@ -7538,125 +7648,126 @@ state 512 logic: value.OR value logic: value.AND value in_loop_elseif: ELSEIF value.THEN in_loop_program - negation: . (251) - - AND shift 163 - OR shift 162 - NOT shift 164 - IS shift 154 - THEN shift 521 - COMPARISON_OP shift 152 - STRING_OP shift 151 - '=' shift 153 - '+' shift 157 - '-' shift 158 - '*' shift 159 - '/' shift 160 - '%' shift 161 - . reduce 251 (src line 1400) - - negation goto 155 - comparison_operator goto 156 + negation: . (255) + + AND shift 165 + OR shift 164 + NOT shift 166 + IS shift 156 + THEN shift 532 + COMPARISON_OP shift 154 + STRING_OP shift 153 + '=' shift 155 + '+' shift 159 + '-' shift 160 + '*' shift 161 + '/' shift 162 + '%' shift 163 + . reduce 255 (src line 1419) + + negation goto 157 + comparison_operator goto 158 -state 513 - flow_control_statement: WHILE variables IN identifier DO in_loop_program END WHILE statement_terminal. (41) +state 524 + flow_control_statement: WHILE variables IN identifier DO in_loop_program END WHILE statement_terminal. (45) - . reduce 41 (src line 343) + . reduce 45 (src line 362) -state 514 +state 525 common_table: recursive identifier '(' identifiers ')' AS '(' select_query.')' - ')' shift 522 + ')' shift 533 . error -state 515 +state 526 join_condition: USING '(' identifiers.')' - ')' shift 523 + ')' shift 534 . error -state 516 +state 527 analytic_function: identifier '(' option ')' OVER '(' analytic_clause.')' - ')' shift 524 + ')' shift 535 . error -state 517 +state 528 analytic_clause: partition.order_by_clause - order_by_clause: . (65) + order_by_clause: . (69) - ORDER shift 122 - . reduce 65 (src line 487) + ORDER shift 123 + . reduce 69 (src line 506) - order_by_clause goto 525 + order_by_clause goto 536 -state 518 +state 529 partition: PARTITION.BY values - BY shift 526 + BY shift 537 . error -state 519 +state 530 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_else END IF.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 527 + statement_terminal goto 538 -state 520 +state 531 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif in_loop_else END.IF statement_terminal - IF shift 528 + IF shift 539 . error -state 521 +state 532 in_loop_elseif: ELSEIF value THEN.in_loop_program in_loop_program: . (3) - common_table_clause: . (74) - - VARIABLE shift 35 - SET shift 31 - CREATE shift 17 - ALTER shift 18 - WITH shift 33 - IF shift 268 - ELSEIF reduce 3 (src line 172) - WHILE shift 29 - ELSE reduce 3 (src line 172) - END reduce 3 (src line 172) - DECLARE shift 23 - FETCH shift 27 - OPEN shift 24 - CLOSE shift 25 - DISPOSE shift 26 - COMMIT shift 21 - ROLLBACK shift 22 - CONTINUE shift 269 - BREAK shift 270 - EXIT shift 30 - PRINT shift 32 - VAR shift 19 - . reduce 74 (src line 531) - - in_loop_program goto 529 - statement goto 266 - in_loop_statement goto 265 + common_table_clause: . (78) + + VARIABLE shift 36 + SET shift 32 + CREATE shift 18 + ALTER shift 19 + WITH shift 34 + IF shift 272 + ELSEIF reduce 3 (src line 173) + WHILE shift 30 + ELSE reduce 3 (src line 173) + END reduce 3 (src line 173) + DECLARE shift 24 + FETCH shift 28 + OPEN shift 25 + CLOSE shift 26 + DISPOSE shift 27 + COMMIT shift 22 + ROLLBACK shift 23 + CONTINUE shift 273 + BREAK shift 274 + EXIT shift 31 + PRINT shift 33 + VAR shift 20 + . reduce 78 (src line 550) + + in_loop_program goto 540 + statement goto 270 + in_loop_statement goto 269 variable_statement goto 11 transaction_statement goto 12 cursor_statement goto 13 - flow_control_statement goto 14 - in_loop_flow_control_statement goto 267 - command_statement goto 15 + table_statement goto 14 + flow_control_statement goto 15 + in_loop_flow_control_statement goto 271 + command_statement goto 16 select_query goto 3 - common_table_clause goto 16 + common_table_clause goto 17 insert_query goto 4 update_query goto 5 delete_query goto 6 @@ -7664,119 +7775,119 @@ state 521 add_columns goto 8 drop_columns goto 9 rename_column goto 10 - variable goto 34 - variable_substitution goto 20 + variable goto 35 + variable_substitution goto 21 -state 522 - common_table: recursive identifier '(' identifiers ')' AS '(' select_query ')'. (77) +state 533 + common_table: recursive identifier '(' identifiers ')' AS '(' select_query ')'. (81) - . reduce 77 (src line 546) + . reduce 81 (src line 565) -state 523 - join_condition: USING '(' identifiers ')'. (174) +state 534 + join_condition: USING '(' identifiers ')'. (178) - . reduce 174 (src line 1005) + . reduce 178 (src line 1024) -state 524 - analytic_function: identifier '(' option ')' OVER '(' analytic_clause ')'. (152) +state 535 + analytic_function: identifier '(' option ')' OVER '(' analytic_clause ')'. (156) - . reduce 152 (src line 902) + . reduce 156 (src line 921) -state 525 - analytic_clause: partition order_by_clause. (153) +state 536 + analytic_clause: partition order_by_clause. (157) - . reduce 153 (src line 908) + . reduce 157 (src line 927) -state 526 +state 537 partition: PARTITION BY.values - IDENTIFIER shift 64 - STRING shift 102 - INTEGER shift 103 - FLOAT shift 105 - TERNARY shift 106 - DATETIME shift 107 - VARIABLE shift 35 - EXISTS shift 99 - NOT shift 100 - NULL shift 108 - CASE shift 97 - CURSOR shift 101 - GROUP_CONCAT shift 109 - '-' shift 104 - '(' shift 88 - . error - - cursor_status goto 87 - primary goto 77 - field_reference goto 76 - value goto 340 - row_value goto 98 - subquery goto 80 - string_operation goto 79 - comparison goto 83 - arithmetic goto 78 - logic goto 84 - function goto 81 - group_concat goto 96 - case goto 82 - values goto 530 - identifier goto 89 - text goto 90 - integer goto 91 - float goto 92 - ternary goto 93 - datetime goto 94 - null goto 95 - variable goto 85 - variable_substitution goto 86 - -state 527 - in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_else END IF statement_terminal. (43) - - . reduce 43 (src line 352) - - -state 528 + IDENTIFIER shift 65 + STRING shift 103 + INTEGER shift 104 + FLOAT shift 106 + TERNARY shift 107 + DATETIME shift 108 + VARIABLE shift 36 + EXISTS shift 100 + NOT shift 101 + NULL shift 109 + CASE shift 98 + CURSOR shift 102 + GROUP_CONCAT shift 110 + '-' shift 105 + '(' shift 89 + . error + + cursor_status goto 88 + primary goto 78 + field_reference goto 77 + value goto 346 + row_value goto 99 + subquery goto 81 + string_operation goto 80 + comparison goto 84 + arithmetic goto 79 + logic goto 85 + function goto 82 + group_concat goto 97 + case goto 83 + values goto 541 + identifier goto 90 + text goto 91 + integer goto 92 + float goto 93 + ternary goto 94 + datetime goto 95 + null goto 96 + variable goto 86 + variable_substitution goto 87 + +state 538 + in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_else END IF statement_terminal. (47) + + . reduce 47 (src line 371) + + +state 539 in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif in_loop_else END IF.statement_terminal - statement_terminal: . (267) + statement_terminal: . (271) - ';' shift 38 - . reduce 267 (src line 1479) + ';' shift 39 + . reduce 271 (src line 1498) - statement_terminal goto 531 + statement_terminal goto 542 -state 529 - in_loop_elseif: ELSEIF value THEN in_loop_program. (228) +state 540 + in_loop_elseif: ELSEIF value THEN in_loop_program. (232) - . reduce 228 (src line 1276) + . reduce 232 (src line 1295) -state 530 - partition: PARTITION BY values. (155) +state 541 + partition: PARTITION BY values. (159) - . reduce 155 (src line 919) + . reduce 159 (src line 938) -state 531 - in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif in_loop_else END IF statement_terminal. (44) +state 542 + in_loop_flow_control_statement: IF value THEN in_loop_program in_loop_elseif in_loop_else END IF statement_terminal. (48) - . reduce 44 (src line 357) + . reduce 48 (src line 376) -120 terminals, 103 nonterminals -269 grammar rules, 532/8000 states +120 terminals, 104 nonterminals +273 grammar rules, 543/8000 states 77 shift/reduce, 81 reduce/reduce conflicts reported -152 working sets used -memory: parser 2382/120000 -600 extra closures -1673 shift entries, 91 exceptions -411 goto entries -1235 entries saved by goto default -Optimizer space used: output 1065/120000 -1065 table entries, 139 zero -maximum spread: 120, maximum offset: 528 +153 working sets used +memory: parser 2459/120000 +611 extra closures +1683 shift entries, 91 exceptions +419 goto entries +1247 entries saved by goto default +Optimizer space used: output 1104/120000 +1104 table entries, 165 zero +maximum spread: 120, maximum offset: 539 diff --git a/lib/parser/parser.y b/lib/parser/parser.y index d6cd6cf0..6b8c749f 100644 --- a/lib/parser/parser.y +++ b/lib/parser/parser.y @@ -29,6 +29,7 @@ package parser %type variable_statement %type transaction_statement %type cursor_statement +%type table_statement %type fetch_position %type cursor_status %type flow_control_statement @@ -226,6 +227,10 @@ statement { $$ = $1 } + | table_statement + { + $$ = $1 + } | flow_control_statement { $$ = $1 @@ -287,6 +292,20 @@ cursor_statement $$ = FetchCursor{Position: $2, Cursor: $3, Variables: $5} } +table_statement + : DECLARE identifier TABLE '(' identifiers ')' + { + $$ = TableDeclaration{Table: $2, Fields: $5} + } + | DECLARE identifier TABLE '(' identifiers ')' FOR select_query statement_terminal + { + $$ = TableDeclaration{Table: $2, Fields: $5, Query: $8} + } + | DECLARE identifier TABLE FOR select_query statement_terminal + { + $$ = TableDeclaration{Table: $2, Query: $5} + } + fetch_position : { @@ -754,19 +773,19 @@ string_operation comparison : value COMPARISON_OP value { - $$ = Comparison{LHS: $1, Operator: $2, RHS: $3} + $$ = Comparison{LHS: $1, Operator: $2.Literal, RHS: $3} } | row_value COMPARISON_OP row_value { - $$ = Comparison{LHS: $1, Operator: $2, RHS: $3} + $$ = Comparison{LHS: $1, Operator: $2.Literal, RHS: $3} } | value '=' value { - $$ = Comparison{LHS: $1, Operator: Token{Token: COMPARISON_OP, Literal: "="}, RHS: $3} + $$ = Comparison{LHS: $1, Operator: "=", RHS: $3} } | row_value '=' row_value { - $$ = Comparison{LHS: $1, Operator: Token{Token: COMPARISON_OP, Literal: "="}, RHS: $3} + $$ = Comparison{LHS: $1, Operator: "=", RHS: $3} } | value IS negation ternary { @@ -802,27 +821,27 @@ comparison } | value comparison_operator ANY row_value { - $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2, Values: $4} + $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2.Literal, Values: $4} } | row_value comparison_operator ANY '(' row_values ')' { - $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2, Values: RowValueList{RowValues: $5}} + $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2.Literal, Values: RowValueList{RowValues: $5}} } | row_value comparison_operator ANY subquery { - $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2, Values: $4} + $$ = Any{Any: $3.Literal, LHS: $1, Operator: $2.Literal, Values: $4} } | value comparison_operator ALL row_value { - $$ = All{All: $3.Literal, LHS: $1, Operator: $2, Values: $4} + $$ = All{All: $3.Literal, LHS: $1, Operator: $2.Literal, Values: $4} } | row_value comparison_operator ALL '(' row_values ')' { - $$ = All{All: $3.Literal, LHS: $1, Operator: $2, Values: RowValueList{RowValues: $5}} + $$ = All{All: $3.Literal, LHS: $1, Operator: $2.Literal, Values: RowValueList{RowValues: $5}} } | row_value comparison_operator ALL subquery { - $$ = All{All: $3.Literal, LHS: $1, Operator: $2, Values: $4} + $$ = All{All: $3.Literal, LHS: $1, Operator: $2.Literal, Values: $4} } | EXISTS subquery { @@ -932,7 +951,7 @@ identified_table } | identifier AS identifier { - $$ = Table{Object: $1, As: $2, Alias: $3} + $$ = Table{Object: $1, As: $2.Literal, Alias: $3} } virtual_table @@ -960,7 +979,7 @@ table } | virtual_table AS identifier { - $$ = Table{Object: $1, As: $2, Alias: $3} + $$ = Table{Object: $1, As: $2.Literal, Alias: $3} } | join { @@ -1028,7 +1047,7 @@ field } | field_object AS identifier { - $$ = Field{Object: $1, As: $2, Alias: $3} + $$ = Field{Object: $1, As: $2.Literal, Alias: $3} } case diff --git a/lib/parser/parser_test.go b/lib/parser/parser_test.go index 8cd6f9ec..12160e7c 100644 --- a/lib/parser/parser_test.go +++ b/lib/parser/parser_test.go @@ -1,15 +1,16 @@ package parser import ( - "fmt" - "github.com/mithrandie/csvq/lib/ternary" "reflect" "testing" + + "github.com/mithrandie/csvq/lib/ternary" ) var parseTests = []struct { Input string Output []Statement + Error string }{ { Input: "select foo; select bar;", @@ -31,19 +32,19 @@ var parseTests = []struct { LHS: SelectEntity{ SelectClause: SelectClause{Select: "select", Fields: []Expression{Field{Object: NewInteger(1)}}}, }, - Operator: Token{Token: UNION, Literal: "union"}, - All: Token{Token: ALL, Literal: "all"}, + Operator: Token{Token: UNION, Literal: "union", Line: 1, Char: 10}, + All: Token{Token: ALL, Literal: "all", Line: 1, Char: 16}, RHS: SelectSet{ LHS: SelectEntity{ SelectClause: SelectClause{Select: "select", Fields: []Expression{Field{Object: NewInteger(2)}}}, }, - Operator: Token{Token: INTERSECT, Literal: "intersect"}, + Operator: Token{Token: INTERSECT, Literal: "intersect", Line: 1, Char: 29}, RHS: SelectEntity{ SelectClause: SelectClause{Select: "select", Fields: []Expression{Field{Object: NewInteger(3)}}}, }, }, }, - Operator: Token{Token: EXCEPT, Literal: "except"}, + Operator: Token{Token: EXCEPT, Literal: "except", Line: 1, Char: 48}, RHS: SelectEntity{ SelectClause: SelectClause{Select: "select", Fields: []Expression{Field{Object: NewInteger(4)}}}, }, @@ -59,7 +60,7 @@ var parseTests = []struct { LHS: SelectEntity{ SelectClause: SelectClause{Select: "select", Fields: []Expression{Field{Object: NewInteger(1)}}}, }, - Operator: Token{Token: UNION, Literal: "union"}, + Operator: Token{Token: UNION, Literal: "union", Line: 1, Char: 10}, RHS: Subquery{ Query: SelectQuery{ SelectEntity: SelectEntity{ @@ -81,7 +82,7 @@ var parseTests = []struct { Fields: []Expression{ Field{ Object: NewInteger(1), - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "a"}, }, }, @@ -182,7 +183,7 @@ var parseTests = []struct { Tables: []Expression{ Table{ Object: Identifier{Literal: "table1"}, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias"}, }, Table{ @@ -194,7 +195,7 @@ var parseTests = []struct { }, }, }, - As: Token{Token: AS, Literal: "as"}, + As: "as", Alias: Identifier{Literal: "alias2"}, }, }, @@ -204,14 +205,19 @@ var parseTests = []struct { }, }, { - Input: "select 1 " + - " from dual " + - " where 1 = 1" + - " group by column1, column2 " + - " having 1 > 1 " + - " order by column4, column5 desc, column6 asc, column7 nulls first, column8 desc nulls last, avg() over () " + - " limit 10 " + - " offset 10 ", + Input: "select 1 \r\n" + + " from dual \n" + + " where 1 = 1 \n" + + " group by column1, column2 \n" + + " having 1 > 1 \n" + + " order by column4, \n" + + " column5 desc, \n" + + " column6 asc, \n" + + " column7 nulls first, \n" + + " column8 desc nulls last, \n" + + " avg() over () \n" + + " limit 10 \n" + + " offset 10 \n", Output: []Statement{ SelectQuery{ SelectEntity: SelectEntity{ @@ -221,7 +227,7 @@ var parseTests = []struct { Where: "where", Filter: Comparison{ LHS: NewIntegerFromString("1"), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: NewIntegerFromString("1"), }, }, @@ -236,7 +242,7 @@ var parseTests = []struct { Having: "having", Filter: Comparison{ LHS: NewIntegerFromString("1"), - Operator: Token{Token: COMPARISON_OP, Literal: ">"}, + Operator: ">", RHS: NewIntegerFromString("1"), }, }, @@ -245,10 +251,10 @@ var parseTests = []struct { OrderBy: "order by", Items: []Expression{ OrderItem{Value: FieldReference{Column: Identifier{Literal: "column4"}}}, - OrderItem{Value: FieldReference{Column: Identifier{Literal: "column5"}}, Direction: Token{Token: DESC, Literal: "desc"}}, - OrderItem{Value: FieldReference{Column: Identifier{Literal: "column6"}}, Direction: Token{Token: ASC, Literal: "asc"}}, - OrderItem{Value: FieldReference{Column: Identifier{Literal: "column7"}}, Nulls: "nulls", Position: Token{Token: FIRST, Literal: "first"}}, - OrderItem{Value: FieldReference{Column: Identifier{Literal: "column8"}}, Direction: Token{Token: DESC, Literal: "desc"}, Nulls: "nulls", Position: Token{Token: LAST, Literal: "last"}}, + OrderItem{Value: FieldReference{Column: Identifier{Literal: "column5"}}, Direction: Token{Token: DESC, Literal: "desc", Line: 7, Char: 19}}, + OrderItem{Value: FieldReference{Column: Identifier{Literal: "column6"}}, Direction: Token{Token: ASC, Literal: "asc", Line: 8, Char: 19}}, + OrderItem{Value: FieldReference{Column: Identifier{Literal: "column7"}}, Nulls: "nulls", Position: Token{Token: FIRST, Literal: "first", Line: 9, Char: 25}}, + OrderItem{Value: FieldReference{Column: Identifier{Literal: "column8"}}, Direction: Token{Token: DESC, Literal: "desc", Line: 10, Char: 19}, Nulls: "nulls", Position: Token{Token: LAST, Literal: "last", Line: 10, Char: 30}}, OrderItem{Value: AnalyticFunction{ Name: "avg", Option: Option{}, @@ -290,8 +296,8 @@ var parseTests = []struct { }, }, { - Input: "select 1 " + - " from dual " + + Input: "select 1 \n" + + " from dual \n" + " limit 10 with ties", Output: []Statement{ SelectQuery{ @@ -302,7 +308,7 @@ var parseTests = []struct { LimitClause: LimitClause{ Limit: "limit", Value: NewInteger(10), - With: LimitWith{With: "with", Type: Token{Token: TIES, Literal: "ties"}}, + With: LimitWith{With: "with", Type: Token{Token: TIES, Literal: "ties", Line: 3, Char: 16}}, }, }, }, @@ -314,7 +320,7 @@ var parseTests = []struct { SelectEntity: SelectEntity{ SelectClause: SelectClause{ Select: "select", - Distinct: Token{Token: DISTINCT, Literal: "distinct"}, + Distinct: Token{Token: DISTINCT, Literal: "distinct", Line: 1, Char: 8}, Fields: []Expression{ Field{Object: AllColumns{}}, }, @@ -504,7 +510,7 @@ var parseTests = []struct { Fields: []Expression{ Field{Object: Comparison{ LHS: FieldReference{Column: Identifier{Literal: "column1"}}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: NewInteger(1), }}, }, @@ -530,7 +536,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: RowValue{ Value: ValueList{ Values: []Expression{ @@ -556,7 +562,7 @@ var parseTests = []struct { Fields: []Expression{ Field{Object: Comparison{ LHS: FieldReference{Column: Identifier{Literal: "column1"}}, - Operator: Token{Token: COMPARISON_OP, Literal: "<"}, + Operator: "<", RHS: NewInteger(1), }}, }, @@ -582,7 +588,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "<"}, + Operator: "<", RHS: RowValue{ Value: Subquery{ Query: SelectQuery{ @@ -617,7 +623,7 @@ var parseTests = []struct { Is: "is", LHS: FieldReference{Column: Identifier{Literal: "column1"}}, RHS: NewNullFromString("null"), - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 19}, }}, }, }, @@ -658,7 +664,7 @@ var parseTests = []struct { LHS: FieldReference{Column: Identifier{Literal: "column1"}}, Low: NewIntegerFromString("-10"), High: NewIntegerFromString("10"), - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 16}, }}, }, }, @@ -728,7 +734,7 @@ var parseTests = []struct { }, }, }, - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 16}, }}, }, }, @@ -774,7 +780,7 @@ var parseTests = []struct { }, }, }, - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 27}, }}, }, }, @@ -826,7 +832,7 @@ var parseTests = []struct { Like: "like", LHS: FieldReference{Column: Identifier{Literal: "column1"}}, Pattern: String{literal: "pattern"}, - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 16}, }}, }, }, @@ -845,7 +851,7 @@ var parseTests = []struct { Field{Object: Any{ Any: "any", LHS: FieldReference{Column: Identifier{Literal: "column1"}}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: RowValue{ Value: Subquery{ Query: SelectQuery{ @@ -880,7 +886,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: RowValueList{ RowValues: []Expression{ RowValue{ @@ -926,7 +932,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: Subquery{ Query: SelectQuery{ SelectEntity: SelectEntity{ @@ -952,7 +958,7 @@ var parseTests = []struct { Field{Object: All{ All: "all", LHS: FieldReference{Column: Identifier{Literal: "column1"}}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: RowValue{ Subquery{ Query: SelectQuery{ @@ -987,7 +993,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: RowValueList{ RowValues: []Expression{ RowValue{ @@ -1033,7 +1039,7 @@ var parseTests = []struct { }, }, }, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", Values: Subquery{ Query: SelectQuery{ SelectEntity: SelectEntity{ @@ -1177,7 +1183,7 @@ var parseTests = []struct { Fields: []Expression{ Field{Object: Logic{ LHS: NewTernaryFromString("true"), - Operator: Token{Token: AND, Literal: "and"}, + Operator: Token{Token: AND, Literal: "and", Line: 1, Char: 13}, RHS: NewTernaryFromString("false"), }}, }, @@ -1196,7 +1202,7 @@ var parseTests = []struct { Fields: []Expression{ Field{Object: Logic{ LHS: NewTernaryFromString("true"), - Operator: Token{Token: OR, Literal: "or"}, + Operator: Token{Token: OR, Literal: "or", Line: 1, Char: 13}, RHS: NewTernaryFromString("false"), }}, }, @@ -1214,7 +1220,7 @@ var parseTests = []struct { Select: "select", Fields: []Expression{ Field{Object: Logic{ - Operator: Token{Token: NOT, Literal: "not"}, + Operator: Token{Token: NOT, Literal: "not", Line: 1, Char: 8}, RHS: NewTernaryFromString("false"), }}, }, @@ -1233,11 +1239,11 @@ var parseTests = []struct { Fields: []Expression{ Field{Object: Logic{ LHS: NewTernaryFromString("true"), - Operator: Token{Token: OR, Literal: "or"}, + Operator: Token{Token: OR, Literal: "or", Line: 1, Char: 13}, RHS: Parentheses{ Expr: Logic{ LHS: NewTernaryFromString("false"), - Operator: Token{Token: AND, Literal: "and"}, + Operator: Token{Token: AND, Literal: "and", Line: 1, Char: 23}, RHS: NewTernaryFromString("false"), }, }, @@ -1259,15 +1265,15 @@ var parseTests = []struct { Field{Object: Logic{ LHS: Logic{ LHS: NewTernaryFromString("true"), - Operator: Token{Token: AND, Literal: "and"}, + Operator: Token{Token: AND, Literal: "and", Line: 1, Char: 13}, RHS: NewTernaryFromString("true"), }, - Operator: Token{Token: OR, Literal: "or"}, + Operator: Token{Token: OR, Literal: "or", Line: 1, Char: 22}, RHS: Logic{ LHS: NewTernaryFromString("false"), - Operator: Token{Token: AND, Literal: "and"}, + Operator: Token{Token: AND, Literal: "and", Line: 1, Char: 31}, RHS: Logic{ - Operator: Token{Token: NOT, Literal: "not"}, + Operator: Token{Token: NOT, Literal: "not", Line: 1, Char: 35}, RHS: NewTernaryFromString("false"), }, }, @@ -1409,7 +1415,7 @@ var parseTests = []struct { Field{Object: Function{ Name: "count", Option: Option{ - Distinct: Token{Token: DISTINCT, Literal: "distinct"}, + Distinct: Token{Token: DISTINCT, Literal: "distinct", Line: 1, Char: 14}, Args: []Expression{AllColumns{}}, }, }}, @@ -1498,7 +1504,7 @@ var parseTests = []struct { CursorLit: "cursor", Cursor: Identifier{Literal: "cur"}, Is: "is", - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 22}, Type: OPEN, TypeLit: "open", }}, @@ -1520,7 +1526,7 @@ var parseTests = []struct { CursorLit: "cursor", Cursor: Identifier{Literal: "cur"}, Is: "is", - Negation: Token{Token: NOT, Literal: "not"}, + Negation: Token{Token: NOT, Literal: "not", Line: 1, Char: 22}, Type: RANGE, TypeLit: "in range", }}, @@ -1602,7 +1608,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - JoinType: Token{Token: CROSS, Literal: "cross"}, + JoinType: Token{Token: CROSS, Literal: "cross", Line: 1, Char: 22}, }, }, }, @@ -1625,7 +1631,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - JoinType: Token{Token: INNER, Literal: "inner"}, + JoinType: Token{Token: INNER, Literal: "inner", Line: 1, Char: 22}, }, }, }, @@ -1652,7 +1658,7 @@ var parseTests = []struct { Literal: "on", On: Comparison{ LHS: FieldReference{View: Identifier{Literal: "table1"}, Column: Identifier{Literal: "id"}}, - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", RHS: FieldReference{View: Identifier{Literal: "table2"}, Column: Identifier{Literal: "id"}}, }, }, @@ -1678,7 +1684,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - Natural: Token{Token: NATURAL, Literal: "natural"}, + Natural: Token{Token: NATURAL, Literal: "natural", Line: 1, Char: 22}, }, }, }, @@ -1701,7 +1707,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - Direction: Token{Token: LEFT, Literal: "left"}, + Direction: Token{Token: LEFT, Literal: "left", Line: 1, Char: 22}, Condition: JoinCondition{ Literal: "using", Using: []Expression{ @@ -1730,8 +1736,8 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - Natural: Token{Token: NATURAL, Literal: "natural"}, - JoinType: Token{Token: OUTER, Literal: "outer"}, + Natural: Token{Token: NATURAL, Literal: "natural", Line: 1, Char: 22}, + JoinType: Token{Token: OUTER, Literal: "outer", Line: 1, Char: 30}, }, }, }, @@ -1754,7 +1760,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - Direction: Token{Token: RIGHT, Literal: "right"}, + Direction: Token{Token: RIGHT, Literal: "right", Line: 1, Char: 22}, }, }, }, @@ -1777,7 +1783,7 @@ var parseTests = []struct { Join: "join", Table: Table{Object: Identifier{Literal: "table1"}}, JoinTable: Table{Object: Identifier{Literal: "table2"}}, - Direction: Token{Token: FULL, Literal: "full"}, + Direction: Token{Token: FULL, Literal: "full", Line: 1, Char: 22}, }, }, }, @@ -2080,7 +2086,7 @@ var parseTests = []struct { }, }, Position: ColumnPosition{ - Position: Token{Token: FIRST, Literal: "first"}, + Position: Token{Token: FIRST, Literal: "first", Line: 1, Char: 53}, }, }, }, @@ -2098,7 +2104,7 @@ var parseTests = []struct { }, }, Position: ColumnPosition{ - Position: Token{Token: LAST, Literal: "last"}, + Position: Token{Token: LAST, Literal: "last", Line: 1, Char: 32}, }, }, }, @@ -2116,7 +2122,7 @@ var parseTests = []struct { }, }, Position: ColumnPosition{ - Position: Token{Token: AFTER, Literal: "after"}, + Position: Token{Token: AFTER, Literal: "after", Line: 1, Char: 32}, Column: FieldReference{Column: Identifier{Literal: "column2"}}, }, }, @@ -2135,7 +2141,7 @@ var parseTests = []struct { }, }, Position: ColumnPosition{ - Position: Token{Token: BEFORE, Literal: "before"}, + Position: Token{Token: BEFORE, Literal: "before", Line: 1, Char: 32}, Column: FieldReference{Column: Identifier{Literal: "column2"}}, }, }, @@ -2272,7 +2278,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: NEXT, Literal: "next"}, + Position: Token{Token: NEXT, Literal: "next", Line: 1, Char: 7}, }, Variables: []Variable{ {Name: "@var1"}, @@ -2286,7 +2292,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: PRIOR, Literal: "prior"}, + Position: Token{Token: PRIOR, Literal: "prior", Line: 1, Char: 7}, }, Variables: []Variable{ {Name: "@var1"}, @@ -2300,7 +2306,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: FIRST, Literal: "first"}, + Position: Token{Token: FIRST, Literal: "first", Line: 1, Char: 7}, }, Variables: []Variable{ {Name: "@var1"}, @@ -2314,7 +2320,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: LAST, Literal: "last"}, + Position: Token{Token: LAST, Literal: "last", Line: 1, Char: 7}, }, Variables: []Variable{ {Name: "@var1"}, @@ -2328,7 +2334,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: ABSOLUTE, Literal: "absolute"}, + Position: Token{Token: ABSOLUTE, Literal: "absolute", Line: 1, Char: 7}, Number: NewInteger(1), }, Variables: []Variable{ @@ -2343,7 +2349,7 @@ var parseTests = []struct { FetchCursor{ Cursor: Identifier{Literal: "cur"}, Position: FetchPosition{ - Position: Token{Token: RELATIVE, Literal: "relative"}, + Position: Token{Token: RELATIVE, Literal: "relative", Line: 1, Char: 7}, Number: NewInteger(1), }, Variables: []Variable{ @@ -2352,6 +2358,68 @@ var parseTests = []struct { }, }, }, + { + Input: "declare tbl table (column1, column2)", + Output: []Statement{ + TableDeclaration{ + Table: Identifier{Literal: "tbl"}, + Fields: []Expression{ + Identifier{Literal: "column1"}, + Identifier{Literal: "column2"}, + }, + }, + }, + }, + { + Input: "declare tbl table (column1, column2) for select 1, 2", + Output: []Statement{ + TableDeclaration{ + Table: Identifier{Literal: "tbl"}, + Fields: []Expression{ + Identifier{Literal: "column1"}, + Identifier{Literal: "column2"}, + }, + Query: SelectQuery{ + SelectEntity: SelectEntity{ + SelectClause: SelectClause{ + Select: "select", + Fields: []Expression{ + Field{ + Object: NewInteger(1), + }, + Field{ + Object: NewInteger(2), + }, + }, + }, + }, + }, + }, + }, + }, + { + Input: "declare tbl table for select 1, 2", + Output: []Statement{ + TableDeclaration{ + Table: Identifier{Literal: "tbl"}, + Query: SelectQuery{ + SelectEntity: SelectEntity{ + SelectClause: SelectClause{ + Select: "select", + Fields: []Expression{ + Field{ + Object: NewInteger(1), + }, + Field{ + Object: NewInteger(2), + }, + }, + }, + }, + }, + }, + }, + }, { Input: "if @var1 = 1 then print 1; end if", Output: []Statement{ @@ -2359,7 +2427,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(1), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ Print{Value: NewInteger(1)}, @@ -2374,7 +2442,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(1), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ Print{Value: NewInteger(1)}, @@ -2384,7 +2452,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(2), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ Print{Value: NewInteger(2)}, @@ -2394,7 +2462,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(3), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ Print{Value: NewInteger(3)}, @@ -2473,7 +2541,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(1), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ FlowControl{Token: CONTINUE}, @@ -2493,7 +2561,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(1), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ FlowControl{Token: CONTINUE}, @@ -2503,7 +2571,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(2), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ FlowControl{Token: BREAK}, @@ -2513,7 +2581,7 @@ var parseTests = []struct { Condition: Comparison{ LHS: Variable{Name: "@var1"}, RHS: NewInteger(3), - Operator: Token{Token: COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []Statement{ FlowControl{Token: EXIT}, @@ -2530,21 +2598,25 @@ var parseTests = []struct { }, }, }, + { + Input: "select 'literal not terminated", + Error: "literal not terminated [L:1 C:30]", + }, } func TestParse(t *testing.T) { - SetDebugLevel(0, true) - - errorQuery := "select 'literal not teriinated" - _, err := Parse(errorQuery) - if err == nil { - t.Errorf("no error, want an error for %q", errorQuery) - } - for _, v := range parseTests { prog, err := Parse(v.Input) if err != nil { - t.Errorf("unexpected error %q at %q", err.Error(), v.Input) + if len(v.Error) < 1 { + t.Errorf("unexpected error %q for %q", err, v.Input) + } else if err.Error() != v.Error { + t.Errorf("error %q, want error %q for %q", err, v.Error, v.Input) + } + continue + } + if 0 < len(v.Error) { + t.Errorf("no error, want error %q for %q", v.Error, v.Input) continue } @@ -2615,16 +2687,3 @@ func TestParse(t *testing.T) { } } } - -func ExampleSetDebugLevel() { - SetDebugLevel(0, false) - _, err := Parse("select select") - fmt.Println(err) - - SetDebugLevel(0, true) - _, err = Parse("select select") - fmt.Println(err) - //Output: - //syntax error - //syntax error: unexpected SELECT -} diff --git a/lib/parser/scanner.go b/lib/parser/scanner.go index b0a44718..5f8f80fe 100644 --- a/lib/parser/scanner.go +++ b/lib/parser/scanner.go @@ -53,6 +53,9 @@ type Scanner struct { srcPos int offset int err error + + line int + char int } func (s *Scanner) Init(src string) *Scanner { @@ -60,6 +63,8 @@ func (s *Scanner) Init(src string) *Scanner { s.srcPos = 0 s.offset = 0 s.err = nil + s.line = 1 + s.char = 0 return s } @@ -72,11 +77,32 @@ func (s *Scanner) peek() rune { func (s *Scanner) next() rune { ch := s.peek() - if ch != EOF { + if ch == EOF { + return ch + } + + s.srcPos++ + s.offset++ + s.char++ + + ch = s.checkNewLine(ch) + + return ch +} + +func (s *Scanner) checkNewLine(ch rune) rune { + if ch != '\r' && ch != '\n' { + return ch + } + + if ch == '\r' && s.peek() == '\n' { s.srcPos++ s.offset++ } - return ch + + s.line++ + s.char = 0 + return s.src[s.srcPos-1] } func (s *Scanner) runes() []rune { @@ -110,10 +136,10 @@ func (s *Scanner) unescapeTokenString() string { return string(runes) } -func (s *Scanner) Scan() (int, string, bool, error) { +func (s *Scanner) Scan() (Token, error) { ch := s.peek() - for s.isWhiteSpace(ch) { + for unicode.IsSpace(ch) { s.next() ch = s.peek() } @@ -123,6 +149,8 @@ func (s *Scanner) Scan() (int, string, bool, error) { token := ch literal := string(ch) quoted := false + line := s.line + char := s.char switch { case s.isDecimal(ch): @@ -163,14 +191,10 @@ func (s *Scanner) Scan() (int, string, bool, error) { literal = s.literal() case s.isCommentRune(ch): s.scanComment() - var tok int - tok, literal, quoted, _ = s.Scan() - token = rune(tok) + return s.Scan() case s.isLineCommentRune(ch): s.scanLineComment() - var tok int - tok, literal, quoted, _ = s.Scan() - token = rune(tok) + return s.Scan() default: switch ch { case EOF: @@ -192,11 +216,7 @@ func (s *Scanner) Scan() (int, string, bool, error) { } } - return int(token), literal, quoted, s.err -} - -func (s *Scanner) isWhiteSpace(ch rune) bool { - return unicode.IsSpace(ch) + return Token{Token: int(token), Literal: literal, Quoted: quoted, Line: line, Char: char}, s.err } func (s *Scanner) scanString(quote rune) { @@ -207,7 +227,9 @@ func (s *Scanner) scanString(quote rune) { break } else if ch == quote { break - } else if ch == '\\' { + } + + if ch == '\\' { s.next() } } diff --git a/lib/parser/scanner_test.go b/lib/parser/scanner_test.go index 9a62e350..d0ea90e9 100644 --- a/lib/parser/scanner_test.go +++ b/lib/parser/scanner_test.go @@ -8,6 +8,8 @@ type scanResult struct { Token int Literal string Quoted bool + Line int + Char int } var scanTests = []struct { @@ -277,6 +279,48 @@ var scanTests = []struct { }, }, }, + { + Name: "Line and Char Count", + Input: "a, \n /* \n\n */ \r\n c \rd 'abc\ndef' --f\n g", + Output: []scanResult{ + { + Token: IDENTIFIER, + Literal: "a", + Line: 1, + Char: 1, + }, + { + Token: int(','), + Literal: ",", + Line: 1, + Char: 2, + }, + { + Token: IDENTIFIER, + Literal: "c", + Line: 5, + Char: 2, + }, + { + Token: IDENTIFIER, + Literal: "d", + Line: 6, + Char: 1, + }, + { + Token: STRING, + Literal: "abc\ndef", + Line: 6, + Char: 3, + }, + { + Token: IDENTIFIER, + Literal: "g", + Line: 8, + Char: 2, + }, + }, + }, { Name: "LiteralNotTerminatedError", Input: "\"string", @@ -290,7 +334,7 @@ func TestScan(t *testing.T) { tokenCount := 0 for { - token, literal, quoted, err := s.Scan() + token, err := s.Scan() tokenCount++ if err != nil { @@ -306,7 +350,7 @@ func TestScan(t *testing.T) { break } - if token == EOF { + if token.Token == EOF { break } @@ -314,14 +358,22 @@ func TestScan(t *testing.T) { break } expect := v.Output[tokenCount-1] - if token != expect.Token { - t.Errorf("%s, token %d: token = %s, want %s", v.Name, tokenCount, TokenLiteral(token), TokenLiteral(expect.Token)) + if token.Token != expect.Token { + t.Errorf("%s, token %d: token = %s, want %s", v.Name, tokenCount, TokenLiteral(token.Token), TokenLiteral(expect.Token)) } - if literal != expect.Literal { - t.Errorf("%s, token %d: literal = %q, want %q", v.Name, tokenCount, literal, expect.Literal) + if token.Literal != expect.Literal { + t.Errorf("%s, token %d: literal = %q, want %q", v.Name, tokenCount, token.Literal, expect.Literal) } - if quoted != expect.Quoted { - t.Errorf("%s, token %d: quoted = %t, want %t", v.Name, tokenCount, quoted, expect.Quoted) + if token.Quoted != expect.Quoted { + t.Errorf("%s, token %d: quoted = %t, want %t", v.Name, tokenCount, token.Quoted, expect.Quoted) + } + if 0 < expect.Line { + if token.Line != expect.Line { + t.Errorf("%s, token %d: line %d: want %d", v.Name, tokenCount, token.Line, expect.Line) + } + if token.Char != expect.Char { + t.Errorf("%s, token %d: char %d: want %d", v.Name, tokenCount, token.Char, expect.Char) + } } } diff --git a/lib/query/filter.go b/lib/query/filter.go index 9673744e..d4c04561 100644 --- a/lib/query/filter.go +++ b/lib/query/filter.go @@ -205,7 +205,7 @@ func (f Filter) evalComparison(expr parser.Comparison) (parser.Primary, error) { return nil, err } - t, err = CompareRowValues(lhs, rhs, expr.Operator.Literal) + t, err = CompareRowValues(lhs, rhs, expr.Operator) if err != nil { return nil, err } @@ -220,7 +220,7 @@ func (f Filter) evalComparison(expr parser.Comparison) (parser.Primary, error) { return nil, err } - t = Compare(lhs, rhs, expr.Operator.Literal) + t = Compare(lhs, rhs, expr.Operator) } return parser.NewTernary(t), nil } @@ -363,7 +363,7 @@ func (f Filter) evalAny(expr parser.Any) (parser.Primary, error) { return nil, err } - t, err := Any(value, list, expr.Operator.Literal) + t, err := Any(value, list, expr.Operator) if err != nil { return nil, err } @@ -376,7 +376,7 @@ func (f Filter) evalAll(expr parser.All) (parser.Primary, error) { return nil, err } - t, err := All(value, list, expr.Operator.Literal) + t, err := All(value, list, expr.Operator) if err != nil { return nil, err } diff --git a/lib/query/filter_test.go b/lib/query/filter_test.go index 4f0e5382..f1b69321 100644 --- a/lib/query/filter_test.go +++ b/lib/query/filter_test.go @@ -253,7 +253,7 @@ var filterEvaluateTests = []struct { Expr: parser.Comparison{ LHS: parser.NewInteger(1), RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewTernary(ternary.FALSE), }, @@ -262,7 +262,7 @@ var filterEvaluateTests = []struct { Expr: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "field notexist does not exist", }, @@ -271,7 +271,7 @@ var filterEvaluateTests = []struct { Expr: parser.Comparison{ LHS: parser.NewInteger(1), RHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "field notexist does not exist", }, @@ -294,7 +294,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewTernary(ternary.TRUE), }, @@ -329,14 +329,14 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(1), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewTernary(ternary.TRUE), }, @@ -359,7 +359,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "field notexist does not exist", }, @@ -397,7 +397,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewTernary(ternary.UNKNOWN), }, @@ -432,7 +432,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "field notexist does not exist", }, @@ -467,7 +467,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "subquery returns too many records, should be only one record", }, @@ -489,7 +489,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "row value length does not match", }, { @@ -827,7 +827,7 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column2"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -861,7 +861,7 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -1091,7 +1091,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<>"}, + Operator: "<>", }, Result: parser.NewTernary(ternary.TRUE), }, @@ -1118,7 +1118,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<>"}, + Operator: "<>", }, Error: "field notexist does not exist", }, @@ -1145,14 +1145,14 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<>"}, + Operator: "<>", }, Error: "field notexist does not exist", }, @@ -1180,7 +1180,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<>"}, + Operator: "<>", }, Error: "row value length does not match", }, @@ -1207,7 +1207,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, Result: parser.NewTernary(ternary.TRUE), }, @@ -1234,7 +1234,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, Error: "field notexist does not exist", }, @@ -1261,14 +1261,14 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, Error: "field notexist does not exist", }, @@ -1296,7 +1296,7 @@ var filterEvaluateTests = []struct { }, }, }, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, Error: "row value length does not match", }, @@ -1364,7 +1364,7 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column2"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -1420,7 +1420,7 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.NewString("str2"), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -1465,7 +1465,7 @@ var filterEvaluateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column2"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column4"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2193,7 +2193,7 @@ var filterEvaluateTests = []struct { Condition: parser.Comparison{ LHS: parser.NewInteger(2), RHS: parser.NewInteger(1), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewString("A"), }, @@ -2201,7 +2201,7 @@ var filterEvaluateTests = []struct { Condition: parser.Comparison{ LHS: parser.NewInteger(2), RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: parser.NewString("B"), }, diff --git a/lib/query/join.go b/lib/query/join.go index 5d1cf321..b1bebbc2 100644 --- a/lib/query/join.go +++ b/lib/query/join.go @@ -49,7 +49,7 @@ func ParseJoinCondition(join parser.Join, view *View, joinView *View) parser.Exp comps[i] = parser.Comparison{ LHS: parser.Identifier{Literal: viewName + "." + v.(parser.Identifier).Literal}, RHS: parser.Identifier{Literal: joinViewName + "." + v.(parser.Identifier).Literal}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", } } diff --git a/lib/query/join_test.go b/lib/query/join_test.go index 6161fa23..942d2fba 100644 --- a/lib/query/join_test.go +++ b/lib/query/join_test.go @@ -38,19 +38,19 @@ var parseJoinConditionTests = []struct { LHS: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key1"}, RHS: parser.Identifier{Literal: "t2.key1"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, RHS: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key2"}, RHS: parser.Identifier{Literal: "t2.key2"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Operator: parser.Token{Token: parser.AND, Literal: "AND"}, }, RHS: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key3"}, RHS: parser.Identifier{Literal: "t2.key3"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Operator: parser.Token{Token: parser.AND, Literal: "AND"}, }, @@ -71,7 +71,7 @@ var parseJoinConditionTests = []struct { Result: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key1"}, RHS: parser.Identifier{Literal: "t2.key1"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, { @@ -83,7 +83,7 @@ var parseJoinConditionTests = []struct { On: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key1"}, RHS: parser.Identifier{Literal: "t2.key1"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -92,7 +92,7 @@ var parseJoinConditionTests = []struct { Result: parser.Comparison{ LHS: parser.Identifier{Literal: "t1.key1"}, RHS: parser.Identifier{Literal: "t2.key1"}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, { @@ -239,7 +239,7 @@ var innerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Result: &View{ Header: []HeaderField{ @@ -293,7 +293,7 @@ var innerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "notexist"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Error: "field table2.notexist does not exist", }, @@ -369,7 +369,7 @@ var outerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Direction: parser.LEFT, Result: &View{ @@ -448,7 +448,7 @@ var outerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Direction: parser.RIGHT, Result: &View{ @@ -527,7 +527,7 @@ var outerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Direction: parser.FULL, Result: &View{ @@ -614,7 +614,7 @@ var outerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Direction: parser.LEFT, Error: "field table1.notexist does not exist", @@ -658,7 +658,7 @@ var outerJoinTests = []struct { Condition: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column1"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Direction: parser.TOKEN_UNDEFINED, Result: &View{ diff --git a/lib/query/query.go b/lib/query/query.go index ba9d881e..6068b4ff 100644 --- a/lib/query/query.go +++ b/lib/query/query.go @@ -52,7 +52,6 @@ var ResultSet = []Result{} func Execute(input string) (string, error) { var out string - parser.SetDebugLevel(0, true) program, err := parser.Parse(input) if err != nil { return out, err @@ -120,6 +119,8 @@ func ExecuteStatement(stmt parser.Statement) (StatementFlow, string, error) { case parser.FetchCursor: fetch := stmt.(parser.FetchCursor) _, err = FetchCursor(fetch.Cursor.Literal, fetch.Position, fetch.Variables) + case parser.TableDeclaration: + err = DeclareTable(stmt.(parser.TableDeclaration)) case parser.SelectQuery: if view, err = Select(stmt.(parser.SelectQuery)); err == nil { results = []Result{ @@ -386,6 +387,50 @@ func FetchCursor(name string, fetchPosition parser.Expression, vars []parser.Var return true, nil } +func DeclareTable(expr parser.TableDeclaration) error { + if _, ok := ViewCache.Exists(expr.Table.Literal); ok { + return errors.New(fmt.Sprintf("table %s already exists", expr.Table.Literal)) + } + + var view *View + var err error + + if expr.Query != nil { + view, err = Select(expr.Query.(parser.SelectQuery)) + if err != nil { + return err + } + + if expr.Fields != nil { + if err := view.UpdateHeader(expr.Table.Literal, expr.Fields); err != nil { + return err + } + } + } else { + fields := make([]string, len(expr.Fields)) + for i, v := range expr.Fields { + f, _ := v.(parser.Identifier) + if InStrSlice(f.Literal, fields) { + return errors.New(fmt.Sprintf("field %s is duplicate", f)) + } + fields[i] = f.Literal + } + header := NewHeaderWithoutId(expr.Table.Literal, fields) + view = &View{ + Header: header, + } + } + + view.FileInfo = &FileInfo{ + Path: expr.Table.Literal, + Temporary: true, + } + + ViewCache.Set(view, expr.Table.Literal) + + return err +} + func formatCount(i int, obj string) string { var s string if i == 0 { @@ -419,7 +464,7 @@ func Commit() (string, error) { case CREATE_TABLE: createFiles[result.FileInfo.Path] = result.FileInfo default: - if 0 < result.OperatedCount { + if !result.FileInfo.Temporary && 0 < result.OperatedCount { if _, ok := createFiles[result.FileInfo.Path]; !ok { if _, ok := updateFiles[result.FileInfo.Path]; !ok { updateFiles[result.FileInfo.Path] = result.FileInfo diff --git a/lib/query/query_test.go b/lib/query/query_test.go index e9ff2c49..c6211af6 100644 --- a/lib/query/query_test.go +++ b/lib/query/query_test.go @@ -123,7 +123,7 @@ var executeTests = []struct { { Name: "Query Execution Error", Input: "select from", - Error: "syntax error: unexpected FROM", + Error: "syntax error: unexpected from [L:1 C:8]", }, } @@ -297,7 +297,7 @@ var executeStatementTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -329,7 +329,7 @@ var executeStatementTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -631,7 +631,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test"}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -655,7 +655,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -678,7 +678,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.CONTINUE}, @@ -697,7 +697,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -720,7 +720,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.BREAK}, @@ -739,7 +739,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -762,7 +762,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test_count"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.EXIT}, @@ -781,7 +781,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test"}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -804,7 +804,7 @@ var whileTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@while_test"}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, Statements: []parser.Statement{ parser.VariableSubstitution{ @@ -894,7 +894,7 @@ var whileInCursorTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@var1"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.CONTINUE}, @@ -920,7 +920,7 @@ var whileInCursorTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@var1"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.BREAK}, @@ -946,7 +946,7 @@ var whileInCursorTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@var1"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.EXIT}, @@ -987,7 +987,7 @@ var whileInCursorTests = []struct { Condition: parser.Comparison{ LHS: parser.Variable{Name: "@var1"}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, Statements: []parser.Statement{ parser.FlowControl{Token: parser.BREAK}, @@ -1243,7 +1243,7 @@ var selectTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, }, GroupByClause: parser.GroupByClause{ @@ -1255,7 +1255,7 @@ var selectTests = []struct { Filter: parser.Comparison{ LHS: parser.Function{Name: "count", Option: parser.Option{Args: []parser.Expression{parser.AllColumns{}}}}, RHS: parser.NewInteger(1), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, }, }, @@ -1754,7 +1754,7 @@ var selectTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "n"}}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, }, }, @@ -1844,7 +1844,7 @@ var selectTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "n"}}, RHS: parser.NewInteger(3), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "<"}, + Operator: "<", }, }, }, @@ -2222,7 +2222,7 @@ var updateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2283,7 +2283,7 @@ var updateTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, @@ -2336,7 +2336,7 @@ var updateTests = []struct { Filter: parser.Comparison{ LHS: parser.Identifier{Literal: "column1"}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2360,7 +2360,7 @@ var updateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2395,7 +2395,7 @@ var updateTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, @@ -2433,7 +2433,7 @@ var updateTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, @@ -2460,7 +2460,7 @@ var updateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2484,7 +2484,7 @@ var updateTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2570,7 +2570,7 @@ var deleteTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2620,7 +2620,7 @@ var deleteTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, @@ -2666,7 +2666,7 @@ var deleteTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, @@ -2690,7 +2690,7 @@ var deleteTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2711,7 +2711,7 @@ var deleteTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -2739,7 +2739,7 @@ var deleteTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }}, diff --git a/lib/query/view.go b/lib/query/view.go index 3e743fa2..d5162764 100644 --- a/lib/query/view.go +++ b/lib/query/view.go @@ -17,7 +17,7 @@ import ( "github.com/mithrandie/csvq/lib/ternary" ) -const STDIN_VIRTUAL_FILE_PATH = ";;__STDIN__;;" +const STDIN_VIRTUAL_FILE_PATH = "@__STDIN" type ViewMap struct { views map[string]*View @@ -57,6 +57,15 @@ func (m *ViewMap) Get(fpath string) (*View, error) { return nil, errors.New(fmt.Sprintf("file %s is not loaded", fpath)) } +func (m *ViewMap) HasTemporaryTable(name string) bool { + for k, v := range m.views { + if v.FileInfo.Temporary && name == k { + return true + } + } + return false +} + func (m *ViewMap) GetWithInternalId(fpath string) (*View, error) { if pt, ok := m.Exists(fpath); ok { ret := m.views[pt].Copy() @@ -123,6 +132,7 @@ type FileInfo struct { NoHeader bool Encoding cmd.Encoding LineBreak cmd.LineBreak + Temporary bool } func NewFileInfo(filename string, repository string, delimiter rune) (*FileInfo, error) { @@ -270,6 +280,7 @@ func loadView(table parser.Table, parentFilter Filter, useInternalId bool) (*Vie fileInfo := &FileInfo{ Path: STDIN_VIRTUAL_FILE_PATH, Delimiter: delimiter, + Temporary: true, } if _, ok := ViewCache.Exists(fileInfo.Path); !ok { @@ -303,12 +314,20 @@ func loadView(table parser.Table, parentFilter Filter, useInternalId bool) (*Vie } else if _, err := parentFilter.CommonTables.Get(table.Name()); err == nil { return nil, errors.New(fmt.Sprintf("table name %s is duplicated", table.Name())) } else { + var fileInfo *FileInfo - flags := cmd.GetFlags() + if ViewCache.HasTemporaryTable(tableIdentifier) { + fileInfo = &FileInfo{ + Path: tableIdentifier, + Temporary: true, + } + } else { + flags := cmd.GetFlags() - fileInfo, err := NewFileInfo(tableIdentifier, flags.Repository, flags.Delimiter) - if err != nil { - return nil, err + fileInfo, err = NewFileInfo(tableIdentifier, flags.Repository, flags.Delimiter) + if err != nil { + return nil, err + } } commonTableName := parser.FormatTableName(fileInfo.Path) @@ -1045,7 +1064,7 @@ func (view *View) InternalRecordId(ref string, recordIndex int) (int, error) { func (view *View) UpdateHeader(reference string, fields []parser.Expression) error { if fields != nil && len(fields) != view.FieldLen() { - return errors.New(fmt.Sprintf("common table %s: field length does not match", reference)) + return errors.New(fmt.Sprintf("view %s: field length does not match", reference)) } for i := range view.Header { diff --git a/lib/query/view_test.go b/lib/query/view_test.go index 9f15c648..be01a7e3 100644 --- a/lib/query/view_test.go +++ b/lib/query/view_test.go @@ -405,7 +405,7 @@ var viewLoadTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -452,7 +452,7 @@ var viewLoadTests = []struct { On: parser.Comparison{ LHS: parser.FieldReference{View: parser.Identifier{Literal: "table1"}, Column: parser.Identifier{Literal: "column1"}}, RHS: parser.FieldReference{View: parser.Identifier{Literal: "table2"}, Column: parser.Identifier{Literal: "column3"}}, - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, }, @@ -703,7 +703,7 @@ var viewWhereTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "column1"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, Result: []int{1}, @@ -731,7 +731,7 @@ var viewWhereTests = []struct { Filter: parser.Comparison{ LHS: parser.FieldReference{Column: parser.Identifier{Literal: "notexist"}}, RHS: parser.NewInteger(2), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: "="}, + Operator: "=", }, }, Error: "field notexist does not exist", @@ -921,7 +921,7 @@ var viewHavingTests = []struct { }, }, RHS: parser.NewInteger(5), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, }, Result: []int{1}, @@ -976,7 +976,7 @@ var viewHavingTests = []struct { }, }, RHS: parser.NewInteger(5), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, }, Error: "field notexist does not exist", @@ -1007,7 +1007,7 @@ var viewHavingTests = []struct { }, }, RHS: parser.NewInteger(5), - Operator: parser.Token{Token: parser.COMPARISON_OP, Literal: ">"}, + Operator: ">", }, }, Result: []int{0}, @@ -3288,7 +3288,7 @@ func TestView_UpdateHeader(t *testing.T) { fields = []parser.Expression{ parser.Identifier{Literal: "alias3"}, } - expectError := "common table ref1: field length does not match" + expectError := "view ref1: field length does not match" err := view.UpdateHeader(reference, fields) if err.Error() != expectError { t.Errorf("error = %q, want error %q for UpdateHeader(%s, %s)", err, expectError, reference, fields) diff --git a/main.go b/main.go index 0e797b29..1bf97543 100644 --- a/main.go +++ b/main.go @@ -11,7 +11,7 @@ import ( "github.com/urfave/cli" ) -var version = "v0.2.8" +var version = "v0.2.9" func main() { cli.AppHelpTemplate = appHHelpTemplate