Skip to content

Commit

Permalink
Merge pull request pingcap#1 from spongedu/hh
Browse files Browse the repository at this point in the history
Fix Create StreamWindow
  • Loading branch information
qiuyesuifeng authored Nov 29, 2018
2 parents 72fc608 + 36c2704 commit 86dd57d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parser.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -4538,9 +4538,9 @@ SelectStmtFromTable:
}
if $7 != nil {
if sw, ok := ($7.(*ast.StreamWindowSpec)); ok {
st.StreamWindowSpec = sw
} else {
st.StreamWindowSpec = sw
st.WindowSpecs = ($7.([]ast.WindowSpec))
st.WindowSpecs = ($7.([]ast.WindowSpec))
}
}
$$ = st
Expand Down
1 change: 1 addition & 0 deletions parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2557,6 +2557,7 @@ func (s *testParserSuite) TestWindowFunctions(c *C) {
{`SELECT FIRST_VALUE(year) OVER (w ORDER BY year ASC) AS first FROM sales WINDOW w AS (PARTITION BY country);`, true},
{`SELECT RANK() OVER w1 FROM t WINDOW w1 AS (w2), w2 AS (), w3 AS (w1);`, true},
{`SELECT RANK() OVER w1 FROM t WINDOW w1 AS (w2), w2 AS (w3), w3 AS (w1);`, true},
{`SELECT COUNT(*) FROM st group by a window tumbling ( size 5 SECOND);`, true},
}
s.enableWindowFunc = true
s.RunTest(c, table)
Expand Down

0 comments on commit 86dd57d

Please sign in to comment.