-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
bug: the range of unsigned should be determined #1151
Comments
MySQL will throw
For
|
Out-of-Range and Overflow Handling
For more infos: |
All I'll write the design docs to desc how to impl all boundary values on integer types(including from |
similar to #1206 CREATE TABLE `test` (
`id1` tinyint(3) unsigned DEFAULT NULL,
`id2` smallint(5) unsigned DEFAULT NULL,
`id3` int(10) unsigned DEFAULT NULL,
`id4` bigint(20) unsigned DEFAULT NULL
)DEFAULT CHARSET=utf8mb4;
insert into test values (255,65535,4294967295,18446744073709551615);
insert into test values (255,65535,4294967295,9223372036854775807);
insert into test values (129,32769,2147483647,9223372036854775808);
mysql> select * from test;
+------+-------+------------+----------------------+
| id1 | id2 | id3 | id4 |
+------+-------+------------+----------------------+
| 127 | 32767 | 2147483647 | 18446744073709551615 |
| 127 | 32767 | 2147483647 | 9223372036854775807 |
| 127 | 32767 | 2147483647 | NULL |
+------+-------+------------+----------------------+
3 rows in set (0.00 sec) |
call stack:
call stack:
|
[summary] tinyint: signed range is -128 to 127, unsigned range is 0 to 127. smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767. mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607. int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647. Note: -2147483648 is not allowed in tianmu engine currently. bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807. Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
[summary] tinyint: signed range is -128 to 127, unsigned range is 0 to 127. smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767. mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607. int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647. Note: -2147483648 is not allowed in tianmu engine currently. bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807. Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
…file test unsigned, this will be opened after we completely support unsigned types stoneatom#1151
[summary] tinyint: signed range is -128 to 127, unsigned range is 0 to 127. smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767. mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607. int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647. Note: -2147483648 is not allowed in tianmu engine currently. bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807. Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
…file test unsigned, this will be opened after we completely support unsigned types #1151
[summary] 1. expand unsigned boundary from signed boundary to max valued. 2. code cover create/insert(delayed/no delayed mode)/update/delete/select. 3. functions and operators(agg and math calculation) refs: stoneatom#1266 related issue: stoneatom#1151
[summary] 1. expand unsigned boundary from signed boundary to max valued. 2. code cover create/insert(delayed/no delayed mode)/update/delete/select. 3. functions and operators(agg and math calculation) refs: stoneatom#1266 related issue: stoneatom#1151
[summary] 1. expand unsigned boundary from signed boundary to max valued. 2. code cover create/insert(delayed/no delayed mode)/update/delete/select. 3. functions and operators(agg and math calculation) refs: stoneatom#1266 related issue: stoneatom#1151
[summary] 1. expand unsigned boundary from signed boundary to max valued. 2. code cover create/insert(delayed/no delayed mode)/update/delete/select. 3. functions and operators(agg and math calculation) refs: stoneatom#1266 related issue: stoneatom#1151
[summary] 1. expand unsigned boundary from signed boundary to max valued. 2. code cover create/insert(delayed/no delayed mode)/update/delete/select. 3. functions and operators(agg and math calculation) refs: stoneatom#1266 related issue: stoneatom#1151
[summary] tinyint: signed range is -128 to 127, unsigned range is 0 to 127. smallint: signed range is -32768 to 32767, unsigned range is 0 to 32767. mediumint: signed range is -8388608 to 8388607, unsigned range is 0 to 8388607. int/integer: signed range is -2147483647 to 2147483647, unsigned range is 0 to 2147483647. Note: -2147483648 is not allowed in tianmu engine currently. bigint: signed range is -9223372036854775806 to 9223372036854775807, unsigned range is 0 to 9223372036854775807. Note: -9223372036854775807 will be set to null and -9223372036854775808 will ret out of range.
…file test unsigned, this will be opened after we completely support unsigned types stoneatom#1151
Have you read the Contributing Guidelines on issues?
Please confirm if bug report does NOT exists already ?
Describe the problem
the range of unsigned ( INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT ) should be determined,
and when INSERT the unsigned data out of range, should return the correct prompt message.
Expected behavior
How To Reproduce
Environment
Are you interested in submitting a PR to solve the problem?
The text was updated successfully, but these errors were encountered: