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
26763a57
Commit
26763a57
authored
Dec 24, 2010
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
5.1-bugteam->5.5-bugteam merge
parents
c6b05a9a
b69b46c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
2 deletions
+29
-2
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+13
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+9
-0
sql/item_func.cc
sql/item_func.cc
+7
-2
No files found.
mysql-test/r/func_math.result
View file @
26763a57
...
...
@@ -501,6 +501,19 @@ SHOW WARNINGS;
Level Code Message
Warning 1292 Truncated incorrect DECIMAL value: ''
Error 1690 BIGINT value is out of range in '('123456789012345678901234567890.123456789012345678901234567890' DIV 1)'
#
# Bug#57810 case/when/then : Assertion failed: length || !scale
#
SELECT CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END;
CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END
NULL
CREATE TABLE t1 SELECT CAST((CASE(('')) WHEN (CONVERT(1, CHAR(1))) THEN (('' / 1)) END) AS CHAR) as C;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`C` varchar(23) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
End of 5.1 tests
#
# Bug #8433: Overflow must be an error
...
...
mysql-test/t/func_math.test
View file @
26763a57
...
...
@@ -336,6 +336,15 @@ select 123456789012345678901234567890.123456789012345678901234567890 div 1 as x;
select
"123456789012345678901234567890.123456789012345678901234567890"
div
1
as
x
;
SHOW
WARNINGS
;
--
echo
#
--
echo
# Bug#57810 case/when/then : Assertion failed: length || !scale
--
echo
#
SELECT
CASE
((
''
))
WHEN
(
CONVERT
(
1
,
CHAR
(
1
)))
THEN
((
''
/
1
))
END
;
CREATE
TABLE
t1
SELECT
CAST
((
CASE
((
''
))
WHEN
(
CONVERT
(
1
,
CHAR
(
1
)))
THEN
((
''
/
1
))
END
)
AS
CHAR
)
as
C
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
#
...
...
sql/item_func.cc
View file @
26763a57
...
...
@@ -1543,9 +1543,14 @@ void Item_func_div::fix_length_and_dec()
{
decimals
=
max
(
args
[
0
]
->
decimals
,
args
[
1
]
->
decimals
)
+
prec_increment
;
set_if_smaller
(
decimals
,
NOT_FIXED_DEC
);
max_length
=
args
[
0
]
->
max_length
-
args
[
0
]
->
decimals
+
decimals
;
uint
tmp
=
float_length
(
decimals
);
set_if_smaller
(
max_length
,
tmp
);
if
(
decimals
==
NOT_FIXED_DEC
)
max_length
=
tmp
;
else
{
max_length
=
args
[
0
]
->
max_length
-
args
[
0
]
->
decimals
+
decimals
;
set_if_smaller
(
max_length
,
tmp
);
}
break
;
}
case
INT_RESULT
:
...
...
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