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

error on large number with type bigint #4287

Closed
hicqu opened this issue Aug 22, 2017 · 1 comment · Fixed by #5247
Closed

error on large number with type bigint #4287

hicqu opened this issue Aug 22, 2017 · 1 comment · Fixed by #5247
Assignees

Comments

@hicqu
Copy link
Contributor

hicqu commented Aug 22, 2017

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
create table x (a bigint);
insert into x values(pow(2, 63)-1);
select * from x;
  1. What did you expect to see?
mysql> select * from x;
Field   1:  `a`
Catalog:    `def`
Database:   `test`
Table:      `x`
Org_table:  `x`
Type:       LONGLONG
Collation:  binary (63)
Length:     20
Max_length: 19
Decimals:   0
Flags:      NUM


+---------------------+
| a                   |
+---------------------+
| 9223372036854775807 |
+---------------------+
  1. What did you see instead?
mysql> select * from x;
Field   1:  `a`
Catalog:    `def`
Database:   ``
Table:      `x`
Org_table:  ``
Type:       LONGLONG
Collation:  binary (63)
Length:     21
Max_length: 20
Decimals:   31
Flags:      BINARY NUM


+----------------------+
| a                    |
+----------------------+
| -9223372036854775808 |
+----------------------+
  1. What version of TiDB are you using (tidb-server -V)?
    latest master branch.
@hicqu
Copy link
Contributor Author

hicqu commented Aug 22, 2017

The first output is from mysql 5.7.18

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 a pull request may close this issue.

2 participants