New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser: refactor parser step2 #4652

Merged
merged 7 commits into from Sep 29, 2017

Conversation

Projects
None yet
3 participants
@coocood
Member

coocood commented Sep 26, 2017

Refactor expression syntax to use MySQL naming and structure.

Partially fix issue #4026

parser: refactor parser step2
Refactor expression syntax to use MySQL naming and structure.

Partially fix issue #4026
@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood
Member

coocood commented Sep 26, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 26, 2017

Member

@winkyao
The syntax SELECT interval 1 DAY + "2017-01-01"; introduces too many shift/reduce conflicts, I haven't found a way to avoid it.

Member

coocood commented Sep 26, 2017

@winkyao
The syntax SELECT interval 1 DAY + "2017-01-01"; introduces too many shift/reduce conflicts, I haven't found a way to avoid it.

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 27, 2017

Member

/run-all-tests

Member

shenli commented Sep 27, 2017

/run-all-tests

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 27, 2017

Member

/run-all-test

Member

coocood commented Sep 27, 2017

/run-all-test

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 27, 2017

Member

/run-all-tests

Member

shenli commented Sep 27, 2017

/run-all-tests

@@ -412,7 +412,7 @@ func startWithAt(s *Scanner) (tok int, pos Pos, lit string) {
s.r.incAsLongAs(isIdentChar)
tok, lit = doubleAtIdentifier, s.r.data(&pos)
} else {
tok = at
tok = int('@')

This comment has been minimized.

@shenli

shenli Sep 27, 2017

Member

Why change this?

@shenli

shenli Sep 27, 2017

Member

Why change this?

This comment has been minimized.

@coocood

coocood Sep 28, 2017

Member

'@' is a single character token, at should be reserved for the keyword AT.
Even though we haven't use the keyword AT yet.

@coocood

coocood Sep 28, 2017

Member

'@' is a single character token, at should be reserved for the keyword AT.
Even though we haven't use the keyword AT yet.

@@ -92,7 +92,7 @@ func (s *testParserSuite) TestSimple(c *C) {
"compact", "redundant", "sql_no_cache sql_no_cache", "sql_cache sql_cache", "action", "round",
"enable", "disable", "reverse", "space", "privileges", "get_lock", "release_lock", "sleep", "no", "greatest", "least",
"binlog", "hex", "unhex", "function", "indexes", "from_unixtime", "processlist", "events", "less", "than", "timediff",
"ln", "log", "log2", "log10", "timestampdiff", "pi", "quote", "none", "super", "default", "shared", "exclusive",

This comment has been minimized.

@shenli

shenli Sep 27, 2017

Member

This is a bug fix?

@shenli

shenli Sep 27, 2017

Member

This is a bug fix?

This comment has been minimized.

@coocood

coocood Sep 28, 2017

Member

Yes, default is a reserved keyword.

@coocood

coocood Sep 28, 2017

Member

Yes, default is a reserved keyword.

@winkyao

This comment has been minimized.

Show comment
Hide comment
@winkyao

winkyao Sep 28, 2017

Member

@coocood Maybe %expect n ? :)

Member

winkyao commented Sep 28, 2017

@coocood Maybe %expect n ? :)

@winkyao winkyao added the status/LGT1 label Sep 28, 2017

@coocood

This comment has been minimized.

Show comment
Hide comment
@coocood

coocood Sep 28, 2017

Member

@winkyao
That expression looks weird, it puts interval value before date value, seems not widely used, let's handle it when actual users need it.

Member

coocood commented Sep 28, 2017

@winkyao
That expression looks weird, it puts interval value before date value, seems not widely used, let's handle it when actual users need it.

@shenli

This comment has been minimized.

Show comment
Hide comment
@shenli

shenli Sep 29, 2017

Member

LGTM

Member

shenli commented Sep 29, 2017

LGTM

@shenli

shenli approved these changes Sep 29, 2017

@shenli shenli added status/LGT2 and removed status/LGT1 labels Sep 29, 2017

@shenli shenli merged commit ca7403a into master Sep 29, 2017

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls First build on master at 72.706%
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details

@shenli shenli deleted the coocood/parser-expr branch Sep 29, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment