Commit 1abd877e authored by Alexander Barkov's avatar Alexander Barkov

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

parent bcc2100f
...@@ -1562,3 +1562,23 @@ Catalog Database Table Table_alias Column Column_alias Type Length Max length Is ...@@ -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 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") INET_ATON("255.255.255.255.255.255.255.255")
18446744073709551615 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"); ...@@ -1203,3 +1203,18 @@ SELECT INET_ATON("255.255.255.255.255.255.255.255");
--enable_ps_protocol --enable_ps_protocol
--disable_metadata --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) ...@@ -2267,6 +2267,7 @@ bool Item_name_const::fix_fields(THD *thd, Item **ref)
collation.set(value_item->collation.collation, DERIVATION_IMPLICIT); collation.set(value_item->collation.collation, DERIVATION_IMPLICIT);
max_length= value_item->max_length; max_length= value_item->max_length;
decimals= value_item->decimals; decimals= value_item->decimals;
unsigned_flag= value_item->unsigned_flag;
fixed= 1; fixed= 1;
return FALSE; return FALSE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment