Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
06c5e43c
Commit
06c5e43c
authored
Apr 14, 2005
by
konstantin@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A test case for Bug#4956 (decimal -> string conversion problem)
parent
31a49c3f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
mysql-test/r/type_decimal.result
mysql-test/r/type_decimal.result
+16
-0
mysql-test/t/type_decimal.test
mysql-test/t/type_decimal.test
+17
-0
No files found.
mysql-test/r/type_decimal.result
View file @
06c5e43c
...
...
@@ -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;
mysql-test/t/type_decimal.test
View file @
06c5e43c
...
...
@@ -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
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment