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
02d7b276
Commit
02d7b276
authored
Jan 14, 2011
by
Tor Didriksen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #59498 div function broken in mysql-trunk
parent
43a2f80e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
3 deletions
+19
-3
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+6
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+5
-0
sql/item_func.cc
sql/item_func.cc
+8
-3
No files found.
mysql-test/r/func_math.result
View file @
02d7b276
...
...
@@ -650,3 +650,9 @@ SELECT ((@a:=@b:=1.0) div (@b:=@a:=get_format(datetime, 'usa')));
NULL
Warnings:
Warning 1366 Incorrect decimal value: '' for column '' at row -1
#
# Bug #59498 div function broken in mysql-trunk
#
SELECT 1 div null;
1 div null
NULL
mysql-test/t/func_math.test
View file @
02d7b276
...
...
@@ -495,3 +495,8 @@ DROP TABLE t1;
--
echo
# in do_div_mod with doubly assigned variables
--
echo
#
SELECT
((
@
a
:=@
b
:=
1.0
)
div
(
@
b
:=@
a
:=
get_format
(
datetime
,
'usa'
)));
--
echo
#
--
echo
# Bug #59498 div function broken in mysql-trunk
--
echo
#
SELECT
1
div
null
;
sql/item_func.cc
View file @
02d7b276
...
...
@@ -1582,10 +1582,15 @@ longlong Item_func_int_div::val_int()
args
[
1
]
->
result_type
()
!=
INT_RESULT
)
{
my_decimal
tmp
;
my_decimal
val0
=
*
args
[
0
]
->
val_decimal
(
&
tmp
);
my_decimal
val1
=
*
args
[
1
]
->
val_decimal
(
&
tmp
);
if
((
null_value
=
(
args
[
0
]
->
null_value
||
args
[
1
]
->
null_value
)))
my_decimal
*
val0p
=
args
[
0
]
->
val_decimal
(
&
tmp
);
if
((
null_value
=
args
[
0
]
->
null_value
))
return
0
;
my_decimal
val0
=
*
val0p
;
my_decimal
*
val1p
=
args
[
1
]
->
val_decimal
(
&
tmp
);
if
((
null_value
=
args
[
1
]
->
null_value
))
return
0
;
my_decimal
val1
=
*
val1p
;
int
err
;
if
((
err
=
my_decimal_div
(
E_DEC_FATAL_ERROR
&
~
E_DEC_DIV_ZERO
,
&
tmp
,
...
...
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