Commit 4acfc0b6 authored by unknown's avatar unknown

Fixed bug 10465.

parent 7b36ac48
...@@ -876,3 +876,12 @@ SELECT * FROM t1; ...@@ -876,3 +876,12 @@ SELECT * FROM t1;
f1 f2 f1 f2
9999999999999999999999999999999999.00000000000000000000 0.00 9999999999999999999999999999999999.00000000000000000000 0.00
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
GRADE
252
SELECT GRADE FROM t1 WHERE GRADE= 151;
GRADE
151
DROP TABLE t1;
...@@ -906,3 +906,13 @@ CREATE TABLE t1 (f1 DECIMAL (64,20), f2 DECIMAL(2,2)); ...@@ -906,3 +906,13 @@ CREATE TABLE t1 (f1 DECIMAL (64,20), f2 DECIMAL(2,2));
INSERT INTO t1 VALUES (9999999999999999999999999999999999, 0); INSERT INTO t1 VALUES (9999999999999999999999999999999999, 0);
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t1; DROP TABLE t1;
#
# Bug #10465
#
CREATE TABLE t1 (GRADE DECIMAL(4) NOT NULL, PRIMARY KEY (GRADE)) ENGINE=INNODB;
INSERT INTO t1 (GRADE) VALUES (151),(252),(343);
SELECT GRADE FROM t1 WHERE GRADE > 160 AND GRADE < 300;
SELECT GRADE FROM t1 WHERE GRADE= 151;
DROP TABLE t1;
...@@ -8060,7 +8060,12 @@ void create_field::create_length_to_internal_length(void) ...@@ -8060,7 +8060,12 @@ void create_field::create_length_to_internal_length(void)
} }
break; break;
case MYSQL_TYPE_NEWDECIMAL: case MYSQL_TYPE_NEWDECIMAL:
key_length= pack_length= my_decimal_get_binary_size(length, decimals); key_length= pack_length=
my_decimal_get_binary_size(my_decimal_length_to_precision(length,
decimals,
flags &
UNSIGNED_FLAG),
decimals);
break; break;
default: default:
key_length= pack_length= calc_pack_length(sql_type, length); key_length= pack_length= calc_pack_length(sql_type, length);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment