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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
1fa7b95d
Commit
1fa7b95d
authored
Jun 22, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiplication of abs() by a negative value. (Bug #11402)
parent
53761ce0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+3
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+5
-0
sql/item_func.cc
sql/item_func.cc
+0
-3
No files found.
mysql-test/r/func_math.result
View file @
1fa7b95d
...
@@ -137,3 +137,6 @@ select * from t1;
...
@@ -137,3 +137,6 @@ select * from t1;
round(1, 6)
round(1, 6)
1.000000
1.000000
drop table t1;
drop table t1;
select abs(-2) * -2;
abs(-2) * -2
-4
mysql-test/t/func_math.test
View file @
1fa7b95d
...
@@ -71,3 +71,8 @@ create table t1 select round(1, 6);
...
@@ -71,3 +71,8 @@ create table t1 select round(1, 6);
show
create
table
t1
;
show
create
table
t1
;
select
*
from
t1
;
select
*
from
t1
;
drop
table
t1
;
drop
table
t1
;
#
# Bug #11402: abs() forces rest of calculation to unsigned
#
select
abs
(
-
2
)
*
-
2
;
sql/item_func.cc
View file @
1fa7b95d
...
@@ -914,10 +914,7 @@ void Item_func_abs::fix_length_and_dec()
...
@@ -914,10 +914,7 @@ void Item_func_abs::fix_length_and_dec()
max_length
=
args
[
0
]
->
max_length
;
max_length
=
args
[
0
]
->
max_length
;
hybrid_type
=
REAL_RESULT
;
hybrid_type
=
REAL_RESULT
;
if
(
args
[
0
]
->
result_type
()
==
INT_RESULT
)
if
(
args
[
0
]
->
result_type
()
==
INT_RESULT
)
{
hybrid_type
=
INT_RESULT
;
hybrid_type
=
INT_RESULT
;
unsigned_flag
=
1
;
}
}
}
...
...
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