Skip to content
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

Suppport CURRENT_TIMESTAMP with pricision #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akihiro17
Copy link

This PR fixes the following error when parsing the CURRENT_TIMESTAMP with pricision.

CREATE TABLE t1
(
  ts timestamp(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
  dt datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)
)
Failure/Error: do_parse

     Racc::ParseError:

       parse error on value "(" (S_LEFT_PAREN)
     # (eval):3:in `_racc_do_parse_c'
     # (eval):3:in `do_parse'
     # ./lib/mysql-parser/lexer.rb:29:in `scan_str'
     # mysql.y.rb:1349:in `parse'
     # ./spec/parser_spec.rb:192:in `block (2 levels) in <class:MySQLParserTester>'

ref. https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html

@akihiro17
Copy link
Author

@michaelfinch What do you think about this change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant