Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL)
-
None
Description
$ mysql-tmp --column-type-info test
|
...
|
mysql> SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2;
|
...
|
Field 1: `c1`
|
Type: LONGLONG
|
Flags: NOT_NULL UNSIGNED BINARY NUM
|
...
|
Field 2: `c2`
|
Type: LONGLONG
|
Flags: BINARY NUM
|
...
|
+----------------------+----------------------+
|
| c1 | c2 |
|
+----------------------+----------------------+
|
| 18446744073709551615 | 18446744073709551615 |
|
+----------------------+----------------------
|
Notice, metadata says LONGLONG UNSIGNED for c1 but LONGLONG SIGNED for c2, but return values are both unsigned.
Another example of incorrect behaviour:
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 AS SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2; |
SHOW WARNINGS;
|
SHOW CREATE TABLE t1; |
The above script returns
+---------+------+---------------------------------------------+
|
| Level | Code | Message |
|
+---------+------+---------------------------------------------+
|
| Warning | 1264 | Out of range value for column 'c2' at row 1 |
|
+---------+------+---------------------------------------------+
|
1 row in set (0.00 sec)
|
|
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
| Table | Create Table |
|
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
| t1 | CREATE TABLE `t1` (
|
`c1` bigint(20) unsigned NOT NULL DEFAULT '0',
|
`c2` bigint(20) DEFAULT NULL
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
+-------+--------------------------------------------------------------------------------------------------------------------------------------------+
|
The expected result is to have unsigned flag in both fields.
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Description |
{noformat} $ mysql-tmp --column-type-info test ... mysql> SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2; ... Field 1: `c1` Type: LONGLONG Flags: NOT_NULL UNSIGNED BINARY NUM ... Field 2: `c2` Flags: BINARY NUM ... +----------------------+----------------------+ | c1 | c2 | +----------------------+----------------------+ | 18446744073709551615 | 18446744073709551615 | +----------------------+---------------------- {noformat} Notice, it returns |
{noformat} $ mysql-tmp --column-type-info test ... mysql> SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2; ... Field 1: `c1` Type: LONGLONG Flags: NOT_NULL UNSIGNED BINARY NUM ... Field 2: `c2` Type: LONGLONG Flags: BINARY NUM ... +----------------------+----------------------+ | c1 | c2 | +----------------------+----------------------+ | 18446744073709551615 | 18446744073709551615 | +----------------------+---------------------- {noformat} Notice, metadata says LONGLONG UNSIGNED for c1 but LONGLONG SIGNED for c2, but return values are both unsigned. Another example of incorrect behaviour: {code:sql} DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2; SHOW WARNINGS; SHOW CREATE TABLE t1; {code} The above script returns {noformat} +---------+------+---------------------------------------------+ | Level | Code | Message | +---------+------+---------------------------------------------+ | Warning | 1264 | Out of range value for column 'c2' at row 1 | +---------+------+---------------------------------------------+ 1 row in set (0.00 sec) +-------+--------------------------------------------------------------------------------------------------------------------------------------------+ | Table | Create Table | +-------+--------------------------------------------------------------------------------------------------------------------------------------------+ | t1 | CREATE TABLE `t1` ( `c1` bigint(20) unsigned NOT NULL DEFAULT '0', `c2` bigint(20) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1 | +-------+--------------------------------------------------------------------------------------------------------------------------------------------+ {noformat} The expected result is to have unsigned flag in both fields. |
Workflow | MariaDB v2 [ 60665 ] | MariaDB v3 [ 66602 ] |
Fix Version/s | 10.2 [ 14601 ] | |
Fix Version/s | 10.1 [ 16100 ] |
Affects Version/s | 10.2 [ 14601 ] |
Fix Version/s | 10.3 [ 22126 ] | |
Fix Version/s | 10.2 [ 14601 ] |
Component/s | Data types [ 13906 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
issue.field.resolutiondate | 2018-06-22 07:28:33.0 | 2018-06-22 07:28:33.241 |
Fix Version/s | 10.3.8 [ 23113 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 66602 ] | MariaDB v4 [ 149089 ] |