Skip to content
Permalink
Browse files
MDEV-8049 name_const() is not consistent about its signess
  • Loading branch information
abarkov committed Jun 22, 2018
1 parent bcc2100 commit 1abd877
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
@@ -1562,3 +1562,23 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is
def INET_ATON("255.255.255.255.255.255.255.255") 8 21 20 Y 32928 0 63
INET_ATON("255.255.255.255.255.255.255.255")
18446744073709551615
#
# MDEV-8049 name_const() is not consistent about its signess
#
SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2;
Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr
def c1 8 20 20 N 32929 0 63
def c2 8 20 20 Y 32928 0 63
c1 c2
18446744073709551615 18446744073709551615
CREATE TABLE t1 AS SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c1` bigint(20) unsigned NOT NULL,
`c2` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SELECT * FROM t1;
c1 c2
18446744073709551615 18446744073709551615
DROP TABLE t1;
@@ -1203,3 +1203,18 @@ SELECT INET_ATON("255.255.255.255.255.255.255.255");

--enable_ps_protocol
--disable_metadata

--echo #
--echo # MDEV-8049 name_const() is not consistent about its signess
--echo #

--enable_metadata
--disable_ps_protocol
SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2;
--enable_ps_protocol
--disable_metadata

CREATE TABLE t1 AS SELECT 18446744073709551615 AS c1, name_const('a',18446744073709551615) AS c2;
SHOW CREATE TABLE t1;
SELECT * FROM t1;
DROP TABLE t1;
@@ -2267,6 +2267,7 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
collation.set(value_item->collation.collation, DERIVATION_IMPLICIT);
max_length= value_item->max_length;
decimals= value_item->decimals;
unsigned_flag= value_item->unsigned_flag;
fixed= 1;
return FALSE;
}

0 comments on commit 1abd877

Please sign in to comment.