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
fa56a9d5
Commit
fa56a9d5
authored
Oct 26, 2005
by
hf@deer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional fix for bug #13573
parent
3f76925d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
9 deletions
+8
-9
sql/item_func.cc
sql/item_func.cc
+8
-9
No files found.
sql/item_func.cc
View file @
fa56a9d5
...
...
@@ -1124,6 +1124,7 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
{
my_decimal
value1
,
*
val1
;
my_decimal
value2
,
*
val2
;
int
err
;
val1
=
args
[
0
]
->
val_decimal
(
&
value1
);
if
((
null_value
=
args
[
0
]
->
null_value
))
...
...
@@ -1131,17 +1132,15 @@ my_decimal *Item_func_div::decimal_op(my_decimal *decimal_value)
val2
=
args
[
1
]
->
val_decimal
(
&
value2
);
if
((
null_value
=
args
[
1
]
->
null_value
))
return
0
;
switch
(
my_decimal_div
(
E_DEC_FATAL_ERROR
&
~
E_DEC_DIV_ZERO
,
decimal_value
,
val1
,
val2
,
prec_increment
))
{
case
E_DEC_TRUNCATED
:
case
E_DEC_OK
:
return
decimal_value
;
case
E_DEC_DIV_ZERO
:
signal_divide_by_null
();
default:
null_value
=
1
;
// Safety
if
((
err
=
my_decimal_div
(
E_DEC_FATAL_ERROR
&
~
E_DEC_DIV_ZERO
,
decimal_value
,
val1
,
val2
,
prec_increment
))
>
3
)
{
if
(
err
==
E_DEC_DIV_ZERO
)
signal_divide_by_null
();
null_value
=
1
;
return
0
;
}
return
decimal_value
;
}
...
...
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