From 1abd877e2df9e83bc1c2f5195796f427a35bd3f1 Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 22 Jun 2018 11:28:02 +0400 Subject: MDEV-8049 name_const() is not consistent about its signess --- mysql-test/main/func_misc.result | 20 ++++++++++++++++++++ mysql-test/main/func_misc.test | 15 +++++++++++++++ 2 files changed, 35 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/main/func_misc.result b/mysql-test/main/func_misc.result index e7a416f8ea6..0ab07664e6c 100644 --- a/mysql-test/main/func_misc.result +++ b/mysql-test/main/func_misc.result @@ -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; diff --git a/mysql-test/main/func_misc.test b/mysql-test/main/func_misc.test index f144236bfdb..f8f2147e182 100644 --- a/mysql-test/main/func_misc.test +++ b/mysql-test/main/func_misc.test @@ -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; -- cgit v1.2.1