Commit 9b583225 authored by unknown's avatar unknown

A test case for Bug#4956 (decimal -> string conversion problem)


mysql-test/r/type_decimal.result:
  Test results (Bug#4956)
mysql-test/t/type_decimal.test:
  A test case for Bug#4956 "strange result, insert into longtext, parameter 
  with numeric value" (the bug itself is not repeatable any more).
parent 88e8c2a0
......@@ -748,3 +748,19 @@ HAVING a <> b;
i a b
6 -51.40 0.00
drop table t1;
create table t1 (c1 varchar(100), c2 longtext);
insert into t1 set c1= 'non PS, 1.0 as constant', c2=1.0;
prepare stmt from "insert into t1 set c1='PS, 1.0 as constant ', c2=1.0";
execute stmt;
set @a=1.0;
insert into t1 set c1='non PS, 1.0 in parameter', c2=@a;
prepare stmt from "insert into t1 set c1='PS, 1.0 in parameter ', c2=?";
execute stmt using @a;
select * from t1;
c1 c2
non PS, 1.0 as constant 1.0
PS, 1.0 as constant 1.0
non PS, 1.0 in parameter 1.0
PS, 1.0 in parameter 1.0
deallocate prepare stmt;
drop table t1;
......@@ -326,3 +326,20 @@ SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1 GROUP BY i HAVING a <> b;
SELECT i, ROUND(SUM(d1), 2) AS a, ROUND(SUM(d2), 2) AS b FROM t1 GROUP BY i
HAVING a <> b;
drop table t1;
#
# A test case for Bug#4956 "strange result, insert into longtext, parameter
# with numeric value": ensure that conversion is done identically no matter
# where the input data comes from.
#
create table t1 (c1 varchar(100), c2 longtext);
insert into t1 set c1= 'non PS, 1.0 as constant', c2=1.0;
prepare stmt from "insert into t1 set c1='PS, 1.0 as constant ', c2=1.0";
execute stmt;
set @a=1.0;
insert into t1 set c1='non PS, 1.0 in parameter', c2=@a;
prepare stmt from "insert into t1 set c1='PS, 1.0 in parameter ', c2=?";
execute stmt using @a;
select * from t1;
deallocate prepare stmt;
drop table t1;
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