From 3769b09014610c4a5675e1ca8762ebffb74050c5 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 18 Nov 2003 15:58:27 +0200 Subject: Fix for bug when zeros are to be prepended to decimal field --- mysql-test/r/type_decimal.result | 6 ++++++ mysql-test/t/type_decimal.test | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/type_decimal.result b/mysql-test/r/type_decimal.result index b74765696a2..df5402c89a8 100644 --- a/mysql-test/r/type_decimal.result +++ b/mysql-test/r/type_decimal.result @@ -363,3 +363,9 @@ CREATE TABLE t1 (a_dec DECIMAL(-2,1)); Too big column length for column 'a_dec' (max = 255). Use BLOB instead CREATE TABLE t1 (a_dec DECIMAL(-1,1)); Too big column length for column 'a_dec' (max = 255). Use BLOB instead +create table t1(a decimal(10,4)); +insert into t1 values ("+0000100000000"); +select * from t1; +a +9999999.9999 +drop table t1; diff --git a/mysql-test/t/type_decimal.test b/mysql-test/t/type_decimal.test index 7aedc051905..14d9625710b 100644 --- a/mysql-test/t/type_decimal.test +++ b/mysql-test/t/type_decimal.test @@ -240,3 +240,9 @@ CREATE TABLE t1 (a_dec DECIMAL(-1,0)); CREATE TABLE t1 (a_dec DECIMAL(-2,1)); --error 1074 CREATE TABLE t1 (a_dec DECIMAL(-1,1)); + +# Zero prepend overflow bug +create table t1(a decimal(10,4)); +insert into t1 values ("+0000100000000"); +select * from t1; +drop table t1; -- cgit v1.2.1