diff options
-rw-r--r-- | Docs/manual.texi | 6 | ||||
-rw-r--r-- | mysql-test/r/show_check.result | 16 | ||||
-rw-r--r-- | mysql-test/t/show_check.test | 14 | ||||
-rw-r--r-- | sql/sql_parse.cc | 4 |
4 files changed, 37 insertions, 3 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index bf5bb1a9d3d..0243265c506 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -46857,7 +46857,7 @@ users use this code as the rest of the code and because of this we are not yet 100% confident in this code. @menu -* News-3.23.51:: +* News-3.23.51:: Changes in release 3.23.51 * News-3.23.50:: Changes in release 3.23.50 * News-3.23.49:: Changes in release 3.23.49 * News-3.23.48:: Changes in release 3.23.48 @@ -46915,6 +46915,10 @@ not yet 100% confident in this code. @node News-3.23.51, News-3.23.50, News-3.23.x, News-3.23.x @appendixsubsec Changes in release 3.23.51 @itemize @bullet +@item +Fixed the @code{FLOAT(X+1,X)} is not converted to @code{FLOAT(X+2,X)}. +(This also affected @code{DECIMAL}, @code{DOUBLE} and @code{REAL} types) +@item Fixed the result from @code{IF()} is case in-sensitive if the 2 and third arguments are case sensitive. @end itemize diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 419b2b4ce7e..44e2b2ec1c9 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -92,3 +92,19 @@ t1 CREATE TABLE `t1` ( `a` int(11) NOT NULL default '0', PRIMARY KEY (`a`) ) TYPE=MyISAM +Field Type Null Key Default Extra +a decimal(9,2) YES NULL +b decimal(9,0) YES NULL +e double(9,2) YES NULL +f double(5,0) YES NULL +h float(3,2) YES NULL +i float(3,0) YES NULL +Field Type Null Key Default Extra +c decimal(10,0) YES NULL +d double YES NULL +f float YES NULL +r double YES NULL +Field Type Null Key Default Extra +c decimal(4,3) YES NULL +d double(4,3) YES NULL +f float(4,3) YES NULL diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 0981b85c91e..e9c7ffa6bb8 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -73,3 +73,17 @@ drop table t1; create table t1 (a int not null, primary key (a)); show create table t1; drop table t1; + +create table t1 (a decimal(9,2), b decimal (9,0), e double(9,2), f double(5,0), h float(3,2), i float(3,0)); +show columns from t1; +drop table t1; + +# Check auto conversions of types + +create table t1 (c decimal, d double, f float, r real); +show columns from t1; +drop table t1; + +create table t1 (c decimal(3,3), d double(3,3), f float(3,3)); +show columns from t1; +drop table t1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 4f9140cc3f2..06a121ea30c 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2432,9 +2432,9 @@ bool add_field_to_list(char *field_name, enum_field_types type, uint sign_len=type_modifier & UNSIGNED_FLAG ? 0 : 1; if (new_field->length && new_field->decimals && - new_field->length < new_field->decimals+2 && + new_field->length < new_field->decimals+1 && new_field->decimals != NOT_FIXED_DEC) - new_field->length=new_field->decimals+2; /* purecov: inspected */ + new_field->length=new_field->decimals+1; /* purecov: inspected */ switch (type) { case FIELD_TYPE_TINY: |