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

lexer: Format syntax errmsg when value out of range #1110

Closed
wants to merge 5 commits into from

Conversation

erwadba
Copy link
Contributor

@erwadba erwadba commented Dec 1, 2020

What problem does this PR solve?

related PR: pingcap/tidb#17489 pingcap/tidb#17745

What is changed and how it works?

Add AppendWarn func in lexer.go.
Generate a warning when decimal value out of range. And return the default value.

Check List

Tests

  • No code

Code changes

  • N/A

Side effects

  • N/A

Related changes

-N/A

@CLAassistant
Copy link

CLAassistant commented Dec 1, 2020

CLA assistant check
All committers have signed the CLA.

@xiongjiwei
Copy link
Contributor

can you please add some test?

@erwadba
Copy link
Contributor Author

erwadba commented Dec 3, 2020

When I add test about decimal value in parser_test.go. like below

SELECT 1234567890123456789012345678901230948390457934057234068019438509023041874359081325875128590860234789847359871045943057;

The test will be failed.

PANIC: parser_test.go:47: testParserSuite.TestSimple

... Panic: This branch is not implemented. This is because you are trying to test something specific to TiDB's MyDecimal implementation. It is recommended to do this in TiDB repository. (PC=0x430C11)

Maybe I should add some test in tidb about decimal value.

@erwadba erwadba closed this Dec 3, 2020
@erwadba erwadba reopened this Dec 3, 2020
@erwadba erwadba closed this Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants