List:Commits« Previous MessageNext Message »
From:gluh Date:April 5 2006 1:12pm
Subject:bk commit into 5.0 tree (gluh:1.2138) BUG#17048
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2138 06/04/05 18:12:35 gluh@stripped +10 -0
  Bug#17048 CREATE TABLE ... SELECT truncate values
   remove initialization of unsigned_flag for Item_decimal

  sql/item.cc
    1.214 06/04/05 18:11:02 gluh@stripped +0 -6
    Bug#17048 CREATE TABLE ... SELECT truncate values
     remove initialization of unsigned_flag for Item_decimal

  mysql-test/t/type_newdecimal.test
    1.37 06/04/05 18:11:02 gluh@stripped +7 -0
    Bug#17048 CREATE TABLE ... SELECT truncate values
     test case

  mysql-test/r/type_newdecimal.result
    1.38 06/04/05 18:11:02 gluh@stripped +12 -7
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/type_float.result
    1.46 06/04/05 18:11:02 gluh@stripped +4 -4
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/ps_5merge.result
    1.40 06/04/05 18:11:02 gluh@stripped +4 -4
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/ps_4heap.result
    1.39 06/04/05 18:11:02 gluh@stripped +2 -2
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/ps_3innodb.result
    1.43 06/04/05 18:11:01 gluh@stripped +2 -2
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/ps_2myisam.result
    1.40 06/04/05 18:11:01 gluh@stripped +2 -2
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/metadata.result
    1.14 06/04/05 18:11:01 gluh@stripped +1 -1
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

  mysql-test/r/case.result
    1.25 06/04/05 18:11:01 gluh@stripped +4 -4
    Bug#17048 CREATE TABLE ... SELECT truncate values
     result fix

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.intranet.mysql.r18.ru
# Root:	/home/gluh/MySQL/Bugs/5.0.17048

--- 1.213/sql/item.cc	Tue Apr  4 09:07:19 2006
+++ 1.214/sql/item.cc	Wed Apr  5 18:11:02 2006
@@ -1899,7 +1899,6 @@ Item_decimal::Item_decimal(const char *s
   name= (char*) str_arg;
   decimals= (uint8) decimal_value.frac;
   fixed= 1;
-  unsigned_flag= !decimal_value.sign();
   max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
                                              decimals, unsigned_flag);
 }
@@ -1909,7 +1908,6 @@ Item_decimal::Item_decimal(longlong val,
   int2my_decimal(E_DEC_FATAL_ERROR, val, unsig, &decimal_value);
   decimals= (uint8) decimal_value.frac;
   fixed= 1;
-  unsigned_flag= !decimal_value.sign();
   max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
                                              decimals, unsigned_flag);
 }
@@ -1920,7 +1918,6 @@ Item_decimal::Item_decimal(double val, i
   double2my_decimal(E_DEC_FATAL_ERROR, val, &decimal_value);
   decimals= (uint8) decimal_value.frac;
   fixed= 1;
-  unsigned_flag= !decimal_value.sign();
   max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
                                              decimals, unsigned_flag);
 }
@@ -1933,7 +1930,6 @@ Item_decimal::Item_decimal(const char *s
   name= (char*) str;
   decimals= (uint8) decimal_par;
   max_length= length;
-  unsigned_flag= !decimal_value.sign();
   fixed= 1;
 }
 
@@ -1943,7 +1939,6 @@ Item_decimal::Item_decimal(my_decimal *v
   my_decimal2decimal(value_par, &decimal_value);
   decimals= (uint8) decimal_value.frac;
   fixed= 1;
-  unsigned_flag= !decimal_value.sign();
   max_length= my_decimal_precision_to_length(decimal_value.intg + decimals,
                                              decimals, unsigned_flag);
 }
@@ -1955,7 +1950,6 @@ Item_decimal::Item_decimal(const char *b
                     &decimal_value, precision, scale);
   decimals= (uint8) decimal_value.frac;
   fixed= 1;
-  unsigned_flag= !decimal_value.sign();
   max_length= my_decimal_precision_to_length(precision, decimals,
                                              unsigned_flag);
 }

