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

parser: support cast as double #399

Merged
merged 2 commits into from
Jul 26, 2019

Conversation

wshwsh12
Copy link
Contributor

@wshwsh12 wshwsh12 commented Jul 25, 2019

What problem does this PR solve?

Related TiDB PR: pingcap/tidb#11443
Support cast(xxx as double).
Mysql support the parser in 8.0.17.
https://dev.mysql.com/doc/refman/8.0/en/cast-functions.html

@CLAassistant
Copy link

CLAassistant commented Jul 25, 2019

CLA assistant check
All committers have signed the CLA.

@wshwsh12 wshwsh12 changed the title parse: support cast as double parser: support cast as double Jul 25, 2019
@codecov
Copy link

codecov bot commented Jul 25, 2019

Codecov Report

Merging #399 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #399   +/-   ##
=======================================
  Coverage   70.22%   70.22%           
=======================================
  Files          32       32           
  Lines        7450     7450           
=======================================
  Hits         5232     5232           
  Misses       1703     1703           
  Partials      515      515
Impacted Files Coverage Δ
parser.go 70.58% <ø> (ø) ⬆️
mysql/util.go 60% <ø> (ø) ⬆️
types/field_type.go 64.89% <100%> (+0.37%) ⬆️
ast/ddl.go 77.91% <0%> (-0.04%) ⬇️
misc.go 96.42% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 53c769c...e79dc55. Read the comment docs.

@wshwsh12 wshwsh12 added the type/enhancement New feature or request label Jul 25, 2019
@wshwsh12 wshwsh12 requested a review from kennytm July 25, 2019 08:34
Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include a test case showing that CAST(x AS DOUBLE) is now a valid expression.

Rest LGTM.

CAST(x AS FLOAT), CAST(x AS FLOAT(p)) and CAST(x AS REAL) are also added in 8.0.17, would you mind at least supporting CAST(x AS FLOAT) in this or a future PR? Thanks.

@wshwsh12
Copy link
Contributor Author

Please include a test case showing that CAST(x AS DOUBLE) is now a valid expression.

Rest LGTM.

CAST(x AS FLOAT), CAST(x AS FLOAT(p)) and CAST(x AS REAL) are also added in 8.0.17, would you mind at least supporting CAST(x AS FLOAT) in this or a future PR? Thanks.

UPDATE. PTAL @kennytm
And I will try to support CAST(x AS FLOAT) in next PR.

@wshwsh12 wshwsh12 requested a review from kennytm July 26, 2019 04:42
Copy link
Contributor

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kennytm kennytm added the status/LGT1 LGT1 label Jul 26, 2019
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason merged commit 46d1b3d into pingcap:master Jul 26, 2019
@wshwsh12 wshwsh12 deleted the support_cast_as_double branch July 29, 2019 08:21
tiancaiamao pushed a commit to tiancaiamao/parser that referenced this pull request Apr 27, 2021
lyonzhi pushed a commit to lyonzhi/parser that referenced this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT1 LGT1 type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants