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: change intLit to decLit when the value out of range #2954

Merged
merged 2 commits into from
Mar 29, 2017

Conversation

tiancaiamao
Copy link
Contributor

If lexer get a intLit and it's out of uint64 range, change it to decimal.
This PR will fix #2946

mysql> create table test (id decimal(30, 0));
Query OK, 0 rows affected (0.00 sec)

mysql>  insert into test values(123456789012345678901234567890);
ERROR 1105 (HY000): line 0 column 54 near ")"integer literal: strconv.ParseUint: parsing "123456789012345678901234567890": value out of range (total length 55)

@tiancaiamao
Copy link
Contributor Author

@coocood @shenli

@shenli
Copy link
Member

shenli commented Mar 29, 2017

LGTM
@coocood @zimulala PTAL

@zimulala
Copy link
Contributor

zimulala commented Mar 29, 2017

mysql> select 123456789012345678903245352784573928475684357639284579432758493574389568374312985695643856743825647835643728;
+--------------------------------------------------------------------------------------------------------------+
| 123456789012345678903245352784573928475684357639284579432758493574389568374312985695643856743825647835643728 |
+--------------------------------------------------------------------------------------------------------------+
|                                            99999999999999999999999999999999999999999999999999999999999999999 |
+--------------------------------------------------------------------------------------------------------------+

@zimulala
Copy link
Contributor

LGTM

@coocood
Copy link
Member

coocood commented Mar 29, 2017

LGTM

@coocood coocood merged commit 8f79c20 into master Mar 29, 2017
@coocood coocood deleted the tiancaiamao/int-decimal branch March 29, 2017 15:16
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.

Insert decimal error : Parse uint64 out of range
4 participants