diff options
author | unknown <bell@sanja.is.com.ua> | 2005-02-09 11:41:55 +0200 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-02-09 11:41:55 +0200 |
commit | 72c32d135adc97e901ae35f2288e20e7002b7c80 (patch) | |
tree | 15fb865dd46d0c4756c334d1237408f979c48010 /mysql-test | |
parent | 1ff73ae729f86003d962d971c42c7c055e839ce3 (diff) | |
parent | 8daa51887da31818fecfa9c157d29dae01816118 (diff) | |
download | mariadb-git-72c32d135adc97e901ae35f2288e20e7002b7c80.tar.gz |
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
sql/sp_head.cc:
Auto merged
Diffstat (limited to 'mysql-test')
40 files changed, 2242 insertions, 467 deletions
diff --git a/mysql-test/r/bigint.result b/mysql-test/r/bigint.result index 4c70e72bdfb..4268b121b1d 100644 --- a/mysql-test/r/bigint.result +++ b/mysql-test/r/bigint.result @@ -7,7 +7,7 @@ select 9223372036854775807,-009223372036854775808; 9223372036854775807 -9223372036854775808 select +9999999999999999999,-9999999999999999999; 9999999999999999999 -9999999999999999999 -9999999999999999999 -10000000000000000000 +9999999999999999999 -9999999999999999999 select cast(9223372036854775808 as unsigned)+1; cast(9223372036854775808 as unsigned)+1 9223372036854775809 @@ -16,7 +16,7 @@ select 9223372036854775808+1; 9223372036854775809 select -(0-3),round(-(0-3)), round(9999999999999999999); -(0-3) round(-(0-3)) round(9999999999999999999) -3 3 10000000000000000000 +3 3 9999999999999999999 create table t1 (a bigint unsigned not null, primary key(a)); insert into t1 values (18446744073709551615), (0xFFFFFFFFFFFFFFFE), (18446744073709551613), (18446744073709551612); select * from t1; diff --git a/mysql-test/r/case.result b/mysql-test/r/case.result index 1f2d60fb79a..1ca913e1259 100644 --- a/mysql-test/r/case.result +++ b/mysql-test/r/case.result @@ -91,7 +91,10 @@ CASE WHEN 1 THEN 'a' ELSE 1.0 END AS c5, CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6, CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7, CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8, -CASE WHEN 1 THEN 1.0 END AS c9 +CASE WHEN 1 THEN 1.0 END AS c9, +CASE WHEN 1 THEN 0.1e1 else 0.1 END AS c10, +CASE WHEN 1 THEN 0.1e1 else 1 END AS c11, +CASE WHEN 1 THEN 0.1e1 else '1' END AS c12 ; SHOW CREATE TABLE t1; Table Create Table @@ -100,11 +103,14 @@ t1 CREATE TABLE `t1` ( `c2` varchar(1) character set latin1 collate latin1_danish_ci NOT NULL default '', `c3` varbinary(1) NOT NULL default '', `c4` varbinary(1) NOT NULL default '', - `c5` varbinary(3) NOT NULL default '', - `c6` varbinary(3) NOT NULL default '', - `c7` double(3,1) NOT NULL default '0.0', - `c8` double(3,1) NOT NULL default '0.0', - `c9` double(3,1) default NULL + `c5` varbinary(4) NOT NULL default '', + `c6` varbinary(4) NOT NULL default '', + `c7` decimal(5,1) NOT NULL default '0.0', + `c8` decimal(5,1) NOT NULL default '0.0', + `c9` decimal(5,1) default NULL, + `c10` double NOT NULL default '0', + `c11` double NOT NULL default '0', + `c12` varbinary(5) NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; SELECT CASE @@ -146,11 +152,11 @@ SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( `COALESCE(1)` int(1) NOT NULL default '0', - `COALESCE(1.0)` double(3,1) NOT NULL default '0.0', + `COALESCE(1.0)` decimal(5,1) NOT NULL default '0.0', `COALESCE('a')` varchar(1) NOT NULL default '', - `COALESCE(1,1.0)` double(3,1) NOT NULL default '0.0', + `COALESCE(1,1.0)` decimal(5,1) NOT NULL default '0.0', `COALESCE(1,'1')` varbinary(1) NOT NULL default '', - `COALESCE(1.1,'1')` varbinary(3) NOT NULL default '', + `COALESCE(1.1,'1')` varbinary(4) NOT NULL default '', `COALESCE('a' COLLATE latin1_bin,'b')` varchar(1) character set latin1 collate latin1_bin NOT NULL default '' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 05d1ba026ba..1c378f88e5c 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -103,9 +103,9 @@ Field Type Null Key Default Extra a datetime NO 0000-00-00 00:00:00 b time NO 00:00:00 c date NO 0000-00-00 -d bigint(17) NO 0 -e double(18,1) NO 0.0 -f bigint(17) NO 0 +d int(2) NO 0 +e decimal(6,1) NO 0.0 +f bigint(18) NO 0 drop table t2; create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt; describe t2; @@ -418,7 +418,7 @@ d date YES NULL e varchar(1) NO f datetime YES NULL g time YES NULL -h longblob NO +h varbinary(23) NO dd time YES NULL select * from t2; a b c d e f g h dd @@ -437,7 +437,7 @@ t2 CREATE TABLE `t2` ( `ifnull(e,e)` bigint(20) default NULL, `ifnull(f,f)` float(3,2) default NULL, `ifnull(g,g)` double(4,3) default NULL, - `ifnull(h,h)` decimal(5,4) default NULL, + `ifnull(h,h)` decimal(6,4) default NULL, `ifnull(i,i)` year(4) default NULL, `ifnull(j,j)` date default NULL, `ifnull(k,k)` datetime NOT NULL default '0000-00-00 00:00:00', diff --git a/mysql-test/r/distinct.result b/mysql-test/r/distinct.result index 1e1d6f96eb7..177994b488d 100644 --- a/mysql-test/r/distinct.result +++ b/mysql-test/r/distinct.result @@ -462,5 +462,5 @@ rout int(11) default '0' INSERT INTO t1 VALUES ('1',1,0); SELECT DISTINCT html,SUM(rout)/(SUM(rin)+1) as 'prod' FROM t1 GROUP BY rin; html prod -1 0.00 +1 0.00000 drop table t1; diff --git a/mysql-test/r/func_equal.result b/mysql-test/r/func_equal.result index 352b76f2744..fe5e5b1b371 100644 --- a/mysql-test/r/func_equal.result +++ b/mysql-test/r/func_equal.result @@ -1,7 +1,7 @@ drop table if exists t1,t2; -select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL; -0<=>0 0.0<=>0.0 "A"<=>"A" NULL<=>NULL -1 1 1 1 +select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL; +0<=>0 0.0<=>0.0 0E0=0E0 "A"<=>"A" NULL<=>NULL +1 1 1 1 1 select 1<=>0,0<=>NULL,NULL<=>0; 1<=>0 0<=>NULL NULL<=>0 0 0 0 @@ -11,6 +11,12 @@ select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; select "A"<=>"B","A"<=>NULL,NULL<=>"A"; "A"<=>"B" "A"<=>NULL NULL<=>"A" 0 0 0 +select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1; +0<=>0.0 0.0<=>0E0 0E0<=>"0" 10.0<=>1E1 10<=>10.0 10<=>1E1 +1 1 1 1 1 1 +select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0; +1.0<=>0E1 10<=>NULL NULL<=>0.0 NULL<=>0E0 +0 0 0 0 create table t1 (id int, value int); create table t2 (id int, value int); insert into t1 values (1,null); diff --git a/mysql-test/r/func_op.result b/mysql-test/r/func_op.result index 6cd975b0911..5f89fe7b727 100644 --- a/mysql-test/r/func_op.result +++ b/mysql-test/r/func_op.result @@ -1,6 +1,6 @@ select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; 1+1 1-1 1+1*2 8/5 8%5 mod(8,5) mod(8,5)|0 -(1+1)*-2 -2 0 3 1.60 3 3 3 4 +2 0 3 1.60000 3 3 3 4 explain extended select 1+1,1-1,1+1*2,8/5,8%5,mod(8,5),mod(8,5)|0,-(1+1)*-2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result index f7b4d302a52..24740442821 100644 --- a/mysql-test/r/group_by.result +++ b/mysql-test/r/group_by.result @@ -440,12 +440,12 @@ create table t2 (user_id integer not null, date date); insert into t2 values (1, '2002-06-09'),(2, '2002-06-09'),(1, '2002-06-09'),(3, '2002-06-09'),(4, '2002-06-09'),(4, '2002-06-09'); select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender; gender dist_count percentage -F 3 60.00 -M 1 20.00 +F 3 60.00000 +M 1 20.00000 select u.gender as gender, count(distinct u.id) as dist_count, (count(distinct u.id)/5*100) as percentage from t1 u, t2 l where l.user_id = u.id group by u.gender order by percentage; gender dist_count percentage -M 1 20.00 -F 3 60.00 +M 1 20.00000 +F 3 60.00000 drop table t1,t2; CREATE TABLE t1 (ID1 int, ID2 int, ID int NOT NULL AUTO_INCREMENT,PRIMARY KEY(ID )); diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index 4c6be698749..52e2a4046cf 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -69,9 +69,11 @@ id select_type table type possible_keys key key_len ref rows Extra select pk from t1 where key2 = 1 and key1 = 1; pk 26 +27 select pk from t1 ignore index(key1,key2) where key2 = 1 and key1 = 1; pk 26 +27 drop table t1; create table t1 ( pk int primary key auto_increment, diff --git a/mysql-test/r/index_merge_ror_cpk.result b/mysql-test/r/index_merge_ror_cpk.result index c344cef5db9..6cfeb20b2de 100644 --- a/mysql-test/r/index_merge_ror_cpk.result +++ b/mysql-test/r/index_merge_ror_cpk.result @@ -56,7 +56,7 @@ pk1 pk2 95 59 explain select * from t1 where badkey=1 and key1=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1 key1 4 const 101 Using where +1 SIMPLE t1 ref key1 key1 4 const 100 Using where explain select * from t1 where pk1 < 7500 and key1 = 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL 38 Using intersect(key1,PRIMARY); Using where @@ -74,13 +74,13 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge PRIMARY,key1,pktail2ok pktail2ok,key1 8,4 NULL 199 Using sort_union(pktail2ok,key1); Using where explain select * from t1 where pktail3bad=1 and key1=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1,pktail3bad pktail3bad 4 const ROWS Using where +1 SIMPLE t1 ref key1,pktail3bad key1 4 const 100 Using where explain select * from t1 where pktail4bad=1 and key1=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1,pktail4bad pktail4bad 4 const 99 Using where +1 SIMPLE t1 ref key1,pktail4bad key1 4 const 100 Using where explain select * from t1 where pktail5bad=1 and key1=10; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1,pktail5bad pktail5bad 4 const 99 Using where +1 SIMPLE t1 ref key1,pktail5bad key1 4 const 100 Using where explain select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using index diff --git a/mysql-test/r/metadata.result b/mysql-test/r/metadata.result index 48c09f369b3..6a2cf466cfa 100644 --- a/mysql-test/r/metadata.result +++ b/mysql-test/r/metadata.result @@ -2,7 +2,7 @@ drop table if exists t1,t2; select 1, 1.0, -1, "hello", NULL; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def 1 8 1 1 N 32897 0 63 -def 1.0 5 3 3 N 32897 1 63 +def 1.0 246 4 3 N 161 1 63 def -1 8 2 2 N 32897 0 63 def hello 253 5 5 N 1 31 8 def NULL 6 0 0 Y 32896 0 63 @@ -18,7 +18,7 @@ def test t1 t1 d d 3 11 0 Y 32768 0 63 def test t1 t1 e e 8 20 0 Y 32768 0 63 def test t1 t1 f f 4 3 0 Y 32768 2 63 def test t1 t1 g g 5 4 0 Y 32768 3 63 -def test t1 t1 h h 0 7 0 Y 32768 4 63 +def test t1 t1 h h 246 5 0 Y 0 4 63 def test t1 t1 i i 13 4 0 Y 32864 0 63 def test t1 t1 j j 10 10 0 Y 128 0 63 def test t1 t1 k k 7 19 0 N 1249 0 63 diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index b06909fb1c8..9f08fae4964 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -19,13 +19,13 @@ INSERT INTO t1 VALUES (1), (2); </database> </mysqldump> DROP TABLE t1; -CREATE TABLE t1 (a decimal(240, 20)); +CREATE TABLE t1 (a decimal(64, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); CREATE TABLE `t1` ( - `a` decimal(240,20) default NULL + `a` decimal(64,20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1; -INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000'); +INSERT INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('987654321098765432109876543210987654321.00000000000000000000'); DROP TABLE t1; CREATE TABLE t1 (a double); INSERT INTO t1 VALUES ('-9e999999'); diff --git a/mysql-test/r/olap.result b/mysql-test/r/olap.result index f398c69a424..a04fa75082f 100644 --- a/mysql-test/r/olap.result +++ b/mysql-test/r/olap.result @@ -164,48 +164,48 @@ product country_id year sum(profit) NULL NULL NULL 7785 select concat(product,':',country_id) as 'prod', concat(":",year,":") as 'year',1+1, sum(profit)/count(*) from t1 group by 1,2 with rollup; prod year 1+1 sum(profit)/count(*) -Calculator:1 :1999: 2 50.00 -Calculator:1 :2000: 2 75.00 -Calculator:1 NULL 2 62.50 -Calculator:2 :2000: 2 75.00 -Calculator:2 NULL 2 75.00 -Computer:1 :1999: 2 1350.00 -Computer:1 :2000: 2 1500.00 -Computer:1 NULL 2 1400.00 -Computer:2 :2000: 2 1350.00 -Computer:2 NULL 2 1350.00 -Phone:3 :2003: 2 10.00 -Phone:3 NULL 2 10.00 -TV:1 :1999: 2 125.00 -TV:1 :2000: 2 150.00 -TV:1 NULL 2 133.33 -TV:2 :2000: 2 100.00 -TV:2 NULL 2 100.00 -NULL NULL 2 519.00 +Calculator:1 :1999: 2 50.00000 +Calculator:1 :2000: 2 75.00000 +Calculator:1 NULL 2 62.50000 +Calculator:2 :2000: 2 75.00000 +Calculator:2 NULL 2 75.00000 +Computer:1 :1999: 2 1350.00000 +Computer:1 :2000: 2 1500.00000 +Computer:1 NULL 2 1400.00000 +Computer:2 :2000: 2 1350.00000 +Computer:2 NULL 2 1350.00000 +Phone:3 :2003: 2 10.00000 +Phone:3 NULL 2 10.00000 +TV:1 :1999: 2 125.00000 +TV:1 :2000: 2 150.00000 +TV:1 NULL 2 133.33333 +TV:2 :2000: 2 100.00000 +TV:2 NULL 2 100.00000 +NULL NULL 2 519.00000 select product, sum(profit)/count(*) from t1 group by product with rollup; product sum(profit)/count(*) -Calculator 68.75 -Computer 1380.00 -Phone 10.00 -TV 120.00 -NULL 519.00 +Calculator 68.75000 +Computer 1380.00000 +Phone 10.00000 +TV 120.00000 +NULL 519.00000 select left(product,4) as prod, sum(profit)/count(*) from t1 group by prod with rollup; prod sum(profit)/count(*) -Calc 68.75 -Comp 1380.00 -Phon 10.00 -TV 120.00 -NULL 519.00 +Calc 68.75000 +Comp 1380.00000 +Phon 10.00000 +TV 120.00000 +NULL 519.00000 select concat(product,':',country_id), 1+1, sum(profit)/count(*) from t1 group by concat(product,':',country_id) with rollup; concat(product,':',country_id) 1+1 sum(profit)/count(*) -Calculator:1 2 62.50 -Calculator:2 2 75.00 -Computer:1 2 1400.00 -Computer:2 2 1350.00 -Phone:3 2 10.00 -TV:1 2 133.33 -TV:2 2 100.00 -NULL 2 519.00 +Calculator:1 2 62.50000 +Calculator:2 2 75.00000 +Computer:1 2 1400.00000 +Computer:2 2 1350.00000 +Phone:3 2 10.00000 +TV:1 2 133.33333 +TV:2 2 100.00000 +NULL 2 519.00000 select product, country , year, sum(profit) from t1,t2 where t1.country_id=t2.country_id group by product, country, year with rollup; product country year sum(profit) Calculator India 2000 150 diff --git a/mysql-test/r/ps_1general.result b/mysql-test/r/ps_1general.result index f5c71d3ed23..153121f0662 100644 --- a/mysql-test/r/ps_1general.result +++ b/mysql-test/r/ps_1general.result @@ -293,7 +293,7 @@ t2 MyISAM 9 Fixed 0 0 0 64424509439 1024 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show table status from test like ''t9%'' '; execute stmt4; Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment -t9 MyISAM 10 Dynamic 2 220 440 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL +t9 MyISAM 10 Dynamic 2 216 432 4294967295 2048 0 NULL # # # latin1_swedish_ci NULL prepare stmt4 from ' show status like ''Threads_running'' '; execute stmt4; Variable_name Value diff --git a/mysql-test/r/ps_2myisam.result b/mysql-test/r/ps_2myisam.result index 50a74dfad63..78436b69ec7 100644 --- a/mysql-test/r/ps_2myisam.result +++ b/mysql-test/r/ps_2myisam.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1772,8 +1772,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1794,7 +1794,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1802,9 +1802,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -1824,13 +1824,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1922,8 +1922,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1945,7 +1945,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -1969,8 +1969,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2019,8 +2019,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2042,7 +2042,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -2059,8 +2059,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2107,8 +2107,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2130,7 +2130,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -2151,8 +2151,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2197,8 +2197,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2220,7 +2220,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -2235,8 +2235,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2584,7 +2584,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2607,7 +2607,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2666,6 +2666,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 127 @@ -2678,7 +2679,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2703,7 +2704,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2716,6 +2717,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -128 @@ -2813,10 +2815,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 diff --git a/mysql-test/r/ps_3innodb.result b/mysql-test/r/ps_3innodb.result index 209a22e4a9e..e5db53e1c18 100644 --- a/mysql-test/r/ps_3innodb.result +++ b/mysql-test/r/ps_3innodb.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1755,8 +1755,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1777,7 +1777,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1785,9 +1785,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -1807,13 +1807,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1905,8 +1905,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1928,7 +1928,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -1952,8 +1952,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2002,8 +2002,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2025,7 +2025,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -2042,8 +2042,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2090,8 +2090,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2113,7 +2113,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -2134,8 +2134,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2180,8 +2180,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2203,7 +2203,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -2218,8 +2218,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2567,7 +2567,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2590,7 +2590,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2649,6 +2649,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 127 @@ -2661,7 +2662,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2686,7 +2687,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2699,6 +2700,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -128 @@ -2796,10 +2798,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 diff --git a/mysql-test/r/ps_4heap.result b/mysql-test/r/ps_4heap.result index f0be4d119bc..ad02de1110c 100644 --- a/mysql-test/r/ps_4heap.result +++ b/mysql-test/r/ps_4heap.result @@ -60,8 +60,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1756,8 +1756,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1778,7 +1778,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1786,9 +1786,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -1808,13 +1808,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1906,8 +1906,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1929,7 +1929,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -1953,8 +1953,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2003,8 +2003,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2026,7 +2026,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -2043,8 +2043,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2091,8 +2091,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2114,7 +2114,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -2135,8 +2135,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2181,8 +2181,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2204,7 +2204,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -2219,8 +2219,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2568,7 +2568,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2591,7 +2591,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2650,6 +2650,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 127 @@ -2662,7 +2663,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2687,7 +2688,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2700,6 +2701,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -128 @@ -2797,10 +2799,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50 50 50 50 50 50 50 50 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52 52 52 52 52 52 52 52 -53 5 53 53 53 53 53 53 53 53 53 53 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54 54 54 54 54 54 54 54 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56 56 56 56 56 56 56 56 diff --git a/mysql-test/r/ps_5merge.result b/mysql-test/r/ps_5merge.result index a62d00c71c0..374f6142c44 100644 --- a/mysql-test/r/ps_5merge.result +++ b/mysql-test/r/ps_5merge.result @@ -102,8 +102,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1692,8 +1692,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1714,7 +1714,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1722,9 +1722,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -1744,13 +1744,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1842,8 +1842,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1865,7 +1865,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -1889,8 +1889,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1939,8 +1939,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1962,7 +1962,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -1979,8 +1979,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2027,8 +2027,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2050,7 +2050,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -2071,8 +2071,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2117,8 +2117,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2140,7 +2140,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -2155,8 +2155,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2504,7 +2504,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2527,7 +2527,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2586,6 +2586,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 127 @@ -2598,7 +2599,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2623,7 +2624,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2636,6 +2637,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -128 @@ -2733,10 +2735,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 @@ -3111,8 +3113,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -4701,8 +4703,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -4723,7 +4725,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -4731,9 +4733,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -4753,13 +4755,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -4851,8 +4853,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4874,7 +4876,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -4898,8 +4900,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4948,8 +4950,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -4971,7 +4973,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -4988,8 +4990,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5036,8 +5038,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5059,7 +5061,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -5080,8 +5082,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5126,8 +5128,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5149,7 +5151,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -5164,8 +5166,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -5513,7 +5515,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -5536,7 +5538,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -5595,6 +5597,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 127 @@ -5607,7 +5610,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -5632,7 +5635,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -5645,6 +5648,7 @@ Warning 1264 Out of range value adjusted for column 'c4' at row 1 Warning 1264 Out of range value adjusted for column 'c5' at row 1 Warning 1264 Out of range value adjusted for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -128 @@ -5742,10 +5746,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 diff --git a/mysql-test/r/ps_6bdb.result b/mysql-test/r/ps_6bdb.result index 9a922d75cdc..bf7ef64d052 100644 --- a/mysql-test/r/ps_6bdb.result +++ b/mysql-test/r/ps_6bdb.result @@ -59,8 +59,8 @@ def test t9 t9 c7 c7 4 12 1 Y 32768 31 63 def test t9 t9 c8 c8 5 22 1 Y 32768 31 63 def test t9 t9 c9 c9 5 22 1 Y 32768 31 63 def test t9 t9 c10 c10 5 22 1 Y 32768 31 63 -def test t9 t9 c11 c11 0 9 6 Y 32768 4 63 -def test t9 t9 c12 c12 0 10 6 Y 32768 4 63 +def test t9 t9 c11 c11 246 7 6 Y 0 4 63 +def test t9 t9 c12 c12 246 8 6 Y 0 4 63 def test t9 t9 c13 c13 10 10 10 Y 128 0 63 def test t9 t9 c14 c14 12 19 19 Y 128 0 63 def test t9 t9 c15 c15 7 19 19 N 1249 0 63 @@ -1755,8 +1755,8 @@ Table Create Table t5 CREATE TABLE `t5` ( `const01` bigint(1) NOT NULL default '0', `param01` bigint(20) default NULL, - `const02` double(3,1) NOT NULL default '0.0', - `param02` double default NULL, + `const02` decimal(3,1) NOT NULL default '0.0', + `param02` decimal(64,30) default NULL, `const03` double NOT NULL default '0', `param03` double default NULL, `const04` varchar(3) NOT NULL default '', @@ -1777,7 +1777,7 @@ t5 CREATE TABLE `t5` ( `param11` bigint(20) default NULL, `const12` binary(0) default NULL, `param12` bigint(20) default NULL, - `param13` double default NULL, + `param13` decimal(64,30) default NULL, `param14` longtext, `param15` longblob ) ENGINE=MyISAM DEFAULT CHARSET=latin1 @@ -1785,9 +1785,9 @@ select * from t5 ; Catalog Database Table Table_alias Column Column_alias Name Type Length Max length Is_null Flags Decimals Charsetnr def test t5 t5 const01 const01 8 1 1 N 32769 0 63 def test t5 t5 param01 param01 8 20 1 Y 32768 0 63 -def test t5 t5 const02 const02 5 3 3 N 32769 1 63 -def test t5 t5 param02 param02 5 20 1 Y 32768 31 63 -def test t5 t5 const03 const03 5 23 1 N 32769 31 63 +def test t5 t5 const02 const02 246 3 3 N 1 1 63 +def test t5 t5 param02 param02 246 64 32 Y 0 30 63 +def test t5 t5 const03 const03 5 17 1 N 32769 31 63 def test t5 t5 param03 param03 5 20 1 Y 32768 31 63 def test t5 t5 const04 const04 253 3 3 N 1 0 8 def test t5 t5 param04 param04 252 16777215 3 Y 16 0 8 @@ -1807,13 +1807,13 @@ def test t5 t5 const11 const11 3 4 4 Y 32768 0 63 def test t5 t5 param11 param11 8 20 4 Y 32768 0 63 def test t5 t5 const12 const12 254 0 0 Y 128 0 63 def test t5 t5 param12 param12 8 20 0 Y 32768 0 63 -def test t5 t5 param13 param13 5 20 0 Y 32768 31 63 +def test t5 t5 param13 param13 246 64 0 Y 0 30 63 def test t5 t5 param14 param14 252 16777215 0 Y 16 0 8 def test t5 t5 param15 param15 252 16777215 0 Y 144 0 63 const01 8 param01 8 const02 8.0 -param02 8 +param02 8.000000000000000000000000000000 const03 8 param03 8 const04 abc @@ -1905,8 +1905,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -1928,7 +1928,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select @arg01:= c1, @arg02:= c2, @arg03:= c3, @arg04:= c4, @arg05:= c5, @arg06:= c6, @arg07:= c7, @arg08:= c8, @arg09:= c9, @arg10:= c10, @arg11:= c11, @arg12:= c12, @@ -1952,8 +1952,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2002,8 +2002,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2025,7 +2025,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; @arg01:= c1 @arg02:= c2 @arg03:= c3 @arg04:= c4 @arg05:= c5 @arg06:= c6 @arg07:= c7 @arg08:= c8 @arg09:= c9 @arg10:= c10 @arg11:= c11 @arg12:= c12 @arg13:= c13 @arg14:= c14 @arg15:= c15 @arg16:= c16 @arg17:= c17 @arg18:= c18 @arg19:= c19 @arg20:= c20 @arg21:= c21 @arg22:= c22 @arg23:= c23 @arg24:= c24 @arg25:= c25 @arg26:= c26 @arg27:= c27 @arg28:= c28 @arg29:= c29 @arg30:= c30 @arg31:= c31 @arg32:= c32 @@ -2042,8 +2042,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2090,8 +2090,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2113,7 +2113,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday select c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32 @@ -2134,8 +2134,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2180,8 +2180,8 @@ def @arg07 253 20 1 Y 128 31 63 def @arg08 253 20 1 Y 128 31 63 def @arg09 253 20 1 Y 128 31 63 def @arg10 253 20 1 Y 128 31 63 -def @arg11 253 20 1 Y 128 31 63 -def @arg12 253 20 1 Y 128 31 63 +def @arg11 253 64 6 Y 128 30 63 +def @arg12 253 64 6 Y 128 30 63 def @arg13 253 8192 10 Y 128 31 63 def @arg14 253 8192 19 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2203,7 +2203,7 @@ def @arg30 253 8192 8 Y 0 31 8 def @arg31 253 8192 3 Y 0 31 8 def @arg32 253 8192 6 Y 0 31 8 @arg01 @arg02 @arg03 @arg04 @arg05 @arg06 @arg07 @arg08 @arg09 @arg10 @arg11 @arg12 @arg13 @arg14 @arg15 @arg16 @arg17 @arg18 @arg19 @arg20 @arg21 @arg22 @arg23 @arg24 @arg25 @arg26 @arg27 @arg28 @arg29 @arg30 @arg31 @arg32 -1 1 1 1 1 1 1 1 1 1 1 1 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday +1 1 1 1 1 1 1 1 1 1 1.0000 1.0000 2004-02-29 2004-02-29 11:11:11 2004-02-29 11:11:11 11:11:11 2004 1 1 a 123456789a 123456789a123456789b123456789c tinyblob tinytext blob text mediumblob mediumtext longblob longtext one monday set @my_key= 0 ; execute stmt1 using @my_key ; execute full_info ; @@ -2218,8 +2218,8 @@ def @arg07 253 20 0 Y 128 31 63 def @arg08 253 20 0 Y 128 31 63 def @arg09 253 20 0 Y 128 31 63 def @arg10 253 20 0 Y 128 31 63 -def @arg11 253 20 0 Y 128 31 63 -def @arg12 253 20 0 Y 128 31 63 +def @arg11 253 64 0 Y 128 30 63 +def @arg12 253 64 0 Y 128 30 63 def @arg13 253 8192 0 Y 128 31 63 def @arg14 253 8192 0 Y 128 31 63 def @arg15 253 8192 19 Y 128 31 63 @@ -2567,7 +2567,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '9223372036854775807' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2590,7 +2590,7 @@ c7 9.22337e+18 c8 9.22337203685478e+18 c9 9.22337203685478e+18 c10 9.22337203685478e+18 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -9223372036854775808 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2661,7 +2661,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= '1.11111111111111111111e+50' ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2674,6 +2674,7 @@ Warning 1265 Data truncated for column 'c4' at row 1 Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 1 @@ -2686,7 +2687,7 @@ c7 3.40282e+38 c8 1.11111111111111e+50 c9 1.11111111111111e+50 c10 1.11111111111111e+50 -c12 99999.9999 +c12 9999.9999 execute my_delete ; set @arg00= -1.11111111111111111111e+50 ; execute my_insert using @arg00, @arg00, @arg00, @arg00, @arg00, @arg00, @@ -2724,6 +2725,7 @@ Warning 1265 Data truncated for column 'c4' at row 1 Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -1 @@ -2796,10 +2798,10 @@ c1 c20 c21 c22 c23 c24 c25 c26 c27 c28 c29 c30 41 4 41 41 41 41 41 41 41 41 41 41 42 4 42 42 42 42 42 42 42 42 42 42 43 4 43 43 43 43 43 43 43 43 43 43 -50 5 50 50 50.00 50.00 50.00 50.00 50.00 50.00 50.00 50.00 -51 5 51 51 51 51 51 51 51 51 51 51 -52 5 52 52 52.00 52.00 52.00 52.00 52.00 52.00 52.00 52.00 -53 5 53 53 53.00 53.00 53.00 53.00 53.00 53.00 53.00 53.00 +50 5 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 50.0 +51 5 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 51.0 +52 5 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 52.0 +53 5 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 53.0 54 5 54 54 54.00 54.00 54.00 54.00 54.00 54.00 54.00 54.00 55 5 55 55 55 55 55 55 55 55 55 55 56 6 56 56 56.00 56.00 56.00 56.00 56.00 56.00 56.00 56.00 diff --git a/mysql-test/r/ps_7ndb.result b/mysql-test/r/ps_7ndb.result index 5047160bf75..4f6a62004d2 100644 --- a/mysql-test/r/ps_7ndb.result +++ b/mysql-test/r/ps_7ndb.result @@ -2674,6 +2674,7 @@ Warning 1265 Data truncated for column 'c4' at row 1 Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 1 @@ -2724,6 +2725,7 @@ Warning 1265 Data truncated for column 'c4' at row 1 Warning 1265 Data truncated for column 'c5' at row 1 Warning 1265 Data truncated for column 'c6' at row 1 Warning 1264 Out of range value adjusted for column 'c7' at row 1 +Note 1265 Data truncated for column 'c12' at row 1 Warning 1264 Out of range value adjusted for column 'c12' at row 1 execute my_select ; c1 -1 diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result index 76d6fa13766..40a31563604 100644 --- a/mysql-test/r/row.result +++ b/mysql-test/r/row.result @@ -14,6 +14,8 @@ row(10,2,3) IN (row(3,NULL,3), row(1,2,3), row(1,3,3)) select row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')); row('a',1.5,3) IN (row(1,2,3), row('a',1.5,3), row('a','a','a')) 1 +Warnings: +Error 1366 Incorrect decimal value: '' for column '' at row -1 select row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)); row('a',0,3) IN (row(3,2,3), row('a','0','3'), row(1,3,3)) 1 diff --git a/mysql-test/r/rpl_user_variables.result b/mysql-test/r/rpl_user_variables.result index 2c2a17c953a..2e39f1f6422 100644 --- a/mysql-test/r/rpl_user_variables.result +++ b/mysql-test/r/rpl_user_variables.result @@ -84,27 +84,27 @@ slave-bin.000001 229 User var 2 272 @`i2`=-12345678901234 slave-bin.000001 272 User var 2 315 @`i3`=0 slave-bin.000001 315 User var 2 358 @`i4`=-1 slave-bin.000001 358 Query 1 470 use `test`; insert into t1 values (@i1), (@i2), (@i3), (@i4) -slave-bin.000001 470 User var 2 513 @`r1`=12.5 -slave-bin.000001 513 User var 2 556 @`r2`=-12.5 -slave-bin.000001 556 Query 1 654 use `test`; insert into t1 values (@r1), (@r2) -slave-bin.000001 654 User var 2 703 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci -slave-bin.000001 703 User var 2 738 @`s2`=_latin1 "" COLLATE latin1_swedish_ci -slave-bin.000001 738 User var 2 780 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci -slave-bin.000001 780 User var 2 822 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci -slave-bin.000001 822 User var 2 864 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci -slave-bin.000001 864 Query 1 983 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) -slave-bin.000001 983 User var 2 1009 @`n1`=NULL -slave-bin.000001 1009 Query 1 1100 use `test`; insert into t1 values (@n1) -slave-bin.000001 1100 User var 2 1126 @`n2`=NULL -slave-bin.000001 1126 Query 1 1217 use `test`; insert into t1 values (@n2) -slave-bin.000001 1217 Query 1 1334 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) -slave-bin.000001 1334 User var 2 1376 @`a`=2 -slave-bin.000001 1376 Query 1 1477 use `test`; insert into t1 values (@a+(@b:=@a+1)) -slave-bin.000001 1477 User var 2 1514 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci -slave-bin.000001 1514 Query 1 1647 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) -slave-bin.000001 1647 User var 2 1689 @`a`=5 -slave-bin.000001 1689 Query 1 1784 use `test`; insert into t1 values (@a),(@a) -slave-bin.000001 1784 User var 2 1809 @`a`=NULL -slave-bin.000001 1809 Query 1 1911 use `test`; insert into t1 values (@a),(@a),(@a*5) +slave-bin.000001 470 User var 2 509 @`r1`=12.5 +slave-bin.000001 509 User var 2 548 @`r2`=-12.5 +slave-bin.000001 548 Query 1 646 use `test`; insert into t1 values (@r1), (@r2) +slave-bin.000001 646 User var 2 695 @`s1`=_latin1 0x5468697320697320612074657374 COLLATE latin1_swedish_ci +slave-bin.000001 695 User var 2 730 @`s2`=_latin1 "" COLLATE latin1_swedish_ci +slave-bin.000001 730 User var 2 772 @`s3`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 772 User var 2 814 @`s4`=_latin1 0x6162635C646566 COLLATE latin1_swedish_ci +slave-bin.000001 814 User var 2 856 @`s5`=_latin1 0x61626327646566 COLLATE latin1_swedish_ci +slave-bin.000001 856 Query 1 975 use `test`; insert into t1 values (@s1), (@s2), (@s3), (@s4), (@s5) +slave-bin.000001 975 User var 2 1001 @`n1`=NULL +slave-bin.000001 1001 Query 1 1092 use `test`; insert into t1 values (@n1) +slave-bin.000001 1092 User var 2 1118 @`n2`=NULL +slave-bin.000001 1118 Query 1 1209 use `test`; insert into t1 values (@n2) +slave-bin.000001 1209 Query 1 1326 use `test`; insert into t1 values (@a:=0), (@a:=@a+1), (@a:=@a+1) +slave-bin.000001 1326 User var 2 1368 @`a`=2 +slave-bin.000001 1368 Query 1 1469 use `test`; insert into t1 values (@a+(@b:=@a+1)) +slave-bin.000001 1469 User var 2 1506 @`q`=_latin1 0x616263 COLLATE latin1_swedish_ci +slave-bin.000001 1506 Query 1 1639 use `test`; insert t1 values (@q), (@q:=concat(@q, 'n1')), (@q:=concat(@q, 'n2')) +slave-bin.000001 1639 User var 2 1681 @`a`=5 +slave-bin.000001 1681 Query 1 1776 use `test`; insert into t1 values (@a),(@a) +slave-bin.000001 1776 User var 2 1801 @`a`=NULL +slave-bin.000001 1801 Query 1 1903 use `test`; insert into t1 values (@a),(@a),(@a*5) drop table t1; stop slave; diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 7d5b2ed18cb..b72754d3374 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -1672,7 +1672,7 @@ fld1 count(*) 158402 4181 select sum(Period)/count(*) from t1; sum(Period)/count(*) -9410.00 +9410.00000 select companynr,count(price) as "count",sum(price) as "sum" ,abs(sum(price)/count(price)-avg(price)) as "diff",(0+count(price))*companynr as func from t3 group by companynr; companynr count sum diff func 37 12543 309394878010 0.0000 464091 @@ -2109,7 +2109,7 @@ select @b; aaaa select @c; @c -6.26 +6.260 create table t1 (a int not null auto_increment primary key); insert into t1 values (); insert into t1 values (); diff --git a/mysql-test/r/strict.result b/mysql-test/r/strict.result index 72a763db1b1..2e48ddf6d53 100644 --- a/mysql-test/r/strict.result +++ b/mysql-test/r/strict.result @@ -531,7 +531,6 @@ Warning 1264 Out of range value adjusted for column 'col1' at row 1 Warning 1264 Out of range value adjusted for column 'col2' at row 1 Warning 1264 Out of range value adjusted for column 'col1' at row 2 Warning 1264 Out of range value adjusted for column 'col2' at row 2 -Warning 1264 Out of range value adjusted for column 'col2' at row 2 UPDATE IGNORE t1 SET col2=1/NULL where col1=0; SELECT * FROM t1; col1 col2 @@ -556,6 +555,7 @@ INSERT INTO t1 VALUES(-9223372036854775808,0),(0,0),(9223372036854775807,1844674 INSERT INTO t1 VALUES('-9223372036854775808','0'),('9223372036854775807','18446744073709551615'); INSERT INTO t1 VALUES(-9223372036854774000.0,0.0),(9223372036854775700.0,1844674407370954000.0); INSERT INTO t1 (col1) VALUES(-9223372036854775809); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES(9223372036854775808); INSERT INTO t1 (col2) VALUES(-1); INSERT INTO t1 (col2) VALUES(18446744073709551616); @@ -595,6 +595,7 @@ Error 1365 Division by 0 Error 1365 Division by 0 INSERT IGNORE INTO t1 VALUES(-9223372036854775809,-1),(9223372036854775808,18446744073709551616); Warnings: +Warning 1264 Out of range value adjusted for column 'col1' at row 1 Warning 1264 Out of range value adjusted for column 'col2' at row 2 INSERT IGNORE INTO t1 VALUES('-9223372036854775809','-1'),('9223372036854775808','18446744073709551616'); Warnings: @@ -616,9 +617,8 @@ col1 col2 9223372036854775807 18446744073709551615 -9223372036854775808 0 9223372036854775807 18446744073709551615 --9223372036854773760 0 -9223372036854775807 1844674407370953984 --9223372036854775808 NULL +-9223372036854774000 0 +9223372036854775700 1844674407370954000 -9223372036854775808 NULL NULL 18446744073709551615 2 NULL @@ -632,12 +632,17 @@ NULL NULL DROP TABLE t1; CREATE TABLE t1 (col1 NUMERIC(4,2)); INSERT INTO t1 VALUES (10.55),(10.5555),(0),(-10.55),(-10.5555),(11),(1e+01); +Warnings: +Note 1265 Data truncated for column 'col1' at row 2 +Note 1265 Data truncated for column 'col1' at row 5 INSERT INTO t1 VALUES ('10.55'),('10.5555'),('-10.55'),('-10.5555'),('11'),('1e+01'); Warnings: Note 1265 Data truncated for column 'col1' at row 2 Note 1265 Data truncated for column 'col1' at row 4 INSERT INTO t1 VALUES (101.55); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES (101); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES (-101.55); ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES (1010.55); @@ -645,7 +650,9 @@ ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES (1010); ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES ('101.55'); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES ('101'); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES ('-101.55'); ERROR 22003: Out of range value adjusted for column 'col1' at row 1 INSERT INTO t1 VALUES ('-1010.55'); @@ -661,14 +668,15 @@ ERROR 22012: Division by 0 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ERROR 22012: Division by 0 INSERT INTO t1 (col1) VALUES (''); -ERROR 01000: Data truncated for column 'col1' at row 1 +ERROR HY000: Incorrect decimal value: '' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('a59b'); -ERROR 01000: Data truncated for column 'col1' at row 1 +ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 INSERT INTO t1 (col1) VALUES ('1a'); -ERROR 01000: Data truncated for column 'col1' at row 1 +Warnings: +Note 1265 Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 (col1) VALUES ('2a'); Warnings: -Warning 1265 Data truncated for column 'col1' at row 1 +Note 1265 Data truncated for column 'col1' at row 1 INSERT IGNORE INTO t1 values (1/0); Warnings: Error 1365 Division by 0 @@ -695,22 +703,19 @@ NULL 11.00 10.00 10.55 -10.55 --10.55 +10.56 -10.55 +-10.56 11.00 10.00 -101.55 -101.00 -101.55 -101.00 +1.00 2.00 NULL -999.99 +99.99 -99.99 -999.99 +99.99 -99.99 -999.99 +99.99 -99.99 DROP TABLE t1; CREATE TABLE t1 (col1 FLOAT, col2 FLOAT UNSIGNED); diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 5ca0c9356e6..2e9f199e8bb 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -890,7 +890,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 Using index 2 DEPENDENT SUBQUERY t2 index_subquery a a 5 func 2 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t2 on a chicking NULL))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in t2 on a checking NULL))) AS `t1.a in (select t2.a from t2)` from `test`.`t1` CREATE TABLE t3 (a int(11) default '0'); INSERT INTO t3 VALUES (1),(2),(3); SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; @@ -1462,25 +1462,25 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 2 Using index Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL s1 5 NULL 3 Using index 2 DEPENDENT SUBQUERY t2 index_subquery s1 s1 6 func 1 Using index; Using where Warnings: -Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 chicking NULL where (`test`.`t2`.`s1` < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` +Note 1003 select `test`.`t1`.`s1` AS `s1`,not(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL where (`test`.`t2`.`s1` < _latin1'a2'))))) AS `s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2')` from `test`.`t1` drop table t1,t2; create table t2 (a int, b int); create table t3 (a int); diff --git a/mysql-test/r/sum_distinct.result b/mysql-test/r/sum_distinct.result index c7f1a660267..34242817a54 100644 --- a/mysql-test/r/sum_distinct.result +++ b/mysql-test/r/sum_distinct.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2; CREATE TABLE t1 ( id INTEGER NOT NULL PRIMARY KEY AUTO_INCREMENT, gender CHAR(1), diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index c9a272df1ba..2045b7e65dd 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -156,6 +156,9 @@ insert into t1 values ("0.0"),("-0.0"),("+0.0"),("01.0"),("+01.0"),("-01.0"); insert into t1 values ("-.1"),("+.1"),(".1"); insert into t1 values ("00000000000001"),("+0000000000001"),("-0000000000001"); insert into t1 values ("+111111111.11"),("111111111.11"),("-11111111.11"); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 insert into t1 values ("-111111111.11"),("+1111111111.11"),("1111111111.11"); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 @@ -164,7 +167,7 @@ Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 -Warning 1265 Data truncated for column 'a' at row 2 +Note 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: @@ -172,24 +175,24 @@ Note 1265 Data truncated for column 'a' at row 3 select * from t1; a 0.00 --0.00 -+0.00 -01.00 -+01.00 --01.00 +0.00 +0.00 +1.00 +1.00 +-1.00 -0.10 -+0.10 0.10 -000000001.00 -+00000001.00 --00000001.00 -111111111.11 -111111111.11 +0.10 +1.00 +1.00 +-1.00 +99999999.99 +99999999.99 -11111111.11 -99999999.99 -999999999.99 -999999999.99 -999999999.99 +99999999.99 +99999999.99 +99999999.99 0.00 -99999999.99 123.40 @@ -222,7 +225,7 @@ Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 -Warning 1265 Data truncated for column 'a' at row 2 +Note 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: @@ -231,15 +234,15 @@ select * from t1; a 0.00 0.00 -+0.00 -01.00 -+01.00 +0.00 +1.00 +1.00 0.00 0.00 -+0.10 0.10 -00000001.00 -+0000001.00 +0.10 +1.00 +1.00 0.00 99999999.99 99999999.99 @@ -280,7 +283,7 @@ Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("1e+1000"),("1e-1000"),("-1e+1000"); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 -Warning 1265 Data truncated for column 'a' at row 2 +Note 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values ("123.4e"),("123.4e+2"),("123.4e-2"),("123e1"),("123e+0"); Warnings: @@ -319,6 +322,9 @@ insert into t1 values (0.0),("-0.0"),(+0.0),(01.0),(+01.0),(-01.0); insert into t1 values (-.1),(+.1),(.1); insert into t1 values (00000000000001),(+0000000000001),(-0000000000001); insert into t1 values (+111111111.11),(111111111.11),(-11111111.11); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 insert into t1 values (-111111111.11),(+1111111111.11),(1111111111.11); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 @@ -327,12 +333,15 @@ Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values (1e+100),(1e-100),(-1e+100); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 +Note 1265 Data truncated for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 3 insert into t1 values (123.4e0),(123.4e+2),(123.4e-2),(123e1),(123e+0); +Warnings: +Note 1265 Data truncated for column 'a' at row 3 select * from t1; a 0.00 --0.00 +0.00 0.00 1.00 1.00 @@ -343,13 +352,13 @@ a 1.00 1.00 -1.00 -111111111.11 -111111111.11 +99999999.99 +99999999.99 -11111111.11 -99999999.99 -999999999.99 -999999999.99 -999999999.99 +99999999.99 +99999999.99 +99999999.99 0.00 -99999999.99 123.40 @@ -362,16 +371,17 @@ create table t1 (a decimal); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+12345678901'),(99999999999999); Warnings: Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 6 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a -9999999999 -1 -+1 -01 -+0000000001 -12345678901 -99999999999 +1 +1 +1 +9999999999 +9999999999 drop table t1; create table t1 (a decimal unsigned); insert into t1 values (-99999999999999),(-1),('+1'),('01'),('+00000000000001'),('+1234567890'),(99999999999999); @@ -381,11 +391,11 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a -0 -0 -+1 -01 -+000000001 +9999999999 +9999999999 +1 +1 +1 1234567890 9999999999 drop table t1; @@ -397,8 +407,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a -0000000000 -0000000000 +9999999999 +9999999999 0000000001 0000000001 0000000001 @@ -413,8 +423,8 @@ Warning 1264 Out of range value adjusted for column 'a' at row 2 Warning 1264 Out of range value adjusted for column 'a' at row 7 select * from t1; a -0000000000 -0000000000 +9999999999 +9999999999 0000000001 0000000001 0000000001 @@ -424,19 +434,17 @@ drop table t1; create table t1(a decimal(10,0)); insert into t1 values ("1e4294967295"); Warnings: -Warning 1265 Data truncated for column 'a' at row 1 Warning 1264 Out of range value adjusted for column 'a' at row 1 select * from t1; a -99999999999 +9999999999 delete from t1; insert into t1 values("1e4294967297"); Warnings: -Warning 1265 Data truncated for column 'a' at row 1 Warning 1264 Out of range value adjusted for column 'a' at row 1 select * from t1; a -99999999999 +9999999999 drop table t1; CREATE TABLE t1 (a_dec DECIMAL(-1,0)); ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-1,0))' at line 1 @@ -448,7 +456,7 @@ CREATE TABLE t1 (a_dec DECIMAL(0,11)); SHOW CREATE TABLE t1; Table Create Table t1 CREATE TABLE `t1` ( - `a_dec` decimal(12,11) default NULL + `a_dec` decimal(11,11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1; create table t1(a decimal(7,3)); @@ -456,64 +464,64 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 select * from t1; a 1.000 -+1.000 +1.000 -1.000 -00001.000 -+0001.000 --0001.000 +1.000 +1.000 +-1.000 +10.000 +10.000 +-10.000 +10.000 10.000 -+10.000 -10.000 -00010.000 -+0010.000 --0010.000 100.000 -+100.000 +100.000 +-100.000 +100.000 +100.000 -100.000 -00100.000 -+0100.000 --0100.000 1000.000 -+1000.000 +1000.000 -1000.000 -01000.000 -+1000.000 +1000.000 +1000.000 -1000.000 -10000.000 -10000.000 +9999.999 +9999.999 -9999.999 -10000.000 -10000.000 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 -99999.999 -99999.999 +9999.999 +9999.999 -9999.999 drop table t1; create table t1(a decimal(7,3) unsigned); @@ -521,22 +529,22 @@ insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000 select * from t1; a 1.000 -+1.000 +1.000 0.000 -0001.000 -+001.000 +1.000 +1.000 0.000 10.000 -+10.000 +10.000 0.000 -0010.000 -+010.000 +10.000 +10.000 0.000 100.000 -+100.000 +100.000 0.000 -0100.000 -+100.000 +100.000 +100.000 0.000 1000.000 1000.000 diff --git a/mysql-test/r/type_float.result b/mysql-test/r/type_float.result index c77b3ad7578..8140167870e 100644 --- a/mysql-test/r/type_float.result +++ b/mysql-test/r/type_float.result @@ -66,7 +66,7 @@ select a from t1 order by a; a -0.010 -0.002 --0.000 +0.000 0.000 1.000 select min(a) from t1; @@ -119,7 +119,7 @@ select a from t1 order by a; a -0.010 -0.002 --0.000 +0.000 0.000 1.000 select min(a) from t1; @@ -142,6 +142,9 @@ create table t1 (c20 char); insert into t1 values (5000.0); Warnings: Warning 1265 Data truncated for column 'c20' at row 1 +insert into t1 values (0.5e4); +Warnings: +Warning 1265 Data truncated for column 'c20' at row 1 drop table t1; create table t1 (f float(54)); ERROR 42000: Incorrect column specifier for column 'f' diff --git a/mysql-test/r/type_newdecimal.result b/mysql-test/r/type_newdecimal.result new file mode 100644 index 00000000000..cf23d4162ae --- /dev/null +++ b/mysql-test/r/type_newdecimal.result @@ -0,0 +1,843 @@ +drop table if exists t1; +select 1.1 IN (1.0, 1.2); +1.1 IN (1.0, 1.2) +0 +select 1.1 IN (1.0, 1.2, 1.1, 1.4, 0.5); +1.1 IN (1.0, 1.2, 1.1, 1.4, 0.5) +1 +select 1.1 IN (1.0, 1.2, NULL, 1.4, 0.5); +1.1 IN (1.0, 1.2, NULL, 1.4, 0.5) +NULL +select 0.5 IN (1.0, 1.2, NULL, 1.4, 0.5); +0.5 IN (1.0, 1.2, NULL, 1.4, 0.5) +1 +select 1 IN (1.11, 1.2, 1.1, 1.4, 1, 0.5); +1 IN (1.11, 1.2, 1.1, 1.4, 1, 0.5) +1 +select 1 IN (1.11, 1.2, 1.1, 1.4, NULL, 0.5); +1 IN (1.11, 1.2, 1.1, 1.4, NULL, 0.5) +NULL +select case 1.0 when 0.1 then "a" when 1.0 then "b" else "c" END; +case 1.0 when 0.1 then "a" when 1.0 then "b" else "c" END +b +select case 0.1 when 0.1 then "a" when 1.0 then "b" else "c" END; +case 0.1 when 0.1 then "a" when 1.0 then "b" else "c" END +a +select case 1 when 0.1 then "a" when 1.0 then "b" else "c" END; +case 1 when 0.1 then "a" when 1.0 then "b" else "c" END +b +select case 1.0 when 0.1 then "a" when 1 then "b" else "c" END; +case 1.0 when 0.1 then "a" when 1 then "b" else "c" END +b +select case 1.001 when 0.1 then "a" when 1 then "b" else "c" END; +case 1.001 when 0.1 then "a" when 1 then "b" else "c" END +c +create table t1 (a decimal(6,3)); +insert into t1 values (1.0), (NULL), (0.1); +select * from t1; +a +1.000 +NULL +0.100 +select 0.1 in (1.0, 1.2, 1.1, a, 1.4, 0.5) from t1; +0.1 in (1.0, 1.2, 1.1, a, 1.4, 0.5) +0 +NULL +1 +drop table t1; +create table t1 select if(1, 1.1, 1.2), if(0, 1.1, 1.2), if(0.1, 1.1, 1.2), if(0, 1, 1.1), if(0, NULL, 1.2), if(1, 0.22e1, 1.1), if(1E0, 1.1, 1.2); +select * from t1; +if(1, 1.1, 1.2) if(0, 1.1, 1.2) if(0.1, 1.1, 1.2) if(0, 1, 1.1) if(0, NULL, 1.2) if(1, 0.22e1, 1.1) if(1E0, 1.1, 1.2) +1.1 1.2 1.1 1.1 1.2 2.2 1.1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `if(1, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', + `if(0, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', + `if(0.1, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0', + `if(0, 1, 1.1)` decimal(5,1) NOT NULL default '0.0', + `if(0, NULL, 1.2)` decimal(5,1) default NULL, + `if(1, 0.22e1, 1.1)` double NOT NULL default '0', + `if(1E0, 1.1, 1.2)` decimal(5,1) NOT NULL default '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 select nullif(1.1, 1.1), nullif(1.1, 1.2), nullif(1.1, 0.11e1), nullif(1.0, 1), nullif(1, 1.0), nullif(1, 1.1); +select * from t1; +nullif(1.1, 1.1) nullif(1.1, 1.2) nullif(1.1, 0.11e1) nullif(1.0, 1) nullif(1, 1.0) nullif(1, 1.1) +NULL 1.1 NULL NULL NULL 1 +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `nullif(1.1, 1.1)` decimal(5,1) default NULL, + `nullif(1.1, 1.2)` decimal(5,1) default NULL, + `nullif(1.1, 0.11e1)` double(4,1) default NULL, + `nullif(1.0, 1)` decimal(5,1) default NULL, + `nullif(1, 1.0)` decimal(1,0) default NULL, + `nullif(1, 1.1)` decimal(1,0) default NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 (a decimal(4,2)); +insert into t1 value (10000), (1.1e10), ("11111"), (100000.1); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 +Warning 1264 Out of range value adjusted for column 'a' at row 3 +Warning 1264 Out of range value adjusted for column 'a' at row 4 +insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 +Warning 1264 Out of range value adjusted for column 'a' at row 3 +Warning 1264 Out of range value adjusted for column 'a' at row 4 +select a from t1; +a +99.99 +99.99 +99.99 +99.99 +-99.99 +-99.99 +-99.99 +-99.99 +drop table t1; +create table t1 (a decimal(4,2) unsigned); +insert into t1 value (10000), (1.1e10), ("11111"), (100000.1); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 +Warning 1264 Out of range value adjusted for column 'a' at row 3 +Warning 1264 Out of range value adjusted for column 'a' at row 4 +insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 2 +Warning 1264 Out of range value adjusted for column 'a' at row 3 +Warning 1264 Out of range value adjusted for column 'a' at row 4 +select a from t1; +a +99.99 +99.99 +99.99 +99.99 +99.99 +0.00 +0.00 +0.00 +drop table t1; +create table t1 (a bigint); +insert into t1 values (18446744073709551615.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +insert into t1 values (9223372036854775808.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +insert into t1 values (-18446744073709551615.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +select * from t1; +a +9223372036854775807 +9223372036854775807 +-9223372036854775808 +drop table t1; +create table t1 (a bigint unsigned); +insert into t1 values (18446744073709551615.0); +insert into t1 values (9223372036854775808.0); +insert into t1 values (9999999999999999999999999.000); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +insert into t1 values (-1.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +select * from t1; +a +18446744073709551615 +9223372036854775808 +18446744073709551615 +0 +drop table t1; +create table t1 (a tinyint); +insert into t1 values (18446744073709551615.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 1 +insert into t1 values (9223372036854775808.0); +Warnings: +Warning 1264 Out of range value adjusted for column 'a' at row 1 +Warning 1264 Out of range value adjusted for column 'a' at row 1 +select * from t1; +a +127 +127 +drop table t1; +create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-1.1); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `round(15.4,-1)` decimal(5,0) NOT NULL default '0', + `truncate(-5678.123451,-3)` decimal(13,0) NOT NULL default '0', + `abs(-1.1)` decimal(6,1) NOT NULL default '0.0', + `-(-1.1)` decimal(7,1) NOT NULL default '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +update t1 set b=a; +SELECT * FROM t1; +a b +1.1 1.100 +2.1 2.100 +DROP TABLE t1; +set session sql_mode='traditional'; +select 1e10/0e0; +1e10/0e0 +NULL +Warnings: +Error 1365 Division by 0 +create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10)); +insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890); +select * from wl1612; +col1 col2 col3 +1 12345678901234567890.1234567890 12345678901234567890.1234567890 +insert into wl1612 values(2,01234567890123456789.0123456789,01234567890123456789.0123456789); +select * from wl1612 where col1=2; +col1 col2 col3 +2 1234567890123456789.0123456789 1234567890123456789.0123456789 +insert into wl1612 values(3,1234567890123456789012345678.0123456789,1234567890123456789012345678.0123456789); +select * from wl1612 where col1=3; +col1 col2 col3 +3 1234567890123456789012345678.0123456789 1234567890123456789012345678.0123456789 +select col1/0 from wl1612; +col1/0 +NULL +NULL +NULL +Warnings: +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +select col2/0 from wl1612; +col2/0 +NULL +NULL +NULL +Warnings: +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +select col3/0 from wl1612; +col3/0 +NULL +NULL +NULL +Warnings: +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +insert into wl1612 values(5,5000.0005,5000.0005); +insert into wl1612 values(6,5000.0005,5000.0005); +select sum(col2),sum(col3) from wl1612; +sum(col2) sum(col3) +1234567903703703580370380357.1491481468 1234567903703703580370380357.1491481468 +insert into wl1612 values(7,500000.000005,500000.000005); +insert into wl1612 values(8,500000.000005,500000.000005); +select sum(col2),sum(col3) from wl1612 where col1>4; +sum(col2) sum(col3) +1010000.0010100000 1010000.0010100000 +insert into wl1612 (col1, col2) values(9,1.01234567891); +Warnings: +Note 1265 Data truncated for column 'col2' at row 1 +insert into wl1612 (col1, col2) values(10,1.01234567894); +Warnings: +Note 1265 Data truncated for column 'col2' at row 1 +insert into wl1612 (col1, col2) values(11,1.01234567895); +Warnings: +Note 1265 Data truncated for column 'col2' at row 1 +insert into wl1612 (col1, col2) values(12,1.01234567896); +Warnings: +Note 1265 Data truncated for column 'col2' at row 1 +select col1,col2 from wl1612 where col1>8; +col1 col2 +9 1.0123456789 +10 1.0123456789 +11 1.0123456790 +12 1.0123456790 +insert into wl1612 (col1, col3) values(13,1.01234567891); +Warnings: +Note 1265 Data truncated for column 'col3' at row 1 +insert into wl1612 (col1, col3) values(14,1.01234567894); +Warnings: +Note 1265 Data truncated for column 'col3' at row 1 +insert into wl1612 (col1, col3) values(15,1.01234567895); +Warnings: +Note 1265 Data truncated for column 'col3' at row 1 +insert into wl1612 (col1, col3) values(16,1.01234567896); +Warnings: +Note 1265 Data truncated for column 'col3' at row 1 +select col1,col3 from wl1612 where col1>12; +col1 col3 +13 1.0123456789 +14 1.0123456789 +15 1.0123456790 +16 1.0123456790 +select col1 from wl1612 where col1>4 and col2=1.01234567891; +col1 +select col1 from wl1612 where col1>4 and col2=1.0123456789; +col1 +9 +10 +select col1 from wl1612 where col1>4 and col2<>1.0123456789; +col1 +5 +6 +7 +8 +11 +12 +select col1 from wl1612 where col1>4 and col2<1.0123456789; +col1 +select col1 from wl1612 where col1>4 and col2<=1.0123456789; +col1 +9 +10 +select col1 from wl1612 where col1>4 and col2>1.0123456789; +col1 +5 +6 +7 +8 +11 +12 +select col1 from wl1612 where col1>4 and col2>=1.0123456789; +col1 +5 +6 +7 +8 +9 +10 +11 +12 +select col1 from wl1612 where col1>4 and col2=1.012345679; +col1 +11 +12 +select col1 from wl1612 where col1>4 and col2<>1.012345679; +col1 +5 +6 +7 +8 +9 +10 +select col1 from wl1612 where col1>4 and col3=1.01234567891; +col1 +select col1 from wl1612 where col1>4 and col3=1.0123456789; +col1 +13 +14 +select col1 from wl1612 where col1>4 and col3<>1.0123456789; +col1 +5 +6 +7 +8 +15 +16 +select col1 from wl1612 where col1>4 and col3<1.0123456789; +col1 +select col1 from wl1612 where col1>4 and col3<=1.0123456789; +col1 +13 +14 +select col1 from wl1612 where col1>4 and col3>1.0123456789; +col1 +5 +6 +7 +8 +15 +16 +select col1 from wl1612 where col1>4 and col3>=1.0123456789; +col1 +5 +6 +7 +8 +13 +14 +15 +16 +select col1 from wl1612 where col1>4 and col3=1.012345679; +col1 +15 +16 +select col1 from wl1612 where col1>4 and col3<>1.012345679; +col1 +5 +6 +7 +8 +13 +14 +drop table wl1612; +select 1/3; +1/3 +0.33333 +select 0.8=0.7+0.1; +0.8=0.7+0.1 +1 +select 0.7+0.1; +0.7+0.1 +0.8 +create table wl1612_1 (col1 int); +insert into wl1612_1 values(10); +select * from wl1612_1 where 0.8=0.7+0.1; +col1 +10 +select 0.07+0.07 from wl1612_1; +0.07+0.07 +0.14 +select 0.07-0.07 from wl1612_1; +0.07-0.07 +0.00 +select 0.07*0.07 from wl1612_1; +0.07*0.07 +0.0049 +select 0.07/0.07 from wl1612_1; +0.07/0.07 +1.000000000 +drop table wl1612_1; +create table wl1612_2 (col1 decimal(10,2), col2 numeric(10,2)); +insert into wl1612_2 values(1,1); +insert into wl1612_2 values(+1,+1); +insert into wl1612_2 values(+01,+01); +insert into wl1612_2 values(+001,+001); +select col1,count(*) from wl1612_2 group by col1; +col1 count(*) +1.00 4 +select col2,count(*) from wl1612_2 group by col2; +col2 count(*) +1.00 4 +drop table wl1612_2; +create table wl1612_3 (col1 decimal(10,2), col2 numeric(10,2)); +insert into wl1612_3 values('1','1'); +insert into wl1612_3 values('+1','+1'); +insert into wl1612_3 values('+01','+01'); +insert into wl1612_3 values('+001','+001'); +select col1,count(*) from wl1612_3 group by col1; +col1 count(*) +1.00 4 +select col2,count(*) from wl1612_3 group by col2; +col2 count(*) +1.00 4 +drop table wl1612_3; +select mod(234,10) ; +mod(234,10) +4 +select mod(234.567,10.555); +mod(234.567,10.555) +2.357 +select mod(-234.567,10.555); +mod(-234.567,10.555) +-2.357 +select mod(234.567,-10.555); +mod(234.567,-10.555) +2.357 +select round(15.1); +round(15.1) +15 +select round(15.4); +round(15.4) +15 +select round(15.5); +round(15.5) +16 +select round(15.6); +round(15.6) +16 +select round(15.9); +round(15.9) +16 +select round(-15.1); +round(-15.1) +-15 +select round(-15.4); +round(-15.4) +-15 +select round(-15.5); +round(-15.5) +-16 +select round(-15.6); +round(-15.6) +-16 +select round(-15.9); +round(-15.9) +-16 +select round(15.1,1); +round(15.1,1) +15.1 +select round(15.4,1); +round(15.4,1) +15.4 +select round(15.5,1); +round(15.5,1) +15.5 +select round(15.6,1); +round(15.6,1) +15.6 +select round(15.9,1); +round(15.9,1) +15.9 +select round(-15.1,1); +round(-15.1,1) +-15.1 +select round(-15.4,1); +round(-15.4,1) +-15.4 +select round(-15.5,1); +round(-15.5,1) +-15.5 +select round(-15.6,1); +round(-15.6,1) +-15.6 +select round(-15.9,1); +round(-15.9,1) +-15.9 +select round(15.1,0); +round(15.1,0) +15 +select round(15.4,0); +round(15.4,0) +15 +select round(15.5,0); +round(15.5,0) +16 +select round(15.6,0); +round(15.6,0) +16 +select round(15.9,0); +round(15.9,0) +16 +select round(-15.1,0); +round(-15.1,0) +-15 +select round(-15.4,0); +round(-15.4,0) +-15 +select round(-15.5,0); +round(-15.5,0) +-16 +select round(-15.6,0); +round(-15.6,0) +-16 +select round(-15.9,0); +round(-15.9,0) +-16 +select round(15.1,-1); +round(15.1,-1) +20 +select round(15.4,-1); +round(15.4,-1) +20 +select round(15.5,-1); +round(15.5,-1) +20 +select round(15.6,-1); +round(15.6,-1) +20 +select round(15.9,-1); +round(15.9,-1) +20 +select round(-15.1,-1); +round(-15.1,-1) +-20 +select round(-15.4,-1); +round(-15.4,-1) +-20 +select round(-15.5,-1); +round(-15.5,-1) +-20 +select round(-15.6,-1); +round(-15.6,-1) +-20 +select round(-15.91,-1); +round(-15.91,-1) +-20 +select truncate(5678.123451,0); +truncate(5678.123451,0) +5678 +select truncate(5678.123451,1); +truncate(5678.123451,1) +5678.1 +select truncate(5678.123451,2); +truncate(5678.123451,2) +5678.12 +select truncate(5678.123451,3); +truncate(5678.123451,3) +5678.123 +select truncate(5678.123451,4); +truncate(5678.123451,4) +5678.1234 +select truncate(5678.123451,5); +truncate(5678.123451,5) +5678.12345 +select truncate(5678.123451,6); +truncate(5678.123451,6) +5678.123451 +select truncate(5678.123451,-1); +truncate(5678.123451,-1) +5670 +select truncate(5678.123451,-2); +truncate(5678.123451,-2) +5600 +select truncate(5678.123451,-3); +truncate(5678.123451,-3) +5000 +select truncate(5678.123451,-4); +truncate(5678.123451,-4) +0 +select truncate(-5678.123451,0); +truncate(-5678.123451,0) +-5678 +select truncate(-5678.123451,1); +truncate(-5678.123451,1) +-5678.1 +select truncate(-5678.123451,2); +truncate(-5678.123451,2) +-5678.12 +select truncate(-5678.123451,3); +truncate(-5678.123451,3) +-5678.123 +select truncate(-5678.123451,4); +truncate(-5678.123451,4) +-5678.1234 +select truncate(-5678.123451,5); +truncate(-5678.123451,5) +-5678.12345 +select truncate(-5678.123451,6); +truncate(-5678.123451,6) +-5678.123451 +select truncate(-5678.123451,-1); +truncate(-5678.123451,-1) +-5670 +select truncate(-5678.123451,-2); +truncate(-5678.123451,-2) +-5600 +select truncate(-5678.123451,-3); +truncate(-5678.123451,-3) +-5000 +select truncate(-5678.123451,-4); +truncate(-5678.123451,-4) +0 +create table wl1612_4 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); +insert into wl1612_4 values(1,0.0123456789012345678912345,0.0123456789012345678912345); +select col2/9999999999 from wl1612_4 where col1=1; +col2/9999999999 +0.0000000000012345678902469135781481410000000000000000000 +select col3/9999999999 from wl1612_4 where col1=1; +col3/9999999999 +0.0000000000012345678902469135781481410000000000000000000 +select 9999999999/col2 from wl1612_4 where col1=1; +9999999999/col2 +810000007209.00007 +select 9999999999/col3 from wl1612_4 where col1=1; +9999999999/col3 +810000007209.00007 +select col2*9999999999 from wl1612_4 where col1=1; +col2*9999999999 +123456789.0000000000111104321087655 +select col3*9999999999 from wl1612_4 where col1=1; +col3*9999999999 +123456789.0000000000111104321087655 +insert into wl1612_4 values(2,55555.0123456789012345678912345,55555.0123456789012345678912345); +select col2/9999999999 from wl1612_4 where col1=2; +col2/9999999999 +0.0000055555012351234402469691331481460000000000000000000 +select col3/9999999999 from wl1612_4 where col1=2; +col3/9999999999 +0.0000055555012351234402469691331481460000000000000000000 +select 9999999999/col2 from wl1612_4 where col1=2; +9999999999/col2 +180001.76000 +select 9999999999/col3 from wl1612_4 where col1=2; +9999999999/col3 +180001.76000 +select col2*9999999999 from wl1612_4 where col1=2; +col2*9999999999 +555550123401234.0000000000111104321087655 +select col3*9999999999 from wl1612_4 where col1=2; +col3*9999999999 +555550123401234.0000000000111104321087655 +drop table wl1612_4; +set sql_mode=''; +select 23.4 + (-41.7), 23.4 - (41.7) = -18.3; +23.4 + (-41.7) 23.4 - (41.7) = -18.3 +-18.3 1 +select -18.3=-18.3; +-18.3=-18.3 +1 +select 18.3=18.3; +18.3=18.3 +1 +select -18.3=18.3; +-18.3=18.3 +0 +select 0.8 = 0.7 + 0.1; +0.8 = 0.7 + 0.1 +1 +create procedure p1 () begin +declare v1, v2, v3, v4 decimal(16,12); declare v5 int; +set v1 = 1; set v2 = 2; set v3 = 1000000000000; set v4 = 2000000000000; set v5 = 0; +while v5 < 100000 do +set v1 = v1 + 0.000000000001; set v2 = v2 - 0.000000000001; set v3 = v3 + 1; set v4 = v4 - 1; set v5 = v5 + 1; +end while; select v1, v2, v3 * 0.000000000001, v4 * 0.000000000001; end;// +# +call p1()// +# +v1 v2 v3 * 0.000000000001 v4 * 0.000000000001 +1.000000100000 1.999999900000 1.000000100000000000 1.999999900000000000 +drop procedure p1; +drop table if exists t1; +Warnings: +Note 1051 Unknown table 't1' +create table t1 (col1 decimal(38)); +insert into t1 values (12345678901234567890123456789012345678); +select * from t1; +col1 +12345678901234567890123456789012345678 +drop table t1; +create table t1 (col1 decimal(31,30)); +insert into t1 values (0.00000000001); +select * from t1; +col1 +0.000000000010000000000000000000 +drop table t1; +select 7777777777777777777777777777777777777 * 10; +7777777777777777777777777777777777777 * 10 +77777777777777777777777777777777777770 +select .7777777777777777777777777777777777777 * +1000000000000000000; +.7777777777777777777777777777777777777 * +1000000000000000000 +777777777777777777.7777777777777777777000000000000000000 +select .7777777777777777777777777777777777777 - 0.1; +.7777777777777777777777777777777777777 - 0.1 +0.6777777777777777777777777777777777777 +select .343434343434343434 + .343434343434343434; +.343434343434343434 + .343434343434343434 +0.686868686868686868 +select abs(9999999999999999999999); +abs(9999999999999999999999) +9999999999999999999999 +select abs(-9999999999999999999999); +abs(-9999999999999999999999) +9999999999999999999999 +select ceiling(99999999999999999999); +ceiling(99999999999999999999) +99999999999999999999 +select ceiling(9.9999999999999999999); +ceiling(9.9999999999999999999) +10 +select ceiling(-9.9999999999999999999); +ceiling(-9.9999999999999999999) +-10 +select floor(9999999999999999999999); +floor(9999999999999999999999) +9999999999999999999999 +select floor(9.999999999999999999999); +floor(9.999999999999999999999) +10 +select floor(-9.999999999999999999999); +floor(-9.999999999999999999999) +-10 +select floor(-999999999999999999999.999); +floor(-999999999999999999999.999) +-1000000000000000000000 +select ceiling(999999999999999999999.999); +ceiling(999999999999999999999.999) +1000000000000000000000 +select 99999999999999999999999999999999999999 mod 3; +99999999999999999999999999999999999999 mod 3 +0 +select round(99999999999999999.999); +round(99999999999999999.999) +100000000000000000 +select round(-99999999999999999.999); +round(-99999999999999999.999) +-100000000000000000 +select round(99999999999999999.999,3); +round(99999999999999999.999,3) +99999999999999999.999 +select round(-99999999999999999.999,3); +round(-99999999999999999.999,3) +-99999999999999999.999 +select truncate(99999999999999999999999999999999999999,31); +truncate(99999999999999999999999999999999999999,31) +99999999999999999999999999999999999999.000000000000000000000000000 +select truncate(99.999999999999999999999999999999999999,31); +truncate(99.999999999999999999999999999999999999,31) +99.9999999999999999999999999999999 +select truncate(99999999999999999999999999999999999999,-31); +truncate(99999999999999999999999999999999999999,-31) +99999990000000000000000000000000000000 +create table t1 as select 0.5; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `0.5` decimal(3,1) NOT NULL default '0.0' +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +select round(1.5),round(2.5); +round(1.5) round(2.5) +2 3 +select 0.07 * 0.07; +0.07 * 0.07 +0.0049 +set sql_mode='traditional'; +select 1E-500 = 0; +1E-500 = 0 +1 +select 1 / 1E-500; +1 / 1E-500 +NULL +Warnings: +Error 1365 Division by 0 +select 1 / 0; +1 / 0 +NULL +Warnings: +Error 1365 Division by 0 +set sql_mode='ansi,traditional'; +CREATE TABLE Sow6_2f (col1 NUMERIC(4,2)); +INSERT INTO Sow6_2f VALUES (10.55); +INSERT INTO Sow6_2f VALUES (10.5555); +Warnings: +Note 1265 Data truncated for column 'col1' at row 1 +INSERT INTO Sow6_2f VALUES (-10.55); +INSERT INTO Sow6_2f VALUES (-10.5555); +Warnings: +Note 1265 Data truncated for column 'col1' at row 1 +INSERT INTO Sow6_2f VALUES (11); +INSERT INTO Sow6_2f VALUES (101.55); +ERROR 22003: Out of range value adjusted for column 'col1' at row 1 +UPDATE Sow6_2f SET col1 = col1 * 50 WHERE col1 = 11; +ERROR 22003: Out of range value adjusted for column 'col1' at row 5 +UPDATE Sow6_2f SET col1 = col1 / 0 WHERE col1 > 0; +ERROR 22012: Division by 0 +SELECT MOD(col1,0) FROM Sow6_2f; +MOD(col1,0) +NULL +NULL +NULL +NULL +NULL +Warnings: +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +Error 1365 Division by 0 +INSERT INTO Sow6_2f VALUES ('a59b'); +ERROR HY000: Incorrect decimal value: 'a59b' for column 'col1' at row 1 +drop table Sow6_2f; diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result index 1a66f0d91d2..e553d9d86f2 100644 --- a/mysql-test/r/type_ranges.result +++ b/mysql-test/r/type_ranges.result @@ -87,6 +87,8 @@ DROP INDEX test ON t1; insert into t1 values (10, 1,1,1,1,1,1,1,1,1,1,1,1,1,NULL,0,0,0,1,1,1,1,'one','one'); insert into t1 values (NULL,2,2,2,2,2,2,2,2,2,2,2,2,2,NULL,NULL,NULL,NULL,NULL,NULL,2,2,'two','two,one'); insert into t1 values (0,1/3,3,3,3,3,3,3,3,3,3,3,3,3,NULL,'19970303','10:10:10','19970303101010','','','','3',3,3); +Warnings: +Warning 1265 Data truncated for column 'string' at row 1 insert into t1 values (0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,NULL,19970807,080706,19970403090807,-1,-1,-1,'-1',-1,-1); Warnings: Warning 1264 Out of range value adjusted for column 'utiny' at row 1 @@ -122,7 +124,7 @@ select auto,string,tiny,short,medium,long_int,longlong,real_float,real_double,ut auto string tiny short medium long_int longlong real_float real_double utiny ushort umedium ulong ulonglong mod(floor(time_stamp/1000000),1000000)-mod(curdate(),1000000) date_field time_field date_time blob_col tinyblob_col mediumblob_col longblob_col 10 1 1 1 1 1 1 1.0 1.0000 1 00001 1 1 1 0 0000-00-00 00:00:00 0000-00-00 00:00:00 1 1 1 1 11 2 2 2 2 2 2 2.0 2.0000 2 00002 2 2 2 0 NULL NULL NULL NULL NULL 2 2 -12 0.33 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 +12 0.33333333 3 3 3 3 3 3.0 3.0000 3 00003 3 3 3 0 1997-03-03 10:10:10 1997-03-03 10:10:10 3 13 -1 -1 -1 -1 -1 -1 -1.0 -1.0000 0 00000 0 0 18446744073709551615 0 1997-08-07 08:07:06 1997-04-03 09:08:07 -1 -1 -1 -1 14 -429496729 -128 -32768 -8388608 -2147483648 -4294967295 -4294967296.0 -4294967295.0000 0 00000 0 0 18446744069414584321 0 0000-00-00 00:00:00 0000-00-00 00:00:00 -4294967295 -4294967295 -4294967295 -4294967295 15 4294967295 127 32767 8388607 2147483647 4294967295 4294967296.0 4294967295.0000 255 65535 16777215 4294967295 4294967295 0 0000-00-00 00:00:00 0000-00-00 00:00:00 4294967295 4294967295 4294967295 4294967295 @@ -174,7 +176,7 @@ Warning 1265 Data truncated for column 'new_field' at row 7 select * from t2; auto string mediumblob_col new_field 1 2 2 ne -2 0.33 ne +2 0.33333333 ne 3 -1 -1 ne 4 -429496729 -4294967295 ne 5 4294967295 4294967295 ne @@ -268,7 +270,7 @@ drop table t2; create table t2 (primary key (auto)) select auto+1 as auto,1 as t1, 'a' as t2, repeat('a',256) as t3, binary repeat('b',256) as t4, repeat('a',4096) as t5, binary repeat('b',4096) as t6, '' as t7, binary '' as t8 from t1; show full columns from t2; Field Type Collation Null Key Default Extra Privileges Comment -auto bigint(17) unsigned NULL NO PRI 0 select,insert,update,references +auto int(6) unsigned NULL NO PRI 0 select,insert,update,references t1 bigint(1) NULL NO 0 select,insert,update,references t2 varchar(1) latin1_swedish_ci NO select,insert,update,references t3 varchar(256) latin1_swedish_ci NO select,insert,update,references diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result index cdae2cd1bcf..5a60ef8abfb 100644 --- a/mysql-test/r/union.result +++ b/mysql-test/r/union.result @@ -565,7 +565,7 @@ a show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` double(53,1) NOT NULL default '0.0' + `a` decimal(20,1) NOT NULL default '0.0' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; create table t2 (it1 tinyint, it2 tinyint not null, i int not null, ib bigint, f float, d double, y year, da date, dt datetime, sc char(10), sv varchar(10), b blob, tx text); @@ -788,11 +788,11 @@ create table t3 select * from t2 union select * from t1; select * from t3; d 1.234567800 -100000000.0 +100000000.000000000 show create table t3; Table Create Table t3 CREATE TABLE `t3` ( - `d` decimal(10,9) default NULL + `d` decimal(19,9) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1,t2,t3; create table t1 select 1 union select -1; diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 1659a9dddb5..57b73a0515e 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -500,14 +500,15 @@ t1 CREATE TABLE `t1` ( `c5` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; -set @arg00= 8, @arg01= 8.8, @arg02= 'a string'; -create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; +set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0; +create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `c1` bigint(20) default NULL, - `c2` double default NULL, - `c3` longtext + `c2` decimal(64,30) default NULL, + `c3` longtext, + `c4` double default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index 64db0a2509f..21f07317159 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -448,7 +448,7 @@ create view v1 as select a+1 from t1; create table t2 select * from v1; show columns from t2; Field Type Null Key Default Extra -a+1 bigint(17) YES NULL +a+1 bigint(12) YES NULL select * from t2; a+1 2 diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test index 87e456baba7..fed3ff07a13 100644 --- a/mysql-test/t/case.test +++ b/mysql-test/t/case.test @@ -58,7 +58,10 @@ CREATE TABLE t1 SELECT CASE WHEN 1 THEN 1.0 ELSE 'a' END AS c6, CASE WHEN 1 THEN 1 ELSE 1.0 END AS c7, CASE WHEN 1 THEN 1.0 ELSE 1 END AS c8, - CASE WHEN 1 THEN 1.0 END AS c9 + CASE WHEN 1 THEN 1.0 END AS c9, + CASE WHEN 1 THEN 0.1e1 else 0.1 END AS c10, + CASE WHEN 1 THEN 0.1e1 else 1 END AS c11, + CASE WHEN 1 THEN 0.1e1 else '1' END AS c12 ; SHOW CREATE TABLE t1; DROP TABLE t1; diff --git a/mysql-test/t/func_equal.test b/mysql-test/t/func_equal.test index cbf589ffcc2..f446e277c92 100644 --- a/mysql-test/t/func_equal.test +++ b/mysql-test/t/func_equal.test @@ -11,10 +11,12 @@ drop table if exists t1,t2; # First some simple tests # -select 0<=>0,0.0<=>0.0,"A"<=>"A",NULL<=>NULL; +select 0<=>0,0.0<=>0.0,0E0=0E0,"A"<=>"A",NULL<=>NULL; select 1<=>0,0<=>NULL,NULL<=>0; select 1.0<=>0.0,0.0<=>NULL,NULL<=>0.0; select "A"<=>"B","A"<=>NULL,NULL<=>"A"; +select 0<=>0.0, 0.0<=>0E0, 0E0<=>"0", 10.0<=>1E1, 10<=>10.0, 10<=>1E1; +select 1.0<=>0E1,10<=>NULL,NULL<=>0.0, NULL<=>0E0; # # Test with tables diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test index 4b74dcbe1fb..3f19c7f0c52 100644 --- a/mysql-test/t/mysqldump.test +++ b/mysql-test/t/mysqldump.test @@ -14,7 +14,7 @@ DROP TABLE t1; # Bug #2005 # -CREATE TABLE t1 (a decimal(240, 20)); +CREATE TABLE t1 (a decimal(64, 20)); INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"), ("0987654321098765432109876543210987654321"); --exec $MYSQL_DUMP --compact test t1 diff --git a/mysql-test/t/strict.test b/mysql-test/t/strict.test index df3f6b49f84..2c15edb5fc3 100644 --- a/mysql-test/t/strict.test +++ b/mysql-test/t/strict.test @@ -388,9 +388,7 @@ INSERT INTO t1 VALUES(-9223372036854775808,0),(0,0),(9223372036854775807,1844674 INSERT INTO t1 VALUES('-9223372036854775808','0'),('9223372036854775807','18446744073709551615'); INSERT INTO t1 VALUES(-9223372036854774000.0,0.0),(9223372036854775700.0,1844674407370954000.0); -# The following should give an error, but doesn't until we fix the interface -# for Field_longlong::store() - +-- error 1264 INSERT INTO t1 (col1) VALUES(-9223372036854775809); INSERT INTO t1 (col1) VALUES(9223372036854775808); INSERT INTO t1 (col2) VALUES(-1); @@ -449,7 +447,9 @@ INSERT INTO t1 VALUES ('10.55'),('10.5555'),('-10.55'),('-10.5555'),('11'),('1e+ -- The 2 following inserts should generate a warning, but doesn't yet -- because NUMERIC works like DECIMAL +--error 1264 INSERT INTO t1 VALUES (101.55); +--error 1264 INSERT INTO t1 VALUES (101); --error 1264 INSERT INTO t1 VALUES (-101.55); @@ -459,7 +459,9 @@ INSERT INTO t1 VALUES (1010.55); INSERT INTO t1 VALUES (1010); -- The 2 following inserts should generate a warning, but doesn't yet -- because NUMERIC works like DECIMAL +--error 1264 INSERT INTO t1 VALUES ('101.55'); +--error 1264 INSERT INTO t1 VALUES ('101'); --error 1264 INSERT INTO t1 VALUES ('-101.55'); @@ -475,11 +477,13 @@ UPDATE t1 SET col1 =col1 * 50000 WHERE col1 =11; UPDATE t1 SET col1 =col1 / 0 WHERE col1 > 0; --error 1365 UPDATE t1 SET col1= MOD(col1,0) WHERE col1 > 0; ---error 1265 +#--error 1265 +--error 1366 INSERT INTO t1 (col1) VALUES (''); ---error 1265 +#--error 1265 +--error 1366 INSERT INTO t1 (col1) VALUES ('a59b'); ---error 1265 +#--error 1265 INSERT INTO t1 (col1) VALUES ('1a'); INSERT IGNORE INTO t1 (col1) VALUES ('2a'); INSERT IGNORE INTO t1 values (1/0); diff --git a/mysql-test/t/sum_distinct.test b/mysql-test/t/sum_distinct.test index efbb21a7b85..964da9defa6 100644 --- a/mysql-test/t/sum_distinct.test +++ b/mysql-test/t/sum_distinct.test @@ -2,7 +2,7 @@ # Various tests for SUM(DISTINCT ...) # --disable_warnings -DROP TABLE IF EXISTS t1; +DROP TABLE IF EXISTS t1, t2; --enable_warnings CREATE TABLE t1 ( diff --git a/mysql-test/t/type_float.test b/mysql-test/t/type_float.test index 80eff1f2859..4f40d97743a 100644 --- a/mysql-test/t/type_float.test +++ b/mysql-test/t/type_float.test @@ -84,6 +84,7 @@ drop table t1; # create table t1 (c20 char); insert into t1 values (5000.0); +insert into t1 values (0.5e4); drop table t1; # Errors diff --git a/mysql-test/t/type_newdecimal.test b/mysql-test/t/type_newdecimal.test new file mode 100644 index 00000000000..3922a0448e9 --- /dev/null +++ b/mysql-test/t/type_newdecimal.test @@ -0,0 +1,873 @@ +--disable_warnings +drop table if exists t1; +--enable_warnings +# +# constant IN function test +# +select 1.1 IN (1.0, 1.2); +select 1.1 IN (1.0, 1.2, 1.1, 1.4, 0.5); +select 1.1 IN (1.0, 1.2, NULL, 1.4, 0.5); +select 0.5 IN (1.0, 1.2, NULL, 1.4, 0.5); +select 1 IN (1.11, 1.2, 1.1, 1.4, 1, 0.5); +select 1 IN (1.11, 1.2, 1.1, 1.4, NULL, 0.5); + +# +# case function test +# +select case 1.0 when 0.1 then "a" when 1.0 then "b" else "c" END; +select case 0.1 when 0.1 then "a" when 1.0 then "b" else "c" END; +select case 1 when 0.1 then "a" when 1.0 then "b" else "c" END; +select case 1.0 when 0.1 then "a" when 1 then "b" else "c" END; +select case 1.001 when 0.1 then "a" when 1 then "b" else "c" END; + +# +# non constant IN test +# +create table t1 (a decimal(6,3)); +insert into t1 values (1.0), (NULL), (0.1); +select * from t1; +select 0.1 in (1.0, 1.2, 1.1, a, 1.4, 0.5) from t1; +drop table t1; + +# +# if function test +# +create table t1 select if(1, 1.1, 1.2), if(0, 1.1, 1.2), if(0.1, 1.1, 1.2), if(0, 1, 1.1), if(0, NULL, 1.2), if(1, 0.22e1, 1.1), if(1E0, 1.1, 1.2); +select * from t1; +show create table t1; +drop table t1; + +# +# NULLIF +# +create table t1 select nullif(1.1, 1.1), nullif(1.1, 1.2), nullif(1.1, 0.11e1), nullif(1.0, 1), nullif(1, 1.0), nullif(1, 1.1); +select * from t1; +show create table t1; +drop table t1; + +# +# saving in decimal field with overflow +# + +create table t1 (a decimal(4,2)); +insert into t1 value (10000), (1.1e10), ("11111"), (100000.1); +insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1); +select a from t1; +drop table t1; +create table t1 (a decimal(4,2) unsigned); +insert into t1 value (10000), (1.1e10), ("11111"), (100000.1); +insert into t1 value (-10000), (-1.1e10), ("-11111"), (-100000.1); +select a from t1; +drop table t1; + + +# +# saving in field with overflow from decimal +# +create table t1 (a bigint); +insert into t1 values (18446744073709551615.0); +insert into t1 values (9223372036854775808.0); +insert into t1 values (-18446744073709551615.0); +select * from t1; +drop table t1; +create table t1 (a bigint unsigned); +insert into t1 values (18446744073709551615.0); +insert into t1 values (9223372036854775808.0); +insert into t1 values (9999999999999999999999999.000); +insert into t1 values (-1.0); +select * from t1; +drop table t1; +create table t1 (a tinyint); +insert into t1 values (18446744073709551615.0); +insert into t1 values (9223372036854775808.0); +select * from t1; +drop table t1; + +# +# test that functions create decimal fields +# +create table t1 select round(15.4,-1), truncate(-5678.123451,-3), abs(-1.1), -(-1.1); +show create table t1; +drop table t1; + +# +# conversion from ucs2 +# +CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3)); +INSERT INTO t1 VALUES ("1.1", 0), ("2.1", 0); +update t1 set b=a; +SELECT * FROM t1; +DROP TABLE t1; + +# +# Trydy's tests +# +set session sql_mode='traditional'; +select 1e10/0e0; +create table wl1612 (col1 int, col2 decimal(38,10), col3 numeric(38,10)); +insert into wl1612 values(1,12345678901234567890.1234567890,12345678901234567890.1234567890); +select * from wl1612; +insert into wl1612 values(2,01234567890123456789.0123456789,01234567890123456789.0123456789); +select * from wl1612 where col1=2; +insert into wl1612 values(3,1234567890123456789012345678.0123456789,1234567890123456789012345678.0123456789); +select * from wl1612 where col1=3; + +select col1/0 from wl1612; +select col2/0 from wl1612; +select col3/0 from wl1612; + +insert into wl1612 values(5,5000.0005,5000.0005); +insert into wl1612 values(6,5000.0005,5000.0005); +select sum(col2),sum(col3) from wl1612; +#select avg(col2),avg(col3) from wl1612; + +insert into wl1612 values(7,500000.000005,500000.000005); +insert into wl1612 values(8,500000.000005,500000.000005); +select sum(col2),sum(col3) from wl1612 where col1>4; +#select avg(col2),avg(col3) from wl1612 where col1>4; + +#insert into wl1612 (col1,col2) values(9,123456789012345678901234567890); +#insert into wl1612 (col1,col3) values(9,123456789012345678901234567890); + +insert into wl1612 (col1, col2) values(9,1.01234567891); +insert into wl1612 (col1, col2) values(10,1.01234567894); +insert into wl1612 (col1, col2) values(11,1.01234567895); +insert into wl1612 (col1, col2) values(12,1.01234567896); +select col1,col2 from wl1612 where col1>8; + +insert into wl1612 (col1, col3) values(13,1.01234567891); +insert into wl1612 (col1, col3) values(14,1.01234567894); +insert into wl1612 (col1, col3) values(15,1.01234567895); +insert into wl1612 (col1, col3) values(16,1.01234567896); +select col1,col3 from wl1612 where col1>12; + +select col1 from wl1612 where col1>4 and col2=1.01234567891; +#-- should return 0 rows +# +select col1 from wl1612 where col1>4 and col2=1.0123456789; +#-- should return col1 values 9 & 10 +# +select col1 from wl1612 where col1>4 and col2<>1.0123456789; +#-- should return col1 values 5,6,7,8,11,12 +# +select col1 from wl1612 where col1>4 and col2<1.0123456789; +#-- should return 0 rows +# +select col1 from wl1612 where col1>4 and col2<=1.0123456789; +#-- should return col1 values 9 & 10 +# +select col1 from wl1612 where col1>4 and col2>1.0123456789; +#-- should return col1 values 5,6,7,8,11,12 +# +select col1 from wl1612 where col1>4 and col2>=1.0123456789; +#-- should return col1 values 5,6,7,8,910,11,12 +# +#select col1, col2 from wl1612 where col1=11 or col1=12; +select col1 from wl1612 where col1>4 and col2=1.012345679; +#-- should return col1 values 11,12 +# +select col1 from wl1612 where col1>4 and col2<>1.012345679; +#-- should return col1 values 5,6,7,8,9,10 +# +select col1 from wl1612 where col1>4 and col3=1.01234567891; +#-- should return 0 rows +# +select col1 from wl1612 where col1>4 and col3=1.0123456789; +#-- should return col1 values 13,14 +# +select col1 from wl1612 where col1>4 and col3<>1.0123456789; +#-- should return col1 values 5,6,7,8,15,16 +# +select col1 from wl1612 where col1>4 and col3<1.0123456789; +#-- should return 0 rows +# +select col1 from wl1612 where col1>4 and col3<=1.0123456789; +#-- should return col1 values 13,14 +# +select col1 from wl1612 where col1>4 and col3>1.0123456789; +#-- should return col1 values 5,6,7,8,15,16 +# +select col1 from wl1612 where col1>4 and col3>=1.0123456789; +#-- should return col1 values 5,6,7,8,13,14,15,16 +# +select col1 from wl1612 where col1>4 and col3=1.012345679; +#-- should return col1 values 15,16 +# +select col1 from wl1612 where col1>4 and col3<>1.012345679; +#-- should return col1 values 5,6,7,8,13,14 +# +drop table wl1612; +# +select 1/3; +# +select 0.8=0.7+0.1; +#-- should return 1 (true) +# +select 0.7+0.1; +# +create table wl1612_1 (col1 int); +insert into wl1612_1 values(10); +# +select * from wl1612_1 where 0.8=0.7+0.1; +#--should return 1 row (col1=10) +# +select 0.07+0.07 from wl1612_1; +# +select 0.07-0.07 from wl1612_1; +# +select 0.07*0.07 from wl1612_1; +# +select 0.07/0.07 from wl1612_1; +# +drop table wl1612_1; +# +create table wl1612_2 (col1 decimal(10,2), col2 numeric(10,2)); +insert into wl1612_2 values(1,1); +insert into wl1612_2 values(+1,+1); +insert into wl1612_2 values(+01,+01); +insert into wl1612_2 values(+001,+001); +# +select col1,count(*) from wl1612_2 group by col1; +# +select col2,count(*) from wl1612_2 group by col2; +# +drop table wl1612_2; +# +create table wl1612_3 (col1 decimal(10,2), col2 numeric(10,2)); +insert into wl1612_3 values('1','1'); +insert into wl1612_3 values('+1','+1'); +# +insert into wl1612_3 values('+01','+01'); +insert into wl1612_3 values('+001','+001'); +# +select col1,count(*) from wl1612_3 group by col1; +# +select col2,count(*) from wl1612_3 group by col2; +# +drop table wl1612_3; +# +select mod(234,10) ; +#-- should return 4 +# +select mod(234.567,10.555); +#-- should return 2.357 +# +select mod(-234.567,10.555); +#-- should return -2.357 +# +select mod(234.567,-10.555); +#-- should return 2.357 +# +select round(15.1); +#-- should return 15 +# +select round(15.4); +#-- should return 15 +# +select round(15.5); +#-- should return 16 +# +select round(15.6); +#-- should return 16 +# +select round(15.9); +#-- should return 16 +# +select round(-15.1); +#-- should return -15 +# +select round(-15.4); +#-- should return -15 +# +select round(-15.5); +#-- should return -16 +# +select round(-15.6); +#-- should return -16 +# +select round(-15.9); +#-- should return -16 +# +select round(15.1,1); +#-- should return 15.1 +# +select round(15.4,1); +#-- should return 15.4 +# +select round(15.5,1); +#-- should return 15.5 +# +select round(15.6,1); +#-- should return 15.6 +# +select round(15.9,1); +#-- should return 15.9 +# +select round(-15.1,1); +#-- should return -15.1 +# +select round(-15.4,1); +#-- should return -15.4 +# +select round(-15.5,1); +#-- should return -15.5 +# +select round(-15.6,1); +#-- should return -15.6 +# +select round(-15.9,1); +#-- should return -15.9 +# +select round(15.1,0); +#-- should return 15 +# +select round(15.4,0); +#-- should return 15 +# +select round(15.5,0); +#-- should return 16 +# +select round(15.6,0); +#-- should return 16 +# +select round(15.9,0); +#-- should return 16 +# +select round(-15.1,0); +#-- should return -15 +# +select round(-15.4,0); +#-- should return -15 +# +select round(-15.5,0); +#-- should return -16 +# +select round(-15.6,0); +#-- should return -16 +# +select round(-15.9,0); +#-- should return -16 +# +select round(15.1,-1); +#-- should return 20 +# +select round(15.4,-1); +#-- should return 20 +# +select round(15.5,-1); +#-- should return 20 +# +select round(15.6,-1); +#-- should return 20 +# +select round(15.9,-1); +#-- should return 20 +# +select round(-15.1,-1); +#-- should return -20 +# +select round(-15.4,-1); +#-- should return -20 +# +select round(-15.5,-1); +#-- should return -20 +# +select round(-15.6,-1); +#-- should return -20 +# +select round(-15.91,-1); +#-- should return -20 +# +select truncate(5678.123451,0); +#-- should return 5678 +# +select truncate(5678.123451,1); +#-- should return 5678.1 +# +select truncate(5678.123451,2); +#-- should return 5678.12 +# +select truncate(5678.123451,3); +#-- should return 5678.123 +# +select truncate(5678.123451,4); +#-- should return 5678.1234 +# +select truncate(5678.123451,5); +#-- should return 5678.12345 +# +select truncate(5678.123451,6); +#-- should return 5678.123451 +# +select truncate(5678.123451,-1); +#-- should return 5670 +# +select truncate(5678.123451,-2); +#-- should return 5600 +# +select truncate(5678.123451,-3); +#-- should return 5000 +# +select truncate(5678.123451,-4); +#-- should return 0 +# +select truncate(-5678.123451,0); +#-- should return -5678 +# +select truncate(-5678.123451,1); +#-- should return -5678.1 +# +select truncate(-5678.123451,2); +#-- should return -5678.12 +# +select truncate(-5678.123451,3); +#-- should return -5678.123 +# +select truncate(-5678.123451,4); +#-- should return -5678.1234 +# +select truncate(-5678.123451,5); +#-- should return -5678.12345 +# +select truncate(-5678.123451,6); +#-- should return -5678.123451 +# +select truncate(-5678.123451,-1); +#-- should return -5670 +# +select truncate(-5678.123451,-2); +#-- should return -5600 +# +select truncate(-5678.123451,-3); +#-- should return -5000 +# +select truncate(-5678.123451,-4); +#-- should return 0 +# +#drop table if exists wl1612_4; +create table wl1612_4 (col1 int, col2 decimal(30,25), col3 numeric(30,25)); +# +insert into wl1612_4 values(1,0.0123456789012345678912345,0.0123456789012345678912345); +# +select col2/9999999999 from wl1612_4 where col1=1; +# +select col3/9999999999 from wl1612_4 where col1=1; +# +select 9999999999/col2 from wl1612_4 where col1=1; +# +select 9999999999/col3 from wl1612_4 where col1=1; +# +select col2*9999999999 from wl1612_4 where col1=1; +# +select col3*9999999999 from wl1612_4 where col1=1; +# +insert into wl1612_4 values(2,55555.0123456789012345678912345,55555.0123456789012345678912345); +# +select col2/9999999999 from wl1612_4 where col1=2; +# +select col3/9999999999 from wl1612_4 where col1=2; +# +select 9999999999/col2 from wl1612_4 where col1=2; +# +select 9999999999/col3 from wl1612_4 where col1=2; +# +select col2*9999999999 from wl1612_4 where col1=2; +# +select col3*9999999999 from wl1612_4 where col1=2; +# +drop table wl1612_4; +# +# +# +# +#-- Additional tests for WL#1612 Precision math +# +#-- 1. Comparisons should show that a number is +#-- exactly equal to its value as displayed. +# +set sql_mode=''; +# +select 23.4 + (-41.7), 23.4 - (41.7) = -18.3; +# +select -18.3=-18.3; +# +select 18.3=18.3; +# +select -18.3=18.3; +# +select 0.8 = 0.7 + 0.1; +# +#-- 2. Adding (one millionth) one million times should be the same as +#-- adding 1. So a stored procedure with many iterations will show if +#-- small errors accumulate. +# +#drop procedure p1; +# +delimiter // +# +create procedure p1 () begin + declare v1, v2, v3, v4 decimal(16,12); declare v5 int; + set v1 = 1; set v2 = 2; set v3 = 1000000000000; set v4 = 2000000000000; set v5 = 0; + while v5 < 100000 do + set v1 = v1 + 0.000000000001; set v2 = v2 - 0.000000000001; set v3 = v3 + 1; set v4 = v4 - 1; set v5 = v5 + 1; + end while; select v1, v2, v3 * 0.000000000001, v4 * 0.000000000001; end;// +# +call p1()// +#-- should return +# -- v1=1.0000001 +# -- v2=1.999999900000 +# -- v3=1.0000001 +# -- v4=1.999999900000 +# +delimiter ;// +# +drop procedure p1; +# +#-- 3. It should be possible to define a column +#-- with up to 38 digits precision either before +#-- or after the decimal point. Any number which +#-- is inserted, if it's within the range, should +#-- be exactly the same as the number that gets +#-- selected. +# +drop table if exists t1; +# +create table t1 (col1 decimal(38)); +# +insert into t1 values (12345678901234567890123456789012345678); +# +select * from t1; +#-- should return: +#+----------------------------------------+ +#| col1 | +#+----------------------------------------+ +#| 12345678901234567890123456789012345678 | +#+----------------------------------------+ +# +#drop table t1; +# +#create table t1 (col1 decimal(38,38)); +# +#insert into t1 values (.12345678901234567890123456789012345678); +# +#select * from t1; +#-- should return: +#+------------------------------------------+ +#| col1 | +#+------------------------------------------+ +#| 0.12345678901234567890123456789012345678 | +#+------------------------------------------+ +# +drop table t1; +# +create table t1 (col1 decimal(31,30)); +# +insert into t1 values (0.00000000001); +# +select * from t1; +#-- should return: +#+---------------+ +#|col1 | +#+---------------+ +#| 0.00000000001 | +#+---------------+ +# +drop table t1; +# +#-- 4. The usual arithmetic operators / * + - should work. +# +#select 77777777777777777777777777777777777777 / 7777777777777777777777777777777777777 = 10; +#-- should return 0 (false). +# +select 7777777777777777777777777777777777777 * 10; +#-- should return 77777777777777777777777777777777777770 +# +select .7777777777777777777777777777777777777 * + 1000000000000000000; +#-- should return 777777777777777777.7777777777777777777 +# +select .7777777777777777777777777777777777777 - 0.1; +#-- should return .6777777777777777777777777777777777777 +# +select .343434343434343434 + .343434343434343434; +#-- should return .686868686868686868 +# +#-- 5. All arithmetic functions mentioned in the +#MySQL Reference Manual should work. +# +select abs(9999999999999999999999); +#-- should return 9999999999999999999999 +# +select abs(-9999999999999999999999); +#-- should return 9999999999999999999999 +# +select ceiling(99999999999999999999); +#-- should return 99999999999999999999 +# +select ceiling(9.9999999999999999999); +#-- should return 10 +# +select ceiling(-9.9999999999999999999); +#-- should return 9 +# +select floor(9999999999999999999999); +#-- should return 9999999999999999999999 +# +select floor(9.999999999999999999999); +#-- should return 9 +# +select floor(-9.999999999999999999999); +#-- should return -10 +# +select floor(-999999999999999999999.999); +select ceiling(999999999999999999999.999); +# +# +select 99999999999999999999999999999999999999 mod 3; +#-- should return 0 +# +select round(99999999999999999.999); +#-- should return 100000000000000000 +# +select round(-99999999999999999.999); +#-- should return -100000000000000000 +# +select round(99999999999999999.999,3); +#-- should return 100000000000000000.000 +# +select round(-99999999999999999.999,3); +#-- should return -100000000000000000.000 +# +select truncate(99999999999999999999999999999999999999,31); +#-- should return 99999999999999999999999999999999999999.000 +# +select truncate(99.999999999999999999999999999999999999,31); +#-- should return 99.9999999999999999999999999999999 +# +select truncate(99999999999999999999999999999999999999,-31); +-- should return 90000000000000000000000000000000 +# +#-- 6. Set functions (AVG, SUM, COUNT) should work. +# +#drop table if exists t1; +# +#delimiter // +# +#create procedure p1 () begin +# declare v1 int default 1; declare v2 decimal(0,38) default 0; +# create table t1 (col1 decimal(0,38)); +# while v1 <= 10000 do +# insert into t1 values (-v2); +# set v2 = v2 + 0.00000000000000000000000000000000000001; +# set v1 = v1 + 1; +# end while; +# select avg(col1),sum(col1),count(col1) from t1; end;// +# +#call p1()// +#-- should return +# -- avg(col1)=0.00000000000000000000000000000000000001 added 10,000 times, then divided by 10,000 +# -- sum(col1)=0.00000000000000000000000000000000000001 added 10,000 times +# +# -- count(col1)=10000 +# +#delimiter ;// +# +#drop procedure p1; +#drop table t1; +# +#-- 7. When I say DECIMAL(x) I should be able to store x digits. +#-- If I can't, there should be an error at CREATE time. +# +#drop table if exists t1; +# +#create table t1 (col1 decimal(254)); +#-- should return SQLSTATE 22003 numeric value out of range +# +#-- 8. When I say DECIMAL(x,y) there should be no silent change of precision or scale. +# +#drop table if exists t1; +# +#create table t1 (col1 decimal(0,38)); +# +#show create table t1; +#-- should return: +#+-------+--------------------------------+ +#| Table | Create Table | +#+-------+--------------------------------+ +#| t9 | CREATE TABLE `t1` ( | +#|`s1` decimal(0,38) default NULL | +#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +#+-------+--------------------------------+ +# +#drop table t1; +# +#-- 9. From WL#1612 "The future" point 2.: +#-- The standard requires that we treat numbers like "0.5" as +#-- DECIMAL or NUMERIC, not as floating-point. +# +#drop table if exists t1; +# +# +create table t1 as select 0.5; +# +show create table t1; +#-- should return: +#+-------+-----------------------------------+ +#| Table | Create Table | +#+-------+-----------------------------------+ +#| t7 | CREATE TABLE `t1` ( | +#| `0.5` decimal(3,1) NOT NULL default '0.0' | +#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +#+-------+-----------------------------------+ +# +drop table t1; +# +#-- 10. From WL#1612, "The future", point 3.: We have to start rounding correctly. +# +select round(1.5),round(2.5); +#-- should return: +#+------------+------------+ +#| round(1.5) | round(2.5) | +#+------------+------------+ +#| 2 | 3 | +#+------------+------------+ +# +#-- 11. From WL#1612, "The future", point 4.: "select 0.07 * 0.07;" should return 0.0049, not 0.00. +#-- If operand#1 has scale X and operand#2 has scale Y, then result should have scale (X+Y). +# +select 0.07 * 0.07; +#-- should return 0.0049 +# +#-- 12. From WL#1612, "The future", point 5.: Division by zero is an error. +# +set sql_mode='traditional'; +# +select 1E-500 = 0; +#-- should return 1 (true). +# +select 1 / 1E-500; +# +#-- should return SQLSTATE 22012 division by zero. +# +select 1 / 0; +#-- should return SQLSTATE 22012 division by zero. +# +#+-------+ +#| 1 / 0 | +#+-------+ +#| NULL | +#+-------+ +#1 row in set, 1 warning (0.00 sec) +# +#-- 13. From WL#1612 "The future" point 6.: Overflow is an error. +# +#set sql_mode=''; +# +#select 1E300 * 1E300; +#-- should return SQLSTATE 22003 numeric value out of range +# +#select 18446744073709551615 + 1; +#-- should return SQLSTATE 22003 numeric value out of range +# +#-- 14. From WL#1612 "The future" point 7.: +#-- If s1 is INTEGER and s2 is DECIMAL, then +#-- "create table tk7 as select avg(s1),avg(s2) from tk;" +#-- should not create a table with "double(17,4)" data types. +#-- The result of AVG must still be exact numeric, with a +#-- scale the same or greater than the operand's scale. +#-- The result of SUM must still be exact numeric, with +#-- a scale the same as the operand's scale. +# +#drop table if exists t1; +#drop table if exists t2; +# +#create table t1 (col1 int, col2 decimal(5)); +# +#create table t2 as select avg(col1),avg(col2) from t1; +# +# +#show create table t2; +#-- should return: +#+-------+---------------------------------+ +#| Table | Create Table | +#+-------+---------------------------------+ +#| t2 | CREATE TABLE `t2` ( | +#| `avg(col1)` decimal(17,4) default NULL, | +#| `avg(col2)` decimal(17,5) default NULL | +#| ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +#+-------+---------------------------------+ +# +#drop table t2; +#drop table t1; +# +#-- 15. From WL#1612 "The future" point 8.: Stop storing leading "+" signs and leading "0"s. +# +#drop table if exists t1; +# +#create table t1 (col1 decimal(5,2),col2 decimal(5) zerofill, col3 decimal(3,1)); +# +#insert into t1 values (1,1,1); +# +#select col1 from t1 union select col2 from t1 union select col3 from t1; +# +#drop table t1; +# +#-- 16. From WL#1612, The future" point 9.: +#-- Accept the data type and precision and scale as the user +#-- asks, or return an error, but don't change to something else. +# +#drop table if exists t1; +# +#create table t1 (col1 numeric(4,2)); +# +#show create table t1; +# +#drop table t1; +# +#-- 17. The scripts in the following bugs should work: +# + +#BUG#559 Maximum precision for DECIMAL column ... +#BUG#1499 INSERT/UPDATE into decimal field rounding problem +#BUG#1845 Not correctly recognising value for decimal field +#BUG#2493 Round function doesn't work correctly +#BUG#2649 round(0.5) gives 0 (should be 1) +#BUG#3612 impicite rounding of VARCHARS during aritchmetic operations... +#BUG#3722 SELECT fails for certain values in Double(255,10) column. +#BUG#4485 Floating point conversions are inconsistent +#BUG#4891 MATH +#BUG#5931 Out-of-range values are accepted +#BUG#6048 Stored procedure causes operating system reboot +#BUG#6053 DOUBLE PRECISION literal + +-- 18. Tests from 'traditional' mode tests +# +set sql_mode='ansi,traditional'; +# +CREATE TABLE Sow6_2f (col1 NUMERIC(4,2)); +#-- should return OK +INSERT INTO Sow6_2f VALUES (10.55); +#-- should return OK +INSERT INTO Sow6_2f VALUES (10.5555); +#-- should return OK +INSERT INTO Sow6_2f VALUES (-10.55); +#-- should return OK +INSERT INTO Sow6_2f VALUES (-10.5555); +#-- should return OK +INSERT INTO Sow6_2f VALUES (11); +#-- should return OK +-- error 1264 +INSERT INTO Sow6_2f VALUES (101.55); +#-- should return SQLSTATE 22003 numeric value out of range +-- error 1264 +UPDATE Sow6_2f SET col1 = col1 * 50 WHERE col1 = 11; +#-- should return SQLSTATE 22003 numeric value out of range +-- error 1365 +UPDATE Sow6_2f SET col1 = col1 / 0 WHERE col1 > 0; +#-- should return SQLSTATE 22012 division by zero +SELECT MOD(col1,0) FROM Sow6_2f; +#-- should return SQLSTATE 22012 division by zero +-- error 1366 +INSERT INTO Sow6_2f VALUES ('a59b'); +#-- should return SQLSTATE 22018 invalid character value for cast +drop table Sow6_2f; diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test index 6c1ae733647..44a324de867 100644 --- a/mysql-test/t/variables.test +++ b/mysql-test/t/variables.test @@ -368,8 +368,8 @@ show create table t1; drop table t1; # # What types and widths have variables? -set @arg00= 8, @arg01= 8.8, @arg02= 'a string'; -create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3; +set @arg00= 8, @arg01= 8.8, @arg02= 'a string', @arg03= 0.2e0; +create table t1 as select @arg00 as c1, @arg01 as c2, @arg02 as c3, @arg03 as c4; show create table t1; drop table t1; |