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
65e6ecb8
Commit
65e6ecb8
authored
Nov 28, 2005
by
ramil@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #12956: cast make differ rounding.
parent
511fbac4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
mysql-test/r/ps.result
mysql-test/r/ps.result
+7
-7
mysql-test/t/count_distinct3.test
mysql-test/t/count_distinct3.test
+1
-1
sql/item_func.cc
sql/item_func.cc
+1
-1
No files found.
mysql-test/r/ps.result
View file @
65e6ecb8
...
@@ -337,7 +337,7 @@ set @precision=10000000000;
...
@@ -337,7 +337,7 @@ set @precision=10000000000;
select rand(),
select rand(),
cast(rand(10)*@precision as unsigned integer) from t1;
cast(rand(10)*@precision as unsigned integer) from t1;
rand() cast(rand(10)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer)
- 65705152
19
- 65705152
20
- 1282061302
- 1282061302
- 6698761160
- 6698761160
- 9647622201
- 9647622201
...
@@ -348,23 +348,23 @@ prepare stmt from
...
@@ -348,23 +348,23 @@ prepare stmt from
set @var=1;
set @var=1;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19
-
- 65705152
20
-
- 1282061302 -
- 1282061302 -
- 6698761160 -
- 6698761160 -
- 9647622201 -
- 9647622201 -
set @var=2;
set @var=2;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19
6555866465
- 65705152
20
6555866465
- 1282061302 122346619
2
- 1282061302 122346619
3
- 6698761160 644973187
3
- 6698761160 644973187
4
- 9647622201 8578261098
- 9647622201 8578261098
set @var=3;
set @var=3;
execute stmt using @var;
execute stmt using @var;
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
rand() cast(rand(10)*@precision as unsigned integer) cast(rand(?)*@precision as unsigned integer)
- 65705152
19 9057697559
- 65705152
20 9057697560
- 1282061302 3730790581
- 1282061302 3730790581
- 6698761160 148086053
4
- 6698761160 148086053
5
- 9647622201 6211931236
- 9647622201 6211931236
drop table t1;
drop table t1;
deallocate prepare stmt;
deallocate prepare stmt;
...
...
mysql-test/t/count_distinct3.test
View file @
65e6ecb8
...
@@ -17,7 +17,7 @@ while ($1)
...
@@ -17,7 +17,7 @@ while ($1)
SET
@
rnd
=
RAND
();
SET
@
rnd
=
RAND
();
SET
@
id
=
CAST
(
@
rnd
*
@
rnd_max
AS
UNSIGNED
);
SET
@
id
=
CAST
(
@
rnd
*
@
rnd_max
AS
UNSIGNED
);
SET
@
id_rev
=
@
rnd_max
-
@
id
;
SET
@
id_rev
=
@
rnd_max
-
@
id
;
SET
@
grp
=
CAST
(
12
8
.0
*
@
rnd
AS
UNSIGNED
);
SET
@
grp
=
CAST
(
12
7
.0
*
@
rnd
AS
UNSIGNED
);
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
INSERT
INTO
t1
(
id
,
grp
,
id_rev
)
VALUES
(
@
id
,
@
grp
,
@
id_rev
);
dec
$
1
;
dec
$
1
;
}
}
...
...
sql/item_func.cc
View file @
65e6ecb8
...
@@ -735,7 +735,7 @@ longlong Item_func_numhybrid::val_int()
...
@@ -735,7 +735,7 @@ longlong Item_func_numhybrid::val_int()
case
INT_RESULT
:
case
INT_RESULT
:
return
int_op
();
return
int_op
();
case
REAL_RESULT
:
case
REAL_RESULT
:
return
(
longlong
)
real_op
(
);
return
(
longlong
)
rint
(
real_op
()
);
case
STRING_RESULT
:
case
STRING_RESULT
:
{
{
int
err_not_used
;
int
err_not_used
;
...
...
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