--- 1.39/mysql-test/r/ps_2myisam.result	Mon Oct 31 15:25:01 2005
+++ 1.40/mysql-test/r/ps_2myisam.result	Wed Apr  5 18:11:01 2006
@@ -1777,7 +1777,7 @@ Table	Create Table
 t5	CREATE TABLE `t5` (
   `const01` bigint(1) NOT NULL default '0',
   `param01` bigint(20) default NULL,
-  `const02` decimal(2,1) unsigned NOT NULL default '0.0',
+  `const02` decimal(2,1) NOT NULL default '0.0',
   `param02` decimal(65,30) default NULL,
   `const03` double NOT NULL default '0',
   `param03` double default NULL,
@@ -1807,7 +1807,7 @@ select * from t5 ;
 Catalog	Database	Table	Table_alias	Column	Column_alias	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	246	3	3	N	33	1	63
+def	test	t5	t5	const02	const02	246	4	3	N	1	1	63
 def	test	t5	t5	param02	param02	246	67	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	23	1	Y	32768	31	63

--- 1.42/mysql-test/r/ps_3innodb.result	Mon Oct 31 15:25:01 2005
+++ 1.43/mysql-test/r/ps_3innodb.result	Wed Apr  5 18:11:01 2006
@@ -1760,7 +1760,7 @@ Table	Create Table
 t5	CREATE TABLE `t5` (
   `const01` bigint(1) NOT NULL default '0',
   `param01` bigint(20) default NULL,
-  `const02` decimal(2,1) unsigned NOT NULL default '0.0',
+  `const02` decimal(2,1) NOT NULL default '0.0',
   `param02` decimal(65,30) default NULL,
   `const03` double NOT NULL default '0',
   `param03` double default NULL,
@@ -1790,7 +1790,7 @@ select * from t5 ;
 Catalog	Database	Table	Table_alias	Column	Column_alias	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	246	3	3	N	33	1	63
+def	test	t5	t5	const02	const02	246	4	3	N	1	1	63
 def	test	t5	t5	param02	param02	246	67	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	23	1	Y	32768	31	63

--- 1.38/mysql-test/r/ps_4heap.result	Mon Oct 31 15:25:01 2005
+++ 1.39/mysql-test/r/ps_4heap.result	Wed Apr  5 18:11:02 2006
@@ -1761,7 +1761,7 @@ Table	Create Table
 t5	CREATE TABLE `t5` (
   `const01` bigint(1) NOT NULL default '0',
   `param01` bigint(20) default NULL,
-  `const02` decimal(2,1) unsigned NOT NULL default '0.0',
+  `const02` decimal(2,1) NOT NULL default '0.0',
   `param02` decimal(65,30) default NULL,
   `const03` double NOT NULL default '0',
   `param03` double default NULL,
@@ -1791,7 +1791,7 @@ select * from t5 ;
 Catalog	Database	Table	Table_alias	Column	Column_alias	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	246	3	3	N	33	1	63
+def	test	t5	t5	const02	const02	246	4	3	N	1	1	63
 def	test	t5	t5	param02	param02	246	67	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	23	1	Y	32768	31	63

--- 1.39/mysql-test/r/ps_5merge.result	Mon Oct 31 15:25:01 2005
+++ 1.40/mysql-test/r/ps_5merge.result	Wed Apr  5 18:11:02 2006
@@ -1697,7 +1697,7 @@ Table	Create Table
 t5	CREATE TABLE `t5` (
   `const01` bigint(1) NOT NULL default '0',
   `param01` bigint(20) default NULL,
-  `const02` decimal(2,1) unsigned NOT NULL default '0.0',
+  `const02` decimal(2,1) NOT NULL default '0.0',
   `param02` decimal(65,30) default NULL,
   `const03` double NOT NULL default '0',
   `param03` double default NULL,
@@ -1727,7 +1727,7 @@ select * from t5 ;
 Catalog	Database	Table	Table_alias	Column	Column_alias	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	246	3	3	N	33	1	63
+def	test	t5	t5	const02	const02	246	4	3	N	1	1	63
 def	test	t5	t5	param02	param02	246	67	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	23	1	Y	32768	31	63
@@ -4711,7 +4711,7 @@ Table	Create Table
 t5	CREATE TABLE `t5` (
   `const01` bigint(1) NOT NULL default '0',
   `param01` bigint(20) default NULL,
-  `const02` decimal(2,1) unsigned NOT NULL default '0.0',
+  `const02` decimal(2,1) NOT NULL default '0.0',
   `param02` decimal(65,30) default NULL,
   `const03` double NOT NULL default '0',
   `param03` double default NULL,
@@ -4741,7 +4741,7 @@ select * from t5 ;
 Catalog	Database	Table	Table_alias	Column	Column_alias	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	246	3	3	N	33	1	63
+def	test	t5	t5	const02	const02	246	4	3	N	1	1	63
 def	test	t5	t5	param02	param02	246	67	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	23	1	Y	32768	31	63

--- 1.37/mysql-test/r/type_newdecimal.result	Tue Nov 29 16:42:38 2005
+++ 1.38/mysql-test/r/type_newdecimal.result	Wed Apr  5 18:11:02 2006
@@ -68,10 +68,10 @@ NULL	1.1	NULL	NULL	NULL	1
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `nullif(1.1, 1.1)` decimal(2,1) unsigned default NULL,
-  `nullif(1.1, 1.2)` decimal(2,1) unsigned default NULL,
-  `nullif(1.1, 0.11e1)` decimal(2,1) unsigned default NULL,
-  `nullif(1.0, 1)` decimal(2,1) unsigned default NULL,
+  `nullif(1.1, 1.1)` decimal(2,1) default NULL,
+  `nullif(1.1, 1.2)` decimal(2,1) default NULL,
+  `nullif(1.1, 0.11e1)` decimal(2,1) default NULL,
+  `nullif(1.0, 1)` decimal(2,1) default NULL,
   `nullif(1, 1.0)` int(1) default NULL,
   `nullif(1, 1.1)` int(1) default NULL
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
@@ -174,9 +174,9 @@ create table t1 select round(15.4,-1), t
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `round(15.4,-1)` decimal(3,0) unsigned NOT NULL default '0',
+  `round(15.4,-1)` decimal(3,0) NOT NULL default '0',
   `truncate(-5678.123451,-3)` decimal(4,0) NOT NULL default '0',
-  `abs(-1.1)` decimal(2,1) NOT NULL default '0.0',
+  `abs(-1.1)` decimal(3,1) NOT NULL default '0.0',
   `-(-1.1)` decimal(2,1) NOT NULL default '0.0'
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
@@ -771,7 +771,7 @@ create table t1 as select 0.5;
 show create table t1;
 Table	Create Table
 t1	CREATE TABLE `t1` (
-  `0.5` decimal(2,1) unsigned NOT NULL default '0.0'
+  `0.5` decimal(2,1) NOT NULL default '0.0'
 ) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 select round(1.5),round(2.5);
@@ -1396,4 +1396,9 @@ c1
 9999999999999999999999999999999999999999999999999999999999999999
 9999999999999999999999999999999999999999999999999999999999999999
 9999999999999999999999999999999999999999999999999999999999999999
+drop table t1;
+create table t1 as select cast(5 as unsigned) - 6.0;
+select * from t1;
+cast(5 as unsigned) - 6.0
+-1.0
 drop table t1;

--- 1.36/mysql-test/t/type_newdecimal.test	Thu Mar 23 11:21:12 2006
+++ 1.37/mysql-test/t/type_newdecimal.test	Wed Apr  5 18:11:02 2006
@@ -1095,3 +1095,10 @@ insert into t1 values(
 insert into t1 values(1e100);
 select * from t1;
 drop table t1;
+
+#
+# Bug#17048 CREATE TABLE ... SELECT truncate values
+#
+create table t1 as select cast(5 as unsigned) - 6.0;
+select * from t1;
+drop table t1;

--- 1.24/mysql-test/r/case.result	Tue Sep 27 20:07:20 2005
+++ 1.25/mysql-test/r/case.result	Wed Apr  5 18:11:01 2006
@@ -103,8 +103,8 @@ 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 '',
+  `c5` varbinary(4) NOT NULL default '',
+  `c6` varbinary(4) NOT NULL default '',
   `c7` decimal(2,1) NOT NULL default '0.0',
   `c8` decimal(2,1) NOT NULL default '0.0',
   `c9` decimal(2,1) default NULL,
@@ -152,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)` decimal(2,1) unsigned NOT NULL default '0.0',
+  `COALESCE(1.0)` decimal(2,1) NOT NULL default '0.0',
   `COALESCE('a')` varchar(1) NOT NULL default '',
   `COALESCE(1,1.0)` decimal(2,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;

--- 1.45/mysql-test/r/type_float.result	Wed Feb  1 18:02:30 2006
+++ 1.46/mysql-test/r/type_float.result	Wed Apr  5 18:11:02 2006
@@ -245,22 +245,22 @@ show warnings;
 Level	Code	Message
 desc  t1;
 Field	Type	Null	Key	Default	Extra
-x	decimal(21,2) unsigned	NO		0.00	
+x	decimal(21,2)	NO		0.00	
 drop table t1;
 create table t1 select 0.0 x;
 desc t1;
 Field	Type	Null	Key	Default	Extra
-x	decimal(2,1) unsigned	NO		0.0	
+x	decimal(2,1)	NO		0.0	
 create table t2 select 105213674794682365.00 y;
 desc t2;
 Field	Type	Null	Key	Default	Extra
-y	decimal(20,2) unsigned	NO		0.00	
+y	decimal(20,2)	NO		0.00	
 create table t3 select x+y a from t1,t2;
 show warnings;
 Level	Code	Message
 desc t3;
 Field	Type	Null	Key	Default	Extra
-a	decimal(21,2) unsigned	NO		0.00	
+a	decimal(21,2)	NO		0.00	
 drop table t1,t2,t3;
 create table t1 (s1 float(0,2));
 ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').

--- 1.13/mysql-test/r/metadata.result	Tue Sep 27 20:07:20 2005
+++ 1.14/mysql-test/r/metadata.result	Wed Apr  5 18:11:01 2006
@@ -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	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
 def					1	8	1	1	N	32897	0	63
-def					1.0	246	3	3	N	161	1	63
+def					1.0	246	4	3	N	129	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
Thread
bk commit into 5.0 tree (gluh:1.2138) BUG#17048gluh5 Apr